// java script engine v.1.1

var ns4 = (document.layers) ? true:false
var ie4 = (document.all) ? true:false
var mouse_x = 0;
var mouse_y = 0;

if (ns4 || ie4)
{
  document.onmousemove = mouseMove
  if (ns4) document.captureEvents(Event.MOUSEMOVE)
}

if (ie4)
{
  if (navigator.userAgent.indexOf('MSIE 5')>0)
    ie5 = true;
  else
    ie5 = false;
}
else
  ie5 = false;

function getObject(lay)
{
  if (ns4 || ie4)
  {
    if (ns4) return eval("document."+lay);
    if (ie4) return eval(lay+".style");
  }
}

function showLayer(lay)
{
  obj = getObject(lay);
  if (ns4) obj.visibility = "show"
  else if (ie4) obj.visibility = "visible"
}

function hideLayer(lay)
{
  obj = getObject(lay);
  if (ns4) obj.visibility = "hide"
  else if (ie4) obj.visibility = "hidden"
}

function zindexObject(lay, val)
{
  obj = getObject(lay);
  obj.zIndex = val;
}

function moveTo(lay, xL, yL)
{
  obj = getObject(lay);
  obj.left = xL;
  obj.top = yL;
}

function moveToRel(lay, xL, yL)
{
  obj = getObject(lay);
  obj.left += xL;
  obj.top += yL;
}

function layerWrite(lay, txt)
{
  if (ns4)
  {
    var lyr = eval("document."+lay+".document");
    lyr.open();
    lyr.write(txt);
    lyr.close();
  }
  else
   if (ie4)
     document.all[lay].innerHTML = txt
}

function mouseMove(e)
{
  if (ns4) {mouse_x=e.pageX; mouse_y=e.pageY;}
  if (ie4) {mouse_x=event.x; mouse_y=event.y;}
  if (ie5) {mouse_x=event.x+document.body.scrollLeft; mouse_y=event.y+document.body.scrollTop;}
}

function NextRandomNumber()
{
        var hi   = this.seed / this.Q;
        var lo   = this.seed % this.Q;
        var test = this.A * lo - this.R * hi;
        if (test > 0)
                this.seed = test;
        else
                this.seed = test + this.M;
        return (this.seed * this.oneOverM);
}

function RandomNumberGenerator() 
{
        var d = new Date();
        this.seed = 2345678901 +
        (d.getSeconds() * 0xFFFFFF) +
        (d.getMinutes() * 0xFFFF);
        this.A = 48271;
        this.M = 2147483647;
        this.Q = this.M / this.A;
        this.R = this.M % this.A;
        this.oneOverM = 1.0 / this.M;
        this.next = NextRandomNumber;
        return this;
}

function hilite(imgDocID, imgObjName)
{
  document.images[imgDocID].src = eval(imgObjName + ".src")
}