    function validateRegForm(form){
        var iControl = "false";
        var email = trim(document.myForm[0].email.value); 
        var password = trim(document.myForm[0].password.value);                       
        var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
        var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
        function trim(s){return s.replace(/^\s+|\s+$/, '');}
        
        if (document.myForm[0].firstName.value == ""){
            document.myForm[0].firstName.style.background = '#ffff99';
            document.getElementById("lblfirstName").style.display = "";
            iControl="true";
        }else{
            document.myForm[0].firstName.style.background = 'White';
            document.getElementById("lblfirstName").style.display = "none";
        }
        if (document.myForm[0].lastName.value == ""){
            document.myForm[0].lastName.style.background = '#ffff99';
            document.getElementById("lbllastName").style.display = "";
            iControl="true";
        }else {
            document.myForm[0].lastName.style.background = 'White';
            document.getElementById("lbllastName").style.display = "none";
        }
        if (email == "") {
            document.myForm[0].email.style.background = '#ffff99';
            document.getElementById("lblemail").style.display = "";
            iControl="true";
        }else if (!emailFilter.test(email)) {              
            document.myForm[0].email.style.background = '#ffff99';
            document.getElementById("lblemail").style.display = "";
            iControl="true";
        } else if (email.match(illegalChars)) {
            iControl="true";
            document.myForm[0].email.style.background = '#ffff99';
            document.getElementById("lblemail").style.display = "";
        } else {
            document.myForm[0].email.style.background = 'White';
            document.getElementById("lblemail").style.display = "none";
        }
        if (password == "") {
            document.myForm[0].password.style.background = '#ffff99';
            document.getElementById("lblpassword").style.display = "";
            iControl="true";
        } else if ((password.length < 2) || (password.length > 15)) {
            document.myForm[0].password.style.background = '#ffff99';
            document.getElementById("lblpassword").style.display = "";
            iControl="true";
        } else if (illegalChars.test(password)) {
            document.myForm[0].password.style.background = '#ffff99';
            document.getElementById("lblpassword").style.display = "";
            iControl="true";
        } else if (!((password.search(/(a-z)+/)) && (password.search(/(0-9)+/)))) {
            document.myForm[0].password.style.background = '#ffff99';
            document.getElementById("lblpassword").style.display = "";
            iControl="true";
        } else {
            document.myForm[0].password.style.background = 'White';
            document.getElementById("lblpassword").style.display = "none";
        }
        if(iControl == "true"){
            return false;
        }else{
            return true;
        }
    }
