
//This does what is says go to the last month
function goLastMonth(month, year){
alert('hej');
// If the month is January, decrement the year
/*if(month == 1){
--year;
month = 13;
}
document.location.href = '<?=$_SERVER['PHP_SELF'];?>?go=kal&month='+(month-1)+'&year='+year;
*/
}

//This does what is says go to the next month
//next function
function goNextMonth(month, year){
// If the month is December, increment the year
if(month == 12){
++year;
month = 0;
}

document.location.href = '<?=$_SERVER['PHP_SELF'];?>?go=kal&month='+(month+1)+'&year='+year;
}
//This function is used on the form to control the amount of characters the input form will allow
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;
}
//This function checks to make sure all form values are filled in before the submit button is given to the user
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

}
