
<!--
//                            ################################
//                            #******************************#
//                            #*****Polymath Menus v3.5******#
//                            #***Produced by Blake Lucas****#
//                            #*http://polymathic.tripod.com*#
//                            #***blacklight@dialpoint.net***#
//                            #******************************#
//                            ################################
whichDiv=-1
whichOrder=0
oldWhichOrder=0
var menuList=new Array()
doneloading=false
oldmenu=0
bodyOnLoad=new Function()
function menu(name){
  //functions
  this.build=startMenu
  this.writeMenu=writeMenu
  this.roll=roll
  this.sync=sync
  this.hidebranch=hidebranch
  this.hultbranch=hultbranch
  this.buildbranch=buildbranch
  this.slideBack=slideBack
  this.slideUp=slideUp
  this.titleopen=titleopen
  this.closeMenu=closeMenu
  this.moveto=moveto
  this.OnOut=OnOut
  this.disMenu=disMenu
  this.buildTree=buildTree
  this.findTextHeight=findTextHeight
  this.drawMenu=drawMenu
  this.show=shower
  this.moveit=moveit
  this.move=move
  //variables
  this.timer=false
  this.texth=0
  this.templayer=0
  this.sliding=false
  this.selected=-2
  this.runer=0
  this.rollactions=new Array()
  this.oldwhichmen=""
  this.oldtop=-1
  this.oldroll=-2
  this.oldmenuRolled=-3
  this.oldmenu=-1
  this.oldlength=0
  this.oldleft=0
  this.olddiv=0
  this.lpos=-1
  this.tpos=-1
  this.nav=false
  this.movetofunc=false
  this.keeplayer=0
  this.keeplayer2=0
  this.entries=new Array()
  this.depth=0
  this.delay=200
  this.currentpos=new Array()
  this.cliped=new Array()
  this.clickactions=new Array()
  this.branch=false
  this.layerOrder=menuList.length
  this.treeArray=new Array()
  this.treeSize=new Array()
  this.roller=false
  this.runonce=true
  this.positionMenu=positionMenu
  //object list
  menuList[menuList.length]=name
  //defaults
  this.fontSize=3;
  this.fontBold=true;
  this.fontItalic=false;
  this.fontFace='Times';
  this.fontColor='white';
  this.fontHoverColor='black';
  this.fontBgColor='black';
  this.fontHoverBgColor='white';
  this.fontTitleColor='';
  this.fontTitleHoverColor='';
  this.fontTitleBgColor='';
  this.fontTitleHoverBgColor='';
  this.fontTitleFace=''
  this.fontTitleAlign="center"
  this.fontAlign="right"
  this.borderWidth=0;
  this.borderBgColor='black';
  this.targetFrame='';
  this.cascadeDirection="right"
  this.menuHeader=true;
  this.menuMainHeader=true;
  this.menuTitle="Main"
  this.menuWidth=100;
  this.menuSpace=1;
  this.menuOffset=40;
  this.arrowUrl='arrow.gif';
  this.menuStayOpen=false;
  this.position="0,0";
  this.positionLock=true;
  this.newStyle=false;
  this.menuHidden=false
  this.tree=new Array()
}
function loaded(){ //build menus when page has finished loading
  for(q=0;q!=menuList.length;q++){
    menuObj(q).build();
  }
  bodyOnLoad()
}

