// Fonctions javascript - genisisweb pour wwwisis version 3
function Filtre() {
	a=window.event.keyCode;
	if ((a<48 || a>57) && a!=47) window.event.keyCode = 0;
}
function Accent(Terme) {
// Filtrage des accents
	var ACCAPP = "AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyynN";
	var ACCWIN = "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿñÑ";
	for (i=0; i<ACCWIN.length; i++) {
		while ( Terme.indexOf(ACCWIN.charAt(i),0) != -1) Terme = Terme.replace(ACCWIN.charAt(i),ACCAPP.charAt(i));
	}
	return Terme;
}
// Renvoi les termes de l'index
function IndexValue(Val,Target) {
var chaine = "";
if (Target && Val) {
	// Mettre en commentaire les deux lignes suivantes si on ne veut pas recuperer les
	// termes existants dans la zone de texte
	chaine = eval("document.GENISIS."+Target+".value");
	if (chaine) Val = Val + ';' + chaine;
	eval("document.GENISIS."+Target+'.value=Val');
}
msg.close();
}
// Ouverture fenetre PopUp - Left=100, Top=100 
function OpenWindow(LURL,Lgx,Lgy) {
	msg=open("","Help","location=no,status=no,toolbar=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,height="+Lgx+",width="+Lgy+",left=100,top=100");	
	msg.location.href=LURL;
	msg.focus();
}
// Reinitialise le formulaire
function ResetForm() {
	document.GENISIS.reset();
}
// Lire une "Textbox"
function ReadTextBox(CTL,UNI) {
	var src = document.GENISIS.elements[CTL].value;
	if (UNI) { 
		var ponctuation = " '-,._:/"+'"';	// Caractères de ponctuation traitement uniterme
		var i;
		for (i=0; i<ponctuation.length; i++) {
			while ( src.indexOf(ponctuation.charAt(i),0) != -1) src = src.replace(ponctuation.charAt(i),";");
		}
	}
	return src;
}
// Mise en forme requete
// CRI = Opérateur entre champs
// CTL = Element du formulaire (retour d'une fonction)
// TRN = Troncature (caractere $)
// LIB = Libellé en clair
// CDS = Etiquette ISIS
// PRF = Préfixe
// OPE = Opérateur entre articles
function MakeRequest(CRI,CTL,TRN,LIB,CDS,PRF,OPE) {
var but="";
var aff="";
var act="";
var actp = "";
var mot="";
if (OPE=="*") {
	act=opet;
} else {
	act=opou;
}
if (CRI=="*") actp=opet;
if (CRI=="+") actp=opou;
if (CRI=="^") actp=opsf;

decoupe=CTL.split(";");
for (var i in decoupe) {
if (decoupe[i]) {
	mot=Accent(decoupe[i]);
	if (but) {
		but = but + OPE + "\"" + PRF + mot + TRN + "\"" + CDS;
		aff = aff + act + decoupe[i];
	} else {
		but = "\"" + PRF + mot + TRN + "\"" + CDS;
		aff = decoupe[i];
	}
}
}
if (but) {
	aff = "(" + LIB + "=" + aff + ")";
	flag=true;
	if (requete) {
		requete = requete+CRI+"("+but+")";
	} else {
		requete = "("+but+")";
	}
	if (question) {
		question = question+actp+aff;
	} else {
		question = aff;
	}
}
}
// Mise en forme requete
// CTL = Element du formulaire (retour d'une fonction)
// TRN = Troncature (caractere $)
// LIB = Libellé en clair
// CDS = Etiquette ISIS
// PRF = Préfixe
// OPE = Opérateur
function MakeRequestMulti(CRI,CTL,CMB,OPE) {
var chaine="";
chaine=ReadListSimple(CMB);
decoupe=chaine.split("|");
MakeRequest(CRI,ReadTextBox(CTL,decoupe[3]),decoupe[2],decoupe[0],decoupe[1],decoupe[4],OPE);
}

