//window.onerror=function(){return true;};
String.prototype.trim = function() {
    return this.replace(/(^\s+)|(\s+$)/g, "");
}
function $(A){
    return document.getElementById(A)
} 

function Cookie(){
  this.SetValue=function(name,value,hours,path,domain){
    var str=new String();
    var nextTime=new Date();
    nextTime.setHours(nextTime.getHours()+hours);
    str=name+"="+escape(value);
    if(hours)
      str+=";expires="+nextTime.toGMTString();
    if(path)
      str+=";path="+path;
    if(domain)
      str+=";domain="+domain;
    document.cookie=str;
    }
  this.GetValue=function(name){
    var rs=new RegExp("(^|)"+name+"=([^;]*)(;|$)","gi").exec(document.cookie),tmp;
    if(tmp=rs)
      return unescape(tmp[2]);
    return null;
    }
}
  
__patrn__ = /\||\!|@|#|\$|%|\^|&|\*|\(|\)|_|\+|\-|}|{|\/|\.|,|\?|>|<|~|、|】|【|‘|；|’|、|。|，|￥|……|）|（|！/gi;

function isSearch(obj) {
	var ck=new Cookie();
	var isUserInfoFull=ck.GetValue("isUserInfoFull");
	if(isUserInfoFull=="false"){
		document.location.href="/msgback.jsp?msg=请先将您的个人信息填写完整！<br />点击 [<a href='/abo/useredit/goeditpwd.action'>这里</a>] 进行修改个人信息。";
		return false;
	}
	var s=$("sw").value.trim();
	return s.replace(__patrn__,"")!='';
}
function changeTag(tag,servlet,tempservlet){
	if(dftag==""){
		document.getElementById("me_"+servlet).style.display='none';
		document.getElementById("me_"+servlet+'_1').style.display='';
	}else{
		if(dftag!=tag){
			document.getElementById("me_"+servlet).style.display='none';
			document.getElementById("me_"+servlet+'_1').style.display='';
			document.getElementById(dftag).style.display='';
			document.getElementById(dftag+'_1').style.display='none';
		}
	}
	
	dftag="me_"+servlet;
	switch(servlet){
	case "search":{
		$("topuserinput").action="search";
		$("topchannel").value=tempservlet;
		break;
		}
		case "goqw.jsp":{
			$("topuserinput").action="/goqw.jsp";
				$("topchannel").value=tempservlet;
			break;
		}
		default:{
		$("topuserinput").action="gosearch.jsp";
			$("topchannel").value=tempservlet;
		break;
		}
	}
}
