function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=400,height=600,scrollbars=yes');
return false;
}

//----------------------------------------------------------------------------------------

function fillCategory(val){ 
 	// this function is used to fill the category list on load
	addOption(document.form.make, "VW", "Volkswagen", "");
	addOption(document.form.make, "Audi", "Audi", "");
	addOption(document.form.make, "BMW", "BMW", "");
	addOption(document.form.make, "other_make", "Other...", "");
	addOption(document.form.model, "--", "--", "");
}

function SelectSubCat(val)
{
	// ON selection of category this function will work

	removeAllOptions(document.form.model);
	addOption(document.form.model, "", "", "");
	
	if(document.form.make.value == 'VW')
	{
		var o = document.getElementById('otheroption');
		o.style.display = 'none';
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
		
		addOption(document.form.model, "337", "337", "");
		addOption(document.form.model, "20th", "20th AE", "");
		addOption(document.form.model, ".:R32", ".:R32", "");
		addOption(document.form.model, "Golf", "Golf", "");
		addOption(document.form.model, "GTI", "GTI", "");
		addOption(document.form.model, "Rabbit", "Rabbit", "");
		addOption(document.form.model, "Jetta", "Jetta", "");
		addOption(document.form.model, "New Beetle", "New Beetle", "");
		addOption(document.form.model, "Passat", "Passat", "");
		addOption(document.form.model, "Touareg", "Touareg", "");
		addOption(document.form.model, "Tiguan", "Tiguan", "");
		addOption(document.form.model, "Corrado", "Corrado", "");
		addOption(document.form.model, "Scirocco", "Scirocco", "");
		addOption(document.form.model, "EOS", "EOS", "");
		addOption(document.form.model, "CabrioIII", "Cabrio III", "");
		addOption(document.form.model, "Eurovan", "Eurovan", "");
		addOption(document.form.model, "Phaeton", "Phaeton", "");
		addOption(document.form.model, "other_model", "Other...", "");
	}
	if(document.form.make.value == 'Audi')
	{
		var o = document.getElementById('otheroption');
		o.style.display = 'none';
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
		
		addOption(document.form.model, "100", "100", "");
		addOption(document.form.model, "200", "200", "");
		addOption(document.form.model, "4000", "4000", "");
		addOption(document.form.model, "5000", "5000", "");
		addOption(document.form.model, "80", "80", "");
		addOption(document.form.model, "90", "90", "");
		addOption(document.form.model, "A3", "A3", "");
		addOption(document.form.model, "A4", "A4", "");
		addOption(document.form.model, "A5", "A5", "");
		addOption(document.form.model, "A6", "A6", "");
		addOption(document.form.model, "A8", "A8", "");
		addOption(document.form.model, "Allroad Quattro", "Allroad Quattro", "");
		addOption(document.form.model, "Cabriolet", "Cabriolet", "");
		addOption(document.form.model, "Coupe", "Coupe", "");
		addOption(document.form.model, "Q5", "Q5", "");
		addOption(document.form.model, "Q7", "Q7", "");
		addOption(document.form.model, "Quattro", "Quattro", "");
		addOption(document.form.model, "R8", "R8", "");
		addOption(document.form.model, "RS 4", "RS4", "");
		addOption(document.form.model, "RS 6", "RS6", "");
		addOption(document.form.model, "RS 5", "RS5", "");
		addOption(document.form.model, "S4", "S4", "");
		addOption(document.form.model, "S5", "S5", "");
		addOption(document.form.model, "S6", "S6", "");
		addOption(document.form.model, "S8", "S8", "");
		addOption(document.form.model, "TT", "TT", "");
		addOption(document.form.model, "V8 Quattro", "V8 Quattro", "");
		addOption(document.form.model, "other_model", "Other...", "");
	}
	if(document.form.make.value == 'BMW')
	{
		var o = document.getElementById('otheroption');
		o.style.display = 'none';
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
		
		addOption(document.form.model, "BMW 2002", "BMW 2002", "");
		addOption(document.form.model, "1 Series", "1 Series", "");
		addOption(document.form.model, "3 Series", "3 Series", "");
		addOption(document.form.model, "5 Series", "5 Series", "");
		addOption(document.form.model, "6 Series", "6 Series", "");
		addOption(document.form.model, "7 Series", "7 Series", "");
		addOption(document.form.model, "8 Series", "8 Series", "");
		addOption(document.form.model, "M Series", "M Series", "");
		addOption(document.form.model, "X Series", "X Series", "");
		addOption(document.form.model, "Z Series", "Z Series", "");
		addOption(document.form.model, "other_model", "Other...", "");
	}
	if(document.form.make.value == 'other_make')
	{
		var o = document.getElementById('otheroption');
		o.style.display = 'none';
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
		
		addOption(document.form.model,"other_model", "Other...");
		var o = document.getElementById('otheroption');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'other_make')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
	}
	if(document.form.make.value == '')
	{
		var o = document.getElementById('otheroption');
		o.style.display = 'none';
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
		addOption(document.form.model, "--", "--", "");
	}
}
////////////////// 

