<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:vxml="http://www.w3.org/2001/vxml"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xv="http://www.voicexml.org/2002/xhtml+voice">
     <head>
        <vxml:form id="food_order_form">
           <vxml:field name="voice_typeOfEat" xv:id="voice_typeOfEat">
                  <vxml:prompt>Do you would to eat breakfast, lunch or dinner?</vxml:prompt>
                  <vxml:grammar src="eat.grxml" />
                  <catch event="noinput nomatch">
                          I did not hear your input or no match
                          <reprompt/>
                  </catch>
                  <catch event="help">
                          your input should be breafast, lunch or dinner
                         <reprompt/>
                  </catch>
           </vxml:field>
           <vxml:field name="fruit">
                  <vxml:prompt>with a apple, orange juice or banana?</vxml:prompt>
                  <vxml:grammar src="fruit.grxml" />
                  <vxml:catch event="noinput nomatch">
                     <vxml:prompt>
                          I did not hear your input or no match
                     </vxml:prompt>
                  </vxml:catch>
                  <vxml:catch event="help">
                     <vxml:prompt>
                          your input should be apple, orange juice or banana
                     </vxml:prompt>
                  </vxml:catch>
                  <vxml:filled>
                       <if cond="fruit=='apple'">
                          <assign name="document.getElementById('apple').checked"  expr="true"/>
                       <elseif cond="fruit=='orange juice'"/>
                          <assign name="document.getElementById('orangejuice').checked"  expr="true"/>
                       <elseif cond="fruit=='banana'"/>
                          <assign name="document.getElementById('banana').checked"  expr="true"/>
                       <else/>
                           <vxml:prompt>nomatch</vxml:prompt>
                       </if>
                  </vxml:filled>
           </vxml:field>
           <vxml:field name="drink">
                  <vxml:prompt>and a drink coke, sprint or pepsi?</vxml:prompt>
                  <vxml:grammar src="drink.grxml" />
                  <vxml:catch event="noinput nomatch">
                     <vxml:prompt>
                          I did not hear your input or no match
                     </vxml:prompt>
                  </vxml:catch>
                  <vxml:catch event="help">
                     <vxml:prompt>
                          your input should be coke, sprint or pepsi
                     </vxml:prompt>
                  </vxml:catch>
                  <vxml:filled>
                       <if cond="drink=='coke'">
                          <assign name="document.getElementById('coke').checked"  expr="true"/>
                       <elseif cond="drink=='sprint'"/>
                          <assign name="document.getElementById('sprint').checked"  expr="true"/>
                       <elseif cond="drink=='pepsi'"/>
                          <assign name="document.getElementById('pepsi').checked"  expr="true"/>
                       <else/>
                           <vxml:prompt>nomatch</vxml:prompt>
                       </if>
                  </vxml:filled>
           </vxml:field>
           <vxml:field name="confirm_order" xv:id="confirm_order" type="boolean">
                  <vxml:prompt>are you sure to order?</vxml:prompt>
                  <vxml:filled>
                     <vxml:if cond="confirm_order==true">
                         Thank you.
                         <vxml:return/>
                     </vxml:if>
                  </vxml:filled>
           </vxml:field>
        </vxml:form>
        <xv:sync xv:input="typeOfEat" xv:field="#voice_typeOfEat"/>
        <xv:sync xv:input="submit" xv:field="#confirm_order"/>
     </head>
     <body ev:event="load" ev:handler="#food_order_form">
        <form action="http://www.cs.pdx.edu/~quangh/bluesky/cgi/menufood.cgi" method="post">
          <table align="center">
              <tr>
                  <td colspan="4"><h1>Order Fast Food Menu</h1></td>
              </tr>
              <tr>
                 <td><b> Eat:</b></td>
                 <td>
                       <select id="typeOfEat" name="typeOfEat">
                         <option value=""></option>
                         <option value="breakfast">breakfast</option>
                         <option value="lunch">lunch</option>
                         <option value="dinner">dinner</option>
                       </select>
                 </td>
              </tr>
              <tr>
                  <td>with a:</td>
              </tr>
              <tr>
                  <td></td>
                  <td>
                     <input type="radio" name="fruit" id="apple" value="apple" checked="checked"/>apple
                     &#160;<input type="radio" name="fruit" id="orangejuice" value="orange juice"/>orange juice
                     &#160;<input type="radio" name="fruit" id="banana" value="banana"/>banana
                  </td>
              </tr>
              <tr>
                  <td>and a drink:</td>
              </tr>
              <tr>
                  <td></td>
                  <td>
                     <input type="radio" name="drink" id="coke" value="coke" checked="checked"/>coke
                     &#160;<input type="radio" name="drink" id="sprint" value="sprint"/>sprint
                     &#160;<input type="radio" name="drink" id="pepsi" value="pepsi"/>pepsi
                  </td>
              </tr>
              <tr>
                  <td align="center">
                      <input type="submit" name="submit" value="Order"/>
                  </td>
              </tr>
          </table>
        </form>
     </body>
</html>