// JavaScript Document
function body_onload(){
/*
The following lines, will add optgroup fixing to a multi-campus school.
	if(document.all)
		document.forms["infoform"].elements["campus_id"].attachEvent("onchange",fixdrop);
	else
		document.forms["infoform"].elements["campus_id"].addEventListener("change",fixdrop,null);
*/
//The following line will add optgroups to a single campus school.
//		fixdrop();

	for(i=1; getElementByID("desc"+i); i++)
		getElementByID("desc"+i).className = "descclosed";
	getElementByID("form").style.minHeight = (getElementByID("content").offsetHeight-3)+"px";
	getElementByID("content").style.minHeight = (getElementByID("form").offsetHeight-3)+"px";
}

function getElementByID(eln){
	if(document.all)
		return document.all(eln);
	else
		return document.getElementById(eln);
}

function swapContent(forel){
	totalels = 0;
	while(getElementByID("topic"+totalels))
		totalels++;
	for(i=0; i < totalels; i++){
		if(i==forel){
			getElementByID("topic"+i).className = "topicopen";
			getElementByID("desc"+i).className = "descopen";
		}
		else{
			getElementByID("topic"+i).className = "topicclosed";
			getElementByID("desc"+i).className = "descclosed";
		}
	}
}