

	function trim(stringToTrim) {
 //alert(stringToTrim);
	return stringToTrim.replace(/^\s+|\s+$/g,'');
	}
	function valid()
	{

	  if(trim(document.searchfrm.search.value)=='')
	  {
	  	alert("Enter search string");
	  	document.searchfrm.search.value='';
	  	document.searchfrm.search.focus();
	  	return false;
	  }
	  else if(trim(document.searchfrm.search.value)=='Type keywords (topic, author name)')
	  {
	    alert("Enter search string");
	  	document.searchfrm.search.value='';
	  	document.searchfrm.search.focus();
	  	return false;
	  }
	  else
	  {
	  	document.searchfrm.submit();
	  }
	}


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 textCounter(c,a,b){if(c.value.length>b){alert("Characters limit Exceeded");c.value=c.value.substring(0,b)}else{a.value=b-c.value.length}}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function trim1(a){return a.replace(/^\s*|\s*$/g,"")}var vsource1;function videoSource1(a){vsource1=a}


function layerControl(c)
{

	if(c=="signin")
	{



		document.getElementById("newmahi").style.display="block";
		document.getElementById("newmahi2").style.display="block";


	}
	else if(c=="closesignin"){
		document.getElementById("newmahi").style.display="none";
		document.getElementById("newmahi2").style.display="none";


	}


}




function loginvalidation(){if(document.loginform.email.value==""){alert("Please enter your e-mail id");document.loginform.email.focus();return false}else{if(document.loginform.email.value!=""){str=document.loginform.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.loginform.email.focus();return false}}}if(trim(document.loginform.password.value)==""){alert("Please enter your password");document.loginform.password.focus();return false}else{var b="e="+document.loginform.email.value+"&p="+document.loginform.password.value+"&cvalue="+document.loginform.checkbox.checked;xmlHttp2=GetXmlHttpObject();url="/magazine/log.php";xmlHttp2.open("POST",url,true);xmlHttp2.onreadystatechange=function(){if(xmlHttp2.readyState==4&&xmlHttp2.status==200){var c=trim(xmlHttp2.responseText);if(c=="RES|1"){document.getElementById("abhijit").innerHTML="Your emailid or password not matched, please try again";document.getElementById("loginsubmit").value="Submit";document.loginform.password.value="";document.loginform.password.focus()}else{window.location=c}return false}else{document.getElementById("loginsubmit").value="Processing"}};xmlHttp2.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp2.setRequestHeader("Content-length",b.length);xmlHttp2.setRequestHeader("Connection","close");xmlHttp2.send(b);return false}}function loginCheck(){xmlHttp3=GetXmlHttpObject();var a="/magazine/logincheck.php";xmlHttp3.onreadystatechange=function b(){if(xmlHttp3.readyState==4&&xmlHttp3.status==200){document.getElementById("header").innerHTML='';document.getElementById("header").innerHTML=xmlHttp3.responseText}};xmlHttp3.open("GET",a,true);xmlHttp3.send(null)}
