﻿
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Residential", "Residential", "");
addOption(document.drop_list.Category, "Lodging", "Lodging", "");
addOption(document.drop_list.Category, "Industrial", "Industrial", "");
addOption(document.drop_list.Category, "Office", "Office", "");
addOption(document.drop_list.Category, "Retail", "Retail", "");
addOption(document.drop_list.Category, "Education", "Education", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "SubCat", "");

if(document.drop_list.Category.value == 'Residential'){
addOption(document.drop_list.SubCat,"210", "Single Family Detached");
addOption(document.drop_list.SubCat,"220", "Apartment");
addOption(document.drop_list.SubCat,"230", "Condominium/Townhouse");
addOption(document.drop_list.SubCat,"240", "Mobile Home Park");
document.getElementById('UnitSize').innerHTML="Enter # of Dwelling Units"
}
if(document.drop_list.Category.value == 'Lodging'){
addOption(document.drop_list.SubCat,"310", "Hotel");
addOption(document.drop_list.SubCat,"320", "Motel");
document.getElementById('UnitSize').innerHTML="Enter # of Rooms"
}
if(document.drop_list.Category.value == 'Industrial'){
addOption(document.drop_list.SubCat,"110", "General Light Industrial");
addOption(document.drop_list.SubCat,"120", "General Heavy Industrial");
addOption(document.drop_list.SubCat,"130", "Industrial Park", "");
addOption(document.drop_list.SubCat,"140", "Manufacturing", "");
addOption(document.drop_list.SubCat,"150", "Warehousing", "");
document.getElementById('UnitSize').innerHTML="Enter Square Footage"
}
if(document.drop_list.Category.value == 'Office'){
addOption(document.drop_list.SubCat,"710", "General Office Building");
addOption(document.drop_list.SubCat,"715", "Single Tenant Office Building");
addOption(document.drop_list.SubCat,"720", "Medical-Dental Office Building", "");
addOption(document.drop_list.SubCat,"733", "Government Office Complex", "");
addOption(document.drop_list.SubCat,"750", "Office Park", "");
addOption(document.drop_list.SubCat,"760", "Research and Development Center", "");
addOption(document.drop_list.SubCat,"770", "Business Park", "");
document.getElementById('UnitSize').innerHTML="Enter Square Footage"
}
if(document.drop_list.Category.value == 'Retail'){
addOption(document.drop_list.SubCat,"813", "Free-Standing Discount Superstore");
addOption(document.drop_list.SubCat,"814", "Specialty Retail Center");
addOption(document.drop_list.SubCat,"815", "Free-Standing Store");
addOption(document.drop_list.SubCat,"820", "Shopping Center");
addOption(document.drop_list.SubCat,"850", "Supermarket");
addOption(document.drop_list.SubCat,"880", "Pharmacy/Drugstore");
addOption(document.drop_list.SubCat,"912", "Drive-in Bank");
addOption(document.drop_list.SubCat,"931", "Quality Restaurant");
addOption(document.drop_list.SubCat,"934", "Fast-Food Restaurant");
document.getElementById('UnitSize').innerHTML="Enter Square Footage"
}
if(document.drop_list.Category.value == 'Education'){
addOption(document.drop_list.SubCat,"520", "Elementary School");
addOption(document.drop_list.SubCat,"522", "Middle School/Junior High School");
addOption(document.drop_list.SubCat,"530", "High School");
addOption(document.drop_list.SubCat,"536", "Private School (K-12)");
addOption(document.drop_list.SubCat,"540", "Junior/Community College");
addOption(document.drop_list.SubCat,"550", "University/College");
addOption(document.drop_list.SubCat,"565", "Day Care Center");
document.getElementById('UnitSize').innerHTML="Enter # of Students"
}

}
////////////////// 

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);
}


