﻿function fillCategory(){ 
// this function is used to fill the category list on load
addOption(document.drop_list.Category, "American", "American", "");
addOption(document.drop_list.Category, "Banquet", "Banquet", "");
addOption(document.drop_list.Category, "Catering", "Catering", "");
addOption(document.drop_list.Category, "Family", "Family", "");
addOption(document.drop_list.Category, "Fine Dining", "Fine Dining", "");
addOption(document.drop_list.Category, "Italian", "Italian", "");
addOption(document.drop_list.Category, "Sports", "Sports", "");
addOption(document.drop_list.Category, "Steak And Seafood", "Steak And Seafood", "");
addOption(document.drop_list.Category, "Weddings", "Weddings", "");
}
function SelectSubCat(){
// ON selection of category this function will work
removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Select A Restaurant", "");
if(document.drop_list.Category.value == 'Family'){
addOption(document.drop_list.SubCat,"dining.asp?id=3&restaurant=the_galaxy_restaurant_sports_bar_and_patio", "The Galaxy Restaurant:Sports Bar And Patio");
addOption(document.drop_list.SubCat,"dining.asp?id=5&restaurant=Bialys_At_The Lakes_Lunch", "Bialys At The Lakes - Lunch");
addOption(document.drop_list.SubCat,"dining.asp?id=6&restaurant=Bialys_At_The Lakes_Dinner", "Bialys At The Lakes - Dinner");

}
if(document.drop_list.Category.value == 'Fine Dining'){
addOption(document.drop_list.SubCat,"dining.asp?id=4&restaurant=papa_joes", "Papa Joe's Restaurant");
addOption(document.drop_list.SubCat,"dining.asp?id=1&restaurant=the_galaxy_restaurant_dining_and_wine_room", "The Galaxy Restaurant:Dining and Wine Room");
}
if(document.drop_list.Category.value == 'Steak And Seafood'){
addOption(document.drop_list.SubCat,"dining.asp?id=4&restaurant=papa_joes", "Papa Joe's Restaurant");
addOption(document.drop_list.SubCat,"dining.asp?id=1&restaurant=the_galaxy_restaurant_dining_and_wine_room", "The Galaxy Restaurant:Dining and Wine Room");
addOption(document.drop_list.SubCat,"dining.asp?id=5&restaurant=Bialys_At_The Lakes_Lunch", "Bialys At The Lakes - Lunch");
addOption(document.drop_list.SubCat,"dining.asp?id=6&restaurant=Bialys_At_The Lakes_Dinner", "Bialys At The Lakes - Dinner");

}
if(document.drop_list.Category.value == 'American'){
addOption(document.drop_list.SubCat,"dining.asp?id=1&restaurant=the_galaxy_restaurant_dining_and_wine_room", "The Galaxy Restaurant:Dining and Wine Room");
addOption(document.drop_list.SubCat,"dining.asp?id=3&restaurant=the_galaxy_restaurant_sports_bar_and_patio", "The Galaxy Restaurant:Sports Bar And Patio");
addOption(document.drop_list.SubCat,"dining.asp?id=5&restaurant=Bialys_At_The Lakes_Lunch", "Bialys At The Lakes - Lunch");
addOption(document.drop_list.SubCat,"dining.asp?id=6&restaurant=Bialys_At_The Lakes_Dinner", "Bialys At The Lakes - Dinner");
}
if(document.drop_list.Category.value == 'Italian'){
addOption(document.drop_list.SubCat,"dining.asp?id=4&restaurant=papa_joes", "Papa Joe's Restaurant");
}
if(document.drop_list.Category.value == 'Sports'){
addOption(document.drop_list.SubCat,"dining.asp?id=3&restaurant=the_galaxy_restaurant_sports_bar_and_patio", "The Galaxy Restaurant:Sports Bar And Patio");
}
if(document.drop_list.Category.value == 'Banquet'){
addOption(document.drop_list.SubCat,"dining.asp?id=2&restaurant=the_galaxy_restaurant_banquet_hall", "The Galaxy Restaurant:Banquet Hall");
}
if(document.drop_list.Category.value == 'Catering'){
addOption(document.drop_list.SubCat,"dining.asp?id=2&restaurant=the_galaxy_restaurant_banquet_hall", "The Galaxy Restaurant:Banquet Hall");
}
if(document.drop_list.Category.value == 'Weddings'){
addOption(document.drop_list.SubCat,"dining.asp?id=2&restaurant=the_galaxy_restaurant_banquet_hall", "The Galaxy Restaurant:Banquet Hall");
}
}
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);
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
