$(function(){
      var $mainNavigation = $("#mainNavigation"),
          $current = null;
      
      $mainNavigation.find("li.navitem").each(function(){
         var $this = $(this), 
             $section = $this.find(".section"),
             $a = $this.find("h3 a");
             
         $a.hover(
            function(){ 
               if ($current != null) {
                  if ($current[0] != $section[0]) {
                     $current.hide();
                     $current.parent().find("h3 a").removeClass("selected");
                     $section.show();
                     clearInterval(contentrotator);
                  }
               } else $section.show();
               
               $current = $section;
               $(this).addClass("selected");
            },
            function(){  }
         );
      });
      
      $splashlist = $("#mainNavigation .contentrotator li");
      
      var rotatorindex, contentrotator;
      
      initRotator = function(){
         rotatorindex = 0;
         contentrotator = setInterval(function(){
            var $prev = $current;
            rotatorindex++;
            if (rotatorindex == ($splashlist.length)) {
               //clearInterval(contentrotator);
			   rotatorindex = -1;
               return;
            }
            else {
               $prev.parent().find("h3 a").removeClass("selected");
               $current = $splashlist.eq(rotatorindex);
               
               $prev.fadeOut(1000, function(){
                  $current.fadeIn(1000);
               });
            }
            
         }, 5000);
      }    
      $current = $splashlist.eq(0).fadeIn(1000);
      initRotator();
   })