﻿function ClearForm() {
    $get("FormDiv").style.display = "none";
    $get("ThanksDiv").style.display = "block";
    
    try {
        pageTracker._trackPageview("Thanks.html");
    } catch (err) { }
}

function ClearForm1() {
    $get("Form1Div").style.display = "none";
    $get("Thanks1Div").style.display = "block";

    try {
        pageTracker._trackPageview("Thanks.html");
    } catch (err) { }
}

function Validate() {

    if (document.getElementById("ContactForm_NameTextBox").value == "") {
        Alert($get("Bottom_NameErrorDiv").innerHTML);
        return false;
    }

    if (document.getElementById("ContactForm_EmailTextBox").value == "") {
        Alert($get("Bottom_EmailErrorDiv").innerHTML);
        return false;
    }

    if (IsEmail(document.getElementById("ContactForm_EmailTextBox")) == "error") {
        Alert($get("Bottom_EmailInvalidDiv").innerHTML);
        return false;
    }

    return true;
}

function Validate1() {

    if (document.getElementById("ContactForm_Name1TextBox").value == "") {
        Alert($get("Bottom_NameErrorDiv").innerHTML);
        return false;
    }

    if (document.getElementById("ContactForm_Email1TextBox").value == "") {
        Alert($get("Bottom_EmailErrorDiv").innerHTML);
        return false;
    }

    if (IsEmail(document.getElementById("ContactForm_Email1TextBox")) == "error") {
        Alert($get("Bottom_EmailInvalidDiv").innerHTML);
        return false;
    }

    return true;
}

function ValidateFB() {

    if (document.getElementById("FBForm_NameTextBox").value == "") {
        Alert("שם - שדה חובה");
        return false;
    }

    if (document.getElementById("FBForm_EmailTextBox").value == "") {
        Alert("אימייל - שדה חובה");
        return false;
    }

    if (IsEmail(document.getElementById("FBForm_EmailTextBox")) == "error") {
        Alert("אימייל לא תקין");
        return false;
    }

    return true;
}

function ValidateContact() {

    if (document.getElementById("NameTextBox").value == "") {
        Alert($get("Bottom_NameErrorDiv").innerHTML);
        return false;
    }

    if (document.getElementById("EmailTextBox").value == "") {
        Alert($get("Bottom_EmailErrorDiv").innerHTML);
        return false;
    }

    if (IsEmail(document.getElementById("EmailTextBox")) == "error") {
        Alert($get("Bottom_EmailInvalidDiv").innerHTML);
        return false;
    }

    return true;
}

function ValidateLandingPage() {

    if (document.getElementById("NameTextBox").value == "") {
        Alert("שם - שדה חובה");
        return false;
    }

    if (document.getElementById("EmailTextBox").value == "") {
        Alert("אימייל - שדה חובה");
        return false;
    }

    if (IsEmail(document.getElementById("EmailTextBox")) == "error") {
        Alert("אימייל לא תקין");
        return false;
    }

    if (document.getElementById("PhoneTextBox").value == "") {
        Alert("טלפון - שדה חובה");
        return false;
    }

    document.getElementById("SendButton").click();

}

