if(typeof widgets=="undefined") widgets = new Object();
widgets.wct = function(id)
{
	this.id = id;
	this.selTab = function(tab)
	{
		$("#" + id + " .wctTabActive").removeClass("wctTabActive");
		$("#" + tab).addClass("wctTabActive");
		return false;
	}
	this.updateDates = function(form, monthDropName, dayDropName)
	{
		monthDrop = form[monthDropName];
		dayDrop = form[dayDropName];
		
		month = monthDrop.options[monthDrop.selectedIndex].value;
		now = new Date();
		if(month < now.getMonth() + 1)
			selDate = new Date(month + "/1/" + now.getFullYear() + 1);
		else
			selDate = new Date(month + "/1/" + now.getFullYear());
			
		dayDrop.innerHTML = "";
			
		for(i = selDate.getDate(); i <= selDate.daysInMonth(); i++)
			dayDrop.innerHTML += "<option>" + i + "</option>";
	}
}
var WCTWidget = widgets.wct;

Date.prototype.daysInMonth = function() {
	return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
}