﻿function validate_email(field, alerttxt) 
{
    with (field) 
    {
        apos = value.indexOf("@");
        dotpos = value.lastIndexOf(".");
        if (apos < 1 || dotpos - apos < 2)
        { alert(alerttxt); return false; }
        else { return true; }
    }
}

function validate_form(thisform) 
{
    with (thisform) 
    {
        if (validate_email(email, "Not a valid e-mail address! Please enter valid email address") == false)
        { email.focus(); return false; }
    }
}


function blank() 
 {
    if (this.typeMismatch('text')) return;
    if (this.isBlank()) 
    {
        this.throwError([this.elem.fName]);
    }
}




function checkform(f) {
    if (f.elements["textfield"].value == "") {
        alert("Search keyword cannot be empty. Please enter the keyword that you wish to search for.");
        return false;
    }
    else {
        return true;
    }
}

