var sCatsSelected;
var sURL;
var arrTempDataSheets;
var objCats;

function init(){
  objCats = getObject('Cats');
  setURL();
}
function setURL(){
  sCatsSelected = objCats.value;
  sURL = getURL(sCatsSelected);
}
function getURL(sSelected){
  if(sSelected == 'Temperlite Technical Data Sheet'){
    return 'http://www.itwinsulation.com/temperlite/data_sheets/Temperlite_Data_Sheet.pdf';
  }else{
    return 'http://www.itwinsulation.com/temperlite/data_sheets/Temperlite_MSDS.pdf';
  }
}
function getDoc(){
  var sCurrentURL = sURL;
  window.open(sCurrentURL);
}
function setLinkClass(sLnkID,sClassName){
  var objLnk = getObject(sLnkID);
  objLnk.className = sClassName;
}
function setCellBorder(sCellID,sClassName){
  var objCell = getObject(sCellID);
  if(document.all){
    objCell.style.cursor = "hand";
  }else{
    objCell.style.cursor = "pointer";
  }
  objCell.className = sClassName;
}
function setTRLnkBordersOn(sLnkID,sTblID,sTopCellID,sBotCellID){
  var objLnk = getObject(sLnkID);
  var objTbl = getObject(sTblID);
  var objTopCell = getObject(sTopCellID);
  var objBotCell = getObject(sBotCellID);
  objLnk.style.textDecoration = "none";
  if(document.all){
    objTopCell.style.cursor = "hand";
    objBotCell.style.cursor = "hand";
    objLnk.style.cursor = "hand";
  }else{
    objTopCell.style.cursor = "pointer";
    objBotCell.style.cursor = "pointer";
    objLnk.style.cursor = "pointer";
  }
  objTopCell.style.paddingBottom = "0";
  objTopCell.style.borderBottomStyle = "solid";
  objTopCell.style.borderBottomWidth = "1px";
  objTopCell.style.borderBottomColor = "#800000";
  objBotCell.style.borderBottomStyle = "solid";
  objBotCell.style.borderBottomWidth = "1px";
  objBotCell.style.borderBottomColor = "#800000";
}
function setTRLnkBordersOff(sLnkID,sTblID,sTopCellID,sBotCellID){
  var objLnk = getObject(sLnkID);
  var objTbl = getObject(sTblID);
  var objTopCell = getObject(sTopCellID);
  var objBotCell = getObject(sBotCellID);
  objLnk.style.textDecoration = "none";
  objLnk.style.cursor = "none";
  objTbl.style.borderStyle = "none";
  objTopCell.style.paddingBottom = "1px";
  objTopCell.style.borderBottomStyle = "none";
  objBotCell.style.borderBottomStyle = "none";
}
function getObject(sObjID){
  var obj;
  var q = "\"";
  if(document.layers){
    obj = eval("document." + sObjID);
  }else if(document.all){
    obj = eval("document.all." + sObjID);
  }else if(document.getElementById){
    var sID = q + sObjID.toString() + q;
    obj = eval("document.getElementById(" + sID + ")");
  }
  return obj;
}