//JQuery Setup
$(function() {

 
//Important functions to fire first!
//-------------------------------------------------------------------------------
  	
	//IE6 duct tape
	$('#nav ul li').bind('mouseenter mouseleave', function(){
		$(this).toggleClass('sfhover');
	});
	
	//png fix
	$(document).pngFix();

// Utilities
//-------------------------------------------------------------------------------
	
	//IE6 Upgrade Warning
	//set cookie handler
	var displayAlertBox = $.cookie('ie6_alert_box');
	//if cookie val 'false' then hide message - user has already seen this message!
	if(displayAlertBox == 'false')
	{
		$('#ie_alert').css('display', 'none');
	}
	else
	{
		$('#ie_alert').css('display', 'block');
	}
	//click to close behavior
	$('.ie-alert-link').click(function(){
		$('#ie_alert').slideToggle("slow");
		$.cookie('ie6_alert_box', 'false', { expires: 14 });
	});

	// prettyPhoto
	//-------------------------------------------------------------------------------
		
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		opacity: 0.50, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'facebook' /* light_rounded / dark_rounded / light_square / dark_square / facebook */
	}); 
	
	
//Basic HTML functions
//---------------------------------------------------------------------------------

	// add 'back to top' link when the content is taller than the window
	// this has to be done after flash replacement because the content height changes
	if ($('#content-int').height() > $(window).height()) {
		$('.top-link').removeClass('hide');
	}
	

 

});//end document.ready
