<!--

var marks = new Array();
var substructures = new Array();

var i = 0;

marks['moto']='ABM,ABM|AMS,AMS|Aprilia,Aprilia|Arctic Cat,Arctic Cat|Arlen Ness,Arlen Ness|Benelli,Benelli|BM,BM|Bimota,Bimota|BMW,BMW|Bombardier,Bombardier|Bontrike,Bontrike|Boom,Boom|Boss Hoss,Boss Hoss|BRP,BRP|Buell,Buell|Cagiva,Cagiva|CPI,CPI|CZ,CZ|Derbi,Derbi|DKW,DKW|Ducati,Ducati|Eagle-Wing,Eagl-Wing|Harley-Davidson,Harley-Davidson|Honling,Honling|Honda,Honda|Hyosung,Hyosung|Ilaljet,Ilaljet|Jawa,Jawa|Kazuma,Kazuma|Kawasaki,Kawasaki|Keeway,Keeway|Kinlon,Kinlon|KYMCO,KYMCO|KTM,KTM|Kymco,Kymco|Malaguti,Malaguti|Moto Guzzi,Moto Guzzi|MV Agusta,MV Agusta|MZ,MZ|Nexus,Nexus|Patron,Patron|Peugeot,Peugeot|PGO,PGO|Piaggio,Piaggio|Polaris,Polaris|Royal Enfield,Royal Enfield|Sachs,Sachs|Sagitta,Sagitta|Ski Doo,Ski Doo|Sunner,Sunner|Suzuki,Suzuki|SYM,SYM|TDM,TDM|Toyota,Toyota|Triumph,Triumph|TVS,TVS|Vento,Vento|Vespa,Vespa|Victory,Victory|Yamaha,Yamaha|Wyp-Motor,Wyp-Motor|0,------------|Buran,Áóðàí|Voshod,Âîñõîä|Gaz,ÃÀÇ|Dnepr,Äíåïð|Zid,ÇÈÄ|Zil,ÇÈË|Izh,ÈÆ|Minsk,Ìèíñê|Ris,Ðûñü|Taiga,Òàéãà|Ural,Óðàë|other,ïðî÷åå|';
substructures['moto']='road,Äîðîæíûé|classic,Êëàññèê|cross,Êðîññ|pocketbike,Ìèíèáàéê|chopper,×îïïåð|scooter,Ñêóòåð|sport,Ñïîðò|sport-tourismo,Ñïîðò-òóðèçì|supersport,Ñóïåðñïîðò|touring,Òóðèíã|enduro,Ýíäóðî|other,ïðî÷åå|';

marks['quad']='ABM,ABM|AEON,AEON|AIE,AIE|Aprilia,Aprilia|Arctic Cat,Arctic Cat|Benelli,Benelli|BM,BM|Bimota,Bimota|BMW,BMW|Bombardier,Bombardier|Bontrike,Bontrike|Boom,Boom|CFmoto,CFmoto|Boss Hoss,Boss Hoss|BRP,BRP|Cagiva,Cagiva|CPI,CPI|CZ,CZ|Derbi,Derbi|DKW,DKW|Ducati,Ducati|FLY,FLY|Harley-Davidson,Harley-Davidson|Honling,Honling|Honda,Honda|Ilaljet,Ilaljet|Jawa,Jawa|Kazuma,Kazuma|Kawasaki,Kawasaki|Keeway,Keeway|Kinlon,Kinlon|KYMCO,KYMCO|KTM,KTM|Moto Guzzi,Moto Guzzi|MV Agusta,MV Agusta|MZ,MZ|NEW FORCE,NEW FORCE|Peugeot,Peugeot|Piaggio,Piaggio|Polaris,Polaris|Rewaco,Rewaco|Royal Enfield,Royal Enfield|Sachs,Sachs|Sagitta,Sagitta|Ski Doo,Ski Doo|Sunner,Sunner|Suzuki,Suzuki|SYM,SYM|Toyota,Toyota|Triumph,Triumph|TVS,TVS|Vento,Vento|Yamaha,Yamaha|Wyp-Motor,Wyp-Motor|0,------------|Voshod,Âîñõîä|Gaz,ÃÀÇ|Zid,ÇÈÄ|Zil,ÇÈË|Izh,ÈÆ|Dnepr,Äíåïð|Ural,Óðàë|Buran,Áóðàí|Ris,Ðûñü|Taiga,Òàéãà|other,ïðî÷åå|';
substructures['quad']='quad,Êâàäðîöèêë|trike,Òðèöèêë|';

marks['snow']='ABM,ABM|Aprilia,Aprilia|Arctic Cat,Arctic Cat|Benelli,Benelli|BM,BM|Bimota,Bimota|BMW,BMW|Bombardier,Bombardier|Bontrike,Bontrike|Boom,Boom|Boss Hoss,Boss Hoss|BRP,BRP|Cagiva,Cagiva|CZ,CZ|Derbi,Derbi|DKW,DKW|Ducati,Ducati|Harley-Davidson,Harley-Davidson|Honling,Honling|Honda,Honda|Ilaljet,Ilaljet|Jawa,Jawa|Kazuma,Kazuma|Kawasaki,Kawasaki|Keeway,Keeway|KTM,KTM|Moto Guzzi,Moto Guzzi|MV Agusta,MV Agusta|MZ,MZ|Peugeot,Peugeot|Piaggio,Piaggio|Polaris,Polaris|Royal Enfield,Royal Enfield|Sachs,Sachs|Ski Doo,Ski Doo|Sunner,Sunner|Suzuki,Suzuki|Toyota,Toyota|Triumph,Triumph|Vento,Vento|Yamaha,Yamaha|0,------------|Voshod,Âîñõîä|Gaz,ÃÀÇ|Zid,ÇÈÄ|Zil,ÇÈË|Izh,ÈÆ|Dnepr,Äíåïð|Ural,Óðàë|Buran,Áóðàí|Ris,Ðûñü|Taiga,Òàéãà|other,ïðî÷åå|';
substructures['snow']='snowmobile,Ñíåãîõîä|';

