<!--

var current_btn = '';

if( document.images )
{
  btn1_off 	= new Image(142,27);
  btn2_off 	= new Image(142,27);
  btn3_off 	= new Image(142,27);
  btn4_off 	= new Image(142,27);
  btn5_off 	= new Image(142,27);
  btn6_off 	= new Image(142,27);
  btn7_off 	= new Image(142,27);

  btn1_on 	= new Image(142,27);
  btn2_on 	= new Image(142,27);
  btn3_on 	= new Image(142,27);
  btn4_on 	= new Image(142,27);
  btn5_on 	= new Image(142,27);
  btn6_on 	= new Image(142,27);
  btn7_on 	= new Image(142,27);

  btn1_off.src 	= "/images/top_btn1_off.gif";
  btn2_off.src 	= "/images/top_btn2_off.gif";
  btn3_off.src 	= "/images/top_btn3_off.gif";
  btn4_off.src 	= "/images/top_btn4_off.gif";
  btn5_off.src 	= "/images/top_btn5_off.gif";
  btn6_off.src 	= "/images/top_btn6_off.gif";
  btn7_off.src 	= "/images/top_btn7_off.gif";

  btn1_on.src 	= "/images/top_btn1_on.gif";
  btn2_on.src 	= "/images/top_btn2_on.gif";
  btn3_on.src 	= "/images/top_btn3_on.gif";
  btn4_on.src 	= "/images/top_btn4_on.gif";
  btn5_on.src 	= "/images/top_btn5_on.gif";
  btn6_on.src 	= "/images/top_btn6_on.gif";
  btn7_on.src 	= "/images/top_btn7_on.gif";

}

function chkVer(imagename,objectsrc)
{
	if(imagename == current_btn) return
	var n=navigator.appName
	var v=parseInt(navigator.appVersion)
	var browsok=((n=="Netscape")&&(v>=3))
	var browsok2=((n=="Microsoft Internet Explorer")&&(v>=4))
	if ((browsok)||(browsok2))
		document.images[imagename].src=eval(objectsrc+".src")
}

/* Highlight a button by default */
function selectedButton(imagename)
{
	current_btn = imagename
	document.images[imagename].src=eval(imagename + "_on.src")
}


Menu = {timer : null, current: null};
Menu.show = function(parentid, id) {
	if(this.current == id) return;

	// Close all menus first
	this.doHide();
	if(this.timer) clearTimeout(this.timer);
	this.current = id;
	
	/*
	The following code was used to dynamically position the submenu next 
	to the parent. Probably worth keeping
	*/
	
	var parent = $("#" + parentid);
	var oParent = parent.parent().get(0);
	
	// Position for child
	var posX = this.findLeft(oParent);
	var posY = this.findTop(oParent);
	
	// Modify these to get exact positioning
	var offsetX = 0;
	var offsetY = parent.height();

	// Reposition the menu and display
	$("#" + id).css({
		'position': 'absolute',
		'top': posY + offsetY + 'px',
		'left': posX + offsetX + 'px',
		'z-index': 99999
	}).fadeIn('fast');
	
	//$("#" + id).fadeIn("fast");
	
}

Menu.hide = function() {
	this.timer = setTimeout("Menu.doHide()", 300);
}
Menu.doHide = function() {
	if(this.current) {
		$('#' + this.current).hide();
	}
	this.current = null;
}
Menu.persist = function() {
	if(this.timer) clearTimeout(this.timer);
}

Menu.findLeft = function(obj)
{
	curleft = 0;
	if(obj.offsetParent)
	while(1) {
		curleft += obj.offsetLeft;
		if(!obj.offsetParent)
			break;
		obj = obj.offsetParent;
	}
	else if(obj.x)
		curleft += obj.x;

	return curleft;
}

Menu.findTop = function(obj)
{
	curtop = 0;
	if(obj.offsetParent)
	while(1) {
		curtop += obj.offsetTop;
		if(!obj.offsetParent)
			break;
		obj = obj.offsetParent;
	}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}

	-->
