<!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" xml:lang="en" lang="en">
	<head>

		<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />
		<meta name="MobileOptimized" content="width" />
		<meta name="HandheldFriendly" content="true" />

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

		<title><?php echo $blogname; ?></title>
		
		<?php 
		if ($contactimg != '') { 
		   $dispcontactimg = str_replace('.png','',$contactimg);
		   $dispcontactimg = stripslashes($dispcontactimg).'-sm.png';
		} else { 
		   $dispcontactimg = 'red-female-sm.png';
		} 
		?>

		<style type="text/css">
			.input, textarea { 
				background-color: #eaeaea; 
				border: 3px solid #454545; 
				border-radius: 10px; 
				width: 185px; 
				height: 30px; 
				margin: 10px 0 0px 45px; 
				padding: 0 10px 0 10px; 
				color: #595959; 
			}
			textarea { 
				height: 80px; 
				padding-top: 10px; 
			}
			.submitnow { 
				background: url('<?php echo $turl2; ?>/m_submitnow.png') no-repeat; 
				border: 0px; 
				width: 175px; 
				height: 56px; 
				margin: 2px 0 0 58px; 
			}
			.call_us_box { 
				background: url('<?php echo $murl; ?>/contactimg/<?php echo $dispcontactimg; ?>') no-repeat;
				width: 307px;
				height: 126px;
				font-family: "Franklin Gothic Medium";
				color: #f8e200;
				font-size: 28px;
				padding: 5px 0 0 40px;
				font-weight: bold; 
			}

		</style>
	
<script type="text/javascript">
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}
</script>

	</head>
	<body style="margin:auto;">

<?php
if ($options['status']=='0') {

echo '
<META HTTP-EQUIV="Refresh" content= "0;URL='.$optout.'">
';

} 
?>

	<div style="text-align: center; width: 100%; background-color: #002a54; font-family: Myriad Pro;margin: 0;padding:0;">

		<div style="background: url('<?php echo $turl2; ?>/m_topbar_bg.png') repeat-x; color: white; font-weight: bold; padding: 4px 8px;">
			<center><?php echo $topbartext; ?><br />
			<?php if ($phone != '') { 
				$pattern = "[^0-9]";
				$simplephone = eregi_replace($pattern,"",$phone); ?>
				<span style="font-size: 15px;">CALL US NOW:</span> 
				<span style="font-size: 18px; color: #f9d542;"><a style="font-size: 18px; color: #f9d542;" href = "tel:<?php echo $simplephone; ?>"><?php echo(stripslashes ($phone));?></a></span>
			<?php } ?>
			</center>
		</div>

	<div style="width: 320px; background-color: #002a54; font-family: Myriad Pro;margin: 0 auto; padding: 0 0 25px 0;">