marks['aqua']='ABM,ABM|Aprilia,Aprilia|Arctic Cat,Arctic Cat|Benelli,Benelli|BM,BM|Bimota,Bimota|BMW,BMW|Bombardier,Bombardier|Bontrike,Bontrike|Boom,Boom|Boss Hoss,Boss Hoss|BRP,BRP|Cagiva,Cagiva|CZ,CZ|Derbi,Derbi|DKW,DKW|Ducati,Ducati|Harley-Davidson,Harley-Davidson|Honling,Honling|Honda,Honda|Ilaljet,Ilaljet|Jawa,Jawa|Kazuma,Kazuma|Kawasaki,Kawasaki|Keeway,Keeway|Kinlon,Kinlon|KYMCO,KYMCO|KTM,KTM|Moto Guzzi,Moto Guzzi|MV Agusta,MV Agusta|MZ,MZ|Peugeot,Peugeot|Piaggio,Piaggio|Polaris,Polaris|Royal Enfield,Royal Enfield|Sachs,Sachs|Ski Doo,Ski Doo|Sunner,Sunner|Suzuki,Suzuki|Toyota,Toyota|Triumph,Triumph|TVS,TVS|Vento,Vento|Yamaha,Yamaha|0,------------|Voshod,Âîñõîä|Gaz,ÃÀÇ|Zid,ÇÈÄ|Zil,ÇÈË|Izh,ÈÆ|Dnepr,Äíåïð|Ural,Óðàë|Buran,Áóðàí|Ris,Ðûñü|Taiga,Òàéãà|other,ïðî÷åå|';
substructures['aqua']='jetski,Âîäíûé ìîòîöèêë|';


function GetHtml(descr){          
    var p = document.getElementById("Parser");
    p.innerHTML = descr;    
    return p.innerHTML;
} 

function chooseVT() {
if (document.search.vehicletype_id.value != 0)
     {	
           
	   InitOne(document.search.mark, marks[document.search.vehicletype_id.value],'');
	   InitOne(document.search.type, substructures[document.search.vehicletype_id.value],'');  

     }  
  
    else 
     {
	   document.search.mark.selectedIndex = 0;
	   document.search.mark.length = 1;
	   document.search.type.selectedIndex = 0;
	   document.search.type.length = 1;
    }   
 
	var cboVT=document.getElementById("vehicletype_id")
	var txtTVT=document.getElementById("tvt")
	txtTVT.value = cboVT.options[cboVT.selectedIndex].text;

	document.search.type.disabled=false;
	document.search.mark.disabled=false;
	document.search.model.disabled=false;
	document.search.price_2.disabled=false;

if (document.search.vehicletype_id.value == 0) {
	document.search.type.disabled=true;
	document.search.mark.disabled=true;
	document.search.model.disabled=true;
	document.search.price_2.disabled=true;
	}

	}


function checkVehTypeSelected() {
	if (document.search.vehicletype_id.value==0) {
		alert ("Âûáåðèòå êàòåãîðèþ!");
		return false;
	} else {
		return true;
	}
}

function changevehtype()
{
	var cboST=document.getElementById("type")
	var txtTST=document.getElementById("tst")
	txtTST.value = cboST.options[cboST.selectedIndex].text;
}

function changedmark()
{
	var cboMK=document.getElementById("mark")
	var txtTMK=document.getElementById("tmk")
	txtTMK.value = cboMK.options[cboMK.selectedIndex].text;
}

function InitOne(msel, list, reqstr)
{ 
    var pos,n,m,i;
    var id,descr;
   
    msel.selectedIndex = 0;
    msel.options.length = 1;		
	
    pos = 0;
    i = 1;
    n = list.indexOf('|',pos);

    while (n > 0)
    {
		m = list.indexOf(',',pos);
		id = list.substr(pos, m-pos);
		descr = list.substr(m+1,n-m-1);
             
		i++;
		msel.options.length = i;
		msel.options[i-1].value = id;
		if (msel == document.search.mark) {msel.options[i-1].text = descr;}
		else
		{
			msel.options[i-1].text = GetHtml(descr).replace('&amp;', '&');
		}
		if (reqstr==id) msel.selectedIndex = i - 1; 
		pos = n + 1;
		n = list.indexOf('|',pos);
    }	 	  
}

var thewindow;
function closethewindow(){thewindow.close();}

var current = 0
var x = 0
var speed = 100
var speed2 = 100

function initArray(n) 
{
 this.length = n;
 for (var i =1; i <= n; i++) {this[i] = ' '}
}

typ = new initArray(4)
typ[0]="    " 
typ[1]="    "
typ[2]="    "
typ[3]="    "
function typewrite() 
{  
  var m = typ[current]
  window.status = m.substring(0, x++) + ""
  if (x == m.length + 1) 
  {
   x = 0
   current++
   if (current > typ.length - 1) {current = 0}
   setTimeout("typewrite()", speed2)
  }
  else {setTimeout("typewrite()", speed)}
}
//-->
