/*

Steven McTainsh
Portfolio (v22)
JavaScript Functions

Copyright © 2009 Steven McTainsh.

Uses jQuery (jquery.com).

*/

function getNextEntry(current)
{
	var total = $(".entry").size();
	var next = current + 1;
	next = (next > total || next < 1) ? 1 : next;
	$(".entry").hide();
	$("#entry" + next).slideDown();
}

function getPreviousEntry(current)
{
	var total = $(".entry").size();
	var next = current - 1;
	next = (next > total || next < 1) ? 1 : next;
	$(".entry").hide();
	$("#entry" + next).slideDown();
}

function init()
{
	$("#portfolioentry").css("height", "350px");
	$(".entry").hide();
	$("#entry1").show();
	$(".portfolionav").show();
	$(".count").show();
	$.localScroll();
}

function changeYear(year)
{
	$('#years li a').attr('id', '');
	$('#years li#year' + year + ' a').attr('id', 'selected');
	$('#yearLoading').slideDown();
	$.get('getYear.php?year=' + year, function(data) {
			$('#portfolioentry').html(data);
			$('#yearLoading').slideUp();
		});
}

function closeNotice()
{
	$('#notify').fadeOut();
}