// JavaScript Document
function infoCoupCoeur(){
	$(".blockSlide").mouseover(function(){
		var titreProd = $(this).find("img").attr("alt"); 
		$(this).append("<div class='infos'>"+titreProd+"</div>");
		$(".infos").css({"opacity":0.8,"height":"0px"});
		$(".infos").animate({"height":"25px"},"fast");
	});
	$(".blockSlide").mouseout(function(){
		$(".infos").remove();
	});
}

function fondBlockSelection(){
	$(".blockSelection").each(function(i){
		if(i%2==0){
			$(this).attr({"class":"blockSelection blanc"});
		}else{
			$(this).attr({"class":"blockSelection gris"});
		}					
	});
}

function supprItemSelection(){
	$(".btn-suppr").click(function(){
		$(this).parent("dl").parent("div").remove();
		fondBlockSelection();
	});	
}

function creationBulle(){
	$(".itemNav li").hover(function(){
		if($(this).attr("class")=="btn-renseignement"){
			var IdBulle = "bulle1";
		}else if($(this).attr("class")=="btn-visite"){
			var IdBulle = "bulle2";
		}else if($(this).attr("class")=="btn-selection"){
			var IdBulle = "bulle3";
		}else{
			var IdBulle = "bulle4";
		}
		
		var texteBulle = $(this).text();
		
		$(this).after("<div class='bulle' id='"+IdBulle+"'>"+texteBulle+"</div>");
		$(".bulle").css({"opacity":"0","marginTop":"-10px"});
		$(".bulle").animate({"opacity":"1","marginTop":"0"},300);
		
	},function(){
		$(".bulle").remove();
	});		
}

function verifModuleRecherche(){
	//verif module recherche
	$("#module-recherche input").focus(function(){
		$(this).css({"color":"#5a371c"});
		if($(this).val()!==""){
			if($(this).attr("class")=="budget1 inputPetit"){
				$(this).css({"background":"#ffffff url(../images/fd-budget1.gif) no-repeat top right"});
			}else if($(this).attr("class")=="budget2 inputPetit"){
				$(this).css({"background":"#ffffff url(../images/fd-budget2.gif) no-repeat top right"});
			}else{
				$(this).css({"background":"#ffffff"});
			}
		}
	});

	
	$(".formRechercheRight input").val("");
	$("#module-recherche input").blur(function(){
		$(this).css({"color":"#b36b33"});
		
		if($(this).val()!==""){
			if($(this).attr("class")=="budget1 inputPetit"){
				$(this).css({"background":"#e0dfdf url(../images/fd-budget1.gif) no-repeat top right"});
			}else if($(this).attr("class")=="budget2 inputPetit"){
				$(this).css({"background":"#e0dfdf url(../images/fd-budget2.gif) no-repeat top right"});
			}else{
				$(this).css({"background":"#e0dfdf"});
			}
		}
	});	
}

function couleurFormContact(){
	$(".monInput").focus(function(){
		$(this).css({"color":"#5a371c","background":"#ffffff"});										
	});
	$(".monInput").blur(function(){
		$(this).css({"color":"#b36b33","background":"#e0dfdf"});
	});	
}

