
var postURL = "";

function CheckForm()
{
        if (document.getElementById("dak").value == "" || document.getElementById("dak").value == "Enter Email") 
        {
            document.getElementById("dak").value = "Enter Email Address";            
            return false;                
        }
        else if (isValidEmail(document.getElementById("dak").value) == false)
        {
        document.getElementById("dak").value = "Incorrect Email Address";
        return false;
        }
        else
        {
        var email=document.getElementById("dak").value;
        postURL="../newsletter.aspx?email="+email;
        return true;
        }
}
        
        
        
// for Checking the Email
function isValidEmail(str) {
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function SubmitEmail() {
    if (CheckForm()) {
        document.getElementById("iframepost").src = postURL;
        for (var i = 0; i < 1119000000; i++) { }
        document.getElementById("dak").value="Success";
        return true;
    }
    else
        return false;

}
