
var ii0 = new Image(); ii0.src = 'js/icons/arr.gif';
var ii1 = new Image(); ii1.src = 'js/icons/i.gif';
var ii2 = new Image(); ii2.src = 'js/icons/n7.gif';
var ii3 = new Image(); ii3.src = 'js/icons/m12.gif';
var ii4 = new Image(); ii4.src = 'js/icons/o.gif';
var ii5 = new Image(); ii5.src = 'js/icons/email.gif';
var ii6 = new Image(); ii6.src = 'js/icons/icq.gif';
var ii7 = new Image(); ii7.src = 'js/icons/yahoo.gif';
var ii8 = new Image(); ii8.src = 'js/icons/aol.gif';
var ii9 = new Image(); ii9.src = 'js/menu_files/pixel.gif';

var wr_act_index;

function wrap_parent (text,icon) {
	return [['<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td bgcolor=#FFFFFF><img height=22 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=100%><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td class=a0>&nbsp; ', text, '</td></tr></table></td><td><img src=js/icons/arr.gif width=4 height=7 align="middle" align=absmiddle hspace=3></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=22 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=100% class=a0>&nbsp;<font color=#000000> ', text, '</font></td><td><img src=js/icons/arr.gif width=4 height=7 align="middle" align=absmiddle hspace=3></td></tr></table></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=22 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=100% class=a0>&nbsp;<font color=#000000> ', text, '</font></td><td><img src=js/icons/arr.gif width=4 height=7 align="middle" align=absmiddle hspace=3></td></tr></table></td></tr></table>'].join('')
	];
}

function wrap_child (text,icon) {
	return [['<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td bgcolor=#FFFFFF><img height=22 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=100%><table cellpadding=0 cellspacing=0 border=0 width=100% height=32><tr><td class=a0>&nbsp; ', text, '</td></tr></table></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=32 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=99% class=a0>&nbsp;<font color=#cc0000> ', text, '</font></td></tr></table></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=32 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=99% class=a0>&nbsp;<font color=#cc0000> ', text, '</font></td></tr></table></td></tr></table>'].join('')
	];
}

function wrap_child_2 (text,icon) {
	return [['<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td bgcolor=#FFFFFF><img height=22 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=100%><table cellpadding=0 cellspacing=0 border=0 width=100% height=34><tr><td class=a0>&nbsp; ', text, '</td></tr></table></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=34 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=99% class=a0>&nbsp;<font color=#cc0000> ', text, '</font></td></tr></table></td></tr></table>'].join(''),
	['<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=34 bgcolor=#FFFFFF><tr><td><img height=16 src=', icon !=null ? 'icons/' + icon: 'js/menu_files/pixel.gif width=16', ' hspace=3></td><td width=99% class=a0>&nbsp;<font color=#cc0000> ', text, '</font></td></tr></table></td></tr></table>'].join('')
	];
}

function WrSetActIndex(new_index)
{
  wr_act_index = new_index;

  //alert(wr_act_index);
}

function wrap_root (text, n_index, highlight) 
{
  var n_act_index = 0;
  var szTdId = "td_" + n_index;
  var szTextId = "text_" + n_index;

  n_act_index = GetNewActIndex();

  //n_act_index = 1;

  //alert("Text: " + text + " Index: " + n_index + " Act. Index: " + n_act_index + " URL: " + String(window.location));

  //alert(szTdId);

  //if (n_index == 1000) {
  if (highlight) {
  	return [
	  '<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td width=100% class=a1 align="center">&nbsp; ' + text + ' &nbsp;</td></tr></table></td></tr></table>',
	  '<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td width=100% class=a1 align="center">&nbsp; '  +  text + ' &nbsp;</td></tr></table></td></tr></table>',
	  '<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td width=100% class=a1 align="center">&nbsp; '  +  text + ' &nbsp;</td></tr></table></td></tr></table>'
	  ];
  }
  else {
  	return [
	  '<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td id="' + szTdId +'" width=100% class=a0 align="center"><div id="' + szTextId + '">&nbsp; ' + text + ' &nbsp;</div></td></tr></table></td></tr></table>',
	  '<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td id="' + szTdId +'" width=100% class=a1 align="center"><div id="' + szTextId + '">&nbsp; '  + text + ' &nbsp;</div></td></tr></table></td></tr></table>',
	  '<table cellpadding=0 cellspacing=0 border=0 width=100% bgcolor=#000000><tr><td><table cellpadding=0 cellspacing=0 border=0 width=100% height=16><tr><td id="' + szTdId +'" width=100% class=a1 align="center"><div id="' + szTextId + '">&nbsp; '  + text + ' &nbsp;</div></td></tr></table></td></tr></table>'
	  ];
  }
}
