
import java.awt.*;
import javax.swing.*;
import java.text.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.Timer;

/**
 * Class Delivery - Allows users to enter delivery service. They can choose a restaurant they wish to get take out from, 
 * select from each restaurants' menu, and have that food delivered for a nominal fee.
 * 
 * @Craig Furlonger
 * @version (a version number)
 * 
 * All logos from http:/www.brfd.co.kr/
 * Casablanca pictures: http://www.brfd.co.kr/company/food/89/88/
 * Little India pictures: http://www.brfd.co.kr/company/food/125/134/1
 * Maloney's Pictures http://www.brfd.co.kr/company/food/65/64/1
 * Vatos pictures http://www.brfd.co.kr/company/food/129/140/1
 * LaFerme pictures http://www.brfd.co.kr/company/food/181/197/1
 * Wolfhound pictures http://www.brfd.co.kr/company/food/107/114/1
 * Greek on the Grill http://www.brfd.co.kr/company/food/52/44/1
 * Thai food pictures: http://travel.cnn.com/bangkok/eat/40-bangkok-foods-we-cant-live-without-342900/
 * Jackson Blvd pictures: http://www.brfd.co.kr/company/food/179/195/1
 * Coca-cola products pictures: http://www.oswegosubshop.com/our-menu/beverages/
 * Currywurst Pictures: https://www.facebook.com/TheCurrywurstCompany/

 * additional pictures 
 * Chilli pepper: https://pixabay.com/

   
   */
public class Delivery extends JApplet implements ActionListener
{
    //setup buttons
    JButton addFood, sendOrder;
    FancyButton [] restaurant;
    
    //setup arrays
    String [] menuItem, menuPicture, menuDescription, menuExtra, orderItem, orderFrom;
    double [] menuPrice, orderPrice;
    JButton [] remove;
    Menu [] thisMenu;
    Order [] thisOrder;
    
    Order swapper;
    
    //other variables
    int chosenItem, itemsInOrder, numberOfRestaurants, line, removeItem;
    double totalBeforeTax, totalCost, tax, deliveryCost;

    int startScreen = 0;
    boolean isVeggie, isSpicy;
    
    //formatted strings.
    String formatBeforeTax, formatTax, formatTotalCost, formattedMenuPrice, formattedOrderPrice, formatDeliveryCost;
    String showDescription, currentRestaurant, currentItem, checkItem1, checkItem2, lastRestaurant;
    //setup inmage
    Image restaurantLogo, showImage, izzyLarge, removeImage, logoImage, downArrow, veggie, spicy;

    //setup panels, labels and a combo box
    JPanel buttonPanel = new JPanel();
    JPanel menuPanel = new JPanel();
    JPanel topPanel = new JPanel();
    JLabel instructions1, instructions2, instructions3;
    JLabel describe = new JLabel();
    JComboBox restaurantItems;
    
    ImageIcon izzyIcon = new ImageIcon();
    ImageIcon downArrowIcon = new ImageIcon();
    ImageIcon removeIcon = new ImageIcon();
    
    //insets to help with null layout
    Insets menuInsets;
    
    //setup decimal format
    DecimalFormat myFormat;
    
    //debugging
    String checker;
    
