//Miscellanious javascript functions
if (parent.frames.length > 0) {
	top.location.replace(document.location);
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height, scrollbar)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbar+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function loadMyMovie(container, theMovie){
	var myMovie = findDom(container, 'none');
	myMovie.src = "video_iframe.cfm?show=" + theMovie; 
} 

function loadDescription(container, theDescript){
	var myDescript = findDom(container, 'none');
	var myValue = findDom(theDescript,'none');
	myDescript.src = "tacad_description.cfm?descriptId=" + myValue.value;
}

function adjustBox(box){
	var myBox = findDom(box, 'style');
	
	if(myBox.height == '0pt'){
		myBox.height = 'auto';
		myBox.overflow = 'auto';
	}
	else if(myBox.height == '0px'){
		myBox.height = 'auto';
		myBox.overflow = 'auto';
	}
	else{
		myBox.height = 0;
		myBox.overflow = 'hidden';
	}
} 

function reloadPage(selector){
	var mySelector = findDom(selector, 'none');
	
	var myJob = mySelector.value;
	
	alert(myJob);
} 

function openTextArea(checkBox, textArea){
	var myCheckBox = findDom(checkBox, 'none');
	var myTextArea = findDom(textArea, 'style');
	
	if(myCheckBox.checked){
		myTextArea.visibility = "visible";
		myTextArea.height = "auto";
	}
	else{
		myTextArea.visibility = "hidden";
		myTextArea.height = "0";
	}
}


function qswitch(boxNum,radio1,radio2,radio3,radio4){
	var myCheckBox = findDom(boxNum, 'none');
	var myRadio1 = findDom(radio1, 'none');
	var myRadio2 = findDom(radio2, 'none');
	var myRadio3 = findDom(radio3, 'none');
	var myRadio4 = findDom(radio4, 'none');
	
	if(myCheckBox.checked){
		myRadio1.disabled = false;
		myRadio2.disabled = false;
		myRadio3.disabled = false;
		myRadio4.disabled = false;
	}
	else{
		myRadio1.disabled = true;
		myRadio2.disabled = true;
		myRadio3.disabled = true;
		myRadio4.disabled = true;
	}
}


function ptaMessage(ptaPage){
	alert("The web page you are about to visit is maintained and updated by the School's PTA/PTO/PTSO. It's content is not created, maintained or hosted by the Londonderry School District.");
	open(ptaPage);
	
}

///////////////////////////////////

