<!--

/**************************************************
Speed Roll-Over Tip Box v1.5

Created by Howard Chen
Get more JavaScripts at http://start.at/javascripts/
Bugs report to jdeveloper@telebot.net
This script is free as long as the credits above are kept

This JavaScript code uses techniques found at
The Dynamic Duo - http://www.dansteinman.com/dynduo/
**************************************************/

tipWidth = 100;
tipLocation = "center";      // can be "right", or "center".  This decides where the tip box appears.

delayTime = 500;            // How long to wait before popping up the tip box.

cursorFollow = true;        // Set to false if you do not want the tip box to stick to the mouse cursor.

withTitle = true;           // Set to false if you do not want a title caption in the tip box
titleBgColor = "#000080";   // The background color of the title caption section of the tip box
titleSize = 2;              // The font size of the title

BgColor = "#008080"         // The background color of the tip box
textSize = 2;               // The font size of the text within the box

//===============DO NOT EDIT BELOW THIS LINE================


  readyToGo = false;

  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false

  function DynLayer(id,nestref) {
          if (ns4) {
                  this.css = (nestref)? eval("document."+nestref+".document."+id) : document.layers[id]
                  this.x = this.css.left
                  this.y = this.css.top
          }
          else if (ie4) {
                  this.css = document.all[id].style
                  this.x = this.css.pixelLeft
                  this.y = this.css.pixelTop
          }
          this.show = DynLayerShow
          this.hide = DynLayerHide
          this.addon = DynLayerAddon
          this.addon(id,nestref)
  }

  function DynLayerMoveTo(x,y) {
          if (x!=null) {
                  this.x = x
                  this.css.left = this.x
          }
          if (y!=null) {
                  this.y = y
                  this.css.top = this.y
          }
  }
  function DynLayerMoveBy(x,y) {
          this.moveTo(this.x+x,this.y+y)
  }
  function DynLayerShow() {
          this.css.visibility = (ns4)? "show" : "visible"
  }
  function DynLayerHide() {
          this.css.visibility = (ns4)? "hide" : "hidden"
  }
  function DynLayerAddon(id,nestref) {
          this.id = id
          this.nestref = nestref
          this.w = (ns4)? this.css.clip.width : this.css.pixelWidth
          this.h = (ns4)? this.css.clip.height : this.css.pixelHeight
          this.doc = (ns4)? this.css.document : document
          this.event = (ns4)? this.css : document.all[id]
          this.obj = id + "DynLayer"
          eval(this.obj + "=this")
          this.moveTo = DynLayerMoveTo
          this.moveBy = DynLayerMoveBy
          this.slideTo = DynLayerSlideTo
          this.slideBy = DynLayerSlideBy
          this.slideStart = DynLayerSlideStart
          this.slide = DynLayerSlide
  }
  function DynLayerSlideTo(endx,endy,inc,speed,fn) {
          if (endx==null) endx = this.x
          if (endy==null) endy = this.y
          var distx = endx-this.x
          var disty = endy-this.y
          this.slideStart(endx,endy,distx,disty,inc,speed,fn)
  }
  function DynLayerSlideBy(distx,disty,inc,speed,fn) {
          var endx = this.x + distx
          var endy = this.y + disty
          this.slideStart(endx,endy,distx,disty,inc,speed,fn)
  }
  function DynLayerSlideStart(endx,endy,distx,disty,inc,speed,fn) {
          if (this.slideActive) return
          var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
          var dx = distx/num
          var dy = disty/num
          if (!fn) fn = null
          this.slideActive = true
          this.slide(dx,dy,endx,endy,num,1,speed,fn)
  }
  function DynLayerSlide(dx,dy,endx,endy,num,i,speed,fn) {
          if (!this.slideActive) return
          if (i++ < num) {
                  this.moveBy(dx,dy)
                  setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+num+","+i+","+speed+",\""+fn+"\")",speed)
          }
          else {
                  this.slideActive = false
                  this.moveTo(endx,endy)
                  eval(fn)
          }
  }

  function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex) {
          if (ns4) {
                  if (nestref) {
                          var lyr = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")")
                  }
                  else {
                          var lyr = document.layers[id] = new Layer(width)
                          eval("document."+id+" = lyr")
                  }
                  lyr.left = left
                  lyr.top = top
                  if (height!=null) lyr.clip.height = height
                  if (bgColor!=null) lyr.bgColor = bgColor
                  lyr.visibility = (visibility=='hidden')? 'hide' : 'show'
                  if (zIndex!=null) lyr.zIndex = zIndex
                  if (content) {
                          lyr.document.open()
                          lyr.document.write(content)
                          lyr.document.close()
                  }
          }
          else if (ie4) {
                  var str = '\n<DIV id='+id+' style="position:absolute; left:'+left+'; top:'+top+'; width:'+width
                  if (height!=null) {
                          str += '; height:'+height
                          str += '; clip:rect(0,'+width+','+height+',0)'
                  }
                  if (bgColor!=null) str += '; background-color:'+bgColor         
                  if (zIndex!=null) str += '; z-index:'+zIndex
                  if (visibility) str += '; visibility:'+visibility
                  str += ';">'+((content)?content:'')+'</DIV>'
                  if (nestref) {
                          index = nestref.lastIndexOf(".")
                          var nestlyr = (index != -1)? nestref.substr(index+1) : nestref
                          document.all[nestlyr].insertAdjacentHTML("BeforeEnd",str);
                  }
                  else {
                          document.body.insertAdjacentHTML("BeforeEnd",str)
                  }
          }
  }

  function init() {
    if (ns4 || ie4) {
        document.onmousemove = mouseMove
        if (ns4) document.captureEvents(Event.MOUSEMOVE)
        createLayer("cursorDiv", null, null,null,null,null,'',null,'hidden');
        cursor = new DynLayer("cursorDiv");
        cursorActive = false;
        readyToGo = true;
        }
    }

  function showTip(text,title) {
    if (!readyToGo) return false;
    cursorActive = true;
    if (withTitle) {
        if (ns4) {
            cursor.doc.open();
            cursor.doc.write("<TABLE BGCOLOR=000000 CELLPADDING=1 CELLSPACING=0><TR><TD><TABLE WIDTH=" + tipWidth + " BORDER=0 CELLSPACING=0 CELLPADDING=2>" + "<TR><TD BGCOLOR=" + titleBgColor + " VALIGN=top><CENTER><B><FONT SIZE=" + textSize + ">" + title + "</B></CENTER></TR><TR><TD BGCOLOR=" + BgColor + " VALIGN=top><FONT SIZE=" + textSize + ">" + text + "</TR></TABLE></TD></TR></TABLE>")
            cursor.doc.close();
            }

        if (ie4) {
            cursor.event.innerHTML = "<TABLE BGCOLOR=000000 CELLPADDING=1 CELLSPACING=0><TR><TD><TABLE WIDTH=" + tipWidth + " BORDER=0 CELLSPACING=0 CELLPADDING=2>" + "<TR><TD BGCOLOR=" + titleBgColor + " VALIGN=top><CENTER><B><FONT SIZE=" + textSize + ">" + title + "</B></CENTER></TR><TR><TD BGCOLOR=" + BgColor + " VALIGN=top><FONT SIZE=" + textSize + ">" + text + "</TR></TABLE></TD></TR></TABLE>"
            }
        }

    else {
        if (ns4) {
            cursor.doc.open();
            cursor.doc.write("<TABLE BGCOLOR=000000 CELLPADDING=1 CELLSPACING=0><TR><TD><TABLE WIDTH=" + tipWidth + " BORDER=0 CELLPADDING=2><TR><TD BGCOLOR=" + BgColor + " VALIGN=top><FONT SIZE=" + textSize + ">" + text + "</TABLE></TD></TR></TABLE>");
            cursor.doc.close();
            }

        if (ie4) {
            cursor.event.innerHTML = "<TABLE BGCOLOR=000000 CELLPADDING=1 CELLSPACING=0><TR><TD><TABLE WIDTH=" + tipWidth + " BORDER=0 CELLPADDING=2><TR><TD BGCOLOR=" + BgColor + " VALIGN=top><FONT SIZE=" + textSize + ">" + text + "</TABLE></TD></TR></TABLE>";
            }
        }
    setTimeout("if(cursorActive==true) cursor.show()",delayTime);
    }

  function hideTip() {
    if (!readyToGo) return false;
    cursorActive = false;
    cursor.hide();
    tempTrigger = false;
    }

  tempTrigger = false;

  function mouseMove(e) {

    if (cursorActive == true && tempTrigger == false) {
        var x = (ns4)? e.pageX : event.x
        var y = (ns4)? e.pageY : event.y + document.body.scrollTop

        if (tipLocation == 'right') {cursor.moveTo(x+15,y+15);}
        if (tipLocation == 'center') {cursor.moveTo(x-tipWidth/2,y+15);}

        if (cursorFollow == false) tempTrigger = true;
        }

    else if (cursorActive == true && tempTrigger == true) {}

    }

//-->
