
//<!--
function RetirerParametre(parametre, lien){
  var debutParametre  = lien.indexOf('&' + parametre);
  var nouveauLien= '';
	if (debutParametre != -1){
		nouveauLien = lien.substring(0,debutParametre);
	 	var finParametre = lien.indexOf('&', debutParametre+1);
		if (finParametre != -1)
		  nouveauLien += lien.substring(finParametre,lien.length);
	    return nouveauLien;		
	 }else{
	   return lien;	
	 }
} 

	
	function getParamValue(param,url1)
{
  param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+param+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( url1 );
  if( results == null )
    return "";
  else
    return results[1];
}

function SetReq(aStr){
	var iframemap = document.getElementById('iframemap');
	var tmplink= '';
  if (iframemap){ 
		tmplink = RetirerParametre('sourceSousCat', iframemap.src);
		tmplink = RetirerParametre('sourceSousCat', tmplink) + '&' + aStr;
//alert(tmplink);
var strSousCatt;
		if(document.getElementById("choixParcour6").checked) strSousCatt = "&sourceSousCat=belvedere";
		iframemap.src = tmplink+strSousCatt;
	}
}
	  
 function AfficherPleinePage(){
   var iframemap = parent.document.getElementById('iFrameCarte');
	 if (iframemap){
		window.open(iframemap.src+"&router=pmn-sl",'','resizable=yes,scrollbars=yes,status=no,menubar=no,Top=' + screen.height * 0.025 + ',Left=' + screen.width * 0.025 + ',width=' + screen.width * 0.95 + ',height=' + screen.height * 0.85);
	 }
 };
 
 function AfficherParcourt(pLink, idParcours){
 	var x, parametres;
   var iframemap = document.getElementById('iframemap');
	 if (iframemap){
	 	for( x = 1 ; x < document.carte.choixParcours.length ; x++ ){
	 		if( idParcours != x ){
		 		if(document.carte.choixParcours[x-1]) document.carte.choixParcours[x-1].checked = false;
		 	}
	 	}
	 /*	for( x = 1 ; x <= 8 ; x++ ){
	 		if( idParcours != x ){
		 		if(document.getElementById("choixAttrait"+x)) document.getElementById("choixAttrait"+x).checked = false;
		 	}
	 	}*/
	 	/*if (getParamValue("attraits",iframemap.src)!=""){
	 		//alert(pLink+"&attraits="+getParamValue("attraits",iframemap.src));
	 		pLink=pLink+"&attraits="+getParamValue("attraits",iframemap.src);
	 	}
	 		if (getParamValue("sourceSousCat",iframemap.src)!=""){
	 		//alert(pLink+"&sourceSousCat="+getParamValue("sourceSousCat",iframemap.src));
	 		pLink=pLink+"&sourceSousCat="+getParamValue("sourceSousCat",iframemap.src);
	
	 	}*/
	 parametres=fchoixAttraitSousCatParcours();
	 if (parametres != ""){
	iframemap.src = pLink+parametres;
	}
	 else {//alert(pLink);
	iframemap.src = pLink;  
}
//alert ("quand change parcours"+iframemap.src );
	 }
 }; 
 
/* function fncshowcircuit(valeurCheck)
{
    var iframemap = document.getElementById('iframemap');
	//var group= document.getElementById('boxes');
	//var childs=group.childNodes;
	var childs=valeurCheck;
	var parcours= '';
	var tmplink= '';
	
 if (iframemap) {
		tmplink = RetirerParametre('parcours', iframemap.src);  
	
		for (idx=0;idx<childs.length;idx++)
		{
			child = childs[idx]
			if (child.checked) parcours = parcours + child.name + ',' 
		}
	    
		iframemap.src = tmplink + '&parcours=' + parcours
	}
	//tmplink = RetirerParametre('parcours', iframemap.src);  
	//iframemap.src = tmplink + '&parcours=' + parcours
}*/

function fncshowcircuit(){
	var parcours;
	parcours ='';
  var iframemap = document.getElementById('iframemap');
	if (iframemap) {
	 	tmplink = RetirerParametre('parcours', iframemap.src);       
		for (var i=1;i<=11;i++){
		  if (document.getElementById('parcourChek' + i).checked)
		    parcours += document.getElementById('parcourChek' + i).value + ',';
		}
	  iframemap.src = tmplink + '&parcours=' + parcours;	
	}
}


function fchoixAttraitHebergement(){
	var i, strChoix;
	strChoix= '';
  for(i=1;i<=2;i++){
	if (document.getElementById('choixAttrait' + i).checked) 
		strChoix += document.getElementById('choixAttrait' + i).value + ',';
  }
 	SetReq('attraits=' + strChoix);
}

function fchoixAttraitSousCat(){
	var i, strChoix;
	strChoix= '';
  for(i=1;i<=11;i++){
  	if (document.getElementById('choixAttrait' + i)) {
			if (document.getElementById('choixAttrait' + i).checked) {
				strChoix += document.getElementById('choixAttrait' + i).value + ',';
			}
		}
  }
//alert("quand ajoute attrait"+'sourceCat=' + strChoix);
 		SetReq('prox=1&sourceSousCat=' + strChoix);
 	//SetReq('sourceSousCat=' + strChoix);
}

function fchoixAttraitSousCatParcours(){
	var i, strChoix;
	strChoix= '';
  for(i=1;i<=11;i++){
  	if (document.getElementById('choixAttrait' + i)) {
			if (document.getElementById('choixAttrait' + i).checked) {
				strChoix += document.getElementById('choixAttrait' + i).value + ',';
			}
		}
  }
 		return '&prox=1&sourceSousCat=' + strChoix;
 	//SetReq('sourceSousCat=' + strChoix);
}

function fchoixAttrait(){
	var i, strChoix;

	strChoix= '';

  for(i=1;i<=11;i++){
	if (document.getElementById('choixAttrait' + i).checked) 
		strChoix += document.getElementById('choixAttrait' + i).value + ','; 
  }   
 	SetReq('prox=1&attraits=' + strChoix);
}


// -->

