// Gere le lien vers la dtd 12
re = /(http:\/\/[a-z0-9._-]*\/[a-z0-9._-]*\/)/i; 

function popup(IdPage) {
	// recuperation du premier index ...
	str = document.location.href;
	found = str.match(re); 
 
	TheUrl = found[0]+"index12/id/"+IdPage;
	TheFeatures = "left=5,top=5,width=500,height=350,resizable=1,scrollbars=1";
	window.open(TheUrl,"Dtd12",TheFeatures);
}

function ResSej(ElCheck) {
	// recuperation du premier index ...
	str = document.location.href;
	found = str.match(re); 

	TheUrl = found[0]+"ReservationSejour/Check/"+ElCheck;
	TheFeatures = "left=5,top=5,width=600,height=450,resizable=1,scrollbars=1";
	window.open(TheUrl,"ResSej",TheFeatures);
}

function EnvoiSelect(Numero) {
	LeSele = eval("document.Type2_"+Numero+".Type2_"+Numero);
	CurSele = LeSele.options.selectedIndex;
	Lurl =	LeSele.options[CurSele].value;
	window.location=Lurl;
}

function OuvreIA(Langue) {
	TheUrl = "../ElemComm/IndiceAtmo.php?lan="+Langue;
	TheFeatures = "left=5,top=5,width=530,height=350,resizable=1,scrollbars=1";
	window.open(TheUrl,"IA",TheFeatures);
}

function OuvreMeteo(Langue) {
	//if (Langue==2) {redirigec('fr38','en')} else {redirigec('fr38','fr')}
	redirigec('fr38','fr');
}

/*
	function redirigec(c,l) { 
	 window.open("http://www.meteo.fr/meteonet/cobranding/cg38/chxca.htm?a="+c+"&b="+l+"&amp;"+escape(location.host),"carte","width=550,height=520,outerWidth=570,outerHeight=565,resize=no,scrollbars=yes"); 
	 //return false; 
	} 

	function redirigec(c,l) {
		window.open("http://www.meteo.fr/meteonet/cobranding/cg383/chxca.htm?a="+c+"&b="+l+"&"+escape(location.host),"carte","width=550,height=520,outerWidth=570,outerHeight=565,resize=no,scrollbars=yes"); 
	    //return false; 
	} 
*/
function redirigec(c,l) {
	window.open("http://www.meteo.fr/meteonet/cobranding/cg382/chxca.htm?a="+c+"&b="+l+"&"+escape(location.host),"carte","width=550,height=520,outerWidth=570,outerHeight=565,resize=no,scrollbars=yes");
    return false;
}


function OuvreCommission(id,Lang,idp){
	largeur=466;
	hauteur=436;
	
	// recuperation du premier index ...
	// 'fiche_commission.php?id='+id+'&Lang='+Lang+'&idp='+idp
	str = document.location.href;
	found = str.match(re); 
	TheUrl = found[0]+"fiche_commission/id/"+id+"/Lang/"+Lang+"/idp/"+idp;
	
	myWindow=window.open(TheUrl,'PopupComs','width='+largeur+',height='+hauteur+',scrollbars=1,resizable=1');
	myWindow.focus();
	if (parseInt(navigator.appVersion) >= 4) myWindow.moveTo((screen.width/2)-(largeur/2+10),(screen.height/2)-(hauteur/2+20));
} 

function OuvrirPopup(UneURl,LaWidth,LaHeight) {
	if (LaWidth=="") { LaWidth='300';}
	if (LaHeight=="") { LaHeight='300';}
	myWindow=window.open(UneURl,'Popup','left=5,top=5,width='+LaWidth+',height='+LaHeight+',scrollbars=1,resizable=1');
	myWindow.focus();
}

function PopElu(id,Lang){
	if (!Lang) Lang = 1;
	
	if(id != 0){
		str = document.location.href;
		found = str.match(re);
		
		largeur=466;
		hauteur=466;
		FeaturePlus = '';
		if (parseInt(navigator.appVersion) >= 4){ 
			FeaturePlus = 'left='+((screen.width/2)-(largeur/2+10))+',top='+((screen.height/2)-(hauteur/2+20))+',';
		}
		myWindow=window.open(found[0]+'fiche_conseiller/id/'+id+'/Lang/'+Lang,'PopupElus',FeaturePlus + 'width='+largeur+',height='+hauteur+',scrollbars=1,resizable=1');
		myWindow.focus();
	}
}

function popupBib(IdPage,id) {
	str = document.location.href;
	found = str.match(re); 
 	
	TheUrl = found[0]+"PopupBib/id/"+IdPage+"/idBib/"+id;
	TheFeatures = "left=5,top=5,width=600,height=605,resizable=0,scrollbars=1";
	window.open(TheUrl,"Dtd12",TheFeatures);
}

function BDIPopupActu(IdPage,id) {
	str = document.location.href;
	found = str.match(re); 
 	
	TheUrl = found[0]+"BDI_PopupActu/id/"+IdPage+"/idAct/"+id;
	TheFeatures = "left=5,top=5,width=600,height=450,resizable=0,scrollbars=1";
	window.open(TheUrl,"Actu",TheFeatures);
}

function popupForm(IdPage,id) {
	str = document.location.href;
	found = str.match(re); 
 	
	TheUrl = found[0]+"PopupForm/id/"+IdPage+"/idForm/"+id;
	TheFeatures = "left=5,top=5,width=600,height=605,resizable=0,scrollbars=1";
	window.open(TheUrl,"Dtd12",TheFeatures);
}

function popupExpo(IdPage,id) {
	str = document.location.href;
	found = str.match(re); 
 	
	TheUrl = found[0]+"PopupExpo/id/"+IdPage+"/idExpo/"+id;
	TheFeatures = "left=5,top=5,width=600,height=605,resizable=0,scrollbars=1";
	window.open(TheUrl,"Dtd12",TheFeatures);
}

