/* fonction paramètre URL */

function findUrl(txt)
{
  var url=window.location.href;
  var urlSplit=url.split(/[?&]/);
  for (var i=1; i<urlSplit.length; i++) 
   if (urlSplit[i].indexOf(txt + "=") > -1 )
   {
    var aParam = urlSplit[i].split("=");
    return aParam[1];
   }
  return "";
 }
// Paramètre pour le hearde dynamique
function findUrlIframe(txt)
{
  var url=window.parent.location.href;
  var urlSplit=url.split(/[?&]/);
  for (var i=1; i<urlSplit.length; i++) 
   if (urlSplit[i].indexOf(txt + "=") > -1 )
   {
    var aParam = urlSplit[i].split("=");
    return aParam[1];
   }
  return "";
 }
 /* fonction paramètre URL POUR UN IFRAME*/
function menuH(){
			switch(note){
			case '1' :document.getElementById('menu1').className="menu-selection1";break;
			case '2' :document.getElementById('menu2').className="menu-selection";break;
			case '3' :document.getElementById('menu3').className="menu-selection";break;
			case '4' :document.getElementById('menu4').className="menu-selection";break;
			case '5' :document.getElementById('menu5').className="menu-selection";break;
			case '6' :document.getElementById('menu6').className="menu-selection";break;
			case '7' :document.getElementById('menu7').className="menu-selection";break;
			default :document.getElementById('menu1').className="menu-selection1";}
}

// function evoie email
function bodyOnLoad()
{
IsEmailOk('Votre inscription a bien %E9t%E9 prise en compte.', 'Une erreur est survenue, veuillez r%E9essayer ult%E9rieurement.');
}

//function pour les onglets page produit
function changeCouleurInit(ta,tp,tb,tc)
{
document.getElementById(ta).className=tp;
document.getElementById(tb).className=tc;
}
//foncion pour le changement d'images du menu de la page produit
function changeCouleur(ta,to,tb,tc,tu,tp,te,ti,tz,tr)
{
document.getElementById(ta).className=tp;
document.getElementById(to).className=te;
document.getElementById(tb).className=ti;
document.getElementById(tc).className=tz;
document.getElementById(tu).className=tr;
}
function changeCouleur2(ta,to,tb,tc,tu,tp,te,ti,tz,tr)
{
document.getElementById(ta).className=tp;
document.getElementById(to).className=te;
document.getElementById(tb).className=ti;
document.getElementById(tc).className=tz;
document.getElementById(tu).className=tr;
}
// fonction pour le changement de titre, passe de FORMULE à OPTION et affiche ou cache l'onglet Cure

//fonction page derniere minute pour afficher ou cacher une div ID
function display(divcache, divaffiche)
{
	document.getElementById(divcache).style.display="none";
	document.getElementById(divaffiche).style.display="block";
}
//function pour les onglets de la page dm j-14
function changeColor()
{
	document.getElementById("j-7").innerHTML="<img src='/images/derniere-minute/j-7.jpg' onmouseout='this.src=\"/images/derniere-minute/j-7.jpg\"' onmouseover='this.src=\"/images/derniere-minute/j-7_hover.jpg\"'/>";
	document.getElementById("j-14").innerHTML="<img src='/images/derniere-minute/j-14_hover.jpg'/>";
}
//function pour les onglets de la page dm j-7
function changeColor2()
{
	document.getElementById("j-7").innerHTML="<img src='/images/derniere-minute/j-7_hover.jpg'/>";
	document.getElementById("j-14").innerHTML="<img src='/images/derniere-minute/j-14.jpg' onmouseout='this.src=\"/images/derniere-minute/j-14.jpg\"' onmouseover='this.src=\"/images/derniere-minute/j-14_hover.jpg\"'/>";
}
//fonction page OP pour afficher ou cacher une div ID
function display1(divcache1,divcache2, divaffiche)
{
	document.getElementById(divcache1).style.display="none";
	document.getElementById(divcache2).style.display="none";
	document.getElementById(divaffiche).style.display="block";
	
}


