// JavaScript Document

var nn4 = (document.layers) ? true : false 
var ie = (document.all) ? true : false 
var dom = (document.getElementById && !document.all) ? true : false 
isHot=false;

//function browser(id){
  //if(nn4) {
  //path = document.layers[id]
  //}
  //else if(ie) {
  //path = document.all[id]
  //} 
  //else {
  //path = document.getElementById(id)
  //}
//return path  //return the path to the css layer depending on which browser is looking at the page
//}

function browser(id){
  if(document.getElementById) {
  path = document.getElementById(id)
  }
  else if(document.all) {
  path = document.all[id]
  }
  else if(document.layers) {
  path = document.layers[id]
  }
  else {
  alert('JS function error:browser')
  }
return path  //return the path to the css layer depending on which browser is looking at the page
}

function getcontentpath(divid){
  if(nn4) {
  contentpath = document.layers[divid]
  }
  else if(ie) {
  contentpath = document.all[divid]
  } 
  else {
  contentpath = document.getElementById(divid)
  }
return contentpath  //return the path to the css layer depending on which browser is looking at the page
}

function showLayer(id,innercontent,contentid) {
    var content
    //var hiddenlayer
    content = "<span>" + innercontent + "</span>"
    hiddenlayer = browser(id)
    contentpath = getcontentpath(contentid)
    if(nn4){
      contentpath.document.open()
	    contentpath.document.write(content) //write content to layer
	    contentpath.document.close()
      hiddenlayer.visibility = "visible"
      posx -= 20
      posy += 20
      hiddenlayer.top = posy
      hiddenlayer.left = posx
    }
    else {
      contentpath.innerHTML = content
      hiddenlayer.style.visibility = "visible"
      dummy = positionLayer()
      winbottom = frameHeight+scrollDown
      //var toppos = posy+scrollDown+15
      var toppos = posy+15
      if (toppos >(winbottom-70)) {
        toppos = posy-100
      }
      //alert(posy)
      var leftpos = posx-20
      //alert(leftpos)
      hiddenlayer.style.top = toppos+"px"
      hiddenlayer.style.left = leftpos+"px"
    }
  }

function hideLayer(id) {
hiddenlayer = browser(id)
   if(nn4){
   hiddenlayer.visibility = "hidden"
   }
   else{
   hiddenlayer.style.visibility = "hidden"
   }
}

function positionLayer() {
    if (self.innerWidth) //Firefox,Opera
    {
      frameWidth = self.innerWidth;
	    frameHeight = self.innerHeight;
	    scrollDown = self.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.clientWidth)
    {
      frameWidth = document.documentElement.clientWidth;
	    frameHeight = document.documentElement.clientHeight;
	    scrollDown = document.documentElement.scrollTop;
    }
    else if (document.body)
    {
      frameWidth = document.body.clientWidth;
	    frameHeight = document.body.clientHeight;
	    scrollDown = document.body.scrollTop;
    }
    else {
      return;
    }
}


