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}function show_qapopup(e,b,a){var d=a;var c=b;var g=document.getElementById("Layer1");var f=document.getElementById("Layer4");document.form1.paramp.value=c;document.form1.pmsgid.value=d;if(e=="open"){g.style.display="block";f.style.display="block"}else{if(e=="close"){g.style.display="none";f.style.display="none"}}}function loginvalidation(g,d){var b=g;var e=document.form1.paramp.value;var a=document.form1.pmsgid.value;if(document.form1.email.value==""){alert("Please enter your e-mail id");document.form1.email.focus();return false}else{if(document.form1.email.value!=""){str=document.form1.email.value;var c=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!c.test(str)){alert("Please input a valid email address!");document.form1.email.focus();return false}}}if(trim(document.form1.password.value)==""){alert("Please enter your password");document.form1.password.focus();return false}else{var f="e="+document.form1.email.value+"&p="+document.form1.password.value+"&cvalue="+document.form1.checkbox1.checked+"&real="+b+"&par="+e+"&parent="+a;xmlHttp=GetXmlHttpObject();url="/answers/login.php";xmlHttp.open("POST",url,true);xmlHttp.onreadystatechange=stateChanged;xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length",f.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(f);return false}}function stateChanged(){if(xmlHttp.readyState==4&&xmlHttp.status==200){if(xmlHttp.responseText=="RES|2"){document.getElementById("response").innerHTML="<font color='red'>Invalid User name or Password</font>"}else{document.form1.action=xmlHttp.responseText;document.form1.submit()}}}function redir(){if(trim(document.topsearch.search_topic1.value)==""){alert("Enter search string");document.topsearch.search_topic1.value="";document.topsearch.search_topic1.focus();return false}document.topsearch.checkbox_value.value=document.topsearch.topic.value;if(document.topsearch.topic.value=="1"){document.topsearch.search.value=document.topsearch.search_topic1.value;document.topsearch.action="/answers/questions_search.php";document.topsearch.submit()}else{if(document.topsearch.topic.value=="2"){document.topsearch.search.value=document.topsearch.search_topic1.value;document.topsearch.action="/network/membersearch.php";document.topsearch.submit()}}}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function echeck(f){var a="@";var b=".";var e=f.indexOf(a);var c=f.length;var d=f.indexOf(b);if(f.indexOf(a)==-1){alert("Invalid e-mail id");document.form1.email.focus();return false}if(f.indexOf(a)==-1||f.indexOf(a)==0||f.indexOf(a)==c){alert("Invalid e-mail id");document.form1.email.select();return false}if(f.indexOf(b)==-1||f.indexOf(b)==0||f.indexOf(b)==c){alert("Invalid e-mail id");document.form1.email.select();return false}if(f.indexOf(a,(e+1))!=-1){alert("Invalid e-mail id");document.form1.email.select();return false}if(f.substring(e-1,e)==b||f.substring(e+1,e+2)==b){alert("Invalid e-mail id");document.form1.email.select();return false}if(f.indexOf(b,(e+2))==-1){alert("Invalid e-mail id");document.form1.email.select();return false}if(f.indexOf(" ")!=-1){alert("Invalid e-mail id");document.form1.email.select();return false}return true}function textCheck(){xmlHttp4=GetXmlHttpObject();if(xmlHttp4==null){alert("Your browser does not support AJAX!");return}var a="/answers/logincheck.php";xmlHttp4.onreadystatechange=stateChanged4;xmlHttp4.open("GET",a,true);xmlHttp4.send(null)}function stateChanged4(){if(xmlHttp4.readyState==4&&xmlHttp4.status==200){document.getElementById("signcheck").innerHTML=xmlHttp4.responseText}};