

function ScheduleTab() 
{ 
	this.date = new Date();
	this.tabId;	 
	 
}
			
ScheduleTab.prototype.Months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
ScheduleTab.prototype.Weekdays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

ScheduleTab.prototype.getDayOfWeek = function() 
{
	return this.Weekdays[this.date.getDay()];
}



ScheduleTab.prototype.setTabId = function(tabId)
{
	this.tabId = tabId;
}

ScheduleTab.prototype.getShortDate = function()
{
	return this.Months[this.date.getMonth()] + " " + this.date.getDate();
}

ScheduleTab.prototype.getNumericDate = function()
{
	return (this.date.getMonth()+1) + "/" + this.date.getDate() + "/" + this.date.getFullYear();
}


ScheduleTab.prototype.getHtml = function()
{
	var html = "<li><div class=\"scheduleTab\" tabId=\"" + this.tabId + "\" numericdate=\""+this.getNumericDate()+"\" date=\"" 
		+ this.date.getFullYear() 
		+ this.padString((this.date.getMonth() + 1).toString(), "0", 2, true)
		+ this.padString(this.date.getDate().toString(), "0", 2, true) 
		+ "\"><div class=\"WeekDay\">" 
		+ this.getDayOfWeek().toLowerCase() 
		+ "</div>";
	html += "<div class=\"Date\">" + this.getShortDate().toLowerCase() + "</div></div></li>";
	 
	return html;
	
}

ScheduleTab.prototype.padString = function(string, padding, length, padLeft)
{
	if (string.length < length)
	{
		for (var i=0; i < (length - string.length); i++)
		{
			if (padLeft)
			{
				string = padding + string;
			}
			else
			{
				string = string + padding;
			}
		}
	}
	
	return string;
}