var Ver4=parseInt(navigator.appVersion.charAt(0))>=4
var IE=navigator.appName.indexOf("Microsoft")!=-1
var bl, ex=-64, ey=-64, x0=-64, y0=-64

function MoveBat()
{ 
  if (Math.abs(ex-x0)>=10) { x0+=Math.floor((ex-x0)*0.1) }
  else if (ex!=x0) { x0+=Math.abs(ex-x0)/(ex-x0) }
  if (Math.abs(ey-y0)>=10) { y0+=Math.floor((ey-y0)*0.1) }
  else if (ey!=y0) { y0+=Math.abs(ey-y0)/(ey-y0) }

  bl.left=x0-52
  bl.top=y0

  setTimeout("MoveBat();",150)
}

function MouseEvent(e)
{
  if (Ver4)
  { if (!IE)
    { ex=e.pageX
      ey=e.pageY }
    else
    { ex=event.clientX + document.body.scrollLeft
      ey=event.clientY + document.body.scrollTop }
  }
}

function ScriptSetup()

{ isIm = (document.images) ? 1 : 0
  if (isIm)
  { arImLoad = new Array
    ('batani')    
    arImList = new Array ()
    for (counter in arImLoad)
    { arImList[counter] = new Image()
      arImList[counter].src = arImLoad[counter] + '.gif'
    }
  }

  if (Ver4)
  { if (!IE)
    { bl=document.BatLayer
      document.captureEvents(Event.MOUSEMOVE)
    }
    else
    { bl=document.all.BatLayer.style }
    document.onmousemove = MouseEvent
    MoveBat()
  }
}
function ShowBat()
{ 
  if(Ver4)
  { s ='<DIV STYLE="visibility:hidden"></DIV>'
    s+='<DIV ID="BatLayer" STYLE="position:absolute; '
    s+='top:-64; left:-64; width:64; height:64">'
    s+='<IMG NAME="bat" SRC="batani.gif" border=0>'
    s+='</A></DIV>'
    document.writeln(s)
  }
}

window.onload = ScriptSetup
ShowBat()

