var browsername = window.navigator.appName;
var platformtype = window.navigator.platform;
var ie = browsername.indexOf("Explorer") > -1 ? true : false;
var nn = browsername.indexOf("Netscape") > -1 ? true : false;
var safari = window.navigator.appVersion.indexOf("Safari") > -1 ? true : false;
var frameht;

function init()
{
 which_bar();
 if(!document.layers)//if not nn4
 {
  var ht, bght, screenht, lbackht;
  var frame = parent.document.getElementById("mp");//get frame object
  var mndiv = document.getElementsByTagName("div");//get div array
  var bg = parent.document.getElementById("container");//get bgle array
  var lbackobj = parent.document.getElementById("lback");//get lback object
  
  if(ie)
  {
   ht = mndiv[0].offsetHeight;//set height equal to height of main div on changing content page
   screenht = parent.document.body.clientHeight;//find screen height
  }
  else if(safari)
  {
   ht = parent.window.innerHeight;
   screenht = parent.window.innerHeight;
  }
  else
  {
   ht = mndiv[0].offsetHeight;//set height equal to height of main div on changing content page
   screenht = parent.window.innerHeight;//find screen height
  }

 frame.style.height = ht + "px";//change frame height to equal main div height
 
 if(ie)
 {bght = bg.clientHeight;}//find height of container
 else
 {
  bght = bg.offsetHeight;//find height of container
  frameht = frame.offsetHeight;
 }

 if(screenht >= bght)
 {lbackht = screenht;}
 else if(screenht <= bght)
 {lbackht = bght;}

 if(lbackht < ht)
 {lbackht = ht;}

 lbackht += "px";
 
 lbackobj.style.height = lbackht; 
 }
}

function refresh()
{
  var lbackht, screenht, bght;
  var lbackobj = document.getElementById("lback");//get lback object
  var bg = document.getElementById("container");//get bgle array
  var frame = document.getElementById("mp");//get frame object
  
  if(ie)
  {
   screenht = document.body.clientHeight;//find screen height
   bght = bg.clientHeight;//find height of background bgle
  }
  else
  {
   screenht = window.innerHeight;//find screen height
   bght = bg.offsetHeight;//find height of background bgle
   frameht = frame.offsetHeight;
  }
  
  if(screenht >= bght)
  {lbackht = screenht;}
  else if(screenht <= bght)
  {lbackht = bght;}
 
 if(lbackht < frameht)
 {lbackht = frameht;}

 lbackht += "px";
 
 lbackobj.style.height = lbackht; 
}

function swapImage(sName,sImage)
{document.images[sName].src = sImage;}

function which_bar()
{
 var loc = window.location.href;
 var path = loc.substring(loc.indexOf("www"), loc.length);
 var imgln = parent.document.images.length;
 var imgloc = parent.document.images[imgln - 1].src;
 var imgsrc = imgloc.substring(imgloc.indexOf("www"), imgloc.length);
 var section = "lti";
 var imgpathbeg = "common/images/";
 var imgpathend = "_bar.jpg";
 
 if((path.indexOf("lli") != -1))
 {section = "lli";}
 else if((path.indexOf("tdlc") != -1))
 {section = "lli";}
 
 if((imgsrc.indexOf(section) < 0))
 { 
  var newimg = imgpathbeg + section + imgpathend;
  parent.document.images["bar"].src = newimg;
 } 
}
