//Explorateurs
var isNav, isIE
if( document.all ){
	isIE = true;
}
else{
	isNav = true;
}

//login
function CheckLogIn(form_name){ //verifie la saisie des forms login/pwd

	l=eval("document."+form_name+".login.value");
	p=eval("document."+form_name+".pwd.value");
	if( p.length > 0 && l.length > 0 ){
		eval("document."+form_name+".submit()");
	}
}//CheckLogin


//Mail
function CheckMail(str_mail){
	arobas=str_mail.indexOf("@");//existence de l'@
	point=str_mail.indexOf(".");//existence du point
		if ((point==-1) || (arobas==-1)){
			return false;
		}
		else {
			return true;
		}
}
//Registration Form
function CheckRegistration(){

	mail 		= document.register.mail.value;
	name 		= document.register.name.value;
	lastname 	= document.register.lastname.value;
	firm 		= document.register.firm.value;
	errMsg		= "";
//	if( ! CheckMail( mail ) ) { 	errMsg 	+= "\n- Mail adress seems to be invalid"; }
	if( mail.length == 0)	  {		errMsg	+= "\n- Mail"; }
	if( name.length == 0 )    { 	errMsg	+= "\n- Name";  }
	if( lastname.length == 0 ){ 	errMsg	+= "\n- Last Name";  }
	if( firm.length == 0 )    { 	errMsg	+= "\n- Firm";  }
	if( errMsg != "" ){
		window.alert( "Please, enter all mandatory fields" + errMsg );
	
	} else {
		document.register.submit();
	}
}

//hilight des cellules menus haut
var current_top_class;
function MenuTopCellOn(idx){
	current_top_class = document.all[idx].className;
	document.all[idx].className="menu_haut_on";
return;
}
function MenuTopCellOff(idx){
	document.all[idx].className=current_top_class;
return;
}

//hilight des cellules menus de gauche
var current_left_class;
function MenuLeftCellOn(idx){
	current_left_class = document.all[idx].className;
	document.all[idx].className="menu_left_on";
return;
}
function MenuLeftCellOff(idx){
	
	document.all[idx].className=current_left_class;
return;
}

//hilight des cellules menus de gauche

function MenuRightCellOn(idx){
	document.all[idx].className="menu_right_on";
return;
}
function MenuRightCellOff(idx){
	document.all[idx].className = "menu_right_off";
return;
}


//lien vers une du site
function GoTo( menu, article, str_url ){
	//alert("url="+str_url);
	if( str_url == "" ){
		document.location="/index.php?page="+menu+"&id="+article;
	}
	else{
		document.location=str_url;
	}
}

//redirige vers la page de recuperation du fichier
var doc_home = "ressources.azuron/medias/docs/";
function GetDoc(n){ //a finir

		$doc = doc_home+n;
		document.location = $doc;
/*
  header("Content-Type: octet-stream"); 
  header("Content-Length: ".filesize($url) ); 
  header("Content-Disposition: attachment; filename=$filename"); 
*/ 

}

//Hilight Champ des formulaires
var highlightcolor="lightblue"
var previous=''
var eventobj;
var formLight=/INPUT|TEXTAREA|SELECT|OPTION/

/*
function hilightForm(e){
	var eventobj = event.srcElement;
	if (previous!='' && formLight.test(eventobj.tagName)){
		previous.style.backgroundColor=''
		previous=eventobj
		eventobj.style.backgroundColor=highlightcolor
	}
	else if(previous=='' && formLight.test(eventobj.tagName)){
		eventobj.style.backgroundColor=highlightcolor
		previous=eventobj
	}
	else{
		previous.style.backgroundColor=''
	}
}
*/
function hilightForm(e){
	return;
}//hilightForm


function ejs_img_fx(img){ //effet mozaique
	if(img && img.filters && img.filters[0]){
		img.filters[0].apply();
		img.filters[0].play();
	}
}//effet mozaique
