
 $(document).ready(function(){
	$('.fzoom').fancybox({
		'zoomOpacity' : true,
		 'overlayShow' : true,
		 'zoomSpeedIn' : 300,
		 'zoomSpeedOut' : 300,
		 'overlayOpacity': .3
		 		 });

	switchTo('news');	
	$("#scroller-news-window").scrollable({
		easing: 'swing',
		size: '1',
		items: '#scroller-news-wrap',
		loop: 'true',
		next: '#button-next-project-news' ,
		navi: '#project-dots-news',
		naviItem: 'a',
		keyboard: true,
		speed: '800'
	});	

	$("#scroller-art-window").scrollable({
		easing: 'swing',
		size: '1',
		items: '#scroller-art-wrap',
		loop: 'true',
		next: '#button-next-project-art' ,
		navi: '#project-dots-art',
		naviItem: 'a',
		keyboard: true,			
		speed: '800'
	});				
	$("#scroller-music-window").scrollable({
		easing: 'swing',
		size: '1',
		items: '#scroller-music-wrap',
		loop: 'true',
		next: '#button-next-project-music' ,
		navi: '#project-dots-music',
		naviItem: 'a',
		keyboard: true,			
		speed: '800'
	});	
	$("#scroller-games-window").scrollable({
		easing: 'swing',
		size: '1',
		items: '#scroller-games-wrap',
		loop: 'true',
		next: '#button-next-project-games' ,
		navi: '#project-dots-games',
		naviItem: 'a',
		keyboard: true,			
		speed: '800'
	});	
	$("#scroller-movies-window").scrollable({
		easing: 'swing',
		size: '1',
		items: '#scroller-movies-wrap',
		loop: 'true',
		next: '#button-next-project-movies' ,
		navi: '#project-dots-movies',
		naviItem: 'a',
		keyboard: true,			
		speed: '800'
	});	

			
 	//set up events to handle browsing project categories
    $("#projects .news a ").bind("click", function(){ switchTo("news"); });
    $("#projects .art a ").bind("click", function(){ switchTo("art");});
    $("#projects .music a ").bind("click", function(){ switchTo("music");}); 
    $("#projects .games a ").bind("click", function(){ switchTo("games");}); 
    $("#projects .movies a ").bind("click", function(){ switchTo("movies");}); 
    		
  });
 		
var curSect = "";

function switchTo(which){
	jQuery.easing.def = "easeInOutSine";
	
	h = $(".project").height();  //so we don't have to hardcode the row height;
	if (which == curSect) { return; }  //don't switch if we are on the selected tab
	
	if (which == "news"){
		$(".button-next-project").hide();
		$("#button-next-project-news").show();		
		$(".project-dots").hide();
		$("#project-dots-news").show(300);		
		$("#project-type-nav span").animate({opacity: '.65'}, { "duration": 300 } );	
		$("#project-type-nav a").css("cursor", "pointer");		
		$("#project-type-nav .news a").css("cursor", "default");			
		$("#project-type-nav .current").animate({top: "20px"  }, { "duration": 300 } );
		$("#project-type-nav .news span").animate({opacity: '1.0'}, { "duration": 300 } );
		$("#scroller-vertical").animate({top: '0'}, { "duration": 300 } );
	}
		
	if (which == "art"){
		$(".button-next-project").hide();
		$("#button-next-project-art").show();		
		$(".project-dots").hide();	
		$("#project-type-nav span").animate({opacity: '.65'}, { "duration": 300 } );
		$("#project-type-nav a").css("cursor", "pointer");		
		$("#project-type-nav .art a").css("cursor", "default");					
		$("#project-type-nav .current").animate({ 	top: "75px"   }, { "duration": 300 } );
		$("#project-type-nav .art span").animate({opacity: '1.0'}, { "duration": 300 } );
		$("#scroller-vertical").animate({top: "-"+(h)+"px"}, { "duration": 300 } );
		$("#project-dots-art").show(300);
	}
	
	if (which == "music"){
	
		$(".button-next-project").hide();
		$("#button-next-project-music").show();		
		$(".project-dots").hide();
		$("#project-type-nav span").animate({opacity: '.65'}, { "duration": 300 } );	
		$("#project-type-nav a").css("cursor", "pointer");		
		$("#project-type-nav .music a").css("cursor", "default");				
		$("#project-type-nav .current").animate({ 		top: "121px"	    }, { "duration": 300} );
		$("#project-type-nav .music span").animate({opacity: '1.0'}, { "duration": 300 } );
		$("#scroller-vertical").animate({top: "-"+(h*2)+"px"}, { "duration": 300 } );
		$("#project-dots-music").show(300);	
	}		

	if (which == "games"){
	
		$(".button-next-project").hide();
		$("#button-next-project-games").show();		
		$(".project-dots").hide();
		$("#project-type-nav span").animate({opacity: '.65'}, { "duration": 300 } );	
		$("#project-type-nav a").css("cursor", "pointer");		
		$("#project-type-nav .games a").css("cursor", "default");				
		$("#project-type-nav .current").animate({ 		top: "167px"	    }, { "duration": 300} );
		$("#project-type-nav .games span").animate({opacity: '1.0'}, { "duration": 300 } );
		$("#scroller-vertical").animate({top: "-"+(h*3)+"px"}, { "duration": 300 } );
		$("#project-dots-games").show(300);	
	}		

	if (which == "movies"){
	
		$(".button-next-project").hide();
		$("#button-next-project-movies").show();		
		$(".project-dots").hide();
		$("#project-type-nav span").animate({opacity: '.65'}, { "duration": 300 } );	
		$("#project-type-nav a").css("cursor", "pointer");		
		$("#project-type-nav .movies a").css("cursor", "default");				
		$("#project-type-nav .current").animate({ 		top: "213px"	    }, { "duration": 300} );
		$("#project-type-nav .movies span").animate({opacity: '1.0'}, { "duration": 300 } );
		$("#scroller-vertical").animate({top: "-"+(h*4)+"px"}, { "duration": 300 } );
		$("#project-dots-movies").show(300);	
	}		

	
	curSect = which;

}


