$(function() {
			$('a[rel=lightbox]').lightBox(); 
			});

$(document).ready(function() {

		$("form[name=contact]").validate({
			  highlight: function(element) {
		    $(element).addClass("errorClass").removeClass("validClass");
		 },
		 unhighlight: function(element) {
		    $(element).removeClass("errorClass").addClass("validClass");
		 },
		 
		 submitHandler: function(form) {
			 
			 $.ajax({  
			   type: "GET",  
			   url: "http://www.poezja.waw.pl/site/send_email",
			   data: {name : $("input#name").val(), email : $("input#email").val(), phone : $("input#phone").val(), message : $("textarea#message").val()},  
			   success: function() {  
			     $('#contact_form').html("<div id='message'></div>");  
			     $('#message').html("<h2>Zapytanie wysłane!</h2>")  
			     .append("<p>Postaramy się odpowiedzieć w ciągu 24 godzin.</p>")  
			     .hide().fadeIn(1500)  
			     
			   }  
			 });  
			 return false;  
			 
		 }
		});
				

		$("#o_nas_over").hide();
		$("#menu_over").hide();
		$("#karta_win_over").hide();
		$("#recenzje_over").hide();
		$("#galeria_over").hide();
		$("#kontakt_over").hide();

		$("table#karta_dan img").hover(function() {
			$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
			$(this).addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
				.animate({
					marginTop: '-40px', /* The next 4 lines will vertically align this image */ 
					marginLeft: '-75px',
					top: '50%',
					left: '50%',
					width: '145px', /* Set new width */
					height: '97px', /* Set new height */
					padding: '5px'
				}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

			} , function() {
			$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
			$(this).removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
				.animate({
					marginTop: '0', /* Set alignment back to default */
					marginLeft: '0',
					top: '0',
					left: '0',
					width: '95px', /* Set width back to default */
					height: '63px', /* Set height back to default */
					padding: '3px'
				}, 400);
		});
		
		$("#o_nas").mouseover(
		  function () {
			 $(this).hide(); 
		    $("#o_nas_over").show();
		  }
		);
		$("#o_nas_over").mouseout( 
				  function () {
					  $(this).hide(); 
					    $("#o_nas").show();  
			  });

		$("#menu").mouseover(
				  function () {
					 $(this).hide(); 
				    $("#menu_over").show();
				  }
				);
		$("#menu_over").mouseout( 
						  function () {
							  $(this).hide(); 
							    $("#menu").show();  
					  });
		$("#karta_win").mouseover(
				  function () {
					 $(this).hide(); 
				    $("#karta_win_over").show();
				  }
				);
		$("#karta_win_over").mouseout( 
						  function () {
							  $(this).hide(); 
							    $("#karta_win").show();  
					  });
		$("#recenzje").mouseover(
						  function () {
							 $(this).hide(); 
						    $("#recenzje_over").show();
						  }
						);
		$("#recenzje_over").mouseout( 
								  function () {
									  $(this).hide(); 
									    $("#recenzje").show();  
							  });
		$("#galeria").mouseover(
				  function () {
					 $(this).hide(); 
				    $("#galeria_over").show();
				  }
				);
		$("#galeria_over").mouseout( 
						  function () {
							  $(this).hide(); 
							    $("#galeria").show();  
					  });
		$("#kontakt").mouseover(
				  function () {
					 $(this).hide(); 
				    $("#kontakt_over").show();
				  }
				);
		$("#kontakt_over").mouseout( 
						  function () {
							  $(this).hide(); 
							    $("#kontakt").show();  
					  });

		$('#s2') 
		.after('<div id="nav">') 
		.cycle({ 
		    fx:     'scrollHorz', 
		    speed:  500, 
		    timeout: 0,    
		    pager:  '#nav' 
		});
				  
	});
