<?php include('header.php'); ?>

<!--<div id="cover_screen" style="display: block">
<a href="javascript:;"><img id="cover_image" src="cover_screen.png" onclick="cover_more()" onmouseover="this.src = 'cover_screen_active.png'" onmouseout="this.src = 'cover_screen.png'" /></a>
	<div id="cover_more" style="display: none">-->

	<div id="purchase">Purchase Carbon Offsets</div>

	<form id="route" name="route" method="post" action="index.php" onsubmit="return formValidator()" style="padding: 0px;">
	<table cellpadding="0" cellspacing="0" style="width: 510px; padding: 0px 0px 0px 10px; margin: 0px;">
		<tr><td style="width: 55%">Is your trip to Whistler</td><td style="width: 25%"><label><input name="Routing" type="radio" value="oneway" <?php echo (($_SESSION['Routing'] == "oneway") ? 'checked="checked"' : "" ) ?> />One way</label></td><td style="width: 20%"><label><input name="Routing" type="radio" value="return" <?php echo (($_SESSION['Routing'] != "oneway") ? 'checked="checked"' : "" ) ?> />Return</label></td></tr>

		<tr><td>Are you flying?</td><td><label><input name="FlyModeYes" type="radio" checked="checked" id="air" onclick="flying()" />Yes</label></td><td><label><input name="FlyMode" type="radio" value="ground" id="ground" onclick="riding()" />No</label></td></tr>

		<tr id="flying_from"><td><label>What city are you coming from?</td><td colspan="2"><input name="destination0" id="destination0" class="ajax align_right" type="text" value="<?php echo $_SESSION['destination0'] ?>" size="20" style="border: 2px solid #929295" /></label></td></tr>

		<?php /*<tr id="riding" style="display: none"><td><label>What city are you coming from?</td><td colspan="2"><input type="text" class="ajax_ground" name="ground_dest" id="ground_dest" value="<?php echo $_SESSION['ground_dest'] ?>" style="border: 2px solid #929295" /></label></td></tr>*/ ?>

		<tr id="riding" style="display: none"><td><label>What city are you coming from?</td><td colspan="2"><select name="ground_dest" id="ground_dest" style="border: 2px solid #929295">
		<?php
			$ground_dest = mysql_query('SELECT City FROM ground ORDER BY City ASC');
			while ($ground_city = mysql_fetch_row($ground_dest))
			{
				echo '<option value="'.$ground_city[0].'"';
				if ($_SESSION['ground_dest'] == $ground_city[0]) echo ' selected="selected"';
				echo '>'.$ground_city[0].'</option>';
			}
		?>
		</select></label></td></tr>

		<tr id="flying"><td>Where are you arriving into?</td><td><label><input name="FlyMode" type="radio" value="yvr" id="yvr" checked="checked" />Vancouver</label></td><td><label><input name="FlyMode" type="radio" value="sea" />Seattle</label></td></tr>

		<tr><td><label>How are you getting to Whistler?</td><td colspan="2">

		<?php $mode[$_SESSION['mode']] = 'selected="selected"'; ?>

		<select name="mode" class="align_right">
			<option value="bus" <?php echo $mode['bus'] ?>>Bus</option>
			<option value="cab" <?php echo $mode['cab'] ?>>Cab</option>
			<option value="car" <?php echo $mode['car'] ?>>Car</option>
			<option value="hcar" <?php echo $mode['hcar'] ?>>Hybrid Car</option>
			<option value="hsuv" <?php echo $mode['hsuv'] ?>>Hybrid SUV</option>
			<option value="limo" <?php echo $mode['limo'] ?>>Limo</option>
			<option value="truck" <?php echo $mode['truck'] ?>>Pickup truck</option>
			<option value="sport" <?php echo $mode['sport'] ?>>SUV</option>
			<option value="van" <?php echo $mode['van'] ?>>Van</option>
		</select></label></td></tr>

		<tr><td><label>How many travellers are you offsetting?</td><td colspan="2"><input name="passengers" id="passengers" type="text" value="<?php echo isset($_SESSION['passengers']) ? $_SESSION['passengers'] : '1' ?>" size="13" style="border: 2px solid #929295" class="align_right" /></label></td></tr>

		<tr><td></td><td colspan="2">
		<input type="hidden" name="destination" value="1" />
		<input type="hidden" name="destination1" value="vancouver" class="ajax" />
		<input type="hidden" name="confirm" value="calculate" />
		<input type="image" id="submit" value="calculate" src="calculate.png" />
		</td></tr>
		</table>
	</form>


	<script type="text/javascript" src="functions.js"></script>


	<script type="text/javascript">
		function flying()
		{
			document.getElementById('riding').style.display='none';
			document.getElementById('flying').style.display='';
			document.getElementById('flying_from').style.display='';
			document.getElementById('ground').checked=false;
			document.getElementById('yvr').checked=true;
		}

		function riding()
		{
			document.getElementById('riding').style.display='';
			document.getElementById('flying').style.display='none';
			document.getElementById('flying_from').style.display='none';
			document.getElementById('air').checked=false;
			document.getElementById('ground').checked=true;
		}

		<?php if ($_SESSION['flymode'] == 'ground') echo 'riding();' ?>
	</script>
<!--</div>
</div>-->

<?php

//if ($_SESSION['destination0'] || $_SESSION['ground_dest']) echo '<script type="text/javascript">cover_more()</script>';

include('footer.php');

?>