﻿
    function onLoad_(){
        if (setSSL(false))
                return;
    }

    function onSubmitContact(){
        document.getElementById("butSubmit").disabled = true;
        window.setTimeout("onSubmitContact2()",111);  
    }

    function onSubmitContact2(){
        var szName = document.getElementById("txtName").value;
        var szEmail = document.getElementById("txtEmail").value;
        var szBody = document.getElementById("txtBody").value;
        var iSel = document.getElementById("ddRestaurant").selectedIndex;
        var szSite = document.getElementById("ddRestaurant").options[iSel].text;
        
        ob_post.ResetParams(); 
        ob_post.AddParam("szName", szName); 
        ob_post.AddParam("szEmail", szEmail); 
        ob_post.AddParam("szBody", szBody); 
        ob_post.AddParam("szSite", szSite); 
        ob_post.post(null, "onSubmit_", funcNull);
    }

    function onSendEmail(){
        document.getElementById("txtName").value = "";
        document.getElementById("txtEmail").value = "";
        document.getElementById("txtBody").value = "";
        document.getElementById("ddRestaurant").selectedIndex = 0;
        alert("Your contact request has been submitted.");
        window.location = "./";
    }

    function checkEmail(){
        var szEmail = document.getElementById("txtEmail").value;
        var bOK = emailCheck(szEmail);
        var szDisplay = "none";
        if (!bOK)
            szDisplay = "inline"
        
        document.getElementById("butSubmit").disabled = !bOK;
        document.getElementById("divEmailChecker").style.display = szDisplay;
    }