    public void init()
    {
       //big screen
       setSize (1500,750);
       
       //set thisMenu as menu
       thisMenu = new Menu[30];
             
       //background color will be white
       getContentPane().setBackground(Color.WHITE);
       
       //main layout is a border layout
       setLayout(new BorderLayout());
       
       restaurant = new FancyButton[12];
       
       //define all the buttons
       logoImage = getImage (getCodeBase(), "logoberlin.png");
       restaurant[0] = new FancyButton (logoImage, "German Food");
       logoImage = getImage (getCodeBase(), "logobuddha.png");
       restaurant[1] = new FancyButton (logoImage, "Thai Cuisine");
       logoImage = getImage (getCodeBase(), "logocasablanca.png");
       restaurant[2] = new FancyButton (logoImage, "Turkish Cuisine");
       logoImage = getImage (getCodeBase(), "logoli.png");
       restaurant[3] = new FancyButton (logoImage, "Indian Cuisine");
       logoImage = getImage (getCodeBase(), "logomaloney.png");
       restaurant[4] = new FancyButton (logoImage, "<HTML>American Pub Food</HTML>");
       logoImage = getImage (getCodeBase(), "logovatos.png");
       restaurant[5] = new FancyButton (logoImage, "Mexican Fusion");
       logoImage = getImage (getCodeBase(), "logogotg.png");
       restaurant[6] = new FancyButton (logoImage, "Greek Food");
       logoImage = getImage (getCodeBase(), "logohlc.png");
       restaurant[7] = new FancyButton (logoImage, "<HTML>American-Style Chinese Food</HTML>");
       logoImage = getImage (getCodeBase(), "logojack.png");
       restaurant[8] = new FancyButton (logoImage, "Pizza");
       logoImage = getImage (getCodeBase(), "logotm.png");
       restaurant[9] = new FancyButton (logoImage, "Sandwiches");
       logoImage = getImage (getCodeBase(), "logolf.png");
       restaurant[10] = new FancyButton (logoImage, "Health Food");
       logoImage = getImage (getCodeBase(), "logowolf.png");
       restaurant[11] = new FancyButton (logoImage, "British Pub Food");
       
       //create the button panel as a grid layout
       buttonPanel.setLayout(new GridLayout (3, 4));
       
       for (int j = 0; j < restaurant.length; j++)
       {   
           restaurant[j].addActionListener(this);//set buttons to action listener
           buttonPanel.add(restaurant[j]); // add the buttons to the button panel
        }
             
              
       //aresize the button panel
       buttonPanel.setPreferredSize(new Dimension(550,200));
       
       
       //set down arrow for instructions
       downArrow = getImage (getCodeBase(), "downarrow.png");
       downArrowIcon = new ImageIcon(downArrow);
       
       //instructions as JLabels will be set at the top of the screen.
       topPanel.setLayout(new GridLayout (1,3));
       instructions1 = new JLabel("<HTML>Step 1: Press a restaurant button from our Lineup</HTML>", downArrowIcon, JLabel.RIGHT);
       instructions2 = new JLabel();
       instructions3 = new JLabel();
       
       topPanel.add(instructions1);
       topPanel.add(instructions2);
       topPanel.add(instructions3);
       topPanel.setBackground(new Color(176,224,230));

       
       
       
       //main menu panel set as null layout
       menuPanel.setLayout(null);
       menuPanel.setBackground(Color.WHITE);
       
       //use menuinsets to help define where things will go in the null layout
       menuInsets = menuPanel.getInsets();
       
       //addfood will be the button to add food to the order
       addFood = new JButton("Add Item");
       
       //sendOrder will be the button to finish the order
       sendOrder = new JButton("Send Order");
       
       //this will be the combo box to select menu items from.
       restaurantItems = new JComboBox();
       restaurantItems.setBounds (40 + menuInsets.left, 100 + menuInsets.top, 240, 20);
       restaurantItems.setEditable(false);     
       
       //set buttons, label and combo box in the null layout
       addFood.setBounds(270 + menuInsets.left, 530 + menuInsets.top, 100, 50);
       addFood.setContentAreaFilled(false);
       
       //set button for ordering      
       sendOrder.setBounds(400 + menuInsets.left, 650 + menuInsets.top, 100, 50);
       sendOrder.setContentAreaFilled(false);
       sendOrder.setEnabled(false);
       
       //set long label for debugging
       describe = new JLabel("<HTML>ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ</HTML>");
       describe.setBounds(40+menuInsets.left, 420 + menuInsets.top, 300,100);
       
       //add action listener to buttons and combo box 
       addFood.addActionListener(this);
       sendOrder.addActionListener(this);
       restaurantItems.addActionListener(this);
       
       //set x for the remove buttons
       removeImage = getImage (getCodeBase(), "remove.png");
       removeIcon = new ImageIcon(removeImage);
              
       line = 89;
       
       //format remove buttons
       remove = new JButton[20];
       
       for (int i =0; i < remove.length; i++)
       {
           remove[i] = new JButton(removeIcon); 
           remove[i].setBorderPainted(false);
           remove[i].setContentAreaFilled(false);
           remove[i].setBounds(875+menuInsets.left, line + menuInsets.top, 15, 15);
           menuPanel.add(remove[i]);
           remove[i].setVisible(false);
           remove[i].addActionListener(this);
           line = line + 20;
        }
       
       //add buttons, combo box and label to menu panel
       menuPanel.add(addFood);
       menuPanel.add(restaurantItems);
       menuPanel.add(describe);
       menuPanel.add(sendOrder);
       
       //set pictures for veggie and spicy images
       veggie = getImage (getCodeBase(), "veggie.png");
       spicy = getImage (getCodeBase(), "spicy.png");
       
       //set items to invisible until startScreen = 2
       describe.setVisible(false);
       addFood.setVisible(false);
       restaurantItems.setVisible(false);
       sendOrder.setVisible(false);
       
       //add button panel to the left, instructions to the north, and the menu panel to the rest
       add(buttonPanel, BorderLayout.WEST);
       add(topPanel, BorderLayout.NORTH);
       add(menuPanel, BorderLayout.CENTER);
       
       //set decimal format to be used by all formatted strings
       myFormat = new DecimalFormat(".00");
       
       //set order arrays, and a counter for items
       thisOrder = new Order[20];
       itemsInOrder = 0;
       numberOfRestaurants = 0;
       
       //set formatted prices to default
       formatBeforeTax = "0.00";
       formatTax = "0.00";
       formatDeliveryCost = "0.00";
       formatTotalCost = "0.00";
       formattedMenuPrice = "0.00";
       formattedOrderPrice = "0.00";

          
       //debugger    
       //checker="eeee";
    }

    
    public void paint(Graphics g)
    {
        
        super.paint(g);
        
        if (startScreen == 0)
        {
            izzyLarge = getImage (getCodeBase(), "izzysbiglogo.png");
            g.drawImage(izzyLarge, 700, 300, 300, 300, this);
            
            g.setColor(new Color(176,224,230));
            g.setFont(new Font("Helvetica", Font.BOLD, 25));
            g.drawString ("Welcome to Izzy's.", 720, 170);
            g.drawString ("Click on a restaurant button to get started!", 600, 200);
            
        }
        else if (startScreen == 1)
        {
            //debugging
            //g.drawString(checker, 1000 ,700);
            
            g.setFont(new Font ("Helvetica", Font.BOLD, 20));//set font only for restaurant name
            g.setColor(Color.BLUE);
            g.drawString(currentRestaurant, 690, 120);
            g.drawImage(restaurantLogo, 600, 70, 75, 75, this);
            
            //display the menu item with new font and color
            g.setFont(new Font ("Times New Roman", Font.BOLD, 20));
            g.setColor(Color.BLACK);
            g.drawString(currentItem, 590, 200);
            
            //display image of selected food item
            g.drawRect(590, 225, 332, 223);
            g.drawImage(showImage, 595, 230, 322, 213, this);
            
            //present vegetarian and spicy icons if necessary
            if (isVeggie)
                {g.drawImage(veggie,860, 450, 30, 30, this);}
            if (isSpicy)
                {g.drawImage(spicy, 890, 450, 30, 30, this);}
                           
            //set formatted price above button
            g.setFont(new Font ("Helvetica", Font.BOLD, 20));
            g.drawString("$"+formattedMenuPrice, 750, 610);
            
        }
        else
        {
            
            izzyLarge = getImage (getCodeBase(), "izzysbiglogo.png");
            g.drawImage(izzyLarge, 630, 100, 200, 200, this);
            
            g.setColor(new Color(176,224,230));
            g.setFont(new Font("Helvetica", Font.BOLD, 25));
            g.drawString ("Thanks for using Izzy's!", 600, 500);
            g.drawString ("Your food should arrive", 600, 320);
            g.drawString("in about 45 minutes!", 620, 360);
                    }
        if (startScreen > 0)
        {
            //line will set each line for the order form. Each line will use 150 as its reference
            line = 150;
            g.setColor(Color.BLACK);
            g.drawRect(950, 85, 500,600);
            
            //display above order items    
            g.drawString(itemsInOrder + " items in your Order: ", 1000, 110);
            
            g.setFont(new Font ("System", Font.PLAIN, 12));
            
            //display items ordered and their price (formatted)
            for (int j = 0; j < itemsInOrder; j++)
                {g.drawString (thisOrder[j].getItem(), 1000, line);
                 formattedOrderPrice = myFormat.format(thisOrder[j].getPrice());
                 g.drawString("$" + formattedOrderPrice, 1240, line);
                 g.drawString("-- "+thisOrder[j].getFrom(), 1300, line);
                 line = line +20;
                 //will add remove button for each item
                 remove[j].setVisible(true);
                }
    
            
            //display totals including taxes, and total after taxes   
            line=line+30;
            g.drawString("Total Food:  ", 1000, line);
            g.drawString("$" + formatBeforeTax, 1240, line);
            
            line=line+30;
            g.drawString("Tax (@ 7%):", 1000, line);
            g.drawString("$" + formatTax, 1240, line);
            
            line =line+30;
            g.drawString("Delivery (x " + numberOfRestaurants + "):", 1000, line);
            g.drawString("$" + formatDeliveryCost, 1240, line);
            
            line=line+30;
            g.drawString("Total:", 1000, line);
            g.drawString("$" + formatTotalCost, 1240, line);
            
            }
        
    }

