Object.extend(String.prototype, {
	trim: function(){
		return this.replace(/^\s+|\s+$/g, '');
	}
});


Object.extend(Array.prototype, {
  serialstring: function(str) {
  	if (!str){str="";}
    return this.join(str);
  }
});



$CE=Element.createNew;
var $SV = Form.Element.setValue;
var $eF = Form.Element.egetValue;
var $dF = Form.Element.dgetValue;


Object.extend(window, {
pageWidth:function () {
	return Math.max(this.getWidth(),this.getScrollWidth());
},
pageHeight:function () {
	return Math.max(this.getHeight(),this.getScrollHeight());
},
getWidth:function () {
	if(this.opera){return this.innerWidth;
	}else{
	return [ document.documentElement.clientWidth , document.body.clientWidth ].find(function(s) {return (s!==undefined && s!==0);}) || 0;
	}
}, getHeight:function () {
	if(this.opera){return this.innerHeight;
	}else{
	return [   document.documentElement.clientHeight,document.body.clientHeight  ].find(function(s) {return (s!==undefined && s!==0);}) || 0;
	}
}, getScrollWidth:function () {
	if (this.ie) {
		return Math.max(document.body.offsetWidth, document.body.scrollWidth);
	}
	if (this.khtml) {
		return document.body.scrollWidth;
	}
	return document.documentElement.scrollWidth;
}, getScrollHeight:function () {
	if (this.ie) {
		return Math.max(document.body.offsetHeight, document.body.scrollHeight);
	}
	if (this.khtml) {
		return document.body.scrollHeight;
	}
	return document.documentElement.scrollHeight;
}, getScrollLeft:function () {
	return [ document.documentElement.scrollLeft , document.body.scrollLeft , this.pageXOffset].find(function(s) {return (s!==undefined && s!==0);}) || 0;
}, getScrollTop:function () {
	return [ document.documentElement.scrollTop, document.body.scrollTop, this.pageYOffset].find(function(s) {return (s!==undefined && s!==0);}) || 0;
}, getSize:function () {
	return {"size":{"x":this.getWidth(), "y":this.getHeight()}, "scrollSize":{"x":this.getScrollWidth(), "y":this.getScrollHeight()}, "scroll":{"x":this.getScrollLeft(), "y":this.getScrollTop()}};
}});


function AconvertTextara(text){
	text=text.replace(new RegExp('&quot;', "g"),'"');
	text=text.replace(new RegExp("&gt;", "g"),">");
	text=text.replace(new RegExp("&lt;", "g"),"<");
	text=text.replace(new RegExp("&amp;", "g"),"&");
	return text;
}

/*--------------------------------------------------------------------------*/
