
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Personal", "Personal", "");
addOption(document.drop_list.Category, "Commercial", "Commercial", "");
//addOption(document.drop_list.Category, "Life", "Life", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "", "");

if(document.drop_list.Category.value == 'Personal'){
addOption(document.drop_list.SubCat,"http://www.ajins.com/auto.html", "Auto");
addOption(document.drop_list.SubCat,"http://www.ajins.com/home.html", "Home");
addOption(document.drop_list.SubCat,"http://www.ajins.com/renters.html", "Renters");
addOption(document.drop_list.SubCat,"http://www.ajins.com/condo.html", "Condo");
addOption(document.drop_list.SubCat,"http://www.ajins.com/earthquake.html", "Earthquake");
addOption(document.drop_list.SubCat,"http://www.ajins.com/flood.html", "Flood");
addOption(document.drop_list.SubCat,"http://www.ajins.com/motorcycle.html", "Motorcycle");
addOption(document.drop_list.SubCat,"http://www.ajins.com/motormobilehome.html", "Motor Home");
addOption(document.drop_list.SubCat,"http://www.ajins.com/boats.html", "Boats");
addOption(document.drop_list.SubCat,"http://www.ajins.com/umbrella.html", "Umbrella");
}
if(document.drop_list.Category.value == 'Commercial'){
addOption(document.drop_list.SubCat,"http://www.ajins.com/commercialauto.html", "Commercial Auto");
addOption(document.drop_list.SubCat,"http://www.ajins.com/commercialproperty.html", "Commercial Property");
addOption(document.drop_list.SubCat,"http://www.ajins.com/generalliability.html", "General Liability");
addOption(document.drop_list.SubCat,"http://www.ajins.com/workerscompensation.html", "Workers Compensation");
addOption(document.drop_list.SubCat,"http://www.ajins.com/epli.html", "EPLI");
addOption(document.drop_list.SubCat,"http://www.ajins.com/businessowners.html", "Business Owners");
addOption(document.drop_list.SubCat,"http://www.ajins.com/professionalliability.html", "Professional Liability");
addOption(document.drop_list.SubCat,"http://www.ajins.com/directorsandofficersliab.html", "Directors and Officers");
}

}
//if(document.drop_list.Category.value == 'Life'){
//addOption(document.drop_list.SubCat,"http://www.quotit.net/WebSites/ajia/", "Life");
//addOption(document.drop_list.SubCat,"http://www.quotit.net/WebSites/ajia/", "Health");
//addOption(document.drop_list.SubCat,"http://www.ajins.com/longterm.html", "Long Term");
//}


////////////////// 

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);
}

