<?php
define("NOCACHE","OFF");

if(NOCACHE === "ON"){	
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache"); // HTTP/1.0
}

$_BROWSERACCESS = isset($_REQUEST['_BROWSERACCESS'])? "ON" : "OFF";
$_DEBUG = isset($_REQUEST['_DEBUG'])? "ON" : "OFF";
define("BROWSERACCESS",$_BROWSERACCESS);
define("DEBUG",$_DEBUG);  

if(DEBUG === "ON"){
	error_reporting(E_ALL);
	ini_set("display_errors", 1);
} else{
	error_reporting(0);
	ini_set("display_errors", 0);
}

$DS = DIRECTORY_SEPARATOR;
//DOCUMENT_ROOT is not defined in WINDO$E
if(!isset($_SERVER['DOCUMENT_ROOT'])){ 
  if(isset($_SERVER['SCRIPT_FILENAME'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( $DS.$DS, 
					     $DS, 
					     substr($_SERVER['SCRIPT_FILENAME'], 
						    0, 
						    0-strlen($_SERVER['PHP_SELF'])));
  }; 
 };

if(!isset($_SERVER['DOCUMENT_ROOT'])){ 
  if(isset($_SERVER['PATH_TRANSLATED'])){
    $_SERVER['DOCUMENT_ROOT'] = str_replace( $DS.$DS, 
					     $DS, 
					     substr(str_replace($DS.$DS.$DS.$DS, $DS.$DS, $_SERVER['PATH_TRANSLATED']), 
						    0, 
						    0-strlen($_SERVER['PHP_SELF'])));
  };
 };


define("SNIPPET_SIZE",100);//search snippet
define("PREZOOM_FOLDER",'prezoom');
define("PREZOOM_L",'landscape');
define("PREZOOM_P",'portrait');

//Alan Ryan [11 Mar 2011] - Update - Virtual/SymLink paths are causing problems
$refFile = substr(__FILE__,strlen(realpath($_SERVER['DOCUMENT_ROOT'])));
define("DEPLOYDIR",dirname($refFile) . DIRECTORY_SEPARATOR ); 
define("INSTALLDIR",dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR);
define("DATAFOLDER",dirname(INSTALLDIR).DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR);

require_once INSTALLDIR . "lib". DIRECTORY_SEPARATOR. "pub_info.php";
?>