jQuery(function( $ ){

	
	
	
	$('div.pane').scrollTo( 0 );
	// Reset the screen to (0,0)
	$.scrollTo( 0 );
	
		
	var $paneTarget = $('#pane-target');
	var easingFunction = 'easeInOutQuint';
	var scrollSpeed = 800;

	// settings for the main page navigation	
	
	$('#home-selector').click(function(){
		$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');
	 	
		$paneTarget.stop().scrollTo( 'li:eq(0)', scrollSpeed, { 
		easing:easingFunction,
			onAfter:function(){$('#subnav').fadeTo(300,0);}
		});
	 });
	 
	
	$('#photography-selector').click(function(){
	$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(1)', scrollSpeed, { 
		easing: easingFunction,
			onAfter:function(){
				$('#subnav').html('<a style="display:block; width:75px" href="http://exposureroom.com/Sasha_Snow/" target="_blank"><img   style="float:left;" src="/assets/images/xr.png" /></a><ul style="margin-left:-70px;"><li><a href="http://www.sashasnow.com/index.php/photography/photography_broadcast">broadcast</a></li> <span style="color:#f8b407;">&bull;</span> <li><a href="http://www.sashasnow.com/index.php/photography/photography_portrait">portrait</a></li> <span style="color:#f8b407;">&bull;</span> <li><a href="http://www.sashasnow.com/index.php/photography/photography_landscape">landscape</a></li></ul>').fadeTo(0,0).fadeTo(500,1);
				$('#left').text('test');
			
			}
		});
	});
	
	
	
	$('#background-selector').click(function(){
	$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(2)', scrollSpeed, { 
		easing: easingFunction,
			onAfter:function(){$('#subnav').fadeTo(300,0);}
		});
	});
	
	$('#films-selector').click(function(){
	$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(3)', scrollSpeed, { 
		easing: easingFunction,
			onAfter:function(){
				$('#subnav').html('<ul><li><a href="http://www.sashasnow.com/ct/index.html">Conflict Tiger</a></li> <span style="color:#f8b407;">&bull;</span> <li><a href="http://www.sashasnow.com/acap/index.html">Arctic Crime & Punishment</a></li> <span style="color:#f8b407;">&bull;</span> <li><a href="http://www.sashasnow.com/asps/index.html">A St. Petersburg Symphony</a></li></ul>').fadeTo(0,0).fadeTo(500,1);
			}
		});
	});
	
	$('#installations-selector').click(function(){
		$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(4)', scrollSpeed, {
		easing: easingFunction,
			onAfter:function(){$('#subnav').fadeTo(300,0);}
		});
	});
	
	$('#cv-selector').click(function(){
		$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(5)', scrollSpeed, {
		easing: easingFunction,
			onAfter:function(){$('#subnav').fadeTo(300,0);}
		});
	});
	
	$('#contact-selector').click(function(){
		$('.active_links').removeClass('active_links');
	 	$(this).addClass('active_links');

		$paneTarget.stop().scrollTo( 'li:eq(6)', scrollSpeed, {
		easing: easingFunction,
			onAfter:function(){$('#subnav').fadeTo(300,0);}
		});
	});
	
	$('#xr').mouseover(function(){
		$(this).fadeTo(300, 1);
	});
	$('#xr').mouseout(function(){
		$(this).fadeTo(300, 0.3);
	});
});