// Lecture "checkBox"
function ReadCheckBox(CTL) {
	var terme = "";
	var elts = document.GENISIS.elements[CTL];
	var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0;
	if (elts_cnt) {
		for (var i = 0; i < elts_cnt; i++) {
			if ( elts[i].checked ) {
				if (terme) terme=terme+";";
				terme=terme+elts[i].value;
			}
		}
	} else {
		if ( elts.checked ) terme=elts.value;
	}
return terme;
}
// Lecture "Bouton Radio"
function ReadRadio(CTL) {
for (var i=0; i<document.GENISIS.elements[CTL].length; i++) {
if (document.GENISIS.elements[CTL][i].checked ) return document.GENISIS.elements[CTL][i].value;
}
return "";
}
// Lecture "Liste multiple"
function ReadListMulti(CTL) {
var terme = "";
for (var i=0; i<document.GENISIS.elements[CTL].length; i++) {
if (document.GENISIS.elements[CTL].options[i].selected) {
if (terme == "") {
	terme=document.GENISIS.elements[CTL].options[i].value;
} else {
	terme=terme+";"+document.GENISIS.elements[CTL].options[i].value;
}}}
return terme;
}
// Lecture "Liste simple"
function ReadListSimple(CTL) {
	i=document.GENISIS.elements[CTL].options.selectedIndex;
	if (i < 0) return "";
	return document.GENISIS.elements[CTL].options[i].value;
}
// Ouverture d'un index
// CDS = etiquette isis
// RET = zone texte de retour
// FIC = 0=Base ISIS,1=Image index Index
// TIT = Titre de la fenetre
// PFX = Prefixe
// POS = Premier terme - pour éviter les chiffres
// SMP = 1=Index long, 0=Index court 
// LgX = Largeur fenetre
// LgY = Hauteur fenetre
// PosX = Position LEFT
// PosY = Position TOP
function OpenIndexPost(CDS,RET,FIC,TIT,PFX,POS,SMP,LgX,LgY,PosX,PosY) {
	document.ENVOI.t2999.value = "AZ";
	if (SMP != 1) {document.ENVOI.t2008.value = "100";}
	document.ENVOI.t2014.value = CDS;
	document.ENVOI.t2015.value = RET;
	document.ENVOI.t2016.value = POS;
	document.ENVOI.t2017.value = TIT;
	document.ENVOI.t2018.value = PFX;
	document.ENVOI.t2020.value = SMP;
	document.ENVOI.action = document.ENVOI.t2009.value;
	msg=window.open("wait.htm","popup","location=no,status=no,toolbar=no,directories=no,resizable=yes,menubar=no,scrollbars=no,height="+LgX+",width="+LgY+",left="+PosX+",top="+PosY);	
	document.ENVOI.target = "popup";
	document.ENVOI.submit();
	msg.focus();
}
// Ouverture index multiple
// CTL = Nom de la combobox à utiliser
// RET = zone texte de retour
// LgX = Largeur fenetre
// LgY = Hauteur fenetre
// PosX = Position LEFT
// PosY = Position TOP
function OpenIndexMulti(RET,CTL,LgX,LgY,PosX,PosY) {
	var chaine="";
	chaine=ReadListSimple(CTL);
	decoupe=chaine.split("|");	
	OpenIndexPost(decoupe[7],RET,decoupe[6],decoupe[5],decoupe[4],"",decoupe[8],LgX,LgY,PosX,PosY);
}
// Variables globales
var nbrlien=0;
var nbrcache=0;
// Affichage long - Accès par lien
function AfficheFiche(url) {
	document.ENVOI.t2999.value = "DT"
	document.ENVOI.t2015.value = url;
	document.ENVOI.t2016.value = "1";
	document.ENVOI.target = "_self";
	document.ENVOI.submit();
}
// Retour au formulaire d'interrogation
function NewQuestion() {
	location.href = document.ENVOI.t2007.value;
}
//
// Va à la page N°
function GoPage(PGE) {
	var source=document.REQUETE.t2001.value;
	document.ENVOI.t2000.value = source.replace(/#/g,"\"");
	document.ENVOI.t2001.value = document.REQUETE.t2001.value;
	document.ENVOI.t2002.value = document.REQUETE.t2002.value;
	document.ENVOI.t2004.value = String(PGE);
	document.ENVOI.t2999.value = "IN";
	document.ENVOI.target = "_self";
	document.ENVOI.submit();
}
// Afficher barre boutons
// NBR = Nombre de réponses/page
// PGE = page en cours
// TOT = Nombre de réponses
// REP = Répertoires des images
function BarreBouton(NBR,PGE,TOT,REP) {
	var page=PGE;
	var total=TOT/NBR;
	total = parseInt(total);
	if ( TOT%NBR != 0 ) total = total + 1;
	if ( page < 1) page = 1;
	if ( page > total ) page = total;
	document.write("<table class=TableNavigue width=100%><tr><td width=\"20%\" align=\"center\">");
	if ( page == 1 ) {
		document.write("<img src=\""+REP+"first_off.gif\" border=0>&nbsp;");
		document.write("<img src=\""+REP+"prev_off.gif\" border=0></td>");
	} else {
		document.write("<a class=Neutre href=\"javascript:GoPage(1);\"><img src=\""+REP+"first_on.gif\" border=0></a>&nbsp;");
		document.write("<a class=Neutre href=\"javascript:GoPage("+Number(page-1)+");\"><img src=\""+REP+"prev_on.gif\" border=0></a></td>");
	}
	document.write("<td align=\"center\"><b>"+page+"/"+total+"</b></td><td width=\"20%\" align=\"center\">");
	if ( page == total ) {
		document.write("<img src=\""+REP+"next_off.gif\" border=0>&nbsp;");
		document.write("<img src=\""+REP+"last_off.gif\" border=0></td>");
	} else {
		document.write("<a class=Neutre href=\"javascript:GoPage("+Number(page+1)+");\"><img src=\""+REP+"next_on.gif\" border=0></a>&nbsp;");
		document.write("<a class=Neutre href=\"javascript:GoPage("+total+");\"><img src=\""+REP+"last_on.gif\" border=0></a></td>");
	}
	document.write("</tr></table>");
}

function Link(Zone,Terme,Champ,Base,Fenetre) {
	Terme = Accent(Terme);
	if ( Champ != "" ) Champ = "/(" + Champ + ")";
	// Transfert des éléments dans le formulaire
	document.LIEN.t2006.value = document.forms[Base].t2006.value;
	document.LIEN.t2009.value = document.forms[Base].t2009.value;
	document.LIEN.t2012.value = document.forms[Base].t2012.value;
	if ( Base == "LINK" ) {
		document.LIEN.t2018.value = "";
	} else {
		document.LIEN.t2018.value = "1";
	}
	if ( Fenetre == "" ) {
		document.LIEN.t2004.value = "1";
		document.LIEN.t2000.value = "(\"" + Terme + "\"" + Champ + ")";
		document.LIEN.t2001.value = "(#" + Terme + "#" + Champ + ")";
		document.LIEN.t2002.value = Zone + "=" + Terme;
		document.LIEN.action = document.LIEN.t2009.value;
		document.LIEN.submit();
	} else {
		var URL=document.LIEN.t2009.value + "?t2999=IN";
		URL=URL + "&t2000=" + escape("(\"" + Terme + "\"" + Champ + ")");
		URL=URL + "&t2001=" + escape("(#" + Terme + "#" + Champ + ")");
		URL=URL + "&t2002=" + escape(Zone + "=" + Terme);
		URL=URL + "&t2003=" + escape(document.LIEN.t2003.value);
		URL=URL + "&t2004=" + escape(document.LIEN.t2004.value);
		URL=URL + "&t2006=" + escape(document.LIEN.t2006.value);
		URL=URL + "&t2007=" + escape(document.LIEN.t2007.value);
		URL=URL + "&t2009=" + escape(document.LIEN.t2009.value);
		URL=URL + "&t2010=" + escape(document.LIEN.t2010.value);
		URL=URL + "&t2011=" + escape(document.LIEN.t2011.value);
		URL=URL + "&t2012=" + escape(document.LIEN.t2012.value);
		URL=URL + "&t2013=" + escape(document.LIEN.t2013.value);
		URL=URL + "&t2014=" + escape(document.LIEN.t2014.value);
		URL=URL + "&t2015=" + escape(document.LIEN.t2015.value);
		URL=URL + "&t2016=" + escape(document.LIEN.t2016.value);
		URL=URL + "&t2017=" + escape(document.LIEN.t2017.value);
		URL=URL + "&t2018=" + escape(document.LIEN.t2018.value);
		URL=URL + "&t2019=" + escape(document.LIEN.t2019.value);
		msg=window.open(URL,"Index","location=no,status=no,toolbar=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,"+Fenetre);	
		msg.focus();
	}
}

// Afficher barre navigation
// NBR = Nombre de réponses/page
// BAR = Nombre de pages/barre
// PGE = page en cours
// TOT = Nombre de réponses
// REP = Répertoires des images
// POS = Position
function BarreNavigue(NBR,BAR,PGE,TOT,REP,POS) {
	var page=PGE;
	var total=TOT/NBR;
	var deb;
	var fin;
	total = parseInt(total);
	if ( TOT%NBR != 0 ) total = total + 1;
	if ( page < 1) page = 1;
	if ( page > total ) page = total;
	document.write("<table class=TableNavigue width=100%><tr><td align="+POS+">");
	if ( page == 1 ) {
		document.write("<img src=\""+REP+"left_off.gif\" border=0><img src=\""+REP+"left_off.gif\" border=0>&nbsp;.&nbsp;");
		document.write("<img src=\""+REP+"left_off.gif\" border=0>&nbsp;.&nbsp;");
	} else {
		document.write("<a class=Neutre href=\"javascript:GoPage(1);\"><img src=\""+REP+"left_on.gif\" border=0><img src=\""+REP+"left_on.gif\" border=0></a>&nbsp;.&nbsp;");
		document.write("<a class=Neutre href=\"javascript:GoPage("+Number(page-1)+");\"><img src=\""+REP+"left_on.gif\" border=0></a>&nbsp;.&nbsp;");
	}
	if ( total <= BAR ) {
		deb=1;
		fin=total;
	} else {
		if ( page < BAR ) {
			deb=1;
			fin=BAR;
		} else {
			fin=page+1;
			if ( page==total) fin--;
			deb=fin-BAR+1;
		}
	}
	for (var x=deb;x<=fin;x++) {
		if ( x == page ) {
			document.write("<span class=PageActive>&nbsp;"+page+"&nbsp;</span>&nbsp;");
		} else {
			document.write("<a class=Navigue href=\"javascript:GoPage("+x+");\">&nbsp;"+x+"&nbsp;</a>&nbsp;");
		}
	}
	if ( page == total ) {
		document.write("&nbsp;.&nbsp;<img src=\""+REP+"right_off.gif\" border=0>&nbsp;.&nbsp;");
		document.write("<img src=\""+REP+"right_off.gif\" border=0><img src=\""+REP+"right_off.gif\" border=0>");
	} else {
		document.write("&nbsp;.&nbsp;<a class=Neutre href=\"javascript:GoPage("+Number(page+1)+");\"><img src=\""+REP+"right_on.gif\" border=0></a>&nbsp;.&nbsp;");
		document.write("<a class=Neutre href=\"javascript:GoPage("+total+");\"><img src=\""+REP+"right_on.gif\" border=0><img src=\""+REP+"right_on.gif\" border=0></a>&nbsp;");
	}
	document.write("</td></tr></table>");
}
//
// Selection d'un terme dans l'index
function Prendre() {
	var i=document.INDEX.source.options.selectedIndex;
	if ( document.INDEX.source.options[i].value == "#" ) return;
	var valeur=document.INDEX.source.options[i].text;
	a = new Option(valeur);
	i=document.INDEX.but.options.length;
	document.INDEX.but.options[i]=a;
}
// Rejet d'un terme dans l'index
function Rejeter() {
	var i=document.INDEX.but.options.selectedIndex;
	if ( document.INDEX.source.options[i].value == "#" ) return;
	document.INDEX.but.options[i]=null;
}
// Affichage index
function AfficheIndex(lettre,sens) {
var requete = "";
if (!lettre) lettre = document.INDEX.terme.value;
if (document.INDEX.source.length) {
	var Rang = ( document.INDEX.source.options[0].value == "#" ) ? 1 : 0;
	for (var i=Rang; i<document.INDEX.but.length; i++) {
			requete=requete+"<OPTION>"+document.INDEX.but.options[i].text+"</OPTION>";
	}
}
if ( !sens ) sens = "AZ";
document.INDEX.t2999.value=sens;
document.INDEX.t2019.value=requete;
document.INDEX.t2016.value=document.INDEX.t2018.value + lettre;
document.INDEX.submit();
}
// Retour a l'interrogation
function Interrogation() {
	var requete = "";
	var Rang = ( document.INDEX.source.options[0].value == "#" ) ? 1 : 0;
	var target = document.INDEX.t2015.value;
	for (var i=Rang; i<document.INDEX.but.length; i++) {
		if (requete) {
			requete=requete+";"+document.INDEX.but.options[i].text;
		} else {
			requete=document.INDEX.but.options[i].text;
		}
	}
	i=requete.indexOf("'",0);
	while ( i != -1) {
		requete = requete.substring(0,i) + "\\" + requete.substring(i);
		i=requete.indexOf("'",i+2);
	}
	location.href="javascript:top.opener.IndexValue('"+requete+"','"+target+"')";
}
// Choix terme unique
function Choix() {
	var requete = "";
	var i = document.INDEX.source.selectedIndex
	if ( i != -1 ) requete = document.INDEX.source.options[i].text;
	var target = document.INDEX.t2015.value;
	location.href="javascript:top.opener.IndexValue('"+requete+"','"+target+"')";
}
// Lecture "checkBox"
function ChargeListe() {
	var elts = document.INDEX.elements['liste'];
	var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0;
	if (elts_cnt) {
		for (var i = elts_cnt-1; i > -1; i--) {
			a = new Option(elts[i].value);
			j=document.INDEX.source.options.length;
			document.INDEX.source.options[j]=a;
		}
	}
}
// Navigation index : page précédente
function PrevPage() {
	var terme = document.INDEX.source.options[0].text;
	if ( document.INDEX.t2994.value == terme ) {
		var message = document.INDEX.t2996.value;
		alert(message);
		return;
	}
	if ( document.INDEX.t2995.value > terme ) {
		AfficheIndex("","AZ");
	} else {
		AfficheIndex(terme,"ZA");
	}
}
// Navigation index : page suivante
function NextPage() {
	if (document.INDEX.source.length != document.INDEX.t2008.value) {
		var message = document.INDEX.t2997.value;
		alert(message);
		return;
	}
	var i=document.INDEX.source.length;
	AfficheIndex(document.INDEX.source.options[i-1].text,"AZ");
}

// gestion historiques

function EcrireCookie(nom, valeur)
{
	var date=new Date;
	date.setMonth(date.getMonth()+6);
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : date;
	var path=(argc > 3) ? argv[3] : "/";
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
 ((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
 ((path==null) ? "" : ("; path="+path))+
 ((domain==null) ? "" : ("; domain="+domain))+
 ((secure==true) ? "; secure" : "");
}
function getCookieVal(offset)
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom)
{
	var arg=nom+"=";
	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 null;
}

function CaseCocher(MFN,NOM) {
	if ( liste.indexOf(","+MFN+",") != -1 ) {
		document.write('<input onClick="Cochage(\'select'+MFN+'\',\''+NOM+'\');" type="checkbox" name="select'+MFN+'" value="'+MFN+'" checked>');
		document.getElementById("TR"+MFN).className="sel_on"; 
	} else {
		document.write('<input onClick="Cochage(\'select'+MFN+'\',\''+NOM+'\');" type="checkbox" name="select'+MFN+'" value="'+MFN+'">');
		document.getElementById("TR"+MFN).className="sel_off"; 
	}
}
function Cochage(CTL,NOM) {
	var chx = document.SELECT.elements[CTL].value;
	var flg = false;
	var i = liste.indexOf(","+chx+",");
	if ( document.SELECT.elements[CTL].checked ) {
		if ( i == -1 ) {
			liste = liste+chx+",";
			flg = true;
		}
		document.getElementById("TR"+chx).className="sel_on"; 
	} else {
		
		if ( i != -1 ) {
			if ( liste == ","+chx+"," ) {
				liste = ",";
			} else if ( i == 0 ) {
				liste = liste.substr(chx.length+1);
			} else {
				liste = liste.substr(0,i)+liste.substr(i+chx.length+1);
			}
			flg = true;
		}
		document.getElementById("TR"+chx).className="sel_off"; 
	}
	if ( flg ) EcrireCookie(NOM,liste);
	var total = liste.replace(/[^,]/gi,"");
	total = eval(total.length - 1);

	if (total >= 2) {
      total_tx = " fiches";   
  } else {
      total_tx = " fiche";
  }
  
  document.getElementById("panierh").innerHTML=total+total_tx;
	document.getElementById("panierb").innerHTML=total+total_tx;
}

function AffichePanier() {
	if (liste==null || liste=="null" || liste =="," ) {
		alert("Votre panier est vide.");
		return;
	}
	var chx = "(#"+liste+"#/(999))";
	chx = chx.replace("(#,","(#");
	chx = chx.replace(",#/","#/");
	chx = chx.replace(/,/gi,"#/(999)) OR (#");
	document.LIEN.t2005.value = document.ENVOI.t2005.value;
	document.LIEN.t2006.value = document.ENVOI.t2006.value;
	document.LIEN.t2004.value = "1";
	document.LIEN.t2003.value = "1000";
	document.LIEN.t2000.value = chx.replace(/#/gi,"\"");
	document.LIEN.t2001.value = chx;
	document.LIEN.t2002.value = "fiches sélectionnées";
	document.LIEN.action = document.LIEN.t2009.value + "/[in=demisis" +document.LIEN.t2013.value + "0.in]/";
	document.LIEN.submit();
}
function ChargePanier(nom,chp) {
	//liste=LireCookie("panier");
	if (liste==null || liste=="null") liste = ",";
	//var total = liste.replace(/[^,]/gi,"");
	//total = eval(total.length - 1);
	if (liste==null || liste=="null" || liste =="," ) {
		return;
	} else {
		var chx = "(#"+liste+"#/("+chp+"))";
		chx = chx.replace("(#,","(#");
		chx = chx.replace(",#/","#/");
		chx = chx.replace(/,/gi,"#/("+chp+")) OR (#");
		//document.ENVOI.t2003.value = "1000";
		document.ENVOI.t2000.value = chx.replace(/#/gi,"\"");
		document.ENVOI.t2001.value = chx;
		document.ENVOI.t2002.value = "fiches sélectionnées";
		document.ENVOI.action = document.ENVOI.t2009.value;
		document.ENVOI.target = "_self";
		document.ENVOI.t2999.value = "SE"
		document.ENVOI.submit();
	}
}

function PrintPanier(nom,chp) {
	//liste=LireCookie("panier");
	if (liste==null || liste=="null") liste = ",";
	//var total = liste.replace(/[^,]/gi,"");
	//total = eval(total.length - 1);
	if (liste==null || liste=="null" || liste =="," ) {
		return;
	} else {
		var chx = "(#"+liste+"#/("+chp+"))";
		chx = chx.replace("(#,","(#");
		chx = chx.replace(",#/","#/");
		chx = chx.replace(/,/gi,"#/("+chp+")) OR (#");
		//document.ENVOI.t2003.value = "1000";
		document.ENVOI.t2000.value = chx.replace(/#/gi,"\"");
		document.ENVOI.t2001.value = chx;
		//document.ENVOI.t2002.value = "fiches sélectionnées";
		document.ENVOI.t2002.value = "";
		document.ENVOI.action = document.ENVOI.t2009.value;
		document.ENVOI.target = "_blank";
		document.ENVOI.t2999.value = "PR"
		document.ENVOI.submit();
	}
}

function ViderPanier(nom,chx) {
	if ( chx == 0 ) {
		EcrireCookie(nom,'null');
		NewQuestion();
	} else {
		DecocherTout();
		EcrireCookie(nom,'null');
		document.getElementById("panierh").innerHTML="0 fiche";
		document.getElementById("panierb").innerHTML="0 fiche";
		liste=",";
	}
}
//
function CocherTout(NOM) {
	for (var i = 0; i < document.SELECT.elements.length; i++) {
		if (document.SELECT.elements[i].type == 'checkbox') {
			if ( !document.SELECT.elements[i].checked ) {
				document.SELECT.elements[i].checked = true;
				Cochage(document.SELECT.elements[i].name,NOM);
			}
		}
	}
}
// 
function DecocherTout(NOM) {
	for (var i = 0; i < document.SELECT.elements.length; i++) {
		if (document.SELECT.elements[i].type == 'checkbox') {
			if ( document.SELECT.elements[i].checked ) {
				document.SELECT.elements[i].checked = false;
				Cochage(document.SELECT.elements[i].name,NOM);
			}
		}
	}
}
//

// Imprime tout
function PrintAll() {
	var source=document.REQUETE.t2001.value;
	document.ENVOI.t2000.value = source.replace(/#/g,"\"");
	document.ENVOI.t2001.value = document.REQUETE.t2001.value;
	document.ENVOI.t2002.value = document.REQUETE.t2002.value;
	document.ENVOI.t2999.value = "PR";
	document.ENVOI.t2016.value = "2";
	document.ENVOI.target = "_blank";
	document.ENVOI.submit();
}

