function showcurrent(id,stop)
{	
	$(".images").hide();
	$("#big" + id).fadeIn();
	$("#current").val(id);
}

var play = $("#statuss").val();
var min = 0;
var max = $(".images").size() - 1;
var now = 0;

function stopslides() 
{
	$("#statuss").val(0);
}

function startslides()
{
	$("#statuss").val(1);
	switchimages(0,0);
}

function switchimages(x)
{
	var play = $("#statuss").val();
	if(play == 0)
	{
	 return;
	}
	if(x>max) {
		x = min;
	}
	showcurrent(x);
	var next = x +1;
	if(play == 1) 
	{
		var stop = 0;
	}
	else
	{
		var stop = 1;
	}	
		setTimeout("switchimages(" + next + ", " + stop + ")", 4500);
}

function shownext()
{
	$("#statuss").val("0");
	var min = 0;
	var stop = 1;
	var max = $(".images").size() - 1;
	var now = $("#current").val();
	var next = parseInt(now) + 1;
	if(next > max) 
	{
		next = min;
	}
	showcurrent(next, stop);
	
}

function showprev()
{
	$("#statuss").val("0");
	var min = 0;
	var stop = 1;
	var max = $(".images").size() - 1;
	var now = $("#current").val();
	var prev = parseInt(now) - 1;
	if(prev < min) 
	{
		prev = max;
	}
	showcurrent(prev, stop);
	
}


switchimages(0, 0);