varPaging = 1;

$(document).ready(function(){	
	
	$("td.logo div.partners div").hover(
		function () {
			$(this).children("div.popup").show();
			
		},
		function () {
			$(this).children("div.popup").hide();
		}
	);	
	
	$('div#homeCycle').cycle({ 
		fx: 'scrollHorz',
		timeout: 8000,
		speed: 1100,
		pager: 'div#content div.paging div.pages',
        prev: 'div#content div.paging span.prev a',
        next: 'div#content div.paging span.next a',		
		before: 
			function() {  
				setTimeout("setSifr()", 1); 
			} 
	});
	$("div#content div.paging div.pages a:first").css("background","none");	
	
//	$("body.home div#content div.paging").hide();
	$("body.home div#content div.paging").css("height", "0");
	$("body.home div#content div.paging").css("display", "none");	
	
	//$("div#main div.twitter").toggleClass("off");
	$("body.programme div#main div.twitter").toggleClass("off"); 
	$("body.about div#main div.twitter").toggleClass("off"); 	
	
	if($.cookie('footer_state') == null){
		$.cookie('footer_state', 'on', {expires: 30});
		//alert($.cookie('footer_state'));
	}
	
	if($.cookie('footer_state') == 'off'){
		$("div#footer div.bottom div.hide").hide();
		$("div#footer div.bottom span.open").removeClass("hide");
	} else {
		$("div#footer div.bottom span.open").addClass("hide");
	}
	
	$("div#footer div.bottom span.close a").click(function () {	
	  $("div#footer div.bottom div.hide").toggle("fast");
	  $.cookie('footer_state', 'off', {expires: 30});
	  $("div#footer div.bottom span.open").removeClass("hide");
	  	  return false
	});
	
	$("div#footer div.bottom h4, div#footer div.bottom span.open").click(function () {	
	  $("div#footer div.bottom div.hide").toggle("fast");
	  if($.cookie('footer_state') == 'off'){
		  $.cookie('footer_state', 'on', {expires: 30});
		  $("div#footer div.bottom span.open").addClass("hide");
	  } else {
		  $.cookie('footer_state', 'off', {expires: 30});
		  $("div#footer div.bottom span.open").removeClass("hide");
	  }
	  	  return false
	});	
	
	$("div#main div.twitter a.close").click(function () {	
	  $("div#main div.twitter").toggleClass("off");
	  	  return false
	});	
	$("div#main div.twitter a.switch").click(function () {	
	  $("div#main div.twitter").toggleClass("off");
	  setSifrTwitter(); 
	  	  return false
	});		
	
	$("div.slideshow").hover(								 
		function () {
			//animate effect is pauze effect
			$("div#content div.paging").animate({opacity: 1.0}, 800);				
//			$("div#content div.paging").slideDown("fast");	
			$("div#content div.paging").animate({height: "29px"}, 300, function () {
				$("div#content div.paging").css("display", "block");
			});
		},
		function () {
			$("div#content div.paging").stop(true);
//			$("div#content div.paging").slideUp("fast");
			$("div#content div.paging").animate({height: "0"}, 300, function () {	
				$("div#content div.paging").css("display", "none");
			});
		}
	);
	
	$("div.galleryWrap").hover(								 
		function () {
			//animate effect is pauze effect
			$("div#content ul.gallery").animate({opacity: 1.0}, 800);
			$("div#content ul.gallery").animate({top: "175px"}, 500 );	
		},
		function () {	
			$("div#content ul.gallery").stop(true);
    		$("div#content ul.gallery").animate({top: "288px"}, 500 );			
		}
	);	
	$("a.movePhoto").mouseover(function () {	
		$("div#content ul.gallery").stop(true);
		$("div#content ul.gallery").animate({top: "175px"}, 500 );	
	});	
	$("a.moveVideo").mouseover(function () {	
		$("div#content ul.gallery").stop(true);
		$("div#content ul.gallery").animate({top: "175px"}, 500 );	
	});		
	$("a.movePhoto").click(function () {			
		$("div#content ul#gallery").removeClass("videoOn");	
		$("div#content ul#gallery").addClass("photoOn");			
	});	
	$("a.moveVideo").click(function () {			
		$("div#content ul#gallery").removeClass("photoOn");	
		$("div#content ul#gallery").addClass("videoOn");			
	});
	
	$("#sponsor_footer").cycle('fade');
	
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 20, /* padding for each side of the picture */
		opacity: 0.70, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});



});




	
	

