/ * Movable_Layer.js * requires a layer in the document, ID is Floter * / var lastscrollx, lastscrolly;
function heartBeat () {if (IE) {diffY = document.body.scrollTop; diffX = document.body.scrollLeft;} if (NS) {diffY = self.pageYOffset; diffX = self.pageXOffset;} if (diffY =! Lastscrolly) {percent = .1 * (DIFFY - Lastscrolly); if (Percent> 0) Percent = math.ceil (percent); else percent = math.floor (percent); if (ie) document.all.floater.style .pixeltop = percent; if (ns) Document.floater.top = percent; Lastscrolly = lastscrolly percent;}}}}}}}}}}}}}}} (DiffX! = Lastscrollx) {Percent = .1 * (Diffx - lastscrollx); if (Percent> 0 ); Else Percent = math.floor (percent); if (ie) document.all.floater.style.pixelleft = percent; if (ns) Document.floater.Left = percent; lastScrollX = lastScrollX percent;}} function checkFocus (x, y) {stalkerx = document.floater.pageX; stalkery = document.floater.pageY; stalkerwidth = document.floater.clip.width; stalkerheight = document.floater.clip.height; if ((x> stalkerx && x <(stalkerx stalkerwidth)) && (y> stalkery && y <(stalkery stalkerheight))) return true; else return false;} function grabIt (e) {IF (IE) {whichit = event.srcelement; while (whichit.id.indexof ("floater") == -1) {Whichit = Whichit.parentelement; if (Whichit == null) {Return True; }} Whichit.style.pixelleft = whichit.offsetleft; Whichit.Style.pixeltop = whichit.offSettop; currentx = (Event.ClientX
document.body.scrollLeft); currentY = (event.clientY document.body.scrollTop);} else {window.captureEvents (Event.MOUSEMOVE); if (checkFocus (e.pageX, e.pageY)) {whichIt = document .floater; StalkerTouchedX = e.pageX-document.floater.pageX; StalkerTouchedY = e.pageY-document.floater.pageY;}} return true;} function moveIt (e) {if (whichIt == null) {return false; } IF (ie) {newx = (event.clientx document.body.scrollleft); newy = (event.clienty document.body.scrolltop); distancex = (newx - currentx); distancey = (newy - currenty); currentX = newX; currentY = newY; whichIt.style.pixelLeft = distanceX; whichIt.style.pixelTop = distanceY; if (whichIt.style.pixelTop
Self.pagexoffset) Whichit.Left = 0 Self.pagexoffset; if (Whichit.top <0 Self.pageyoffset) Whichit.top = 0 Self.pageyoffset; IF ((Whichit.left Whichit.clip.width> = (Window.innerWidth Self.pagexoffset-17)) Whichit.LEFT = (WINDOW.INNERWIDTH SELF.PAGEXOFFSET) -Whichit.Clip.width) -17; if ((Whichit.top Whichit.clip. HEIGHT) > = (Window.innerHeight Self.pageyoffset-17)) Whichit.top = (WINDOW.INNERHEIGHT SELF.PAGEYOFFSET) -Whichit.clip.Height) -17; return false;} Return False;} Function Dropit () {whichIt = null; if (NS) window.releaseEvents (Event.MOUSEMOVE); return true;} function FloatDiv () {self.onError = null; currentX = currentY = 0; whichIt = null; lastScrollX = 0; lastScrollY = 0 NS = (Document.Layers)? 1: 0; IE = (Document.all)? 1: 0; IF (ns) {WINDOW .captureevents (event.mouseup | Event.mousedown); window.onmousedown = grabit; window.onmousemove = moveit; window.onm OUSEUP = Dropit;} if (ie) {document.onmousedown = grabit; document.onmousemove = moveit; document.onmouseup = dropit;} if (ns || ie) action = WINDOW.SetInterval ("HeartBeat ()", 1) ;
}