function openPopup(file,target,w,h,scroll,left,others,type) {
   if (!scroll)
	scroll='yes';
   if (!h)
	h=580;
   if (!w)
	w=800;
   if (others)
	others=','+others;
   else
	others='';
  if (left=="0")
	l = 0
	else 
	l = (screen.width/2)-(w/2);
 window.open(file,target,'width='+w+',height='+h+',left='+l+',top=0,scrollbars='+scroll+''+others+',resizable=yes');
}
function launchSearch() {
if (document.forms[0].valRecherche.value != "")
openPopup('/lub/lubusa.nsf/ResultatRecherche?readform&ID=C125717D00402081C1256EF3004DB954&LG=EN&MOT='+escape(document.forms[0].valRecherche.value)+'&end', 'result', '370', '600', '1', '0','');
}
function ChangeLibRecherche(){
window.document.getElementById("mot").value = window.document.getElementById("valRecherche").value
}
function extraireCode(chaine) {
	// entree : &#12345;
	// sortie : 12345
	
	if (chaine != '') {		
		var regexp = /&#(\d*);/gi; 		
		if (chaine.search(regexp)!=-1) {			
			chaine =  chaine.replace(regexp, "$1" )
		}		
	}	
	return chaine;
}
function formatChainePourAlert(chaine) {
	i = 0;
	retour = "";
	ch = "";
	while (i<chaine.length) {
		if (chaine.charAt(i)=="&") {
			if (i<chaine.length-1) {
				i++;
				if (chaine.charAt(i)=="#"){
					if (i<chaine.length-1) {
						i++;
						if( chaine.indexOf(";",i) > i) {
							ch = chaine.slice(i-2,chaine.indexOf(";",i));							
							while( ch.indexOf("&#",2) > 0) {
								retour += ch.substring(0,ch.indexOf("&#",2))
								i += ch.indexOf("&#",2);
								ch = ch.slice(ch.indexOf("&#",2),ch.length);								
							}							
							if (extraireCode(ch+";") == (ch+";")) {
								retour += ch+";";
							} else {
								retour += String.fromCharCode(extraireCode(ch+";"));
							}
							i = i + ch.length-1;
						} else {
							retour += "&#"+chaine.charAt(i);
							i++;
						}						
					} else {
						retour += "&#";
						i++;
					}
				} else {
					retour += "&" + chaine.charAt(i);
					i++;
				}
			} else {
				retour += chaine.charAt(i);	
				i++
			}
		} else {	
			retour += chaine.charAt(i);
			i++
		}
	}
	return retour
}
function ValideSondage(idson){
	formSon = document.formSondage;
	nom_var = 'ID'+ idson;
	duree = 1;  // Durée de vie du cookie en jours
	date_expire = new Date();
	date_expire.setTime(date_expire.getTime() + (duree*24*60*60*1000));
	voter="0";
	if (formSon.sondage[0].checked){
		SetCookie( 'ID'+ idson,nom_var,date_expire,'/');
		window.location.replace('/lub/contenu.nsf/WSON?OpenAgent&IDSON='+idson+'&REP=1&UNI=C125717D00402081C1256EF3004DB954&DB=lubusa.nsf&SRV=LIVE&');
		voter="1";
	}
	if (formSon.sondage[1].checked){
		SetCookie( 'ID'+ idson,nom_var,date_expire,'/');
		window.location.replace('/lub/contenu.nsf/WSON?OpenAgent&IDSON='+idson+'&REP=2&UNI=C125717D00402081C1256EF3004DB954&DB=lubusa.nsf&SRV=LIVE&');
		voter="1";
	}
	if (formSon.length>=3){
		if (formSon.sondage[2].checked){
			SetCookie( 'ID'+ idson,nom_var,date_expire,'/');
			window.location.replace('/lub/contenu.nsf/WSON?OpenAgent&IDSON='+idson+'&REP=3&UNI=C125717D00402081C1256EF3004DB954&DB=lubusa.nsf&SRV=LIVE&');
			voter="1";
		}
	}
	if (formSon.length>=4){
		if (formSon.sondage[3].checked){
			SetCookie( 'ID'+ idson,nom_var,date_expire,'/');
			window.location.replace('/lub/contenu.nsf/WSON?OpenAgent&IDSON='+idson+'&REP=4&UNI=C125717D00402081C1256EF3004DB954&DB=lubusa.nsf&SRV=LIVE&');
			voter="1";
		}
	}
	if (formSon.length>=5){
		if (formSon.sondage[4].checked){
			SetCookie( 'ID'+ idson,nom_var,date_expire,'/');
			window.location.replace('/lub/contenu.nsf/WSON?OpenAgent&IDSON='+idson+'&REP=5&UNI=C125717D00402081C1256EF3004DB954&DB=lubusa.nsf&SRV=LIVE&');
			voter="1";
		}
	}
	if (voter=="0") alert(formatChainePourAlert(''));	
}