String.prototype.toInt = function() {
	if(/^-/.test(this)) {
		return this.replace(/[^0-9]/g, '') * -1;
	} else {
		return this.replace(/[^0-9]/g, '') * 1;
	}
}
String.prototype.lTrim = function() {
	return this.replace(/^[\s\t]+/, '');
}
String.prototype.rTrim = function() {
	return this.replace(/[\s\t]+$/, '');
}
String.prototype.trim = function() {
	return this.replace(/^[\s\t]+|[\s\t]+$/, '');
}
String.prototype.textAreaTrim = function() {
	return this.replace(/[\s\t]+\r\n/g, "\r\n");
}

function getStatus(obj) {
	obj.clientWidth = document.documentElement.clientWidth || document.body.clientWidth;
	obj.clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
	obj.offsetWidth = document.documentElement.offsetWidth || document.body.offsetWidth;
	obj.offsetHeight = document.documentElement.offsetHeight || document.body.offsetHeight;
	obj.offsetLeft = document.documentElement.offsetLeft || document.body.offsetLeft;
	obj.offsetTop = document.documentElement.offsetTop || document.body.offsetTop;
	obj.scrollWidth = document.documentElement.scrollWidth || document.body.scrollWidth;
	obj.scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
	obj.scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
	obj.scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
}

function getParentTag(tag, tagName)
{
	var pNode = tag.parentNode;
	while(pNode.tagName != tagName) {
		pNode = pNode.parentNode;
	}
	return pNode;
}

function getElementsByNameFromParent(tag, name)
{
	var childs = tag.getElementsByTagName('*');
	var tags = new Array();
	var i;
	for(i = 0; i < childs.length; i ++) {
		if(childs[i].name == name) {
			tags.push(childs[i]);
		}
	}
	return tags;
}
//Array, Object, Number
