provided by: 
Originally published at Internet.comHola...
Now it gets hard to describe what's going on because the script is written to have multiple functions interact. So read closely and I apologize for any confusion I'll probably start up.
The Script's Effects
-----------------------------------
Here's the Code
When you click on either the next or previous headline buttons, you enact a function. Those functions look like this:
function chngNext() { document.headline.shownext.value = "Y" headMach(); } function chngPrev() { document.headline.showprev.value = "Y" headMach(); }
Let's say you click on "Next Headline". The function chngNext() fires and the value of one of the hidden fields, "shownext", has its value changed from "N" to "Y".
Then another function, named headMach(), is enacted.
The function chngPrev() runs if the "Previous Headline" button is clicked. It works the same way. The hidden field "showprev" is changed from "N" to "Y" and that headMach() runs.
...but's what's headMach()?
Why, this is headMach():
function headMach() { var totalHeads = 4; //total number of headlines you want if ((document.headline.shownext.value == "Y") && (document.headline.showprev.value == "N")) { var headShow= (parseInt(document.headline.nowShowing.value) +1); if (headShow > totalHeads) { var headShow = 1;} } if ((document.headline.showprev.value == "Y") && (document.headline.shownext.value == "N")) { var headShow= (parseInt(document.headline.nowShowing.value) - 1); if (headShow < 1) { var headShow = totalHeads;} } ...
Read article at Internet.com site