function goLastMonth(month, year){
	// If the month is January, decrement the year
	if(month == 1) {
		--year;
		month = 13;
	}
	document.location.href = ('calendar.php?month='+(month-1)+'&year='+year);
}

//next function
function goNextMonth(month, year){
	// If the month is December, increment the year
	if(month == 12){
	++year;
	month = 0;
	}
	document.location.href = ('calendar.php?month='+(month+1)+'&year='+year);
}

function remChars(txtControl, txtCount, intMaxLength) {
	if(txtControl.value.length > intMaxLength) 	txtControl.value = txtControl.value.substring(0, (intMaxLength-1));
	else	txtCount.value = intMaxLength - txtControl.value.length;
}

function checkFilled() {

	var filled = 0
	var x = document.form1.calName.value;
	//x = x.replace(/^\s+/,""); // strip leading spaces
	if (x.length > 0) {filled ++}

	var y = document.form1.calDesc.value;
	//y = y.replace(/^s+/,""); // strip leading spaces
	if (y.length > 0) {filled ++}

	if (filled == 2) {
	document.getElementById("Submit").disabled = false;
	}
	else {document.getElementById("Submit").disabled = true} // in case a field is filled then erased
	
}

