var timer, timer2, timer3, timer4, timer5, timer6, timer7, timer8;

function getNumFromPx(inp)
{
	return inp.substring(0,inp.length-2);
}
function moveup() 
{
	if (document.getElementById('f-item1').style.top=='') 
	{
		document.getElementById('f-item1').style.top='180px';
		clearTimeout(timer2);
	}
	if (getNumFromPx(document.getElementById('f-item1').style.top)>0) 
	{
		clearTimeout(timer2);
		document.getElementById('f-item1').style.top=getNumFromPx(document.getElementById('f-item1').style.top)-10+'px';
 	 	timer=setTimeout("moveup()",50);
 	}
}

function movedown() 
{
	if (getNumFromPx(document.getElementById('f-item1').style.top)<180) 
	{
		clearTimeout(timer);
		var num=parseInt(getNumFromPx(document.getElementById('f-item1').style.top));
		num=num+10;
		document.getElementById('f-item1').style.top=num+'px';
		timer2=setTimeout("movedown()",50);
	 }
}
function moveup2() 
{
	if (document.getElementById('f-item2').style.top=='') 
	{
		document.getElementById('f-item2').style.top='180px';
		clearTimeout(timer4);
	}
	if (getNumFromPx(document.getElementById('f-item2').style.top)>0) 
	{
		clearTimeout(timer4);
		document.getElementById('f-item2').style.top=getNumFromPx(document.getElementById('f-item2').style.top)-10+'px';
 	 	timer3=setTimeout("moveup2()",50);
 	}
}

function movedown2() 
{
	if (getNumFromPx(document.getElementById('f-item2').style.top)<180) 
	{
		clearTimeout(timer3);
		var num=parseInt(getNumFromPx(document.getElementById('f-item2').style.top));
		num=num+10;
		document.getElementById('f-item2').style.top=num+'px';
		timer4=setTimeout("movedown2()",50);
	 }
}
function moveup3() 
{
	if (document.getElementById('f-item3').style.top=='') 
	{
		document.getElementById('f-item3').style.top='180px';
		clearTimeout(timer6);
	}
	if (getNumFromPx(document.getElementById('f-item3').style.top)>0) 
	{
		clearTimeout(timer6);
		document.getElementById('f-item3').style.top=getNumFromPx(document.getElementById('f-item3').style.top)-10+'px';
 	 	timer5=setTimeout("moveup3()",50);
 	}
}

function movedown3() 
{
	if (getNumFromPx(document.getElementById('f-item3').style.top)<180) 
	{
		clearTimeout(timer5);
		var num=parseInt(getNumFromPx(document.getElementById('f-item3').style.top));
		num=num+10;
		document.getElementById('f-item3').style.top=num+'px';
		timer6=setTimeout("movedown3()",50);
	 }
}
function moveup4() 
{
	if (document.getElementById('f-item4').style.top=='') 
	{
		document.getElementById('f-item4').style.top='180px';
		clearTimeout(timer8);
	}
	if (getNumFromPx(document.getElementById('f-item4').style.top)>0) 
	{
		clearTimeout(timer8);
		document.getElementById('f-item4').style.top=getNumFromPx(document.getElementById('f-item4').style.top)-10+'px';
 	 	timer7=setTimeout("moveup4()",50);
 	}
}

function movedown4() 
{
	if (getNumFromPx(document.getElementById('f-item4').style.top)<180) 
	{
		clearTimeout(timer7);
		var num=parseInt(getNumFromPx(document.getElementById('f-item4').style.top));
		num=num+10;
		document.getElementById('f-item4').style.top=num+'px';
		timer8=setTimeout("movedown4()",50);
	 }
}
	
