
/* calender */

function fillForm(day,month,year){
document.location.href = 'calendar.php?month='+(month)+'&day='+(day)+'&year='+year+'&v=1&f=true&b='+(document.form1.bandName.value);
	}

//This does what is says go to the last month
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;
}

//This does what is says go to the next month
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;
}

//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
	
}
/* End calender */

/* vertical menu */

var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
var submenuoffset=-5 //Offset of submenus from main menu. Default is -2 pixels.


function createcssmenu(){

//document.getElementById('menuDiv').innerHTML = newInnerHTML;
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    var spanref=document.createElement("span")
		spanref.className="arrowdiv"
		spanref.innerHTML="&nbsp;&nbsp;"
		ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}


if (window.addEventListener)
window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu)

defaultStep=2
step=defaultStep

function scrollDivDown(id){
clearTimeout(timerDown)
document.getElementById(id).scrollTop+=step
timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}

function scrollDivUp(id){
clearTimeout(timerUp)
document.getElementById(id).scrollTop-=step
timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

timerDown=""
timerUp=""

function stopMe(){
clearTimeout(timerDown)
clearTimeout(timerUp)
}

document.onmousemove=function(){stopMe()}

