<?php 
require('includes/settings.php');
require('includes/mysql_connect.php');
require('includes/funcs.php');
if (isset($_POST['submit']))
{
	$eligible = sanitize($_POST['submit']);
	if (substr($eligible,0,3) == 'Yes')
	{
		session_start();
		$_SESSION['eligible'] = 'Y';
		$randomString = substr( md5(uniqid(rand(), true)), 3, 10);
		$_SESSION['randomString'] = $randomString;

		header('Location: contest_page2.php');
	}
	else
	{
		//$strValidationB = '<h3 class="textCenter" style="color:white !important">Sorry. You must be over 18 to enter this contest</h3>';
		$strValidationB = 'invalid';
	}
}

include('includes/header.php'); 
?>

<body class="internal">
	<!-- <script src="../assets/scripts/jquery.screwdefaultbuttonsV2.js"></script> -->
	
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="ageForm" class="form" enctype="multipart/form-data" >
		<header>
		</header>
		<main class="container">
			<h3 class="defaultText textCenter" id="18warning"

			<?php if ($strValidationB) echo ' style="background-color:red;color:white"' ; ?>
			
			
				>YOU MUST BE OVER 18 YEARS OLD TO ENTER THIS CONTEST</h3><br>
			<div class="centerContent span12" align="center">
				
				<div class="vMiddle">
					<input type="submit" value="Yes, I am over 18 years old." name="submit" class="button buttonLRG validAGE" style="margin-bottom:20px;">	
				</div>
				
				<div class="vMiddle">
					<input type="submit" value="No, I am not over 18 years old." name="submit" class="button buttonLRG validAGE"  style="margin-bottom:27px;">
				</div>
				
				
			</div>
		</main>
	
		<footer class="clearfix">
		<div class="span2 column">
			<a href='index.php' class='button home homebutton'>HOME</a>
			</div>
			<div class="rulesnregs span8 column">
				<a href="#rules" class="fancybox" >CONTEST RULES AND REGULATIONS</a>
			</div>
			<div class="span2 column2">
							
			</div>
				<div id="rules">
					<?php include('rules.php') ?>
				</div>
		</footer>
	</form>

</body>
</html>