// this file specifies JS functions that should be applied to all pages of the webapp
$(document).ready(function() {

  $("ul#main_nav li").hoverIntent( function() { navHoverOver(this); } , function() { null; } );
  $("#nav").hoverIntent( function() { null; } , function() { navHoverOff( null ); } );

  var slideSequenceTime = 7000;
  $(document).everyTime(slideSequenceTime, function() { imageSlideForward(); } );
});

function imageSlideForward() {
  var thisSlideOn = $(".slide_on");
  
  thisSlideOn.removeClass("slide_on");
  thisSlideOn.hide();
  
  if (thisSlideOn.attr("id").split("_")[1] == (thisSlideOn.siblings().size() + 1)) {
    $("#slideshowImage_1").addClass("slide_on");
    $("#slideshowImage_1").fadeIn('slow');
  } else {
    thisSlideOn.next().addClass("slide_on");
    thisSlideOn.next().fadeIn('slow');
  }
}

