<!-- CASCADING POPUP MENUS v2.31 by Angus Turnbull http://gusnz.cjb.net -->
<!-- Begin

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);


function getRef(id)
{
 return (isDOM ? document.getElementById(id) :
  (isIE4 ? document.all[id] : document.layers[id]));
}

function getSty(id)
{
 return (isNS4 ? getRef(id) : getRef(id).style);
} 


var popTimer = 0;

var litNow = new Array();

function popOver(menuNum, itemNum)
{
 clearTimeout(popTimer);

 hideAllBut(menuNum);

 litNow = getTree(menuNum, itemNum);
 changeCol(true);

 targetNum = menu[menuNum][itemNum].target;
 if (targetNum > 0)
 {

  thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
  thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);


  with (menu[targetNum][0].ref)
  {
   left = thisX + menu[targetNum][0].x;
   top = thisY + menu[targetNum][0].y;
   visibility = 'visible';
  }
 }
}

function popOut(menuNum, itemNum)
{

 if ((menuNum == 0) && !menu[menuNum][itemNum].target) hideAllBut(0);
 else popTimer = setTimeout('hideAllBut(0)', 500);
}

function popClick(menuNum, itemNum)
{
 with (menu[menuNum][itemNum])
 {
  switch (type)
  {

   case 'js:': { eval(href); break }

   case '': type = 'window';
   default: if (href) eval(type + '.location.href = "' + href + '"');
  }
 }

 hideAllBut(0);
}


function getTree(menuNum, itemNum)
{

 itemArray = new Array(menu.length);

 while(1)
 {
  itemArray[menuNum] = itemNum;

  if (menuNum == 0) break;
  itemNum = menu[menuNum][0].parentItem;
  menuNum = menu[menuNum][0].parentMenu;
 }
 return itemArray;
}

function changeCol(isOver)
{

 for (count = 0; count < litNow.length; count++)
 {

  if (litNow[count])
  {

   with (menu[count][0]) with (menu[count][litNow[count]])
   {
    newCol = isOver ? overCol : backCol;

    if (isNS4) ref.bgColor = newCol;
    else ref.backgroundColor = newCol;
   }
  }
 }
}

function hideAllBut(menuNum)
{

 var keepMenus = getTree(menuNum, 1);

 for (count = 0; count < menu.length; count++)
  if (!keepMenus[count] && menu[count]) menu[count][0].ref.visibility = 'hidden';

 changeCol(false);
}


function addProps(obj, data, names, addNull)
{
 for (i = 0; i < names.length; i++)
  if(i < data.length || addNull) obj[names[i]] = data[i];
}

function Menu()
{
 var names = ['isVert', 'popInd', 'x','y', 'width', 'pad', 'overCol', 'backCol',
  'borderClass', 'textClass',      'parentMenu', 'parentItem', 'ref'];
 addProps(this, arguments, names, true);
}

function Item()
{
 var names = ['text', 'href', 'type', 'length', 'spacing', 'target',    'ref'];
 addProps(this, arguments, names, true);
}


