//############################################################################//
//             Copyright (c) 2006, by Deluxe-Menu.com
//             Deluxe Tuner script
//             http://deluxe-menu.com
//             Programming by Shakhmatov Nik
//             E-mail: cs@deluxe-menu.com
//############################################################################//

var itemParamsCnt = 7;


//############################################################################//
//  Functions for item params
//############################################################################//

var setFromTuner = false;

var hints = [
    ['trText',      '  Item text.\n\nSet \'$\' symbol at the beginning of this value to create a new tabs row (doesn\'t work in tab-mode when tabMode=1).\nTo make a separator set the value into \'-\'.'],
    ['trLink',        'Item link (URL) (when tabMode=1) or object\'s ID property on the page (when tabMode=0).\n\nYou can also assign Javascript code to item using prefix \'javascript:\', for example:\n\n\javascript:alert(\'Hello!\')'],
    ['trTip',         'Hint message.'],
    ['trIcon',        'Item\'s normal icon.'],
    ['trIconOver',    'Item\'s mouseover icon.'],
    ['trIconSelected','Item\'s icon in selected tab state.'],
    ['trItemStyle',   'Individual item style.']
];

window.onload = assignHints;

function assignHints()
{
  for (var i=0; i<hints.length; i++)
      document.getElementById(hints[i][0]).title = hints[i][1];
}


function dm_setItemParams(iText, iLink, iIcon, iIconOver, iIconSelected, iTip, iStyle)
// Sets item parameters to objects
{
  setFromTuner = true;
  with (document)
  {
      getElementById('itemText_id'  ).value    = iText;
      getElementById('itemLink_id'  ).value    = iLink;
      getElementById('iconNormal_id').value    = iIcon;
      getElementById('iconOver_id'  ).value    = iIconOver;
      getElementById('iconSelected_id').value  = iIconSelected;
      getElementById('itemTip_id'   ).value    = iTip;
      getElementById('itemStyle_id'   ).selectedIndex = iStyle ? iStyle : -1;
  }
  setFromTuner = false;
}


function dm_getItemParam(paramInd)
// Returns specified item param from object
{
  with (document)
      switch (paramInd)
      {
        case 0: return getElementById('itemText_id').value;
        case 1: return getElementById('itemLink_id').value;
        case 2: return getElementById('iconNormal_id').value;
        case 3: return getElementById('iconOver_id').value;
        case 4: return getElementById('iconSelected_id').value;
        case 5: return getElementById('itemTip_id').value;
        case 6: return getElementById('itemStyle_id').selectedIndex;

        default: return '';
      }
}

