var NS4 = (document.layers)?1:0;
var DOM = (document.all)?1:0;
var DOCREF = NS4 ? "document." : "document.all.";
var IPATH = "images/"
var TREF = DOCREF+"txt";
var PREF = DOCREF+"pic";
var XREF = DOM ? ".style.pixelLeft" : ".left";
var WREF = DOM ? "img.style.pixelWidth" : ".clip.width";
var YREF = DOM ? ".style.pixelTop" : ".top";
var VREF = DOM ? ".style.visibility" : ".visibility";
var txt = new Array();
var bann = new Array();
var ntxt=0;
var nbann=0;
var done = false;
loaded = true;

if (DOM || NS4) {
  document.writeln('<style>\n#txtbar{POSITION: absolute; VISIBILITY: hidden}');
  document.writeln('</style>');
}

function hover(which,active) {
  if (!done) return true;
  eval(DOCREF+"hilite"+XREF+"= txt[which].xt - 14");
  eval(DOCREF+"hilite"+YREF+"= txt[which].yt - 14");
  eval(DOCREF+"hilite"+VREF+"=" + (active ? "'visible'" : "'hidden'"));
  txt[which].text(active);
  self.status = active ? txt[which].desc : '';
  return true; // override status message
}

function jump(which) {
  window.open (txt[which].url, "_parent");
  return false; // don't do default jump
}

function txt_anim(rpt) {
  if (this.p == 0) return 0;
  this.p = this.p * 0.9 - 0.01;
  if (this.p <= 0) this.p = 0;
  x = this.p * (this.xs - this.xt) + this.xt;
  y = this.p * (this.ys - this.yt) + this.yt;
  eval (this.xref + "= x");
  eval (this.yref + "= y");
  eval (this.vref + "= 'visible'");
  return (this.p > 0.3);
}

function txt_text(active) {
  eval(this.tref + (active ? "= 'visible'" : "= 'hidden'"));
}

function bann_anim(rpt) {
  if (this.p == 0) {
    this.p = 1.0;
  }
  this.p = this.p - this.i;
  if (this.p <= 0) this.p = 0;
  x = this.p * (this.xs - this.xt) + this.xt;
  y = this.p * (this.ys - this.yt) + this.yt;
  eval (this.xref + "= x");
  eval (this.yref + "= y");
  eval (this.vref + "= 'visible'");
}

function txtObj (id, xs, ys, xt, yt, url, t) {
  document.writeln('<style>\n#txt'+id+'{POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 60 }');
  document.writeln('#pic'+id+'{POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 60 }\n</style>');
  document.writeln('<div id="txt'+id+'">');
  document.writeln('<A HREF="' + url + '" onClick="return jump(' + ntxt + ');" onMouseOver="return hover(' + ntxt + ',1);" onMouseOut="return hover(' + ntxt + ',0);">');
  document.writeln('<img src="' + IPATH + id + 'txt.gif" name="' + id + '_name" border=0></A></div>');
  document.writeln('<div id="pic'+id+'">');
  document.writeln('<font face="Arial,Helvetica,sans-serif" size="-1">',t,'</font></div>');
  this.id = id;
  this.xs = xs;
  this.ys = ys;
  this.xt = xt;
  this.yt = yt;
  this.p = 1.0;
  this.url = url;
  this.desc = t;
  this.xref = TREF+id+XREF;
  this.yref = TREF+id+YREF;
  this.vref = TREF+id+VREF;
  this.tref = PREF+id+VREF;
  this.anim = txt_anim;
  this.text = txt_text;
  eval (PREF+id+XREF + "=500");
  eval (PREF+id+YREF + "=8");
  txt[ntxt++] = this;
}

function bannObj (id, xs, ys, xt, yt, i, s) {
  document.writeln('<style>\n#'+id+'{POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 10}\n</style>');
  document.writeln('<div id="'+id+'">'+s+'</div>');
  this.id = id;
  this.xs = xs;
  this.ys = ys;
  this.xt = xt;
  this.yt = yt;
  this.p = 1.0;
  this.i = i;
  this.xref = DOCREF+id+XREF;
  this.yref = DOCREF+id+YREF;
  this.vref = DOCREF+id+VREF;
  this.anim = bann_anim;
  bann[nbann++] = this;
}

function advance() {
  for (n=0; n<ntxt; n++) {
    if (txt[n].anim())
	break;
  }
  if (n == ntxt) {
    done = 1;
    for (n=0; n<nbann; n++)
      bann[n].anim();
  }
}

function init() {
  done = false;
  setInterval ("advance()", 50);
}

if (DOM || NS4) {
  var x=0;
  new txtObj('h', 600, 5, x+=10, 5, "../home", "Home Page");
  new txtObj('t', 600, 5, x+=50, 5, "../table", "Find out more about Round Table");
  new txtObj('n', 600, 5, x+=48, 5, "../news", "Recent news from our area");
  new txtObj('d', 600, 5, x+=48, 5, "../diary", "Area on-line diary");
  new txtObj('e', 600, 5, x+=48, 5, "../events", "Forthcoming special events");
  new txtObj('p', 600, 5, x+=54, 5, "../pictures", "Memorable moments!");
  new txtObj('l', 600, 5, x+=62, 5, "../links", "Other sites of interest to Tablers");
  new txtObj('c', 600, 5, x+=44, 5, "../circle", "The Ladies' site");
  new txtObj('f', 600, 5, x+=46, 5, "../feedback", "Let's hear from you");
  new bannObj("bann0",600,0,-200,0,0.007,'<font size="5" color="#0000c0" face="Arial"><b>Round&nbsp;Table</b></font>');
  new bannObj("bann1",-200,5,600,5,0.009,'<font size="5" color="#0000ff" face="TimesRoman"><b><i>Severn&nbsp;Vale</i></b></font>');
  document.writeln('<style>\n#hilite{POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 40}\n</style>');
  document.writeln('<div id="hilite"><img SRC="' + IPATH + 'hilite.gif" name="hilite_name"></div>');
  window.onload = init;
  if (NS4) window.resize = init;
}

