﻿function ValidateLoginForm(){
var doclickevent = true; 
var fullname=$(".FullName").val();
var email=$(".Email").val();
var cell=$(".Cell").val();
if (fullname=="")
{
$(".ErrFullName").css('display', 'block');
doclickevent=false;
}
else
{
$(".ErrFullName").css('display', 'none');
}
if ( (email == "") || (Validate_Email(email)==false)){
$(".ErrEmail").css('display', 'block');
doclickevent=false;
}
else
{
$(".ErrEmail").css('display', 'none');
}
if ((cell == "") ||(cell.length != 7) || (Validate_OnlyDigits(cell) == false)) {
$(".ErrCell").css('display', 'block');
doclickevent=false;
}
else
{
$(".ErrCell").css('display', 'none');
}

if (doclickevent==true)
  $(".btnLottery").click();
}
function Validate_OnlyLetters(str) {
return /^ *[א-ת\s\.\-\']+ *$/.test(str);
}
function Validate_OnlyDigits(str) {
return /^ *[0-9\.]+ *$/.test(str);
}
function Validate_Email(mail) 
{
var re = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
var Match = re.exec(mail);

if ((Match != null) && (mail == Match[0]))
{
    return true;
} 
else
{
    return false;
}
}

