var selRow=null;   
var prevSelRow = null;
function isRowSelected(trObj)
{
  return (selRow == trObj)
}
function overRow(trObj)
{
  if (isRowSelected(trObj)) return
  
  trObj.style.backgroundColor="khaki"
  trObj.style.cursor = "pointer"
}
function outRow(trObj)
{
  if (isRowSelected(trObj)) return
  
  trObj.style.backgroundColor="white"
  trObj.style.cursor = "pointer"
}
function selectRow(trObj, index)
{
  if (isRowSelected(trObj)) return
  
  trObj.style.backgroundColor="orange"
  trObj.style.cursor = "pointer"
  if (prevSelRow != trObj && prevSelRow != null){
      prevSelRow.style.backgroundColor="white"
      prevSelRow.style.cursor = "pointer"
  }
  prevSelRow = trObj
  selRow = trObj
}
function getSelAvailSegIndex(trId)
{
   var idPrefix;
   if (trId == null || trId == 'unknown')
    idPrefix = 'trAvailSeg_';
   else
    idPrefix = trId;
   return parseInt(selRow.id.replace(idPrefix,''))
}