
//<!--
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 SetReq(aStr, link){
	var iframemap = document.getElementById('iframemap');
	var tmplink= '';
  if (iframemap){ 
	  if(link){
			tmplink = RetirerParametre('sourceSousCat', link);
		}else{
			tmplink = RetirerParametre('sourceSousCat', iframemap.src);
		}
		tmplink = RetirerParametre('attraits', tmplink) + '&' + aStr;
		iframemap.src = tmplink;
	}
}
	  
 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;
   var iframemap = document.getElementById('iframemap');
	 if (iframemap){
	 	for( x = 1 ; x <= 9 ; x++ ){
	 		if( idParcours != x ){
		 		if(document.getElementById("choixParcour"+x)) document.getElementById("choixParcour"+x).checked = false;
		 	}
	 	}
	 	/*for( x = 1 ; x <= 8 ; x++ ){
	 		if( idParcours != x ){
		 		if(document.getElementById("choixAttrait"+x)) document.getElementById("choixAttrait"+x).checked = false;
		 	}
	 	}*/
	 	var i, strChoix;
		strChoix= '';
	  for(i=1;i<=9;i++){
	  	if (document.getElementById('choixAttrait' + i) != undefined) {
				if (document.getElementById('choixAttrait' + i).checked) {
					strChoix += document.getElementById('choixAttrait' + i).value + ',';
				}
			}
	  }
	 	SetReq('sourceSousCat=' + strChoix,pLink);
	 	//iframemap.src = pLink;  
	 }
 }; 
 
/* 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<=9;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<=9;i++){
  	if (document.getElementById('choixAttrait' + i) != undefined) {
			if (document.getElementById('choixAttrait' + i).checked) {
				strChoix += document.getElementById('choixAttrait' + i).value + ',';
			}
		}
  }
 	SetReq('sourceSousCat=' + strChoix);
}

function fchoixAttrait(){
	var i, strChoix;

	strChoix= '';

  for(i=1;i<=8;i++){
	if (document.getElementById('choixAttrait' + i).checked) 
		strChoix += document.getElementById('choixAttrait' + i).value + ','; 
  }   
 	SetReq('attraits=' + strChoix);
}


// -->