    public void changeMenu(int restaurant)
    {
        //this method will change the menu when a restaurant button is pressed to reflect that new restaurant, and put menu items in the combo box
        
        //this will change the start screen from splash screen to menu items once a button is selected
        if (startScreen == 0)
            {startScreen = 1;
             //make items visible
             restaurantItems.setVisible(true);
             describe.setVisible(true);
             addFood.setVisible(true);
             sendOrder.setVisible(true);
             
             //set next part of instructions
             instructions2.setText("<HTML>Step 2: Choose items to order from the menu by pressing 'Add Item'.</HTML>");
             instructions2.setIcon(downArrowIcon);
             instructions2.setHorizontalAlignment(JLabel.RIGHT);
            }
                    
        //clear the old menu
        for (int j=0; j<thisMenu.length; j++)
            {
                thisMenu[j]=null;
            }
                     
        //switch statement tells which menu to bring up    
        switch (restaurant)
        {
            case 0:
            {
                currentRestaurant = "Berlin Curry Wurst";
                restaurantLogo = getImage (getCodeBase(), "logoberlin.png");
                                            
                thisMenu[0] = new Menu("Original Sausage Currywurst", "<HTML>Our delicious home made German wurst sausage with our special curry sauce.</HTML>","BCWoriginal sausage.jpg", 7, false, false);
 
                thisMenu[1] = new Menu("Curried Hash", "<HTML>Our home made German wurst sausage, with potatoes curry, and a fried egg.</HTML>", "BCWcurried hash.jpg", 6.5, false, false);
                
                thisMenu[2] = new Menu("French Fries", "<HTML>Our special french fries with our blend of spices.</HTML>", "BCWfries.jpg", 5, false, true);
                
                thisMenu[3] = new Menu("Bavarian Salad", "<HTML>Lettuce, radish and onions with a light vinaigrette dressing.</HTML>", "BCWbavarian salad.jpg", 6, false, true);
                
                thisMenu[4] = new Menu("Back Bacon Sandwich", "<HTML>Canadian back bacon in curry and spices on a kaiser bun.</HTML>", "BCWback bacon.jpg", 8, false, false);
                
                thisMenu[5] = new Menu("Coca-Cola", "<HTML>500ml bottle.</HTML>", "BCWcoke.jpg", 1.25, false, false);
                
                thisMenu[6] = new Menu("Diet Coke", "<HTML>500ml bottle.</HTML>", "BCWdiet coke.jpg", 1.25, false, false);
                
                thisMenu[7] = new Menu("Sprite", "<HTML>500ml bottle.</HTML>", "BCWsprite.jpg", 1.25, false, false);
                
                thisMenu[8] = new Menu("Fresca", "<HTML>500ml bottle.</HTML>", "BCWfresca.jpg", 1.25, false, false);
                
                break;
            }
            case 1:
            { 
                currentRestaurant = "Buddha's Belly";
                restaurantLogo = getImage (getCodeBase(), "logobuddha.png");
                
                thisMenu[0] = new Menu("Gai Pad King", "<HTML>Stir fried chicken and ginger.</HTML>","BBgai pad king.jpg", 14.25, false, false);
                                
                thisMenu[1] = new Menu("Nam Tok Moo", "<HTML>Grilled pork with green onions, chili, and toasted rice.</HTML>", "BBnam tok moo.jpg", 15.25, true, false);
                                
                thisMenu[2] = new Menu("Guay Teow Nuaa", "<HTML>Tender beef with noodles and vegetables in broth.</HTML>", "BBguay teow nuaa.jpg", 16.25, false, false);
                
                thisMenu[3] = new Menu("Gang Som Plah Chon","<HTML>Fried fish smothered in a stunning sweet, sour and spicy soup.</HTML>", "BBgang som plah chon.jpg", 17.25, true, false);
                
                thisMenu[4] = new Menu("Gang Massaman", "<HTML>Tender chunks of lamb and potato in creamy red curry.</HTML>", "BBgang massaman.jpg", 17.25, true, false);
                
                thisMenu[5] = new Menu("Panang Gai", "<HTML>Tender chunks of lamb in creamy red curry with peanut and coconut.</HTML>", "BBpanang gai.jpg", 17.25, true, false);
                
                thisMenu[6] = new Menu("Pad Thai", "<HTML>Rice noodles stir fried with tofu, peanuts, shrimp, and vegetables.</HTML>", "BBpad thai.jpg", 13.25, false, false);
                
                thisMenu[7] = new Menu("Kao Moo Dang", "<HTML>Thinly sliced barbecued pork, sausage, vegetables, and a hard-boiled egg, in red barbecue sauce.</HTML>", "BBkao moo dang.jpg", 16.25, false, false);
                
                thisMenu[8] = new Menu("Kao Man Gai", "<HTML>Boiled chicken with garlic chili vinaigrette on rice.</HTML>", "BBkao man gai.jpg", 15.25, false, false);
                
                break;
            }
            case 2:
            {
                currentRestaurant = "Casablanca";
                restaurantLogo = getImage (getCodeBase(), "logocasablanca.png");
                
                thisMenu[0] = new Menu("Morrocan Chicken Sandwich", "<HTML>Tender chicken, falafel, and Casablanca spices and sauce on a kaiser bun.</HTML>", "Cmorrocan chicken sandwich.jpg", 6, false, false);
                 
                thisMenu[1] = new Menu("Morrocan Vegetable Sandwich", "<HTML>House-made falafel, with Casablanca spices and sauce on a kaiser bun.</HTML>", "Cmorrocan vegetable sandwich.jpg", 5, false, true);
                
                thisMenu[2] = new Menu("Lamb Chili Sandwich", "<HTML>Lamb, special Chili spice, Casablanca sauce on a kaiser bun.</HTML>", "Clamb chili sandwich.jpg", 6.5, true, false);
                
                thisMenu[3] = new Menu("Spicy Shrimp Sandwich", "<HTML>Specially prepared spiced shrimp, and Casablanca special sauce on a kaiser bun</HTML>", "Cspicy shrimp sandwich.jpg", 7, true, false);
                
                thisMenu[4] = new Menu("Lentil Soup", "<HTML>Our in-house, hand-made lentil soup.</HTML>", "CLentil Soup.jpg", 4.5, false, true);
                
                break;
            }
            case 3:
            {
                currentRestaurant = "Little India";
                restaurantLogo = getImage (getCodeBase(), "logoli.png");
                
                thisMenu[0] = new Menu("Mutton Masala", "<HTML>Lamb cooked with onions, chopped garlic and fresh coriander leaves.</HTML>", "LImutton masala.jpg", 13, false, false);
                                
                thisMenu[1] = new Menu("Kadhai Gosht", "<HTML>Lamb cooked with coriander seeds, red chilies, tomatoes and green pepper.</HTML>","LIkadhai gosht.jpg", 13, true, false);
                
                thisMenu[2] = new Menu("Lamb Vindaloo", "<HTML>Lamb cooked with potato, onion, tomato and red Goan chili.</HTML>", "LIlamb vindaloo.jpg", 12.5, true, false);
                
                thisMenu[3] = new Menu("Chicken Vindaloo", "<HTML>Chicken cooked with fried onions, tomatoes, ginger and garlic.</HTML>", "LIchicken vindaloo.jpg", 11.5, true, false);
                
                thisMenu[4] = new Menu("Chicken-Do Pyaza", "<HTML>Chicken cooked in cashew masala sauce with onions, garlic and cardamun.</HTML>", "LIchicken-do pyaza.jpg", 11, false, false);
                
                thisMenu[5] = new Menu("Butter Chicken", "<HTML>Chicken cooked in tomato, onion, cashew nut and cream sauce.</HTML>", "LIbutter chicken.jpg", 11.5, false, false);
                
                thisMenu[6] = new Menu("Chicken Vindaloo", "<HTML>Chicken cooked with potatoes, onion, tomato and red Goan chili.</HTML>", "LIchicken vindaloo.jpg", 11.50, true, false);
                
                thisMenu[7] = new Menu("Vegetable-Do Pyaza", "<HTML>Vegetables fried in cashew masala sauce onion, garlic and cardamum.</HTML>", "LIvegetable-do Pyaza.jpg", 10, false, true);
                
                thisMenu[8] = new Menu("Aloo Palak", "<HTML>Potato cubes cooked in creamy spinach seasoned with garlic, mustard seeds.</HTML>", "LIaloo palak.jpg", 10.5, false, true);
                
                thisMenu[9] = new Menu("Plain Naan", "<HTMLL>Traditional Indian Bread.</HTML>", "LIplain naan.jpg", 2, false, true);
                
                thisMenu[10] = new Menu("Garlic Naan", "<HTML>Garlic flavored Indian bread.</HTML>", "LIgarlic naan.jpg", 2.5, false, true);
                
                thisMenu[11] = new Menu("Safron Rice", "<HTML>Rice cooked with saffron and cumin seeds.</HTML>", "LIsafron rice.jpg", 3.5, false, true);
                
                thisMenu[12] = new Menu("Vegetable Samosas", "<HTML>Deep fried stuffed vegetables. Two Pieces. Served with corriander sauce</HTML>", "LIvegetable samosas.jpg", 4, false, true);
                break;
            }
            case 4:
            {
                currentRestaurant = "Maloney's";
                restaurantLogo = getImage (getCodeBase(), "logomaloney.png");
                thisMenu[0] = new Menu("The Bostonian Burger", "<HTML>Sirloin burger cooked in Sam Adams sauce, sautéed onions, mushrooms, double Swiss American cheese, with pesto, on Boston toast. Served with fries.</HTML>", "Mthe bostonian burger.jpg", 13.6, false, false);
                                
                thisMenu[1] = new Menu("Tony Montana Cuban Sandwich", "<HTML>The ultimate Cuban sandwich with roasted pork tender loin, ham, swiss/american cheese, pickle, mustard on a soft buttered Baguette. Served with fries.</HTML>", "Mtony montana cuban sandwich.jpg", 11, false, false);
                
                thisMenu[2] = new Menu("Chili Cheese Dog", "<HTML>A hot dog with home-made chili and melted cheddar cheese. Served with fries.</HTML>.", "Mchili cheese dog.jpg", 10.5, false, false);
                
                thisMenu[3] = new Menu("Swiss Mushroom Burger", "<HTML>Sirloin burger topped with Swiss cheese, portabella mushrooms & caramelized onions. Served with fries.</HTML>", "Mswiss mushroom burger.jpg", 13, false, false);
                
                thisMenu[4] = new Menu("The Guacomole Burger", "<HTML>Sirloin patty topped with guacamole, cheddar cheese, bacon, red onion, jalapeños , lettuce and tomato. Served with fries.</HTML>", "Mthe guacomole burger.jpg", 13.5, false, false);
                
                thisMenu[5] = new Menu("Classic Turkey Sandwich","<HTML>Half pound of turkey breast, iceberg lettuce, tomato and amrerican cheese with mayonnaise on toasted white bread. Served with fries.</HTML>", "Mclassic turkey sandwich.jpg", 13.5, false, false);

                thisMenu[6] = new Menu("Coca Cola", "500ml bottle.", "BCWcoke.jpg", 1.25, false, false);
                
                thisMenu[7] = new Menu("Diet Coke", "500ml bottle.", "BCWdiet coke.jpg", 1.25, false, false);
                
                thisMenu[8] = new Menu("Sprite", "500ml bottle.", "BCWsprite.jpg", 1.25, false, false);
                
                break;
            }
            
            case 5:
            {
                currentRestaurant = "Vatos Urban Tacos";
                restaurantLogo = getImage (getCodeBase(), "logovatos.png");
                
                thisMenu[0] = new Menu("Classic Burrito", "<HTML>Mexican rice, black beans, cheese, lettuce, sour cream, spicy chipotle mayo, cilantro onion, pico de gallo, Vatos hot sauce.</HTML>", "Vclassic burrito.jpg", 9.9, true, false);
                
                thisMenu[1] = new Menu("Fajita Burrito", "<HTML>Mexican rice, black beans, cheese, fajita veggies, sour cream, spicy chipotle mayo, cilantro onion, pico de gallo, Vatos hot sauce.</HTML>", "Vfajita burrito.jpg", 10.9, true, false);
                
                thisMenu[2] = new Menu("Vatos Burrito", "<HTML>Mexican rice, black beans, cheese, sautéed kimchi, French fries, sour cream, spicy chipotle mayo, cilantro onion, pico de gallo, Vatos hot sauce.</HTML>.", "Vvatos burrito.jpg", 10.9, true, false);
                
                thisMenu[3] = new Menu("Vegetarian Burrito","<HTML>Mexican rice, black beans, cheese, lettuce, sour cream, spicy chipotle mayo, cilantro onion, pico de gallo, Vatos hot sauce.</HTML>", "Vvegetarian burrito.jpg", 9.9, true, true);
                
                thisMenu[4] = new Menu("Baja Fish Tacos", "<HTML>Tempura beer-battered pollock, chipotle mayo, pico de gallo, apple coleslaw. Three tacos.</HTML>", "Vbaja fish tacos.jpg", 6.9, true, false);
                
                thisMenu[5] = new Menu("Barbacoa Pork Tacos", "<HTML>Slow-braised sweet & spicy pork shoulder, cilantro onion, Vatos hot sauce. Three tacos.</HTML>.", "Vbarbacoa pork tacos.jpg", 6.9, true, false);
                
                thisMenu[6] = new Menu("Braised Carnitas Tacos", "<HTML>Slow-braised Mexican style pork shoulder, cilantro onion, Vatos hot sauce. Three tacos.</HTML>", "Vbraised carnitas tacos.jpg", 6.9, true, false);
                
                thisMenu[7] = new Menu("Chili Lime Shrimp Tacos", "<HTML>Flash-fried shrimp, chipotle mayo, Asian slaw, pico de gallo, lime-cilantro sour cream. Three tacos.</HTML>", "Vchili lime shrimp tacos.jpg", 8.9, true, false);
                
                thisMenu[8] = new Menu("Chimichurri Chicken Tacos", "<HTML>Spicy chicken, Mexican cheese, lettuce, onion, sweet & tangy chimichurri salsa, sour cream. Three tacos.</HTML>", "Vchimichurri chicken tacos.jpg", 6.9, true, false);
                
                thisMenu[9] = new Menu("Spciy Chicken Tacos", "<HTML>Spicy chicken, chipotle mayo, Mexican cheese, cilantro onion, pico de gallo, Vatos hot sauce, sour cream. Three tacos.</HTML>", "Vspicy chicken tacos.jpg", 6.9, true, false);
                
                thisMenu[10] = new Menu("Classic Carne Asada Tacos", "<HTML>Grilled beef, cilantro, chopped onion, Vatos hot sauce. Three tacos.</HTML>", "Vclassic carne asada tacos.jpg", 6.9, true, false);
                
                thisMenu[11] = new Menu("Galbi Short Rib Tacos", "<HTML>Marinated short rib, ssamjang aioli, Asian slaw, cilantro onion, roasted sesame seeds. Three tacos.</HTML>", "Vgalbi short rib tacos.jpg", 7.9, false, false);
                
                thisMenu[12] = new Menu("Just Cheese Please Quesadilla", "<HTML>'Nude' quesadilla stuffed with melted mozzarella cheese.</HTML>", "Vjust cheese please quesadilla.jpg", 7.9, false, true);
                           
                thisMenu[13] = new Menu("Mango Shrimp Quesadilla","<HTML>Chipotle shrimp topped with sour cream, avocado slices, fresh mango salsa.</HTML>", "Vmango shrimp quesadilla.jpg", 16.9, false, false);
            
                thisMenu[14] = new Menu("Mushroom and Spinach Quesadilla", "<HTML>Grilled mushrooms and spinach topped with cilantro mayo, árbol chili sauce, cilantro onion.</HTML>", "Vmushroom and spinach quesadilla.jpg", 10.9, true, true);
                
                thisMenu[15] = new Menu("Spicy Chicken Quesadilla", "<HTML>Spicy chicken topped with sour cream, árbol chili sauce, cilantro onion.</HTML>", "Vspicy chicken quesadilla.jpg", 10.9, true, false);
                
                thisMenu[16] = new Menu("Carnitas Taquitos","<HTML>Crispy corn tortillas stuffed with Mexican style braised carnitas & cheese. Topped with bell pepper marinara sauce, sour cream, cilantro onion.</HTML>", "Vcarnitas taquitos.jpg", 10.9, false, false);
                         
                thisMenu[17] = new Menu("Kimchi Carnitas Fries", "<HTML>Seasoned French fries, braised carnitas, sautéed kimchi, cheese, cilantro onion, sour cream, Vatos hot sauce.</HTML>", "Vkimchi carnitas fries.jpg", 12.5, true, false);
                
                thisMenu[18] = new Menu("Tamales", "<HTML>Two 100% corn tamales filled with carnitas & cheese. Chimichurri salsa & sour cream.</HTML>", "Vtamales.jpg", 9.9, false, false);
                
                thisMenu[19] = new Menu("Honey Tequila Chicken Wings", "<HTML>Wings coated in sweet & spicy honey tequila sauce, deep-fried masa-battered jalapeños, cilantro, blue cheese dipping sauce.</HTML>.", "Vhoney tequila chicken wings.jpg", 12.9, true, false);
                
                thisMenu[20] = new Menu("Vatos Chili Con Carne", "<HTML>Grounded beef, potatoes, kimchi, Mexican cheese, sour cream, cilantro onions, tortilla strips.</HTML>", "Vvatos chili con carne.jpg", 11.9, true, false);
                
                thisMenu[21] = new Menu("Vatos Cowboy Queso", "<HTML>Molten queso dip with pepper jack and cheddar cheeses, black beans, pico de gallo, sour cream & fresh hand-cut tortilla chips.</HTML>", "Vvatos cowboy queso.jpg", 10.9, false, true);
                
                thisMenu[22] = new Menu("California Fresh Salad", "<HTML>Romaine lettuce, apples, cucumbers, red bell peppers, candied walnuts, gorgonzola cheese, sun-dried cranberries, lemon honey mustard vinaigrette.</HTML>", "Vcalifornia fresh salad.jpg", 13.9, false, true);
             
                thisMenu[23] = new Menu("Mexican Caesar Salad", "<HTML>Spinach, lettuce & mixed greens, pico de gallo, sweet pickled red onions, cabbage, cilantro, onion, toasted pumpkin seeds, dry parmesan, tortilla chips, cilantro caesar dressing.</HTML>", "Vmexican caesar salad.jpg", 10.9, false, true);
                
                thisMenu[24] = new Menu("Coca-Cola", "<HTML>500ml bottle.</HTML>", "BCWcoke.jpg", 1.25, false, false);
                
                thisMenu[25] = new Menu("Coke Zero", "<HTML>500ml bottle.</HTML>", "BCWcoke zero.jpg", 1.25, false, false);
                
                thisMenu[26] = new Menu("Sprite", "<HTML>500ml bottle.</HTML>", "BCWsprite.jpg", 1.25, false, false);
                break;
            }
            case 6:
            {
                currentRestaurant = "Greek on the Grill";
                restaurantLogo = getImage (getCodeBase(), "logogotg.png");
                
                thisMenu[0] = new Menu("Chicken Pita", "<HTML>Greek style chicken pita.</HTML>", "GOTGchicken pita.jpg", 5.5, false, false);
                                
                thisMenu[1] = new Menu("Pork Pita", "<HTML>Greek Style pork pita.</HTML>", "GOTGpork pita.jpg", 5.5, false, false);
                
                thisMenu[2] = new Menu("Lamb Pita", "<HTML>Greek style lamb pita.</HTML>.", "GOTGlamb pita.jpg", 6, false, false);
                
                thisMenu[3] = new Menu("Tzatziki Chicken Salad", "<HTML>Chicken with sliced cucumbers, onions, lettuce, and our own tzatziki dressing</HTML>", "GOTGtzatziki chicken salad.jpg", 6, false, false);
                
                thisMenu[4] = new Menu("Greek Salad", "<HTML>Tomatoes, sliced cucumbers, onion, feta cheese, and olives.</HTML>", "GOTGgreek salad.jpg", 5.5, false, true);
                
                thisMenu[5] = new Menu("Coca-Cola", "<HTML>500ml bottle.</HTML>", "BCWcoke.jpg", 1.25, false, false);
                
                thisMenu[6] = new Menu("Coke Zero", "<HTML>500ml bottle.</HTML>", "BCWcoke zero.jpg", 1.25, false, false);
                
                thisMenu[7] = new Menu("Sprite", "<HTML>500ml bottle.</HTML>", "BCWsprite.jpg", 1.25, false, false);
               
                break;
            }
            case 7:
            {
                currentRestaurant = "Ho Lee Chow";
                restaurantLogo = getImage (getCodeBase(), "logohlc.png");
                
                thisMenu[0] = new Menu("General Tso's Chicken", "<HTML>Just the way the General liked it. Tender deep-fried chunks of chicken sauteed in a sweet sauce with a hint of spice.</HTML>", "HLCgeneral tso's chicken.jpg", 17.5, false, false);
                                
                thisMenu[1] = new Menu("Kung Pao Chicken", "<HTML>Slices of chicken, onions, bell peppers, celery and peanuts wokked to perfection in our special Szechuan sauce.</HTML>", "HLCkung pao chicken.jpg", 16.9, true, false);
                
                thisMenu[2] = new Menu("Orange Chicken", "<HTML>Deep-fried chunks of chicken stir-fried with sliced onions and orange pieces.</HTML>.", "HLCorange chicken.jpg", 17.5, false, false);
                
                thisMenu[3] = new Menu("Sweet & Sour Pork", "<HTML>Deep-fried chunks of pork served with bell peppers, onions and pineapple chunks served in our popular sweet & sour sauce.</HTML>", "HLCsweet & sour pork.jpg", 17.5, false, false);
                
                thisMenu[4] = new Menu("Ho Lee's Mu Shu Pork", "<HTML>Shredded pork, cabbage, carrots and mushrooms wokked in Hoi Sin sauce, served with Mu Shu wraps.</HTML>", "HLCho lee's mu shu pork.jpg", 16.9, false, false);
                
                thisMenu[5] = new Menu("Szechuan Pork","<HTML>Tender slices of pork, bell peppers and onions stir-fried in our spicy szechuan sauce.</HTML>", "HLCszechuan pork.jpg", 17.5, false, false);

                thisMenu[6] = new Menu("Mongolian Beef", "<HTML>Tender slices of beef deep-fried and wokked with spring onions, onions and served in our special mongolian sauce.</HTML>", "HLCmongolian beef.jpg", 19.5, false, false);
                
                thisMenu[7] = new Menu("Ho Lee's Beijing Beef", "<HTML>Slices of crispy beef wokked in Ho lee's unique tangy spicy style sauce.</HTML>", "HLCho lee's beijing beef.jpg", 19.9, false, false);
                
                thisMenu[8] = new Menu("Ho Lee's Pepper Beef", "<HTML>Generous portions of beef and vegetables served in our special pepper sauce with a strong hint of ground black pepper.</HTML>", "HLCho lee's pepper beef.jpg", 19.9, false, false);
                
                thisMenu[9] = new Menu("Sweet & Spicy Jumbo Prawns", "<HTML>Tender large prawns, bell peppers and pineapples wok seared and served in our unique sweet & spicy sauce.</HTML>", "HLCsweet & spicy jumbo prawns.jpg", 31.9, true, false);
                                
                thisMenu[10] = new Menu("Szechuan Special", "<HTML>Tender pieces of beef, chicken, shrimp and squid stir-fried in our very special szechuan sauce.</HTML>", "HLCszechuan special.jpg", 21.9, false, false);
                
                thisMenu[11] = new Menu("Mayo Shrimp", "<HTML>Generous portions of deep-fried shrimp, delicately coated in our special sweet mayonnaise sauce, flavored with a hint of peanuts.</HTML>.", "HLCmayo shrimp.jpg", 23.5, false, false);
                
                thisMenu[12] = new Menu("Ho Lee's Cantonese Chow Mein", "<HTML>Tender pieces of chicken, shrimp, squid, and vegetables stir-fried and served over traditionally fried egg noodles in our famous original sauce.</HTML>", "HLCho lee's cantonese chow mein.jpg", 18.9, false, false);
                
                thisMenu[13] = new Menu("Black bean Chow Mein", "<HTML>Tender pieces of chicken, shrimp, squid, and vegetables stir-fried and served over traditionally fried egg noodles in our famous black bean sauce.</HTML>", "HLCblack bean chow mein.jpg", 18.9, false, false);
                
                thisMenu[14] = new Menu("Ho Lee's Beef Ho Fun","<HTML>Wide rice noodles stir-fried with tender slices of beef, spring onions, onions and bean sprouts in a deliciously light sweet soya sauce.</HTML>", "HLCho lee's beef ho fun.jpg", 17.9, false, false);

                thisMenu[15] = new Menu("Hong Kong Fried Rice", "<HTML>A Hong Kong classic, a lighter colored fried rice with egg, shrimp, crab meat, cabbages, bean sprouts, carrots and bell peppers.</HTML>", "HLChong kong fried rice.jpg", 11.9, false, false);
                
                thisMenu[16] = new Menu("Beef Fried Rice", "<HTML>Beef, chopped onions, mushrooms, green onions, carrots, bean sprouts, bell peppers and egg wokked over high heat for best results.</HTML>", "HLCbeef fried rice.jpg", 11.9, false, false);
                
                thisMenu[17] = new Menu("Chicken Fried Rice", "<HTML>Chunks of chicken, mushrooms, carrots, bean sprouts, green onions, bell peppers and eggs wokked over high heat for best results.</HTML>", "HLCchicken fried rice.jpg", 11.5, false, false);
                
                thisMenu[18] = new Menu("Ho Lee's Garlic Vegetables", "<HTML>Vegetable mix medley wokked in our original garlic sauce.</HTML>", "HLCho lee's garlic vegetables.jpg", 14.5, false, true);
                                
                thisMenu[19] = new Menu("Vegetables Ma Po Tofu", "<HTML>Soft cubes of tofu stir-fried with a medley of vegetables Szechuan style.</HTML>", "HLCvegetables ma po tofu.jpg", 14.5, false, false);
                
                thisMenu[20] = new Menu("Spicy Eggplant", "<HTML>Tasty eggplant stir-fried in our special szechuan sauce</HTML>.", "HLCspicy eggplant.jpg", 15.5, true, true);
                
                thisMenu[21] = new Menu("Shrimp Spring Rolls", "<HTML>Deep-fried thin pancakes filled with shredded vegetables and shrimp (2 Rolls).</HTML>", "HLCshrimp spring rolls.jpg", 6.9, false, false);
                
                thisMenu[22] = new Menu("Vegetable Spring Rolls", "<HTML>Deep-fried thin pancakes filled with shredded vegetables (2 Rolls).</HTML>", "HLCvegetable spring rolls.jpg", 5.9, false, true);
                
                thisMenu[23] = new Menu("Shrimp Moneybag Dumplings","<HTML>A lucky appetizer. Deep-fried pouches filled with shrimp, served with our mayonnaise sauce. (6 Pieces)</HTML>", "HLCshrimp moneybag dumplings.jpg", 8.5, false, false);

                break;
            }
            case 8:
            {
                currentRestaurant = "Jackson Blvd. Pizza";
                restaurantLogo = getImage (getCodeBase(), "logojack.png");
                
                thisMenu[0] = new Menu("Cheese Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Grana padano cheese, Parmesan cheese and Colby jack cheese.</HTML>", "JBcheese pizza.jpg", 15.2, false, true);
                                
                thisMenu[1] = new Menu("Hawaiian Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Parmesan cheese, Grana padano cheese, Pineapple, Canadian bacon, Lemon zest and Fresh basil.</HTML>", "JBhawaiian pizza.jpg", 17.9, false, false);
                
                thisMenu[2] = new Menu("Pepperoni", "<HTML>Tomato sauce, Mozzarella cheese, Pepperoni and more Pepperoni.</HTML>.", "JBpepperoni pizza.jpg", 17.9, false, false);
                
                thisMenu[3] = new Menu("Pepperoni Delight Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Grana padano cheese, Pepperoni, Roasted red bell peppers and Chopped spring onions.</HTML>", "JBpepperoni delight pizza.jpg", 17.9, false, false);
                
                thisMenu[4] = new Menu("American Spirit Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Grana padaco cheese,Parmesan cheese, Pepperoni, Crispy bacon and Mushrooms.</HTML>", "JBamerican spirit pizza.jpg", 18.4, false, false);
                
                thisMenu[5] = new Menu("Italian Spirit Pizza","<HTML>Tomato sauce, Mozzarella cheese, Italian sausages, Roasted red bell peppers, Artichokes, Ricotta cheese, Spinach, Sun dried tomatoes, Oregano, Grana padano cheese and Fresh basil.</HTML>", "JBitalian spirit pizza.jpg", 21.6, false, false);

                thisMenu[6] = new Menu("Super Jackson Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Pepperoni, Italian sausages, Certified Jackson's crushed beef parry, Crispy bacon, Red onions, Roasted red bell peppers, Oregano and Grana padano cheese.</HTML>", "JBsuper jackson pizza.jpg", 23.1, false, false);
                
                thisMenu[7] = new Menu("Greekology Pizza","<HTML>Tomato sauce, Mozzarella cheese, Grana padano cheese, Zucchini, Egg plants, Grilled red bell peppers, Red onions, Sun dried tomatoes, Feta cheese, Oregano and Fresh basil.</HTML>", "JBgreekology pizza.jpg", 18.4, false, true);

                thisMenu[8] = new Menu("Melting Cheeseburger Pizza", "<HTML>Tomato sauce, Mozzarella cheese, American cheese, Monterey pepper jack cheese, Certified Jackson's crushed beef patty, Crispy bacon, Red onions, tomatoes and Dill pickles.</HTML>", "JBmelting cheeseburger pizza.jpg", 21, false, false);
                                 
                thisMenu[9] = new Menu("Original Cheese Deep Dish Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Parmesan cheese, Grana padano cheese, Oregono and Fresh basil.</HTML>", "JBoriginal cheese deep dish pizza.jpg", 19.8, false, true);
                
                thisMenu[10] = new Menu("Dr. Pepperoni Deep Dish Pizza","<HTML>Tomato sauce, Mozzarella cheese, Grana padono cheese, Parmesan cheese, Pepperoni and More pepperoni.</HTML>", "JBdr pepperoni deep dish pizza.jpg", 21, false, false);

                thisMenu[11] = new Menu("Jackson Five Deep Dish Pizza", "<HTML>Tomato sauce, Mozzarella cheese, Grana padono cheese, Parmesan cheese, Pepperoni, Crispy bacon and Mushrooms.</HTML>", "JBsuper jackson pizza.jpg", 22.2, false, false);
                
                thisMenu[12] = new Menu("President Deep Dish Pizza","<HTML>Tomato sauce, Mozzarella cheese, Parmesan cheese, Grana padano cheese, Pepperoni, Certified Jackson's crushed beef patty, Grilled red bell pepper and Red onions.</HTML>", "JBpresident deep dish pizza.jpg", 24.5, false, true);

                thisMenu[13] = new Menu("Ratatouille", "<HTML>Tomato sauce, Mozzarella cheese, Grana padano cheese, Egg plants, Zucchini, Grilled red bell peppers, Oregano and Fresh basil.</HTML>", "JBratatouille.jpg", 22.2, false, true);
                                
                thisMenu[14] = new Menu("Coca Cola", "500ml bottle.", "BCWcoke.jpg", 1.5, false, false);
                
                thisMenu[15] = new Menu("Diet Coke", "500ml bottle.", "BCWdiet coke.jpg", 1.5, false, false);
                
                thisMenu[16] = new Menu("Sprite", "500ml bottle.", "BCWsprite.jpg", 1.5, false, false);
                
                thisMenu[17] = new Menu("Dr. Pepper", "500ml bottle.", "BCWdr pepper.jpg", 1.5, false, false);
                
                break;
            }
            case 9:
            {
                currentRestaurant = "Toast Monster";
                restaurantLogo = getImage (getCodeBase(), "logotm.png");
                
                thisMenu[0] = new Menu("Bacon, Egg & Cheese Sammy", "<HTML>Bacon, egg, cheddar, and mozzarella on toast.</HTML>", "TMbacon egg & cheese sammy.jpg", 5.8, false, false);
                                
                thisMenu[1] = new Menu("Ham, Egg & Cheese Sammy", "<HTML>Ham, egg, cheddar, and mozzarella on toast.</HTML>", "TMham egg & cheese sammy.jpg", 5.8, false, false);
                
                thisMenu[2] = new Menu("Nutella Banana Sammy", "<HTML>Nutella, banana, and marshmellow on toast.</HTML>.", "TMnutella banana sammy.jpg", 5.8, false, true);
                
                thisMenu[3] = new Menu("PB & J Sammy", "<HTML>Peanut butter and grape jam on toast.</HTML>", "TMpb & j sammy.jpg", 4.7, false, true);
                
                thisMenu[4] = new Menu("Mac & Cheese with Sloppy Joe Sammy", "<HTML>Macaroni, cheese, and sloppy joe on toast.</HTML>", "TMmac & cheese with sloppy joe sammy.jpg", 10.5, false, false);
                
                thisMenu[5] = new Menu("Chicken Pizzaiola Sammy","<HTML>Chicken breast, tomato sauce, pickle, and mozzarella on toast.</HTML>", "TMchicken pizzaiola sammy.jpg", 12.8, false, false);

                thisMenu[6] = new Menu("Steak & Potato Sammy", "<HTML>Steak, potato, mayo, BBQ sauce, and mozzarella on toast.</HTML>", "TMsteak & potato sammy.jpg", 16.3, false, false);
                           
                break;
            }
            case 10:
            {
                currentRestaurant = "La Ferme";
                restaurantLogo = getImage (getCodeBase(), "logolf.png");
                
                thisMenu[0] = new Menu("Tofu Mango Salad", "<HTML>Tofu, eggplant, mango, pumpkin seed, chia seed, almond, tomato, mango dressing, ricotta spinach spread with bread.</HTML>", "LFtofu mango salad.jpg", 12.5, false, true);
                                
                thisMenu[1] = new Menu("Chickpea Salad", "<HTML>Chickpea, hummus, mint, ricotta, spinach, tomato, grapefruit, lemon vinaigrette dressing, beet hummus with bread.</HTML>", "LFchickpea salad.jpg", 14.5, false, true);
                
                thisMenu[2] = new Menu("Avocado Salad", "<HTML>Avocado, salmon, quinoa, cucumber, tomato, green bean, almond, lemon cream dressing, avocado spread with bread.</HTML>.", "LFavocado salad.jpg", 15.8, false, false);
                
                thisMenu[3] = new Menu("Chicken Quinoa Salad", "<HTML>Chicken, quinoa, broccoli, tomato, orange, rosemary, hazelnut, wholegrain mustard dressing, sweet pumpkin spread with bread.</HTML>", "LFchicken quinoa salad.jpg", 17, false, false);
                
                thisMenu[4] = new Menu("Seafood Quinoa Stew", "<HTML>Quinoa, scallop, shrimp, clam, baby cuttlefish, tomato, carrot, potato.</HTML>", "LFseafood quinoa stew.jpg", 15.8, false, false);
                
                thisMenu[5] = new Menu("Oats Risotto","<HTML>Oats, sea bass, leek, broccoli, garden bean, sweet pumpkin.</HTML>", "LFoats risotto.jpg", 17.8, false, true);

                thisMenu[6] = new Menu("Chicken Cous Cous", "<HTML>Chicken, red quinoa, couscous, potato, broccoli, green beans.</HTML>", "LFchicken cous cous.jpg", 18.5, false, false);
                
                thisMenu[7] = new Menu("Healthy Smoothie", "<HTML>Beet, strawberry, carrot, apple, chia seed, coconut water.</HTML>", "LFhealthy smoothie.jpg", 7.8, false, true);
                
                thisMenu[8] = new Menu("Cleanse Smoothie", "<HTML>Orange, carrot, banana, lemon.</HTML>.", "LFcleanse smoothie.jpg", 7.8, false, true);
                
                thisMenu[9] = new Menu("Skinny Smoothie", "<HTML>Banana, cabbage, almond, coconut oil, coconut water.</HTML>", "LFskinny smoothie.jpg", 7.8, false, true);
                
                thisMenu[10] = new Menu("Beauty Smoothie", "<HTML>Avocado, banana, almond milk, spinach, dates, almond.</HTML>", "LFbeauty smoothie.jpg", 7.8, false, true);
                
                thisMenu[11] = new Menu("Miranda Smoothie","<HTML>Spirulina,Cacao 100%,goji berries, maca, brown rice protein, acai, chia seed.</HTML>", "LFmiranda smoothie.jpg", 7.8, false, true);

                thisMenu[12] = new Menu("Anti-Age Smoothie", "<HTML>Blueberry, banana, kale, almond milk.</HTML>", "LFanti age smoothie.jpg", 7.8, false, true);
                                
                break;
            }
            case 11:
            {
                currentRestaurant = "Wolfhound Irish Pub";
                restaurantLogo = getImage (getCodeBase(), "logowolf.png");
                
                thisMenu[0] = new Menu("Paddy Mac's Big Beef Burger", "<HTML>An extra large patty (240g) with extra cheese & extra bacon on a toasted bun with lettuce, tomato, onions & garlic mayo.</HTML>", "WIPpaddy mac's big beef burger.jpg", 17, false, false);
                                
                thisMenu[1] = new Menu("Bacon Cheese Burger", "<HTML>Grilled beef patty (180g) with cheese & bacon on a toasted bun with fresh lettuce, tomato, onions & garlic mayo.</HTML>", "WIPbacon cheese burger.jpg", 14, false, false);
                
                thisMenu[2] = new Menu("Bacon Ranch Chicken Burger", "<HTML>Crispy breaded chicken breast, crispy bacon & creamy ranch dressing on a toasted bun with lettuce, tomato & onions.</HTML>.", "WIPbacon ranch chicken burger.jpg", 14, false, false);
                
                thisMenu[3] = new Menu("Caesar Chicken Sandwich", "<HTML>Grilled Chicken, Caesar Dressing, Romaine, Bacon, Red Onion, Parmesan, Garlic Mayo, Ciabatta.</HTML>", "WIPcaesar chicken sandwich.jpg", 14, false, false);
                
                thisMenu[4] = new Menu("Classic Club Sandwich", "<HTML>Triple decker loaded with grilled chicken breast, crispy bacon,fried egg lettuce, tomato and mayo on toasted bread.</HTML>", "WIPclassic club sandwich.jpg", 16, false, false);
                
                thisMenu[5] = new Menu("Spicy Cajun Chicken Sandwich","<HTML>Cajun Spiced Chicken, Ranch Dressing, Lettuce, Tomato, Red Onion, Garlic Mayo, Ciabatta.</HTML>", "WIPspicy cajun chicken sandwich.jpg", 14, true, false);

                thisMenu[6] = new Menu("Bangers & Mash", "<HTML>Four top grade sausages with mashed potatoes, carrots and zucchini smothered in onion gravy.</HTML>", "WIPbangers & mash.jpg", 15, false, false);
                                
                thisMenu[7] = new Menu("Grilled Chicken Salad", "<HTML>Spicy Grilled Chicken, Assorted Greens & Vegetables, with vinagrette dressing.</HTML>", "WIPgrilled chicken salad.jpg", 13, false, false);
                
                thisMenu[8] = new Menu("Grilled Chicken Caesar Salad", "<HTML>Grilled Chicken, Romaine, Parmesan, Garlic Croutons, Bacon, Housemade Caesar dressing.</HTML>.", "WIPgrilled chicken caesar salad.jpg", 13.5, false, false);
                
                thisMenu[9] = new Menu("Potato Wedges", "<HTML>A huge bowl of golden brown potato wedges served with garlic dip.</HTML>", "WIPpotato wedges.jpg", 9, false, true);
                
                thisMenu[10] = new Menu("Curry Chips", "<HTML>Potato wedges smothered in curry sauce and onions.</HTML>", "WIPcurry chips.jpg", 10, false, true);
                
                thisMenu[11] = new Menu("Mozzarella Sticks","<HTML>Homemade cheese wedges fried golden brown with a side of marinara sauce.</HTML>", "WIPmozzarella sticks.jpg", 10, false, true);

                thisMenu[12] = new Menu("The Whole Shebang Breakfast", "<HTML>Three eggs, 2 slices of bacon, 3 sausages, extra beans, 2 hash browns, fried tomato and 2 slices of toast.</HTML>", "WIPthe whole shebang breakfast.jpg", 17, false, false);
                                
                break;
            }
        }
        
       
        
        //clear the combo box
        restaurantItems.removeAllItems();
        
        //enter new menu items into the combo box
        for (int k = 0; k < thisMenu.length; k++)
            {
                if (thisMenu[k] != null)
                    restaurantItems.addItem(thisMenu[k].getItem());
            }
        
        //set chosen item to the first item
        chosenItem=0;
        
        //debugging
        
        repaint(); 
    }
    
