﻿function Validate()
{

    if(document.getElementById("NameTextBox").value=="")
    {
        ShowMessage("שם - שדה חובה", true, "200px");
        return false;
    }
    
    if(document.getElementById("EmailTextBox").value=="")
    {
        ShowMessage("אימייל - שדה חובה", true, "200px");
        return false;
    }
    
    if(!checkMail(document.getElementById("EmailTextBox").value))
    {
        ShowMessage("אימייל לא תקין", true, "200px");
        return false;
    }

    if(document.getElementById("PhoneTextBox").value=="")
    {
        ShowMessage("טלפון - שדה חובה", true, "200px");
        return false;
    }

    if(document.getElementById("RemarksTextBox").value=="")
    {
        ShowMessage("תיאור - שדה חובה", true, "200px");
        return false;
    }
    
    if(document.getElementById("SendButton")!=null)
    {
        document.getElementById("SendButton").click();
    }
}


function ClearForm()
{
    document.getElementById("NameTextBox").value="";
    document.getElementById("EmailTextBox").value="";
    document.getElementById("PhoneTextBox").value="";
    document.getElementById("RemarksTextBox").value="";
}
