
function scroll() {
   /***
      display the text at the right position and set a timeout
      move the position one step further
    ***/
   var len = varTxt.length;
   pos++;
   // calculate the text which shall be displayed
   var scroller = "";
   if ( pos == len ) {
      document.getElementById( "mess2" ).innerHTML = "";
      return;   // no more self-calling
   }
   /***
       if the text hasn't reached the left side yet we have to
       add some spaces - otherwise we have to cut of the first
       part of the text which moved already across the left border
    ***/
   if ( pos < 0 ) {
      for ( var i = 1; i <= Math.abs( pos ); i++ ) {
         scroller = scroller + " ";
      }
      scroller = scroller + varTxt.substring( 0, width - i + 1 );
   }
   else {
      scroller = scroller + varTxt.substring( pos, len );
   }
   document.getElementById( "mess2" ).innerHTML = scroller;
   // call this function again after 100 milliseconds
   setTimeout( "scroll()", 100 );
}

function onMouseOverE() {
   window.status = clickE;
   ddrivetip( clickE, 'white', 300 );
   setMessE();
   return true;
}

function setMessE() {
   setMess( messE[ currMessE ] );
   currMessE = ( currMessE + 1 ) % messE.length;
   timeOut = setTimeout( "clrMessE()", 3000 );
}

function clrMessE() {
   setMess( '' );
   timeOut = setTimeout( "setMessE()", 500 );
}

function onMouseOverF() {
   window.status = clickF;
   ddrivetip( clickF, 'white', 300 );
   setMessF();
   return true;
}

function setMessF() {
   setMess( messF[ currMessF ] );
   currMessF = ( currMessF + 1 ) % messF.length;
   timeOut = setTimeout( "clrMessF()", 3000 );
}

function clrMessF() {
   setMess( '' );
   timeOut = setTimeout( "setMessF()", 500 );
}

function onMouseOutX() {
   window.status = '';
   hideddrivetip();
   setMess( '' );
   clearTimeout( timeOut );
   return true;
}

function setMess( theMess ) {
   document.getElementById( "mess1" ).innerHTML = theMess;
}

function ietruebody() {
  return ( document.compatMode && document.compatMode != "BackCompat" ) ? document.documentElement : document.body;
}

function ddrivetip( thetext, thecolor, thewidth ) {
   if ( ns6 || ie ) {
      if ( typeof thewidth != "undefined" )
         tipobj.style.width = thewidth + "px";
      if ( typeof thecolor != "undefined" && thecolor!="" )
         tipobj.style.backgroundColor = thecolor;
      tipobj.innerHTML = thetext;
      enabletip = true;
      return false;
   }
}

function positiontip( e ) {
   if ( enabletip ) {
      var curX = ( ns6 ) ? e.pageX : event.x + ietruebody().scrollLeft;
      var curY = ( ns6 ) ? e.pageY : event.y + ietruebody().scrollTop;
      // find out how close the mouse is to the corner of the window
      var rightedge  = ( ie && ! window.opera ) ? ietruebody().clientWidth-event.clientX  - offsetxpoint : window.innerWidth  - e.clientX - offsetxpoint - 20;
      var bottomedge = ( ie && ! window.opera ) ? ietruebody().clientHeight-event.clientY - offsetypoint : window.innerHeight - e.clientY - offsetypoint - 20;
      var leftedge   = ( offsetxpoint < 0 ) ? offsetxpoint * ( -1 ) : -1000;
      // if the horizontal distance isn't enough to accomodate the width of the context menu
      if ( rightedge < tipobj.offsetWidth )
         // move the horizontal position of the menu to the left by it's width
         tipobj.style.left = ie ? ietruebody().scrollLeft + event.clientX - tipobj.offsetWidth + "px" : window.pageXOffset + e.clientX - tipobj.offsetWidth + "px";
      else if ( curX < leftedge )
         tipobj.style.left = "5px";
      else
         // position the horizontal position of the menu where the mouse is positioned
         tipobj.style.left=curX+offsetxpoint + "px";
      // same concept with the vertical position
      if ( bottomedge < tipobj.offsetHeight )
         tipobj.style.top = ie ? ietruebody().scrollTop+event.clientY - tipobj.offsetHeight - offsetypoint + "px" : window.pageYOffset + e.clientY-tipobj.offsetHeight - offsetypoint + "px";
      else
         tipobj.style.top = curY+offsetypoint + "px";
      tipobj.style.visibility = "visible";
   }
}

function hideddrivetip() {
   if ( ns6 || ie ) {
      enabletip = false;
      tipobj.style.visibility = "hidden";
      tipobj.style.left = "-1000px";
      tipobj.style.backgroundColor = '';
      tipobj.style.width = '';
   }
}

