function activateNavButtons(activeButton)	{
	$.each(["trailer","screenings","press","thefilm","contact","buydvd","donate"], function(index, value){
		if(value==activeButton) {
			$('#' + value + 'Button').attr('src', '/images/' + value + 'ON');
			$('#' + value + 'A').removeAttr('href');
		} else {
			$('#' + value + 'Button').hover(
				function(){ $('#' + value + 'Button').attr('src', '/images/' + value + 'ON'); }, 
				function(){ $('#' + value + 'Button').attr('src', '/images/' + value + 'OFF'); }
			);
		}
	});
}
function activateContentAndLabels(activeContent)	{
	if(!activeContent) {
		$("#contentLabels span").addClass('selectedLabel').unbind('click');
	} else {
		$("#contentLabels span").removeClass('selectedLabel').click(function(){
			activateContentAndLabels($(this).attr('alt')); setScrollPane();	 $(".scrollPane")[0].scrollTo(0);														
		});
		$("#contentLabels span#" + activeContent + "Label").addClass('selectedLabel').unbind('click');
		$("#content .scrollPane div").hide();
		$("#content .scrollPane div#" + activeContent).show();
	}
}
function setScrollPane(){
	if($(".scrollPane")[0])	$(".scrollPane").jScrollPane({ dragMaxHeight: 30, dragMinHeight: 30, showArrows: true, scrollbarWidth: 30, scrollbarMargin: 37 });
	// handle exceptions for blocks that don't scroll
	if(!$(".jScrollPaneDrag:visible")[0])	{
		if($("#synopsis")[0]) $("#synopsis").width(530);
		if($("#reviews")[0]) $("#reviews").width(530);
		if($("#photos")[0]) $("#photos").width(530);
		if($("#press")[0]) $("#press").width(530);
		if($("#contactFilmmakers")[0]) $("#contactFilmmakers").width(530);
		if($("#distribution")[0]) $("#distribution").width(530);
	}
}
$(document).ready(function(){
	setScrollPane();
	if($("#mailingList")[0]) $("#fireEmail").click(function(){
		$.post('/ajax.php', {action: 'addEmail', email: $("#email").val() }, function(){ $("#mailingList").html("<p id='confirmationMessage'>Welcome to the Fishbone Familyhood. <span>Now get out of your seat and shake that ass!</span></p>"); });
	});
});


