
function fillCategory(){ 
 // this function is used to fill the category list on load
 addOption(document.drop_list.Make, "Audi", "Audi", "");
 addOption(document.drop_list.Make, "BMW", "BMW", "");
 addOption(document.drop_list.Make, "Chrysler", "Chrysler", "");
 addOption(document.drop_list.Make, "Mercedes-Benz", "Mercedes-Benz", "");


}

function SelectSubCat(){
// ON selection of make this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Choose Model", "");

if(document.drop_list.Make.value == 'Mercedes-Benz'){
addOption(document.drop_list.SubCat,"mb.asp?model=c230&category=all", "C230 K");
addOption(document.drop_list.SubCat,"mb.asp?model=c320&category=all", "C320");
addOption(document.drop_list.SubCat,"c32.asp?model=c32&category=all", "C32 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=c55&category=all", "C55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=cl55&category=all", "CL55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=cl600&category=all", "CL600");
addOption(document.drop_list.SubCat,"mb.asp?model=cls55&category=all", "CLS55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=clk55&category=all", "CLK55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=e55&category=all", "E55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=s600&category=all", "S600");
addOption(document.drop_list.SubCat,"mb.asp?model=s55&category=all", "S55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=sl55&category=all", "SL55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=slk230&category=all", "SLK230 K");
addOption(document.drop_list.SubCat,"mb.asp?model=slk32&category=all", "SLK32 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=slk55&category=all", "SLK55 AMG");
addOption(document.drop_list.SubCat,"mb.asp?model=sl600&category=all", "SL600");

}

if(document.drop_list.Make.value == 'Chrysler'){
addOption(document.drop_list.SubCat,"chy.asp?model=SRT6&category=all", "Crossfire SRT6");
addOption(document.drop_list.SubCat,"chy-na.asp?model=NA&category=all", "Crossfire NA");


}
if(document.drop_list.Make.value == 'BMW'){
addOption(document.drop_list.SubCat,"BMW-135i.asp?model=135i&category=all", "135i");
addOption(document.drop_list.SubCat,"135i-Tuning.asp", "335i");
addOption(document.drop_list.SubCat,"135i-Tuning.asp", "535i");

}
if(document.drop_list.Make.value == 'Audi'){
addOption(document.drop_list.SubCat,"Audi.asp?model=A4&category=all", "A4 1.8T");
addOption(document.drop_list.SubCat,"Audi.asp?model=A6&category=all", "A6 2.7T");
addOption(document.drop_list.SubCat,"Audi.asp?model=S4&category=all", "S4 2.7T");



}
}
////////////////// 

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);
}

function goTo (page) {
  
	if (page != "" ) {
		if (page == "--" ) {
			removealloptions();
		} else {
			document.location.href = page;
		}
	}
	return false;
}