var telematica = 	new ItemStyle(30, 0 , '', 0, 0 , '#93A8CB', '#93A8CB',  'mnInt', 'mnIntH', 'no-border', 'no-border', null, null, 'hand', 'default');
var IMenuItem = 	new ItemStyle(30, 0, '&gt;', -15, 0, '7#E6E3FB', '10#f20000', 'IntegMenuItem', 'IntegMenuItemOver', 'itemBorder', 'itemBorder', 80, 85, 'hand', 'default');
var IMenuItemG = 	new ItemStyle(30, 0, '&gt;', -15, 0, '7#d1fbd6', '10#00ad14', 'IntegMenuItem', 'IntegMenuItemOver', 'itemBorder', 'itemBorder', 80, 85, 'hand', 'default');

var IMenuItem_1 = 	new ItemStyle(150, 0, '',0, 0, 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_04.jpg', 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_on_04.jpg', 'mnInt', 'mnIntH', 'no-border', 'no-border', null, null, 'hand', 'default');
var IMenuItem_2 = 	new ItemStyle(150, 0, '',0, 0, 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_05.jpg', 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_on_05.jpg', 'mnInt', 'mnIntH', 'no-border', 'no-border', null, null, 'hand', 'default');
var IMenuItem_3 = 	new ItemStyle(150, 0, '',0, 0, 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_06.jpg', 'http://secure.telematica.gr/images/web/plxdevices/assets/template/plx_on_06.jpg', 'mnInt', 'mnIntH', 'no-border', 'no-border', null, null, 'hand', 'default');

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

startMenu('root', false, 150, 0, 30, telematica);
addItem(' ', 'mProd', 'sm:', IMenuItem_1);
addItem(' ', 'mOrder', 'sm:', IMenuItem_2);
addItem(' ', 'mExtra', 'sm:', IMenuItem_3);

startMenu('mProd', true, 20, 30, 150, IMenuItem);
addItem('iMFD Display Modules', 'mDisp', 'sm:', IMenuItem);
addItem('iMFD Sensor Modules', 'mSen', 'sm:', IMenuItem);
addItem('iMFD DataLogger', 'http://www.plxdevices.es/product/logger/r800.php', '');
addItem('WideBand Air-Fuel', 'mWide', 'sm:', IMenuItem);
addItem('iMFD Accessories', 'mAcc', 'sm:', IMenuItem); 
addItem('Economy driving', 'mEco', 'sm:', IMenuItemG); 

startMenu('mDisp', true, 150, 0, 220, IMenuItem);
addItem('DM-200 OBDII/CAN 60mm OLED Gauge', 'http://www.plxdevices.es/product/display/dm200OBD.php', '');
addItem('DM-100 OBDII/CAN 52mm OLED Gauge', 'http://www.plxdevices.es/product/display/dm100OBD.php', '');
addItem('DM-200 60mm OLED Gauge', 'http://www.plxdevices.es/product/display/dm200.php', '');
addItem('DM-100 52mm OLED Gauge', 'http://www.plxdevices.es/product/display/dm100.php', '');
addItem('DM-5 Standard 52mm LED Gauge', 'mDM5', 'sm:', IMenuItem);

startMenu('mDM5', true, 220, 0, 150, IMenuItem);
addItem('DM-5 AFR', 'http://www.plxdevices.es/product/display/dm5_AFR.php', '');
addItem('DM-5 EGT', 'http://www.plxdevices.es/product/display/dm5_EGT.php', '');
addItem('DM-5 Oil Temp', 'http://www.plxdevices.es/product/display/dm5_OIL.php', '');
addItem('DM-5 Water Temp', 'http://www.plxdevices.es/product/display/dm5_Water.php', '');
addItem('DM-5 Boost', 'http://www.plxdevices.es/product/display/dm5_Boost.php', '');
addItem('DM-5 AIT', 'http://www.plxdevices.es/product/display/dm5_AIT.php', '');

startMenu('mSen', true, 150, 0, 150, IMenuItem);
addItem('SM-AFR (Wideband)', 'http://www.plxdevices.es/product/sensor/sm_AFR.php', '');
addItem('SM-EGT (Exhaust Gas)', 'http://www.plxdevices.es/product/sensor/sm_EGT.php', '');
addItem('SM-FluidTemp (Water, oil)', 'http://www.plxdevices.es/product/sensor/sm_FL.php', '');
addItem('SM-Vac/Boost', 'http://www.plxdevices.es/product/sensor/sm_VAC.php', '');
addItem('SM-AIT (AirIntake)', 'http://www.plxdevices.es/product/sensor/sm_AIT.php', '');
addItem('SM-Oil Pressure', 'http://www.plxdevices.es/product/sensor/sm_OIL.php', '');
 
startMenu('mWide', true, 150, 0, 220, IMenuItem);
addItem('M300 Tuner Edition', 'http://www.plxdevices.es/product/combo/M300.php', '');
addItem('SM-AFR + DM-200 60mm Combo', 'http://www.plxdevices.es/product/combo/cm_AFR_dm200.php', '');
addItem('SM-AFR + DM-100 52mm Combo', 'http://www.plxdevices.es/product/combo/cm_AFR_dm100.php', '');
addItem('SM-AFR + DM-5 52mm Combo', 'http://www.plxdevices.es/product/combo/cm_AFR_dm5.php', '');
addItem('SM-AFR (Wideband O2)', 'http://www.plxdevices.es/product/sensor/sm_AFR.php', '');
addItem('Bosch Wideband', 'http://www.plxdevices.es/product/combo/BoschAFR.php', '');
addItem('Sensor Harness', 'http://www.plxdevices.es/product/combo/harnessAFR.php', '');

startMenu('mAcc', true, 150, 0, 220, IMenuItem);
addItem('SM-AFR (Wideband O2)', 'http://www.plxdevices.es/product/sensor/sm_AFR.php', '');
addItem('Bosch Wideband', 'http://www.plxdevices.es/product/combo/BoschAFR.php', '');
addItem('Sensor Harness', 'http://www.plxdevices.es/product/combo/harnessAFR.php', '');
addItem('O2 Sensor Bung', 'http://www.plxdevices.es/product/peripheral/O2sensorbung.php', '');
addItem('O2 Sensor Plug', 'http://www.plxdevices.es/product/peripheral/O2sensorplug.php', '');
addItem('O2 Sensor Bung &amp; Plug', 'http://www.plxdevices.es/product/peripheral/O2sensorbungplug.php', '');
addItem('52mm &amp; 60mm Gauge Holder', 'http://www.plxdevices.es/product/peripheral/holder.php', '');
addItem('iMFD SM-USB adapter', 'http://www.plxdevices.es/product/peripheral/adapter.php', '');
addItem('Gauge Visor', 'http://www.plxdevices.es/product/peripheral/visor.php', '');

startMenu('mEco', true, 150, 0, 220, IMenuItemG);
addItem('Kiwi (Trip Computer)', 'http://www.plxdevices.es/product/eco/kiwi.php', '');
addItem('Kiwi MPG', 'http://www.plxdevices.es/product/eco/kiwimpg.php', '');
addItem('Kiwi WiFi (for iPhone)', 'http://www.plxdevices.es/product/eco/kiwiwifi.php', '');
addItem('Kiwi Webpage', 'http://www.plxkiwi.net', '');

startMenu('mOrder', true, 10, 30, 150, IMenuItem);
addItem('View Shopping cart', 'http://www.plxdevices.es/shop/ShoppingCart.php', '');
addItem('Locate a Reseller', 'http://www.plxdevices.es/contact/reseller.php', '');
addItem('PLX Worldwide', 'mCountry', 'sm:', IMenuItem);
addItem('Reseller Login', 'https://secure.telematica.gr', '');

startMenu('mCountry', true, 150, 0, 100, IMenuItem);
addItem('U.S.A.', 'http://www.plxdevices.com', '');
addItem('Europe', 'http://www.plxdevices.net', '');
addItem('Greece', 'http://www.plxdevices.gr', '');
addItem('U.K.', 'http://www.plxdevices.es', '');
addItem('Germany', 'http://www.plxdevices.de', '');
addItem('Italy', 'http://www.plxdevices.it', '');
addItem('France', 'http://www.plxdevices.fr', '');
addItem('Spain', 'http://www.plxdevices.es', '');


startMenu('mExtra', true, 30, 30, 150, IMenuItem);
addItem('Product Extras', 'mOther', 'sm:', IMenuItem);
addItem('PLX on YouTube', 'http://www.youtube.com/PLXDevices', '');
addItem('Request form', 'http://www.plxdevices.es/contact/request.php', '');
addItem('About us', 'mCompany', 'sm:', IMenuItem);


startMenu('mOther', true, 150, 0, 150, IMenuItem);
addItem('DM-200 Extra Gauges', 'http://www.plxdevices.es/product/display/custom_gauges.php', '');
addItem('Gauge Software', 'http://www.plxdevices.es/product/display/utility.php', '');
addItem('Logger Software', 'http://www.plxdevices.es/product/other/Loggersoftware.php', '');
addItem('Firmware updates', 'http://www.plxdevices.es/product/other/firmware.php', '');
addItem('OLED Technology', 'http://www.plxdevices.es/product/display/hdd100.php', '');
addItem('ECUs', 'http://www.plxdevices.es/product/other/ECU.php', '');

startMenu('mCompany', true, 150, 0, 150, IMenuItem);
addItem('Reseller', 'http://www.plxdevices.es/contact/reseller.php', '');
addItem('Contact us', 'http://www.plxdevices.es/contact/contact.php', '');


}