<?php
if ($options['introtext']!='') {

echo '<center><blockquote><p style="font-family: Arial; font-size: 12px; font-weight: heavy; color: #fff;">'.$options['introtext'].'</p></blockquote></center>';

}
?>

			<?php
			if (isset($_POST['submit'])) { 
		
			   $fromname = $_POST['fromname'];
			   $fromemail = $_POST['fromemail'];
			   $number = $_POST['number'];
			   $project = $_POST['project'];
			   $comment = $_POST['comment'];

			   $blogname = $_POST['blogname'];
			   $contactimg = $_POST['contactimg'];
			   $turl2 = $_POST['turl2'];
			   $murl = $_POST['murl'];
			   $topbartext = $_POST['topbartext'];
			   $phone = $_POST['phone'];
			   $email = $_POST['email'];

			   $to = $blogname.': <'.$email.'>';
			   $subject = "Admin Message (Mobile): ".$blogname;
			   $message = 'Following is a message received from the contact form on '.$blogname.': '."\n\n".'Name: '.$fromname."\n\n".'Email: '.$fromemail."\n\n".'Number: '.$number."\n\n".$formadd.': '.$project."\n\n".'Comments: '.$comment."\n";
			   $headers = 'From: '.$email."\r\n";
      			   $headers .= "Reply-to: ".$email."\r\n";

			   if ($ccemail!='') {
      			      $headers .= "Cc: ".$ccemail."\r\n";
			   }

			   mail($to, $subject, $message, $headers);

			   echo '
			<div style="background: url(\''.$turl2.'/m_title_bar.png\') no-repeat; color: white; font-family: Tekton Pro; font-size: 25px; margin: auto; width: 278px; padding: 25px 0 0 0; height: 37px;">
				<center>Thank You!</center>
			</div>
				<div style="background: url(\''.$turl2.'/m_email_bg.png\') no-repeat; margin: auto; width: 301px; height: 375px;">
					<div style="color: white; width: 140px; padding: 50px 0 0 90px; font-size: 24px;" >Thank you for your inquiry ... we will be in touch with you shortly!</div>
				</div>';

			} else {

			   if ($formadd=='') {
			      $formadd='Your Project';
			   }

			   echo '
			<div style="background: url(\''.$turl2.'/m_title_bar.png\') no-repeat; color: white; font-family: Tekton Pro; font-size: 25px; margin: auto; width: 278px; padding: 25px 0 0 0; height: 37px;">
				<center>'.$formheading.'</center>
			</div>
				<div style="background: url(\''.$turl2.'/m_email_bg.png\') no-repeat; margin: auto; width: 301px; height: 375px;">
					<form action="'.$turl2.'/index.php" id="contactForm" method="post">
						<input type="text" onclick="clickclear(this, \'Your Name:\')" onblur="clickrecall(this,\'Your Name:\')" alt="" name="fromname" id="fromname" value="Your Name:" class="input"/>
						<input type="text" onclick="clickclear(this, \'Your Email:\')" onblur="clickrecall(this,\'Your Email:\')" alt="" name="fromemail" id="fromemail" value="Your Email:" class="input"/>
						<input type="text" onclick="clickclear(this, \'Your Phone Number:\')" onblur="clickrecall(this,\'Your Phone Number:\')" alt="" name="number" id="number" value="Your Phone Number:" class="input"/>
						<input type="text" onclick="clickclear(this, \''.$formadd.':\')" onblur="clickrecall(this,\''.$formadd.':\')" alt="" name="project" id="project" value="'.$formadd.':" class="input"/>
						<div class="textareabg"><textarea onclick="clickclear(this, \'Your Message:\')" onblur="clickrecall(this,\'Your Message:\')" name="comment">Your Message:</textarea></div>

						<input type="hidden" value="'.$blogname.'" name="blogname" />
						<input type="hidden" value="'.$contactimg.'" name="contactimg" />
						<input type="hidden" value="'.$turl2.'" name="turl2" />
						<input type="hidden" value="'.$murl.'" name="murl" />
						<input type="hidden" value="'.$topbartext.'" name="topbartext" />
						<input type="hidden" value="'.$phone.'" name="phone" />
						<input type="hidden" value="'.$email.'" name="email" />
						<input type="hidden" value="'.$formadd.'" name="formadd" />
						<input type="hidden" value="1" name="submit" />

						<input type="submit" value="" class="submitnow" name="roofer-send" id="roofer-send" />

					</form>
				</div>
			   ';
			}
			?>

			<?php if ($sidebarshow != 'true') { ?>

			<div class="call_us_box" >
			<?php if ($phone != '') { ?>
				<?php echo(stripslashes ($phone));?>
			<?php } ?>
			</div>

			<?php } ?>

			<?php if ($options['homelink']=='1') { 

			if ($options['hometext']=='') {
			   $hometext='No Thanks, Please Take Me Home';
			} else {
			   $hometext=$options['hometext'];
			} ?>

			<a style="margin: 0 0 25px 0; color: #f9d542;" href="<?php echo $optoutnret; ?>"><?php echo $hometext; ?></a>

			<?php } ?>

	</div>
	</div>
	</body>
</html>