$(document).ready(function(){
	var title = $('#title');
	var navPrev = $('#navPrev');
	var navNext = $('#navNext');
	var position = 1;
	var item = new Array();
	item[1] = $('#item1');
	item[2] = $('#item2');
	item[3] = $('#item3');
	item[4] = $('#item4');
	item[5] = $('#item5');
	item[5].animate({
		'opacity': '0'
	});
	navNext.mouseenter(function(){
		$('#picNext').fadeOut(0);
	});
	navNext.mouseleave(function(){
		$('#picNext').fadeIn(0);
	});

	navPrev.mouseenter(function(){
		$('#picPrev').fadeOut(0);
	});
	navPrev.mouseleave(function(){
		$('#picPrev').fadeIn(0);
	});

	navNext.click(function(){
		if (position == 1)
		{
			position++;
			navPrev.show();
			item[1].animate({
				'opacity': '0'
			});
			item[4].animate({
				'opacity': '1'
			});
			title.animate({
				'margin-left': '-270px'
			});
		}
		else if (position == 2)
		{
			position++;
			$(this).hide();
			item[2].animate({
				'opacity': '0'
			});
			item[5].animate({
				'opacity': '1'
			});
			title.animate({
				'margin-left': '-540px'
			});

		}
	});

	navPrev.click(function(){
		if (position == 2)
		{
			position--;
			$(this).hide();
			item[1].animate({
				'opacity': '1'
			});
			item[4].animate({
				'opacity': '0'
			});
			title.animate({
				'margin-left': '0px'
			});

		}
		else if (position == 3)
		{
			position--;
			navNext.show();
			item[2].animate({
				'opacity': '1'
			});
			item[5].animate({
				'opacity': '0'
			});
			title.animate({
				'margin-left': '-270px'
			});
		}
	});
});
