
function blogroll_switch(link, name) {
	if (!$(link).hasClass('button_active')) {
		$('.home_blogroll_title a').removeClass('button_active');
		$(link).addClass('button_active');
		$('.home_blogroll').hide();
		$('.home_blogroll_' + name).show();
	}
	return false;
}

$(document).ready(function(){
	$('.home_blogroll_title .videos_button').click(function(){
		return blogroll_switch(this, 'videos');
	});
	$('.home_blogroll_title .photos_button').click(function(){
		return blogroll_switch(this, 'photos');
	});
	$('.home_blogroll_title .journal_button').click(function(){
		return blogroll_switch(this, 'journal');
	});
	$('.home_blogroll_title .all_button').click(function(){
		return blogroll_switch(this, 'all');
	});
	
	$('#state_select').change(function(){
			var selected = $('#state_select options:selected');
			if ($(this).val() == 'RI') {
				$('.general_terms').hide();
				$('.fl_terms').hide();
				$('.ny_terms').hide();
				$('.ri_terms').show();
			}
			if ($(this).val() == 'FL') {
			    $('.general_terms').hide();
				$('.ri_terms').hide();
				$('.ny_terms').hide();
				$('.fl_terms').show();
			}
			if ($(this).val() == 'NY') {
			    $('.general_terms').hide();
				$('.ri_terms').hide();
				$('.ny_terms').show();
				$('.fl_terms').hide();
			}
			else {
				$('.ri_terms').hide();
				$('.fl_terms').hide();
				$('.ny_terms').hide();
				$('.general_terms').show();
			}
	});
});