// FONCTION POUR LE DIAPORAMA DEROULANT DE LA PAGE PRODUIT RESIDENCE

var scrollTimer_1;
var scrollTimer2_1;
var scrollPas_1 = 10;
var scrollNB_1;

function stopScroll_1() 
{
	if(scrollTimer_1)clearTimeout(scrollTimer_1);
}
// stop scrolling autiomatique
function stopScroll2_1() 
{
	if(scrollTimer2_1)clearTimeout(scrollTimer2_1);
}
// go scrolling fleche
function scrollUp_1(px) 
{
	var div = document.getElementById("diapoScroll");
	div.scrollLeft = div.scrollLeft+px;
	scrollTimer_1 = setTimeout("scrollUp_1("+px+")", 30);
}
// go scrolling forward automatique
function scrollF_1() 
{
	if(scrollNB_1 <= 0)
		stopScroll2_1();
	else
	{
		var div = document.getElementById("diapoScroll");
		div.scrollLeft = div.scrollLeft+scrollPas_1;
		scrollNB_1--;
		scrollTimer2_1 = setTimeout("scrollF_1()", 30);
	}
}
// go scrolling backward automatique
function scrollB_1() 
{
	if(scrollNB_1 <= 0)
		stopScroll2_1();
	else
	{	
		var div = document.getElementById("diapoScroll");
		div.scrollLeft = div.scrollLeft-scrollPas_1;
		scrollNB_1--;
		scrollTimer2_1 = setTimeout("scrollB_1()", 30);
	}
}
// FONCTION POUR LE DIAPORAMA DEROULANT DE LA PAGE PRODUIT STATION

var scrollTimer_2;
var scrollTimer2_2;
var scrollPas_2 = 10;
var scrollNB_2;

function stopScroll_2() 
{
	if(scrollTimer_2)clearTimeout(scrollTimer_2);
}
// stop scrolling autiomatique
function stopScroll2_2() 
{
	if(scrollTimer2_2)clearTimeout(scrollTimer2_2);
}
// go scrolling fleche
function scrollUp_2(px) 
{
	var div = document.getElementById("diapoScroll_st");
	div.scrollLeft = div.scrollLeft+px;
	scrollTimer_2 = setTimeout("scrollUp_2("+px+")", 30);
}
// go scrolling forward automatique
function scrollF_2() 
{
	if(scrollNB_2 <= 0)
		stopScroll2_2();
	else
	{
		var div = document.getElementById("diapoScroll_st");
		div.scrollLeft = div.scrollLeft+scrollPas_2;
		scrollNB_2--;
		scrollTimer2_2 = setTimeout("scrollF_2()", 30);
	}
}
// go scrolling backward automatique
function scrollB_2() 
{
	if(scrollNB_2 <= 0)
		stopScroll2_2();
	else
	{	
		var div = document.getElementById("diapoScroll_st");
		div.scrollLeft = div.scrollLeft-scrollPas_2;
		scrollNB_2--;
		scrollTimer2_2 = setTimeout("scrollB_2()", 30);
	}
}
function changeOnglet(a,b,c,d,e,f,g,h){
		document.getElementById(a).className=b;
		document.getElementById(c).className=d;
		document.getElementById(e).className=f;
		document.getElementById(g).className=h;
}

