function checkForm(theForm, lang)
{

        if(theForm.s_email)
	{
		if( (theForm.s_email.value.length < 2) || (theForm.s_email.value.indexOf("@") ==-1) || (theForm.s_email.value.indexOf(".") ==-1) )
		{
                    if(lang!='en')
                        alert("Merci de renseigner le champs e-mail.");
                    else
                        alert("Please, fill the email field.");
                    return false;
		}
	}
	if(theForm.s_pwd.value.length < 2)
	{
            if(lang!='en')
                    alert("Merci de renseigner votre mot de passe.");
            else
                    alert("Please, fill the password field.");
            return false;
	}
	if(theForm.s_pwd2)
        {
            if(theForm.s_pwd2.value != theForm.s_pwd.value)
            {
                if(lang!='en')
                        alert("Les deux mots de passe doivent être identiques");
                else
                        alert("Both password must be the same.");
                return false;
            }
        }
	
	return true;
}
function submitKeys(e)  
{	
	if (e.keyCode == 13)
	{
		if(checkForm(document.loginform))
			document.loginform.submit();
	}
}
function login()
{
	if(checkForm(document.loginform))
			document.loginform.submit();
}
