
function Element(lchamp1, lchamp2, lchamp3, lchamp4, lchamp5, lchamp6, lchamp7, lchamp8, lchamp9)
{
	this.champ1=lchamp1;
	this.champ2=lchamp2;
	this.champ3=lchamp3;
	this.champ4=lchamp4;
	this.champ5=lchamp5;
	this.champ6=lchamp6;
	this.champ7=lchamp7;
	this.champ8=lchamp8;
	this.champ9=lchamp9;
}

function afficheEnregistrement(nomForm, lPath, refCategorie, id_enr) {

	var nomCateg = tab_Categories[refCategorie].champ2;
	var url = lPath + nomCateg + "/" + nomCateg + "_detail.php";

	document.forms[nomForm].form_ref.value=id_enr;
	document.forms[nomForm].lieninterne.value="yes";	

	document.forms[nomForm].action=url;
	document.forms[nomForm].submit();
}

function afficheCategorie(lPath, refCategorie, filtresContraintes, filtresTypes, typeSite){

	var lListe;
	if (typeSite == "admin")
		lListe = tab_Categories[refCategorie].champ5;
	else
		lListe = tab_Categories[refCategorie].champ8;

	var nomCateg;
	nomCateg=tab_Categories[refCategorie].champ2;

	url = lPath + nomCateg + "/" + lListe + "?filtre_fk=" + filtresContraintes + "&filtre_type=" + filtresTypes + "&lieninterne=yes";
	document.location=url;
}

function afficheGestionLien(lPath, refCategorie, nomChamplien, nomChampUrlLien, nomSelect, typeSite)
{
	var urlLien;
	var optionFenetre;
	var choixLien;
	
	choixLien = document.all[nomSelect].options[document.all[nomSelect].selectedIndex].value;

	if (choixLien == "mail") {
		urlLien=lPath + "liensinternes/lien_mail.php";
		optionFenetre = "toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,width=600,height=200,left=20,top=20";
	}
	else if (choixLien == "externe") {
		urlLien=lPath + "liensinternes/lien_externe.php";
		optionFenetre = "toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,width=600,height=300,left=20,top=20";		
	}		
	else if (choixLien == "interne_l") {
		urlLien=lPath + "liensinternes/lien_interne_l.php";
		optionFenetre = "toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,width=600,height=200,left=20,top=20";		
	}		
	else if (choixLien == "interne_d") {
		urlLien=lPath + refCategorie + "/" + refCategorie + "_lien_interne_d.php";
		optionFenetre = "toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,width=600,height=600,left=20,top=20";		
	}		

	window.open(urlLien + "?name="+nomChamplien+"&nameUrl="+nomChampUrlLien+"&typeSite="+typeSite+"&nomSelect="+nomSelect, "", optionFenetre);
}

function precedent(){
	history.go(-1);
}