// fonction pour le menu sur la HP
function slide(a,b,c,d){
	document.getElementById(a).style.display="block";
	document.getElementById(b).style.display="none";
	document.getElementById(c).style.display="none";
	document.getElementById(d).style.display="none";
}
function slide2(a,b,c){
	document.getElementById(a).style.display="block";
	document.getElementById(b).style.display="none";
	document.getElementById(c).style.display="none";
}
//function pour afficher le lire la suite dans la page produit
function opendiv(id,id2){
	if (document.getElementById(id).style.height != ""){
		document.getElementById(id).style.height="";
		document.getElementById(id2).innerHTML="Masquer la suite";
	}
	else
	{
		document.getElementById(id).style.height="153px";
		document.getElementById(id2).innerHTML="Lire la suite";	
	}
	
}
function cacheshow(div){
	if (document.getElementById(div).style.display=='none')
		{
		document.getElementById(div).style.display='block';	
		}
	else
		{
		document.getElementById(div).style.display='none';	
		}
}
function cacheshowImg(div,divimg,srchover,src){
	if (document.getElementById(div).style.display=='none')
		{
		document.getElementById(div).style.display='block';	
		document.getElementById(divimg).src =srchover;
		}
	else
		{
			document.getElementById(div).style.display='none';	
		document.getElementById(divimg).src =src;
		}
}
function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre)
{
window.open (nom_de_la_page, nom_interne_de_la_fenetre, config='top=400, left=400, height=450, width=600, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}
//fonction pour remplacer des parametre dans un chaine
function str_replace(cherche,remplace,chaine)
{   
  		while(chaine.indexOf(cherche)>-1)	
		{   
			chaine = chaine.replace(cherche,remplace);   
		}   
  		return chaine;   
 } 
//fonction dans les list_heb pour afficher les distances  pour le moteurv3
var lihe_id = findUrl('lihe_id');
var lieu_id = findUrl('lieu_id');
var prest_id = findUrl('prest_id');
var pack_id = findUrl('pack_id');
var distance = findUrl('distance');
var nomDistance = "nomDistance_"+lihe_id+"_"+prest_id+"_"+pack_id;
var distNom = "distNom_"+lihe_id+"_"+prest_id+"_"+pack_id;

var lieunomUrl = findUrl('lieu_nom').toUpperCase();//la variable "lieu_nom" dans l'url et en majuscule
lieunomUrl = str_replace("%20"," ",lieunomUrl);// remplace la variable "lieu_nom" en enelevant les %20 (les espaces)

var lieunom = findUrlIframe('lieunom'); //la variable "lieunom" dans l'url parent de l'iframe
	lieunom = str_replace("%20"," ",lieunom);// remplace la variable "lieunom" en enelevant les %20 (les espaces)
var lieunomMaj = lieunom.toUpperCase();//change la variable "lieunom" en majuscule

function affiProxi(nomDistance,distNom,distance,lieunomUrl)
{
	//si distance vaut rien alors on cache tout
	if (distance != "")
	{
		if(window.parent.$(nomDistance))
		{
		window.parent.$(nomDistance).style.visibility="visible";
		window.parent.$(distNom).innerHTML=lieunom;
		}
	}
	//si la varibale "lieu_nom" dans l'url et egal à la variable "lieunom" dans l'url PARENT alors on cache toute la div
	if (lieunomUrl == lieunomMaj)
	{
		if(window.parent.$(nomDistance))
		{
	window.parent.$(nomDistance).style.visibility="hidden";
		}
	}
}
//fonction reziseMe pour la page List_Heb  pour resizer l'iframe de la page results + javascript en innerHTML
var idprixMin = "prixmin_"+lihe_id+"_"+prest_id+"_"+pack_id;
var idmoyenne = "moyenne_"+lihe_id+"_"+prest_id+"_"+pack_id; 
var divavis= "avis_results_"+lihe_id+"_"+prest_id+"_"+pack_id;
var idnbenote = "nbenote_"+lihe_id+"_"+prest_id+"_"+pack_id;
var idtauxpromo = "tauxpromo_"+lihe_id+"_"+prest_id+"_"+pack_id;
var idPrixMinBarre = "PrixMinBarre_"+lihe_id+"_"+prest_id+"_"+pack_id;
var apartir = "idapartir_"+lihe_id+"_"+prest_id+"_"+pack_id;
var offre_heb = "offre_resultat_"+prest_id+"_"+lihe_id;
function reziseMe(id,idprixMin,idmoyenne,divavis,idnbenote,idtauxpromo,idPrixMinBarre)
{
height = $('ListeHebergement').getHeight();
			if(window.parent.resizeIframe)
			{
            	window.parent.resizeIframe(id, height);
			}
			// prix min barre
            if (window.parent.$(idPrixMinBarre)) window.parent.$(idPrixMinBarre).innerHTML = prixMinBarre+"&euro;";
            // taux
            if (window.parent.$(idtauxpromo)) window.parent.$(idtauxpromo).innerHTML = tauxpromo;
            // prix min
            if (window.parent.$(idprixMin)) window.parent.$(idprixMin).innerHTML = prixMin;
			// moyenne avis
            if (window.parent.$(idmoyenne)) window.parent.$(idmoyenne).innerHTML = moyenne;
			// nbe de note avis
            if (window.parent.$(idnbenote)) window.parent.$(idnbenote).innerHTML = nbenote;
			
			if (nbenote=="0"){
				if (window.parent.$(divavis))
				{
						window.parent.$(divavis).innerHTML="";
				}
			}		
                                             
            if(window.parent.$(idtauxpromo))
			{  
				if(tauxpromo==100){
				window.parent.$(offre_heb).style.display = 'none';
				}
				
				if ((prixMin==prixMinBarre || tauxpromo<=0) && window.parent.$(idtauxpromo).up()) {
				 // on masque le span promo
				 window.parent.$(idtauxpromo).up().style.display = 'none';
				 window.parent.$(idPrixMinBarre).style.display = 'none';
				} 
			}
				

} 
//fonction pour l'inscription a la newsletter avec ouverture dans une lytebox
function openDL(){
var trez = document.forms["Form1"].elements["email"].value;
//myLytebox.start("<a /newsletter/inscription-newsletter.html?mail="+trez, false, true);
document.getElementById('okA').href="/newsletter/inscription.html?mail="+trez;
}
//function pour faire disparaitre les imput (pour la lytebox sur ie6)
function disableInput()
{
	if(document.all)
	{
		var selectDis = document.getElementsByTagName("select");
		for (i = 0; i < selectDis.length; i++)
		{
			selectDis[i].style.visibility = "hidden";
		}
	}
}
//function pour faire afficher les imput (pour la lytebox sur ie6)
function showInput(){
	if(document.all){
	var selectDis = document.getElementsByTagName("select");
for (i = 0; i < selectDis.length; i++) {
selectDis[i].style.visibility = "visible";}}
}
//-----------*--------- TAG Horizon media --------------------------------
configurationOAS_url = OAS_url ='http://horyzonix.sdv.fr/RealMedia/ads/'; 
OAS_listpos = 'Top,Middle'; 
OAS_query = ''; 
OAS_sitepage = 'www.declicfrance.com/hp'; 
//end of configuration 
OAS_version = 10; 
OAS_rn = '001234567890'; 
OAS_rns = '1234567890'; 
OAS_rn = new String (Math.random()); 
OAS_rns = OAS_rn.substring (2, 11); 
function OAS_NORMAL(pos) { 
	document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" target="_top">'); document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" border=0></A>'); 
}
function OAS_RICH(pos) { 
	document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" target="_top">'); document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" border=0></A>'); 
} 
OAS_version = 11; 
if (navigator.userAgent.indexOf('Mozilla/3') != -1) 
	OAS_version = 10; 
if (OAS_version >= 11) 
	document.write('<SCR'+'IPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + OAS_query + '"><\/SCR'+'IPT>');
document.write(''); 
function OAS_AD(pos) { 
	if (OAS_version >= 11) OAS_RICH(pos); 
	else OAS_NORMAL(pos); 
}
//-----------*---------
function Popup(href, titre) {
               window.open(href,titre,'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=620, height=500');
        }
//-----------*--------- POP UP PRIX GARANTIS --------------------------------
function PopupPG() {
               window.open('/popupprixgarantis.aspx','prix_garantis','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=620, height=500');
        }
		
		
/* fonction liens js DF Mag */
function navTo (target) {
window.open(target, '_self');	
}
function readMore (article) {
window.open('/mag/articles/'+article+'.html', '_self');	
}