<?php
//If the form is submitted
if(isset($_POST['submit'])) {

	//Check to make sure that the name field is not empty
	if(trim($_POST['contactname']) == '') {
		$hasError = true;
	} else {
		$name = trim($_POST['contactname']);
	}

	//Check to make sure that the subject field is not empty
	if(trim($_POST['subject']) == '') {
		$hasError = true;
	} else {
		$subject = trim($_POST['subject']);
	}

	//Check to make sure sure that a valid email address is submitted
	if(trim($_POST['email']) == '')  {
		$hasError = true;
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
		$hasError = true;
	} else {
		$email = trim($_POST['email']);
	}

	//Check to make sure comments were entered
	if(trim($_POST['message']) == '') {
		$hasError = true;
	} else {
		if(function_exists('stripslashes')) {
			$comments = stripslashes(trim($_POST['message']));
		} else {
			$comments = trim($_POST['message']);
		}
	}

	//If there is no error, send the email
	if(!isset($hasError)) {
		$emailTo = 'duffy@ocarrollcabinets.com'; //Put your own email address here
		$body = "Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments";
		$headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;

		mail($emailTo, $subject, $body, $headers);
		$emailSent = true;
	}
}
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="description" content="Custom Built Cabinetry in Orlando, Florida" />
	<meta name="keywords" content="Orlando, Florida Custom Cabinets, Custom Cabinets, Custom Built Cabinetry, Kitchen Refurb, Custom Kitchen Cabinets" />
	<meta name="author" content="RLMediaSolutions" />
	<meta name="copyright" content="2009 O'Carroll Custom Cabinets" />
	<meta name="robots" content="all" />

	<title>O'Carroll Custom Cabinets | Your shop for affordable custom cabinets out of Orlando, Florida</title>
    
    <script src="js/jquery.min.js" type="text/javascript"></script> 
    <script src="js/jquery.validate.pack.js" type="text/javascript"></script>   
    
    <script type="text/javascript">
	$(document).ready(function(){
	$("#contactform").validate();
	});
	</script>

	<link href="css/layout.css" rel="stylesheet" type="text/css" />
</head>

<body>

	<h1><span>O'Carroll Custom Cabinets, high quality custom cabinetry in and around Orlando, Florida at a reasonable price.</span></h1>
    
<div id="headerbg">
  <div id="headerblank">
    <div id="header">
    
      <div id="menu">
        <ul>
          <li class="tab1"><a href="index.html" title="O'Carroll Custom Cabinets Homepage">main</a></li>
          <li class="tab2"><a href="aboutocarroll.html" title="About O'Carroll Custom Cabinets">about</a></li>
          <li class="tab3on"><a href="contactocarroll.php" title="Contact O'Carroll Custom Cabinets in Orlando, Florida">contact</a></li>
          <li class="tab4"><a href="photogallery.html" title="Visit the O'Carroll Custom Cabinets project gallery">gallery</a></li>
        </ul>
      </div>
      
      <div id="leftbar">
        <div class="rightheading">
            <h4>contact O'Carroll</h4>
        </div>
         <div class="righttxt"><span class="rightboldtxt">online contact form</span><br />
         please feel free to use the contact form to the right. once I have recieved your submited email I will get back to you as soon as possible</div>
        <div class="righttxt">
          <p><span class="rightboldtxt">address</span><br />
            O'Carroll Custom Cabinets</p>
          <p>1255 Belle Avenue Suite 190<br />
            Winter Springs, Fl 32708</p>
        </div>
        <div class="righttxt"><span class="rightboldtxt">phone</span><br />
          office. 407-265-1513<br />
          cell. 407-496-5343<br />
          fax. 407-767-0293</div>
        <div class="righttxt"><span class="rightboldtxt">email</span><br />
        duffy@ocarrollcabinets.com</div>
      </div>
      
      <div id="contactus">
      
               <div id="contact-wrapper">
               
<?php if(isset($hasError)) { //If errors are found ?>
	<p class="error">Please check if you've filled all the fields with valid information. Thank you.</p>
<?php } ?>

<?php if(isset($emailSent) && $emailSent == true) { //If email is sent ?>
	<p class="emailsent">Email Successfully Sent!</p>
	<p class="emailty">Thank you <strong><?php echo $name;?></strong> for your interest in O'Carroll Custom Cabinets!  I will be in touch with you as soon as possible.</p>
<?php } ?>
               
	<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform">
		<div>
		    <label for="contactname" class="rightboldtxt">name:</label>
			<input type="text" size="90" name="contactname" id="contactname" class="required" value="" />
		</div>

		<div>
			<label for="email" class="rightboldtxt">email:</label>
			<input type="text" size="90" name="email" id="email" class="required email" value="" />
		</div>

		<div>
			<label for="subject" class="rightboldtxt">subject:</label>
			<input type="text" size="90" name="subject" id="subject" class="required" value="" />
		</div>

		<div>
			<label for="message" class="rightboldtxt">message:</label>
			<textarea rows="3" cols="70" name="message" id="message" class="required"></textarea>
		<input name="submit" type="submit" class="sendbutton" value="Send Message" />
        </div>
	    
	</form>
    
</div> 
      </div>
      
    </div>
  </div>
</div>

<div id="contentbg">
  <div id="contentblank">
    <div id="content">
      <div id="contentmid"></div>
      <div id="contentright">
      
        <div class="rightheading3">
          <h4>call us 407.265.1513</h4>
        </div>
        
    </div>
  </div>
</div>
</div>


<!-- begin footer -->
<div id="footerbg">
  <div id="footerblank">
    <div id="footer">

      <div id="footerlinks"><a href="index.html" class="footerlinks">main</a> | <a href="aboutocarroll.html" class="footerlinks">about</a> | <a href="contactocarroll.php" class="footerlinks">contact</a> | <a href="photogallery.html" class="footerlinks">gallery</a></div>
      <div id="copyrights">&copy; 2009 O'Carroll custom cabinets. all rights reserved.</div>
      <div id="designedby">site design by <a href="http://www.ryanluton.com" rel="external" class="designedby">rl media solutions</a> valid <a href="http://validator.w3.org/check?uri=http%3A%2F%2Focarrollcabinets.com%2F" rel="external" class="designedby">xhtml &amp; css</a></div>
    </div>
  </div>
</div>

</body>
</html>
