var stropMenusL = new Array();



function stropMenuLOver(cont) {
  if (!stropMenuOpened(cont))
    cont.className = 'menuButtLCommon menuButtLOver';
}

function stropMenuLOut(cont) {
  if (!stropMenuOpened(cont))
    cont.className = 'menuButtLCommon menuButtLNorm';
}

function stropMenuOpened(cont) {
  var attr = cont.getAttribute('stropOpened');
  if (attr !== null)
    if (attr == 'yes')
      return true;
      
  return false;
}



function stropMenuLClick(cont, num) {
  // See if the menu exists
  if (stropMenusL[num] !== null) {
    // See if it has sub-menus
    if (stropMenusL[num].length > 0) {
      
      // Get menu's index
      var index = cont.parentNode.rowIndex;
      
      // See if it is already opened
      var opened = false;
      
      var attr = cont.getAttribute('stropOpened');
      if (attr !== null)
        if (attr == 'yes')
          opened = true;
          
          
      if (opened) {
        var table = document.getElementById('stropMenusLTable');
        table.deleteRow(index + 1);
        cont.setAttribute('stropOpened', 'no');
      }
      else {
        // Change the butt
        cont.className = 'menuButtLCommon menuButtLClick';
        cont.setAttribute('stropOpened', 'yes');
        
        // Create the menu row
        var table = document.getElementById('stropMenusLTable');
        var row = table.insertRow(index + 1);
        var cell = row.insertCell(0);
        
        // Create the menu items
        var content = '';
        for (var i=0; i<stropMenusL[num].length; ++i) {
          if (i == 0) {
            if (stropMenusL[num][i][1] == '')
              content += '<div class="menuBackLFirst">'+ stropMenusL[num][i][0] +'</div>';
            else
              content += '<div class="menuBackLFirst"><a href="'+ stropMenusL[num][i][1] +'" target="_self" class="menuBackLLink">'+ stropMenusL[num][i][0] +'</a></div>';
          }
          else {
            if (stropMenusL[num][i][1] == '')
              content += '<div class="menuBackL">'+ stropMenusL[num][i][0] +'</div>';
            else
              content += '<div class="menuBackL"><a href="'+ stropMenusL[num][i][1] +'" target="_self" class="menuBackLLink">'+ stropMenusL[num][i][0] +'</a></div>';
          }
        }
        
        content += '<img src="img/sub_but_down.gif" width="235" height="5" alt="" />';
        cell.innerHTML = content;
      }
    }
  }
}
