/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Fang | http://www.webdeveloper.com/forum/showthread.php?t=191419Licensed under: Public Domain
 */

function postNews2() {
  aLI2=document.getElementById('news2').getElementsByTagName('li');
  for(var i=0; i<aLI2.length; i++)  {
    aLI2[i].style.display="none";
    aLI2[i].getElementsByTagName('p')[0];
  }
  rotate2(aLI2.length-1);
};

var aLI2=[];
var timerRUN2=null;
var Speed2=5000; // change as required

function rotate2(idx2) {
  aLI2[idx2].style.display="none";
  idx2=(idx2<aLI2.length-1)? ++idx2 : 0;
  aLI2[idx2].style.display="block";
  timerRUN2=setTimeout('rotate2('+idx2+')', Speed2);
}

function inView2() {
  var newsItem2=0;
  for(var i=0; i<aLI2.length; i++) {
    if(aLI2[i].style.display=="block") {newsItem2= i;}
  }
  return newsItem2;
}


function addLoadEvent2(func) {
  var oldonload2 = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload2) {
        oldonload2();
      }
      func();
    }
  }
}

addLoadEvent2(function() {
  postNews2();
});