function menuObj(val){
  return(eval(menuList[val]))
}
function startMenu(){ //draw layers
  if(this.newStyle){
    this.menuMainHeader=true
    this.menuHeader=true
  }
  if(!this.menuMainHeader){
    this.menuStayOpen=true;
  }
  if(this.cascadeDirection.toLowerCase()=="left"){
    this.menuOffset=-this.menuOffset
    this.menuSpace=-2*this.menuWidth-this.menuSpace
  }
  if(!this.fontTitleColor&&!this.fontTitleBgColor){
    this.fontTitleColor=this.fontColor
    this.fontTitleHoverColor=this.fontHoverColor
    this.fontTitleBgColor=this.fontBgColor
    this.fontTitleHoverBgColor=this.fontHoverBgColor
  }
  if(!this.fontTitleFace){
    this.fontTitleFace=this.fontFace
  }
  if(!this.fontHoverBgColor){this.fontHoverBgColor=this.fontBgColor}
  this.drawMenu(1);
  this.currentpos[0]=-1
  this.writeMenu("",0)
  this.buildTree()
  this.disMenu("",0)
  this.findTextHeight()
  this.positionMenu();
  div("RegularLayer"+this.layerOrder+"_0").move(this.lpos,this.tpos)
  this.moveto()
  if(!this.menuStayOpen){
    div("RegularLayer"+this.layerOrder+"_0").clip(0,div("RegularLayer"+this.layerOrder+"_0").width(),this.texth+(this.borderWidth*2),0);
    this.cliped[0]=1;
  } else {
     this.nav=true
  }
  div("RolledLayer"+this.layerOrder+"_0").clip(0,0,0,0);
  this.sync(0)
  this.currentpos[1]=0;
  if(!this.menuHidden){
    div("RegularLayer"+this.layerOrder+"_0").show();
    div("RolledLayer"+this.layerOrder+"_0").show();
    div("TransparentLayer"+this.layerOrder+"_0").show();
  }
  doneloading=true
}
function positionMenu(){
  temp=new Array();
  temp=this.position.split(",");
  switch(temp[0].toLowerCase()){
    case "left":this.lpos=0;break;
    case "center":this.lpos=(lib.browserWidth-this.menuWidth)/2;break;
    case "right":this.lpos=lib.browserWidth-this.menuWidth;break;
    default:this.lpos=parseInt(temp[0]);
  }
  this.lpos=Math.round(this.lpos);
  switch(temp[1].toLowerCase()){
    case "top":this.tpos=0;break;
    case "middle":this.tpos=(lib.browserHeight-((this.menuStayOpen)?div("RegularLayer"+this.layerOrder+"_0").height():this.texth))/2;break;
    case "bottom":this.tpos=lib.browserHeight-div("RegularLayer"+this.layerOrder+"_0").height();break;
    default:this.tpos=Math.round(parseInt(temp[1]));
  }
  this.tpos=Math.round(this.tpos);
}
function resize(w,h){
  window.scroll(0,0)
  for(q=0;q!=menuList.length;q++){
    menuObj(q).positionMenu();
    menuObj(q).move(menuObj(q).lpos,menuObj(q).tpos);
  }
}
function drawMenu(extent){
  for(depcount=this.depth;depcount<=extent;depcount++){
    create("RolledLayer"+this.layerOrder+"_"+depcount,"position:absolute;left:0;top:0;z-index:"+(depcount*3+1)+";visibility:hidden;","");
    create("RegularLayer"+this.layerOrder+"_"+depcount,"position:absolute;left:0;top:0;z-index:"+(depcount*3)+";visibility:hidden;","");
    create("TransparentLayer"+this.layerOrder+"_"+depcount,"position:absolute;left:0;top:0;z-index:"+(depcount*3+2)+";visibility:hidden;","<table border=0 cellspacing=0 cellpadding=0 width=0 height=0><TR><TD>&nbsp;</td></tr></table>");
    div("TransparentLayer"+this.layerOrder+"_"+depcount).mouseOver("whichOrder="+this.layerOrder+";whichDiv="+depcount);
    div("TransparentLayer"+this.layerOrder+"_"+depcount).mouseOut("whichDiv=-1");
    this.currentpos[depcount]=1
    this.cliped[depcount]=0
  }
  this.depth=depcount;
}
function findTextHeight(){
  this.texth=(div("RegularLayer"+this.layerOrder+"_0").height()-(this.borderWidth*2))/(this.tree.length+((this.menuMainHeader)?1:0))
}
function move(x,y){
  for(poscount=1;poscount!=this.depth;poscount++){
    div("RegularLayer"+this.layerOrder+"_"+poscount).hide()
    div("RolledLayer"+this.layerOrder+"_"+poscount).hide()
    div("TransparentLayer"+this.layerOrder+"_"+poscount).hide()
  }
  div("RegularLayer"+this.layerOrder+"_0").move(x,y);
  this.sync(0);
}
function moveto(){ //move menu as person scrolls
  this.topval=(n4)?window.pageYOffset:window.document.body.scrollTop;
  this.leftval=(n4)?window.pageXOffset:window.document.body.scrollLeft;
  if(!this.positionLock){
   if(this.oldtop!=this.topval||this.oldleft!=this.leftval){
     this.oldtop=this.topval
     this.oldleft=this.leftval
     div("RegularLayer"+this.layerOrder+"_0").slideStop();
     this.runonce=false;
   } else {
     if(!this.runonce){
       this.runonce=true;
       this.moveit();
     }
   }
  }
  this.movetofunc=window.setTimeout(menuList[this.layerOrder]+".moveto()",10);
}
function moveit(){
  yamt=null
  xamt=null
  Dinc=-1;
  if(this.nav){
    for(count=1;count!=this.depth;count++){
       div("RegularLayer"+this.layerOrder+"_"+count).hide()
       div("RolledLayer"+this.layerOrder+"_"+count).hide()
       div("TransparentLayer"+this.layerOrder+"_"+count).hide()
    }
    if(this.menuStayOpen){this.titleopen(1)}
    this.closeMenu()
  }
  if(div("RegularLayer"+this.layerOrder+"_0").y()!=this.oldtop+this.tpos){
    ypos=div("RegularLayer"+this.layerOrder+"_0").y();
    if(div("RegularLayer"+this.layerOrder+"_0").y()>lib.browserHeight+this.oldtop){
      ypos=this.oldtop+lib.browserHeight;
    }
    if(div("RegularLayer"+this.layerOrder+"_0").y()+div("RegularLayer"+this.layerOrder+"_0").height()<this.oldtop){
      ypos=this.oldtop-div("RegularLayer"+this.layerOrder+"_0").height()
    }
    div("RegularLayer"+this.layerOrder+"_0").slideStop();
    div("RegularLayer"+this.layerOrder+"_0").move(null,ypos);
    Dinc=Math.ceil(Math.abs((this.oldtop+this.tpos-div("RegularLayer"+this.layerOrder+"_0").y())/20));
    yamt=Math.round(this.oldtop+this.tpos)
  }
  if(div("RegularLayer"+this.layerOrder+"_0").x()!=this.oldleft+this.lpos){
    xpos=div("RegularLayer"+this.layerOrder+"_0").x();
    if(div("RegularLayer"+this.layerOrder+"_0").x()>lib.browserWidth+this.oldleft){
      xpos=this.oldleft+lib.browserWidth;
    }
    if(div("RegularLayer"+this.layerOrder+"_0").x()<this.oldleft){
      xpos=this.oldleft-div("RegularLayer"+this.layerOrder+"_0").width()
    }
    div("RegularLayer"+this.layerOrder+"_0").slideStop();
    div("RegularLayer"+this.layerOrder+"_0").move(xpos,null);
    if(Dinc!=-1){
      Dinc=Math.ceil(Math.abs((this.oldleft+this.lpos-div("RegularLayer"+this.layerOrder+"_0").x())/20));
    }
    xamt=Math.round(this.oldleft+this.lpos)
  }
  div("RegularLayer"+this.layerOrder+"_0").slide(xamt,yamt,Dinc,10,"menuObj("+this.layerOrder+").sync(0)");
}
function disMenu(whichmen,writelayer){ //write content for child menus
  if(!this.sliding){
    div("RolledLayer"+this.layerOrder+"_"+writelayer).bgColor(this.fontHoverBgColor)
    div("RegularLayer"+this.layerOrder+"_"+writelayer).bgColor(this.fontBgColor)
    div("RegularLayer"+this.layerOrder+"_"+writelayer).write(eval(menuList[this.layerOrder]+".treeReg"+whichmen));
    div("RolledLayer"+this.layerOrder+"_"+writelayer).write(eval(menuList[this.layerOrder]+".treeRoll"+whichmen));
    div("RegularLayer"+this.layerOrder+"_"+writelayer).clip(0,div("RegularLayer"+this.layerOrder+"_"+writelayer).width(),div("RegularLayer"+this.layerOrder+"_"+writelayer).height(),0);
    div("TransparentLayer"+this.layerOrder+"_"+writelayer).write("<table border=0 cellspacing=0 cellpadding=0 width="+div("RegularLayer"+this.layerOrder+"_"+writelayer).width()+" height="+div("RegularLayer"+this.layerOrder+"_"+writelayer).height()+"><TR><TD>&nbsp;</td></tr></table>");
    div("TransparentLayer"+this.layerOrder+"_"+writelayer).resize(div("RegularLayer"+this.layerOrder+"_"+writelayer).width(),div("RegularLayer"+this.layerOrder+"_"+writelayer).height());
    eval("temp=new Array();temp=this.tree"+whichmen);
    this.entries[writelayer]=temp.length+(((writelayer==0&&this.menuMainHeader)||(writelayer!=0&&this.menuHeader))?1:0);
    eval(menuList[this.layerOrder]+'.rollactions[writelayer]='+menuList[this.layerOrder]+'.ractions'+whichmen);
    eval(menuList[this.layerOrder]+'.clickactions[writelayer]='+menuList[this.layerOrder]+'.cactions'+whichmen);
  }
}
function buildTree(){ //pre-computate child menus
    for(y=0;y!=this.treeArray.length;y++){
      this.writeMenu(this.treeArray[y],this.treeSize[y]);
    }
}
function writeMenu(whichmen,writelayer){ //generate HTML code for child menus
  if(!this.sliding){
    var storecode;
    eval("temp=new Array();temp=this.tree"+whichmen);
    if(whichmen==""){
      branchName=this.menuTitle
    } else {
      temp2=whichmen.split("_");
      keepid=temp2[temp2.length-1]
      temp2.length-=1
      var newWhichmen=temp2.join("_");
      eval("temp3=new Array();temp3=this.tree"+newWhichmen);
      temp3=temp3[keepid].split(",")
      branchName=temp3[0]
    }
    this.rollactions[writelayer]=new Array()
    this.clickactions[writelayer]=new Array()
    par=menuList[this.layerOrder]+'.oldwhichmen=\'\';'+menuList[this.layerOrder]+'.titleopen('+(writelayer+1)+');'+menuList[this.layerOrder]+'.oldlength=0;if(!'+menuList[this.layerOrder]+'.cliped['+writelayer+']){'+menuList[this.layerOrder]+'.hidebranch('+(writelayer+1)+')};window.status=\\"'+branchName+'\\";'
    eval(menuList[this.layerOrder]+'.ractions'+whichmen+'=new Array()');
    eval(menuList[this.layerOrder]+'.cactions'+whichmen+'=new Array()');
    eval(menuList[this.layerOrder]+'.ractions'+whichmen+'[0]="'+par+'"');
    eval(menuList[this.layerOrder]+'.cactions'+whichmen+'[0]=""');
    storecode="<table border="+this.borderWidth+" width="+this.menuWidth+" bordercolor='"+this.borderBgColor+"' bordercolorlight='"+this.borderBgColor+"' bordercolordark='"+this.borderBgColor+"' cellspacing=0 cellpadding=0>"
    mirrorcode="<table border="+this.borderWidth+" width="+this.menuWidth+" bordercolor='"+this.borderBgColor+"' bordercolorlight='"+this.borderBgColor+"' bordercolordark='"+this.borderBgColor+"' cellspacing=0 cellpadding=0>"
    if((writelayer==0&&this.menuMainHeader)||(writelayer!=0&&this.menuHeader)){
      storecode+="<TR><TD align='"+this.fontTitleAlign+"' nowrap bgColor='"+this.fontTitleHoverBgColor+"'><font face='"+this.fontTitleFace+"' color='"+this.fontTitleHoverColor+"' size='"+this.fontSize+"'>"+((this.fontItalic)?"<I>":"")+""+((this.fontBold)?"<B>":"")+""+branchName+""+((this.fontBold)?"</B>":"")+""+((this.fontItalic)?"</I>":"")+"</font></TD></TR>"
      mirrorcode+="<TR><TD align='"+this.fontTitleAlign+"' nowrap bgColor='"+this.fontTitleBgColor+"'><font face='"+this.fontTitleFace+"' color='"+this.fontTitleColor+"' size='"+this.fontSize+"'>"+((this.fontItalic)?"<I>":"")+""+((this.fontBold)?"<B>":"")+""+branchName+""+((this.fontBold)?"</B>":"")+""+((this.fontItalic)?"</I>":"")+"</font></TD></TR>"
    }
    for(mencount=0;mencount!=temp.length;mencount++){
      Artemp=new Array()
      Artemp=temp[mencount].split(",")
      lkname=Artemp[0]
      lkaddr=Artemp[1]
      var rollcode=menuList[this.layerOrder]+'.hidebranch('+(writelayer+1)+');window.status=\\"'+lkname+' : '+((lkaddr)?lkaddr:"")+'\\";'
      var imgcode=""
      if(lkaddr=="branch"){
        lkaddr=menuList[this.layerOrder]+'.slideBack('+(writelayer+1)+')'
        rollcode=menuList[this.layerOrder]+'.hultbranch(\''+whichmen+'_'+mencount+'\','+mencount+','+(writelayer+1)+');window.status=\\"'+lkname+'\\";'
        if(this.arrowUrl){imgcode="<img src='"+this.arrowUrl+"' border=0 onload='"+menuList[this.layerOrder]+".findTextHeight()'>"}
        this.treeArray[this.treeArray.length]=whichmen+'_'+mencount;
        this.treeSize[this.treeSize.length]=writelayer+1;
      } else {
        if(this.targetFrame){
          lkaddr="parent."+this.targetFrame+".location.href='"+lkaddr+"'"
        } else {
          lkaddr="location.href='"+lkaddr+"'"
        }
      }
      storecode+="<TR bgColor='"+this.fontHoverBgColor+"' border="+this.borderWidth+"><TD align='"+this.fontAlign+"' nowrap>"+((this.fontAlign.toLowerCase()=="left")?imgcode:"")+""
                   +"<font face='"+this.fontFace+"' color='"+this.fontHoverColor+"' size='"+this.fontSize+"'>"+((this.fontItalic)?"<I>":"")+""+((this.fontBold)?"<B>":"")+""+lkname+""+((this.fontBold)?"</B>":"")+""+((this.fontItalic)?"</I>":"")+"</font>"+((this.fontAlign.toLowerCase()=="right")?imgcode:"")+""
                   +"</TD></TR>"
      mirrorcode+="<TR bgColor='"+this.fontBgColor+"' border="+this.borderWidth+"><TD align='"+this.fontAlign+"' nowrap>"+((this.fontAlign.toLowerCase()=="left")?imgcode:"")+""
                   +"<font face='"+this.fontFace+"' color='"+this.fontColor+"' size='"+this.fontSize+"'>"+((this.fontItalic)?"<I>":"")+""+((this.fontBold)?"<B>":"")+""+lkname+""+((this.fontBold)?"</B>":"")+""+((this.fontItalic)?"</I>":"")+"</font>"+((this.fontAlign.toLowerCase()=="right")?imgcode:"")+""
                   +"</TD></TR>"
      eval(menuList[this.layerOrder]+'.ractions'+whichmen+'['+(mencount+1)+']="'+rollcode+'"');
      eval(menuList[this.layerOrder]+'.cactions'+whichmen+'['+(mencount+1)+']="'+lkaddr+'"');
    }
    eval(menuList[this.layerOrder]+'.treeReg'+whichmen+'="'+mirrorcode+'</table>"');
    eval(menuList[this.layerOrder]+'.treeRoll'+whichmen+'="'+storecode+'</table>"');
  }
}
function roll(layer,select){ //execute text rollover
  if(select!=-2&&!this.sliding){
    if(this.oldmenuRolled!=layer&&this.oldmenuRolled!=-3){
      div("RolledLayer"+this.layerOrder+"_"+this.oldmenuRolled).clip(0,0,0,0);
    }
    this.oldmenuRolled=layer
    topV=(select+1)*this.texth+(this.borderWidth)
    rightV=div("RolledLayer"+this.layerOrder+"_"+layer).width()
    bottomV=(select+2)*this.texth+(this.borderWidth)
    div("RolledLayer"+this.layerOrder+"_"+layer).clip(topV,rightV,bottomV,0);
  } else {
    div("RolledLayer"+this.layerOrder+"_"+layer).clip(0,0,0,0);
  }
}
function sync(layer){ //synchronize layers to the Regular layer
  div("RolledLayer"+this.layerOrder+"_"+layer).move(div("RegularLayer"+this.layerOrder+"_"+layer).x(),div("RegularLayer"+this.layerOrder+"_"+layer).y());
  div("TransparentLayer"+this.layerOrder+"_"+layer).move(div("RegularLayer"+this.layerOrder+"_"+layer).x(),div("RegularLayer"+this.layerOrder+"_"+layer).y());
  div("TransparentLayer"+this.layerOrder+"_"+layer).clip(0,div("RegularLayer"+this.layerOrder+"_"+layer).clip('r'),div("RegularLayer"+this.layerOrder+"_"+layer).clip('b'),0)
}
function hidebranch(layer){
  div("RegularLayer"+this.layerOrder+"_"+layer).hide();
  div("TransparentLayer"+this.layerOrder+"_"+layer).hide();
  if(this.branch){window.clearTimeout(this.branch);this.branch=false;this.oldwhichmen="";}
  if(!this.newStyle){
    for(poscount=layer+1;poscount!=this.depth;poscount++){
      div("RegularLayer"+this.layerOrder+"_"+poscount).hide()
      div("TransparentLayer"+this.layerOrder+"_"+poscount).hide()
    }
  }
}
function hultbranch(whichmen,men,layer){ //delay menus from opening
  if(whichmen!=this.oldwhichmen){
    this.hidebranch(layer)
  } else {
    window.clearTimeout(this.branch);
  }
  this.branch=window.setTimeout(menuList[this.layerOrder]+'.buildbranch("'+whichmen+'",'+men+','+layer+');',this.delay);
}
function buildbranch(branchmen,menu,stolayer){
  if(this.oldwhichmen!=branchmen&&!this.sliding){
    this.drawMenu(stolayer+1);
    this.oldwhichmen=branchmen
    this.oldlength=stolayer
    this.currentpos[stolayer]=1
    this.cliped[stolayer]=0
    this.disMenu(branchmen,stolayer);
    yval=div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).y()+((((stolayer-1==0&&this.menuMainHeader)||(stolayer-1!=0&&this.menuHeader))?1:0)+menu)*this.texth;
    if(yval+div("RegularLayer"+this.layerOrder+"_"+stolayer).height()>lib.browserHeight+this.topval){
      yval=lib.browserHeight+this.topval-div("RegularLayer"+this.layerOrder+"_"+stolayer).height();
    }
    xval=div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).width()+div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).x()+this.menuSpace;
    if(xval+div("RegularLayer"+this.layerOrder+"_"+stolayer).width()>lib.browserWidth+this.leftval){
      xval=div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).x()-div("RegularLayer"+this.layerOrder+"_"+stolayer).width()-this.menuSpace;
    }
    if(xval<this.leftval){
      xval=div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).x()+div("RegularLayer"+this.layerOrder+"_"+(stolayer-1)).width()+(-1*(this.menuSpace+2*this.menuWidth));
    }
    div("RegularLayer"+this.layerOrder+"_"+stolayer).move(xval,yval);
    div("RolledLayer"+this.layerOrder+"_"+stolayer).clip(0,0,0,0);
    div("RolledLayer"+this.layerOrder+"_"+stolayer).show()
    div("RegularLayer"+this.layerOrder+"_"+stolayer).clip(0,div("RegularLayer"+this.layerOrder+"_"+stolayer).width(),div("RegularLayer"+this.layerOrder+"_"+stolayer).height(),0);
    this.sync(stolayer);
    div("TransparentLayer"+this.layerOrder+"_"+stolayer).show()
    div("RegularLayer"+this.layerOrder+"_"+stolayer).show()
  }
}
function slideBack(layer){
  if(this.currentpos[layer]==1&&!this.sliding&&this.newStyle){
    this.sliding=true
    div("RegularLayer"+this.layerOrder+"_"+(layer-1)).wipeStop();
    div("RegularLayer"+this.layerOrder+"_"+(layer-1)).wipe(0,div("RegularLayer"+this.layerOrder+"_"+(layer-1)).width(),this.texth+(this.borderWidth*2),0,10,10,'menuObj('+this.layerOrder+').sync('+(layer-1)+');')
    this.roll(layer-1,-2);
    this.roll(layer,-2);
    div("RolledLayer"+this.layerOrder+"_"+layer).hide();
    div("TransparentLayer"+this.layerOrder+"_"+layer).hide();
    if(this.branch){window.clearTimeout(this.branch);}
    div("RegularLayer"+this.layerOrder+"_"+layer).slide(div("RegularLayer"+this.layerOrder+"_0").x()+div("RegularLayer"+this.layerOrder+"_0").width()-div("RegularLayer"+this.layerOrder+"_"+layer).width()+(this.menuOffset*layer),div("RegularLayer"+this.layerOrder+"_"+layer).y(),this.menuWidth/10,10,menuList[this.layerOrder]+'.sync('+layer+');if(div("RegularLayer'+this.layerOrder+'_'+layer+'").shown()){div("RolledLayer'+this.layerOrder+'_'+layer+'").show();div("TransparentLayer'+this.layerOrder+'_'+layer+'").show();};'+menuList[this.layerOrder]+'.sliding=false;'+menuList[this.layerOrder]+'.currentpos['+layer+']=0;'+menuList[this.layerOrder]+'.templayer='+layer+';'+menuList[this.layerOrder]+'.cliped['+(layer-1)+']=1;'+menuList[this.layerOrder]+'.sliding=false;')
   if(layer>1){this.slideUp(layer-1)};
  }
  if(!this.newStyle){this.templayer=layer}
}
function slideUp(layer){
  if((this.texth*layer)+div("RegularLayer"+this.layerOrder+"_0").y()!=div("RegularLayer"+this.layerOrder+"_"+layer).y()){
    div("RolledLayer"+this.layerOrder+"_"+layer).hide();
    div("TransparentLayer"+this.layerOrder+"_"+layer).hide();
    div("RegularLayer"+this.layerOrder+"_"+layer).slide(div("RegularLayer"+this.layerOrder+"_0").x()+div("RegularLayer"+this.layerOrder+"_0").width()-div("RegularLayer"+this.layerOrder+"_"+layer).width()+(this.menuOffset*layer),(this.texth*layer)+div("RegularLayer"+this.layerOrder+"_0").y(),this.texth/2,10,menuList[this.layerOrder]+'.currentpos['+layer+']=0;'+menuList[this.layerOrder]+'.sync('+layer+');if(div("RegularLayer'+this.layerOrder+'_'+layer+'").shown()){div("RolledLayer'+this.layerOrder+'_'+layer+'").show();div("TransparentLayer'+this.layerOrder+'_'+layer+'").show();}')
  } else {
    this.currentpos[layer]=0;
  }
}
function titleopen(layer){
  if(this.currentpos[layer]==0&&this.cliped[layer-1]==1&&!this.sliding){
    this.nav=1;
    this.templayer=layer-1
    for(poscount=layer;poscount!=this.depth;poscount++){
      div("RegularLayer"+this.layerOrder+"_"+poscount).slideStop()
      div("RegularLayer"+this.layerOrder+"_"+poscount).hide()
      div("TransparentLayer"+this.layerOrder+"_"+poscount).hide()
      this.roll(poscount,-2);
    }
    div("RegularLayer"+this.layerOrder+"_"+(layer-1)).wipeStop();
    div("RegularLayer"+this.layerOrder+"_"+(layer-1)).wipe(0,div("RolledLayer"+this.layerOrder+"_"+(layer-1)).width(),div("RolledLayer"+this.layerOrder+"_"+(layer-1)).height(),0,10,10,'');
    div("TransparentLayer"+this.layerOrder+"_"+(layer-1)).clip(0,div("RolledLayer"+this.layerOrder+"_"+(layer-1)).width(),div("RolledLayer"+this.layerOrder+"_"+(layer-1)).height(),0);
    this.keeplayer2=""
    this.cliped[layer-1]=0
    this.currentpos[layer+1]=1;
  }
}
function closeMenu(){ //close up menu on mouse out
    if(this.menuHidden){
      div("RegularLayer"+this.layerOrder+"_0").hide();
      div("TransparentLayer"+this.layerOrder+"_0").hide();
      div("RolledLayer"+this.layerOrder+"_0").hide();
      this.titleopen(1);
    } else {
      if(!this.menuStayOpen){
        div("RegularLayer"+this.layerOrder+"_0").wipeStop();
        div("RegularLayer"+this.layerOrder+"_0").wipe(0,div("RegularLayer"+this.layerOrder+"_0").width(),this.texth+(this.borderWidth*2),0,10,10,'');
        this.sync(0)
        this.cliped[0]=1;
        this.currentpos[1]=0;
        this.oldwhichmen=""
        this.oldlength=0
        this.nav=false
      }
    }
}
function shower(){
  menuObj(oldmenu).closeMenu()
  oldmenu=this.layerOrder
  div("RegularLayer"+this.layerOrder+"_0").show();
  div("TransparentLayer"+this.layerOrder+"_0").show()
  div("RolledLayer"+this.layerOrder+"_0").show()
  this.titleopen(1);
  whichOrder=this.layerOrder
  window.clearTimeout(this.timer)
  this.timer=false
  this.roller=true

}
function OnOut(){ //tidy up opened menus on mouse out
  if(this.newStyle){
    div("RegularLayer"+this.layerOrder+"_"+(this.templayer+1)).hide()
    div("RolledLayer"+this.layerOrder+"_"+(this.templayer+1)).hide()
    div("TransparentLayer"+this.layerOrder+"_"+(this.templayer+1)).hide()
    this.roll(this.templayer,-2);
    this.oldwhichmen=""
    this.oldlength=0
    this.slideUp(this.templayer);
    if(this.templayer==0||this.menuHidden){
      this.closeMenu()
    }
  } else {
    this.currentpos[1]=0
    this.templayer=0
    this.oldwhichmen="";
    for(poscount=1;poscount!=menuObj(oldWhichOrder).depth;poscount++){
      div("RegularLayer"+oldWhichOrder+"_"+poscount).hide()
      div("TransparentLayer"+oldWhichOrder+"_"+poscount).hide()
    }
    this.keeplayer2=""
    this.closeMenu()
  }
}
function mouseMove(xcord,ycord){ //Handle mouse movement
  if(doneloading&&!menuObj(whichOrder).sliding){
    cmenu=menuObj(whichOrder)
    if(whichDiv!=-1){
      window.clearTimeout(cmenu.timer)
      cmenu.timer=false
      if(cmenu.oldlength==whichDiv&&cmenu.oldlength!=cmenu.keeplayer2){
         cmenu.keeplayer2=cmenu.oldlength
         cmenu.slideBack(cmenu.oldlength)
      }
      yval=ycord-div("TransparentLayer"+cmenu.layerOrder+"_"+whichDiv).y()
      selecter=Math.ceil((cmenu.entries[whichDiv]*yval)/div("RegularLayer"+cmenu.layerOrder+"_"+whichDiv).height())-2
      if((cmenu.oldroll!=selecter||cmenu.oldroll==-1)&&!cmenu.cliped[whichDiv]){
        cmenu.roll(whichDiv,selecter);
        cmenu.oldroll=selecter
        eval(cmenu.rollactions[whichDiv][selecter+(((whichDiv==0&&cmenu.menuMainHeader)||(whichDiv!=0&&cmenu.menuHeader))?1:2)]) //execute mouse over actions for links
      } else {
        if(selecter==-1&&(cmenu.oldroll!=selecter||cmenu.olddiv!=whichDiv)){
          cmenu.roll(whichDiv,selecter);
          eval(cmenu.rollactions[whichDiv][0]) //execute mouse over actions for previous menus
          cmenu.oldroll=-1
        }
      }
      cmenu.olddiv=whichDiv
    } else {
      if(cmenu.oldroll==-2&&cmenu.templayer!=-1&&whichOrder==oldWhichOrder&&!cmenu.roller){
        if(!cmenu.timer){
          cmenu.timer=window.setTimeout(menuList[cmenu.layerOrder]+'.OnOut()',601); //Delay closure of menus
        }
      }
      if(cmenu.oldroll!=-2){
        cmenu.roll(cmenu.olddiv,-2);
        cmenu.oldroll=-2
      }
    }
    if(whichOrder!=oldWhichOrder){ //Commands to execute when user switches menus
      window.clearTimeout(menuObj(oldWhichOrder).timer)
      menuObj(oldWhichOrder).timer=false
      window.clearTimeout(menuObj(oldWhichOrder).branch);
      for(poscount=1;poscount!=menuObj(oldWhichOrder).depth;poscount++){
        div("RegularLayer"+oldWhichOrder+"_"+poscount).hide()
        div("TransparentLayer"+oldWhichOrder+"_"+poscount).hide()
      }
      menuObj(oldWhichOrder).closeMenu();
      menuObj(oldWhichOrder).roll(0,-2)
      cmenu.oldroll=-2
      oldWhichOrder=whichOrder
    }

  }
}
function mouseUp(x,y){ //Handle mouse up action
  if(doneloading){
    if(whichDiv!=-1){eval(cmenu.clickactions[whichDiv][cmenu.oldroll+(((whichDiv==0&&cmenu.menuMainHeader)||(whichDiv!=0&&cmenu.menuHeader))?1:2)])}
    if(!cmenu.newStyle&&cmenu.nav&&whichDiv==-1){
      for(poscount=1;poscount!=cmenu.depth;poscount++){ //Close menu when cursor is off menu and user clicks
        div("RegularLayer"+whichOrder+"_"+poscount).hide()
        div("TransparentLayer"+whichOrder+"_"+poscount).hide()
      }
    }
  }
}

//-->
