	var animlance = 0;
	var listmenuanim="menu-item-41!menu-item-1320!menu-item-399!";
	
	jQuery(function() {
		var $tabs50_0 = jQuery("#tabs_50_0").tabs({ cookie: { expires: 30 } });
		//getter
		var cookie = jQuery("#tabs_50_0").tabs( "option", "cookie" );
		//setter
		jQuery("#tabs_50_0").tabs( "option", "cookie", { expires: 30 } );
		//fx for animation
		jQuery("#tabs_50_0").tabs({ fx: { opacity: 'toggle' } });
		//getter
		var fx = jQuery("#tabs_50_0").tabs( "option", "fx" );
		//setter
		jQuery("#tabs_50_0").tabs( "option", "fx", { opacity: 'toggle' } );
	});
	
	
	function finanim(){
		animlance=0;
	}

	  jQuery(document).ready(function() {
	  
		jQuery(".searchInput").focus(function(){
			// Select input field contents
			this.value="";
		});
		jQuery(".searchInput").blur(function(){
			// Select input field contents
			if(this.value==""){
				this.value="Rechercher";
			}
		});
		jQuery(".level-0 li a").click(function(event){
			if (jQuery(this).parent().attr("id").indexOf("menu-item-699")>=0){
				if ((jQuery(".searchInput").text()!="Rechercher") && (jQuery(".searchInput").text()!="")){
					event.preventDefault();
					//jQuery("#headerSearcher.searchForm").submit();
					window.location.href="http://"+window.location.hostname+"/?s="+jQuery('input[name$="s"]').val();
				}
			}
		});
		jQuery(".searchForm").submit(function() {
			//alert(jQuery('input[name$="s"]').val());
			  if ((jQuery(this).find('input[name$="s"]').val() == "") || (jQuery(this).find('input[name$="s"]').val() == "Rechercher")) {
				/*jQuery(this).find('input[name$="s"]').val("%");
				return true;*/
				alert("Veuillez saisir une valeur dans le champ de recherche");
				return false;
			  }
		});
		jQuery(".searchInput2").focus(function(){
			// Select input field contents
			this.value="";
		});
		jQuery(".searchInput2").blur(function(){
			// Select input field contents
			if(this.value==""){
				this.value="Rechercher";
			}
		});
		jQuery(".searchForm2").submit(function(event) {
			//alert(jQuery('input[name$="s"]').val());
			  if ((jQuery(this).find('input[name$="s"]').val() == "") && (jQuery(this).find('input[name$="s"]').val() == "Rechercher")){
				/*jQuery(this).find('input[name$="s"]').val("%");
				return true;*/
				alert("Veuillez saisir une valeur dans le champ de recherche");
				return false;
			  }else{
			  //post_type=page
					event.preventDefault();
					var swhere="";
					var i=0;
					while (jQuery('input[name$="post_type['+i+']"]').length != 0){
						if (jQuery('input[name$="post_type['+i+']"]').is(':checked')==true){
							if (swhere==""){
								swhere+=jQuery('input[name$="post_type['+i+']"]').val();
							}
							else{
								swhere+=","+jQuery('input[name$="post_type['+i+']"]').val();
							}
						}
						i++;
					}
					
					//jQuery("#headerSearcher.searchForm").submit();
					var urlretour="http://"+window.location.hostname+"/?s="+jQuery('.searchForm2 > input[name$="s"]').val();
					if (swhere!=""){
						urlretour+="&post_type="+swhere;
					}
					window.location.href=urlretour;
			  }
		});
		/*jQuery("#menu-item-capsule li").click(function() {
				jQuery(this).css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/menu_active.jpg") no-repeat scroll 0 0 transparent','height':'0px'});
				jQuery(this).animate({'height':'96px'},500,finanim);
		});*/
		//jQuery("#menu-menu.current-menu-item.level-0").css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/menu_active.jpg") no-repeat scroll 0 0 transparent','height':'0px'});
		var menuparent=jQuery(".current-menu-parent.niv-0").attr("id");
		var menuactif=jQuery(".current-menu-item.niv-0").attr("id");
		if(listmenuanim.indexOf(menuactif+"!")>=0){
	//		jQuery(".current-menu-item.niv-0").css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/menu_active.jpg") no-repeat scroll 0 0 transparent','height':'0px'});
			jQuery(".current-menu-item.niv-0").addClass('active');
			jQuery(".current-menu-item.niv-0").animate({'height':'96px'},{duration: 1000,easing: 'easeOutBounce'},finanim);
		}
			//alert(menuparent);
		if(listmenuanim.indexOf(menuparent+"!")>=0){
			jQuery(".current-menu-parent.niv-0").addClass('active parent');
			//jQuery(".current-menu-parent.niv-0").css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/menu_active.jpg") no-repeat scroll 0 0 transparent'});
			//jQuery(".current-menu-parent.niv-0").find("a").css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/blank.gif")'});
		}
		//alert(jQuery(".current-menu-parent.niv-0").attr("id"));
		//jQuery("#menu-menu,.current-menu-item,.niv-0").css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/menu_active.jpg") no-repeat scroll 0 0 transparent','height':'0px'});
		//jQuery("#menu-menu,.current-menu-item,.niv-0").animate({'height':'96px'},{duration: 1000,easing: 'easeOutBounce'},finanim);

		function afficheFond(){
			//var i=0;
			var object=this;
			if (jQuery(object).is("a")){
				var object=jQuery(this).parent();
			}
			//jQuery(object).stop();
			var tempid=jQuery(object).attr("id");
			if (jQuery(object).hasClass("current-menu-item")==false && jQuery(object).hasClass("current-menu-parent")==false && animlance==0 && listmenuanim.indexOf(tempid+"!")>=0){
				var elem = listmenuanim.split('!');
				i=0;
				var temp="";
				var temp2;
				while (i<elem.length-1){
					if (elem[i]!=tempid){
				  	  temp='#'+elem[i];
					  temp2=jQuery(object).parent();
					  temp2=temp2.find(temp);
						if (jQuery(temp2).hasClass("current-menu-item")==false){
							//jQuery(temp2).parent().find(temp).css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/blank.gif")'});
							jQuery(temp2).parent().find(temp).css({'background-color':'transparent'});
								jQuery(temp2).parent().find(temp).addClass('image_blank');
						}
					}
					i++;
				}
				
				animlance=1;
				jQuery(object).animate({'background-color':'#12ADE3'},500,finanim);				
				
				//event.stopImmediatePropagation(); 
			//jQuery(object).css({'display':'none','background-color':'#12ADE3'});
			//jQuery(object).fadeIn('slow');
			}
		}
		function enleveFond(){
			var object=this;
			
			if (jQuery(object).is("a")){
				var object=jQuery(this).parent();
			}
			if (jQuery(object).hasClass("current-menu-item")==false){
				jQuery(object).stop();
			}
			/*var elem = listmenuanim.split('!');
				i=0;
				var temp="";
				var temp2;
				while (i<elem.length-1){
					if (elem[i]!=tempid){
				  	  temp='#'+elem[i];
					  temp2=jQuery(object).parent();
					  temp2=temp2.find(temp);
						if (jQuery(temp2).hasClass("current-menu-item")==false){
							jQuery(temp2).parent().find(temp).css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/blank.gif")'});
						}
					}
					i++;
				}*/
			var temp=jQuery(object).attr("id");
			if (jQuery(object).hasClass("current-menu-item")==false && jQuery(object).hasClass("current-menu-parent")==false  && listmenuanim.indexOf(temp+"!")>=0){
				//jQuery(object).css({'background':'url("http://192.168.1.25/tempoconseil/wp-content/themes/tempo_conseil/images/blank.gif")'});
				jQuery(object).addClass('image_blank');
				jQuery(object).css({'background-color':'transparent'});
				jQuery(object).removeClass('active');
			}
			animlance=0;
			
			//jQuery(object).css({'display':'none','background-color':'#12ADE3'});
			//jQuery(object).fadeOut('slow');
		}
		
		jQuery("#menu-menu li:not(.current-menu-item)").mouseover(afficheFond);
		//jQuery("#menu-item-capsule a:not(.current-menu-item)").mouseover(afficheFond);
		
		jQuery("#menu-menu li").mouseleave(enleveFond);
		//jQuery("#menu-item-capsule a").mouseleave(enleveFond);
		
	  });
	



