
function loadMenuItem(id,lng){
	//alert(lng);
	var ln;
	if(lng==1){
		ln= 'fr';
	}	
	if(lng==2){
		ln= 'nl';
	}
	if(lng==3){
		ln= 'ger';
	}
	if(lng==4){
		ln= 'en';
	}
	new Ajax.Updater('mainContent', './Object/mainContainer.php', {method: 'post', postBody: 'content='+"0"+id  +"_"+ ln+".html"});
}
function goParent(obj,num){
	for (var i=0;i<num;i++){
		obj = obj.parentNode;
	}
	return obj;
}
function cacheMenu(dom_object){
	dom_object = goParent(dom_object, 2);
	dom_object.style.display="none";
}
//<!-- par MMM pour création des formulaire de contact-->
function loadform(form,ln){
	new Ajax.Updater('mainContent', './Object/mainContainer.php', {method: 'post', postBody: 'content='+form+"_"+ln+".html"});

}

function ValidMail(mail_address)
{
     // alert("teste la validité email"); 
	 return mail_address.match(/^([\w]+)@([\w]+)\.([\w]+)$/);
}

function loadform2(form,ln){

var email=formulairefr.EmailFrom.value;
	//	if ((email.indexOf('@',0)==-1) || (email.indexOf('.',0)==-1)) 
		// l'adresse entrée est incorrecte
//		alert("adresse email incorrecte");

if(document.formulairefr.FirstName.value == "")
  {
	if(ln=='fr') alert("Veuillez complèter votre PRENOM, svp.");
	else if (ln== 'nl') alert("Gelieve uw VOORNAAM in te vullen, aub.");
	formulairefr.FirstName.focus();
    return (false);

  }
 else if (formulairefr.LastName.value == "")
  {
    if(ln=='fr') alert("Veuillez complèter votre NOM, svp.");
    else if (ln== 'nl') alert("Gelieve uw NAAM in te vullen, aub.");
	formulairefr.LastName.focus();
    return (false);
  }
  else if (formulairefr.Company.value == "")
  {
    if(ln=='fr') alert("Veuillez complèter votre COMMUNE/CPAS/SOCIETE, svp.");
    else if (ln== 'nl') alert("Gelieve uw GEMEENTE/OCMW/BEDRIJF in te vullen, aub.");
	formulairefr.Company.focus();
	
      return (false);
  }
  else if (formulairefr.WorkTel.value == "")
  {
    if(ln=='fr') alert("Veuillez complèter votre TELEPHONE, svp.");
    else if (ln== 'nl') alert("Gelieve uw TELEFOON in te vullen, aub.");
	formulairefr.WorkTel.focus();
      return (false);
  }
  else 
  if ( !(ValidMail(email)) ) 
{
        if(ln=='fr') alert( "Adresse EMAIL invalide");
		else if (ln== 'nl') alert("Ongeldige EMAIL adres");
		formulairefr.EmailFrom.focus();
      return (false);
}

if( ln =='fr')
{	//new Ajax.Updater('mainContent', './Object/mainContainer_ok.php', {method: 'post', postBody: 'content='+"ok_"+ln+".php"});
	new Ajax.Updater('mainContent', './Object/mainContainer_fr.php', {method: 'post', postBody: 'content='+
	document.formulairefr.Company.value+ " "+ formulairefr.WorkTel.value+ " "+ formulairefr.EmailFrom.value+ " "
	
	
	});
}
else if( ln =='nl')
{	//new Ajax.Updater('mainContent', './Object/mainContainer_ok.php', {method: 'post', postBody: 'content='+"ok_"+ln+".php"});
	new Ajax.Updater('mainContent', './Object/mainContainer_nl.php', {method: 'post', postBody: 'content='+
	document.formulairefr.Company.value+ "|"+ formulairefr.WorkTel.value+ "|"+ formulairefr.EmailFrom.value+ "|"
	
	
	});
}


//}
}

