<?php
if (isset($_POST['AddMultiple']))
{
  $value=$_POST['destination']+1;
}
else if ( (isset($_POST['Remove'])) && ($_POST['destination']>1))
{
  $value=$_POST['destination']-1;
}
else
{
  $value =1;
}
?>

 <input name="destination" type="hidden" value="<?php echo $value?>"/>


 <br />

<?php
function createInput($name, $value, $type)
{
	return "<input type=\"{$type}\" class=\"ajax\" name=\"{$name}\" value=\"{$value}\"/>";
}

function make_form($i_text,$val) {
//print_r($val);
$form = null;
$text = 'destination';
$value = 'vancouver';
$type = 'hidden';
for($i = 1; $i <= $i_text; $i++)
{
/*for whistler we make the destionation default to vancouver and it's hidden*/
   /* $form .= "<label><br /> Destination #" .$i. " city or IATA airport code<br />" ;*/
    $input = createInput($text.$i, $value, $type);
	$form .= $input;
}

return $form;
}


echo make_form($value,$_POST);
?>

<!--
  We need a drop down list for locations and car modes
-->

<label> How are you getting to Whistler </label>

:&nbsp&nbsp

<select name="mode">
		<option value="car" >Car/Station Wagon </option>
		<option value="van">Van</option>
		<option value="sport">Sport-Utility Vehicle</option>
		<option value="truck">Pickup truck</option>
		<option value="hcar">Hybrid Car</option>
		<option value="hsuv">Hybrid SUV</option>
		<option value="cab">Cab</option>
	    <option value="limo">Limo</option>
		<option value="bus" selected="selected">Bus</option>
   </select>



