<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Gecko Logic</title>
<style type="text/css">

body {
	margin: 0px;
	padding: 0px;
}
h1			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:17px;
	color:#00469B;
	font-weight:bold;
}

p			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:12px;
	color:#333333;
}

td			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:12px;
	color:#333333;
}

li			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:14px;
	color:#333333;
	margin-bottom: 5px;
	font-weight:800;
}

ul			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:12px;
	color:#333333;
}

a			
{
	font-family:"Myriad Pro", Myriad, Arial, "Gill Sans MT", sans-serif;
	font-size:11px;
	color:#000000;
	font-weight:bold;
	text-decoration:none;
}

a:hover			
{ color:#f7b200; }

input,select,textarea,radio {
border:1px solid #333333;
font-size:11px;
color:#00469B;
background-color:#FFFFFF;
}
 .style1
        {
            color: #FF0000;
        }

.style2 {font-size: 12px}
</style>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>

<body>
<?php
if(!isset($_POST['post']) || empty($_POST['firstName']) || empty($_POST['lastName']) || empty($_POST['email']) || empty($_POST['phone'])) {
if(isset($_POST['post'])) { 
?>
<script language="javascript" type="text/javascript" >
alert('Please fill in the required fields');
</script>
<h4 style="color: #900">Please fill in the required fields.</h4>
<?php
 }
?>
<form name="infoForm" method="post" action="request_info_USA_new.php">
	<input type="hidden" name="post" value="post" >
  <table width="431" height="184" border="0" cellpadding="4" cellspacing="0">
  <tr>
            <td>
                <div align="right">
      <span class="style1">*</span>Indicates required field.                </div>            </td>
            <td>            </td>
        </tr>
    <tr>
      <td width="164"><div align="right">First Name</div></td>
      <td colspan="2"><input name="firstName" type="text" id="firstName" onBlur="MM_validateForm('firstName','','R');return document.MM_returnValue"><span class="style1"> *</span></td>
    </tr>
    <tr>
      <td><div align="right">Last Name</div></td>
      <td colspan="2"><input name="lastName" type="text" id="lastName" onBlur="MM_validateForm('lastName','','R');return document.MM_returnValue"><span class="style1"> *</span></td>
    </tr>
    <tr>
      <td><div align="right">Email</div></td>
      <td colspan="2"><input name="email" type="text" id="email" onBlur="MM_validateForm('email','','NisEmail');return document.MM_returnValue">
      <span class="style1"> *</span></td>
    </tr>
    <tr>
      <td><div align="right">Phone</div></td>
      <td colspan="2"><input name="phone" type="text" id="phone" onBlur="MM_validateForm('phone','','RisNum');return document.MM_returnValue"><span class="style1"> *</span></td>
    </tr>
    <tr>
      <td><div align="right">Best time to call</div></td>
      <td colspan="2"><input type="text" name="besttimetocall" id="besttimetocall"></td>
    </tr>
    <tr>
      <td><div align="right">Address</div></td>
      <td colspan="2"><input type="text" name="address"></td>
    </tr>
    <tr>
      <td><div align="right">City</div></td>
      <td colspan="2"><input type="text" name="city"></td>
    </tr>
    <tr>
      <td><div align="right">State</div></td>
      <td colspan="2">
	  <select name="state"> 
<option value="" selected="selected">Select a State</option> 
<option value="AL">Alabama</option> 
<option value="AK">Alaska</option> 
<option value="AZ">Arizona</option> 
<option value="AR">Arkansas</option> 
<option value="CA">California</option> 
<option value="CO">Colorado</option> 
<option value="CT">Connecticut</option> 
<option value="DE">Delaware</option> 
<option value="DC">District Of Columbia</option> 
<option value="FL">Florida</option> 
<option value="GA">Georgia</option> 
<option value="HI">Hawaii</option> 
<option value="ID">Idaho</option> 
<option value="IL">Illinois</option> 
<option value="IN">Indiana</option> 
<option value="IA">Iowa</option> 
<option value="KS">Kansas</option> 
<option value="KY">Kentucky</option> 
<option value="LA">Louisiana</option> 
<option value="ME">Maine</option> 
<option value="MD">Maryland</option> 
<option value="MA">Massachusetts</option> 
<option value="MI">Michigan</option> 
<option value="MN">Minnesota</option> 
<option value="MS">Mississippi</option> 
<option value="MO">Missouri</option> 
<option value="MT">Montana</option> 
<option value="NE">Nebraska</option> 
<option value="NV">Nevada</option> 
<option value="NH">New Hampshire</option> 
<option value="NJ">New Jersey</option> 
<option value="NM">New Mexico</option> 
<option value="NY">New York</option> 
<option value="NC">North Carolina</option> 
<option value="ND">North Dakota</option> 
<option value="OH">Ohio</option> 
<option value="OK">Oklahoma</option> 
<option value="OR">Oregon</option> 
<option value="PA">Pennsylvania</option> 
<option value="RI">Rhode Island</option> 
<option value="SC">South Carolina</option> 
<option value="SD">South Dakota</option> 
<option value="TN">Tennessee</option> 
<option value="TX">Texas</option> 
<option value="UT">Utah</option> 
<option value="VT">Vermont</option> 
<option value="VA">Virginia</option> 
<option value="WA">Washington</option> 
<option value="WV">West Virginia</option> 
<option value="WI">Wisconsin</option> 
<option value="WY">Wyoming</option>
</select>	  </td>
    </tr>
    <tr>
      <td><div align="right">Zip</div></td>
      <td colspan="2"><input type="text" name="zip"></td>
    </tr>
	
	
    <tr>
      <td><div align="right">AVG bill $</div></td>
      <td colspan="2"><input type="text" name="bill"></td>
    </tr>
    <tr>
      <td><div align="right">AVG KWH</div></td>
      <td colspan="2"><input type="text" name="kwh"></td>
    </tr>
    
    <tr>
      <td><div align="right"></div></td>
      <td width="105"><input type="button" name="Submit" value="Submit" onclick="self.location.href='freequote.htm'; forms['infoForm'].submit();"></td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>
  <p><span style="color: #00469B; font-weight: bold;">Toll Free: 1-760-840-7399</span></p>
  <p style="font-size: 10px">
<span class="style2">*We will protect your privacy. We will not disclose or sell your information to third parties. We will only use your information to evaluate if a solar power system will apply to you.</span><br>
</p>
</form>

<?php
}
else {
$requestDate = date('l, j F Y');
$emailHead = '<HTML><HEAD>
<style type="text/css">p			
{ font-family:"Trebuchet MS",lucida grande, luxi sans, helvetica, arial, sans-serif; font-size:12px; color:#333333; }
</style>
</HEAD>
<BODY>';
$emailBody = '<p>
<strong>Date of request:</strong> '. $requestDate .' <br>
<strong>First Name:</strong> '. $_POST['firstName'] .' <br>
<strong>Last name:</strong> '. $_POST['lastName'] .' <br>
<strong>Email:</strong> '. $_POST['email'] .' <br>
<strong>Phone:</strong> '. $_POST['phone'] .' <br>
<strong>Address:</strong> '. $_POST['address'] .' <br>
<strong>City:</strong> '. $_POST['city'] .' <br>
<strong>State:</strong> '. $_POST['state'] .' <br>
<strong>Zip:</strong> '. $_POST['zip'] .' <br>
<strong>Heard from:</strong> '. $_POST['heardfrom'] .' <br>
<strong>Roof type:</strong> '. $_POST['roofType'] .' <br>
<strong>Description:</strong> '. $_POST['desc'] .' <br>
<strong>AVG Bill:</strong> '. $_POST['bill'] .' <br>
<strong>AVG kWh\'s:</strong> '. $_POST['kwh'] .' <br>
<strong>Utility Co:</strong> '. $_POST['utilityCo'] .' <br>
</p>';
$emailBody = stripslashes($emailBody);
$emailFoot = '</BODY></HTML>';
?>
<h1>Thank you</h1>
<p>
Thank you for submitting your information. One of our representatives will contact you immediately!
</p>
<p>
We are looking forward to meeting with you!
</p>
<p>
Your GeckoLogic-USA Energy Team!
</p>
<?php
//echo $emailBody;
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: GeckoLogic website <noreply@geckologic.com>' . "\r\n";
mail('georg.eversheim@geckologic.com,leadsfromweb@geckologic.com,marco@sabaseo.com', "info request", $emailHead.$emailBody.$emailFoot, $headers);
//mail('benjamin@geminidigitalmedia.com', "info request", $emailHead.$emailBody.$emailFoot, $headers);
}
?>
</body>
</html>
