
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.market, "Garden Center", "Garden Center", "");
addOption(document.drop_list.market, "General Merchandise", "General Merchandise", "");
addOption(document.drop_list.market, "C-Store/Automotive", "C-Store/Automotive", "");
addOption(document.drop_list.market, "Floral", "Floral", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.orgncode);
addOption(document.drop_list.orgncode, "", "Please select", "");

if(document.drop_list.market.value == 'Garden Center'){
addOption(document.drop_list.orgncode,"FPGCP - GCP&S", "GCP&S");
addOption(document.drop_list.orgncode,"FPNR - Nursery Retailer", "Nursery Retailer");
addOption(document.drop_list.orgncode,"FPTGC - Today's Garden Center", "Today's Garden Center");
addOption(document.drop_list.orgncode,"FPGCM - Garden Center Magazine", "Garden Center Magazine");
addOption(document.drop_list.orgncode,"FPGP - Green Profit", "Green Profit");
addOption(document.drop_list.orgncode,"FPGMP - GMPro", "GMPro");
addOption(document.drop_list.orgncode,"FPSF - Super Floral Retailing", "Super Floral Retailing");
addOption(document.drop_list.orgncode,"FPGPN - Greenhouse Product News", "Greenhouse Product News");
addOption(document.drop_list.orgncode,"FPMAG - Other Magazine", "Other Magazine");
addOption(document.drop_list.orgncode,"Internet Search", "Internet Search");
addOption(document.drop_list.orgncode,"Referral", "Referral");
addOption(document.drop_list.orgncode,"Trade Show", "Trade Show");
}
if(document.drop_list.market.value == 'General Merchandise'){
addOption(document.drop_list.orgncode,"FPGCP - GCP&S", "GCP&S");
addOption(document.drop_list.orgncode,"FPNR - Nursery Retailer", "Nursery Retailer");
addOption(document.drop_list.orgncode,"FPTGC - Today's Garden Center", "Today's Garden Center");
addOption(document.drop_list.orgncode,"FPGCM - Garden Center Magazine", "Garden Center Magazine");
addOption(document.drop_list.orgncode,"FPGP - Green Profit", "Green Profit");
addOption(document.drop_list.orgncode,"FPGMP - GMPro", "GMPro");
addOption(document.drop_list.orgncode,"FPSF - Super Floral Retailing", "Super Floral Retailing");
addOption(document.drop_list.orgncode,"FPGPN - Greenhouse Product News", "Greenhouse Product News");
addOption(document.drop_list.orgncode,"FPMAG - Other Magazine", "Other Magazine");
addOption(document.drop_list.orgncode,"Internet Search", "Internet Search");
addOption(document.drop_list.orgncode,"Referral", "Referral");
addOption(document.drop_list.orgncode,"Trade Show", "Trade Show");
}
if(document.drop_list.market.value == 'C-Store/Automotive'){
addOption(document.drop_list.orgncode,"CPCSD - C-Store Decisions", "C-Store Decisions");
addOption(document.drop_list.orgncode,"CPCSN - C-Store News", "C-Store News");
addOption(document.drop_list.orgncode,"CPCSC - C-Store Canada", "C-Store Canada");
addOption(document.drop_list.orgncode,"FPMAG - Other Magazine", "Other Magazine");
addOption(document.drop_list.orgncode,"Internet Search", "Internet Search");
addOption(document.drop_list.orgncode,"Referral", "Referral");
addOption(document.drop_list.orgncode,"Trade Show", "Trade Show");
}
if(document.drop_list.market.value == 'Floral'){
addOption(document.drop_list.orgncode,"FPGCP - GCP&S", "GCP&S");
addOption(document.drop_list.orgncode,"FPNR - Nursery Retailer", "Nursery Retailer");
addOption(document.drop_list.orgncode,"FPTGC - Today's Garden Center", "Today's Garden Center");
addOption(document.drop_list.orgncode,"FPGCM - Garden Center Magazine", "Garden Center Magazine");
addOption(document.drop_list.orgncode,"FPGP - Green Profit", "Green Profit");
addOption(document.drop_list.orgncode,"FPGMP - GMPro", "GMPro");
addOption(document.drop_list.orgncode,"FPSF - Super Floral Retailing", "Super Floral Retailing");
addOption(document.drop_list.orgncode,"FPGPN - Greenhouse Product News", "Greenhouse Product News");
addOption(document.drop_list.orgncode,"FPMAG - Other Magazine", "Other Magazine");
addOption(document.drop_list.orgncode,"Internet Search", "Internet Search");
addOption(document.drop_list.orgncode,"Referral", "Referral");
addOption(document.drop_list.orgncode,"Trade Show", "Trade Show");
}

}
////////////////// 

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);
}

