$(document).ready(function() {
	

	setTimeout(function(){$('#slider .flashSlide').css({'background-color': '#fff','background-image': 'none'});},8000);	
	$("#menus li a:first").addClass("noBack");
	$("#menus li:not(li.current_page_item) a").addClass("notCurrentPage");
	$("form.wpcf7-form").jqTransform();
        
	Cufon.replace('.wpcf7-form');
	Cufon.replace('#footerleft li a',{hover: {color: '#9f9f9f'}});
	Cufon.replace('#menus li a.notCurrentPage', {textShadow: '#fff 0px 1px 0px', color:'#155E63' });
	Cufon.replace('#menus li.current_page_item a, #menus li.current_page_parent a', {textShadow: '#4a8e93 0px 1px 5px', color:'#ffffff'});
	Cufon.replace('.contentSlide h2', {textShadow: '#136265 0px -1px 0px'});	
	Cufon.replace('h3:not(.prodtitles), .post h2, #fbComments');
	Cufon.replace('.post .content-bar h1');
	Cufon.replace('.post p strong.first', {color:'#155D63'});
	Cufon.replace('#menuLeft h1', {textShadow: '#135459 0px -1px 0px'});
	Cufon.replace('.post #menuLeftContent h2', {textShadow: '#063033 0px -1px 0px'});

	$('.arrowslide').click(function() {
	  if ($('.contentSlide').css("marginTop")=="-145px"){
	  	$('.contentSlide').animate({
	  	  marginTop: '0px'
	  	}, 400, function() {	    
	  	  $('.arrowslide').animate({
	  	    backgroundPosition: '245px 0px'
	  	  }, 300);
	  	});
	  	$('.shadow').fadeIn("500");
	  }
	  else {
		  $('.shadow').fadeOut("500");
		  $('.contentSlide').animate({
		    marginTop: '-145px'
		  }, 400, function() {	    
		    $('.arrowslide').animate({
		      backgroundPosition: '245px -11px'
		    }, 300);
		  });
	  }
	});
	
	$("#content1").hover(function(){if ($('.contentSlide').css("marginTop")=="0px"){$(this).css({backgroundPosition: "0px 160px",color:"#cff4f6"});}},function(){$(this).css({backgroundPosition: "0px 0px",color:"#85B1B3"});});
	$("#content2").hover(function(){if ($('.contentSlide').css("marginTop")=="0px"){$(this).css({backgroundPosition: "-315px 160px",color:"#cff4f6"});}},function(){$(this).css({backgroundPosition: "-315px 0px",color:"#85B1B3"});});
	$("#content3").hover(function(){if ($('.contentSlide').css("marginTop")=="0px"){$(this).css({backgroundPosition: "-612px 160px",color:"#cff4f6"});}},function(){$(this).css({backgroundPosition: "-612px 0px",color:"#85B1B3"});});
	$("#content1").click(function(){window.location.href="http://www.institut-top-ongles.fr/institut-beaute-top-ongles/";});
	$("#content2").click(function(){window.location.href="http://www.institut-top-ongles.fr/nouveautes/actualites/";});
	$("#content3").click(function(){window.open("http://www.facebook.com/TopOngles");});
	$("#btnvisage,#btncorps,#btnmains,#btnbronzage,#btnmaquillage,#btndivers").hover(function(){$(this).css({backgroundPosition: "0 34px"});},function(){$(this).css({backgroundPosition: "0px 0px"});});
	$("#menuLeftContent li a").not($("#menuLeftContent li.current_page_item a")).hover(function() {
	$(this).stop().animate({color: "#fff"},"fast");
	        },function(){
	              $(this).stop().animate({color: "#9ED0D3"},"fast");
	});
	$("h3.prodtitles").click(function(){		
		if ($(this).hasClass("selected")){} 
		else {
			if ($(".wpsc_description.selected").size()){  // si un element est déjà ouvert				
				$clicked = $(this);
				$openedTitle = $("h3.prodtitles.selected");
				$opened = $(".wpsc_description.selected");
				$opened.slideUp(400,function(){$clicked.next().slideDown(400);});		
				$openedTitle.removeClass("selected");$opened.removeClass("selected");
				$openedTitle.children("span.showmemore").fadeIn(400);
			}
			else $(this).next().slideDown(400)			
			$(this).addClass("selected");$(this).next().addClass("selected");
			$(this).children("span.showmemore").fadeOut(400);
		}	
	});
	if(jQuery.browser.version.substr(0,3)=="1.9"){
	    $(".jqTransformInputInner div input").css({paddingTop: "0px"});
	    $("button.jqTransformButton span span").css({paddingTop: "10px"});
	    $("button.jqTransformButton span span").css({height: "23px"}); 
	}
	$("#mapp0_poweredby").css({display:"none"});
	$("#btnvisage").click(function(){window.location.href="nos-soins/le-visage/"});
	$("#btncorps").click(function(){window.location.href="nos-soins/le-corps/"});
	$("#btnmains").click(function(){window.location.href="nos-soins/les-mains-et-les-pieds/"});
	$("#btnbronzage").click(function(){window.location.href="nos-soins/bronzage-u-v/"});
	$("#btnmaquillage").click(function(){window.location.href="nos-soins/maquillage-et-produits/"});
	$("#btndivers").click(function(){window.location.href="nos-soins/divers/"});	
	
	$("#menuLeftContent li").click(function(){
		$("#menuLeftContent li.current_page_item").removeClass("current_page_item");
		$(this).addClass("liClickedleft current_page_item");		
		});
	 
	 
	 setTimeout(function(){$(".FBConnectButton_Text").html("J'aime ça !").delay("100"); $(".hiddenfb").fadeIn("slow");},1500);
	
});
