
/** Code to run on page load, including image rollovers and anything else fancy */
function page_setup() 
{
	if(page_setup_fired) return false;
	
	page_setup_fired = true;
	
	$('#mainmenu').hrmenu();
	
	if( $('.recentProjects .wrapper').eq(0).length > 0 )
	{
		$('.recentProjects .wrapper').eq(0)
			.after('<div class="cycleControls"><a class="cyclePrev" href="#" title="Previous Photo">&lt;</a><a class="cycleNext" href="#" title="Next Photo">&gt;</a><span class="cycleNav"></span></div>')
			.cycle({ 
				fx		: 'fade', 
				speed	: 1500, 
				timeout	: 4000, 
				pager	: '.cycleNav' ,
				next	: '.cycleNext', 
				prev	: '.cyclePrev',
				pause	: 1
			});
	}
	
	if( $('.projectShowcase .wrapper').eq(0).length > 0 )
	{
		$('.projectShowcase .wrapper').eq(0)
			.after('<div class="cycleControls"><a class="cyclePrev" href="#" title="Previous Photo">&lt;</a><a class="cycleNext" href="#" title="Next Photo">&gt;</a><span class="cycleNav"></span></div>')
			.cycle({ 
				fx		: 'fade', 
				speed	: 1500, 
				timeout	: 4000, 
				pager	: '.cycleNav' ,
				next	: '.cycleNext', 
				prev	: '.cyclePrev',
				pause	: 1
			});
	}

	return false;
	
	if( $('.flash').eq(0).length > 0 )
	{
		$('.flash').anythingSlider({
			easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 3000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 600,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             // Start text
			stopText: "Stop"               // Stop text
			//navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
		});
	}
	
	$('.featuredProjects ul li').each( function(){
	
		$(this).hover(function(){
		
			$('.recentProjectContentWrapper', $(this)).eq(0).slideDown();
		
		}, function(){
		
			$('.recentProjectContentWrapper', $(this)).eq(0).slideUp();
		
		});
		
		var href = $('.recentProjectLink', $(this)).attr('href');
		
		$(this).click(function(){
		
			location.href = href;
		
		});
	
	});
	
}

var page_setup_fired = false;
$(document).ready(page_setup);
