// fenetre affichant les informations sur l'ecotype
function aproposde( test ) {
	var w=window.open("../popup/popGeneral/print_info_eco.php?test="+test, "aproposde", "scrollbars, rezisable=yes, left=50, top=30, width=400, height=650");
	w.document.close();
	w.focus();
}

// fenetre affichant la bibliographie
	function biblio( test1 ) {
		var w=window.open("../popup/popGeneral/info_biblio.php?test="+test1, "biblio", "scrollbars, rezisable=yes, left=50, top=30, width=500, height=500");
		w.document.close();
		w.focus();
	}


// fenetre d'information sur les lignees rils 
	function info_rils( test2 ) {
		var w=window.open("../popup/popGeneral/info_rils.php?test="+test2, "info_rils", "scrollbars, rezisable=yes,  left=150, top=150, width=400, height=250");
		w.document.close();
		w.focus();
	}

// fenetre d'impression de la fiche informative des ecotypes dans la recherche multicritère 
 	function print_info_eco( test ) {
		var w=window.open("../popup/popGeneral/print_info_eco.php?test="+test, "print_info_eco", "scrollbars, rezisable=yes,  left=70, top=20, width=700, height=650");
		w.document.close();
		w.focus();
	}

// fenetre d'impression de la fiche informative des ecotypes dans la recherche multicritère
 
	function info_rils_meth( test ) {
		var w=window.open("../popup/popGeneral/info_rils_meth.php?test="+test, "info_rils_meth", "scrollbars, rezisable=yes,  left=5, top=100, width=500, height=400");
		w.document.close();
		w.focus();
	}

// affichage des informations sur l'obtention des lignees RILs 
 
	function popRils( test ) {
		var w=window.open("../popGeneral/popRils.php?test="+test, "popRils", "scrollbars, rezisable=yes,  left=5, top=20, width=700, height=550");
		w.document.close();
		w.focus();
	}
	
	function popInfoCharacterization() {
		var w=window.open("../popup/popInsert/Info_Characterization.php", "popInfoCaracterization", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}

	function popInfoCollection() {
		var w=window.open("../popup/popInsert/Info_Collection.php", "popInfoCollection", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
	function popInfoPasseport() {
		var w=window.open("../popup/popInsert/Info_Passeport.php", "popInfoPasseport", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
	function popInfoThematicContact() {
		var w=window.open("../popup/popInsert/Info_ThematicContact.php", "popInfoThematicContact", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
	function popInfoDownloadFile() {
		var w=window.open("../../popup/popInsert/popInfoDownloadFile.html", "popInfoDownloadFile", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
// Fonction permettant de recharger la page avec les
// informations sur le contact selectionné dans la liste
 
	function chgpage(formulaire) {
		if (formulaire.liste.selectedIndex != 0) {
			location.href = formulaire.liste.options[formulaire.liste.selectedIndex].value;
		}
	}

	function popInsertInfo() {
		var w=window.open("../../popup/popInsert/Info_InsertInfo.php", "popInsertInfo", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=400");
		w.document.close();
		w.focus();
	}
	
	function popInsertRes() {
		var w=window.open("../popup/Info_InsertRes.php", "popInsertRes", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
	function popInsertCol() {
		var w=window.open("../popup/Info_InsertCol.php", "popInsertCol", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}
	
	function popInsertPas() {
		var w=window.open("../popup/Info_InsertPas.php", "popInsertPas", "scrollbars, rezisable=yes,  left=20, top=20, width=500, height=300");
		w.document.close();
		w.focus();
	}	
	
// Fonction pour l'insertion	
function OpenPopup ( page, nom, option ) {
	window.open(page, nom, option );
}

function textareaSize(zoneTexte) {
	if (zoneTexte) {
	  nbrLignes=2;longueurDeLigne=2; // Taille minimal de la zone de texte.
	  nbrLignesMax=18;longueurDeLigneMax=17; // Taille maximale de la zone de texte.
 	 lesLignes=escape(zoneTexte.value).split("%0D%0A");
 	 if (lesLignes) {nbrLignes=lesLignes.length;}
 	 if (nbrLignes>document.body.clientHeight/nbrLignesMax) {nbrLignes=document.body.clientHeight/nbrLignesMax;}
	
 	 if (lesLignes) {
 	  for(n=0; n<(lesLignes.length); n++) {
 	   if (longueurDeLigne<unescape(lesLignes[n]).length) {longueurDeLigne=unescape(lesLignes[n]).length;}
 	   if (longueurDeLigne>document.body.clientWidth/longueurDeLigneMax)
 	  {
 	  longueurDeLigne=document.body.clientWidth/longueurDeLigneMax;
 	  nbrLignes+=unescape(lesLignes[n]).length/(document.body.clientWidth/longueurDeLigneMax);
 	  }
 	  }
 	 }
  else {longueurDeLigne=zoneTexte.value.length}
 	 zoneTexte.cols=(longueurDeLigne+1); // Charge le nombre de colonnes utile, plus une colonne pour la clarté
 	 zoneTexte.rows=(nbrLignes+1); // Charge le nombre de lignes utile, plus une ligne pour la clarté
	}
}	


// popup non utilisé => à vérifier !

// fenetre affichant les "donnees brutes" sur un ecotype
	function popup( test ) {
		var w=window.open("../popup/info_supl.php?test="+test, "popup", "scrollbars, rezisable=yes, left=50, top=30, width=400, height=600");
		w.document.close();
		w.focus();
	}

// fenetre affichant les donnees climatologiques 
	function climato( test ) {
		var w=window.open("../popup/info_climato.php?test="+test, "climato", "scrollbars, rezisable=yes,  left=50, top=30, width=400, height=500");
		w.document.close();
		w.focus();
	}

// fenetre regroupant les informations d'un ecotype pour l'impression
	function impression( test ) {
		var w=window.open("../popup/Impression.php?test="+test, "impression", "scrollbars, rezisable=yes,  left=50, top=30, width=600, height=500");
		w.document.close();
		w.focus();
	}	
	