//
// scripts.js - set of javascript functions
//
// Copyright (c) 2001 Absolutis.

var NS4 = (document.layers) ? 1 : 0;

function openPopup(url,name,w,h)
{
  l = (screen.width - w) / 2;
  t = (screen.height - h) / 2;
  p = window.open(url,name,'scrollbars=0,left='+l+',top='+t+',width='+w+',height='+h);
  p.focus();
}

function openPopupSB(url,name,w,h)
{
  l = (screen.width - w) / 2;
  t = (screen.height - h) / 2;
  p = window.open(url,name,'scrollbars=yes,resizable,left='+l+',top='+t+',width='+w+',height='+h);
  p.focus();
}

function over(img)
{
  document[img].src = eval(img + "_over.src");
}

function out(img)
{
  document[img].src = eval(img + "_out.src");
}

function scrollBox(name,obj,nest)
{          
  this.name = name;  
  this.timer = 0;                                                             
  this.style = (NS4) ? eval('document.'+nest+'.document.'+obj) : eval('document.all.'+obj+".style");                                                 
  this.top = (NS4) ? this.style.top : eval('document.all.'+obj+".offsetTop");
  this.height = (NS4) ? this.style.document.height : eval('document.all.'+obj+".offsetHeight");                                          
  this.start = scrollBox_start;
  this.stop = scrollBox_stop;     
  if(!NS4) this.style.top = this.top + "px"; // buggy IE5 :(                                                                       
  return this;
}

function scrollBox_start(speed)
{
  this.style.top = (NS4) ? this.style.top + speed : (parseInt(this.style.top) + speed) + "px";
  if(parseInt(this.style.top) + this.height < 0) this.style.top = this.top;
  this.timer = setTimeout(this.name+".start("+speed+")",150);
}

function scrollBox_stop()
{
  clearTimeout(this.timer);
}


function debugObject(object)
{
  s = "";
  for(p in object)
  {
    s = s + p + ": " + object[p] + "\n"
  }
  alert(s);
}

function showLayer(layerName)
{
  if(NS4)
  {
    document.layers[layerName].visibility = "show";
  }
  else
  {
    document.all[layerName].style.visibility = "visible";
  }
}

function hideLayer(layerName)
{
  if(NS4)
  {
    document.layers[layerName].visibility = "hidden";
  }
  else
  {
    document.all[layerName].style.visibility = "hidden";
  }
}
