function activateclick(ctrId)
{
    var btnRechAv = document.getElementById(ctrId);
	btnRechAv.click();
}

function AfficherSiBesoinEnvoiMail()
{
var bnafficheEnvoiMail = document.getElementById('ctl00_AfficherEnvoiMail');
if(bnafficheEnvoiMail.Value == "1")
    showpopupemail();
else
    closepopupemail();

}

function showpopupemail()
{
$(".popup_mail").show();
$(".fond_gris").show();
}

function closepopupemail()
{
$(".popup_mail").hide();
$(".fond_gris").hide();
}


$(document).ready(function(){

	/*$(".onglet-home img:last").hover(function(){
		$(this).attr("src",$(this).attr("src").replace("_off","_on"));		
	},function(){
		$(this).attr("src",$(this).attr("src").replace("_on","_off"));
	});*/
	
	/* gestion des boutons de home */
	$(".ssmenuhome li").click(function(){
		$(this).children("a").attr("href","#");
		$(".ssmenuhome li div").hide();
		$(".bchome_selection").hide();
		$(".bchome").hide();
		$(this).children("div").show();
		if($(this).attr("class")=="rub01"){
			$(".retraite").show();	
		}
		if($(this).attr("class")=="rub02"){
			$(".prevoyance").show();	
		}
		if($(this).attr("class")=="rub03"){
			$(".epargne").show();	
		}
		if($(this).attr("class")=="rub04"){
			$(".sante").show();	
		}
		if($(this).attr("class")=="rub05"){
			$(".assurances").show();	
		}
		if($(this).attr("class")=="rub06"){
			$(".service").show();	
		}
	});
	
	/* gestion des popup */
	$(".suite a").click(function(){
		$(this).attr("href","#");
		$(this).removeAttr("target");
		$(".popup_find_agence").show();
		$(".fond_gris").show();
	});
		$(".zoom a").click(function(){
		$(this).attr("href","#");
		$(this).removeAttr("target");
		$(".popup_carte_agence").show();
		$(".fond_gris").show();
	});
	$(".bt_conseiller").click(function(){
		$(this).children("a").attr("href","#");
		$(this).children("a").removeAttr("target");
		
		$(".popup_conseil").show();
		$(".fond_gris").show();
	});

	$(".lien_rappel").click(function(){
		$(".popup_find_agence").hide();
		$(".popup_conseil").show();
		$(".fond_gris").show();
	});

	$(".lien_question").click(function(){
		$(".popup_find_agence").hide();
		$(".popup_question").show();
		$(".fond_gris").show();
	});
	
	$(".popup_conseil .bt_bas").click(function(){
		$(".popup_conseil").hide();
		$(".popup_recap_conseil").show();
		$(".fond_gris").show();
	});
	
	$(".popup_question .bt_bas").click(function(){
		$(".popup_question").hide();
		$(".popup_recap_question").show();
		$(".fond_gris").show();
	});

/*
	$(".popup_mail .bt_bas").click(function(){
		$(".popup_mail").hide();
		$(".popup_recap_mail").show();
		$(".fond_gris").show();
	});
*/
	/*$("li.envoyer a").click(function(){
		$(".popup_mail").show();
		$(".fond_gris").show();
	});*/


	/*$(".bt_fermer").click(function(){
		$(".popup_mail").hide();
		$(".fond_gris").hide();
	});*/
/*
	$(".bt_fermer").click(function(){
		$(this).parent("div").hide();
		$(".fond_gris").hide();
	});
*/	
	
	$(".pop_bt_fermer").click(function(){
		$(".popup_recap").hide();
		$(".fond_gris").hide();
	});

	
	/* effacement de la valeur des champs	*/

	$("input").focus(function(){
		if($(this).attr("name")=="ctl00$toolbox1$recherche" ||$(this).attr("name")=="ctl00$toolbox$recherche" || $(this).attr("name")=="tel" || $(this).attr("name")=="toolbox$recherche"){
			$(this).attr("value","");
		}
	}); 
	
	/* gestion de la taille des polices */
	$(".aplus a").click(function(){
		taille_police_actuel=parseInt($(".global").css("font-size"));
		taille_police_modifiee=parseInt($(".global").css("font-size"))+1;		
		if($.browser.msie) { 
			taille_police_modifiee=parseInt($(".global").css("font-size"))+1+"%";
		}
		$(".global").css("font-size",taille_police_modifiee)

	});
	$(".amoins a").click(function(){
		taille_police_actuel=parseInt($(".global").css("font-size"));
		taille_police_modifiee=parseInt($(".global").css("font-size"))-1;
		if($.browser.msie) {
			taille_police_modifiee=parseInt($(".global").css("font-size"))-1+"%";
		}
		$(".global").css("font-size",taille_police_modifiee)
	});
	
	/* gestion de l'acces client */
	$("li.acces").hover(function(){
		$("li.acces .ssmenu_acces").show();
	},function(){
		$("li.acces .ssmenu_acces").hide();
	});

	/* gestion de l'impression */
	$("p.lien_imprimer a").click(function(){
		window.print();					 
	});

	/* ouverture popup print */
	$("li.imprimer a").click(function(){
		window.open(window.location,"print","scrollbars=yes, width=595, height=600");
		this.blur();
		return(false);
	});

	if($.browser.msie)
	{
		if(window.name == "print")
		{
			document.getElementsByTagName("link")[1].setAttribute("media","all");
		}
	}
	else
	{
		if(window.name == "print")
		{
			$("#print").remove();
			$("head").append('<link href="css/pop.css" rel="stylesheet" type="text/css" media="all" />');
		}
	}

	/* gestion carte */
	$("map *").Tooltip({
		track:true,
		delay:0,
		showURL:false,
		event:"click"
		
	});
	
	$(".zone_1").mouseover(function(){
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_1.gif" usemap="#grandcarte_map" height="290" width="277" />');				
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_1.gif');				
	});
	$(".zone_2").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_2.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_2.gif" usemap="#grandcarte_map" height="290" width="277" />');
	});
	$(".zone_3").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_3.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_3.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_4").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_4.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_4.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_5").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_5.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_5.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_6").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_6.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_6.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_7").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_7.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_7.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_8").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_8.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_8.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".zone_9").mouseover(function(){
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_9.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_9.gif" usemap="#grandcarte_map" height="290" width="277" />');	
	});
	$(".france").mouseout(function(){
	
		$(".france span img").attr('src', 'img/carte_decoupe/carte_zone_0.gif');	
		//$(".france span").html('<img alt="Carte AG2R assurance France" src="img/carte_decoupe/carte_zone_0.gif" usemap="#grandcarte_map" height="290" width="277" />');				
	});
	
	/* lien rollover */
	$(".votre_agence a").mouseover(function(){
		$(".votre_agence h4").css("text-decoration","underline");			
	});
	$(".votre_agence a").mouseout(function(){
		$(".votre_agence h4").css("text-decoration","none");
		
	});
	$(".conseiller").mouseover(function(){
		$(".conseiller h3").css("text-decoration","underline");
		$(".conseiller").css("cursor","pointer");
	});
	$(".conseiller").mouseout(function(){
		$(".conseiller h3").css("text-decoration","none");			
	});
	$(".bloc1").mouseover(function(){
		$(".bloc1 h4").css("text-decoration","underline");			
	});
	$(".bloc1").mouseout(function(){
		$(".bloc1 h4").css("text-decoration","none");			
	});
	$(".bloc2").mouseover(function(){
		$(".bloc2 h4").css("text-decoration","underline");			
	});
	$(".bloc2").mouseout(function(){
		$(".bloc2 h4").css("text-decoration","none");			
	});
	$(".bloc3").mouseover(function(){
		$(".bloc3 h4").css("text-decoration","underline");			
	});
	$(".bloc3").mouseout(function(){
		$(".bloc3 h4").css("text-decoration","none");			
	});

	
	$(".votre_agence").mouseover(function(){
		$(".votre_agence h3").css("text-decoration","underline");
		$(".votre_agence a").css("text-decoration","underline");
	});
	$(".votre_agence").mouseout(function(){
		$(".votre_agence h3").css("text-decoration","none");
		$(".votre_agence a").css("text-decoration","none");
	});

});