
$(document).ready(function() {

		//capcha
		$(".capcha-img").click(function(e){
			$(this).find("img").attr("src" , $(this).attr("href") + "?" + $.now() );		
			return false;
		});


		 $(function() {
		      $('#slides').superslides({
		        hashchange: false,
				animation: "fade",
				pagination: false,
		        play: 5000
		      });

		    });


			function Counter(){

				var target = new Date($("#countdown").attr("data-date")); 
				var now = new Date();
				var difference = Math.floor((target.getTime() - now.getTime()) / 1000);

				var seconds = fixIntegers(difference % 60);
				difference = Math.floor(difference / 60);

				var minutes = fixIntegers(difference % 60);
				difference = Math.floor(difference / 60);

				var hours = fixIntegers(difference % 24);
				difference = Math.floor(difference / 24);

				var days = difference;

			
				$(".countdown #seconds").html(seconds);
	//			$(".countdown #seconds").css({top:"0px",opacity:0});
				//$(".countdown #seconds").animate({top:'-50px',opacity:1},500);
				
				$(".countdown #minutes").html(minutes);

				
				$(".countdown #hours").html(hours);

				
				$(".countdown #days").html(days);
			
			} Counter();

			setInterval(Counter, 1000); 



			function fixIntegers(integer) {
				if (integer < 0)
					integer = 0;
				if (integer < 10)
					return "0" + integer;
				return "" + integer;
			}
			

					
	
});