    public void displayMenuItem(int chosenItem)
    {
        //this method will set certain display variables to the item in the combo box like the picture, price and and item description. And repaint.
        
        formattedMenuPrice = myFormat.format(thisMenu[chosenItem].getPrice());
        currentItem = thisMenu[chosenItem].getItem();
        describe.setText(thisMenu[chosenItem].getDescription());
        showImage = getImage (getCodeBase(), thisMenu[chosenItem].getPicture());
        isSpicy = thisMenu[chosenItem].getSpicy();
        isVeggie = thisMenu[chosenItem].getVegetarian();
        
        checker = "" + isVeggie;
        repaint();
    }
    
    
    public void addToOrder(int chosenItem)
    {
        //this method will add the item selected in the combo box to the running order when the addfood button is pressed.
        thisOrder[itemsInOrder] = new Order(thisMenu[chosenItem].getItem(), currentRestaurant, thisMenu[chosenItem].getPrice());
        itemsInOrder++;
        
        //once there is something to order, enable send order button
        sendOrder.setEnabled(true);
          
        //insert last piece of instructions
        instructions3.setText("<HTML>Step 3: When you've selected your meal press 'Send Order'.</HTML>");
        instructions3.setIcon(downArrowIcon);
        instructions3.setHorizontalAlignment(JLabel.RIGHT);
        
        calculateCost();
    }
    
