//
//
// Created By:    Author: Dane Jorgensen
// Revision:      $Revision: 1.1.1.1 $
// Last Modified: $Date: 2005/02/16 20:58:36 $
// Modified By:   $Author: project $
// Source:        $Source: /home/project/usr/local/cvsroot/dtpxpress.com/htdocs/includes/js/login.js,v $
//
//




function checkForm() {


    var obj = document.createAcct;
    var errMsg = "Please correct the following error(s):      ";
    var bFlag = true;
    var isFocus = false;
    var goodEmail = obj.email.value.search(/^[^\.][A-Za-z0-9_\-\.]*[^\.]\@[^\.][A-Za-z0-9_\-\.]+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.biz)|(\.us)|(\.bizz)|(\.coop)|(\..{2,2}))[ ]*$/gi);



    if ( obj.password.value.length==0 ) {
        errMsg+="\n     Please fill in your password."
        obj.password.focus();
        isFocus = true;
        bFlag = false;
    }
    if ( obj.password2.value.length==0 ) {
        errMsg+="\n     Please fill in your password again."
        obj.password2.focus();
        isFocus = true;
        bFlag = false;
    }
    if ( obj.firstName.value.length==0 ) {
        errMsg+="\n     Please fill in your first name."
        obj.firstName.focus();
        isFocus = true;
        bFlag = false;
    }
    if ( obj.lastName.value.length==0 ) {
        errMsg+="\n     Please fill in your last name."
        obj.lastName.focus();
        isFocus = true;
        bFlag = false;
    }
    if (obj.email.value == "" || obj.email.value == " ") {
        errMsg+="\n     Please enter your Email address."
        if (!isFocus) {
            obj.email.focus(); 
            isFocus = true; 
        }
        bFlag = false;
    }
    else if (!(goodEmail!=-1)) {
        errMsg+="\n     Please enter a valid Email address."
        if (!isFocus) { 
            obj.email.focus(); 
            isFocus = true; 
        }
        bFlag = false;
    }

    if (!bFlag) {
        alert(errMsg); 
        errMsg=""; 
    }

    return bFlag;
}
