var SI_flag;           // setInterval  的回傳值;

MarQ_Width  = 750;     // 呈現的寬度;
pre_Left    = 0;       // 取得新的 scrollLeft : 取得捲軸(拉 Bar )的左邊座標值;
Stop_flag   = false;   // 是否停止的控制旗標;
Move_Speed  = 10;      // 移動速度-每一次執行的秒數;



//***********************************************************************************//
//控制 拉 Bar 的移動方向;
//***********************************************************************************//
function scroll_Move(Move_Way) 
{
   var MQ_obj = document.getElementById('MarQ_Show');

	 if(Stop_flag == true) return;

//	 preLeft = MQ_obj.scrollLeft;
	 if(Move_Way == 'Right')
   	  MQ_obj.scrollLeft -= 2;
  else
   	  MQ_obj.scrollLeft += 2;  	

//   控制 拉 Bar 的 到底時的提示訊息   	 
//	 if(pre_Left == MQ_obj.scrollLeft) {
//      Move_End()
//	   }

}//End of function scroll_Move(Way) ;



//***********************************************************************************//
//控制 拉 Bar 的 往左移;
//***********************************************************************************//
function Move_Left()
{

	 Stop_flag = false;
	 SI_flag   = setInterval("scroll_Move('Left')", Move_Speed);

}//End of function Move_Left();



//***********************************************************************************//
//控制 拉 Bar 的 往右移;
//***********************************************************************************//
function Move_Right()
{

	Stop_flag = false;
	SI_flag   = setInterval("scroll_Move('Right')", Move_Speed);

}//End of function Move_Right();



//***********************************************************************************//
//控制 拉 Bar 的 停止;
//***********************************************************************************//
function Move_stop()
{

	Stop_flag = true;
	clearInterval(SI_flag);

}//End of function Move_stop();



//***********************************************************************************//
//控制 拉 Bar 的 到底時的提示訊息;
//***********************************************************************************//
function Move_End()
{
  alert('已經到底了');
  Move_stop();
	  
}//End of function Move_End();



//***********************************************************************************//
//初始化 拉 Bar -- 給寬度, 並將拉 Bar 設定為不呈現;
//***********************************************************************************//
function MarQ_Show_init() 
{

  var MQ_obj = document.getElementById('MarQ_Show');

  MQ_obj.style.width     = MarQ_Width;
//  MQ_obj.style.overflowX = 'visible';
//  MQ_obj.style.overflowY = 'visible';  
  MQ_obj.style.overflowX = 'hidden';
  MQ_obj.style.overflowY = 'hidden';  
}//End of function MarQ_Show_init() ;

//***********************************************************************************//
//END
//***********************************************************************************//
