
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Beauty", "Beauty", "");
addOption(document.drop_list.Category, "Food", "Food & Catering", "");
addOption(document.drop_list.Category, "Accom", "Accommodation", "");
addOption(document.drop_list.Category, "Venues", "Venues & Reception", "");
addOption(document.drop_list.Category, "Flowers", "Flowers", "");
addOption(document.drop_list.Category, "Photo", "Photography & Video", "");
addOption(document.drop_list.Category, "Entertainment", "Entertainment", "");
addOption(document.drop_list.Category, "Fashion", "Fashion & Accessories", "");
addOption(document.drop_list.Category, "Stationery", "Stationery", "");
addOption(document.drop_list.Category, "Transport", "Transport Hire", "");
addOption(document.drop_list.Category, "Celebrants", "Celebrants", "");
addOption(document.drop_list.Category, "Gifts", "Gifts & Registry", "");
addOption(document.drop_list.Category, "Health", "Health & Wellbeing", "");
addOption(document.drop_list.Category, "Other", "Other", "");
addOption(document.drop_list.Category, "All", "All Categories", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Select a Category", "");

if(document.drop_list.Category.value == 'Beauty'){
addOption(document.drop_list.SubCat,"Hair", "Beauty, Hair, Makeup, Nails & Massage", "");
addOption(document.drop_list.SubCat,"Cosmetic", "Cosmetic Dentistry", "");
addOption(document.drop_list.SubCat,"Dental", "Dental", "");
addOption(document.drop_list.SubCat,"Eyes", "Eyelashes", "");
addOption(document.drop_list.SubCat,"Hairdressing", "Hairdressing", "");
addOption(document.drop_list.SubCat,"Makeup", "Makeup & Hair", "");
addOption(document.drop_list.SubCat,"Nails", "Nails", "");
addOption(document.drop_list.SubCat,"Tanning", "Tanning", "");
addOption(document.drop_list.SubCat,"Teeth", "Teeth Refinement", "");
}
if(document.drop_list.Category.value == 'Food'){
addOption(document.drop_list.SubCat,"Cakes", "Cakes & Catering", "");

addOption(document.drop_list.SubCat,"Catering", "Catering", "");
addOption(document.drop_list.SubCat,"Outdoor", "Outdoor Catering", "");
addOption(document.drop_list.SubCat,"Party", "Party Food", "");
addOption(document.drop_list.SubCat,"Wedding", "Wedding & Celebration Cakes", "");
}
if(document.drop_list.Category.value == 'Accom'){
  document.location.href = "directory.html#accommodation";
}
if(document.drop_list.Category.value == 'Venues'){
addOption(document.drop_list.SubCat,"Beach", "Beach Weddings", "");
addOption(document.drop_list.SubCat,"Garden", "Garden Weddings", "");
addOption(document.drop_list.SubCat,"Ceremony", "Ceremony Venues", "");
addOption(document.drop_list.SubCat,"Engagement", "Engagement Parties", "");
addOption(document.drop_list.SubCat,"Events", "Events", "");
addOption(document.drop_list.SubCat,"Functions", "Functions", "");
addOption(document.drop_list.SubCat,"Parties", "Hens & Bucks Parties", "");
addOption(document.drop_list.SubCat,"Reception", "Reception Venues", "");
}
if(document.drop_list.Category.value == 'Flowers'){
addOption(document.drop_list.SubCat,"Floral", "Floral", "");
addOption(document.drop_list.SubCat,"Florist", "Florist", "");
addOption(document.drop_list.SubCat,"Preserving", "Flower Preserving", "");
}
if(document.drop_list.Category.value == 'Photo'){
addOption(document.drop_list.SubCat,"Photography", "Photography", "");
addOption(document.drop_list.SubCat,"Booths", "Photobooths", "");
addOption(document.drop_list.SubCat,"Picture", "Picture Framers", "");
addOption(document.drop_list.SubCat,"Video", "Video Production", "");
}
if(document.drop_list.Category.value == 'Entertainment'){
addOption(document.drop_list.SubCat,"Enter", "Entertainment", "");
addOption(document.drop_list.SubCat,"Sculpture", "Ice Sculpture", "");
}
if(document.drop_list.Category.value == 'Fashion'){
addOption(document.drop_list.SubCat,"Accessories", "Accessories", "");
addOption(document.drop_list.SubCat,"Aftercare", "Aftercare, Cleaning & Boxing your Dress", "");
addOption(document.drop_list.SubCat,"Expos", "Bridal Expos", "");
addOption(document.drop_list.SubCat,"Bridal", "Bridal Fashion", "");
addOption(document.drop_list.SubCat,"Bridesmades", "Bridesmaids' Fashion", "");
addOption(document.drop_list.SubCat,"Children", "Children's Formal Wear", "");
addOption(document.drop_list.SubCat,"Drycleaners", "Drycleaners", "");
addOption(document.drop_list.SubCat,"Fash", "Fashion", "");
addOption(document.drop_list.SubCat,"Groom", "Groom's Attire & Hire", "");
addOption(document.drop_list.SubCat,"Jewellery", "Jewellery", "");
addOption(document.drop_list.SubCat,"Lingerie", "Lingerie", "");
addOption(document.drop_list.SubCat,"Mother", "Mother of the Bride", "");
addOption(document.drop_list.SubCat,"Nightwear", "Nightwear", "");
addOption(document.drop_list.SubCat,"Shoes", "Shoes", "");
}
if(document.drop_list.Category.value == 'Stationery'){
addOption(document.drop_list.SubCat,"Invites", "Invitations, Stationery & Scrapbooking", "");
addOption(document.drop_list.SubCat,"Deco", "Wedding Decorations", "");
addOption(document.drop_list.SubCat,"Wishing", "Wishing Wells", "");
}
if(document.drop_list.Category.value == 'Transport'){
addOption(document.drop_list.SubCat,"Car", "Car Hire & Transport", "");
addOption(document.drop_list.SubCat,"Trans","Transport Hire", "");
}
if(document.drop_list.Category.value == 'Celebrants'){
addOption(document.drop_list.SubCat,"Celebrants", "Celebrants", "");
}
if(document.drop_list.Category.value == 'Gifts'){
addOption(document.drop_list.SubCat,"Bonbonerie", "Bonbonerie & Gifts", "");
addOption(document.drop_list.SubCat,"Registry", "Bridal Registry", "");
addOption(document.drop_list.SubCat,"Presents", "Gifts", "");
addOption(document.drop_list.SubCat,"Gift Registry", "Gift Registry", "");
}
if(document.drop_list.Category.value == 'Health'){
addOption(document.drop_list.SubCat,"Counselling", "Counselling", "");
addOption(document.drop_list.SubCat,"Fitness", "Fitness & Weight Loss", "");
addOption(document.drop_list.SubCat,"Wellbeing", "Health & Wellbeing", "");
addOption(document.drop_list.SubCat,"Pre-Marriage", "Pre-Marriage Counselling", "");
addOption(document.drop_list.SubCat,"Relationship", "Relationship Counselling", "");
addOption(document.drop_list.SubCat,"Weight", "Weight Loss", "");
}
if(document.drop_list.Category.value == 'Other'){
addOption(document.drop_list.SubCat,"After", "After Five", "");
addOption(document.drop_list.SubCat,"Staff", "Decorations & Staff", "");
addOption(document.drop_list.SubCat,"Equipment", "Equipment Hire", "");
addOption(document.drop_list.SubCat,"Eventplanners", "Event Planners", "");
addOption(document.drop_list.SubCat,"Marquee", "Marquee Hire, Decorations & Staff", "");
addOption(document.drop_list.SubCat,"Hire", "Party Hire", "");
}
if(document.drop_list.Category.value == 'All'){
document.location.href = "directory.html";
}

}
////////////////// 
function GoToPage(){


if (document.drop_list.SubCat.value == '.....'){
  document.location.href = "directory.html#accessories";
  }
///if (document.drop_list.SubCat.value == 'Accommodation'){
//  document.location.href = "directory.html#accommodation";
//  } 
if (document.drop_list.SubCat.value == 'Aftercare'){
  document.location.href = "directory.html#aftercare";
  }
if (document.drop_list.SubCat.value == 'After'){
  document.location.href = "directory.html#afterfive";
  }
if (document.drop_list.SubCat.value == 'Beach'){
  document.location.href = "directory.html#beach";
  }
if (document.drop_list.SubCat.value == 'Hair'){
  document.location.href = "directory.html#beauty";
  }
if (document.drop_list.SubCat.value == 'Bonbonerie'){
  document.location.href = "directory.html#bonbonerie";
  }
if (document.drop_list.SubCat.value == 'Expos'){
  document.location.href = "directory.html#bridalexpos";
  }
if (document.drop_list.SubCat.value == 'Bridal'){
  document.location.href = "directory.html#bridalfashion";
  }
if (document.drop_list.SubCat.value == 'Registry'){
  document.location.href = "directory.html#bridalregistry";
  }
if (document.drop_list.SubCat.value == 'Bridesmades'){
  document.location.href = "directory.html#bridesmaids";
  }
if (document.drop_list.SubCat.value == 'Cakes'){
  document.location.href = "directory.html#cakes";
  }
if (document.drop_list.SubCat.value == 'Car'){
  document.location.href = "directory.html#car";
  }
if (document.drop_list.SubCat.value == 'Catering'){
  document.location.href = "directory.html#catering";
  }
if (document.drop_list.SubCat.value == 'Celebrants'){
  document.location.href = "directory.html#celebrants";
  }
if (document.drop_list.SubCat.value == 'Ceremony'){
  document.location.href = "directory.html#ceremony";
  }
if (document.drop_list.SubCat.value == 'Children'){
  document.location.href = "directory.html#childrens";
  }
if (document.drop_list.SubCat.value == 'Cosmetic'){
  document.location.href = "directory.html#cosmetic";
  }
if (document.drop_list.SubCat.value == 'Counselling'){
  document.location.href = "directory.html#counselling";
  }
if (document.drop_list.SubCat.value == 'Staff'){
  document.location.href = "directory.html#decorations";
  }
if (document.drop_list.SubCat.value == 'Dental'){
  document.location.href = "directory.html#dental";
  }
if (document.drop_list.SubCat.value == 'Drycleaners'){
  document.location.href = "directory.html#drycleaners";
  }
if (document.drop_list.SubCat.value == 'Engagement'){
  document.location.href = "directory.html#engagement";
  }
if (document.drop_list.SubCat.value == 'Enter'){
  document.location.href = "directory.html#entertainment";
  }
if (document.drop_list.SubCat.value == 'Equipment'){
  document.location.href = "directory.html#equipment";
  }
if (document.drop_list.SubCat.value == 'Events'){
  document.location.href = "directory.html#events";
  }
if (document.drop_list.SubCat.value == 'Eyes'){
  document.location.href = "directory.html#eyes";
  }
if (document.drop_list.SubCat.value == 'Eventplanners'){
  document.location.href = "directory.html#eventplanners";
  }
if (document.drop_list.SubCat.value == 'Fash'){
  document.location.href = "directory.html#fashion";
  }
if (document.drop_list.SubCat.value == 'Fitness'){
  document.location.href = "directory.html#fitness";
  }
if (document.drop_list.SubCat.value == 'Floral'){
  document.location.href = "directory.html#floral";
  } 
if (document.drop_list.SubCat.value == 'Florist'){
  document.location.href = "directory.html#florist";
  }
if (document.drop_list.SubCat.value == 'Preserving'){
  document.location.href = "directory.html#flower";
  }
if (document.drop_list.SubCat.value == 'Functions'){
  document.location.href = "directory.html#functions";
  }
if (document.drop_list.SubCat.value == 'Garden'){
  document.location.href = "directory.html#garden";
  }
if (document.drop_list.SubCat.value == 'Presents'){
  document.location.href = "directory.html#gifts";
  }
if (document.drop_list.SubCat.value == 'Gift Registry'){
  document.location.href = "directory.html#giftregistry";
  }
if (document.drop_list.SubCat.value == 'Groom'){
  document.location.href = "directory.html#groom";
  }
if (document.drop_list.SubCat.value == 'Hairdressing'){
  document.location.href = "directory.html#hairdressing";
  }
if (document.drop_list.SubCat.value == 'Wellbeing'){
  document.location.href = "directory.html#health";
  }
if (document.drop_list.SubCat.value == 'Parties'){
  document.location.href = "directory.html#hens";
  }
if (document.drop_list.SubCat.value == 'Sculpture'){
  document.location.href = "directory.html#ice";
  }
if (document.drop_list.SubCat.value == 'Invites'){
  document.location.href = "directory.html#invitations";
  }
if (document.drop_list.SubCat.value == 'Jewellery'){
  document.location.href = "directory.html#jewellery";
  }
if (document.drop_list.SubCat.value == 'Lingerie'){
  document.location.href = "directory.html#lingerie";
  }
if (document.drop_list.SubCat.value == 'Marquee'){
  document.location.href = "directory.html#marquee";
  }
if (document.drop_list.SubCat.value == 'Makeup'){
  document.location.href = "directory.html#makeup";
  }
if (document.drop_list.SubCat.value == 'Mother'){
  document.location.href = "directory.html#mother";
  }
if (document.drop_list.SubCat.value == 'Nails'){
  document.location.href = "directory.html#nails";
  }
if (document.drop_list.SubCat.value == 'Nightwear'){
  document.location.href = "directory.html#nightwear";
  }
if (document.drop_list.SubCat.value == 'Outdoor'){
  document.location.href = "directory.html#outdoor";
  }
if (document.drop_list.SubCat.value == 'Hire'){
  document.location.href = "directory.html#partyhire";
  }
if (document.drop_list.SubCat.value == 'Party'){
  document.location.href = "directory.html#partyfoods";
  }
if (document.drop_list.SubCat.value == 'Booths'){
  document.location.href = "directory.html#photobooths";
  }
if (document.drop_list.SubCat.value == 'Photography'){
  document.location.href = "directory.html#photography";
  }
if (document.drop_list.SubCat.value == 'Picture'){
  document.location.href = "directory.html#framers";
  }
if (document.drop_list.SubCat.value == 'Pre-Marriage'){
  document.location.href = "directory.html#premarriage";
  }
if (document.drop_list.SubCat.value == 'Reception'){
  document.location.href = "directory.html#reception";
  }
if (document.drop_list.SubCat.value == 'Relationship'){
  document.location.href = "directory.html#relationship";
  }
if (document.drop_list.SubCat.value == 'Shoes'){
  document.location.href = "directory.html#shoes";
  }
if (document.drop_list.SubCat.value == 'Tanning'){
  document.location.href = "directory.html#tanning";
  }
if (document.drop_list.SubCat.value == 'Teeth'){
  document.location.href = "directory.html#teeth";
  }
if (document.drop_list.SubCat.value == 'Trans'){
  document.location.href = "directory.html#trans";
  }
if (document.drop_list.SubCat.value == 'Video'){
  document.location.href = "directory.html#video";
  } 
if (document.drop_list.SubCat.value == 'Wedding'){
  document.location.href = "directory.html#wedding";
  }
if (document.drop_list.SubCat.value == 'Deco'){
  document.location.href = "directory.html#decos";
  }
if (document.drop_list.SubCat.value == 'Weight'){
  document.location.href = "directory.html#weightloss";
  }
if (document.drop_list.SubCat.value == 'Wishing'){
  document.location.href = "directory.html#wells";
  }
//if (document.drop_list.SubCat.value == 'Cat'){
//  document.location.href = "directory.html";
//  }  
}
////////////////// Add the Above function for each SubCat////////////////////////////////////

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);
}

//<form action="../">
//<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
//    <option value="">Choose a destination...</option>
//    <option value="http://www.yahoo.com/">YAHOO</option>
//    <option value="http://www.google.com/">GOOGLE</option>
//    <option value="http://www.altavista.com/">ALTAVISTA</option>
//    <option value="http://www.amazon.com/">AMAZON</option>
//    <option value="http://artlung.com/">ARTLUNG</option>
//</select>
//</form>



