function validity()
{frm=document.frmlogin;if(frm.txt_email.value=="")
{frm.txt_email.value="Enter Email";return false;}
retval=IsEmailValid1(frm.txt_email);if(retval==true)
{if(frm.txt_pwd.value=="")
{document.getElementById("pwd").innerHTML='<input type="text"  class="blacktxt"  value="Enter Password"  onFocus="clearpwd()">';return false;}}
else
return false;}
function IsEmailValid1(str)
{var retval=true;var AtSym=str.value.indexOf('@');var Period=str.value.lastIndexOf('.');var Space=str.value.indexOf(' ');var Length=str.value.length-1;var index=str.value.indexOf('@');var substr=str.value.substring(index+1);var index2=substr.indexOf('@');var count=0;if(str.value=="")
{str.value="Enter Email";str.focus();return false;}
else
{for(i=0;i<str.value.length;i++)
{if(str.value.charAt(i)==" ")
count++;}
if(count==str.value.length)
{str.value="Enter Email";str.focus();return false;}
else if((AtSym<1)||(str.value.charAt(0)=='_')||(str.value.charAt(Length)=="_")||(str.value.indexOf("_")==AtSym+1)||(str.value.charAt(AtSym-1)=="_")||(Period<=AtSym+1)||(Period==Length)||((Space>0)&&(Space!=Length))||(index2!=-1))
{str.value="Enter Valid Email";str.focus();return false;}}
return true;}
function cleartext()
{document.frmlogin.txt_email.value="";}
function clearpwd()
{document.getElementById("pwd").innerHTML='<input type="password" class="blacktxt" name="txt_pwd" >';document.getElementById("txt_pwd").focus();}
function RMcatchme_now()
{if(document.getElementById('set_my_info').checked){document.getElementById('set_my_info').value=1;}else if(!(document.getElementById('set_my_info').checked)){document.getElementById('set_my_info').value="";}}
function IsForgotEmailValid(str,name,divid)
{var retval=true;var AtSym=str.value.indexOf('@');var Period=str.value.lastIndexOf('.');var Space=str.value.indexOf(' ');var Length=str.value.length-1;var index=str.value.indexOf('@');var substr=str.value.substring(index+1);var index2=substr.indexOf('@');var count=0;if(str.value=="")
{document.getElementById(divid).innerHTML="<span class='error'>Please enter Email</span>";str.focus();retval=false;}
else
{for(i=0;i<str.value.length;i++)
{if(str.value.charAt(i)==" ")
count++;}
if(count==str.value.length)
{document.getElementById(divid).innerHTML="<span class='error'>Please Enter Valid Please enter Email</span>";str.focus();retval=false;}
else if((AtSym<1)||(str.value.charAt(0)=='_')||(str.value.charAt(Length)=="_")||(str.value.indexOf("_")==AtSym+1)||(str.value.charAt(AtSym-1)=="_")||(Period<=AtSym+1)||(Period==Length)||((Space>0)&&(Space!=Length))||(index2!=-1))
{document.getElementById(divid).innerHTML="<span class='error'>Please Enter Valid "+name+"</span>";str.focus();retval=false;}}
return retval;}
function forgotPass(id)
{var email="";if(id==1)
{var form1=document.forgotfrm;if(form1.txtforgot.value=="")
{document.getElementById("frndmailalert").innerHTML="<span class='error'>Please Enter Email</span>";return false;}
else
{if(IsForgotEmailValid(form1.txtforgot,'Email','frndmailalert'))
{email=form1.txtforgot.value;document.getElementById("frndmailalert").innerHTML="";}
else
return false;}}
else
email="";var i=Math.round(100*Math.random())
var j=Math.floor(Math.random()*100000)
new_rqst=i+j;document.getElementById("forgot").innerHTML="<span class='msgs'>Loading....</span>";var url=SET_GLOBAL_VALUE+"forgotpass.php?id="+id+"&email="+email+"&newrequest="+new_rqst;xmlHttpForgot=GetXmlHttpObject(forGotPass);xmlHttpForgot.open("GET",url,true);xmlHttpForgot.send(null);}
function forGotPass()
{if(xmlHttpForgot.readyState==4)
{document.getElementById("forgot").innerHTML=xmlHttpForgot.responseText;}}
function toshop(id){if(id==0)
location.href='shop/index.php';else
location.href='shop/product_desc.php?prod_id='+id;}
function togame(id){location.href='games/game_display.php?game_id='+id;}
function toprofile(arg1,arg2){location.href='myaccount/viewfriendsprofile.php?'+arg1+'='+arg2;}