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);
}

Date.prototype.getDST = function() {
	var now_local = this;
	var jan_local = new Date(now_local.getFullYear(), 0, 1, 0, 0, 0, 0, 0);
	var jun_local = new Date(now_local.getFullYear(), 5, 1, 0, 0, 0, 0, 0);
	var now_utc = new Date.UTC(now_local.getFullYear(), now_local.getMonth(), now_local.getDate(), now_local.getHours(), now_local.getMinutes(), now_local.getSeconds(), now_local.getMilliseconds());
	var jan_utc = new Date.UTC(jan_local.getFullYear(), jan_local.getMonth(), jan_local.getDate(), jan_local.getHours(), jan_local.getMinutes(), jan_local.getSeconds(), jun_local.getMilliseconds());
	var jun_utc = new Date.UTC(jun_local.getFullYear(), jun_local.getMonth(), jun_local.getDate(), jun_local.getHours(), jun_local.getMinutes(), jun_local.getSeconds(), jan_local.getMilliseconds());
	var now_diff = Math.round((now_utc - now_local.getTime()) / (1000 * 3600));
	var jan_diff = Math.round((jan_utc - jan_local.getTime()) / (1000 * 3600));
	var jun_diff = Math.round((jun_utc - jun_local.getTime()) / (1000 * 3600));
	return jan_diff != jun_diff && now_diff == Math.max(jan_diff, jun_diff);
}

// 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;
}