

/*
	thanks to Dan Steinman for his niffty path tool
	http://www.dansteinman.com/dynduo/duopath/duopath.html
	
	coz precalculated is faster, faster, faster
*/
	var duoPathBookshelf2Text = new Array(-197,-184,-170,-154,-137,-119,-101,-84,-68,-53,-41,-29,-20,-12,-5,-0,3,5,6,6,5,4,2,0);
	var duoPathBookshelf2Visual = new Array(-197,-198,-199,-200,-201,-201,-201,-200,-198,-195,-190,-185,-177,-169,-158,-145,-130,-113,-94,-75,-55,-35,-17,0);
	
	var duoPathCertified2Text = new Array(0,-15,-33,-52,-72,-93,-114,-133,-151,-167,-180,-191,-201,-208,-214,-218,-221,-223,-223,-223,-222,-221,-220,-218,-218);
	var duoPathCertified2Visual = new Array(0,0,2,3,4,5,5,5,3,0,-4,-10,-17,-27,-38,-51,-67,-85,-104,-125,-146,-166,-185,-203,-218);
	
	var pathIndex=0; 
	var moveID=null;
	
	delay=1;

// == certified ===============================
		
	function moveCertified2Text()
	{
		clearTimeout(moveID);
		var xPos = duoPathCertified2Text[pathIndex];
		pathIndex+=1;
		document.getElementById('certified').style.left=xPos+"px";
		
		if(pathIndex<duoPathCertified2Text.length-1)
		{
			moveID=setTimeout("moveCertified2Text()",delay);
		}
		else
		{
			document.getElementById("back").style.display="block";
		}
	}
	
	function moveCertified2Visual()
	{
		clearTimeout(moveID);
		
		if(document.getElementById("back").style.display=="block")
		{
			document.getElementById("back").style.display="none";
		}
		var xPos = duoPathCertified2Visual[pathIndex];
		pathIndex-=1;
		document.getElementById('certified').style.left=xPos+"px";
		
		if(pathIndex>0){
			moveID=setTimeout("moveCertified2Visual()",delay);
		}
	}
	
// == bookshelf ===============================		

	function moveBookshelf2Text()
	{
		clearTimeout(moveID);
		var yPos = duoPathBookshelf2Text[pathIndex];
		pathIndex+=1;
		document.getElementById('bookshelf').style.top=yPos+"px";
		
		if(pathIndex<duoPathBookshelf2Text.length-1)
		{
			moveID=setTimeout("moveBookshelf2Text()",delay);
		}
		else
		{
			document.getElementById("back").style.display="block";
		}
	}
	
	function moveBookshelf2Visual()
	{
		clearTimeout(moveID);
		if(document.getElementById("back").style.display=="block")
		{
			document.getElementById("back").style.display="none";
		}
		var yPos = duoPathBookshelf2Visual[pathIndex];
		pathIndex-=1;
		document.getElementById('bookshelf').style.top=yPos+"px";
		
		if(pathIndex>0){
			moveID=setTimeout("moveBookshelf2Visual()",delay);
		}
	}
	
// ====================================

