String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}


windowsize = function() {
	var w = 0;
	var h = 0;
	var sl = 0;
	var st = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	
	
	
	if (!document.documentElement.scrollTop) {
		sl = document.body.scrollLeft;
		st = document.body.scrollTop;
	} else {
		sl = document.documentElement.scrollLeft;
		st = document.documentElement.scrollTop;
	} 
	
	return {width:w,height:h,scrollLeft:sl,scrollTop:st};
}