function validm(){if(trim(document.searchfrm.search.value)==""||document.searchfrm.search.value=="Type keyword (name, city, interest, company, school, title,..)"){alert("Enter search string");document.searchfrm.search.value="";document.searchfrm.search.focus();return false}else{document.searchfrm.submit()}}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function form_validate(){if(document.login.email.value==""){alert("Please enter your e-mail id");document.login.email.focus();return false}else{if(document.login.email.value!=""){str=document.login.email.value;var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!a.test(str)){alert("Please input a valid email address!");document.login.email.value="";document.login.email.focus();return false}}}if(trim(document.login.password.value)==""){alert("Please enter your password");document.login.password.value="";document.login.password.focus();return false}else{var b="e="+document.login.email.value+"&p="+document.login.password.value+"&cvalue="+document.login.checkbox.checked;xmlHttp1=GetXmlHttpObject();url="/userprofiles/log.php";xmlHttp1.open("POST",url,true);xmlHttp1.onreadystatechange=function(){if(xmlHttp1.readyState==4&&xmlHttp1.status==200){var c=xmlHttp1.responseText;if(c=="RES|1"){document.getElementById("abhijit11").innerHTML="Your emailid or password not matched, please try again";document.login.password.value="";document.login.password.focus()}else{window.location=c}return false}};xmlHttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp1.setRequestHeader("Content-length",b.length);xmlHttp1.setRequestHeader("Connection","close");xmlHttp1.send(b);return false}}function showlogin(b,a){if(b==1){b="open"}var d=document.getElementById("newmahi");var c=document.getElementById("newmahi2");if(b=="open"){d.style.display="block";c.style.display="block"}else{if(b=="close"){d.style.display="none";c.style.display="none"}}}function loginvalidation(){if(document.logintop.email.value==""){alert("Please enter your e-mail id");document.logintop.email.focus();return false}else{if(document.logintop.email.value!=""){str=document.logintop.email.value;var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!a.test(str)){alert("Please input a valid email address!");document.logintop.email.focus();return false}}}if(trim(document.logintop.password.value)==""){alert("Please enter your password");document.logintop.password.focus();return false}else{var b="e="+document.logintop.email.value+"&p="+document.logintop.password.value+"&cvalue="+document.logintop.checkbox.checked;xmlHttp=GetXmlHttpObject();url="/userprofiles/log.php";xmlHttp.open("POST",url,true);xmlHttp.onreadystatechange=stateChanged;xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length",b.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(b);return false}}function stateChanged(){if(xmlHttp.readyState==4&&xmlHttp.status==200){var a=xmlHttp.responseText;if(a=="RES|1"){document.getElementById("abhijit").innerHTML="Your emailid or password not matched, please try again";document.logintop.password.value="";document.logintop.password.focus()}else{window.location=a}return false}}function GetXmlHttpObject(){var a=null;try{a=new XMLHttpRequest()}catch(b){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP")}}return a};
