/*
 *  Defines the layer object
 *  Copyright (c) 2001 Glimpse
 *  To be used with the Glimpse PHP Library
 */

function GLIMPSE_MOUSE_ENGINE() {
	this.toCall = new Array()
	this.x = 0
	this.y = 0
	this.down = false
}

function GLIMPSE_MOUSE_ENGINE_updateCoords(e) {
  var mouse = eval(_mouseObjectName)
  if (IE) {
    mouse.x = parseInt(event.x+document.body.scrollLeft)
    mouse.y = parseInt(event.y+document.body.scrollTop)
  }
  if (NS4 || NS6) {
    mouse.x = parseInt(e.pageX)
    mouse.y = parseInt(e.pageY)
  }
  for (var i=0; i<mouse.toCall.length; i++) eval(mouse.toCall[i])
}
GLIMPSE_MOUSE_ENGINE.prototype.updateCoords = GLIMPSE_MOUSE_ENGINE_updateCoords

function GLIMPSE_MOUSE_ENGINE_registerOnMouseMove(code) {
  var mouse = eval(_mouseObjectName)
	for (var i=0; i<mouse.toCall.length; i++) if (mouse.toCall[i] == code) return
	mouse.toCall[mouse.toCall.length] = code
}
GLIMPSE_MOUSE_ENGINE.prototype.registerOnMouseMove = GLIMPSE_MOUSE_ENGINE_registerOnMouseMove