/*************************************************************** * Floating Top Bar script - Dynamic Drive (www.dynamicdrive.com) * Sliding routine by Roy Whittle (http://www.javascript-fx.com/) * Simplified by !CrazyDavinci! for PunBB Floating Avatar (http://crazydavinci.net) * This notice must stay intact for legal use. * Visit http://www.dynamicdrive.com/ for full source code ***************************************************************/ startX = parseInt(screen.width/2)+480;startY = parseInt(screen.height/2)-110 function iecompattest(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body} function staticbar(){ ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera; d = document; el= d.getElementById("avatar"); barheight= el.offsetHeight; function ml(id){ el.style.cssText="visibility:visible;width:80px";if(d.layers)el.style=el; el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";}; el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight; el.x = startX;el.y -= startY;return el; } window.stayTopLeft=function(){ var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight; ftlObj.y += (pY - startY - ftlObj.y)/8;ftlObj.sP(ftlObj.x, ftlObj.y);setTimeout("stayTopLeft()", 10); } ftlObj = ml("avatar");stayTopLeft(); } if (window.addEventListener) window.addEventListener("load", staticbar, false); else if (window.attachEvent) window.attachEvent("onload", staticbar); else if (document.getElementById) window.onload=staticbar