function _getElement(eName) {
    if (document.all) return(eval("document.all." + eName));
    else  return(document.getElementById(eName));
}

function open_win(url)
{
    var rootpath = "/";
    if (httpRoot != null) rootpath = httpRoot;
    window.open(rootpath + url,'srtrwin','');
}

function showMe(div, shutoffdiv) {
   var shutoff = _getElement(shutoffdiv);
   if (shutoff != null) {
     shutoff.style.visibility = "hidden";
   }
   var obj = _getElement(div);
   if (obj != null) {
      obj.style.visibility = "visible";
   }
   
   // this is for getting the CSR comment div over the dropdown box
   // if there is a iframe tag with ID = selectBlocker, make it visible
   var iframe = _getElement('selectBlocker');
   if (iframe != null) {
      iframe.style.visibility = "visible";
   }
}

function hideMe(div) {
   var obj = _getElement(div);
   if (obj != null) {
      obj.style.visibility = "hidden";
   }
   
   // this is for getting the CSR comment div over the dropdown box
   // if there is a iframe tag with ID = selectBlocker, make it visible
   var iframe = _getElement('selectBlocker');
   if (iframe != null) {
      iframe.style.visibility = "hidden";
   }
}

function PutTextForThumbnail(id, msg) {
   var obj = _getElement(id);
   if (obj != null) {
      obj.innerHTML = msg;
   }
}

// need to delete it after decided which color to use.
function swapImg() {
   var img = _getElement("hrsa_tagline");
   var aa = _getElement("hrsa_right");
   if (img != null) {
      if(img.bgColor == "#010000") {
         img.bgColor = "2";
         img.style.backgroundColor = "#033977";
         aa.style.backgroundColor = "#033977";
      } else if (img.bgColor == "#020000") {
         img.bgColor = "3";
         img.style.backgroundColor = "#58534a";
         aa.style.backgroundColor = "#58534a";
      } else {
         img.bgColor = "1";
         img.style.backgroundColor = "#787266";
         aa.style.backgroundColor = "#787266";
      }
   }
}

function swapUST() {
   var td = _getElement("ust_logo");
   var image = _getElement("ctl00_Srtr_Logo");
   if (td != null && image != null) {
       if(td.bgColor == "#010000") {
          td.bgColor = "2";
          td.style.backgroundColor = "#033977";
          image.src = "http://testweb02/srtrdotgov/images/ust_darkblue.jpg";
       } else {
          td.bgColor = "1";
          td.style.backgroundColor = "#58544B";
          image.src = "http://testweb02/srtrdotgov/images/ust_darkgray.jpg";
       }
   }
}