function showSignUpPopup(invitationCode){var x,y;if(self.innerHeight){x=self.innerWidth;y=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;y=document.documentElement.clientHeight;}else{if(document.body){x=document.body.clientWidth;y=document.body.clientHeight;}}}var xmlHttp=getXMLHTTP();var url="/users/registerPage?invitationCode="+invitationCode;if(xmlHttp){xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){var selectTag=document.getElementsByTagName("select");for(var i=0;i<selectTag.length;i++){selectTag[i].style.display="none";}var left=x/4;document.getElementById("SignUpWaterMark").style.width=x+"px";document.getElementById("SignUpWaterMark").style.left=left+"px";document.getElementById("SignUpWaterMark").style.height=(197+(2*y))+"px";document.getElementById("SignUpWaterMark").style.visibility="visible";document.getElementById("SignUpWaterMark").style.display="block";document.getElementById("SignUpWaterMark").innerHTML=xmlHttp.responseText;document.getElementById("emailId").focus();}else{alert(signup_page);}}};xmlHttp.open("GET",url,true);xmlHttp.send(null);}}function submitSignUpForm(){if(!validateEmail("emailId")){return false;}else{if(trim(document.getElementById("password").value)==""){alert(password);document.getElementById("password").focus();return false;}else{if(trim(document.getElementById("password").value).length<8){alert(valid_password);document.getElementById("password").focus();return false;}else{if(trim(document.getElementById("confirmpwd").value)==""){alert(confirm_password);document.getElementById("confirmpwd").focus();return false;}else{if(trim(document.getElementById("password").value)!=trim(document.getElementById("confirmpwd").value)){alert(not_match);document.getElementById("confirmpwd").value="";document.getElementById("confirmpwd").focus();return false;}else{if(trim(document.getElementById("firstName").value)==""){alert(first_name);document.getElementById("firstName").focus();return false;}else{if(trim(document.getElementById("lastName").value)==""){alert(last_name);document.getElementById("lastName").focus();return false;}else{if(trim(document.getElementById("mmcity").value)==0){alert(select_city);document.getElementById("mmcity").focus();return false;}else{document.signUpForm.method="post";document.signUpForm.submit();}}}}}}}}}function submitUserRegistrationForm(mode){var emailId=document.getElementById("regEmailId").value;var password=document.getElementById("password").value;var confirmpwd=document.getElementById("confirmpwd").value;var firstName=document.getElementById("firstName").value;var lastName=document.getElementById("lastName").value;var mmcity=document.getElementById("mmcity").value;if(!validateEmail("regEmailId")){return false;}else{if(trim(password)==""){alert("Please enter your password.");document.getElementById("password").focus();return false;}else{if(trim(password).length<8){alert(valid_password);document.getElementById("password").focus();return false;}else{if(trim(confirmpwd)==""){alert(confirm_password);document.getElementById("confirmpwd").focus();return false;}else{if(trim(password)!=trim(confirmpwd)){alert(not_match);document.getElementById("confirmpwd").value="";document.getElementById("confirmpwd").focus();return false;}else{if(trim(firstName)==""){alert(first_name);document.getElementById("firstName").focus();return false;}else{if(trim(lastName)==""){alert(last_name);document.getElementById("lastName").focus();return false;}else{if(trim(mmcity)==0){alert(select_city);document.getElementById("mmcity").focus();return false;}else{if(mode=="register"){document.userRegistrationForm.method="post";document.userRegistrationForm.action="/users/signUp?mode=register";document.userRegistrationForm.submit();}else{if(mode=="submitForm"){if(document.getElementById("confirmationCode").value==""){document.getElementById("confirmationCode").focus();alert("Please enter the confirmationCode.");return false;}document.userRegistrationForm.method="post";document.userRegistrationForm.action="/users/confirmRegistration";document.userRegistrationForm.submit();}else{if(mode=="inviteFriend"){document.userRegistrationForm.method="post";document.userRegistrationForm.action="/users/signUp";document.userRegistrationForm.submit();}}}}}}}}}}}}function checkEmailId(){regEmailId=document.getElementById("regEmailId").value;if(regEmailId){try{var url="/users/checkEmailExistence?emailId="+regEmailId;var xmlHttp=getXMLHTTP();if(xmlHttp){xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){var response=xmlHttp.responseText;if(!validateEmail("regEmailId")){document.getElementById("regEmailId").focus();return false;}else{if(response!="false"){alert("Sorry "+regEmailId+" is already registered. Please enter another EmailId.");document.getElementById("regEmailId").value="";document.getElementById("regEmailId").focus();}}}}};xmlHttp.open("GET",url,true);xmlHttp.send(null);}}catch(err){}}}function cancelSignUpPage(){document.getElementById("SignUpWaterMark").style.visibility="hidden";document.getElementById("SignUpWaterMark").style.display="none";var selectTag=document.getElementsByTagName("select");for(var i=0;i<selectTag.length;i++){selectTag[i].style.display="block";}}function userLoginSubmit(){if(document.getElementById("loginid").value==""){alert(email_required);document.getElementById("loginid").focus();return false;}else{if(document.getElementById("pwd").value==""){alert(password_required);document.getElementById("pwd").focus();return false;}else{if(document.getElementById("businessesList")){if(document.getElementById("businessesList").value!=" "){document.getElementById("businessesId").value=document.getElementById("businessesList").value;}}document.loginForm.method="post";document.loginForm.submit();}}}function forgotPassword(){if(document.getElementById("loginid").value==""){alert(email_required);document.getElementById("loginid").focus();return(false);}else{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("loginid").value)){var email=document.getElementById("loginid").value;document.loginForm.method="post";document.loginForm.action="/users/forgotPassword?emailId="+email;document.loginForm.submit();}else{alert(email_format);document.getElementById("loginid").focus();return false;}}}function showPopup(paramType,paramValue){var x,y;if(self.innerHeight){x=self.innerWidth;y=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;y=document.documentElement.clientHeight;}else{if(document.body){x=document.body.clientWidth;y=document.body.clientHeight;}}}var selectTag=document.getElementsByTagName("select");for(var i=0;i<selectTag.length;i++){selectTag[i].style.display="none";}var left=x/4;document.getElementById("waterMark").style.left=left+"px";document.getElementById("waterMark").style.height=(197+(2*y))+"px";document.getElementById("waterMark").style.visibility="visible";document.getElementById("waterMark").style.display="block";if(document.getElementById("loginFocus")){document.getElementById("loginFocus").value="true";}if(paramType=="url"){document.getElementById("redirectUrl").value=paramValue;}else{document.getElementById("backToAction").value=paramValue;}document.getElementById("loginid").focus();}function userSurveyLoginSubmit(surveyId){if(document.getElementById("surveyUserLoginId").value==""){alert(email_required);document.getElementById("surveyUserLoginId").focus();return false;}else{if(document.getElementById("surveyUserPassword").value==""){alert(password_required);document.getElementById("surveyUserPassword").focus();return false;}else{document.surveysLoginForm.method="post";if(surveyId!=""&&surveyId!="0"){document.surveysLoginForm.action="/Survey/"+surveyId;}else{document.surveysLoginForm.action="/Survey";}document.surveysLoginForm.submit();}}}function userCheckOutLoginSubmit(){if(document.guestLoginForm.guestEmailId.value==""){if(document.checkOutLoginForm.loginid.value==""){alert(email_required);document.checkOutLoginForm.loginid.focus();return false;}else{if(document.checkOutLoginForm.pwd.value==""){alert(password_required);document.checkOutLoginForm.pwd.focus();return false;}else{document.checkOutLoginForm.method="post";document.checkOutLoginForm.submit();}}}else{document.guestLoginForm.method="post";document.guestLoginForm.submit();}}function checkOutUserforgotPassword(){if(document.checkOutLoginForm.loginid.value==""){alert(email_required);document.checkOutLoginForm.loginid.focus();return(false);}else{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.checkOutLoginForm.loginid.value)){var email=document.checkOutLoginForm.loginid.value;document.checkOutLoginForm.method="post";document.checkOutLoginForm.action="/users/forgotPassword?emailId="+email;document.checkOutLoginForm.submit();}else{alert(email_format);document.checkOutLoginForm.loginid.focus();return false;}}}
