// JavaScript Document

//在庫車両数字
function numImg(n){
len=n.length-1;
for(i=0;i<=len;i++){
k=n.charAt(i);
if(k != ","){
  document.write("<img src='./CommonImages/numimg/" + k +".gif' width='17' height='30'>");
}
}
}


//infomation用
nowInfo = -1;
function loadFunc(){
//0.1秒ごとに移動
myx = 654;//ｘ軸初期値
dist =200;//減速初期速度
dist2 = 10;//加速初期速度
access = 1.3;//減速度or加速度
stoptime = 4000;//静止時間（ミリ秒）
nowInfo = nowInfo + 1
if(nowInfo >= infomationArray.length)nowInfo=0;
mytext = infomationArray[nowInfo];
	if(document.all){
	       document.all("infotext").style.pixelLeft = myx
		   document.all("infotext").innerHTML = mytext
      }else if(document.getElementById){
	       document.getElementById("infotext").style.left = myx + "px"
		   document.getElementById("infotext").innerHTML = mytext
      }
	myID=setInterval("infomationMove()",100)
}



function infomationMove(){
	dist = Math.floor(dist/access)
	if(dist<5)dist=0;
	myx = myx - dist;
	  if(document.all){
	       document.all("infotext").style.pixelLeft = myx
      }else if(document.getElementById){
	       document.getElementById("infotext").style.left = myx + "px"
		  
      }
	  if(dist<5){
	  clearInterval(myID)
	  myID2 = setTimeout("infomationMove2()",stoptime)
	  }
}

function infomationMove2(){
	myID3=setInterval("infomationMove3()",100)
	clearTimeout(myID2)
}

function infomationMove3(){
	dist2 = dist2*access
	myx = myx - dist2;
	  if(document.all){
	       document.all("infotext").style.pixelLeft = myx
      }else if(document.getElementById){
	       document.getElementById("infotext").style.left = myx + "px"
		  
      }
	  if(myx<= -634){
		clearInterval(myID3)  
		  loadFunc()
	  }
}
