        <!--
            function IsValidCharacters(email) {
                validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@.-_";
                len = email.length;

                for(i=0 ; i<len ; i++) {
                    letterPos = validChars.indexOf(email.charAt(i), 0);
                    if(letterPos < 0) {
                        return false;
                    }
                }
                return true;
            }
        
            function ValidateEmail(email) {
                if(email == null)                { alert("Email address cannot contain a NULL value."); return false; }
                if(email == "")                    { alert("Email address cannot contain an EMPTY value."); return false; }
                if(!IsValidCharacters(email))    { alert("Email address has INVALID characters."); return false; }
    
                /*
                **  @ symbol must not be the first character.
                */
                if (email.indexOf("@") == 0) {
                    alert("@ cannot be the first character.");
                    return false;
                }
                
                /*
                **  @ symbol must contain at least 1 instance.
                */
                if (email.indexOf("@") < 0) {
                    alert("Must contain at least one (1) @ symbol.");
                    return false;
                }

                /*
                ** Must contain only one @ symbol.
                */
                if (email.indexOf("@") != email.lastIndexOf("@")) {
                    alert("Must contain only one @ symbol.");
                    return false;
                }
                
                /*
                ** Last dot ( . ) must be after the @ symbol.
                */
                if (email.lastIndexOf(".") < email.indexOf("@")) {
                    alert("The last dot ( . ) must be after the @ symbol.");
                    return false;
                }

                /*
                ** Cannot have two dots ( .. ) together.
                */
                if (email.indexOf("..") >= 0) {
                    alert("Cannot have two dots ( .. ) together.");
                    return false;
                }

                /*
                ** Cannot have a dot ( . ) and @ symbol together.
                */
                if (email.indexOf(".@") >= 0) {
                    alert("Cannot have a dot ( . ) and @ symbol together.");
                    return false;
                }

                /*
                ** Cannot have an @ symbol and dot ( . ) together.
                */
                if (email.indexOf("@.") >= 0) {
                    alert("Cannot have an @ symbol and dot ( . ) together.");
                    return false;
                }

                /*
                ** Last character cannot be a dot ( . )
                */
                if (email.lastIndexOf(".") == (email.length - 1)) {
                    alert("Last character cannot be a dot ( . )");
                    return false;
                }
                return true;
            }
            
            function ValidateFirstName(firstname) {
                validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                len = firstname.length;

                if(firstname == "") { alert("Firstname MUST contain a value"); return false; }
                
                for(i=0 ; i<len ; i++) {
                    letterPos = validChars.indexOf(firstname.charAt(i), 0);
                    if(letterPos < 0) {
                        alert("First Name has INVALID characters.");
                        return false;
                    }
                }
                return true;
            }
            
            function ValidateForm(formObj) {
                // Initialisation of variables
                email = formObj.EmailAddress.value;
                firstname = formObj.FirstName.value;
                
                // validate email
                if(!ValidateEmail(email)) { 
                    formObj.EmailAddress.select();
                    return false;
                }
                
                // validate firstname
                if(!ValidateFirstName(firstname)) {
                    formObj.FirstName.select();
                    return false;
                }                
                return true;
            }
        -->