
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.form1.Category, "Arts", "Arts", "");
addOption(document.form1.Category, "Business & Economy", "Business & Economy", "");
addOption(document.form1.Category, "Computer", "Computer", "");
addOption(document.form1.Category, "Health & Fitness", "Health & Fitness", "");
addOption(document.form1.Category, "Internet", "Internet", "");
addOption(document.form1.Category, "Shopping", "Shopping", "");
addOption(document.form1.Category, "Society", "Society", "");
addOption(document.form1.Category, "Government", "Government", "");
addOption(document.form1.Category, "Recreation", "Recreation", "");
addOption(document.form1.Category, "Sports", "Sports", "");
addOption(document.form1.Category, "Tour & Travels", "Tour & Travels", "");
addOption(document.form1.Category, "Finance & Insurance", "Finance & Insurance", "");
addOption(document.form1.Category, "Real Estate", "Real Estate", "");
addOption(document.form1.Category, "Mortgage", "Mortgage", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.form1.SubCat);
addOption(document.form1.SubCat, "", "Choose a Sub Category", "");

if(document.form1.Category.value == 'Arts'){
addOption(document.form1.SubCat,"Awards", "Awards");
addOption(document.form1.SubCat,"Art Design", "Art Design");
addOption(document.form1.SubCat,"Chat & Forums", "Chat & Forums");
addOption(document.form1.SubCat,"Art Directories", "Art Directories");
addOption(document.form1.SubCat,"Entertainment", "Entertainment");
addOption(document.form1.SubCat,"Movie & Videos", "Movie & Videos");
addOption(document.form1.SubCat,"Music", "Music");
addOption(document.form1.SubCat,"News & Media", "News & Media");
addOption(document.form1.SubCat,"Organizations", "Organizations");
addOption(document.form1.SubCat,"Regional", "Regional");
addOption(document.form1.SubCat,"Visual Arts", "Visual Arts");
}
if(document.form1.Category.value == 'Business & Economy'){
addOption(document.form1.SubCat,"Accounting", "Accounting");
addOption(document.form1.SubCat,"Construction & Maintenance", "Construction & Maintenance");
addOption(document.form1.SubCat,"Business Directories", "Business Directories", "");
addOption(document.form1.SubCat,"Industrial Goods & Services", "Industrial Goods & Services", "");
addOption(document.form1.SubCat,"Companies", "Companies", "");
addOption(document.form1.SubCat,"Management", "Management", "");
addOption(document.form1.SubCat,"Computer & Software", "Computer & Software", "");
addOption(document.form1.SubCat,"Telecommunications", "Telecommunications", "");
addOption(document.form1.SubCat,"Whole Sale Trade", "Whole Sale Trade", "");
addOption(document.form1.SubCat,"E-commerce", "E-commerce", "");
addOption(document.form1.SubCat,"Equipments", "Equipments", "");
}
if(document.form1.Category.value == 'Computer'){
addOption(document.form1.SubCat,"Hardware", "Hardware");
addOption(document.form1.SubCat,"Software", "Software");
addOption(document.form1.SubCat,"Programming", "Programming");
addOption(document.form1.SubCat,"Systems", "Systems");
addOption(document.form1.SubCat,"Security", "Security");
addOption(document.form1.SubCat,"Computing", "Computing");
addOption(document.form1.SubCat,"Operating System", "Operating System");
}
if(document.form1.Category.value == 'Health & Fitness'){
addOption(document.form1.SubCat,"Dental Health", "Dental Health");
addOption(document.form1.SubCat,"Health Care", "Health Care");
addOption(document.form1.SubCat,"First Aid", "First Aid");
addOption(document.form1.SubCat,"Mental Health", "Mental Health");
addOption(document.form1.SubCat,"Fitness", "Fitness");
addOption(document.form1.SubCat,"Health Insurance", "Health Insurance");
addOption(document.form1.SubCat,"Beauty", "Beauty");
addOption(document.form1.SubCat,"Child Health", "Child Health");
addOption(document.form1.SubCat,"Environmental Health", "Environmental Health");
addOption(document.form1.SubCat,"Weight Loss", "Weight Loss");
addOption(document.form1.SubCat,"Women Health", "Women Health");
addOption(document.form1.SubCat,"Nursing", "Nursing");
}
if(document.form1.Category.value == 'Internet'){
addOption(document.form1.SubCat,"Domain Names", "Domain Names");
addOption(document.form1.SubCat,"E-Marketing", "E-Marketing");
addOption(document.form1.SubCat,"Search Engine Optimization", "Search Engine Optimization");
addOption(document.form1.SubCat,"Search Engines", "Search Engines");
addOption(document.form1.SubCat,"Website Design", "Website Design");
addOption(document.form1.SubCat,"Web Development", "Web Development");
addOption(document.form1.SubCat,"Web Hosting", "Web Hosting");
addOption(document.form1.SubCat,"Web Directories", "Web Directories");
addOption(document.form1.SubCat,"Internet Marketing", "Internet Marketing");
addOption(document.form1.SubCat,"Internet", "Internet");
}
if(document.form1.Category.value == 'Shopping'){
addOption(document.form1.SubCat,"Antiques & collections", "Antiques & collections");
addOption(document.form1.SubCat,"Art & Crafts", "Art & Crafts");
addOption(document.form1.SubCat,"Books", "Books");
addOption(document.form1.SubCat,"Automobile", "Automobile");
addOption(document.form1.SubCat,"Clothing", "Clothing");
addOption(document.form1.SubCat,"Electrical", "Electrical");
addOption(document.form1.SubCat,"Gifts & Toys", "Gifts & Toys");
addOption(document.form1.SubCat,"Home & Garden", "Home & Garden");
addOption(document.form1.SubCat,"Jewellery", "Jewellery");
addOption(document.form1.SubCat,"Office Equipments", "Office Equipments");
addOption(document.form1.SubCat,"Retailers", "Retailers");
addOption(document.form1.SubCat,"Weddings", "Weddings");
}
if(document.form1.Category.value == 'Society'){
addOption(document.form1.SubCat,"Religion", "Religion");
addOption(document.form1.SubCat,"Education", "Education");
addOption(document.form1.SubCat,"Organizations", "Organizations");
addOption(document.form1.SubCat,"Social Science", "Social Science");
addOption(document.form1.SubCat,"People", "People");
}
if(document.form1.Category.value == 'Government'){
addOption(document.form1.SubCat,"Law ", "Law ");
addOption(document.form1.SubCat,"Military", "Military");
addOption(document.form1.SubCat,"Politics", "Politics");
}
if(document.form1.Category.value == 'Recreation'){
addOption(document.form1.SubCat,"Automobile", "Automobile");
addOption(document.form1.SubCat,"Food & Drink", "Food & Drink");
addOption(document.form1.SubCat,"Dating", "Dating");
addOption(document.form1.SubCat,"Fun & Games", "Fun & Games");
addOption(document.form1.SubCat,"Pets", "Pets");
addOption(document.form1.SubCat,"Casino", "Casino");
}
if(document.form1.Category.value == 'Sports'){
addOption(document.form1.SubCat,"Soccer", "Soccer");
addOption(document.form1.SubCat,"Golf", "Golf");
addOption(document.form1.SubCat,"Rugby", "Rugby");
addOption(document.form1.SubCat,"Motor Sports", "Motor Sports");
addOption(document.form1.SubCat,"Fishing", "Fishing");
addOption(document.form1.SubCat,"Games", "Games");
addOption(document.form1.SubCat,"Others", "Others");
}
if(document.form1.Category.value == 'Tour & Travels'){
addOption(document.form1.SubCat,"Accommodation", "Accommodation");
addOption(document.form1.SubCat,"Transportation", "Transportation");
addOption(document.form1.SubCat,"Guides & Directories", "Guides & Directories");
addOption(document.form1.SubCat,"Holidays", "Holidays");
addOption(document.form1.SubCat,"Tourism", "Tourism");
addOption(document.form1.SubCat,"Traveloques", "Traveloques");
}
if(document.form1.Category.value == 'Finance & Insurance'){
addOption(document.form1.SubCat,"Banks", "Banks");
addOption(document.form1.SubCat,"Association", "Association");
addOption(document.form1.SubCat,"Loan", "Loan");
addOption(document.form1.SubCat,"Credit Card", "Credit Card");
addOption(document.form1.SubCat,"Organization", "Organization");
addOption(document.form1.SubCat,"Finance", "Finance");
addOption(document.form1.SubCat,"Insurance", "Insurance");
}
if(document.form1.Category.value == 'Real Estate'){
addOption(document.form1.SubCat,"Agents & Brokers", "Agents & Brokers");
addOption(document.form1.SubCat,"Apartment Rental", "Apartment Rental");
addOption(document.form1.SubCat,"Construction & Builders", "Construction & Builders");
addOption(document.form1.SubCat,"Movers & Relocation", "Movers & Relocation");
addOption(document.form1.SubCat,"Property Management", "Property Management");
}
if(document.form1.Category.value == 'Mortgage'){
addOption(document.form1.SubCat,"Building Inspectors", "Building Inspectors");
addOption(document.form1.SubCat,"Commercial Lenders", "Commercial Lenders");
addOption(document.form1.SubCat,"Conveyancers", "Conveyancers");
addOption(document.form1.SubCat,"Financial Advisors", "Financial Advisors");
addOption(document.form1.SubCat,"Insurance", "Insurance");
addOption(document.form1.SubCat,"Mortgage Brokers", "Mortgage Brokers");
addOption(document.form1.SubCat,"Mortgage Managers/Bankers", "Mortgage Managers/Bankers");
addOption(document.form1.SubCat,"Property Valuers", "Property Valuers");
}

}
////////////////// 

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);
}