    public void removeFromOrder(int removeItem)
    {
        //this method will take away a particular item from the order
        
        //swap very last item with item that will be taken away
        thisOrder[removeItem] = thisOrder[itemsInOrder - 1];
        thisOrder[itemsInOrder - 1] = null; //nulls last item in order
        itemsInOrder = itemsInOrder -1; //subtract one from the items in order
        remove[itemsInOrder].setVisible(false);//get rid of the remove button
        
        if (itemsInOrder == 0)
            sendOrder.setEnabled(false);
        
        calculateCost();
    }
    
    public void calculateCost()
    {
        //this method calculates the cost of the order
        
        //put items in order of restaurant they come from
        orderRestaurants();
        //check how many restaurants user is ordering from
        numberOfRestaurants = checkRestaurants();
        
        totalBeforeTax = 0;
        
        //get price from each item in order
        for (int k = 0; k < itemsInOrder; k++)
            totalBeforeTax = totalBeforeTax + thisOrder[k].getPrice();
        
        formatBeforeTax = myFormat.format(totalBeforeTax);
        
        //update variables in the total section to reflect the prices with a new item      
        
        //7% tax added            
        tax = totalBeforeTax * .07;
        formatTax = myFormat.format(tax);
        
        //delivery is number of restaurants * $4
        deliveryCost = numberOfRestaurants * 4;
        formatDeliveryCost = myFormat.format(deliveryCost);
        
        //calculate total cost with tax and delivery
        totalCost = totalBeforeTax + tax + deliveryCost;
        formatTotalCost = myFormat.format(totalCost);
                
        
        repaint();
    }
    
