<?php
	/*
	** File: box
	** Description: functions for drawing nice boxes around things
	** using tables.
	** Version: $Revision: 1.4 $
	** Created: 9/22/99
	** Author: Leon Atkinson
	** Email: leon@clearink.com
	** CVS Author: $Author: leon $
	** Last Revised: $Date: 2000/02/03 16:58:01 $
	** Log : $Log: box,v $
	** Log : Revision 1.4  2000/02/03 16:58:01  leon
	** Log : Fixing box code to work with Mozilla
	** Log :
	** Log : Revision 1.2  1999/09/29 17:46:52  leon
	** Log : Changed code that stops double-inclusion of box module because, as
	** Log : Jeremiah Bellomy suggested, putting return inside of curly braces is
	** Log : broken.
	** Log :
	** Log : Revision 1.1  1999/09/23 00:02:37  leon
	** Log : Preliminary support for colors and styles to reside in global_settings.
	** Log : The only place this is used right now is in a new module called 'box'.  The
	** Log : box module allows you to draw a box around an area using tables.  The box
	** Log : will be a flat color.  This has to be accomplished in two ways, depending
	** Log : on the browser. Older browsers don't support it at all.
	** Log :
	**
	** Copyright (c) 1999 Working Dogs.  All rights reserved.
	*/

	/*
	** Ensure that these functions aren't included twice
	*/

	$included_flag = 'INCLUDE_' . basename(__FILE__);
	
	if(defined($included_flag))
		//if this module has been included already, then the
		//constant will be defined.  Note the unusual use of
		//the return statement here.  Control will return to
		//the file that included it.
		return;
	
	define($included_flag, TRUE);	
	


	function startBox($BoxTitle=FALSE, $BoxOptions=FALSE)
	{
		global $Browser_Name;
		global $Browser_Version;
		global $SiteColor;

		if(($Browser_Name == "Mozilla") AND ($Browser_Version >= 3))
		{
			print("<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" COLOR=\"".$SiteColor['Border']."\">\n");
			print("<TR>\n");
			print("<TD BGCOLOR=\"".$SiteColor['Border']."\">\n");
	
			print("<TABLE BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"6\" WIDTH=\"100%\">\n");
		}
		elseif(($Browser_Name == "MSIE") AND ($Browser_Version >= 3))
		{
			print("<TABLE BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"6\" BORDERCOLOR=\"".$SiteColor['Border']."\">\n");
		}
		else
		{
			print("<TABLE BORDER=\"1\">\n");
		}

		if($BoxTitle)
		{
			print("<tr><td bgcolor=\"$SiteColor->Highlight2\">");
			print("<b>$BoxTitle</b>");
			
			if($BoxOptions) 
			{	
				print(" &nbsp; | &nbsp; $BoxOptions\n");
			}
			
			print("</td></tr>\n");
		}
		print("<TR>\n");
		print("<TD BGCOLOR=\"".$SiteColor['TableBackground']."\">\n");
	
	}
	
	
	function endBox()
	{
		global $Browser_Name;
		global $Browser_Version;
	
		if(($Browser_Name == "Mozilla") AND ($Browser_Version >= 3))
		{
			print("</TD>\n");
			print("</TR>\n");
			print("</TABLE>\n");
	
			print("</TD>\n");
			print("</TR>\n");
			print("</TABLE>\n\n");
		}
		else
		{
			print("</TD>\n");
			print("</TR>\n");
			print("</TABLE>\n\n");
		}
	
	}
?>