String.prototype.trim=function(){
	return this.replace(/(^\s*)|(\s*$)/gi,'');
}
String.prototype.lTrim=function(){
	return this.replace(/^\s*/gi,'');
}
String.prototype.rTrim=function(){
	return this.replace(/\s*$/gi,'');
}
String.prototype.Replace=function(oldV,newV){
	return this.replace(eval('/'+oldV.replace(/\\/gi,'\\\\').replace(/(\[|\]|\(|\)|\.|\*|\?)/gi,'\\$1')+'/gi'),newV);
}
String.prototype.isEmpty=function(){
	return (this===undefined || this===null || !this.trim());
}
String.prototype.isNumber=function(){
	return (!isNaN(this) && this!=undefined && this!=null);
}

function showPanel(id,flag){
	if(flag===null || flag===undefined)
		flag=false;

	var p=$(id);
	if(p){
		p.style.display=(flag?'':'none');
	}else{
		alert(id);
	}
}

function $(id){
	if(typeof(id)=='object'){
		return id;
	}else{
		return document.getElementById(id);
	}
}

//获取Get变量
 var _GET={
	page:document.location.href,
	initialize:function(s){
		(!s) && (s=document.location.search);
		var _sear=s;

		(_sear.substr(0,1)=='?') && (_sear=_sear.substr(1));		
		this.page=document.location.href;
		
		
		if(_sear){
			this.page=this.page.replace('?'+_sear,'');			
			this.string=unescape(_sear);			
			var s='';
			if(_sear.indexOf('&')>0){
			 s=_sear.substr(0,_sear.indexOf('&'));
			 _sear=_sear.substr(_sear.indexOf('&')+1);
			}else{
			 s=_sear;
			 _sear='';
			}
			var twist=0;
			
			while(s && twist<10000){ 
			 if(s.indexOf('=')>0){
			  var vname =s.substr(0,s.indexOf('='));
			  var val  =s.substr(s.indexOf('=')+1);
			  if(vname){			  
			   this[this.trim(vname)]=unescape(this.trim(val));
			  }
			 }
			 

			 
			 if(_sear.indexOf('&')>0){
			  s=_sear.substr(0,_sear.indexOf('&')); 
			  _sear=_sear.substr(_sear.indexOf('&')+1);
			 }else{
			  s=_sear;
			  _sear='';
			 }
			 
			 twist++;
			}
		}
	},
	trim:function(s){
		return s.replace(/(^\s*)|(\s*$)/g,'');
	},
	toString:function(){
		var funcName={'toString':1,'trim':1,'initialize':1,'string':1,'page':1};
		var ret='';
		for(a in this){
			if(!funcName[a]){
				ret+=a+'='+this[a]+'&';
			}
		}

		ret=ret.substr(0,ret.length-1);
		return ret;
	}
};
_GET.initialize();
 