function Calendar(strPrefix) {
	this.strPrefix = strPrefix;
	this.intMonths = 0;
	this.selectedMonth = 0;
}

Calendar.prototype.initDisplay = function() {
	var objCalendar = objDOM.getLayerReference(this.calID(0));
	this.intMonths = -1;
	var intSelectedMonth = 0;
	while (objCalendar != null) {
		//is this the current month?
		if (objCalendar.getAttribute("selected") == "1") {
			intSelectedMonth = this.intMonths;
		}
			
		//position the calendar
		objLiquidPositioner.setPosition("calendarSpacer", objCalendar.id); 
		
		//get the next calendar
		++this.intMonths
		objCalendar = objDOM.getLayerReference(this.calID(this.intMonths));
	}
	
	this.selectMonth(intSelectedMonth);
	
	this.hideButton("0", "back");
	this.hideButton((this.intMonths - 1), "forward");
	
}

Calendar.prototype.calID = function(intMonth) {
	return this.strPrefix + intMonth;
}

Calendar.prototype.selectMonth = function(intMonth) {
	if (intMonth >= 0 && intMonth < this.intMonths) {
		objDOM.getLayerReference(this.calID(this.selectedMonth)).style.visibility = 'hidden';
		this.selectedMonth = intMonth;
		objDOM.getLayerReference(this.calID(intMonth)).style.visibility = 'visible';
		return true;
	}
	return false;
}

Calendar.prototype.next = function() {
	var intNewMonth = this.selectedMonth + 1;
	this.selectMonth(intNewMonth);

}

Calendar.prototype.previous = function() {
	var intNewMonth = this.selectedMonth - 1;
	this.selectMonth(intNewMonth);
}


Calendar.prototype.hideButton = function(intMonth, strName) {
	objDOM.getLayerReference("calendar" + intMonth + strName).src = "/images/" + strName + "_off.gif";
	objDOM.getLayerReference("calendar" + intMonth + strName).style.cursor = "default";
}
