/*
Highlight Table Cells Script- 
*/


// 07.05.01 new code to detect Netscape 6
var browserName = navigator.appName;
var browserVersion = navigator.appVersion;
var browserVersionNum = parseFloat(browserVersion)
var found_str = browserName.indexOf("Netscape");



function changeto(highlightcolor)
{
  var row_index;
  source=event.srcElement;
  row_index = source.parentElement.rowIndex;
  if (source.tagName=="TR"||source.tagName=="TABLE")
  return
  while(source.tagName != "TD")
  {
    source=source.parentElement;
  }
  
  // get out cell id, check if we have ignore in id (needed to ignore high light of first row)
  var source_id = "" + source.id;
  var found_ignore = false;
  if (source_id.indexOf("ignore") > -1)
  {
    found_ignore = true;
  }
  // done check for ignore
  
  if (source.style.backgroundColor!=highlightcolor && !found_ignore)
  {
    source.style.backgroundColor=highlightcolor  
  }
}



function changeback(originalcolor)
{
  var row_index = source.parentElement.rowIndex;
  
  // check if our first table row should be un-high-lighted even if its the first row (i.e. index=0)
  if (source.id == "unhighlight")
  {
    row_index = -1; //reset make sure our row_index is not 0 so the following code will execute
  }
  
  if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||row_index==0)
  {
    return;
  }
  
  if (event.toElement != source)
  {
    source.style.backgroundColor = originalcolor;
  }
}
