<!--
menuDrop = new Array();
var myimages=new Array()
var ie = (document.all)? true:false;
var ns = (document.layers)? true:false;
var ns6 = (parseInt(navigator.appVersion) >= 5 && navigator.userAgent.indexOf["Netscape6"] != -1)? true:false;
var currmenu = ''; // currently active menu
var inmenu = false; // 
var timer = null;
var timeron = false;
var timeout = 500;

clearTimeout(timer);


function swapImgRestore() { 
  var i,x,a=document. sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { 
  	var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x= findObj(n,d.layers[i].document); return x;
}

function swapImage() { 
  var i,j=0,x,a= swapImage.arguments; document. sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x= findObj(a[i]))!=null){document. sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//header equals the clickable part, the desription equals the dropping part

function initializeToolbar(){
    var i;
    if (document.all){
	for(i = 0; i < document.all('container').all.length; i++){//for i=0 i less than the length of the container tag boundries, add 1 to i
	   if ((document.all('container').all[i].className == 'header') ||//says whatever is in the div tag named container with a class name of header do this
(document.all('container').all[i].className == 'drop')){		//or with a class name of drop
		menuDrop[menuDrop.length]
= document.all('container').all[i];
	    }
	}
    }
 else if (document.getElementsByTagName && document.getElementById){
	var contained =
document.getElementById('container').getElementsByTagName('div');
	for(i = 0; i < contained.length; i++){
	    if ((contained[i].getAttribute('class') == 'header') ||
(contained[i].getAttribute('class') == 'drop')){
		menuDrop[menuDrop.length]
= contained[i];
	    }
	}
    }
}

function collapse(divID){ 
    var curStyle = document.getElementById(divID).style.display;  
    if (curStyle == 'none'){
	document.getElementById(divID).style.display = 'block';
    } else {
	document.getElementById(divID).style.display = 'none';
    }
}
function cleartimer() {
	clearTimeout(timer);
	timeron = false;
	inmenu = true;
}

function timemenu() {
	if (!timeron) {
		timeron = true;
		inmenu = false;
		timer = setTimeout("killmenu()",timeout);
	}
}

function showmenu(menu, e) { // Clears 'killmenu()' timer, positions and reveals 'menu'
	clearTimeout(timer)
	timeron = false;
	
	if(check(menu)) {
	
		if (ns6) {
			var obj = document.getElementById(menu).style;
		} else {
			var obj = (ns)? document.layers[menu]:document.all[menu].style; // Define style pointer for NS/IE
		}
		
		if ((check(menu))&&(currmenu != menu)) {
			killmenu();
			obj.top = e.clientY;//+ document.body.scrollTop - e.offsetY;
			//alert(e.clientY);
			obj.top = (ns)? (e.pageY + 5):(e.clientY + document.body.scrollTop - e.offsetY - 200);
			obj.left = (ns)? (e.pageX + 10):(e.clientX + document.body.scrollLeft - e.offsetX + 350);
			obj.zindex = 9999;
		}
		
		show(menu);
		currmenu = menu;
	}	
}

function killmenu(){ // Kills the menu if the user has not moused-over it
	if(!inmenu){
		if(check(currmenu)){
			timeron = false;
			hide();
		}			
	}
}

function show(id) {
	if (ns6) {
		document.getElementById(id).style.display = "";	
	} else if (ns) {
		document.layers[id].visibility = "show";
	} else if (ie) {
		document.all[id].style.visibility = "visible";
	}
}

function hide() { // Specific to 'currmenu'
	if (ns6) {
		document.getElementById(currmenu).style.display = "none";	
	} else if (ns) {
		document.layers[currmenu].visibility = "hide";
	} else if (ie) {
		document.all[currmenu].style.visibility = "hidden";
	}
}	


function check(obj) { // Checks the existence of a menu layer object
	if (ns) {
		if (document.layers[obj]) {
			return true
		} else {
			return false;
		}		
	} else if (ie) {
		if (document.all[obj]) {
			return true;
		} else {
			return false;
		}		
	}
}
// -->

