/*****************************************************************************
* ITSMenuLibrary.js *
*****************************************************************************
* Release 4.0 (Lotus Domino 5/6) *
* Created by Dwight Egerton *
* Last modified 23 January 2003 by Dwight Egerton *
* *
* Description: *
* Code for menus for all Web applications *
* *
*****************************************************************************
* IT Software Series *
* *
*****************************************************************************
*****************************************************************************
* Menu Object/Style/Item properties *
*****************************************************************************/
function menuSTYLE(w,h,t,l,r){
this.width=Math.round((page.x2-l)*(w/100));
this.height=h;
this.top=t;
this.left=l;
this.regClass='menuItem-Out';
this.overClass='menuItem-Over';
this.arrow=true;
this.arrowImg='/mgb/portalit.nsf/menuarrow.gif';
this.arrowWidth=12;
this.arrowHeight=7;
this.rows=r;
return this
}
function menuITEM(l,p,id,name,type,act,target,img){
this.level=l;
this.parent=p;
this.id=id;
this.name=name;
this.type=type;
this.action=act;
this.target=target;
this.img=img;
this.imgW=12;
this.imgH=12;
this.item=new Array();
this.txt='';
this.zindex=200;
this.addMENU=addMENU;
return this
}
function menuOBJ(id){
this.level=0;
this.parent='';
this.id=id;
this.scroll=true;
this.hidelist=0;
this.item=new Array();
this.style=new Array();
this.layClass='menuLayout';
this.help=false;
this.refresh=true;
this.zindex=100;
this.addMENU=addMENU;
this.menuBUILD=menuBUILD;
this.menuSCROLL=menuSCROLL;
return this
}
/*****************************************************************************
* Build the menu for display *
*****************************************************************************/
function menuBUILD(){
var txt='';
txt+='
| ';
for(x=0;x ';
if(this.item[x].img!=null) txt+='  ';
txt+=this.item[x].name+ ' ';
if(this.item[x].item!='') {
if(this.style[this.item[x].level].arrow) txt+='  ';
txt+=' ';
this.item[x].txt='';
}
txt+=' ';
}
txt+=' ';
txt+=' |
';
bc.doc.write(txt);
div=bc.doc.getElementById(this.id)
div.p=this;
div.o=new libraryOBJ(div.id,'');
for(x=0;x ';
if(i.img!=null) txt+='

';
txt+=i.name+ '
';
return txt
}
/*****************************************************************************
* Add menu items / sub items *
*****************************************************************************/
function addMENU(name,type,act,target,img){
id=this.id+mIdx;
this.item[this.item.length]=new menuITEM(this.level+1,this,id,name,type,act,target,img);
mIdx++;
}
/*****************************************************************************
* Mouse Functions *
*****************************************************************************/
function menuOVER(c) {
isON=true;
if(typeof(c.p.parent.parent.style)!='undefined') style=c.p.parent.parent.style;
else style=c.p.parent.style;
c.o.evnt.className=style[c.p.level].overClass
}
function menuOUT(c) {
isON=false;
if(typeof(c.p.parent.parent.style)!='undefined') style=c.p.parent.parent.style;
else style=c.p.parent.style;
c.o.evnt.className=style[c.p.level].regClass
timer=setTimeout('menuCLOSE()',200);
}
function menuCLOSE() {
if(lastMENU!=null){
if(isON==false){
lastMENU.s.writeIt('');
lastMENU=null;
}
}
}
function menuCLICK(c) {
if(c.p.item==''&&!c.p.type){
tWin=parent.oWin;
if(c.p.target==-1) bc.doc.location.href=c.p.action;
else{
if(bc.ie5){
obj=tWin[c.p.target].oText.obj.substring(0,tWin[c.p.target].oText.obj.indexOf('Object'));
obj.location.href=c.p.action;
}
else tWin[c.p.target].oText.evnt.contentWindow.location.href=c.p.action;
}
}
else if(c.p.item==''&&c.p.type) eval(c.p.action);
else {
if(lastMENU!=null){
lastMENU.s.writeIt('');
lastMENU=null;
}
c.s.writeIt(c.p.txt);
lastMENU=c;
isON=true;
for(x=0;x