

            function homeVal()
            {
                var res = "";
                var message = "";
                var homeForm=window.document.FirstTimeForm;
                var homeEmail=homeForm.homeEmail.value;
                var homeUser=homeForm.homeUser.value;

                res=emptyVal(homeEmail);
                if(res!="")
                {  message=res;
                    alert("Please enter your E-Mail address ");
                    homeForm.homeEmail.focus();
                    return false;
                }

                res=emailVal(homeEmail);
                if(res!="")
                {
                    message = res;
                    alert("Please enter your valid E-Mail address ");
                    //homeForm.homeEmail.value="";
                    homeForm.homeEmail.focus();return false;
                }
                res=fieldLength(homeEmail,9,45);
                if(res!="")
                {
                    message = " Your E-Mail " + res;
                    alert(message);
                    homeForm.homeEmail.value="";
                    homeForm.homeEmail.focus();return false;
                }

                res=emptyVal(homeUser);
                if(res!="")
                {  message=res;alert("Please Select the UserType");
                    homeForm.homeUser.focus();
                    return false;
                }
                homeForm.action="HomeServlet";
                homeForm.method="post";
                homeForm.submit();
                return true;


            }

            function loginfn()
            {
                    var res = "";
                var message = "";

                var homeForm=window.document.homeForm;
                var loginEmail = homeForm.loginEmail.value;
                var loginPsw = homeForm.loginPsw.value;

                res=emptyVal(loginEmail);
                if(res!="")
                {  message=res;alert("Please enter username");
                    homeForm.loginEmail.focus();
                    return false;
                }
                res=emailVal(loginEmail);
                if(res!="")
                {
                    message = "Please enter valid username";
                    alert(message);homeForm.loginEmail.focus();return false;
                }
                res=fieldLength(loginEmail,9,45);
                if(res!="")
                {
                    message = " Your E-Mail "+res;
                    alert(message);homeForm.loginEmail.focus();return false;
                }
                res=emptyVal(loginPsw);
                if(res!="")
                {  message=res;alert("Please Enter Password");
                    homeForm.loginPsw.focus();
                    return false;
                }

                res=userVal(loginPsw);
                if(res!="")
                {
                    message = "Password "+res;
                    alert(message);homeForm.loginPsw.focus();
                    homeForm.loginPsw.value="";return false;
                }
                res=fieldLength(loginPsw,6,15);
                if(res!="")
                {
                    message = "Password "+res;
                    alert(message);homeForm.loginPsw.focus();
                    homeForm.loginPsw.value="";return false;
                }
                homeForm.action="SigninServlet";
                homeForm.method="post";
                homeForm.submit();
                return true;

            }

