var s1_h = 68;		// These must (approximately) match the actual heights of the slices
var s2_h = 52;
var s3_h = 220;

var s1_y = (0);		// These must match the starting Y offsets in index.html
var s2_y = (-20);
var s3_y = (-40);

// These are the target (final) offsets
var s1_tgt_y = (-95);
var s2_tgt_y = (-200);
var s3_tgt_y = (-280);

var s1_task;
var s2_task;
var s3_task;

function setup_slices( )
{
	if (document.getElementById)
		{
		slice1 = document.getElementById("first");
		slice2 = document.getElementById("second");
		slice3 = document.getElementById("third");
	
		s1_task = window.setInterval("nudge_s1()",190);
		s2_task = window.setInterval("nudge_s2()",100);
		s3_task = window.setInterval("nudge_s3()",75);
		//s1_task = window.setInterval("nudge_s1()",20);
		//s2_task = window.setInterval("nudge_s2()",15);
		//s3_task = window.setInterval("nudge_s3()",10);
		}
}

function nudge_s1( )
{
	if ( s1_y > s1_tgt_y )
		{
		s1_y -= 1;
		slice1.style.backgroundPosition = "0 "+s1_y+"px";
		}
	else
		{
		window.clearInterval(s1_task);
		}
}

function nudge_s2( )
{
	if ( s2_y > s2_tgt_y )
		{
		s2_y -= 1;
		slice2.style.backgroundPosition = "0 "+s2_y+"px";
		}
	else
		{
		window.clearInterval(s2_task);
		}
}

function nudge_s3( )
{
	if ( s3_y > s3_tgt_y )
		{
		s3_y -= 1;
		slice3.style.backgroundPosition = "0 "+s3_y+"px";
		}
	else
		{
		window.clearInterval(s3_task);
		}
}