function SelectSubCat2(val)
{
	// ON selection of category this function will work
	removeAllOptions(document.form.generation);
	addOption(document.form.generation, "", "", "");
	
	if(document.form.model.value == '')
	{
		var o = document.getElementById('otheroption2');
		o.style.display = 'none';
		var o = document.getElementById('genlevel');
		o.style.display = 'none';
	}
	
	//=======================================================
	// Place in Here all values that do not have generations
	//=======================================================
	
	//Volkswagen ----------
	if(document.form.model.value == '337'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '20th'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'New Beetle'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Tiguan'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Corrado'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'EOS'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'CabrioIII'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Eurovan'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Phaeton'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
		
	//Audi ----------
	if(document.form.model.value == '100'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '200'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '4000'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '5000'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '80'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == '90'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'A3'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'A5'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'A8'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}	
	if(document.form.model.value == 'Allroad Quattro'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Cabriolet'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Coupe'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Q5'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Q7'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'Quattro'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'R8'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'RS 6'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'RS 5'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}	
	if(document.form.model.value == 'S4'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'S5'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'S8'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
	if(document.form.model.value == 'V8 Quattro'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}
		
	//BMW ---------
	
	if(document.form.model.value == 'BMW 2002'){	
		var o = document.getElementById('genlevel');
		o.style.display = 'none';}

	//=======================================================
	//        Volkswagen Generation Selections
	//=======================================================

	if(document.form.model.value == 'other_model')
	{
		//addOption(document.form.model,"other", "Other");
		var o = document.getElementById('otheroption2');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'other_model')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}		
	}
	
	if(document.form.model.value == '.:R32')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '.:R32')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk4", "Mk4 (2004)", "");
		addOption(document.form.generation, "Mk5", "Mk5 (2007+)", "");
	}
	
	if(document.form.model.value == 'Golf')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Golf')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk2", "Mk2", "");
		addOption(document.form.generation, "Mk3", "Mk3", "");
		addOption(document.form.generation, "Mk4", "Mk4", "");
	}
	
	if(document.form.model.value == 'GTI')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'GTI')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk1", "Mk1", "");
		addOption(document.form.generation, "Mk2", "Mk2", "");
		addOption(document.form.generation, "Mk3", "Mk3", "");
		addOption(document.form.generation, "Mk4", "Mk4", "");
		addOption(document.form.generation, "Mk5", "Mk5", "");
	}
		
	if(document.form.model.value == 'Rabbit')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Rabbit')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk1", "Mk1", "");
		addOption(document.form.generation, "Mk5", "Mk5", "");
	}	
	
	if(document.form.model.value == 'Jetta')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Jetta')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk1", "Mk1", "");
		addOption(document.form.generation, "Mk2", "Mk2", "");
		addOption(document.form.generation, "Mk3", "Mk3", "");
		addOption(document.form.generation, "Mk4", "Mk4", "");
		addOption(document.form.generation, "Mk5", "Mk5", "");
	}
	
	if(document.form.model.value == 'Passat')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Passat')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "B3", "B3", "");
		addOption(document.form.generation, "B4", "B4", "");
		addOption(document.form.generation, "B5", "B5", "");
		addOption(document.form.generation, "B6", "B6", "");
	}
	
	if(document.form.model.value == 'Touareg')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Touareg')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Touareg 1", "Touareg 1", "");
		addOption(document.form.generation, "Touareg 2", "Touareg 2", "");
	}
	
	if(document.form.model.value == 'Scirocco')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Scirocco')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk1", "Mk1", "");
		addOption(document.form.generation, "Mk2", "Mk2", "");
	}
	
	//=======================================================
	//              Audi Generation Selections
	//=======================================================
	
	if(document.form.model.value == 'A4')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'A4')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "B5", "B5", "");
		addOption(document.form.generation, "B6", "B6", "");
		addOption(document.form.generation, "B7", "B7", "");
		addOption(document.form.generation, "B8", "B8", "");
	}
	
	if(document.form.model.value == 'A6')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'A6')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "C4", "C4", "");
		addOption(document.form.generation, "C5", "C5", "");
		addOption(document.form.generation, "C6", "C6", "");
	}
	
	if(document.form.model.value == 'RS 4')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'RS 4')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "B5", "B5", "");
		addOption(document.form.generation, "B7", "B7", "");
	}
	
	if(document.form.model.value == 'S6')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'S6')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "C4", "C4", "");
		addOption(document.form.generation, "C5", "C5", "");
		addOption(document.form.generation, "C6", "C6", "");
	}
	
	if(document.form.model.value == 'TT')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'TT')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "Mk1", "Mk1", "");
		addOption(document.form.generation, "Mk2", "Mk2", "");
	}
	
	//=======================================================
	//              BMW Series Selections
	//=======================================================

	if(document.form.model.value == '1 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '1 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "128i", "128i", "");
		addOption(document.form.generation, "135i", "135i", "");
	}
	
	if(document.form.model.value == '3 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '3 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}	
		//removeAllOptions(document.form.generation);
		addOption(document.form.generation, "318i", "318i", "");
		addOption(document.form.generation, "318iC", "318iC", "");
		addOption(document.form.generation, "318iS", "318iS", "");
		addOption(document.form.generation, "318ti", "318ti", "");
		addOption(document.form.generation, "320i", "320i", "");
		addOption(document.form.generation, "323ci", "323ci", "");
		addOption(document.form.generation, "323i", "323i", "");
		addOption(document.form.generation, "323iT", "323iT", "");
		addOption(document.form.generation, "323ic", "323ic", "");
		addOption(document.form.generation, "323is", "323is", "");
		addOption(document.form.generation, "325", "325", "");
		addOption(document.form.generation, "325Ci", "325Ci", "");
		addOption(document.form.generation, "325e", "325e", "");
		addOption(document.form.generation, "325i", "325i", "");
		addOption(document.form.generation, "325iC", "325iC", "");
		addOption(document.form.generation, "325iT", "325iT", "");
		addOption(document.form.generation, "325iX", "325iX", "");
		addOption(document.form.generation, "325is", "325is", "");
		addOption(document.form.generation, "325xi", "325ixi", "");
		addOption(document.form.generation, "325xiT", "325xiT", "");
		addOption(document.form.generation, "328Ci", "328Ci", "");
		addOption(document.form.generation, "328i", "328i", "");
		addOption(document.form.generation, "328iC", "328iC", "");
		addOption(document.form.generation, "328iS", "328iS", "");
		addOption(document.form.generation, "328xi", "328xi", "");
		addOption(document.form.generation, "330Ci", "330Ci", "");
		addOption(document.form.generation, "330i", "330i", "");
		addOption(document.form.generation, "330xi", "330xi", "");
		addOption(document.form.generation, "335d", "335d", "");
		addOption(document.form.generation, "335i", "335i", "");
		addOption(document.form.generation, "335xi", "335xi", "");
	}
	
	if(document.form.model.value == '5 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '5 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "524td", "524td", "");
		addOption(document.form.generation, "525i", "525i", "");
		addOption(document.form.generation, "525iT", "525iT", "");
		addOption(document.form.generation, "525xi", "525xi", "");
		addOption(document.form.generation, "528e", "528e", "");
		addOption(document.form.generation, "528i", "528i", "");
		addOption(document.form.generation, "528iT", "528iT", "");
		addOption(document.form.generation, "528xi", "528xi", "");
		addOption(document.form.generation, "530i", "530i", "");
		addOption(document.form.generation, "530iT", "530iT", "");
		addOption(document.form.generation, "530xi", "530xi", "");
		addOption(document.form.generation, "533i", "533i", "");
		addOption(document.form.generation, "535i", "535i", "");
		addOption(document.form.generation, "535xi", "535xi", "");
		addOption(document.form.generation, "540i", "540i", "");
		addOption(document.form.generation, "540iT", "540iT", "");
		addOption(document.form.generation, "550I", "550I", "");
	}
	
	
	if(document.form.model.value == '6 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '6 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "633CSi", "633CSi", "");
		addOption(document.form.generation, "635CSi", "635CSi", "");
		addOption(document.form.generation, "645Ci", "645Ci", "");
		addOption(document.form.generation, "650CI", "650CI", "");
		addOption(document.form.generation, "650CIC", "650CIC", "");
	}
	
	if(document.form.model.value == '7 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '7 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "733i", "733i", "");
		addOption(document.form.generation, "735i", "735i", "");
		addOption(document.form.generation, "735iL", "735iL", "");
		addOption(document.form.generation, "740i", "740i", "");
		addOption(document.form.generation, "740iL", "740iL", "");
		addOption(document.form.generation, "745Li", "745Li", "");
		addOption(document.form.generation, "750i", "750i", "");
		addOption(document.form.generation, "750iL", "750iL", "");
		addOption(document.form.generation, "760Li", "760Li", "");
		addOption(document.form.generation, "760i", "760i", "");
		addOption(document.form.generation, "Alpina B7", "Alpina B7", "");
	}
	
	if(document.form.model.value == '8 Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == '8 Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "840Ci", "840Ci", "");
		addOption(document.form.generation, "850CSi", "850CSi", "");
		addOption(document.form.generation, "850Ci", "850Ci", "");
		addOption(document.form.generation, "850i", "850i", "");
	}
	
	if(document.form.model.value == 'L Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'L Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "L6", "L6", "");
		addOption(document.form.generation, "L7", "L7", "");
	}
	
	if(document.form.model.value == 'M Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'M Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "M Coupe", "M Coupe", "");
		addOption(document.form.generation, "M Roadster", "M Roadster", "");
		addOption(document.form.generation, "M3", "M3", "");
		addOption(document.form.generation, "M5", "M5", "");
		addOption(document.form.generation, "M6", "M6", "");
	}
	
	if(document.form.model.value == 'X Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'X Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "X3", "X3", "");
		addOption(document.form.generation, "X5", "X5", "");
		addOption(document.form.generation, "X6", "X6", "");
	}
	
	if(document.form.model.value == 'Z Series')
	{
		var o = document.getElementById('genlevel');
		//(val == 'other')? o.style.display = 'block' : o.style.display = 'none';
		if(val == 'Z Series')
		{
			o.style.display = 'block';
		}
		else
		{
			o.style.display = 'none';
		}
		
		addOption(document.form.generation, "Z3", "Z3", "");
		addOption(document.form.generation, "Z4", "Z4", "");
		addOption(document.form.generation, "Z8", "Z8", "");
	}
	
		//addOption(document.form.generation, "", "", "");
}
////////////////// 

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, optin)
{
	//var select = document.forms.form.elements.make;
	//select.options[select.optin.length] = new Option('text', 'value');
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}