<?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>
    <title>George Mathis Movie Reservation System</title>

	<!-- first declare the voice handler. -->   
      <vxml:form id="movie">
	  <vxml:field xv:id="movie_name" name="movie_name">
	    <vxml:grammar> <![CDATA[
		#JSGF V1.0;
		grammar m_name;
		public <m_name> = Rent | The Legend of Zorro | Chicken Little | King Kong | Harry Potter and the Goblet of Fire | Doom ;
	    ]]>
	   </vxml:grammar>
             
	   <vxml:prompt> Welcome to the George Mathis Movie Reservation System 
	   </vxml:prompt>
            <vxml:prompt xv:src="#movie_label"/>
            <vxml:catch event="help nomatch noinput" count="1">
              Please say the name of the movie from the above list, For example Rent 		             </vxml:catch>
	     
	    <vxml:catch event="help nomatch noinput" count="2">
              Please select a valid movie from the list.
            </vxml:catch>
	  
	    <vxml:catch event="help nomatch noinput" count="3">
              We're sorry . Please try again later.
	      <!-- <vxml:exit/> -->
            </vxml:catch>
          </vxml:field>

	<vxml:field xv:id="day" name="day">
	    <vxml:grammar> <![CDATA[
		#JSGF V1.0;
		grammar d_name;
		public <d_name> = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday;
	    ]]>
	   </vxml:grammar>
             
            <vxml:prompt xv:src="#day_label"/>
            <vxml:catch event="help nomatch noinput" count="1">
               We're sorry. Please say a valid day.
		<!-- <reprompt/> -->
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="2">
                We're sorry. Please say the day again.
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="3">
                 We're sorry. Please try again later.
		<!-- <exit> -->
            </vxml:catch>
         </vxml:field>

	<vxml:field xv:id="time_name" name="time_name">
	    <vxml:grammar> <![CDATA[
		#JSGF V1.0;
		grammar t_name;
		public <t_name> = 1  | 3  | 5  | 8  | 9  ;
	    ]]>
	   </vxml:grammar>
             
            <vxml:prompt xv:src="#time_label"/>
       	    <vxml:catch event="help nomatch noinput" count="1">
               We're sorry. Please say a valid time.
		<!-- <reprompt/> -->
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="2">
                We're sorry. Please say the time again.
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="3">
                 We're sorry. Please try again later.
		<!-- <exit> -->
            </vxml:catch>
	   </vxml:field>

	<vxml:field xv:id="tickets" name="tickets" >
        	<vxml:prompt> Ok. How many tickets would you like to reserve? 				</vxml:prompt>
		 <vxml:grammar> <![CDATA[
		#JSGF V1.0;
		grammar t_name;
		public <t_name> = 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20  ;
	    ]]>
	   </vxml:grammar>
		<vxml:catch event="help nomatch noinput" count="1">
               We're sorry. Please say a valid number.
		<!-- <reprompt/> -->
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="2">
                We're sorry. Please say the number again.
            </vxml:catch>

	    <vxml:catch event="help nomatch noinput" count="3">
                 We're sorry. Please try again later.
		<!-- <exit> -->
            </vxml:catch>
		<vxml:filled>
			<vxml:prompt xv:src="#tconfirm"/>
		</vxml:filled>
         </vxml:field>   
 		   
        </vxml:form>  
      <!-- done voice handler -->

      <!-- declare inputs synchronized with VoiceXML fields -->
         <xv:sync xv:input="ml" xv:field="#movie_name"/>
	 <xv:sync xv:input="day_name" xv:field="#day"/>
	 <xv:sync xv:input="time" xv:field="#time_name"/>
	 <xv:sync xv:input="num_tickets" xv:field="#tickets"/> -->
        <xv:cancel id="voice_cancel"/>
  </head>
  <body bgcolor="pink" ev:event="load" ev:handler="#movie">
    <h1> George Mathis Movie Reservation System </h1>

    <p>This system permits users to enter their choices using either keyboard or speak 		the same information.
    </p>
    <h2>Welcome to the Movie Selector</h2>
	<form id="movie_query" >
	      <p>Your available choices of movies:</p><br/> 	
	<table border="0" cellpadding="10"  >   
		<tr>
		    <td align="center"> <img src="./rent_earlyposter.jpg" alt="Rent" 			border="2"/> </td> 
		    <td align="center"> <img src="./chickenlittle_teaserposter.jpg" 			alt="Chicken Little" border="2"/></td>
		    <td align="center"> <img src="./kingkong_teaserposter.jpg" alt="King 			Kong" border="2"/> </td>
		</tr>
		<tr> 
			<td align="center"><b> Rent</b></td>  <td align="center"><b> 			Chicken Little </b></td> <td align="center"><b> King 			Kong</b></td> 
		</tr> 
		<tr>
		    <td align="center"><img 			src="./harrypotterandthegobletoffire_releaseposter.jpg" 					alt="Harry Potter" border="2"/></td> 

  		   <td align="center"><img src="./thelegendofzorro_releaseposter.jpg" 			 		alt="The Legend of Zorro" border="2"/></td> 
		    <td align="center"><img src="./doom_releaseposter.jpg" alt="Doom" 			border="2"/> </td>
		</tr>
		<tr><td align="center"><b> Harry Potter and the<br/> Goblet of 		Fire</b></td> <td><b> The Legend of Zorro   </b> </td> <td 		align="center"> 			<b>Doom</b></td> </tr>
	</table><br/><br/>
	  
    
      <label id="movie_label">  Please select a movie from the above choices.

      <input name="ml" type="text"/>
      </label><br/><br/> 

	<label id="day_label"> Ok now please say the day for which you would like to 		reserve tickets 
      		<input name="day_name" type="text" />
	</label><br/><br/>
   
  	<label id="time_label"> Ok, the availabe showtimes are 1pm, 3pm, 5pm, 8pm and 		9pm. Please select your showtime.
      		<input name="time" type="text"/>
      </label><br/><br/>

	<label id="tick_num"> Ok, how many tickets would you like to reserve ?
      		<input name="num_tickets" type="text"/>
        </label><br/><br/>

	<p id="tconfirm"> Please review the above information and click Submit to 		continue booking or Reset to start again. </p>
          <br/><br/>

      
      <input type="submit" value="Submit"/>
      <input type="reset" value="Reset"
		 ev:event="click" xv:handler="#voice_cancel"/>
    </form>
  </body>
</html>



