String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
}
var tyUrlReg = /^((http:\/\/)(.){0,12}(tianya\.cn)(\/))/;
var hnUrlReg = /^((http:\/\/)(.){0,12}(hainan\.net)(\/))/;
var aParams="",fowardURL="",returnURL="";
aParams = document.location.search.substr(1).trim().split("&");
if(aParams!="" || aParams!=null)
{
	for (i=0; i < aParams.length ; i++)
	{
		if(aParams[i].toLowerCase().indexOf('fowardurl')!=-1)
		{
			fowardURL=aParams[i];
			fowardURL=fowardURL.split('=')[1];
			fowardURL=decodeURIComponent(fowardURL);
		}
		if(aParams[i].toLowerCase().indexOf('returnurl')!=-1)
		{
			returnURL=aParams[i];
			returnURL=returnURL.split('=')[1];
			returnURL=decodeURIComponent(returnURL);
		}
	}
}
if((!tyUrlReg.test(fowardURL)) && (!hnUrlReg.test(fowardURL)))
{
	fowardURL="";
}
if((!tyUrlReg.test(returnURL)) && (!hnUrlReg.test(returnURL)))
{
	returnURL=""
}
function GetPassWin()
{
	var GetPassurl = "http://id.tianya.cn/logon/tenya_find_password_new.asp";
	GetPasswindow = window.open(GetPassurl, 'rewin', 'left=100, top=100, width=600,height=500,resizable=1,status=0,menubar=0,scrollbars=1'); 
	GetPasswindow.focus();
}

function check_data()
{
	var login_action="http://login.tianya.cn/user/loginsubmit.asp";
	document.login.action=login_action
	document.login.submit();
	//document.login.button1.disabled='true'  //deleted at 20090202
}
//作用：让用户按回车键后提交页面
function   check_key(evt){
   evt= (evt)? evt :((window.event)?event:null);
   if(evt){
       if(evt.keyCode==13){
		check_data();
       }
   }
} 