// BLOC ONGLET 

jQuery(document).ready(function() {
	jQuery(".annim").click(function () {
		jQuery('.ui-state-focus').animate({
   			width: '210px',
			opacity: '1'
		}, 2000);
	});
});
jQuery(document).ready(function() {
	jQuery('.ui-tabs-selected').animate({
		width: '210px',
		opacity: '1'
	}, 2000);
});
function affiche(ind) {
	jQuery(document).ready(function() {
		var cpt = "."+ind.toString();
		jQuery(cpt).animate({
   				width: '210px',
				opacity: '1'
			}, 2000);
	});
	var i = 0;
	while (i<6){
		if (ind != i) {
			var cpt = "."+i.toString();
			jQuery(cpt+" a").animate({
   				width: '180px'
			}, 2000);
		}
		i++;
	}
}


// BLOC ARRONDI
jQuery(document).ready(function() {
  
	jQuery('ul.corner li').each(function(index) {
		//  jQuery(this).corner("round 8px").parent().css('padding', '8px').corner("round 14px");
		jQuery(this).corner();
	});
  
 //jQuery('div.inner').corner("round 14px").parent().css('padding', '5px').corner("round 14px")
 /*<div class="outer">
<div class="inner">Cloud planning</div>
</div>*/ 
 
 
	jQuery("ul.corner li").hover(
		function () {
			jQuery(this).addClass("hover");
		},
		function () {
			jQuery(this).removeClass("hover");
		}
	);
 
 
  //.parent().css('padding', '8px').corner("round 10px");
  
  
  // gestion affichage inscription newsletter
	jQuery("#ico-inscriptionnewsletter").live('click', function(event) {
		var htmlprompt="";
		event.preventDefault();
		htmlprompt+="<iframe src=\"http://intelligentplanning.tempo-conseil.com/wp-content/themes/tempo_conseil/inscription_newsletter.php\" width=\"350\" height=\"130\" scrolling=\"no\" frameborder=\"0\"><p>Your browser does not support iframes.</p></iframe>";		
			var statesdemo = {
					state0: {
						html:htmlprompt,
						buttons: { Fermer: false},
						focus: 1,						
						submit:function(v,m,f){							
									return true;
						}
					}
			};
		result_validation=jQuery.prompt(statesdemo);		
	});
});
