//  var samplevar = new ItemStyle(height/width, gap, 'html_character_to_next_menu',
//                            numberofpixelsfromrightsidehtmlcharacter, padding, 'linkfadeintime#COLOR', 'activefadeintime#COLOR',
//                             'StyleSheetRest', 'StyleSheetActive', 'BorderStyleRest', 'BorderStyleActive',
//                              TranslucencyRest, TranslucencyActive, 'CurserTypeRest', 'CurserTypeActive');

var hBar = new ItemStyle(22, 11, '+', -15, 3, '4#000000', '10#F6D900', 'lowText', 'highText', 'itemBorder', 'itemBorder', 100, 100, 'crosshair', 'default');
var subM = new ItemStyle(20, 4, '+', -15, 2, '4#000000', '10#F6D900', 'lowText', 'highText', 'itemBorder', 'itemBorder', 100, 100, 'crosshair', 'default');

var pMenu = new PopupMenu('pMenu'); with (pMenu) {

startMenu('root', true, 50, 160, 100, hBar);
addItem('HOME', 'http://ictechnology.com/home', '');
addItem('HISTORY', 'http://ictechnology.com/history', '');
addItem('PRODUCTS', 'mProducts', 'sm:');
addItem('CONTACT', 'mContactus', 'sm:');

   startMenu('mProducts', true, 80, 7, 97, subM);
   addItem('Handguns', 'mHandguns', 'sm:');
   addItem('Options', 'mOptions', 'sm:');
   
      startMenu('mHandguns', true, 80, 7, 100, subM);
      addItem('M11 Standard', 'http://ictechnology.com/m11standard', '');
      addItem('M11 Recon', 'http://ictechnology.com/m11recon', '');
      addItem('M11 Merc', 'http://ictechnology.com/m11merc', '');
      addItem('X1 Spy', 'http://ictechnology.com/x1spy', '');
      
      startMenu('mOptions', true, 80, 7, 117, subM);
      addItem('Custom Finishes', 'http://ictechnology.com/finishes', '');
      addItem('Night Sights', 'http://ictechnology.com/sights', '');
      addItem('Porting', 'http://ictechnology.com/porting', '');
      addItem('Stippling', 'http://ictechnology.com/stippling', '');
   
   startMenu('mContactus', true, 80, 7, 97, subM);
   addItem('Contact Form', 'http://ictechnology.com/contact', '');
   addItem('Ordering Info', 'http://ictechnology.com/ordering', '');
   addItem('Email Us', 'mailto:icinfo@ictechnology.com', '');
   

   
//showDelay = 2;
menu.root[0].oncreate = function() { pMenu.doVis('root', true) }
}

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) {
 var mD = menuObj.menu[menuName][0];
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;
with (mD) {
  clearTimeout(timer);
  if (!lyr || !lyr.ref) return;
  if (!visNow && dir>0) dir = 0-dir;
  if (dir>0) lyr.vis('visible');
  lyr.sty.zIndex = 1001 + dir;
  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;
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout('menuAnim('+menuObj.myName+',"'+menuName+'",'+dir+')', 40);
 }
};
