        function checkForm(frm) 
        {
            var ordid
            var email, pass
       
            
            if (frm.name=="frmnew")
            {
                ordid = document.getElementById("txtOrderID")
    
                if (ordid.value == "") 
                {
    
                 alert("Please enter the OrderID.")
                 ordid.focus()
                 return false
    
                } else 
                {
    
                if (isNaN(ordid.value) == true) 
                {
                        alert("Incorrect Format for OrderID")
                        ordid.focus()
                        return false
                }else
                {
                    return true
                }
             }
           }else
           {
            email = document.getElementById("txtEmail")
            pass = document.getElementById("txtPass")
    
            if (email.value == "" || pass.value == "") 
            {
                if (email.value == "") {
                    alert("You are missing the Email.")
                    return false
                } else if (pass.value == "") {
                    alert("You are missing the Password.")
                    return false
                    
                 }   
            }else
            {
                return formatCheck()
            }
            
           }  
           
         }
    
    
    function formatCheck()
    {
        var preok, emailok
        preok = preCheckemail()
        if (preok == true) {
            emailok = checkEmail()
            if (emailok == true) {
                return true
            } else {
              
                email.focus()
                return false
            }
    
        } else {
            alert("Uknown issue. Please Report this to RCI")
            return false
        }
    
    }
    
    function checkEmail(){
        var str = document.frmexisting.txtEmail.value
        if (str == "") {
            return
        }
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str))
        testresults=true
        else{
        alert("Sorry, your email format appears invalid. Try re-entering it.")
        document.frmexisting.txtEmail.focus()
       
        testresults=false
        }
        return (testresults)
    }
    
    function preCheckemail(){
        if (document.layers||document.getElementById||document.all)
        return true
        else
        return false
    }
    