//addMenuBorder(pMenu, window.subBlank, null, '#666666', 1, '#CCCCDD', 2);
addDropShadow(pMenu, window.IMenuItem, [40,"#333333",6,6,-4,-4], [40,"#666666",4,4,0,0]);

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}}
 if (e && this.MS && navigator.platform.indexOf('Mac')>-1 && e.tagName=='A')
 {
  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 = 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);
 }
};


function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)
{
 for (var mN in mObj.menu)
 {
  var mR=mObj.menu[mN], dS='<div style="position:absolute; background:';
  if (mR[0].itemSty != iS) continue;
  for (var mI=1; mI<mR.length; mI++)
  {
   mR[mI].iX += bordW+backW;
   mR[mI].iY += bordW+backW;
  }
  mW = mR[0].menuW += 2*(bordW+backW);
  mH = mR[0].menuH += 2*(bordW+backW);
  if (isNS4) mR[0].extraHTML += '<layer bgcolor="'+bordCol+'" left="0" top="0" width="'+mW+
   '" height="'+mH+'" z-index="980"><layer bgcolor="'+backCol+'" left="'+bordW+'" top="'+
   bordW+'" width="'+(mW-2*bordW)+'" height="'+(mH-2*bordW)+'" z-index="990"></layer></layer>';
  else mR[0].extraHTML += dS+bordCol+'; left:0px; top:0px; width:'+mW+'px; height:'+mH+
   'px; z-index:980; '+
   (alpha!=null?'filter:alpha(opacity='+alpha+'); -moz-opacity:'+alpha+'%; opacity:'+(alpha/100):'')+
   '">'+dS+backCol+'; left:'+bordW+'px; top:'+bordW+'px; width:'+(mW-2*bordW)+'px; height:'+
   (mH-2*bordW)+'px; z-index:990"></div></div>';
 }
};

