var dir = 1;
var dir_rem = 0;
var move_flag=1;

total_w = $('move_txt_id').getWidth(); 	

$("move_txt_id").style.left=$('main_id').getWidth();

function img_onload()
{	
	x =$("move_txt_id").style.left;
	
	if(x=="")	x=0;
	else x=x.replace("px", "");
	
	y=parseInt(x);

	if (y > -total_w) 
		dir = -1;
		
	if (y < -total_w) 
	{
		$("move_txt_id").style.left=$('main_id').getWidth();
		y=parseInt($("move_txt_id").style.left);
	}
	
	$("move_txt_id").style.left = dir + y +"px";
	
	//$("move_txt_id").innerHTML= "<span>y="+y+" total="+total_w+"</span>  "+ txt +"  <span>y="+y+" total="+total_w+"</span>";
	if(move_flag==1)
	{
		window.setTimeout('img_onload()', 30);
	}
}

function stop(flag)
{
	move_flag=flag;
	if(move_flag==1)
	{
		window.setTimeout('img_onload()', 30);
	}
}


img_onload();

/*
var dir = 1;
var dir_rem = 0;
document.getElementById("move_txt_id").style.left=$('main_id').getWidth();
//alert($('move_txt_id').getWidth())
function img_onload()
{	
	x =document.getElementById("move_txt_id").style.left;
	if(x=="")	x=0;
	else x=x.replace("px", "");
	
	y=parseInt(x);
	
	if (y>=(total_w - 312)) dir = -1;
	if (y<=0) dir = 1;
	document.getElementById("move_txt_id").style.left = dir + y +"px";
	window.setTimeout('img_onload()', 30);
}

function stop(xx)
{
	if (xx==0)
	{
		dir_rem = dir;
		dir = 0;
	}
	else dir = dir_rem;
}

total_w = 620; 	

img_onload();
*/
