<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN"
                        "http://www.phone.com/dtd/wml11.dtd" >

<wml>              
 
<!-- Display the splash screen. The user can either 
     start a game or reset the default board size -->       
         
  <card id="start">
  
    <onevent type="onenterforward" >
      <refresh>
        <setvar name="iheight" value="5" />
        <setvar name="iwidth" value="10" />
      </refresh>
    </onevent>    
    
    <p align="center" >           
      <big>              
      <br/> 
      <img alt="Battleships!" src="bship.bmp"/><br/>          
      </big>
      <select>
        <option onpick="bships.wmls#InitBoard()"> 
          Play
        </option>
        <option onpick="bships.wml#bsize">    
          Set Board Size 
        </option>
      </select>
    </p>
  </card>                

<!-- Display the playing board and let the user fire a torpedo -->             
                
  <card id="display" > 
    <do type="accept" label="Fire" >             
      <go href="bships.wml#fire" />             
    </do>             

    <p align="center">
      <b>
      <br/> $gLine1          
      <br/> $gLine2                
      <br/> $gLine3          
      <br/> $gLine4          
      <br/> $gLine5         
      <br/> $gLine6
      </b>      
    </p>                        
  </card>

<!-- Get a pair of firing coordinates and fire a torpedo -->

  <card id="fire" >
    <do type="accept">
      <go href="bships.wmls#FireTorpedo($row,$col)" />
    </do>

    <p>
      Select firing location: <br/>
      Row (1-$(iheight)):
      <input name="row" format="1N" emptyok="false" maxlength="1" />
      Column (1-$(iwidth)):
      <input name="col" format="*N" emptyok="false" maxlength="2" />
    </p>
 </card>
             
<!-- Get the user's preferred board size -->

  <card id="bsize" >
    <do type="accept" >
      <go href="bships.wmls#InitBoard()" />
    </do>

    <p>
      Rows (1-5):
      <input name="iheight" value="5" format="1N" 
        emptyok="false" maxlength="1"/>      
      Columns (5-15):
      <input name="iwidth" value="15" format="*N"
        emptyok="false" maxlength="2" />
    </p>	
 </card>

</wml>              
