
// Toggle Hide/Show div

function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}

// Hide div

function hide_visibility(id) {
for (var i = 0; i < id.length; i++) {
	var e = document.getElementById(id[i]);
e.style.display = 'none';
} 
}

// Show div

function show_visibility(id) {
for (var i = 0; i < id.length; i++) {
	var e = document.getElementById(id[i]);
e.style.display = 'inline';
}
}

// Variables needed for Rollovers
var over = 'no';
var whichOne = ' ';
var styleSheetElement;
var oldElement;

// Function to Assign the relative path to images and links
if (whichLevel == 0) {
	var path = '';
} else if (whichLevel == 1) {
	var path = '../';
} else if (whichLevel == 2) {
	var path = '../../';
} else if (whichLevel == 3) {
	var path = '../../../';
}


// function that turns on the menus
function menuOn(pic) {
	over = 'yes';
	var layerName = pic + 'Menu';
		styleSheetElement = document.getElementById(layerName);
		if(document.images) {
			if (whichOne != ' ') {
				whichOne = whichOne + 'Menu';
				oldElement = document.getElementById(whichOne);
				oldElement.style.visibility = "hidden";
				
			}
			styleSheetElement.style.visibility = "visible";
				
		}
	}

// Timer function that is run to give the user time to get to the menu from the button
function overChecker(pic) {
	whichOne = pic;
	over = 'no';
	setTimeout("menuOff()", 900);
}

// function that turns off the menus
function menuOff() 
{
	if (over == 'no')  {	
		styleSheetElement.style.visibility = "hidden";
	}
}

function changeClass(elem, className1,className2)
{
    elem.className = (elem.className == className1)?className2:className1;
}

/* function to change a class */
function setClass(objectID,newClass) {
	var object = document.getElementById(objectID);
	if (object) {
		object.className = newClass;
	}
}

function autotab(original,destination){
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
	destination.focus()
}