
/*!
@function String.trim()
@abstract removes trailing / leading spaces jump to first/last element.
@result use php-like trim on strings
*/
String.prototype.trim = function() {
		return this.replace(/^\s+|\s+$/g, '');
}

/*!
@function String.strstr (str) {
@abstract strstr, test for given substring
@param string to search for 
@result use php-like strstr on strings
*/
String.prototype.strstr = function(str) {
	return !!this.match("\\b"+str+"\\b");
}

/*!
@function String.strReplace (foe,friend)
@abstract sreplace foe with friend
@param foe: string to replace, friend: string being insert
@result use php-like strReplace on strings
*/
String.prototype.strReplace = function(foe,friend) {
	return this.replace(foe.trim(),friend);
}

/*!
@function Array.push()
@abstract  cover IE 5.0's lack of the push method
@result add push to array
*/
Array.prototype.push = function(value) {
	this[this.length] = value;
}

/*!
@function Array.inArray(_needle)
@abstract search for _needle in Array
@result add inArray to array
*/
Array.prototype.inArray = function(_v) {
	var _n = this.length;
	if (_n > 0) 
	{
		do 
		{
			if (this[_n] === _v) { return _n; }
		} 
		while (_n--);
	}
	return false;
}