// The code in this file assumes at least three DIV elements exist on the page: // MessagesContaner, MessagesDrawer, and Message1 through MessageN (where N is an // integer between 2 and 99, inclusively) // The messages, one through 99, will scroll (slide) up slowly, pausing at each message. // Through the site properties, you can set the speed of the scroll, the amount of pause // between messages, and the jump or smoothness factor. var intDelay = 3000; // Milleseconds between slidings. var intSpeed = 100; // How many milleseconds a jump should be made var intJump = 1; // How large a jump is (smooth factor) var intTop = 0; // Starting position of all messages. var intMessageCount = 0; // Number of messages var intCurrentMessage = 1; // Message currently being viewed. var intHeight = 0; // Store the offsetHeight, in case it changes. function startScroll() { var n = 1; // Looping variable intHeight = document.all['Message1'].offsetHeight; // Hide the messages that are not currently being displayed by making the clipping window // equal in height to a single message. document.all['MessagesContainer'].style.clip = 'rect(0px 1000px '+intHeight+'px 0px)'; // Loop 1 through 99, seeing how many messages we have to display. intMessageCount = 0; for (n = 1; n < 99; n++) { if (document.all['Message'+n]) { intMessageCount = intMessageCount + 1; } } // After intDelay millseconds, begin moving the messages up. window.setTimeout('moveUp(intJump)', intDelay); } function moveUp(n) { // Determine where the top of the messages should be, after it moves up (n) pixels. intTop = intTop - n; intHeight = document.all['Message1'].offsetHeight; // Set the new top. (perform the physical move) document.all['MessagesDrawer'].style.top = intTop; if (intTop % intHeight == 0) { // If we're at the end of a message... intCurrentMessage++; // If we're NOT at the LAST message... if (intCurrentMessage <= intMessageCount) { // Wait the "long" delay before resuming the slide up. window.setTimeout('moveUp(intJump)', intDelay); } else { // Move the messages back down to the bottom, ready to slide up again. intTop = intHeight; // Return back to the first message intCurrentMessage = 0; // Start the move-up process again. window.setTimeout('moveUp(intJump)', intSpeed); } } else { // Just keep sliding up... window.setTimeout('moveUp(intJump)', intSpeed); } } function initializeScroll() { for (var n = 1; n < 99; n++) { if (document.all['Message'+n]) { var divMessage = document.all['Message'+n]; var strMessage = divMessage.innerHTML; //strMessage = replace(strMessage, '[Document.Referrer]', document.referer); divMessage.innerHTML = strMessage; } } startScroll(); } function replace(strIn, strReplace, strWith) { var strOutput = ''; if (strIn.indexOf(strReplace) > -1) { strOutput = strIn.substr(0, strIn.indexOf(strReplace)) + strWith + strIn.substr(strIn.indexOf(strReplace)+strReplace.length, strIn.length) } return strOutput; } document.writeln('