//frame breaking script
var notGovSite = document.referrer.indexOf('.gov/') < 0;

// Allow www.ala.org and www.zhost.com base on LO's request. 02/28/2008 Ta-Sun
var notalaorg  = document.referrer.indexOf('www.ala.org/') < 0;
var notzhostcom= document.referrer.indexOf('www.zhost.com/') < 0;

// Allow nlmgis01.nlm.nih.gov for Monitor Tracking machine in Computer lab
var notTouchCnt= document.referrer.indexOf('nlmgis01.nlm.nih.gov') < 0;
// Allow nlmgis02.nlm.nih.gov for Monitor Tracking machine in Computer lab
var notTouchCnt2= document.referrer.indexOf('nlmgis02.nlm.nih.gov') < 0;


// Allow olos.ala.org/goodhealth/ base on LO's request 9/18/2008 Ta-Sun
var notolosalaorg = document.referrer.indexOf('olos.ala.org/goodhealth/') < 0;

if (top.location != self.location &&
    notTouchCnt &&
    notTouchCnt2 ) {

  location.replace('http://www.nlm.nih.gov/medlineplus/framing.html');
}
function __onload(){}
var crtTab = {};
var sp_month = ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"];
us_month = ["January","February", "March","April","May","June","July","August","September","October","November","December"];
function opentab(panelId, tab) {
  try {
    document.getElementById(crtTab[panelId]).parentNode.className=("tlast"==crtTab[panelId])?"lasttab":"";
    tab.parentNode.className = ("tlast"==tab.id)?"lasttabcurrent":"tabcurrent";    
    //show tab content
    document.getElementById(crtTab[panelId] + "_c").style.display = "none";    
    document.getElementById(tab.id + "_c").style.display = "block";
    crtTab[panelId] = tab.id;
  }
  catch(e) {
  }  
}

function setCalendar(locale) {
  var dd = calcTime();
  _mon = ("us"==locale)?us_month[dd.getMonth()].substr(0,3).toLocaleUpperCase():sp_month[dd.getMonth()].substr(0,3);
  _day = (dd.getDate()<10)?("0"+dd.getDate()):dd.getDate();
  document.getElementById("cl_date").innerHTML = _day;
  document.getElementById("cl_month").innerHTML = _mon;  
}

function calcTime() {
  d = new Date();
  utc = d.getTime() + d.getTimezoneOffset()*60000;
  nd = new Date(utc + (3600000*(-5))); //US Eastern Time
  return nd;
}

function setpage(id) {
  setroll("");
  var elems = document.getElementsByTagName("ul");
  for (n=0;n<elems.length;n++) {
    if (/tabheader/.test(elems[n].className)) {
      elems[n].style.display = "block;";
    }
  }
  crtTab["th1"] = "t1";
  crtTab["th2"] = "t21";
  document.getElementById("tlast").parentNode.className="lasttab";
  document.getElementById(crtTab["th1"]).parentNode.className="tabcurrent";
  document.getElementById("th1").style.display = "block";
  document.getElementById("tc1").style.display = "block";
  document.getElementById("t1_c").style.display = "block";
  if ("us"==jsLang) {
    document.getElementById(crtTab["th2"]).parentNode.className="tabcurrent";
    document.getElementById("th2").style.display = "block";
    document.getElementById("tc2").style.display = "block";
    document.getElementById("t21_c").style.display = "block";
  }
  
  setCalendar(jsLang);
  try {
    //alert(com.deconcept.FlashObjectUtil.getPlayerVersion().major);
    if ((com.deconcept.FlashObjectUtil.getPlayerVersion()).major <9) {
      if (null!=document.getElementById("FlashID")) {
        document.getElementById("FlashID").className = "noshow";             
      }
      document.getElementById("for_sr").className = "show";
    }
    else {
      document.getElementById("for_sr").className = "show structural";
    }
  }
  catch(e) {
    document.getElementById("FlashID").className = "noshow";     
    document.getElementById("for_sr").className = "show";
  }
}

function setroll(pttitle) {
  var elems = document.getElementsByTagName("ul");
  for (n=0;n<elems.length;n++) {
    var elm = elems[n];
    if (/roll_/.test(elm.className)) {
      for (i=0;i<elm.childNodes.length;i++) {
        if( elm.childNodes[i].hasChildNodes()){
          if (!(/activetab/.test(elm.childNodes[i].className))) {
            if ((1==elm.childNodes[i].firstChild.nodeType) && (null!=elm.childNodes[i].firstChild.getAttribute("rollClass"))) {
              elm.childNodes[i].firstChild.onmouseover=function(){roll(this);};
              elm.childNodes[i].firstChild.onmouseout=function(){rollout(this);};
            }
          }
        }
      }
    }
  }
  if (""!=pttitle) {
    setupPrintPrivew(pttitle);
  }
  __onload();
}

function roll(obj) {
  var rollClass = obj.getAttribute("rollClass");
  obj.className=rollClass + "_rollover btnt";
  obj.parentNode.className=rollClass + "_liover";  
}
function rollout(obj) {
  var rollClass = obj.getAttribute("rollClass");
  obj.className=rollClass + " btnt";
  obj.parentNode.className=rollClass + "_linorm";
}
function leavemplus(param1, langcode) {
  if ((null==langcode) || undefined==langcode)
    langcode = "us";
  var trackingImg = "http://www.nlm.nih.gov/results/medlineplus/" + langcode + "/leavemplus.html?";
  var img = document.createElement("img");
  img.setAttribute("src",trackingImg + param1);
}

