// Copyright 2003, DuaneWeb. All rights reserved.
var Menus=new Array();
var mCnt=0;
if (document.all){
 var mtop=120;
 var mleft=10;
 var speed=20;
 }
else {
 var mtop=115;
 var mleft=8;
 var speed=15;
 }
var ExpandObj;
var ExpandIx;
function moverm(obj, ix)
{
 if (document.all)
  obj.style.cursor="Hand";
 else obj.style.cursor="Pointer";
 obj.style.borderRight="1px solid blue";
 obj.style.borderLeft="1px solid blue";
 obj.style.paddingRight="4px";
 obj.style.paddingLeft="4px";
 obj.style.backgroundColor="#DDDDDD";
 ExpandObj=obj;
 ExpandIx=ix;
 ExpTimer=setTimeout('expand()', 300);
}
function mover(obj)
{
 timeroff();
 if (document.all)
  obj.style.cursor="Hand";
 else obj.style.cursor="Pointer";
 obj.style.borderRight="1px solid blue";
 obj.style.borderLeft="1px solid blue";
 obj.style.paddingRight="4px";
 obj.style.paddingLeft="4px";
 obj.style.backgroundColor="#DDDDDD";
 var cid=new String(obj.id);
 var keys=cid.split('|');
 var s='';
 for (var i=0;i<mCnt&&s=='';i++){
  tmenu=Menus[i];
  if (tmenu.caption==keys[0]){
   if (keys.length>1){
    for (var j=0;j<tmenu.icnt;j++){
     if (tmenu.items[j].caption==keys[1]){
      s=tmenu.items[j].hint;
      break;
      }
     }
    }
   else s=tmenu.hint;
   }
  }
 getRef('HDiv').innerHTML='<table border="0" cellspacing="0" cellpadding="0"><tr><td style="width: 30px; text-align: left"><img src="images/menutag.gif" /></td><td class="m1" style="text-align: left">'+s+'</d></tr></table>';
}
function mout(obj)
{
 obj.style.cursor="Default";
 obj.style.borderRight="none";
 obj.style.borderLeft="none";
 obj.style.paddingRight="5px";
 obj.style.paddingLeft="5px";
 obj.style.backgroundColor="transparent";
 timeron();
 clearTimeout(ExpTimer);
}
var ExpTimer=0;
var ETimer=0;
var ExOffset=0;
function expand()
{
 s='<table border="0" cellspacing="0" cellpadding="0"><tr><td style="width: 30px; text-align: left"><img src="images/menutag.gif" /></td>';
 var tmenu=Menus[ExpandIx];
 for (var i=0;i<tmenu.icnt;i++)
   s+='<td id="'+tmenu.caption+'|'+tmenu.items[i].caption+'" class="m1" onmouseover="mover(this)" onmouseout="mout(this)" onclick="loadpage('+"'"+tmenu.items[i].url+"'"+')">'+tmenu.items[i].caption+'</td>';
 s+='</tr></table>';
 getRef('SDiv').innerHTML=s;
 mover(ExpandObj);
 clearTimeout(ETimer);
 ExOffset=0;
  getStyle('HDiv').top=mtop+'px';
 expand2();
}
function expand2()
{
 ExOffset+=2;
 if (ExOffset<26){
  getStyle('SDiv').top=mtop+ExOffset+'px';
  ETimer=setTimeout('expand2()', speed);
  }
 else if (ExOffset<50){
  getStyle('HDiv').top=mtop+ExOffset+'px';
  ETimer=setTimeout('expand2()', speed);
  }
}
function collapse()
{
 timeroff();
 clearTimeout(ETimer);
 collapse2(); 
}
function collapse2()
{
 ExOffset-=2;
 if (ExOffset>=26){
  getStyle('HDiv').top=mtop+ExOffset+'px';
  ETimer=setTimeout('collapse2()', speed);
  }
 else if (ExOffset>=0){
  getStyle('HDiv').top=mtop+ExOffset+'px';
  getStyle('SDiv').top=mtop+ExOffset+'px';
  ETimer=setTimeout('collapse2()', speed);
  }
}
var MenuTimer=0;
function timeron()
{
 if ( MenuTimer )
  timeroff();
 MenuTimer=setTimeout('collapse()', 1000);
}
function timeroff()
{
 clearTimeout(MenuTimer);
 MenuTimer=0;
}
function MenuItem(iid, cap, url, hint)
{
 this.id=iid;
 this.caption=cap;
 this.url=url;
 this.hint=hint;
}
function AddMenu(iid, cap, url, hint)
{
 this.items[this.icnt++]=new MenuItem(iid, cap, url, hint);
}
function Menu(cap, hint)
{
 this.id="MH"+cap;
 this.caption=cap;
 this.hint=hint;
 this.items=new Array();
 this.icnt=0;
 this.AddItem=AddMenu;
}
function moverd()
{
   timeroff();
}
function writemenus()
{
 var i;
 var j;
 var tmenu;
 s='<div id="HDiv" style="text-align: left; position: absolute; height: 20px; width: 100%; top: '+mtop+'px; left: '+mleft+'px; background-image: url(images/buttonmain.jpg);" ommouseover="timeroff()" onmouseout="timeron()"></div>';
 s+='<div id="SDiv" style="text-align: left; position: absolute; height: 20px; width: 100%; top: '+mtop+'px; left: '+mleft+'px; background-image: url(images/buttonmain.jpg);" ommouseover="moverd()" onmouseout="timeron()"></div>';
 s+='<div style="text-align: left; position: absolute; height: 20px; width: 100%; top: '+mtop+'px; left: '+mleft+'px; background-image: url(images/buttonmain.jpg);" ommouseover="timeroff()" onmouseout="timeron()">';
 s+='<table border="0" cellspacing="0" cellpadding="0"><tr><td style="width: 30px; text-align: left"><img src="images/menutag.gif" /></td>';
 for (i=0;i<mCnt;i++)
  s+='<td id="'+Menus[i].caption+'" class="m1" onmouseover="moverm(this, '+i+')" onmouseout="mout(this)">'+Menus[i].caption+'</td>';
 s+='</tr></table></div>';
document.write(s);
}
function loadpage(ref)
{
 window.location.assign(ref);
}
function cover(obj)
{
 if (document.all)
  obj.style.cursor="Hand";
 else obj.style.cursor="Pointer";
 obj.style.color="white";
}
function cout(obj)
{
 obj.style.cursor="Default";
 obj.style.color="#99CCFF";
}
function cload(ref)
{
 window.location.assign(ref);
}
function custom_init()
{
}