<?php

#the .htfolder.inc.php file for the valID folder.
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/pear");

$script=$_SERVER["SCRIPT_FILENAME"];
$self=$_SERVER["PHP_SELF"];
$file=substr(strrchr($script,"/"),1);
$directory=substr($script,0,strlen($script)-strlen($file)-1);
$logdirectory=$directory;
$logfilename="valID.log";
$common_folder="./";
define ("DEBUGMU",true);
if (!defined("ALLSITES")) define("ALLSITES","/var/www/sites/allsites");
include_once(ALLSITES."/.htreportingerrors.inc.php");
#include_once($common_folder.".htloggywoggy.php");
loggywoggy($_SERVER["REQUEST_URI"]." from ".$_SERVER["REMOTE_ADDR"]);
if ($_SERVER["REQUEST_METHOD"] == "POST") buggywuggy(print_r($POST,TRUE));
#Eliminated setup.inc and moved the following statements here to replace the include statement.

echo "Including DB.php.";
require_once("MDB2.php");
#require_once("DB.php");
require_once(ALLSITES."/.htDBselect.php");
echo "Including .htsite.inc.php.";

include_once ($common_folder.".htsite.inc.php");
echo "Including .htfunctions.inc.php.";

#include_once ("$allsites/.htfunctions.inc.php");
include_once (ALLSITES."/.htpresent.inc.php");
echo "Including .htauthentify.inc.php.";
include_once($common_folder.".htauthentify.inc.php");
echo "I think they're all included now.";
define('OSNAMES',"fr-FreeBSD,li-Linux,ma-Macintosh,wi-Windows");

define('BROWSERS',"ff-FireFox,ie-Internet Explorer,ko-Konqueror,mo-Mozilla,op-Opera");

define('OURNAME',"ValID");

define('OURDOMAIN',"authentrus.com");
define ('MAXCOLUMNS',33);		#Ridiculously hign number of columns for a table, to be more than the number of menues.

function page_bottom($menues="")
{
	echo "\n\n<HR>\n</TD></TR>";			#Closes the line opened in page_top.
	if(strlen($menues) == 0) {global $menubar;$menu=$menubar;}
	else $menu=$menues;
	if (strlen($menues) >0) echo "\n<TR>$menues</TR>";
	echo "\n<TR><TD colspan=".MAXCOLUMNS." align=center>&copy;".thisyear(2007)." The Village Group</TD></TR>";
	echo "\n</TABLE>";
	echo "\n</BODY></HTML>";
}
function page_top($title="",$metas="",$menues="")
{
	echo "<HTML><HEAD><TITLE>$title</TITLE>\n$metas\n</HEAD>";
	echo "<BODY>";
	echo "\n<TABLE>";
	if(strlen($menues) == 0) {global $menubar;$menu=$menubar;}
	else $menu=$menues;
	if (strlen($menu) >0) echo "\n<TR>$menu</TR>";
	echo "\n<TR><TD colspan=".MAXCOLUMNS.">\n<HR>\n";	#Opens a line closed in page_bottom.
	register_shutdown_function("page_bottom",$menues);
}

/*
function addMessage($msg)
{
	return "<BR>$msg";
}
function addError($error)
{
	return "<BR>$error";
}
*/

function addMenu($link,$text="Click Here")
{
	global $menubar;
	$a="\n<TD><A href=\"$link\">$text</A></TD>";
	$menubar.=$a;
	return $a;
}
$menubar="";
$msgs="";
$errors="";
if ($live > 1) $msgs.=addMessage("\n<H2><FONT color=red>This is still in test mode.</FONT></H2>");
?>
