//BASED ON SUCKERFISH MENU... OLD SCHOOL
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
//window.onload=startList;

//HP Rotator
function theRotator() {
      $('.imgrotator li').css({opacity: 0.0});
      $('.imgrotator li:first').css({opacity: 1.0}).addClass('show');
      $('span.previous').click(function(){
	    rotate()
	    clearInterval(play);
      });
      $('span.next').click(function(){
	    var current = ($('.imgrotator li.show')?  $('.imgrotator li.show') : $('.imgrotator li:first'));
	    var previous = ((current.prev().length) ? ((current.prev().hasClass('show')) ? $('.imgrotator li:last') :current.prev()) : $('.imgrotator li:last'));    
		previous.css({opacity: 0.0}).addClass('show').stop().animate({opacity: 1.0}, 1000);
	    current.stop().animate({opacity: 0.0}, 1000).removeClass('show');
	    clearInterval(play);
      });
      timedRotate()
}

function timedRotate() {
	play = setInterval('rotate()',6000);
};

function rotate() {    
    var current = ($('.imgrotator li.show')?  $('.imgrotator li.show') : $('.imgrotator li:first'));
    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('.imgrotator li:first') :current.next()) : $('.imgrotator li:first'));    
	next.css({opacity: 0.0}).addClass('show').stop().animate({opacity: 1.0}, 1000);
    current.stop().animate({opacity: 0.0}, 1000).removeClass('show');
};

