String.prototype.toFirstLowerCase = function() {
	return this.substring(0,1).toLowerCase() + this.substring(1);
}
		
String.prototype.toInt = function() {
	return parseInt(this);
}
		
String.prototype.toBoolean = function() {
	if (this == "false") return false;
	else if (this.length > 0) return true;
	else return false;
}
		
String.prototype.trim = function () {
    var s = this.replace(/^\s*/, "");
   	return s.replace(/\s*$/, "");
}
	    
String.prototype.replaceAll = function(s1, s2) { 
	return this.replace(new RegExp(s1, "g"), s2);
}
		
String.prototype.endsWith = function(text) {
	return (this.indexOf(text) == this.length - text.length);
}
		
String.prototype.startsWith = function(inText) {
	return (this.indexOf(inText) == 0);
}

// IE doesn't support Array.indexOf natively
Array.prototype.indexOf = function(v) {
	for (var i = 0; i < this.length; i++) 
		if (this[i] == v) return i;
	return -1;
}