function createMenus()
{
 if (!isDyn) return;

 for (currMenu = 0; currMenu < menu.length; currMenu++)
 if (menu[currMenu]) with (menu[currMenu][0])
 {

  var str = '', itemX = 0, itemY = 0;


  if (isNS4) pad++;

  for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem])
  {
   var itemID = 'menu' + currMenu + 'item' + currItem;

   var shrink = (borderClass && isDOM && !document.all ? 2 : 0)
   var w = (isVert ? width : length) - shrink;
   var h = (isVert ? length : width) - shrink;

   if (isDOM || isIE4)
   {
    str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX +
     '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
    if (backCol) str += 'background: ' + backCol;
    str += '" ';
   }
   if (isNS4)
   {
    str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + 
     w + '" height="' + h + '" visibility="inherit" ';
    if (backCol) str += 'bgcolor="' + backCol + '" ';
   }
   if (borderClass) str += 'class="' + borderClass + '" ';
   
   str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' +
     currMenu + ',' + currItem + ')" onClick="popClick(' + currMenu + ',' + currItem + ')">';

   if (target > 0)
   {

    menu[target][0].parentMenu = currMenu;
    menu[target][0].parentItem = currItem;

    if (popInd)
    {
     if (isNS4) str += '<layer class="' + textClass + '" left="'+ (w - 15) + '" top="' +
      pad + '">' + popInd + '</layer>';
     else str += '<div class="' + textClass + '" style="position: absolute; left: ' + (w - 15) +
      '; top: ' + pad + '">' + popInd + '</div>';
    }
   }

   if (isNS4) str += (borderClass ? '<spacer type="block" width="' + (w - 8) + '" height="' +
    (h - 8) + '">' : '') +
    '<layer left="' + pad + '" top="' + pad + '" width="' + (w - (2 * pad)) + '" height="' +
    (h - (2 * pad)) + '"><a class="' + textClass + '" href="#" ' +
    'onClick="popClick(' + currMenu + ',' + currItem + '); return false" ' +
    'onMouseOver="status=\'\'; return true;">' + text + '</a></layer>';

   else str += '<div class="' + textClass + '" style="position: absolute; left: ' + pad +
    '; top: ' + pad + '; width: ' + (w - (2 * pad)) + '; height: ' + (h - (2 * pad)) +
    '">' + text + '</div>';

   str += (isNS4 ? '</layer>' : '</div>');

   if (isVert) itemY += length + spacing - 1;
   else itemX += length + spacing + 1;

  }

  if (document.all)
  {

   document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' +
    'style="position: absolute; width: 3; height: 3; visibility: hidden; z-index: 1000">' +
     str + '</div>');
   ref = getSty('menu' + currMenu + 'div');
  }
  else if (isDOM)
  {
   var newDiv = document.createElement('div');
   document.body.appendChild(newDiv);
   newDiv.innerHTML = str;
   ref = newDiv.style;
    
   ref.position = 'absolute';
   ref.visibility = 'hidden';
  }

  else if (isNS4)
  {
   ref = new Layer(0);
   ref.document.write(str);
   ref.document.close();
  }

  ref.left = x;
  ref.top = y;

  if (!isNS4) ref.cursor = (document.all ? 'hand' : 'pointer');

  if (!document.all) ref.zIndex = 1000;

  for (currItem = 1; currItem < menu[currMenu].length; currItem++)
  {
   itemName = 'menu' + currMenu + 'item' + currItem;
   if (isDOM || isIE4) menu[currMenu][currItem].ref = getSty(itemName);
   if (isNS4)
   {
    menu[currMenu][currItem].ref = ref.document[itemName];

    with (ref.document[itemName])
    {
     document.captureEvents(Event.CLICK);
     document.onclick = new Function('popClick(' + currMenu + ', ' + currItem + ')');
    }
   }
  }

 }


 menu[0][0].ref.visibility = 'visible';
}


var menu = new Array();

var defOver = '#FFCC00', defBack = '#F5F5F5';

var defLen = 20;

menu[0] = new Array();
menu[0][0] = new Menu(false, '', 4, 98, 18, 0, '#FFCC00', '#DCE4ED', '', 'itemText');
menu[0][1] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m1.gif" width="149" height="18">', 'http://www.hobbylink.com.br/', '', 149, 0, 1);
menu[0][2] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m2.gif" width="173" height="18">', '', '', 173, 0, 2);
menu[0][3] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m3.gif" width="154" height="18">', 'http://www.hobbylink.com.br/eventos/', '', 154, 0, 3);
menu[0][4] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m4.gif" width="101" height="18">', '', '', 101, 0, 4);
menu[0][5] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m5.gif" width="99" height="18">', 'http://www.hobbylink.com.br/classimodel/', '', 99, 0, 5);
menu[0][6] = new Item('<img src="http://www.hobbylink.com.br/layout/new/m6.gif" width="89" height="18">', 'http://www.hobbylink.com.br/fale_conosco/index.php', '', 89, 0, 6);

