// registe the string function, trim()
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,'');
}
// registe the string function, ltrim()
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,'');
}
// registe the string function, rtrim()
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,'');
}

/* 
 * resizes only large images. Max image width is defined in - resetPicSize(this, 300)
 */
function resetPicSize(obj, x_size) {
   if (obj.offsetWidth > x_size) {
       obj.style.width = x_size;
   }
}