var hBar = new ItemStyle(35, 0, '', 0, 0, '#BECFEB', '#BECFEB', 'highText', 'highText', '', '',
 null, null, 'hand', 'default');


var imgM = new ItemStyle(22, 1, '', 0, 5, '/menu/images/sub_bg.gif', '/menu/images/sub_bg_over.gif', 'lowText', 'highText', 'itemBorder', 'itemBorderBlank', null, null, 'hand', 'default');

// preload
if (document.images) {
image0 = new Image();
image0.src = "/menu/images/top_loading.jpg";

image1 = new Image();
image1.src = "/menu/images/top_tik_over.gif";

image2 = new Image();
image2.src = "/menu/images/top_advert_over.gif";

image3 = new Image();
image3.src = "/menu/images/top_host_over.gif";

image4 = new Image();
image4.src = "/menu/images/top_build_over.gif";

image5 = new Image();
image5.src = "/menu/images/top_consult_over.gif";

image6 = new Image();
image6.src = "/menu/images/sub_bg_over.gif";
}


var pMenu = new PopupMenu('pMenu');
with (pMenu)
{
// main menu :

startMenu('root', false, 'window.page.elmPos("menupos").x', 'window.page.elmPos("menupos").y', 35, hBar, '', false);
addItem('SWAP:<img src="/menu/images/top_tik.gif" alt="" border="0" />^<img src="/menu/images/top_tik_over.gif" alt="" border="0" />', 'mTik', 'sm:', null, 115).onclick='window.location.href="/tik/index.phtml"';
addItem('SWAP:<img src="/menu/images/top_advert.gif" alt="" border="0" />^<img src="/menu/images/top_advert_over.gif" alt="" border="0" />', 'mAdvert', 'sm:', null, 108).onclick='window.location.href="/advert/index.phtml"';
addItem('SWAP:<img src="/menu/images/top_host.gif" alt="" border="0" />^<img src="/menu/images/top_host_over.gif" alt="" border="0" />', 'mHost', 'sm:', null, 117).onclick='window.location.href="/host/index.phtml"';
addItem('SWAP:<img src="/menu/images/top_build.gif" alt="" border="0" />^<img src="/menu/images/top_build_over.gif" alt="" border="0" />', 'mBuild', 'sm:', null, 108).onclick='window.location.href="/build/index.phtml"';
addItem('SWAP:<img src="/menu/images/top_consult.gif" alt="" border="0" />^<img src="/menu/images/top_consult_over.gif" alt="" border="0" />', '/consult/index.phtml', '', null, 126);

// sub menus :

startMenu('mTik', true, -10, 38, 120, imgM, '', false);
addItem('<div align="right"><img src="/menu/images/sub1.gif" alt="" border="0" /></div>', '/tik/index.phtml', '');

startMenu('mAdvert', true, -45, 38, 145, imgM, '', false);
addItem('<div align="right"><img src="/menu/images/sub1a.gif" alt="" border="0" /></div>', '/advert/index.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_advert_1.gif" alt="" border="0" /></div>', '/advert/advert_2.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_advert_2.gif" alt="" border="0" /></div>', '/advert/advert_3.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_advert_3.gif" alt="" border="0" /></div>', '/advert/advert_4.phtml', '');

startMenu('mHost', true, -10, 38, 120, imgM, '', false);
addItem('<div align="right"><img src="/menu/images/sub1a.gif" alt="" border="0" /></div>', '/host/index.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_1.gif" alt="" border="0" /></div>', '/host/host_2.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_2.gif" alt="" border="0" /></div>', '/host/host_3.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_3.gif" alt="" border="0" /></div>', '/host/host_4.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_4.gif" alt="" border="0" /></div>', '/host/host_5.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_5.gif" alt="" border="0" /></div>', '/host/host_6.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_6.gif" alt="" border="0" /></div>', '/host/host_7.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_host_7.gif" alt="" border="0" /></div>', '/host/host_8.phtml', '');

startMenu('mBuild', true, -20, 38, 120, imgM, '', false);
addItem('<div align="right"><img src="/menu/images/sub1a.gif" alt="" border="0" /></div>', '/build/index.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_build_1.gif" alt="" border="0" /></div>', '/build/build_2.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_build_2.gif" alt="" border="0" /></div>', '/build/build_3.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_build_3.gif" alt="" border="0" /></div>', '/build/build_4.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_build_4.gif" alt="" border="0" /></div>', '/build/build_5.phtml', '');
addItem('<div align="right"><img src="/menu/images/sub_build_5.gif" alt="" border="0" /></div>', '/build/build_6.phtml', '');

}


if ((navigator.userAgent.indexOf('rv:0.')==-1) &&
    !(isOp&&!document.documentElement) && !(isIE4&&!window.external))
{
 pMenu.showMenu = new Function('mN','menuAnim(this, mN, 10)');
 pMenu.hideMenu = new Function('mN','menuAnim(this, mN, -15)');

}




page.elmPos=function(e,p)
{
 var x=0,y=0,w=p?p:this.win;
 e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;
 if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}
 else if (e && e.focus && e.href && this.MS && /Mac/.test(navigator.platform))
 {
  e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +
   'self.tmpY=clientY-offsetY}');
  e.focus();x=tmpX;y=tmpY;e.blur()
 }
 else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}
 return{x:x,y:y};
};





function menuAnim(menuObj, menuName, dir)
{
 // The array index of the named menu (e.g. 'mFile') in the menu object (e.g. 'pMenu').
 var mD = menuObj.menu[menuName][0];
 // Add timer and counter variables to the menu data structure, we'll need them.
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;

 with (mD)
 {
  // Stop any existing animation.
  clearTimeout(timer);

  if (!lyr || !lyr.ref) return;
  if (!visNow && dir>0) dir = 0-dir;
  // Show the menu if that's what we're doing.
  if (dir>0) lyr.vis('visible');
  // Also raise showing layers above hiding ones.
  lyr.sty.zIndex = dir>0 ? mD.zIndex + 1 : 1001;

  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );
  counter += dir;
  if (counter>100) { counter = 100; lyr.sty.zIndex = mD.zIndex }
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout('menuAnim('+menuObj.myName+',"'+menuName+'",'+dir+')', 40);
 }
};

