var highlightColor = "#90A0FF";
var linkColor ="#003090";
var linksShown = false;

function show_links()
{
   if(window.event.ctrlKey && linksShown==false)
   {
   //  for (i=0; i < document.links.length; i++) {
   //      document.links[i].style.cssText = "background: #A0C0FF; filter: Alpha(opacity=50, enabled=1);";
   //      }
      //_logMessage("Control pressed");  // Only for use with evaluator!!!
      for (i=0; i < document.all.length; i++)
      {
         var e = document.all[i];
         if (e.nodeName == "IMG" && hasParentWithNodeName(e, "A")  )
         {
            e.backupStyle   = e.style.cssText;
            e.style.cssText = "background: "+highlightColor+"; filter: Alpha(opacity=50, enabled=1);";
         } else if (e.nodeName == "AREA" )
         {  
            e.backupStyle   = e.style.cssText;
            e.style.cssText = "background: "+highlightColor+"; filter: Alpha(opacity=50, enabled=1);";
         } else if (e.nodeName == "A") 
         {
            e.backupStyle   = e.style.cssText;
            e.style.cssText = "color: "+linkColor+"; text-decoration: underline  !important;";
         }
       }
   linksShown=true;
   }
}

function hide_links()
{
   if(linksShown==true)
   {
      //_logMessage("Control released");
      for (i=0; i < document.all.length; i++)
      {
         document.all[i].style.cssText = document.all[i].backupStyle;
      }
   linksShown=false;
   }
}


function hasParentWithNodeName( e, name )
{
  if (e.parentElement) 
  {
    if (e.parentElement.nodeName == name)
      return true;
    return hasParentWithNodeName( e.parentElement, name ); 
  }
  return false;
}
