
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Alfa Romeo", "Alfa Romeo", "");
addOption(document.drop_list.Category, "Audi", "Audi", "");
addOption(document.drop_list.Category, "BMW", "BMW", "");
addOption(document.drop_list.Category, "Citroen", "Citroen", "");
addOption(document.drop_list.Category, "Daewoo", "Daewoo", "");
addOption(document.drop_list.Category, "Fiat", "Fiat", "");
addOption(document.drop_list.Category, "Ford", "Ford", "");
addOption(document.drop_list.Category, "Honda", "Honda", "");
addOption(document.drop_list.Category, "Landrover", "Landrover", "");
addOption(document.drop_list.Category, "Lexus", "Lexus", "");
addOption(document.drop_list.Category, "Mazda", "Mazda", "");
addOption(document.drop_list.Category, "Mitsubishi", "Mitsubishi", "");
addOption(document.drop_list.Category, "Nissan", "Nissan", "");
addOption(document.drop_list.Category, "Peugeot", "Peugeot", "");
addOption(document.drop_list.Category, "Renault", "Renault", "");
addOption(document.drop_list.Category, "Rover", "Rover", "");
addOption(document.drop_list.Category, "Seat", "Seat", "");
addOption(document.drop_list.Category, "Subaru", "Subaru", "");
addOption(document.drop_list.Category, "Suzuki", "Suzuki", "");
addOption(document.drop_list.Category, "Toyota", "Toyota", "");
addOption(document.drop_list.Category, "Vauxhall", "Vauxhall", "");
addOption(document.drop_list.Category, "Volkswagen", "Volkswagen", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Select Model", "");

if(document.drop_list.Category.value == 'Alfa Romeo'){
addOption(document.drop_list.SubCat,"145", "145");
addOption(document.drop_list.SubCat,"146", "146");
addOption(document.drop_list.SubCat,"155", "155");
addOption(document.drop_list.SubCat,"156", "156");
addOption(document.drop_list.SubCat,"164", "164");
addOption(document.drop_list.SubCat,"166", "166");
addOption(document.drop_list.SubCat,"Spider", "Spider");
}
if(document.drop_list.Category.value == 'Audi'){
addOption(document.drop_list.SubCat,"80", "80");
addOption(document.drop_list.SubCat,"A2", "A2");
addOption(document.drop_list.SubCat,"A3", "A3");
addOption(document.drop_list.SubCat,"A4", "A4");
addOption(document.drop_list.SubCat,"A6", "A6");
addOption(document.drop_list.SubCat,"Roadster", "Roadster");
addOption(document.drop_list.SubCat,"S3", "S3");
addOption(document.drop_list.SubCat,"TT", "TT");
}
if(document.drop_list.Category.value == 'BMW'){
addOption(document.drop_list.SubCat,"3 Series 87-91", "3 Series 87-91");
addOption(document.drop_list.SubCat,"3 Series 91-98", "3 Series 91-98");
addOption(document.drop_list.SubCat,"3 Series 98-05", "3 Series 98-05");
addOption(document.drop_list.SubCat,"3 Series Compact (00-03)", "3 Series Compact (00-03)");
addOption(document.drop_list.SubCat,"M3", "M3");
addOption(document.drop_list.SubCat,"M5", "M5");
addOption(document.drop_list.SubCat,"5 Series (87-96)", "5 Series (87-96)");
addOption(document.drop_list.SubCat,"5 Series (96-01)", "5 Series (96-01)");
addOption(document.drop_list.SubCat,"5 Series (01-02)", "5 Series (01-02)");
addOption(document.drop_list.SubCat,"X3)", "X3");
addOption(document.drop_list.SubCat,"X5", "X5");
addOption(document.drop_list.SubCat,"Z3", "Z3");
addOption(document.drop_list.SubCat,"Z4", "Z4");
}
if(document.drop_list.Category.value == 'Citroen'){
addOption(document.drop_list.SubCat,"AX", "AX");
addOption(document.drop_list.SubCat,"Berlingo", "Berlingo");
addOption(document.drop_list.SubCat,"BX", "BX");
addOption(document.drop_list.SubCat,"Saxo", "Saxo");
addOption(document.drop_list.SubCat,"Xantia", "Xantia");
addOption(document.drop_list.SubCat,"Xsara", "Xsara");
}
if(document.drop_list.Category.value == 'Daewoo'){
addOption(document.drop_list.SubCat,"Kalos", "Kalos");
addOption(document.drop_list.SubCat,"Lanos", "Lanos");
addOption(document.drop_list.SubCat,"Matiz", "Matiz");
addOption(document.drop_list.SubCat,"Nexia", "Nexia");
}
if(document.drop_list.Category.value == 'Fiat'){
addOption(document.drop_list.SubCat,"Brava", "Brava");
addOption(document.drop_list.SubCat,"Bravo", "Bravo");
addOption(document.drop_list.SubCat,"Cinquecento", "Cinquecento");
addOption(document.drop_list.SubCat,"Coupe", "Coupe");
addOption(document.drop_list.SubCat,"Panda", "Panda");
addOption(document.drop_list.SubCat,"Punto Mk1", "Punto Mk1");
addOption(document.drop_list.SubCat,"Punto Mk2", "Punto Mk2");
addOption(document.drop_list.SubCat,"Seicento", "Seicento");
addOption(document.drop_list.SubCat,"Stilo", "Stilo");
addOption(document.drop_list.SubCat,"Uno", "Uno");
}
if(document.drop_list.Category.value == 'Ford'){
addOption(document.drop_list.SubCat,"Capri", "Capri");
addOption(document.drop_list.SubCat,"Cortina", "Cortina");
addOption(document.drop_list.SubCat,"Cougar", "Cougar");
addOption(document.drop_list.SubCat,"Escort Mk3", "Escort Mk3");
addOption(document.drop_list.SubCat,"Escort Mk4", "Escort Mk4");
addOption(document.drop_list.SubCat,"Escort Mk5", "Escort Mk5");
addOption(document.drop_list.SubCat,"Escort Mk6", "Escort Mk6");
addOption(document.drop_list.SubCat,"Escort Mk7", "Escort Mk7");
addOption(document.drop_list.SubCat,"Fiesta Mk1", "Fiesta Mk1");
addOption(document.drop_list.SubCat,"Fiesta Mk2", "Fiesta Mk2");
addOption(document.drop_list.SubCat,"Fiesta Mk3", "Fiesta Mk3");
addOption(document.drop_list.SubCat,"Fiesta Mk4", "Fiesta Mk4");
addOption(document.drop_list.SubCat,"Fiesta Mk5", "Fiesta Mk5");
addOption(document.drop_list.SubCat,"Focus", "Focus");
addOption(document.drop_list.SubCat,"Fusion", "Fusion");
addOption(document.drop_list.SubCat,"Galaxy", "Galaxy");
addOption(document.drop_list.SubCat,"Ka", "Ka");
addOption(document.drop_list.SubCat,"Mondeo Mk1", "Mondeo Mk1");
addOption(document.drop_list.SubCat,"Mondeo Mk2", "Mondeo Mk2");
addOption(document.drop_list.SubCat,"Mondeo Mk3", "Mondeo Mk3");
addOption(document.drop_list.SubCat,"Mondeo ST24", "Mondeo ST24");
addOption(document.drop_list.SubCat,"Orion", "Orion");
addOption(document.drop_list.SubCat,"Probe", "Probe");
addOption(document.drop_list.SubCat,"Puma", "Puma");
addOption(document.drop_list.SubCat,"Sierra", "Sierra");
addOption(document.drop_list.SubCat,"S-Max", "S-Max");
}
if(document.drop_list.Category.value == 'Honda'){
addOption(document.drop_list.SubCat,"Accord", "Accord");
addOption(document.drop_list.SubCat,"Civic", "Civic");
addOption(document.drop_list.SubCat,"CR-V", "CR-V");
addOption(document.drop_list.SubCat,"HR-V", "HR-V");
addOption(document.drop_list.SubCat,"Integra", "Integra");
addOption(document.drop_list.SubCat,"Jazz", "Jazz");
addOption(document.drop_list.SubCat,"NSX", "NSX");
addOption(document.drop_list.SubCat,"Prelude 92-", "Prelude 92-");
}
if(document.drop_list.Category.value == 'Landrover'){
addOption(document.drop_list.SubCat,"Discovery", "Discovery");
addOption(document.drop_list.SubCat,"Freelander", "Freelander");
addOption(document.drop_list.SubCat,"Range Rover", "Range Rover");
}
if(document.drop_list.Category.value == 'Lexus'){
addOption(document.drop_list.SubCat,"IS200", "IS200");
addOption(document.drop_list.SubCat,"IS300", "IS300");
addOption(document.drop_list.SubCat,"LS200", "LS200");
addOption(document.drop_list.SubCat,"LS400", "LS400");
}
if(document.drop_list.Category.value == 'Mazda'){
addOption(document.drop_list.SubCat,"3", "3");
addOption(document.drop_list.SubCat,"5", "5");
addOption(document.drop_list.SubCat,"6", "6");
addOption(document.drop_list.SubCat,"323", "323");
addOption(document.drop_list.SubCat,"626", "626");
addOption(document.drop_list.SubCat,"MX3", "MX3");
addOption(document.drop_list.SubCat,"MX5", "MX5");
addOption(document.drop_list.SubCat,"MX6", "MX6");
addOption(document.drop_list.SubCat,"RX7", "RX7");
addOption(document.drop_list.SubCat,"RX8", "RX8");
}
if(document.drop_list.Category.value == 'Mitsubishi'){
addOption(document.drop_list.SubCat,"Colt", "Colt");
addOption(document.drop_list.SubCat,"EVO", "EVO");
addOption(document.drop_list.SubCat,"FTO", "FTO");
addOption(document.drop_list.SubCat,"Galant", "Galant");
addOption(document.drop_list.SubCat,"GTO", "GTO");
addOption(document.drop_list.SubCat,"Lancer", "Lancer");
}
if(document.drop_list.Category.value == 'Nissan'){
addOption(document.drop_list.SubCat,"100NX", "100NX");
addOption(document.drop_list.SubCat,"200SX", "200SX");
addOption(document.drop_list.SubCat,"300ZX", "300ZX");
addOption(document.drop_list.SubCat,"Almera", "Almera");
addOption(document.drop_list.SubCat,"Micra", "Micra");
addOption(document.drop_list.SubCat,"Navara", "Navara");
addOption(document.drop_list.SubCat,"Primera", "Primara");
addOption(document.drop_list.SubCat,"Primera GT", "Primera GT");
addOption(document.drop_list.SubCat,"Terrano", "Terrano");
addOption(document.drop_list.SubCat,"X-Trail", "X-Trail");
}
if(document.drop_list.Category.value == 'Peugeot'){
addOption(document.drop_list.SubCat,"106", "106");
addOption(document.drop_list.SubCat,"107", "107");
addOption(document.drop_list.SubCat,"205", "205");
addOption(document.drop_list.SubCat,"206", "206");
addOption(document.drop_list.SubCat,"207", "207");
addOption(document.drop_list.SubCat,"306", "306");
addOption(document.drop_list.SubCat,"307", "307");
addOption(document.drop_list.SubCat,"309", "309");
addOption(document.drop_list.SubCat,"405", "405");
addOption(document.drop_list.SubCat,"406", "406");
addOption(document.drop_list.SubCat,"407", "407");
}
if(document.drop_list.Category.value == 'Renault'){
addOption(document.drop_list.SubCat,"5", "5");
addOption(document.drop_list.SubCat,"9", "9");
addOption(document.drop_list.SubCat,"19", "19");
addOption(document.drop_list.SubCat,"21", "21");
addOption(document.drop_list.SubCat,"Clio", "Clio");
addOption(document.drop_list.SubCat,"Laguna", "Laguna");
addOption(document.drop_list.SubCat,"Megane", "Megane");
}
if(document.drop_list.Category.value == 'Rover'){
addOption(document.drop_list.SubCat,"25", "25");
addOption(document.drop_list.SubCat,"75", "75");
addOption(document.drop_list.SubCat,"200", "200");
addOption(document.drop_list.SubCat,"400", "400");
addOption(document.drop_list.SubCat,"600", "600");
}
if(document.drop_list.Category.value == 'Seat'){
addOption(document.drop_list.SubCat,"Arosa", "Arosa");
addOption(document.drop_list.SubCat,"Cordoba", "Cordoba");
addOption(document.drop_list.SubCat,"Ibiza", "Ibiza");
addOption(document.drop_list.SubCat,"Leon", "Leon");
addOption(document.drop_list.SubCat,"Toledo", "Toledo");
}
if(document.drop_list.Category.value == 'Subaru'){
addOption(document.drop_list.SubCat,"Forester", "Forester");
addOption(document.drop_list.SubCat,"Impreza (93-99)", "Impreza (93-99)");
addOption(document.drop_list.SubCat,"Impreza (00-)", "Impreza (00-)");
addOption(document.drop_list.SubCat,"Legacy", "Legacy");
}
if(document.drop_list.Category.value == 'Suzuki'){
addOption(document.drop_list.SubCat,"Baleno", "Baleno");
addOption(document.drop_list.SubCat,"Swift (90-)", "Swift (90-)");
addOption(document.drop_list.SubCat,"Vitara", "Vitara");
}
if(document.drop_list.Category.value == 'Toyota'){
addOption(document.drop_list.SubCat,"Avensis", "Avensis");
addOption(document.drop_list.SubCat,"Celica", "Celica");
addOption(document.drop_list.SubCat,"Corolla (87-96)", "Corolla (87-96)");
addOption(document.drop_list.SubCat,"Corolla (97-)", "Corolla (97-)");
addOption(document.drop_list.SubCat,"MR2 Mk1", "MR2 Mk1");
addOption(document.drop_list.SubCat,"MR2 Mk2", "MR2 Mk2");
addOption(document.drop_list.SubCat,"Rav4 (-98)", "Rav4 (-98)");
addOption(document.drop_list.SubCat,"Rav4 (98-)", "Rav4 (98-)");
addOption(document.drop_list.SubCat,"Supra", "Supra");
addOption(document.drop_list.SubCat,"Yaris", "Yaris");
}
if(document.drop_list.Category.value == 'Vauxhall'){
addOption(document.drop_list.SubCat,"Astra Mk3", "Astra Mk3");
addOption(document.drop_list.SubCat,"Astra Mk4", "Astra Mk4");
addOption(document.drop_list.SubCat,"Astra Mk5", "Astra Mk5");
addOption(document.drop_list.SubCat,"Astra Mk6", "Astra Mk6");
addOption(document.drop_list.SubCat,"Calibra", "Calibra");
addOption(document.drop_list.SubCat,"Corsa B", "Corsa B");
addOption(document.drop_list.SubCat,"Corsa C", "Corsa C");
addOption(document.drop_list.SubCat,"Corsa D", "Corsa D");
addOption(document.drop_list.SubCat,"Frontera", "Frontera");
addOption(document.drop_list.SubCat,"Tigra", "Tigra");
addOption(document.drop_list.SubCat,"Nova", "Nova");
addOption(document.drop_list.SubCat,"Vectra B", "Vectra B");
addOption(document.drop_list.SubCat,"Vectra C", "Vectra C");
}
if(document.drop_list.Category.value == 'Volkswagen'){
addOption(document.drop_list.SubCat,"Beetle (00-)", "Beetle (00-)");
addOption(document.drop_list.SubCat,"Bora", "Bora");
addOption(document.drop_list.SubCat,"Corrado", "Corrado");
addOption(document.drop_list.SubCat,"Golf Mk1", "Golf Mk1");
addOption(document.drop_list.SubCat,"Golf Mk2", "Golf Mk2");
addOption(document.drop_list.SubCat,"Golf Mk3", "Golf Mk3");
addOption(document.drop_list.SubCat,"Golf Mk4", "Golf Mk4");
addOption(document.drop_list.SubCat,"Golf Mk5", "Golf Mk5");
addOption(document.drop_list.SubCat,"Passat (94-97)", "Passat (94-97)");
addOption(document.drop_list.SubCat,"Passat (97-00)", "Passat (97-00)");
addOption(document.drop_list.SubCat,"Passat (01-)", "Passat (01-)");
addOption(document.drop_list.SubCat,"Polo", "Polo", "");
}

}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
