var c=0;
var t=0;
var pos=0;
var act=1;
var ncx=0;
function posTG(act){
	var cx=1;
	cx=-(act*270)+270; //Set Position
	document.getElementById('posTG').style.left=c+"px";
	/* Display Calculate
		document.getElementById('txt2').value=ncx;	
		document.getElementById('txt1').value=cx;
		document.getElementById('txt').value=c;
	*/
	if(ncx>cx){
		t=setTimeout("posTG(act)",10);
		c=c-45;
		if(c<cx){stopCount();}
	}else if(ncx<cx){
		t=setTimeout("posTG(act)",10);	
		c=c+45;
		if(c>cx){ stopCount();}
		ncx=cx;
	}
	ncx=c;
}
function stopCount(){clearTimeout(t);}