<?php

session_name("fancyform");
session_start();


$_SESSION['n1'] = rand(1,20);
$_SESSION['n2'] = rand(1,20);
$_SESSION['expect'] = $_SESSION['n1']+$_SESSION['n2'];


$str='';
if($_SESSION['errStr'])
{
	$str='<div class="error">'.$_SESSION['errStr'].'</div>';
	unset($_SESSION['errStr']);
}

$success='';
if($_SESSION['sent'])
{
	$success='<h1>Thank you!</h1>';
	
	$css='<style type="text/css">#contact-form{display:none;}</style>';
	
	unset($_SESSION['sent']);
}
?>
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/home/fraction/public_html/cmsAdmin/lib/viewer_functions.php";

  list($contactRecords, $contactMetaData) = getRecords(array(
    'tableName'   => 'contact',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $contactRecord = @$contactRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$contactRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fraction Facts: Contact Us</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="description" content="Who to talk to about fractional ownership or shared ownership opportunities in Australia" />
<meta name="keywords" content="help, fractional ownership, shared ownership, experts, support, how to, consultants" />

<link rel="stylesheet" href="css/fractionfacts.css" type="text/css" />
<script src="js/click.js" type="text/javascript"></script>
<script src="js/jquery-1.4.min.js" type="text/javascript"></script>

		<script src="js/cufon-yui.js" type="text/javascript"></script>
		<script src="js/Maiandra_GD_400.font.js" type="text/javascript"></script>
		<script type="text/javascript">
			Cufon.replace('h1');
			Cufon.replace('h3');
		</script>
		<script src="js/jquery.droppy.js" type="text/javascript"></script>
		<script type='text/javascript'>
          $(function() {
            $('#nav').droppy();
          });
        </script>
<link rel="stylesheet" type="text/css" href="jqtransformplugin/jqtransform.css" />
<link rel="stylesheet" type="text/css" href="formValidator/validationEngine.jquery.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />

<?=$css?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js"></script>
<script type="text/javascript" src="formValidator/jquery.validationEngine.js"></script>

<script type="text/javascript" src="script.js"></script>

</head>
<body>
<div id="pagewidth" >

    <?php
    include("insertHeader.php");
    ?> 
    
    <?php
    include("insertNavigation.php");
    ?>    
    <div id="wrapper" class="clearfix" ><div id="rightcol">
			<?php
            include("insertRightPanel.php");
            ?>   
        </div>
<div id="maincol_text"> 

    <h1>Registration of Interest</h1><div id="previousPage"> | <a href="javascript:history.go(-1)">Previous Page</a></div>
    <div class="clearfix"></div>
<div id="main-container">

	<div id="form-container">
    <h1>Viridian Registration</h1>
    <h2>blurb goes here</h2>
    
    <form id="contact-form" name="contact-form" method="post" action="submit.php">
    <input type="hidden" value="Viridian Registration" name="subject" id="subject" />
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="15%"><label for="name">Name</label></td>
          <td width="70%"><input type="text" class="validate[required]" name="name" id="name" value="<?=$_SESSION['post']['name']?>" /></td>
          <td width="15%" id="errOffset">&nbsp;</td>
        </tr>
        <tr>
          <td width="15%"><label for="phone">Phone</label></td>
          <td width="70%"><input type="text" class="validate[required]" name="phone" id="phone" value="<?=$_SESSION['post']['phone']?>" /></td>
          <td width="15%" id="errOffset">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top"><label for="address">Address</label></td>
          <td><textarea name="address" id="address" class="validate[required]" rows="2"><?=$_SESSION['post']['address']?></textarea></td>
          <td valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td width="15%"><label for="suburb">Suburb</label></td>
          <td width="70%"><input type="text" class="validate[required]" name="suburb" id="suburb" value="<?=$_SESSION['post']['suburb']?>" /></td>
          <td width="15%" id="errOffset">&nbsp;</td>
        </tr>
        <tr>
          <td width="15%"><label for="state">State</label></td>
          <td width="70%"><input type="text" class="validate[required]" name="state" id="state" value="<?=$_SESSION['post']['state']?>" /></td>
          <td width="15%" id="errOffset">&nbsp;</td>
        </tr>
        <tr>
          <td width="15%"><label for="postcode">Postcode</label></td>
          <td width="70%"><input type="text" class="validate[required]" name="postcode" id="postcode" value="<?=$_SESSION['post']['postcode']?>" /></td>
          <td width="15%" id="errOffset">&nbsp;</td>
        </tr>
        <tr>
          <td><label for="email">Email</label></td>
          <td><input type="text" class="validate[required,custom[email]]" name="email" id="email" value="<?=$_SESSION['post']['email']?>" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td valign="top"><label for="message">Message</label></td>
          <td><textarea name="message" id="message" rows="5"><?=$_SESSION['post']['message']?></textarea></td>
          <td valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td><label for="captcha">Security Check:<br /><?=$_SESSION['n1']?> + <?=$_SESSION['n2']?> =</label></td>
          <td><input type="text" class="validate[required,custom[onlyNumber]]" name="captcha" id="captcha" /></td>
          <td valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top">&nbsp;</td>
          <td colspan="2"><input type="submit" name="button" id="button" value="Submit" />
          <input type="reset" name="button2" id="button2" value="Reset" />
          
          <?=$str?>          <img id="loading" src="img/ajax-load.gif" width="16" height="16" alt="loading" /></td>
        </tr>
      </table>
      </form>
      <?=$success?>
    </div>

</div>
    </div>
    </div>

    <?php
    include("insertFooter.php");
    ?>   

</div>
    <?php
    include("insertGooglecode.php");
    ?>   
</body>
</html>