// JavaScript Document

<!--

<!-- main drop-down menu -->
	function expand(s)
	{
	  var td = s;
	  var d = td.getElementsByTagName("div").item(0);
	
	  td.className = "menuHover";
	  d.className = "menuHover";
	}
	
	function collapse(s)
	{
	  var td = s;
	  var d = td.getElementsByTagName("div").item(0);
	
	  td.className = "menuNormal";
	  d.className = "menuNormal";
	}




<!-- Hide/Display Content -->
	function showNav(n) {
	if(document.getElementById(n).style.display == "none" || null)
		{document.getElementById(n).style.display = "block";}
	else
		{document.getElementById(n).style.display = "none";}
	}
	

<!-- Reporting - changing images from iframe -->
	function changeImage(img) {
	if(document.getElementById('placeholder').style.display == null || "none")
	{
			document.getElementById('placeholder').src = img;
			document.getElementById('placeholder').style.display = "block";
	}
	else
		{document.getElementById('placeholder').style.display = null;}
	}
	
	function closeImage(img)
	{
		document.getElementById('placeholder').src = null;
		document.getElementById('placeholder').style.display = "none";
	}
	
	
<!-- From onlinells -->
	
	function redirect(pass)
	{
		window.location = pass;
	}
	
	function toPlaceDemo()
	{
		document.placeform.submit();
	}
	
	function toClasspakDemo()
	{
		document.classpakform.submit();
	}
	
	function popUp(passPage,passWidth,passHeight)
	{
		var openWindow = window.open(passPage,'LLS','width=' + passWidth + ',height=' + passHeight + ',toolbar=no,location=no,status=no,'+ 'menubar=no,scrollbars=yes,resizable=yes');
		openWindow.focus();
	}
	
	

<!-- Alternative Nagivation on the Left-->

var slideSpeed = 45;
var timer = 1;
var objectIdToSlideDown = false;
var activeId = false;
var slideInProgress = false;

function showHideContent(e,inputId)
{
	if(slideInProgress)return;
	slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('a' + numericId);

	objectIdToSlideDown = false;
	
	if(!answerDiv.style.display || answerDiv.style.display=='none'){		
		if(activeId && activeId!=numericId){			
			objectIdToSlideDown = numericId;
			slideContent(activeId,(slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,slideSpeed);
		}
	}else{
		slideContent(numericId,(slideSpeed*-1));
		activeId = false;
	}	
}

function slideContent(inputId,direction)
{
	
	var obj =document.getElementById('a' + inputId);
	var contentObj = document.getElementById('ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',timer);
	}else{
		if(height<=1){
			obj.style.display='none'; 
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('a' + objectIdToSlideDown).style.display='block';
				document.getElementById('a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,slideSpeed);				
			}else{
				slideInProgress = false;
			}
		}else{
			activeId = inputId;
			slideInProgress = false;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='key'){
			divs[no].onclick = showHideContent;
			divs[no].id = 'q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'a'+divCounter;	
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.id = 'ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}		
	}	
}
window.onload = initShowHideDivs;

//-->