function addDropShadow(mObj, iS)
{
 for (var mN in mObj.menu)
 {
  var a=arguments, mD=mObj.menu[mN][0], addW=addH=0;
  if (mD.itemSty != iS) continue;
  for (var shad=2; shad<a.length; shad++)
  {
   var s = a[shad];
   var alpha = (s[0]!=null && navigator.userAgent.indexOf('AppleWebKit') == -1);
   if (isNS4) mD.extraHTML += '<layer bgcolor="'+s[1]+'" left="'+s[2]+'" top="'+s[3]+'" width="'+
    (mD.menuW+s[4])+'" height="'+(mD.menuH+s[5])+'" z-index="'+(arguments.length-shad)+'"></layer>';
   else mD.extraHTML += '<div style="position:absolute; background:'+s[1]+'; left:'+s[2]+
    'px; top:'+s[3]+'px; width:'+(mD.menuW+s[4])+'px; height:'+(mD.menuH+s[5])+'px; -z-index:'+
    (a.length-shad)+'; '+
    (alpha?'filter:alpha(opacity='+s[0]+'); -moz-opacity:'+s[0]+'%; opacity:'+(s[0]/100):'')+
    '"></div>';
   addW=Math.max(addW, s[2]+s[4]);
   addH=Math.max(addH, s[3]+s[5]);
  }
  mD.menuW+=addW; mD.menuH+=addH;
 }
};