var inmenu=false;
var lastmenu=0;
var pos=350;
var lastVisible="text_5";
function Clock() {
  if (!document.getElementById) return;
  theclock=document.getElementById("clock");
  now = new Date();
  hours=now.getHours();
  mins=now.getMinutes();
  secs=now.getSeconds();
  if (secs < 10) secs= "0" + secs;
  if (mins < 10) mins= "0" + mins;
  if (hours<10) hours="0" + hours;
  theclock.innerHTML = hours + ":" + mins + ":" + secs;
  window.setTimeout("Clock();",250);  
}
function Scroll() {
  if (!document.getElementById) return;
  obj=document.getElementById("thetext");
  pos -=1;
  if (pos < 0-obj.offsetHeight) pos=300;
  obj.style.top=pos;  
  window.setTimeout("Scroll();",50);
}
function TextChange(text) {
first=document.getElementById(text);
last=document.getElementById(lastVisible);
last.style.visibility="hidden";
first.style.visibility="visible";
lastVisible=text;
}
function Menu(current) {
   if (!document.getElementById) return;
   inmenu=true;
   oldmenu=lastmenu;
   lastmenu=current;
   if (oldmenu) Erase(oldmenu);
   m=document.getElementById("menu-" + current);
   box=document.getElementById(current);
   box.style.left= m.offsetLeft + m.offsetWidth + 2;
   box.style.top= m.offsetTop;
   box.style.visibility="visible";
   m.style.backgroundColor="Aqua";
   box.style.backgroundColor="Silver";
   box.style.width="168px";
}
function Erase(current) {
   if (!document.getElementById) return;
   if (inmenu && lastmenu==current) return;
   m=document.getElementById("menu-" + current);
   box=document.getElementById(current);
   box.style.visibility="hidden";
   m.style.backgroundColor="Silver";
}
function Timeout(current) {
   inmenu=false;
   window.setTimeout("Erase('" + current + "');",500);
}
function Highlight(menu,item) {
   if (!document.getElementById) return;
   inmenu=true;
   lastmenu=menu;
   obj=document.getElementById(item);
   obj.style.backgroundColor="Aqua";
}
function UnHighlight(menu,item) {
   if (!document.getElementById) return;
   Timeout(menu);
   obj=document.getElementById(item);
   obj.style.backgroundColor="Silver";
}

