function detect_browsers() { isDOM = (document.getElementById) ? 1:0; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+) Explorer4 = (document.all && document.all.item) ? 1:0; //Microsoft Internet Explorer 4+ Netscape = (document.layers) ? 1:0; //Netscape 4.* Opera = (window.opera) ? 1:0; //Opera Opera5 = (Opera && isDOM) ? 1:0; //Opera 5+ Explorer5 = (isDOM && Explorer4) ? 1:0; //MSIE 5+ Konqueror = (isDOM && navigator.appName == 'Konqueror'); // Konqueror Mozilla = (isDOM && !Explorer4 && !Opera) ? 1:0; //Mozilla & Netscape 6.* } function windowPos() { if (Explorer5) { Yp = document.body.scrollTop; } else if (Netscape || Mozilla || Opera5 || Opera || Konqueror) { Yp = self.pageYOffset; } if (Yp != Yb) { smooth = (Yp - Yb) / 10; if (smooth > 0) { smooth = Math.ceil(smooth); } else { smooth = Math.floor(smooth); } if (Explorer5) { document.all.sliding.style.pixelTop += smooth; } else if (Netscape) { document.sliding.top += smooth; } else if (Opera5) { document.getElementById("sliding").style.top = document.getElementById("sliding").style.top + smooth; } else if (Opera || Mozilla || Konqueror) { document.getElementById("sliding").style.top = parseInt(document.getElementById("sliding").style.top) + smooth + "px"; } Yb += smooth; } if (Explorer5) { winWidth = document.body.clientWidth; } else if (Netscape || Mozilla || Opera5 || Opera || Konqueror) { winWidth = window.innerWidth; } if (winWidth < 770) { winWidth = 770; } if (Explorer5) { document.all.sliding.style.pixelLeft = (winWidth/2) + fromCenter; } else if (Netscape) { document.sliding.left = (winWidth / 2) + fromCenter - 6; } else if (Opera5 || Konqueror) { document.getElementById("sliding").pixelLeft = (winWidth / 2) + fromCenter; } else if (Opera || Mozilla) { document.getElementById("sliding").style.left = (winWidth / 2) + fromCenter - 8; } } function sliding_start() { self.onError = null; // ignore errors (FIXME) detect_browsers(); Yb = 0; if (Explorer5) { winWidth = document.body.clientWidth; } if (Netscape || Mozilla || Opera5 || Opera || Konqueror) { winWidth = window.innerWidth; } if (winWidth < 770) { winWidth = 770; } // Default object location for different browsers if (Explorer5) { locationX = Math.floor((winWidth / 2) + fromCenter) - 2; } else if (Netscape) { locationX = (winWidth / 2) + fromCenter - 6; } else if (Opera5 || Konqueror) { locationX = Math.floor((winWidth / 2) + fromCenter); } else if (Opera || Mozilla) { locationX = Math.floor((winWidth / 2) + fromCenter) - 8; } locationY = 6; // from page top // choose right element type for object if (Explorer5 || Mozilla || Opera5 || Opera || Konqueror) { htmltag = '
' + sbanner + '
'; } else if (Netscape) { htmltag = '' + sbanner + ''; } document.write (htmltag); window.setInterval("windowPos()", 10); } var sbanner, sbwidth, sbheight; // 's' is for Sliding // start loop if screen width is bigger then 800 and banner is defined if (screen.width>800 && sbanner && sbwidth && sbheight) { var fromCenter = 386; // Change this to move object left or right var winWidth; sliding_start(); }