Object.prototype.trim=function(){
	return (this.replace(/^\s*/,"")).replace(/\s*$/,"");
}

Object.prototype.ltrim=function(){
	return this.replace(/^\s*/,"");
}

Object.prototype.rtrim=function(){
	return this.replace(/\s*$/,"");
}

Object.prototype.wrap=function(len){
	if(this.length>len){
		newtext="";
		var lines=(this.length-(this.length%len))/len;
		for(var i=0;i<lines;i++){
			newtext+=this.substr(i*len,len)+"<br/>";
		}
		newtext+=this.substr(i*len,this.length);
		return newtext;
	}
	return this;
}

Object.prototype.isEmail=function(){
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	return emailReg.test(this);
}

Object.prototype.isText=function(){
	return this.match(/^[a-zA-Z ]+$/)!=null;
}

Object.prototype.isInteger=function(){
	return this.toString().match(/^\d+$/)!=null;
}

Object.prototype.isFloat=function(){
	return this.toString().match(/^\d+\.\d+$/)!=null;
}

Object.prototype.isNumber=function(){
	return this.toString().isInteger()||this.isFloat();
}

Object.prototype.isLeapYear=function(){
	return (this%4==0&&(this%100!=0||this%400==0));
}

Object.prototype.appendZero=function(len){
	if(!len)len=2;n=this;for(var i=0;i<len-this.toString().length;i++)n="0"+n;return n;
}

Object.prototype.toPixel=function(){
	return isNaN(this)?null:this.toString()+"px";
}

Object.prototype.toPercentage=function(base){
	return (isNaN(this)||isNaN(base))?null:(this/base)*100+"%";
}

Object.prototype.reversed=function(){
	var ns="";for(var i=0;i<this.length;i++)ns=this.substr(i,1)+ns;return ns;
}

Object.prototype.superSplit=function(symbols){
	var v=this;if(symbols.length>1){for(var i=1;i<symbols.length;i++){var sb=symbols.substr(i,1);if(sb=="/")sb="\\/";else if(sb==".")sb="\\.";eval("v=v.replace(/"+sb+"/g,'"+symbols.substr(0,1)+"')");}}return v.split(symbols.substr(0,1));
}

Object.prototype.inArray=function(ary){
	for(var i=0;i<ary.length;i++){if(ary[i]==this)return i;};return null;
}