var layerSwitch = ""
var styleSwitch = ""
var bracketSwitch = "']."
var isIE = false
var isNS4 = false
var isNS6 = false

function checkBrowser()
{
   if (document.layers)
   {
      layerSwitch = "document.layers['"
      styleSwitch = "']"
      isNS4 = true
   }
   else if (document.all)
   {
      layerSwitch = "document.all['"
      styleSwitch = "'].style"
      isIE = true
   }
   else
   {
      layerSwitch = "document.getElementById('"
      styleSwitch = "').style"
      isNS6 = true
   }
}

function moveLayerTo(layer,left,top)
{
   eval(layerSwitch + layer + styleSwitch + '.top=top')
   eval(layerSwitch + layer + styleSwitch + '.left=left')
}

function showLayer (layer)
{
   eval(layerSwitch + layer + styleSwitch + '.visibility = "visible"')
}

function hideLayer (layer)
{
   eval(layerSwitch + layer + styleSwitch + '.visibility = "hidden"')
}

function showImage (layer, imageName)
{
   if (document.images)
   {
      if (isIE || isNS6 || (layer == ""))
      {
         document[imageName].src = eval(imageName + "ON.src") 
      }
      else
      {
         eval(layerSwitch + layer + styleSwitch + '.document').images[imageName].src = eval(imageName + "ON.src")
      }
   }
}

function hideImage (layer, imageName)
{
   if (document.images)
   {
      if (isIE || isNS6 || (layer == ""))
      {
         document[imageName].src = eval(imageName + ".src")
      }
      else
      {
         eval(layerSwitch + layer + styleSwitch + '.document').images[imageName].src = eval(imageName + ".src")
      }
   }
}

function preload(imgObj,imgSrc)
{
    eval(imgObj+' = new Image()')
    eval(imgObj+'.src = "'+imgSrc+'"')
}

function loadStylesheet(path)
{
   if (isNS4)
   {
      document.write("<link rel=stylesheet href=" + path + "css/styleNS4.css>")
   }
   else if (isNS6)
   {
      document.write("<link rel=stylesheet href=" + path + "css/styleNS6.css>")
   }
   else
   {
      document.write("<link rel=stylesheet href=" + path + "css/style.css>")
   }
}

function openWin(page)
{
   window.open(page,"picWin","width=600,height=600,scrollbars=0")
}

function reload()
{
   if (isNS4)
   {
      window.reload
   }
}
