function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function showHint(layerObj)
{
	var obj = document.getElementById(layerObj);
	obj.style.visibility = "";
}

function admin(){
	if( confirm("OK for the Admin Panel, Cancel for the TEST Creation Panel","2") ){location.href = "admin.php";}
	else{location.href = "testcreate.php";}
}

function launchKA() {
	keepalivewin = window.open("keepalive.php","keepalive","toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, height=150,width=400,left=50,top=50");
	window.focus();
	alert("KeepAlive has been launched, and is now running in a separate browser window in the background.");
}

function hideHint(layerObj)
{
	var obj = document.getElementById(layerObj);
	obj.style.visibility = "hidden";
}

////////////// Function for Encylopedia ///////////////////////////
function toggleChild(rowNum)
{
	var childRow = (rowNum - 0);
	var object = document.getElementById('row' + childRow);
	if(object.style.display == '')
	{
		hideChild(rowNum);
	}
	else
	{
		showChild(rowNum);
	}
}
function showChild(rowNum)
{
	var childRow = (rowNum - 0);
	var object = document.getElementById('row' + childRow);
	object.style.display = '';
}
function hideChild(rowNum)
{
	var childRow = (rowNum - 0);
	var object = document.getElementById('row' + childRow);
	object.style.display = 'none';
}
////////////// Function for Encylopedia ///////////////////////////


////////////// Function for Login ///////////////////////////
function checkForm() {
	if ( document.loginform.user.value == "" ){
		alert("Username Not Filled In!");
		document.loginform.user.focus();
		event.returnValue=false;
	}
	else if ( document.loginform.pass.value == "" ){
		alert("Password Not Filled In!");
		document.loginform.pass.focus();
		event.returnValue=false;
	}
}
////////////// Function for Login ///////////////////////////

////////////// AJAX Keep Alive by Daniel Morante //////////////////
function keepalive() {
xmlhttp.open("GET", "keepalive.php",true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
   	//Do nothing
  }
 }
 xmlhttp.send(null)
 }
