$(document).ready(function() {
	$(".small_box").hover(
		 function () 
		 {
		 	$(this).css("cursor", "pointer");
		 	$(this).css("cursor", "hand");
	     	$(this).children("div.content").children("div.header").css("background", "url(./css/theme_komputerowiec/box_top_over.png) 0 0 no-repeat");
	     	$(this).children("div.content").css("background", "url(./css/theme_komputerowiec/box_content_over.png) 0 0 repeat-y");
	     	$(this).children("div.footer").css("background", "url(./css/theme_komputerowiec/box_bottom_over.png) 0 0 no-repeat");
	     }, 
	     function () 
	     {
	     	$(this).children("div.content").children("div.header").css("background", "url(./css/theme_komputerowiec/box_top.png) 0 0 no-repeat");
	     	$(this).children("div.content").css("background", "url(./css/theme_komputerowiec/box_content.png) 0 0 repeat-y");
	     	$(this).children("div.footer").css("background", "url(./css/theme_komputerowiec/box_bottom.png) 0 0 no-repeat");
	     }
	),
	$(".small_box").click(
		function(e)
		{
			$link = $(this).children("div.content").children("div.header").children("h3").children("a").attr("href");
			
			window.location = $link;
		}
	),
	$("#search_box").css("background","#b5dfec").css("border", "0").css("width", "210px").css("margin-top","4px").css("margin-left","10px").css("font-size","130%");
	$("#submit_send").css("border","0").css("width","94px").css("height","27px").css("background-image","url(./css/theme_komputerowiec/button_szukaj.png)");
	
	if ($("#cover_zoom_image").length > 0)
	{
		$("#cover_zoom_image").click(function(e){
			
			var documentHeight = $(document).height();
			var windowHeight = $(window).height();
			var windowWidth = $(window).width();
			
			var height = (($(window).height() + $(window).scrollTop()) - $("#cover_zoom_image_wrapper").height())/2 + $(window).scrollTop()/2;
			var width = (($(window).width() + $(window).scrollLeft()) - $("#cover_zoom_image_wrapper").width())/2 + $(window).scrollLeft()/2;
			$("#cover_zoom_image_wrapper").css("top", height+"px");
			$("#cover_zoom_image_wrapper").css("left", width+"px");
		
			$("#lightbox").css("height", documentHeight +"px");
			
			$("#lightbox").css("height", windowHeight +"px");
			$("#lightbox").css("filter", "alpha(opacity=50)");
			
			$("#lightbox").fadeIn(500, function(){
				$("#cover_zoom_image_wrapper").slideDown("slow");
			});
			
			e.preventDefault();
		});
		
		$("div.close_icon a").click(function(){
		
			$("#cover_zoom_image_wrapper").slideUp("fast", function(){
				$("#lightbox").fadeOut(500);
			});
			
			e.preventDefault();
		});
	}
});