$(document).ready(function() { 
	$('ul.sf-menu').superfish();
	$('#homebox1').mouseenter(function(){
	   $('#homebox1 .slideimage').css( { 'opacity' : '0' });
	   $('#homebox1image-large').animate({ opacity: "show" }, "slow");
	   $('#homebox1 .plusbutton').css( { 'display' : 'none' });
	   $('#homebox1 .caption1').css( { 'display' : 'none' });
	   $('#homebox1 .caption2').css( { 'display' : 'block' });
	    return false;
  }).mouseleave(function(){
   		$('#homebox1 .slideimage').css( { 'opacity' : '1' });
   		$('#homebox1image-large').animate({ opacity: "hide" }, "slow");
   		$('#homebox1 .plusbutton').css( { 'display' : 'block' });
   		$('#homebox1 .caption1').css( { 'display' : 'block' });
   		$('#homebox1 .caption2').css( { 'display' : 'none' });
   		return false;
  });
  	$('#homebox2').mouseenter(function(){
	   $('#homebox2 .slideimage2').css( { 'opacity' : '0' });
	   $('#homebox2image-large').animate({ opacity: "show" }, "slow");
	   $('#homebox2 .plusbutton2').css( { 'display' : 'none' });
	   $('#homebox2 .caption3').css( { 'display' : 'none' });
	   $('#homebox2 .caption4').css( { 'display' : 'block' });
	    return false;
  }).mouseleave(function(){
   		$('#homebox2 .slideimage2').css( { 'opacity' : '1' });
   		$('#homebox2image-large').animate({ opacity: "hide" }, "slow");
   		$('#homebox2 .plusbutton2').css( { 'display' : 'block' });
   		$('#homebox2 .caption3').css( { 'display' : 'block' });
   		$('#homebox2 .caption4').css( { 'display' : 'none' });
   		return false;
  });
  	$('#menu1').mouseenter(function(){
	   $(this).find('#menu-header1').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background-hover.jpg) no-repeat' });
	    return false;
  }).mouseleave(function(){
   		$(this).find('#menu-header1').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background.jpg) no-repeat' });
	    return false;
  });
  	$('#menu2').mouseenter(function(){
	   $(this).find('#menu-header2').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background-hover.jpg) no-repeat' });
	    return false;
  }).mouseleave(function(){
   		$(this).find('#menu-header2').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background.jpg) no-repeat' });
	    return false;
  });
  	$('#menu3').mouseenter(function(){
	   $(this).find('#menu-header3').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background-hover.jpg) no-repeat' });
	    return false;
  }).mouseleave(function(){
   		$(this).find('#menu-header3').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background.jpg) no-repeat' });
	    return false;
  });
  	$('#menu4').mouseenter(function(){
	   $(this).find('#lastmenuitem').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background-hover.jpg) no-repeat' });
	    return false;
  }).mouseleave(function(){
   		$(this).find('#lastmenuitem').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background.jpg) no-repeat' });
	    return false;
  });
  	$('#help').mouseenter(function(){
	   $(this).find('#help-header').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background-hover.jpg) no-repeat' });
	    return false;
  }).mouseleave(function(){
   		$(this).find('#help-header').css( { 'background' : 'url(http://broadriver.us/images/site/menu-background.jpg) no-repeat' });
	    return false;
  });
    $("SELECT").selectBox();
	$('#loginsubmit').click(function(){
		$(this).fadeOut(200);
		$('#reallysubmit').fadeIn(1000);
	 });
	$('#registersubmit').click(function(){
		$(this).fadeOut(200);
		$('#reallysubmit2').fadeIn(1000);
	 });
	$('#cancel1').click(function(){
		$('#reallysubmit').fadeOut(200);
		$('#loginsubmit').fadeIn(1000);
	 });
	 $('#cancel2').click(function(){
		$('#reallysubmit2').fadeOut(200);
		$('#registersubmit').fadeIn(1000);
	 });
	 $('#submitbutton').click(function(){
		$('.contactformpart2').show('fast');
		$('.contactformpart3').css( { 'background-color' : '#FFF' });
	 });
	 $('#stafflist ul li a').click(function(){
		$(this).css( { 'font-weight' : 'bold' , 'background' : 'url(images/site/yellow-triangle-alt.png) no-repeat;' });
	 });
	 $('#staff_tooltip').fadeOut(12000, function() {
    // Animation complete.
  	 });
  	 $("#middlecoltext ul").idTabs(); 
}); 

$(window).load(function() {
	$('#slider').nivoSlider({
        effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices: 15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed: 500, // Slide transition speed
        pauseTime: 8000, // How long each slide will show
        startSlide: 0, // Set starting Slide (0 index)
        directionNav: true, // Next & Prev navigation
        directionNavHide: false, // Only show on hover
        controlNavThumbs: true, // Use thumbnails for Control Nav
        controlNavThumbsFromRel: true, // Use image rel for thumbs
        keyboardNav: true, // Use left & right arrows
        pauseOnHover: false, // Stop animation while hovering
        manualAdvance: false, // Force manual transitions
        captionOpacity: 1, // Universal caption opacity
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
    $('#slider2').nivoSlider({
        effect: 'slideRight', // Specify sets like: 'fold,fade,sliceDown'
        slices: 15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed: 1500, // Slide transition speed
        pauseTime: 8000, // How long each slide will show
        startSlide: 0, // Set starting Slide (0 index)
        directionNav: false, // Next & Prev navigation
        directionNavHide: false, // Only show on hover
        controlNav: false,
        controlNavThumbs: false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel: false, // Use image rel for thumbs
        keyboardNav: true, // Use left & right arrows
        pauseOnHover: true, // Stop animation while hovering
        manualAdvance: false, // Force manual transitions
        captionOpacity: 1, // Universal caption opacity
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
    $('#slider3').nivoSlider({
        effect: 'slideRight', // Specify sets like: 'fold,fade,sliceDown'
        slices: 15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed: 1500, // Slide transition speed
        pauseTime: 8000, // How long each slide will show
        startSlide: 0, // Set starting Slide (0 index)
        directionNav: false, // Next & Prev navigation
        directionNavHide: false, // Only show on hover
        controlNav: false,
        controlNavThumbs: false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel: false, // Use image rel for thumbs
        keyboardNav: true, // Use left & right arrows
        pauseOnHover: true, // Stop animation while hovering
        manualAdvance: false, // Force manual transitions
        captionOpacity: 1, // Universal caption opacity
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
});
