// JavaScript Document
//change_classe.When a form field is focused, the color of the element changes.
//This function allows to change the settings for the design of the class used when the element is focused.
function change_classe(formulaire,champ,etat) {
	eval("document." + formulaire + "." + champ).className = etat;
}

function SetFocusOn() {
   var d = document;
   if ( d.getElementById)
       d.forms[1].elements[0].focus();
}


//Acceder la page demandée
function acceder_page(){
	i 	=	document.menuform.menu.value;
	
	if (i != '0'){
		
		switch(i){
			case '0' :	actionContent 	= 	"";
						break;			
			case '1' : 	actionContent 	= 	"representants";
						break;
			case '2' : 	actionContent 	= 	"gestion_livres";
						break;
			case '3' : 	actionContent 	= 	"gestion_magazines";
						break;
			case '4' : 	actionContent 	= 	"gestion_cdcassettes";
						break;
			case '6' : 	actionContent 	= 	"tips";
						break;						
			case '7' : 	actionContent 	= 	"";
						break;
			case '10' : actionContent 	= 	"ajout_livres";
						break;		
			case '11' : actionContent 	= 	"ajout_magazines";
						break;
			case '13' : actionContent 	= 	"ajout_cdcassettes";
						break;
			case '14' : actionContent 	= 	"";
						break;
			case '15' : actionContent 	= 	"dispStockPromo";
						break;
		}
		if (actionContent != ""){
			window.parent.location.href = actionContent + ".php";
		}
	}
}

