var iPos = 1; var newsSlide = new Fx.Slide('newsItem'+iPos); var iTimers = [{},{},{},{},{},{}]; function clearTimers() { clearTimeout(iTimers['doSlideIn']); clearTimeout(iTimers['newsSlide']); clearTimeout(iTimers['moveToNext']); } function fadeLinks (dir) { /* Check dir attribute */ if (dir != 'in' && dir != 'out') { dump('Unknown Fade Direction'); return; } /* Get Link Objects */ oNewsSynopLink=$$('div#newsItem'+iPos+' .newsSynopLink'); /* Fade Links */ if (oNewsSynopLink[0]) oNewsSynopLink[0].fade(dir); if (oNewsSynopLink[1]) oNewsSynopLink[1].fade(dir); if (oNewsSynopLink[2]) oNewsSynopLink[2].fade(dir); } function moveToNext () { /* Slide Box Out */ doSlideOut(); /* Increment Marker */ iPos++; /* Check Marker Exists */ if (!$('newsItem'+iPos)) iPos = 1; /* Clear Previously Set Timers */ clearTimers(); /* Setup Action */ iTimers['doSlideIn'] = setTimeout('doSlideIn();', 750); } function moveToPrev () { /* Slide Box Out */ doSlideOut(); /* Decrease Marker Value */ iPos = iPos - 1; /* Check Marker Exists */ if (!$('newsItem'+iPos)) iPos = numNewsItems; /* Clear Previously Set Timers */ clearTimers(); /* Setup Action */ iTimers['doSlideIn'] = setTimeout('doSlideIn();', 750); } function moveToLatest() { /* Slide Box Out */ doSlideOut(); /* Reset Marker Value */ iPos = 1; /* Clear Previously Set Timers */ clearTimers(); /* Setup Action */ iTimers['doSlideIn'] = setTimeout('doSlideIn();', 750); } function doSlideOut () { /* Call Fade Out Function */ fadeLinks('out'); /* Slide Box Out */ newsSlide.slideOut(); } function doSlideIn () { /* Set Display Attribute */ /* Update newsSlide */ newsSlide = new Fx.Slide('newsItem'+iPos); /* Replace sIFR Text */ if (displaySIFR && hasFlash) { sIFR.replaceElement("h2", named({sFlashSrc: "flash/halvett.swf", sColor: "#cc9933",sWmode: "transparent"})); sIFR.replaceElement("h5.footerText", named({sFlashSrc: "flash/halvett.swf", sColor: "",sWmode: "transparent"})); } /* Slide Box In */ setTimeout("newsSlide.slideIn();",85); setTimeout("fadeLinks('in');",175); /* Recurring Event */ iTimers['moveToNext'] = setTimeout('moveToNext()', 40000);} iTimers['moveToNext'] = setTimeout("moveToNext()", 40000);