//alert("here");
function  fillCategory(){ 
 // this function is used to fill the makes list on load
addOption(document.form1.makes, "Brochure", "Brochure", "");
addOption(document.form1.makes, "Datasheets", "Datasheets", "");
addOption(document.form1.makes, "Applications_Notes", "Applications_Notes", "");
}



function  SelectSubCat(){
	
	
// ON selection of makes this function will work

removeAllOptions(document.form1.models);
addOption(document.form1.models, "", "Product...", "");

if(document.form1.makes.value == 'Brochure'){
addOption(document.form1.models,"fontus_corporate.pdf", "Corporate Brochure");
addOption(document.form1.models,"BBG_brochure.pdf", "Building Brochure");
addOption(document.form1.models,"CFG.pdf", "Chemicals & Services Brochure");
addOption(document.form1.models,"Ergo_RO.pdf", "ergo RO");
addOption(document.form1.models,"ergo_softening.pdf", "ergo Softners");
addOption(document.form1.models,"industrial_brochure.pdf", "Industrial Brochure");
addOption(document.form1.models,"automobile_brochure.pdf", "Automotive Brochure");

}
if(document.form1.makes.value == 'Datasheets'){
addOption(document.form1.models,"#", "Sewage Treatment");
addOption(document.form1.models,"Fontus_filter.pdf", "Standard Packaged Filter");
addOption(document.form1.models,"Fontus_RO.pdf", "Standard Packaged RO");
addOption(document.form1.models,"Fontus_softner.pdf", "Standard Packaged Softner");

}
if(document.form1.makes.value == 'Applications_Notes'){
addOption(document.form1.models,"hotel.pdf", "Hotels");


}
}
////////////////// 

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);
}

