var errFound = false;

function ValidEmail(item) {
    if (!ValidLength(item, 5)) return false;
    if (item.indexOf('@', 0) == -1) return false;
    return true;
}

function ValidLength(item, len) {
    return (item.length >= len);
}
function error(elem, text) {
    if (errFound) return;
    window.alert(text);
    elem.select();
    elem.focus();
    errFound = true;
}
function cValidate() {
    errFound = false;
    if (!ValidEmail(document.cform.cemail.value, 1))
        error(document.cform.cemail, "Please Enter Email ");
    if (document.cform.terms.checked == false) {
        error(document.cform.terms, "You must agree to the Terms of Use");
    }        
    return !errFound;
}

