var selectName;

function leftnavOver(tr)
{
   tr.style.backgroundColor = leftBackgroundOver;
}

function leftnavOut(tr)
{
	tr.style.backgroundColor = leftBackgroundOut;
}

function selectNav (name)
{
   reset();
   eval("document."+name+"1.className='leftnav_link_on'");
   eval("document."+name+"2.className='leftnav_icon_on'");
   selectName = name;
}

function deSelect (name)
{
	eval("document."+name+"1.className='leftnav_link'");
	eval("document."+name+"2.className='leftnav_icon'");
}

// VM/FAX/EMAIL LIST ROLLOVER SCRIPT

// set on mouse over
var tdMouse
// active extension, or Jselected td
var selectedBar

function colorEachTd (name, td)
{
   var table = tdMouse.offsetParent.offsetParent
//alert('table '+table)
   var colls = table.rows
//alert('colls '+colls)
   size = colls.length
//alert('size '+size);
   for (var i=2; i<size; i++)
   {
// skip opened item
//      if (document.getElementById("option_"+(i-1)).style.display == "block")
//         continue;
      var item = colls.item(i)
      barOut(name, item, Math.floor((i-2)/3));
   }
}

function CheckAll(td, name)
{
   var temp = eval('document.'+name+'.checkall.checked');

   for (var i=0;i<eval('document.'+name+'.elements.length');i++)
   {
      var e = eval('document.'+name+'.elements[i]');
      if (e.name != 'Check All')
         e.checked = temp;
   }

   colorEachTd (name, td)
}

function barOut(name, td, i) {

   td.style.backgroundColor = "transparent";
   var theStyle = document.getElementById("option_"+i);
   // checkbox
   var selectedCheckbox = document.getElementById("selected"+i);

	if (theStyle != null && theStyle.style.display == "block")
      td.style.backgroundColor =  mouseOverColor	//color for currently play
    else if ( (selectedCheckbox != null && selectedCheckbox.checked) || selectedBar == i)
      td.style.backgroundColor = mouseOverColor
   else
      td.style.backgroundColor = "transparent"
}


// selected memory wizard type
var selectedW = -1

function highlightTd (idx)
{
   selectedW = idx

   var table = tdMouse.offsetParent

   var rows = table.rows
   var colls = (rows.item(0)).cells
   var size = colls.length
   for (var i=0; i<size; i++)
   {
      var item = colls.item(i)
      barOffW(item, i)
   }
}

// need to know the difference between barOverW & barOver
function barOverW(td) {
   tdMouse = td
	td.style.backgroundColor = mouseOverColorW;
}

function barOffW(td, i) {
   if (selectedW != i)
	  td.style.backgroundColor = "transparent";
}

function barOver(td) {
	td.style.backgroundColor = mouseOverColor;
}

function barOff(td) {
	td.style.backgroundColor = "transparent";
}


// frontoffice
var onRow = "#FFEAEA";
var offRow = "transparent";

function changeIt(activeRow, style) {
	var row = document.getElementById(activeRow);
	row.style.background = style;
	//alert(rowIDi);
}

function highlight(flipit, theTable, id) {
	var theTable = document.getElementById(theTable);
	var finish = document.getElementById(flipit);
	if (finish.style.display == 'none')
   {
		finish.style.display = '';
		theTable.style.background = "#FFEAEA";
	}
   else
   {
		finish.style.display = 'none';
		theTable.style.background = "transparent";
	}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