    public void orderRestaurants()
    {
        swapper = new Order();
                
        //method will sort items in thisOrder by the restaurant they come from
        for (int k = 0; k < itemsInOrder; k++)
            {
                for (int j = 0; j < itemsInOrder; j++)
                    {   if (0 > (thisOrder[k].getFrom().compareTo(thisOrder[j].getFrom())))
                        {swapper = thisOrder[k];
                         thisOrder[k] = thisOrder[j];
                         thisOrder[j] = swapper;

                        }
                    }
            }
    }
    
    public int checkRestaurants()
    {
        //method will count how many restaurants are in order. This is reflected in the delivery fee
        lastRestaurant="";
        numberOfRestaurants = 0;
        for (int k = 0; k < itemsInOrder; k++)
            {
                if (!thisOrder[k].getFrom().equals(lastRestaurant))
                {
                    lastRestaurant = thisOrder[k].getFrom();
                    numberOfRestaurants++;                    
            }
        }
        
        return numberOfRestaurants;
    }
    
    public void actionPerformed( ActionEvent ae)
    {
        Object obj = ae.getSource();
        
        //if one of the restaurant buttons are pressed
        for (int i = 0; i < restaurant.length; i++)
        {
            if (obj == restaurant[i])
                {restaurantItems.removeActionListener(this); //turn off action listener for the combo box until all menu actions are performed
                 changeMenu(i); //calls up method to change the menu to new restaurant
                 restaurantItems.addActionListener(this); //turn combo box action listener back on
                 displayMenuItem(chosenItem);
                }
        }
             
        //this is triggered when the combo box is changed to reflect a new item. This is turned off when new menus are being put into the combo box because the change messes everything up.    
        if (obj == restaurantItems)
            {
                //find which item has been selected
                //checkItem1 = restaurantItems.getSelectedItem().toString();
                chosenItem = restaurantItems.getSelectedIndex();
                 
                                
                //set the chosen item integer to select the chosen item in all arrays
                /*for (int k = 0; k < thisMenu.length; k++)
                    {
                            checker = checkItem1 + "vs" + checkItem2;
                            repaint();
                            checkItem2=thisMenu[k].getItem();
                            if (checkItem1 == checkItem2)
                            chosenItem=k;*/
                    //}
                    //display the new item
                    displayMenuItem(chosenItem);
                    }
           
        //when addfood button is pressed add the chosen item to the order            
        if (obj == addFood)
            {addToOrder(chosenItem);
            }

        //when sendOrder button is pressed...not much will happen, just switch to screen 2
        if (obj == sendOrder)
            {
                startScreen = 2;
                repaint();
                sendOrder.setEnabled(false);
                addFood.setVisible(false);
                restaurantItems.setVisible(false);
                describe.setVisible(false);
            }
            
        for (int k = 0; k < remove.length; k++)
            {
                //will remove item (k) from order
                if (obj == remove[k])
                removeFromOrder(k);
                
            }
        //debugger
        //checker = chosenItem +"!";
        repaint();
    }
    
}
