<!-- Hide from old browsers

var i = 0;
var whitespace = " \t\n\r";
var phonefilter=/\d\d\d-\d\d\d-\d\d\d\d/;

//***********************************************
//* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
//* This notice must stay intact for legal use.
//* Visit http://www.dynamicdrive.com/ for full source code
//***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;

function checkmail(e)
{
    var returnval=emailfilter.test(e.value);
    if (returnval==false)
    {
      alert("Veuillez inscrire une adresse courriel valide :: Please enter a valid email address");
      e.select();
    }
    return returnval;
}


function webinar_form ()
{
    if (registration.Mois.options[0].selected)
    {
	alert("Veuillez sélectionner le mois :: Please select the desired month");
	registration.Mois.focus();
	return false;
    } 
    if (registration.Jour.options[0].selected)
    {
	alert("Veuillez sélectionner le jour :: Please select the desired day");
	registration.Jour.focus();
	return false;
    } 
    if (registration.Heure.options[0].selected)
    {
	alert("Veuillez sélectionner l'heure :: Please select the desired time");
	registration.Heure.focus();
	return false;
    } 
    if (registration.Langue.options[0].selected)
    {
	alert("Veuillez sélectionner la langue :: Please select the desired language");
	registration.Langue.focus();
	return false;
    } 

    return checkcommon();
}

function seminar_form()
{
    if (registration.ChoixSeminaire.options[0].selected)
    {
	alert("Veuillez sélectionner un séminaire :: Please select a seminar");
	registration.ChoixSeminaire.focus();
	return false;
    }

    return checkcommon();
}

function e_seminar_form()
{
    return checkcommon();
}


function bulletin_form()
{
    if (inscriptionbulletin.Nom.value == "")
    { alert("Veuillez inscrire votre nom :: Please enter your name");
	inscriptionbulletin.Nom.focus();	
	return false;
    }

    if (!checkmail(inscriptionbulletin.Courriel))
    { return false; }

    return true;
}


function checkcommon ()
{
    if (!checkmail(registration.Courriel))
    { return false; }

    if (registration.Nom.value == "")
    { alert("Veuillez inscrire votre nom :: Please enter your name");
	registration.Nom.focus();	
	return false;
    }

    if (registration.Poste.value == "")
    { alert("Veuillez inscrire votre poste :: Please enter your job title");
	registration.Poste.focus();	
	return false; }

    if (registration.Compagnie.value == "")
    { alert("Veuillez inscrire le nom de votre société :: Please enter your company");
	registration.Compagnie.focus();	
	return false; }

    if (!checkphone(registration.Telephone))
    { return false ; }

    return true;
}

function checkphone (phone)
{
   var returnphone=phonefilter.test(phone.value);

   if (returnphone==false) 
   {
	alert("Veuillez inscrire un no. téléphone valide :: Please enter a valid phone number\n\n ddd-ddd-dddd");
	phone.focus();
   }
   return returnphone;
}


//Script tiré de SelfHTML qui permet de valider les entrées de formulaire pour 
//des caractères non valides. Pour chaque champ texte, il faut inclure un événement
//qui appelle la fonction de validation, comme ci-dessous. 
//NOTE: /\w/ = caract. alphanumériques+underscore. N'accepte pas les carac accentués.
//NOTE: remplacé /\w/ par /[\w\séèçàùâêîôûäëïöü-É]/. Pas encore implanté dans les formulaires.
//<input type="text" name="exemple" onKeyPress="return scanTouche(event)">

function codeTouche(evenement)
{
        for (prop in evenement)
        {
                if(prop == 'which') return(evenement.which);
        }
        return(evenement.keyCode);
}

function scanTouche(evenement)
{
        var reCarValides = /[\w\séèçàùâêîôûäëïöü-É]/;

        var codeDecimal  = codeTouche(evenement);
        var car = String.fromCharCode(codeDecimal);
        var autorisation = reCarValides.test(car);

        return autorisation;
}


//-->

