// JavaScript Document
<!--

//---------------------------------------FOR MENU NI GILBERTO------------------------------------------------------

var ddlevelsmenu={

downarrowpointer: ["ddlevelsfiles/arrow-down.gif", 11,7], //path to "down arrow" image that gets added to main menu items (last 2 parameters should be width/height of img)
rightarrowpointer: ["ddlevelsfiles/arrow-right.gif", 12,12], //path to "right arrow" image that gets added to LI elements within drop down menu containing additional menus
hideinterval: 200, //delay in milliseconds before sub menu(s) disappears onmouseout.
httpsiframesrc: "blank.htm", //If menu is run on a secure (https) page, the IFRAME shim feature used by the script should point to an *blank* page *within* the secure area to prevent an IE security prompt. Specify full URL to that page on your server (leave as is if not applicable).

///No need to edit beyond here////////////////////

topmenuids: [], //array containing ids of all the primary menus on the page
topitems: {}, //object array containing all top menu items
subuls: {}, //object array containing all ULs
topitemsindex: -1,
ulindex: -1,
hidetimers: {}, //object array timer
shimadded: false,

getoffset:function(what, offsettype){
	return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
},

getoffsetof:function(el){
	el._offsets={left:this.getoffset(el, "offsetLeft"), top:this.getoffset(el, "offsetTop")}
},

getwindowsize:function(){
	this.docwidth=window.innerWidth? window.innerWidth-10 : this.standardbody.clientWidth-10
	this.docheight=window.innerHeight? window.innerHeight-15 : this.standardbody.clientHeight-18
},

gettopitemsdimensions:function(){
	for (var m=0; m<this.topmenuids.length; m++){
		var topmenuid=this.topmenuids[m]
		for (var i=0; i<this.topitems[topmenuid].length; i++){
			var header=this.topitems[topmenuid][i]
			var submenu=document.getElementById(header.parentNode.getAttribute('rel'))
			header._dimensions={w:header.offsetWidth, h:header.offsetHeight, submenuw:submenu.offsetWidth, submenuh:submenu.offsetHeight}
		}
	}
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

addpointer:function(target, imgclass, imginfo){
	var pointer=document.createElement("img")
	pointer.src=imginfo[0]
	pointer.style.width=imginfo[1]+"px"
	pointer.style.height=imginfo[2]+"px"
	pointer.className=imgclass
	target.appendChild(pointer)
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

addshimmy:function(target){
	var shim=(!window.opera)? document.createElement("iframe") : document.createElement("div") //Opera 9.24 doesnt seem to support transparent IFRAMEs
	shim.className="ddiframeshim"
	shim.setAttribute("src", location.protocol=="https:"? this.httpsiframesrc : "about:blank")
	shim.setAttribute("frameborder", "0")
	target.appendChild(shim)
	try{
		shim.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
	}
	catch(e){}
	return shim
},

positionshim:function(header, submenu, dir, scrollX, scrollY){
	if (header._istoplevel){
		var scrollY=window.pageYOffset? window.pageYOffset : this.standardbody.scrollTop
		var topgap=header._offsets.top-scrollY
		var bottomgap=scrollY+this.docheight-header._offsets.top-header._dimensions.h
		if (topgap>0){
			this.shimmy.topshim.style.left=scrollX+"px"
			this.shimmy.topshim.style.top=scrollY+"px"
			this.shimmy.topshim.style.width="99%"
			this.shimmy.topshim.style.height=topgap+"px" //distance from top window edge to top of menu item
		}
		if (bottomgap>0){
			this.shimmy.bottomshim.style.left=scrollX+"px"
			this.shimmy.bottomshim.style.top=header._offsets.top + header._dimensions.h +"px"
			this.shimmy.bottomshim.style.width="99%"
			this.shimmy.bottomshim.style.height=bottomgap+"px" //distance from bottom of menu item to bottom window edge
		}
	}
},

hideshim:function(){
	this.shimmy.topshim.style.width=this.shimmy.bottomshim.style.width=0
	this.shimmy.topshim.style.height=this.shimmy.bottomshim.style.height=0
},


buildmenu:function(mainmenuid, header, submenu, submenupos, istoplevel, dir){
	header._master=mainmenuid //Indicate which top menu this header is associated with
	header._pos=submenupos //Indicate pos of sub menu this header is associated with
	header._istoplevel=istoplevel
	if (istoplevel){
		this.addEvent(header, function(e){
		ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
		}, "click")
	}
	this.subuls[mainmenuid][submenupos]=submenu
	header._dimensions={w:header.offsetWidth, h:header.offsetHeight, submenuw:submenu.offsetWidth, submenuh:submenu.offsetHeight}
	this.getoffsetof(header)
	submenu.style.left=0
	submenu.style.top=0
	submenu.style.visibility="hidden"
	this.addEvent(header, function(e){ //mouseover event
		if (!ddlevelsmenu.isContained(this, e)){
			if (typeof ddlevelsmenu.hidetimers[this._master][parseInt(this._pos)]!="undefined")
				clearTimeout(ddlevelsmenu.hidetimers[this._master][parseInt(this._pos)])
			if (this._istoplevel)
				ddlevelsmenu.css(this, "selected", "add")
			var submenu=ddlevelsmenu.subuls[this._master][parseInt(this._pos)]
			ddlevelsmenu.getoffsetof(header)
			var scrollX=window.pageXOffset? window.pageXOffset : ddlevelsmenu.standardbody.scrollLeft
			var scrollY=window.pageYOffset? window.pageYOffset : ddlevelsmenu.standardbody.scrollTop
			var submenurightedge=this._offsets.left + this._dimensions.submenuw + (this._istoplevel && dir=="topbar"? 0 : this._dimensions.w)
			var submenubottomedge=this._offsets.top + this._dimensions.submenuh
			//Sub menu starting left position
			var menuleft=(this._istoplevel? this._offsets.left + (dir=="sidebar"? this._dimensions.w : 0) : this._dimensions.w)
			if (submenurightedge-scrollX>ddlevelsmenu.docwidth){
				menuleft+= -this._dimensions.submenuw + (this._istoplevel && dir=="topbar" ? this._dimensions.w : -this._dimensions.w)
			}
			submenu.style.left=menuleft+"px"
			//Sub menu starting top position
			var menutop=(this._istoplevel? this._offsets.top + (dir=="sidebar"? 0 : this._dimensions.h) : this.offsetTop)
			if (submenubottomedge-scrollY>ddlevelsmenu.docheight){ //no room downwards?
				if (this._dimensions.submenuh<this._offsets.top+(dir=="sidebar"? this._dimensions.h : 0)-scrollY){ //move up?
					menutop+= - this._dimensions.submenuh + (this._istoplevel && dir=="topbar"? -this._dimensions.h : this._dimensions.h)
				}
				else{ //top of window edge
					menutop+= -(this._offsets.top-scrollY) + (this._istoplevel && dir=="topbar"? -this._dimensions.h : 0)
				}
			}
			submenu.style.top=menutop+"px"			
			ddlevelsmenu.positionshim(this, submenu, dir, scrollX, scrollY)
			submenu.style.visibility="visible"
		}
	}, "mouseover")
	this.addEvent(header, function(e){ //mouseout event
		if (this._istoplevel){
			var submenu=ddlevelsmenu.subuls[this._master][parseInt(this._pos)]
			if (!ddlevelsmenu.isContained(this, e) && !ddlevelsmenu.isContained(submenu, e)) //hide drop down ul if mouse moves out of menu bar item but not into drop down ul itself
				ddlevelsmenu.hidemenu(submenu)
		}
		else if (!this._istoplevel && !ddlevelsmenu.isContained(this, e)){
			var headerlist=this
			ddlevelsmenu.hidetimers[this._master][parseInt(this._pos)]=setTimeout(function(){
				var submenu=ddlevelsmenu.subuls[headerlist._master][parseInt(headerlist._pos)]
				ddlevelsmenu.hidemenu(submenu)
			}, ddlevelsmenu.hideinterval)
		}
	}, "mouseout")
},

hidemenu:function(submenu){
	if (typeof submenu._pos!="undefined"){ //if submenu is outermost UL drop down menu
		this.css(this.topitems[submenu._master][parseInt(submenu._pos)], "selected", "remove")
		this.hideshim()
	}
	submenu.style.left=0
	submenu.style.top="-1000px"
	submenu.style.visibility="hidden"
},


addEvent:function(target, functionref, tasktype) {
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

init:function(mainmenuid, dir){
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	this.topitemsindex=-1
	this.ulindex=-1
	this.topmenuids.push(mainmenuid)
	this.topitems[mainmenuid]=[] //declare array on object
	this.subuls[mainmenuid]=[] //declare array on object
	this.hidetimers[mainmenuid]=[] //declare array on object
	if (!this.shimadded){
		this.shimmy={}
		this.shimmy.topshim=this.addshimmy(document.body) //create top iframe shim obj
		this.shimmy.bottomshim=this.addshimmy(document.body) //create bottom iframe shim obj
		this.shimadded=true
	}
	var menubar=document.getElementById(mainmenuid)
	var menuitems=menubar.getElementsByTagName("*")
	this.getwindowsize()
	for (var i=0; i<menuitems.length; i++){
		if (menuitems[i].getAttribute('rel')){
			this.topitemsindex++
			this.ulindex++
			var menulink=menuitems[i].getElementsByTagName("a")[0]
			this.topitems[mainmenuid][this.topitemsindex]=menulink //store ref to main menu links
			var dropul=document.getElementById(menuitems[i].getAttribute('rel'))
			dropul.style.zIndex=2000 //give drop down menus a high z-index
			dropul._master=mainmenuid  //Indicate which main menu this main UL is associated with
			dropul._pos=this.topitemsindex //Indicate which main menu item this main UL is associated with
			this.addEvent(dropul, function(){ddlevelsmenu.hidemenu(this)}, "click")
			var arrowpointer=(dir=="sidebar")? "rightarrowpointer" : "downarrowpointer"
			this.addpointer(menulink, arrowpointer, this[arrowpointer])
			this.buildmenu(mainmenuid, menulink, dropul, this.ulindex, true, dir) //build top level menu
			//dropul.onmouseover=function(){
				//do nothing
			//}
			this.addEvent(dropul, function(e){ //hide menu if mouse moves out of main UL element into open space
				if (!ddlevelsmenu.isContained(this, e) && !ddlevelsmenu.isContained(ddlevelsmenu.topitems[this._master][parseInt(this._pos)], e)){
					var dropul=this
					ddlevelsmenu.hidetimers[this._master][parseInt(this._pos)]=setTimeout(function(){
						ddlevelsmenu.hidemenu(dropul)
					}, ddlevelsmenu.hideinterval)
				}
			}, "mouseout")
			var subuls=dropul.getElementsByTagName("ul")
			for (var c=0; c<subuls.length; c++){
				this.ulindex++
				var parentli=subuls[c].parentNode
				this.addpointer(parentli.getElementsByTagName("a")[0], "rightarrowpointer", this.rightarrowpointer)
				this.buildmenu(mainmenuid, parentli, subuls[c], this.ulindex, false, dir) //build sub level menus
			}
		}
	} //end for loop
	this.addEvent(window, function(){ddlevelsmenu.getwindowsize(); ddlevelsmenu.gettopitemsdimensions()}, "resize")
},

setup:function(mainmenuid, dir, path){
	this.downarrowpointer[0]=path+"/includes/js/"+this.downarrowpointer[0];
	this.rightarrowpointer[0]=path+"/includes/js/"+this.rightarrowpointer[0];
	this.addEvent(window, function(){ddlevelsmenu.init(mainmenuid, dir)}, "load")
}

}

//---------------------------------------FOR MENU NI ATE ANNA------------------------------------------------------
/*
Dr. Clue's drop-down menu system for 4th generation browsers
        copyright @ 1998,1999 drclue , www.drclue.net
license is granted for use of this software by individuals
in support of personal web-sites. All other rights reserved.
*/

//*** Global Variables
var LIBLOADEDJSmenu=false;
var     systemLibCnt    =0;
var     systemIsNS      =(document.layers!=null);       // Is it a Netscape browser
var     systemMouseDn   =true; // mousemove dragging
if(document.layers)document.all=document.layers;

var     systemMaxZ      =0; 
var     systemNullChk   =((systemIsNS)?((navigator.appVersion.substring(0,4)=="4.05")?"null":"undefined"):"null")
var     menuTimeOut     =null;  // mouseout Cancel menu timer
var     menuCurrentItem =null;  // currently highlighted object.
var     menuCurrentPath ="";    // The open menu list.
var     menuScreenWidth =0;

//*** General Menu  configuration variables
var     menuSubAuto     =true; //true
var     menuSubSymbol   ="<img src=\"http://www.mfi.org.ph/portal/images/arrow.gif\">";     // html to indicate sub menu
var     menuSubSymbol2   ="<img src=\"http://www.mfi.org.ph/portal/images/arrow2.gif\">";     // html to indicate sub menu
var     menuRoll        =false;  // true Show menu items as built
var     menuCharHeight  =22;    // Avg Char Height.
var     menuCharWidth   =5;     // Avg Char Width.
var     menuYpopoff     =18;
var     menuXpopoff     =-5;
var     menuBcolor      = "#FFFFFF"; //#9C9C9C";     // background
var     menuBcolor2     ="#9C9C9C";     // background
var     menuTcolor      ="#000000";     // Text
var     menuHBcolor     ="#3366CC";
var     menuHTcolor     ="#FFFFFF";
var     menuFont        ="verdana, geneva, arial, helvetica";// menu label font
var     menuFontSize    =3;     // menu font size
var     menuBold        =false; // Use bold
var     menuAtimeout    =4500;
var     Firstpass       =false; //true
var     lastEVENT       =null; //null

var szDuds="Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)";

function PreLoads(treeList)
        {
        window.status="["+systemLibCnt+"] menu.js["+LIBLOADEDJSmenu + "] items ["+""+" Loading ...";
        if(!LIBLOADEDJSmenu)
          {  setTimeout("PreLoads('"+treeList+"')",500);return;   }
        window.onResize="document.location.href=document.location.href";        
        if(!document.links.length)
          {  setTimeout("PreLoads('"+treeList+"')",500);return;   }
        window.status="initializing";
        while(treeList.length>1)
             {          
             killboy =treeList.substring(1);
             killboy =killboy.substring(0,killboy.indexOf(":"));
             treeList=treeList.substring(killboy.length+1);
             window.status="Loading "+killboy;
             menuCREATE(killboy,0,0);
             }
        window.status="";
        }

/* Called by the jsLAYERclass to create
a layer if the layer does not already exist.*/

function jsLAYERcreateLayer(Homeboy,x,y,w,h,bColor)
        {
        if(systemIsNS)
          {
          var lyr= document.layers[Homeboy.lyrName] = new Layer(w)
          lyr.left=x;lyr.top=y; lyr.clip.height=h;lyr.clip.width=w-1;
          lyr.bgColor=((jsLAYERcreateLayer.arguments.length>5)?bColor:menuBcolor);
          lyr.visibility='hidden';lyr.zIndex=1;
          lyr.isHighlight=false;
          lyr.border=1;
          document.layers[Homeboy.lyrName].style=document.layers[Homeboy.lyrName];
          }else{
          var str = '\n<div id='+Homeboy.lyrName+' style="visibility: hidden; padding: 1px 1px 1px 1px; border-width: thin; position:absolute; left:'+(x)+'; top:'+(y)+'; width:'+ (w)
          str += '; height:'+(h)+'px; clip:rect(2px '+(w+2)+'px '+(h)+'px 2px)'
          /*str += '; height:'+(h)+'px; clip:rect(2px '+(w+2)+'px '+(h+2)+'px 2px)'*/
          str += '; background-color:'+((jsLAYERcreateLayer.arguments.length>5)?bColor:menuBcolor2)+';z-Index:5;"> </div>';
          document.body.insertAdjacentHTML("BeforeEnd",str);
          }
        Homeboy.jsLAYERobject=document.all[Homeboy.lyrName];
        if(systemIsNS)
          {
          Homeboy.jsLAYERdocument  =document.layers[Homeboy.lyrName].document;
          Homeboy.style            =document.layers[Homeboy.lyrName];
          }else{
          Homeboy.jsLAYERdocument  =document.all[Homeboy.lyrName];
          Homeboy.style            =document.all[Homeboy.lyrName].style;
          Homeboy.style.zIndex     =systemMaxZ++;
          }
        Homeboy.jsLAYERobject.HomeBoy=Homeboy;
        Homeboy.jsLAYERobject.W =w-1;
        Homeboy.jsLAYERobject.X =x;
        Homeboy.jsLAYERobject.Y =y+1;
        Homeboy.jsLAYERobject.H =h;
        Homeboy.jsLAYERobject.MOUSEHANDLER="MOUSEVECTOR";
        return Homeboy;
        }
function jsLAYERsetHandler(Homeboy,szHANDLER) // named function for events
        {
        Homeboy.jsLAYERobject.MOUSEHANDLER=szHANDLER;
        MOUSECAPTURE(Homeboy,Homeboy.lyrName);
        }
function jsLAYERhomeboy(layername){return document.all[layername].HomeBoy;}
function jsLAYERopen(Homeboy){if(systemIsNS){Homeboy.jsLAYERobject.document.open();  }else{  Homeboy.jsLAYERobject.innerHTML="";}}
function jsLAYERwrite(Homeboy,Text){if(systemIsNS){Homeboy.jsLAYERdocument.write(Text);}else{Homeboy.jsLAYERobject.innerHTML+=Text;}}
function jsLAYERclose(Homeboy)
        {
        if(systemIsNS)
          {
          Homeboy.jsLAYERdocument.close();
          MOUSECAPTURE(Homeboy,Homeboy.lyrName);
          }
        }
function jsLAYERsetContent(Homeboy,text)
        {
        jsLAYERopen(Homeboy);
        jsLAYERwrite(Homeboy,text);
        jsLAYERclose(Homeboy);return;
        }
function jsLAYERshow(Homeboy,vis){Homeboy.style.visibility=((vis)?"visible":"hidden");}
function jsLAYERgetX(Homeboy){return parseInt(Homeboy.style.left);}
function jsLAYERgetY(Homeboy){return parseInt(Homeboy.style.top);}
function jsLAYERxy(Homeboy,x,y,InLayer) //hover clip
        {
        this.InX=x;this.InY=y;
        if(document.layers)
          {
          if(InLayer)
            {
            InX+=InLayer.style.left;
            InY+=InLayer.style.top-2;
            }
          Homeboy.jsLAYERobject.x=this.InX;
          Homeboy.jsLAYERobject.y=this.InY-2;
          }
	   else{

          if(InLayer)
            {
            this.InX+=parseInt(document.all[Homeboy.lyrName].style.left);
            this.InY+=parseInt(document.all[Homeboy.lyrName].style.top-2);
            }
          //alert(document.all[Homeboy.lyrName].style.left+"[]"+this.InX+"[]"+x)
          document.all[Homeboy.lyrName].style.left=this.InX
          document.all[Homeboy.lyrName].style.top=this.InY-2
          }
        }

/*Function      :MEVENT
**Parameters    :Homeboy        - Layer Class Pointer
**               Evt            - javascript Browser Event
**Description   :Noramalizes Netscape/MSIE evnts to 
**a class containing variables for both, with Netscape names
**superceding MSIE names. It is this psudeo event class that
**is passed to all MOUSE... event handler functions.
*/
function MEVENT(Homeboy,Evt) //normalizes the differences in NS and MSIE events
        {
        this.type=Evt.type;
        this.screenX=Evt.screenX;
        this.screenY=Evt.screenY;
        if(systemIsNS)
          {
        this.pageX=Evt.pageX;
        this.pageY=Evt.pageY;
        this.locationX=Homeboy.jsLAYERobject.x;
        this.locationY=Homeboy.jsLAYERobject.y;
        this.layerX=Evt.layerX;
        this.layerY=Evt.layerY;
        this.which=Evt.which;
        this.target=Evt.target;
        this.modifiers=Evt.modifiers;
          }else{
        this.pageX=Evt.x;
        this.pageY=Evt.y;
	if(document.body.scrollTop)this.pageY+=document.body.scrollTop;
        this.locationX=parseInt(Homeboy.jsLAYERobject.style.left);
        this.locationY=parseInt(Homeboy.jsLAYERobject.style.top);
        this.layerX=this.pageX-this.locationX;
        this.layerY=this.pageY-this.locationY;
        this.which=Evt.button+1;
        this.target=Evt.srcElement;
        this.modifiers=(((Evt.altKey)?1:0)+((Evt.ctrlKey)?2:0)+((Evt.AltKey)?4:0));
          }
        }
function MOUSEVECTOR(layername,Evt)// handles the actuall prep and call of mouse events
        {
        Homeboy=document.all[layername].HomeBoy;return false;
        }
// Sets up mouse event NOTE: Use of "new Function" is important
function MOUSECAPTURE(Homeboy,layername)
        {
var NFD="return "+Homeboy.jsLAYERobject.MOUSEHANDLER+"('"+layername+"',"+((systemIsNS)?"arguments[0]":"window.event")+")"
Homeboy.jsLAYERobject.onmouseover=new Function(NFD)
Homeboy.jsLAYERobject.onmouseout=new Function(NFD)
Homeboy.jsLAYERdocument.onmousemove=new Function(NFD)
Homeboy.jsLAYERdocument.onmousedown=new Function(NFD)
Homeboy.jsLAYERdocument.onmouseup=new Function(NFD)
if(systemIsNS)Homeboy.jsLAYERdocument.captureEvents(  Event.MOUSEUP |   Event.MOUSEDOWN   | Event.MOUSEMOVE);
        }
function NSResizePatch(){document.location.href=document.location.href;}
function jsNULLvector(layername,Evt){return true;}
var MPTYPE ="",MSTYPE ="";
function jsMPANELvector(panelName,Evt)  // Vectors mouse messages for the panel
        {
        Homeboy=jsLAYERhomeboy(panelName);
        if(menuTimeOut)clearTimeout(menuTimeOut);
        if(Evt.type=="mouseout" || Evt.type=="mousedown") 
          {
          MPTYPE=Evt.type;
          if(MPTYPE==MSTYPE&&MPTYPE=="mouseout")menuTimeOut=setTimeout("menuPOPDN()",100);
          }
        if(Evt.type!="mousemove" )return false;
        EVENT=new MEVENT(Homeboy,Evt);

        EntryNum=0;
        EntryNotch=EVENT.layerY;
        if(EntryNotch)
          {
          EntryNotch-=(EntryNotch%(menuCharHeight+1));
          EntryNum=(EntryNotch/(menuCharHeight+1))
          }
        if(Homeboy.mParent.Items.length<=EntryNum)return true;
        lastEVENT=EVENT;
        if(Homeboy.mParent.EntryNum==EntryNum)return false;

//if(!systemIsNS)
//{
//alert(EntryNum+"[]"+EntryNotch+"[]"+EVENT.layerY)
//Homeboy.mParent.Items[EntryNum].RENDER)
//}
        jsLAYERsetContent(Homeboy.mParent.mSELECT,Homeboy.mParent.Items[EntryNum].RENDER);

        jsLAYERxy(Homeboy.mParent.mSELECT,jsLAYERgetX(Homeboy),jsLAYERgetY(Homeboy)+(EntryNum*(menuCharHeight+1)));
        Homeboy.mParent.EntryNum=EntryNum;
        if(!menuSubAuto)return false;
        if(Homeboy.mParent.Items[EntryNum].ACTION.substring(0,1)=="@")
          {
          fakeEvt = new Object();
          fakeEvt.type="mousedown";
          jsMSELECTvector(Homeboy.mParent.mSELECT.lyrName,fakeEvt);
          }
        return false;
        }
/*
** Vectors mouse messages for the menu selector
*/
function jsMSELECTvector(panelName,Evt)
        {
        if(menuTimeOut)clearTimeout(menuTimeOut);
        if(Evt.type=="mouseout" || Evt.type=="mousedown") 
          {
          MSTYPE=Evt.type;
          if(MPTYPE==MSTYPE&&MPTYPE=="mouseout")menuTimeOut=setTimeout("menuPOPDN()",100);
          Homeboy=jsLAYERhomeboy(panelName);
          return false;
          }
        if(Evt.type!="mouseup")return false;
        Homeboy=jsLAYERhomeboy(panelName);
        var action = Homeboy.mParent.Items[Homeboy.mParent.EntryNum].ACTION;

        if(menuCurrentPath.indexOf(Homeboy.jsLAYERobject.GROUP)>0)
          {
          var FindGroup = ":"+Homeboy.jsLAYERobject.GROUP+":";
          var killList = menuCurrentPath.substring(menuCurrentPath.indexOf(FindGroup)+FindGroup.length-1);
          menuPOPDN(killList);
          }
        if(action.length<1){window.status="[Not Available]";return false;}
        var isMenu = action.substring(0,1)=="@";
        var isJavascript = action.substring(0,1)=="!";
        if(isJavascript)
          {
          eval(action.substring(1))
          return false;
          }
        if(isMenu)
          {
          menuPOPUP(jsLAYERgetX(Homeboy)+Homeboy.jsLAYERobject.W+2,jsLAYERgetY(Homeboy),action.substring(1));
          }else{
          document.location.href=action;
          }
        return false;
        }
/*
** This is the menu panel
*/
function jsMPANELclass(group,entry,label,action,x,y,w,h)
        {
        this.lyrName            =group+entry;
        //if(!document.all[this.lyrName])jsLAYERcreateLayer(this,x,y,w,h,"#000000");
        if(!document.all[this.lyrName])jsLAYERcreateLayer(this,x,y,w+40,h,"DARKGRAY");
        jsLAYERsetHandler(this,"jsMPANELvector");
        this.jsLAYERobject.GROUP=group;this.jsLAYERobject.ENTRY=entry;
        this.jsLAYERobject.rtWidth=10;
        this.jsLAYERobject.rtSymbol="»";
        }
/*
** This is the highlite bar
*/
function jsMSELECTclass(group,entry,label,action,x,y,w,h)
        {
        this.lyrName            =group+entry;
        if(!document.all[this.lyrName])jsLAYERcreateLayer(this,x,y,w+40,h);
        jsLAYERsetHandler(this,"jsMSELECTvector");
        this.jsLAYERobject.GROUP=group;
        this.jsLAYERobject.ENTRY=entry;
        this.jsLAYERobject.rtWidth=10;
        this.jsLAYERobject.rtSymbol="»";
        }
/*
** Create the menu label object string for display
function menuLABEL(Homeboy,text,isHighlight,isSub)
        {
        var fontstart="<FONT FACE='"+menuFont+"' SIZE="+menuFontSize+" COLOR='"+((isHighlight)?menuHTcolor:menuTcolor)+"'>"+((menuBold)?"<B>":"");
        var CONTENT=" ";
        if(text)CONTENT=text.length?" "+text:" ";
        var lyrtxt="<TABLE BORDER=0 CELLPADDING=0 STYLE='{cursor:hand;}' CELLSPACING=0 BGCOLOR='";
        lyrtxt+=((isHighlight)?menuHBcolor:menuBcolor);
        lyrtxt+="' WIDTH='"+Homeboy.jsLAYERobject.W+"' HEIGHT='"+(menuCharHeight-1)+"'>";
        lyrtxt+="<TR VALIGN=MIDDLE>";
        twidth=parseInt(Homeboy.jsLAYERobject.W)-parseInt(Homeboy.jsLAYERobject.rtWidth);
        lyrtxt+="<TD STYLE=\'padding:0px 0px 0px 0px;\' WIDTH='"+twidth.toString();
        lyrtxt+="'>"+fontstart+CONTENT+((menuBold)?"</B>":"")+"</FONT></TD>";
        lyrtxt+="<TD WIDTH='10'>"+fontstart+((isSub)?((isHighlight)?menuSubSymbol2:menuSubSymbol):" ")+((menuBold)?"</B><br>":"")+"</FONT></TD></TR>";
	 lyrtxt+="</TABLE>";
        return lyrtxt;
        }

*/
function menuLABEL(Homeboy,text,isHighlight,isSub)
        {
        var fontstart="<FONT FACE='"+menuFont+"' SIZE="+(menuFontSize-1)+" COLOR='"+((isHighlight)?menuHTcolor:menuTcolor)+"'>"+((menuBold)?"<B>":"");
        var CONTENT=" ";
        if(text)CONTENT=text.length?" "+text:" ";
        var lyrtxt="<TABLE BORDER=0 CELLPADDING=0 STYLE='cursor:hand;' CELLSPACING='0' BGCOLOR='";
        lyrtxt+=((isHighlight)?menuHBcolor:menuBcolor);
        lyrtxt+="' WIDTH='"+Homeboy.jsLAYERobject.W+"' HEIGHT='"+(menuCharHeight)+"'>";
	 lyrtxt+="<TR VALIGN=MIDDLE>";
        twidth=parseInt(Homeboy.jsLAYERobject.W)-parseInt(Homeboy.jsLAYERobject.rtWidth);
        lyrtxt+="<TD VALIGN=MIDDLE STYLE=\'padding:0px 0px 0px 10px;\' WIDTH='"+twidth.toString();
        //lyrtxt+="'>"+fontstart+CONTENT+((menuBold)?"</B>":"")+"</FONT>";
        //lyrtxt+=fontstart+((isSub)?((isHighlight)?menuSubSymbol2:menuSubSymbol):" ")+((menuBold)?"</B>":"")+"</FONT></TD></TR></TABLE>";
        lyrtxt+="'>"+fontstart+CONTENT+((menuBold)?"</B>":"")+"</FONT></TD>";
        lyrtxt+="<TD WIDTH='10'>"+fontstart+((isSub)?((isHighlight)?menuSubSymbol2:menuSubSymbol):" ")+((menuBold)?"</B>":"")+"</FONT></TD></TR></TABLE>";
  
       return lyrtxt;
        }

function MenuItem(label,action)
        {
        this.LABEL      =label  ;
        this.ACTION     =action ;
        this.SUB        =this.ACTION.substring(0,1)=="@";
        this.RENDER     =""     ;
        }
function MenuListAPPEND(label,action)   //Appends an item to the menuobject
        {
        this.Items[this.Items.length]=new MenuItem(label,action);
        if(label.length>this.greatestCharWidth)this.greatestCharWidth=label.length;
        }
function menuPop(tobj) //Pops up menu relative to <A> tag location on screen.
        {
        objectName=tobj.href.substring(tobj.href.lastIndexOf("/")+1);

        //alert(objectName.indexOf(".html"));
        if(objectName.indexOf(".html")>-1){
		objectName=objectName.substring(0,objectName.indexOf("."))
              //alert(objectName);
	 }

	 //if(!menuCurrentPath)return;

        //if(menuCurrentPath.indexOf(":"+objectName+":")==0 )return false;

	 //alert(menuCurrentPath.indexOf(":" + objectName + ":"));
        if(menuCurrentPath.indexOf(":"+objectName+":")==0 )return false;



        //alert(menuCurrentPath.length);
        if(menuCurrentPath.length>0)menuPOPDN();

//alert(szDuds.indexOf(navigator.userAgent));

if(szDuds.indexOf(navigator.userAgent)>-1)
{
//alert(tobj.href.indexOf(".html"));
if(tobj.href.indexOf(".html")==-1)tobj.href+=".html";
return true;
}

	 //alert(navigator.appVersion);

        if(navigator.appVersion.indexOf("MSIE")>-1 && navigator.appVersion.indexOf("Mac")>-1)
          {// compatible mac
          if(tobj.href.indexOf(".html")==-1)tobj.href+=".html";
          return true;
          }

	//alert(systemIsNS);

        //this.MX=((systemIsNS)?(tobj.x):window.event.clientX-window.event.offsetX+tobj.offsetLeft);
        //this.MY=((systemIsNS)?(tobj.y):window.event.clientY-window.event.offsetY+tobj.offsetTop);

        this.MX=((systemIsNS)?(tobj.x):event.clientX-event.offsetX+tobj.offsetLeft);
        this.MY=((systemIsNS)?(tobj.y):event.clientY-event.offsetY+tobj.offsetTop);

	

        if(!systemIsNS){
		MSIEmeasure(tobj,this);
	 }

        //alert(MSIEmeasure(tobj,this));    
        this.MY+=menuYpopoff;
        this.MX+=menuXpopoff;
        //alert(this.MX + '-'+ this.MY);
        menuPOPUP(this.MX,this.MY,objectName);
        menuTimeOut=setTimeout("menuPOPDN()",menuAtimeout);
        return false;
        }

function menuPOPUP(x,y,menulist)        //*** Opens named menu at given location
        {
        var DL=eval(menulist);
        if(!DL){alert("menuPOPUP NULL "+menulist);return;}
        menuSHOW(menulist,x,y);
        if(!menuScreenWidth)
          menuScreenWidth=(systemIsNS)?document.width:document.body.offsetWidth;
        mkw=(DL.greatestCharWidth*menuCharWidth)+10;
        var atX = ((x+mkw+20)>=menuScreenWidth)?x-mkw:x;
        if(jsLAYERgetX(DL.mPANEL)!=atX)menuXY(DL,atX,y);
        }
function menuCREATE(szMlist,iLeft,iTop)
        {
        Left= 20;Top = 40;
        if(menuCREATE.arguments.length>1)Left=iLeft;
        if(menuCREATE.arguments.length>2)Top=iTop+4;
        Mlist=eval(szMlist);
        if(Mlist.mPANEL ==null)
          {
          Mlist.mPANEL=new jsMPANELclass(szMlist,0,"Hello","alert('hi')",Left,Top,((Mlist.greatestCharWidth+15)*menuCharWidth)+1,((menuCharHeight+1)*Mlist.Items.length));
          Mlist.mPANEL.mParent=Mlist;
          var menuContent='';
          menuContent='<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 STYLE=padding:0px 0px 3px 3px><TR><TD >';
          //menuContent='<div  style="background-color: #FFFFFF; padding: 1px 1px 1px 1px; border-width: thin; >';

          for(x=0;x<Mlist.Items.length;x++)
           {
           menuContent+=menuLABEL(Mlist.mPANEL,Mlist.Items[x].LABEL,false,Mlist.Items[x].SUB);
           Mlist.Items[x].RENDER=menuLABEL(Mlist.mPANEL,Mlist.Items[x].LABEL,true,Mlist.Items[x].SUB);
           }
        menuContent+='</TD></TR>';
	// menuContent+='<TR><TD BGCOLOR="#F1F1EE">&nbsp;sdfsd</TD>';
        //menuContent+="</TR>";
	// menuContent+="<TR><TD STYLE=\'padding:0px 0px 0px 0px;\' COLSPAN=2> </TD></TR>";
	 menuContent+="</TABLE>";
	 //menuContent+="</div>";

//alert(menuContent);
          jsLAYERsetContent(Mlist.mPANEL,menuContent);
          }

        if(Mlist.mSELECT==null)
          {
          Mlist.mSELECT=new jsMSELECTclass(szMlist,1,"Hello","alert('hi')",Left,Top,(Mlist.greatestCharWidth+15)*menuCharWidth,menuCharHeight-1);
          Mlist.mSELECT.mParent=Mlist;
          jsLAYERsetContent(Mlist.mSELECT,Mlist.Items[0].RENDER);
          }
        }

function menuSHOW(szMlist,iLeft,iTop)   // SHOW the menu
        {
        Left= 20;Top = 40;
        if(menuSHOW.arguments.length>1)Left=iLeft;
        if(menuSHOW.arguments.length>2)Top=iTop+4;
        Mlist=eval(szMlist);
        if(Mlist.mPANEL==null)menuCREATE(szMlist,iLeft,iTop);
        if(jsLAYERgetX(Mlist.mPANEL)!=Left || jsLAYERgetY(Mlist.mPANEL)!=Top)
            {
            jsLAYERxy(Mlist.mPANEL,Left,Top)   
            jsLAYERxy(Mlist.mSELECT,Left,Top+(Mlist.EntryNum*(menuCharHeight+1)));
            }; 
        if(menuCurrentPath.indexOf(":"+szMlist+":")<0)menuCurrentPath+=((menuCurrentPath.length)?"":":")+szMlist+":";

        if(Mlist.mPANEL.style.clip&&!systemIsNS)
          {
          Clips= Mlist.mPANEL.style.clip.split("rect(")[1].split(")")[0].split("px")
          Clips[2]=Mlist.Items.length * (menuCharHeight+1);
          Mlist.mPANEL.style.clip = "rect("+Array(0,Clips[1],Clips[2],0).join("px ")+"px)";
          Mlist.mPANEL.style.zIndex=5;
          Mlist.mSELECT.style.zIndex=6;
          }
        Mlist.mPANEL.style.visiblity='visible';
//alert(Mlist.Items.length +" Item(s) "+ Mlist.mPANEL.style.clip);
        jsLAYERshow(Mlist.mPANEL,true);
        jsLAYERshow(Mlist.mSELECT,true);
        }
function menuHIDE(szMlist)      //  Hides the named menu
        {
        Mlist=eval(szMlist);
        jsLAYERshow(Mlist.mSELECT,false);
        jsLAYERshow(Mlist.mPANEL,false);
        }
function menuXY(Mlist,x,y)      // Moves the referenced menu
        {
        jsLAYERxy(Mlist.mPANEL,x,y)
        jsLAYERxy(Mlist.mSELECT,x,y+(Mlist.EntryNum*(menuCharHeight+1)));
        }
function menuPOPDN(treeList)    // closes a list of menus
        {
        if(menuTimeOut)clearTimeout(menuTimeOut);
        if(menuPOPDN.arguments.length<1)treeList=menuCurrentPath;
        while(treeList.length>1)
             {          
             killboy =treeList.substring(1);
             killboy =killboy.substring(0,killboy.indexOf(":"));
             treeList=treeList.substring(killboy.length+1);
             menuHIDE(killboy);
             }
        if(menuPOPDN.arguments.length<1)menuCurrentPath="";
        };
/*
** MAIN MENU OBJECT
*/
var mSELECT=null;
function MenuList(Mlist)
        {
        this.mPANEL=null;this.mSELECT=null;
        this.Items=new Array();this.EntryNum=0;
        this.APPEND=MenuListAPPEND;
        this.greatestCharWidth=0;
        }

/*      Function        :MSIEmeasure
**      Since I have found no straight forward method of obtaining IE x,y
**      coords for the clicked link, this function recurses up the object tree
**      to measure the screen location of the <A> involved
*/
function MSIEmeasure(btobj,HB)
        {
        var tobj=btobj;
        HB.MX=tobj.offsetLeft;
        HB.MY=tobj.offsetTop;
        while(tobj.parentElement)
          {
          if(!tobj.parentElement)break;
          tobj = tobj.parentElement;
//        if(tobj.tagName=="TABLE")
          if(String(":TABLE:TD:span:").indexOf(":"+tobj.tagName+":")>-1)
            {
            HB.MX+=tobj.offsetLeft;
            HB.MY+=tobj.offsetTop;
            }
          if(!tobj.parentElement)break;
          if(tobj.parentElement.tagName=="BODY")break;
          }
        return ;
        }
/****************************************
** A message window                     *
*****************************************/
var StatusMsgWin=null;
function jsMESSAGEclass(group,entry,x,y,w,h)
        {
        this.lyrName            =group+entry;
        if(!document.all[this.lyrName])jsLAYERcreateLayer(this,x,y,w,h,"#FFFFCC");
        jsLAYERsetHandler(this,"jsNULLvector");
        jsLAYERshow(this,true);
        this.jsLAYERobject.GROUP=group;this.jsLAYERobject.ENTRY=entry;
        }
/*
** Set the contents of the message window;
*/
function jsStatusMsg(txtMESSAGE)
        {
        if(!StatusMsgWin)
          {
          StatusMsgWin= new jsMESSAGEclass("E",1,1,1,355,100);
          jsLAYERshow(StatusMsgWin,true);
          }
        jsLAYERsetContent(StatusMsgWin,txtMESSAGE);
        }
var LIBLOADEDJSmenu=true;
//systemLibCnt++; 
//---------------------------------------END MENU---------------------------------------------------------




-->