$(function(){
//Search
	var sTxt="Recherche ...";
	$("#s").attr("value",sTxt).addClass("sFocus")
		.focus(function(){if($(this).val()==sTxt)$(this).val('').removeClass("sFocus").addClass("sBlur")})
		.blur(function(){if ($(this).val()=='')$(this).val(sTxt).removeClass("sBlur").addClass("sFocus")});
	$("#searchsubmit").attr("value","")
//Menu
	$('#nav_main ul').lavaLamp({fx:'easeInOutCubic',speed:400,returnHome:false});
//Widget Suggestion
	$('#wpcf7-f4-w3-o1').addClass('clearfix');
//prettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});
//Contact Form
	$(".contact-click").click(function(){$("#contact_wrap").slideToggle("slow");});
//Animations	
	var navDuration=500;var navJumpHeight="25px";var navJumpHeight2="3px";
	$("#logo_relook").hover(function(){$("#portail_relook").css("color","#69b8e8").stop().animate({top:"-="+navJumpHeight},navDuration,'easeOutExpo');},
								function(){$("#portail_relook").css("color","#fff").stop().animate({top:"70px"},navDuration,'easeOutBounce');});
	$("#logo_consult").hover(function(){$("#portail_consult").css("color","#c92955").stop().animate({top:"-="+navJumpHeight},navDuration,'easeOutExpo');},
								function(){$("#portail_consult").css("color","#fff").stop().animate({top:"177px"},navDuration,'easeOutBounce');});
	var arr=['France3','MarieClaire','Vivolta','MidiLibre','Nouvelles'];
	jQuery.each(arr, function(){$('"img[alt*=\"'+this+'\"]"').hover(function(){$(this).stop().animate({top:"-="+navJumpHeight2},100,'easeOutExpo');},
																	function(){$(this).stop().animate({top:"0px"},100);});});
//Diaporama
	$("#diapo").tabs({fx:{opacity:"toggle"}}).tabs("rotate",5000,true);
//ToopTip
	$("#tarifs1 img[title],#tarifs2 img[title]").tooltip({tip:'.tooltip1',effect:'slide'});
	$(".hello3").tooltip({tip:'.tooltip2',effect:'slide'});
//Rotator
	var qR="#quoterotator>div";
	function start_rotating(){var total_elements=$(qR).length;var starting_number=Math.ceil(Math.random()*total_elements);
							$(qR).hide();$(qR+':nth-child('+starting_number+')').show().addClass('active');
							show_timer1 = setTimeout(function(){continue_rotating()},5000);}
	function continue_rotating(){var element=$(qR+'.active').next();
		if ($(element).parent().attr('id')!='quoterotator'){element=$(qR+':first');}
		$(qR+'.active').hide().removeClass('active');$(element).fadeIn(2000).addClass('active');
		show_timer1=setTimeout(function(){continue_rotating()},5000);}
	if($('#quoterotator').length){start_rotating();}
//Partenaires
	$('#text-9').addClass('clearfix');
	$('.bubbleInfo').each(function(){
	var distance=10,time=30,hideDelay=200,hideDelayTimer=null,beingShown=false,shown=false,trigger=$('.trigger',this),info=$('.popup',this).css('opacity',0);
	$([trigger.get(0),info.get(0)]).mouseenter(function(){if (hideDelayTimer) clearTimeout(hideDelayTimer);
	if (beingShown || shown){//don't trigger the animation again
	return;}else{//reset position of info box
	beingShown=true;
	info.css({top:-90,left:-115,display:'block'}).animate({top:'-='+distance+'px',opacity:1},time,'swing',function(){
	beingShown=false;shown=true;});}return false;}).mouseleave(function(){
	if (hideDelayTimer) clearTimeout(hideDelayTimer);hideDelayTimer=setTimeout(function(){hideDelayTimer=null;
	info.animate({top:'-='+distance+'px',opacity:0},time,'swing',function(){shown=false;info.css('display','none');});},hideDelay);
	return false;});}); 
});