// REVISTA
menu[1] = new Array();
menu[1][0] = new Menu(true, '>', 0, 16, 150, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[1][1] = new Item('Complete sua coleção <br>de Hobbylink/MeN', 'http://www.hobbylink.com.br/hobbylink/', '', 33, 0, 0);

// EXCLUSIVO ASSINANTES
menu[2] = new Array();
menu[2][0] = new Menu(true, '>', 0, 16, 174, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[2][1] = new Item('Dicionário do Modelismo', 'http://www.hobbylink.com.br/assinant/dicionario/', '', defLen, 0, 0);
menu[2][2] = new Item('Dúvidas mais comuns', 'http://www.hobbylink.com.br/assinant/duvidas/duvidas_comuns.php', '', defLen, 0, 0);
menu[2][3] = new Item('Dicas para iniciantes', 'http://www.hobbylink.com.br/assinant/duvidas/primeiras_dicas.php', '', defLen, 0, 11);

// EVENTOS
menu[3] = new Array();
menu[3][0] = new Menu(true, '>', 0, 16, 155, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[3][1] = new Item('Consulte o calendário', 'http://www.hobbylink.com.br/eventos/', '', defLen, 0, 0);
menu[3][2] = new Item('Cadastre um <br />evento no calendário', 'http://www.hobbylink.com.br/eventos/cadastrar.php', '', 33, 0, 0);

// ONDE PRATICAR
menu[4] = new Array();
menu[4][0] = new Menu(true, '>', 0, 16, 102, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[4][1] = new Item('Aeromodelismo', 'http://www.hobbylink.com.br/pistas/index.php?tipo=AEROMODELISMO', '', defLen, 0, 0);
menu[4][2] = new Item('Automodelismo', 'http://www.hobbylink.com.br/pistas/index.php?tipo=AUTOMODELISMO', '', defLen, 0, 0);
menu[4][3] = new Item('Nautimodelismo', 'http://www.hobbylink.com.br/pistas/index.php?tipo=NAUTIMODELISMO', '', defLen, 0, 0);
menu[4][4] = new Item('Cadastre sua <br />pista ou clube!', 'http://www.hobbylink.com.br/pistas/cadastrar.php', '', 33, 0, 0);

// CLASSIFICADOS
menu[5] = new Array();
menu[5][0] = new Menu(true, '>', 0, 16, 100, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[5][1] = new Item('Comprar, vender ou trocar produtos usados', 'http://www.hobbylink.com.br/classimodel/', '', 33, 0, 0);
menu[5][2] = new Item('Envie seu Classificado', 'http://www.hobbylink.com.br/classimodel/anunciar.php', '', 33, 0, 0);

// FALE CONOSCO
menu[6] = new Array();
menu[6][0] = new Menu(true, '>', -0, 16, 89, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[6][1] = new Item('Contato', 'http://www.hobbylink.com.br/fale_conosco/index.php', '', defLen, 0, 0);

// DICAS INICIANTES
menu[11] = new Array();
menu[11][0] = new Menu(true, '<', 140, 0, 99, 3, defOver, defBack, 'itemBorder', 'itemText');
menu[11][1] = new Item('Aeromodelismo', 'http://www.hobbylink.com.br/assinant/duvidas/primeiras_dicas.php', '', defLen, 0, 0);
menu[11][2] = new Item('Automodelismo', 'http://www.hobbylink.com.br/assinant/duvidas/primeiras_dicas.php', '', defLen, 0, 0);
menu[11][3] = new Item('Nautimodelismo', 'http://www.hobbylink.com.br/assinant/duvidas/primeiras_dicas.php', '', defLen, 0, 0);

window.onload = createMenus;
window.onresize = resizeHandler;

var popOldWidth = window.innerWidth;
function resizeHandler()
{

 if (!menu[0][0].ref) return;
 
 if (isNS4 && popOldWidth != window.innerWidth) location.reload()
}

function positionMenu()
{
}


function colItem()
{

 var names = ['text', 'href', 'type', 'length', 'spacing', 'overCol', 'backCol', 'target', 'ref'];
 addProps(this, arguments, names, true);
}

moveRoot = new Function('with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);');


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//  End -->