var DEBUG= 0;//режим работы


function sf(txt)
{
 document.write(txt);
};

var mleft=-780;
var mleft_step=156;


function sw_model_name(n)
{
 
 for(i in cmi){
	k=String(parseInt(i)+1);
   document.all["model"+k].src="/i/"+cmi[i]+".gif";
   document.getElementById("cmn"+k).className="hide";
   document.getElementById("cm"+k).className="hide";
 };

 document.getElementById("cmn"+n).className="act";
 document.all["model"+n].src="/i/"+cmi[n-1]+"_.gif";
 document.all["cm"+n].className="act";
 
 mleft=-780;
 mleft_step=156;

 document.all["cm"+n].style.left=mleft+"px";

};

function swm(n,n2)
{
 if (n2==2)
  {
   document.all.D.className="d";
   document.all.carhead2.style.display="block";
   document.all.carhead.style.display="none";
  }
   else
  {
   document.all.carhead2.style.display="none";
   document.all.carhead.style.display="block";
   document.all.D.className="";
  };


  if(DEBUG==1) alert(1);
  
 sw_model_name(n);
 move_start(n);
};


function move_start(n)
{
 if (mleft>-5)
  {
   mleft=0;
   document.all["cm"+n].style.left="0px";
  }
   else
  {
   mleft_step=Math.abs(Math.round(mleft/5));
   if (mleft+mleft_step>=0) mleft=0; else mleft=mleft+mleft_step;
   document.getElementById("cm"+n).style.left=mleft+"px";
   setTimeout('move_start('+n+')',10);
  };
}

