Message Slideshow

A form box message slideshow rotates among any number of messages. Each message is associated with a unique URL, and clicking the button will take the surfer to a different URL, depending on when the surfer clicks it.


What's On Update


<SCRIPT>

// initialize to -1 because it immediately gets set to 0 by the slidemessage()
// this then brings up message 0
// curmsg is also a Global variable that is used by the Take me there! button at the bottom

var
curmsg = -1;

// create the message array
var messages = new Array();

//add more messages as desired
messages[0] = "Check out CNN, one of the premier news site on the net, covering national international, sports, and wheather news!";
messages[1] = "Visit Wired.com for the latest happenings in the technology sector.";
messages[2] = "Go to download.com to download the latest shareware and demo programs!";

// create the links array
var msgLinks = new Array();

msgLinks[0] = "http://www.cnn.com";
msgLinks[1] = "http://www.wired.com";
msgLinks[2] = "http://www.download.com";

function slidemessage() {
     // the array index (curmsg) can only goes from 0 to 2 (messages.length - 1)
     // if curmsg greater than the 2 reset the counter back to 0 & start the cycle over again

     if (
curmsg < messages.length - 1) curmsg++;
     else
curmsg = 0;

     // put the new message into the TextArea
     document.slideshow[0].value = messages[
curmsg];

     // waiting time is set to 4.5 seconds before you call slidemessage()
    
setTimeout("slidemessage()", 4500);
}

</SCRIPT>

after the document is loaded call the slidemessage() function
<
BODY onLoad="slidemessage()">

<FORM NAME="slideshow">
     What's On Update
     <
TEXTAREA></TEXTAREA>
onClick you are taken to the link associated with that particular message
     <
INPUT TYPE="button" VALUE="Take me there!" onClick="location.href=msgLinks[curmsg]">
</
FORM>