// JavaScript Document
function calendar(moduleID,month){
	//properties
	this.months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	this.selectedMonth = month;
	this.moduleID = moduleID;
	this.currentEvent;
	
	//methods
	this.nextMonth2 = function(){
		if(this.selectedMonth == 11){
			this.selectedMonth = 0;
		} else {
			this.selectedMonth += 1;
		}
		document.getElementById('month_'+this.moduleID).value = this.months[this.selectedMonth];
	}
	this.previousMonth2 = function(){
		if(this.selectedMonth == 0){
			this.selectedMonth = 11;
		} else {
			this.selectedMonth -= 1;
		}
		document.getElementById('month_'+this.moduleID).value = this.months[this.selectedMonth];
	}
	this.nextYear2 = function(){
		document.getElementById('year_'+this.moduleID).value = eval(document.getElementById('year_'+this.moduleID).value) + 1;
	}
	this.previousYear2 = function(){
		document.getElementById('year_'+this.moduleID).value = eval(document.getElementById('year_'+this.moduleID).value) - 1;
	}	
	this.hideEvent2 = function(eventy, dayBox, linky){
		document.getElementById(eventy).style.display = "none";
		document.getElementById(dayBox).className = "calEvent";
	}
	this.showEvent2 = function(eventy, dayBox, left, top){
		this.currentEvent = eventy;
		var popUp = document.getElementById('popUp_'+this.moduleID);
		popUp.style.left = left+"px";
		popUp.style.top = top+"px";
		document.getElementById(this.currentEvent).style.display = "inline";
		document.getElementById(dayBox).className = "calEvent2";
	}
}
