function pop(u,t) {
	switch(t) {
		case 0: { window.open(u);return }
		case 1: { window.open(u,"","scrollbars=yes,resizable=yes,width=410,height=300,left=20,top=20");return }
		case 2: { window.open(u,"","scrollbars=yes,resizable=yes,status=yes,width=410,height=300,left=20,top=20");return }
		case 3: { window.open(u,"","scrollbars=yes,resizable=yes,width=450,height=300,left=20,top=20");return }
		case 4: { window.open(u,"","scrollbars=yes,resizable=yes,width=700,height=650,left=0,top=0");return }
		case 5: { window.open(u,"","scrollbars=yes,resizable=yes,width=640,height=680,left=0,top=0");return }
	}
	window.open(u,"","scrollbars=yes,resizable=yes,width=600,height=440,left=20,top=20")
	}
function verif(email) {
	var arobase = email.indexOf("@"); var point = email.lastIndexOf(".")
	if((arobase < 1)||(point + 1 == email.length)||(point < arobase+2)) return false
	return true
	}
function contact(redac) {
	if(redac!="") pop("/asphp/contact.asp?contact="+redac,1)
	}
function gloss(lng,fct) {
	pop("/asphp/glossaire.asp?lng=" + lng + "&fct=" + fct,1)
	}
function abonne() {
	if(!verif(document.newsletter.mail.value)) { alert("E-mail invalide !") ; document.newsletter.mail.focus() }
	else document.newsletter.submit()
	}
function vide(mail) {
	if(mail.value=="E-mail") mail.value=""
	}

/*function SetCookie(CookieName,CookieArgs,CookieExpire) {
	document.cookie = escape(CookieName) + "=" + escape(CookieArgs) + ";" + "expires=" + CookieExpire;
	}
*/

function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
      		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
                        return getCookieVal (j);
                i=document.cookie.indexOf(" ",i)+1;
                        if (i==0) break;}
	return "";
}

function cre_cookie(nom,contenu) {
	document.cookie = nom + "=" + escape(contenu)
}
	  
function SetCookie(nom,contenu,jours) {
 var expireDate = new Date();
     expireDate.setTime(expireDate.getTime() + jours*24*3600*1000);
     document.cookie = nom + "=" + escape(contenu)
      + ";expires=" + expireDate.toGMTString();
}

function DeleteCookie(nom) {SetCookie(nom,"",-1) }

function display(page, num, id_sondage) {
	var expB = new Date();
	
//	expB.setTime (expB.getTime() + (24*60*60*1000*365)); // expirations de 365 jours
//	SetCookie("sondage_" + id_sondage, "yes", expB);
	SetCookie("sondage_" + id_sondage, "yes", 365);
//	alert("cookie=" + GetCookie("sondage_" + id_sondage));
	pop(page, num);
//	DeleteCookie("sondage_" + id_sondage);
	window.location.href = window.location.href ;
	}