// *** SESSION CODE MUST BE AT THE VERY TOP OF PAGE TO WORK
header("ETag: PUB" . time());
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()-10) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5) . " GMT");
header("Pragma: no-cache");
header("Cache-Control: max-age=1, no-store, no-cache, must-revalidate, proxy-revalidate, private");
header("Cache-Control: post-check=0, pre-check=0", false);
session_cache_limiter('private, must-revalidate, nocache,no-store');
session_start();
include("contact/refersettings.php");
include("contact/lang.php");
if($checkReferer == "y")
{
   $referer = $_SERVER['HTTP_REFERER'];
  
   if(!isset($_SESSION['theRef']))
   {
     if(!stristr($referer,$domain) && !stristr($referer,$altdomain))
     {
      
      include("contact/ireferer.php");
      exit();
    }
  }
} 
if (!isset($_SESSION['theIP']))
{
   $_SESSION['verstring'] = 0;
   $_SESSION['theIP'] = $_SERVER["REMOTE_ADDR"];
   $_SESSION['theTime'] = time();
   $_SESSION['theRef'] = 1;
   $_SESSION['accesses'] = 1;
   
}
else
{
   $currentTime = time();
   $checkTime = $_SESSION['theTime'];
   $checkTime = $checkTime + $delayTime;
 // echo"$checkTime <-- checktime currenttime --> $currentTime
"; 
   if($currentTime < $checkTime)
   {
     if($useTrueDelayTime == "y")
    {
        $trueDelayTime = $checkTime - $currentTime; 
    }
     else
    {
     	$trueDelayTime = $delayTime;
    }
     include("contact/delayed.php");
     exit();
  }
}
$accessCount = $_SESSION['accesses'];
if($accessCount > $totalAccesses)
{
   include("contact/limitavailability.php");
   exit();
} 
$theTime = time();
//create a hash
//***END TOP OF PAGE CODE
?>