$(function(){
  $('a.tab-nav', '#tabbed-collections-nav').click(function(){
    var myHash = this.hash;
    $('.collection-tab', '#tabbed-collections').each(function(){
      if('#'+this.id == myHash){
        $(this).show();
      }else{
      	$(this).hide();
      }
    });
    //$(''+this.hash, '#tabbed-collections').show();
    switch(this.hash){
        case '#photos-tab':
    		$('#tabbed-collections-nav').css({background:"url('../images/site/photo_highlight.png')"});
        	break;
        case '#videos-tab':
    		$('#tabbed-collections-nav').css({background:"url('../images/site/video_highlight.png')"});        
        	break;
        case '#snow-report-tab':
        default:
    		$('#tabbed-collections-nav').css({background:"url('../images/site/snow_highlight.png')"});
    		break;
    }
  	return false;
  });
});

Shadowbox.init({
    language: "en",
    players:    ["img","swf","flv","html"],
    onOpen: function(){
	  pauseSlideShow();
	},
	onClose: function(){
	  resumeSlideShow();
	}
});

function pauseSlideShow(){
     if($('.slideshow').length > 0){
	$('.slideshow').cycle('pause');
     }
}

function resumeSlideShow(){
     if($('.slideshow').length > 0){
	$('.slideshow').cycle('resume');
     }
}

