/*
	Rutgers University Student Assembly Calendar Javascript Objects
	Created by Rohit Sodhia
*/

/* Date Object Extensions */
if (Date.prototype.getMonthName == null) {
	Date.prototype.getMonthName = function () {
		var month = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
		
		return month[this.getMonth()];
	}
}

if (Date.prototype.getDayName == null) {
	Date.prototype.getDayName = function () {
		var weekday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thrusday", "Friday", "Saturday");
		
		return weekday[this.getDay()];
	}
}

if (Date.prototype.setFullTime == null) {
	Date.prototype.setFullTime = function (hours, minutes, seconds) {
		this.setHours(hours);
		this.setMinutes(minutes);
		this.setSeconds(seconds);
	}
}

if (Date.prototype.getClockTime == null) {
	Date.prototype.getClockTime = function (parts) {
		var hours = this.getHours() + 1;
		
		var meridiem = "AM";
		if (hours > 12) {
			hours -= 12;
			meridiem = "PM";
		}
		
		var minutes = this.getMinutes();
		if (minutes < 10) { minutes = "0" + minutes; }
		
		if (parts == 1) { return hours + " " + meridiem; }
		else if (parts == 2) { return hours + ":" + minutes + " " + meridiem; }
		else if (parts == 3) { return hours + ":" + minutes + " " + seconds + " " + meridiem; }
		else { return "Error"; }
	}
}
