//==========================================================================//
// File: menu.js																												    //
// Author: (c) Jörg Fabel Nov 2003																					//
// Contact: jfabel@fabcor.de																								//
//==========================================================================//

////////////////////Please leave this notice//////////////////////
//								//
//	Dynamic JS Menu 1.0					//
//	By Pat Libby (Libbypa@maine.rr.com)			//
//	http://dragonsbane1.topcities.com			//
//	It works only with IE5.0(++) and Netscape6.0(++)	//
//	Free to use!						//
//								//
////////////////////Last modified 01-31-2003//////////////////////

//	Modify following four lines to customize your menu
var tdColor="#FFFFFF";		// menu item text color
var tdBgColor="";	// menu item background color
var hlColor="#FFFF00";		// highlight text color
var hlBgColor="";	// highlight background color
//	After change, modify same values in your DropDown.css file

////////////////////DO NOT MODIFY BELOW HERE//////////////////////
var md=300;
var ti=-1;
var oTd=new Object;
oTd=null;

function doMenu(td){
	clearTimeout(ti);
	td.style.backgroundColor=hlBgColor;
	td.style.color=hlColor;
	var i;
	var sT="";
	var tda=new Array();
	tda=td.id.split("_");

  if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		for(i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			if(tdo[i]!=tda[i]){
			  if (document.getElementById("td"+sT) != null) { 
  				document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
	  			document.getElementById("td"+sT).style.color=tdColor;
				}
				if(document.getElementById("menubtn"+sT) != null){
     	    sSrc = document.getElementById("menubtn"+sT).src;
		      sSrcNew = sSrc.replace(/menubtncurrent/,"menubtnempty");
      	  document.getElementById("menubtn"+sT).src = sSrcNew;					
				}
				if(document.getElementById("tbl"+sT)!=null)
					document.getElementById("tbl"+sT).style.visibility="hidden";
			}
		}			
	}
	oTd=td;
	sT="tbl";
	sBtn="menubtn";
	for(i=1;i<tda.length;i++){
		sT+="_"+tda[i];
		sBtn+="_"+tda[i];
	}
	if(document.getElementById(sT)!=null)
		document.getElementById(sT).style.visibility="visible";
	if(document.getElementById(sBtn) != null){
	  sSrc = document.getElementById(sBtn).src;
		sSrcNew = sSrc.replace(/menubtnempty/,"menubtncurrent");
	  document.getElementById(sBtn).src = sSrcNew;
	}
}

function clearMenu(){
	if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		var sT="";
		for(var i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			if(document.getElementById("td"+sT)!=null){
			 document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
			 document.getElementById("td"+sT).style.color=tdColor;
			}
			if(document.getElementById("tbl"+sT)!=null)
				document.getElementById("tbl"+sT).style.visibility="hidden";
			if(document.getElementById("menubtn"+sT)!=null){
    	 sSrc = document.getElementById("menubtn"+sT).src;
		   sSrcNew = sSrc.replace(/menubtncurrent/,"menubtnempty");
			 document.getElementById("menubtn"+sT).src = sSrcNew;
			}
		}
		oTd=null;			
	}
}

function runMenu(strURL, strTarget){
	if (strURL == ""){
		return;
	}
	window.open(strURL, strTarget);
}

function runMenu1(strURL){
	location.hreAf=strURL;
}

var tt="";
var sT="";
var pT=new Array();
var tA=new Array();

function getCoord1(divid, tblid, tdid){
	tA=tdid.split("_");
	if(tA.length>2){
		tA=tA.slice(0,-1);
		tt=tA.join("_");
		return (document.getElementById(divid).offsetTop+document.getElementById(tdid).offsetTop+16)+"px;left:"+
			(document.getElementById(divid).offsetLeft+document.getElementById(tblid).offsetLeft+document.getElementById(tdid).offsetLeft)+"px\">";
	}
}

function getCoord2(divid, tblid, tdid){
	tA=tdid.split("_");
	if(tA.length>2){
		tA=tA.slice(0,-1);
		tt=tA.join("_");
		return (document.getElementById(divid).offsetTop+document.getElementById(tdid).offsetTop - 0)+"px;left:"+
			(document.getElementById(divid).offsetLeft+document.getElementById(tblid).offsetLeft+document.getElementById(tdid).offsetLeft+document.getElementById(tdid).offsetWidth)+"px\">";
	}
}

