// NOTE: this file needs point.js which is included below
function browserObj() {
this.platform = ''
this.version = 0
this.isNav4 = false
this.isNav6 = false
this.isIE4 = false
this.isIE = false
this.isMoz = false
this.isSafari = false
this.isMajor = false
this.isMinor = false
this.agent = navigator.appName.toLowerCase()
if (navigator.appVersion.indexOf('Mac') != -1) {
this.platform = "mac"
} else {
this.platform = "pc"
}
//if (this.platform == 'mac') { alert(navigator.appName + ',' + navigator.appVersion + ',' + navigator.userAgent) }
//var isNav4, isNav6, isIE4, isMajor, isMinor;
if (this.agent.indexOf('safari') != -1) {
this.isMajor = true
this.isSafari = true
} else if (this.agent.indexOf('gecko') > -1) {
if (this.agent.indexOf('netscape') > -1) {
this.isNav6 = true
this.isMajor = true
this.isGood = true
} else {
this.isMajor = true
this.isMoz = true
this.isGood = true
}
} else if (this.agent.indexOf('gecko') > -1) {
if (this.agent.indexOf('netscape') > -1) {
this.isNav6 = true
this.isMajor = true
this.isGood = true
} else {
this.isMajor = true
this.isMoz = true
this.isGood = true
}
} else if (this.agent.indexOf('netscape') > -1) {
if (navigator.appVersion.charAt(0) > "4") {
this.version = 6
this.isNav6 = true
this.isMajor = true
} else {
this.version = 4
this.isNav4 = true;
this.isMinor = true
}
} else {
this.isIE = true
var uA = navigator.userAgent.toLowerCase()
var ind = uA.indexOf("msie")
uA = uA.substr(ind, uA.length)
ind = uA.indexOf(";")
uA = parseFloat(uA.substr(0, ind).replace("msie", ""))
if (uA >= 5) {
this.version = uA
this.isMajor = true
} else {
this.version = uA
this.isIE4 = true;
this.isMinor = true
}
}
}
var browserProps = new browserObj()
function getAbsolutePos (who, debug) {
var x = 0;
var y = 0;
if (!browserProps.isNav4) {
while (who.offsetParent != null) {
if (debug) { alert(who + ',' + who.id + ',' + who.offsetParent + ',' + who.offsetParent.tagName + ',' + who.offsetParent.offsetParent) }
x += who.offsetLeft
y += who.offsetTop
who = who.offsetParent
}
x += who.offsetLeft
y += who.offsetTop
} else {
x = who.x
y = who.y
}
return new pointObj(x, y)
}
function pointObj(x, y) {
this.x = x
this.y = y
this.toString = function() {
return 'point object\nx:' + this.x + ',y:' + this.y
}
}
// End point.js
/* This mouse.js file invokes a mouse object inherently; it is deprecated, in favor of mouse.2.js, which provides a getMouse() function to invoke the mouse object */
var browserProps = new browserObj()
//Netscape 6
if ( !document.all ) {
if (window.addEventListener) {
window.addEventListener("mousemove",watchMouseCoords,true)
}
}
//IE 5+
if (document.attachEvent) {
document.attachEvent("onmousemove",watchMouseCoords)
}
//IE4
if (browserProps.isIE4) {
document.onmousemove = watchMouseCoords
}
//Netscape 4
if (browserProps.isNav4) {
window.onmousemove = watchMouseCoordsNN
captureEvents(Event.MOUSEMOVE);
}
//Mac
if (browserProps.platform == "mac") {
//alert("mac")
document.onmousemove = watchMouseCoords
}
function mouseMove(e) {
watchMouseCoordsNN(e)
}
var mouse = new pointObj(0,0);
var m_xOff, m_yOff, m_ev, m_isStandard;
function watchMouseCoords(e) {
//m_ev = ((browserProps.isMajor)&&(browserProps.platform != "mac")) ? e : event
m_ev = e || event;
if (browserProps.isNav6) { // need to catch the various implementations of scrollTop
m_yOff = window.pageYOffset;
m_xOff = window.pageXOffset;
} else {
/* Need to account for quirks vs. strict mode; strict puts everything onto documentElement */
isStandard = (document.compatMode && document.compatMode == "CSS1Compat") ? true : false;
/*if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollTop == 0)) {*/
if (isStandard) {
//window.status = 'strict';
m_yOff = document.documentElement.scrollTop;
} else {
//window.status = 'non strict';
m_yOff = document.body.scrollTop;
}
//window.status = m_yOff;
if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollLeft == 0)) {
m_xOff = document.documentElement.scrollLeft;
} else {
m_xOff = document.body.scrollLeft;
}
}
if (browserProps.isSafari) { m_yOff = 0 };
mouse.x = m_ev.clientX + m_xOff
mouse.y = m_ev.clientY + m_yOff
if (mouse.callback) { mouse.callback() }
//window.status = mouse.x + ',' + mouse.y
}
function watchMouseCoordsNN(e) {
mouse.x = e.pageX
mouse.y = e.pageY
if (mouse.NNcallback) { mouse.NNcallback() }
}