<?php
#############################################################################
#                              Site@School
# main.inc.php: last changed 29/06/2006  , version: 2.4.02
# by Fred Stuurman  (fc.stuurman@hccnet.nl)
# LICENSE INFORMATION: see LICENCE.txt in starnet directory
#$Id: main.inc.php,v 1.1 2006/10/03 11:13:16 fstuurman Exp $
#############################################################################
if ( !defined('IN_SAS') )
{
	die("Hacking attempt");
}
?>
<html>
<head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> 
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $sas_lang['lang_charset']?>">
<?php
print "<title>$sitename - $pagetitle</title>";
?>
<link rel="StyleSheet" href="<?php echo $cmsdir ?>/themes/<?php echo $themelocation ?>/style.css" type="text/css">

<script TYPE="text/javascript" language="javascript">
// if form exists , set cursor in first input field
function focusonform()
{
	if (document.forms[0])
	{
	document.forms[0].elements[0].focus();
	}
	else
	{
	window.focus();
	}
}
</script>
</head>

<?php
if($site == "protected") 
{
$header_parm = explode(",", $sas_config['template_header_prot']);               //get header parms in an array
$section_parm = explode(",", $sas_config['template_section_prot']);             //get section parms in an array
$status_parm = explode(",", $sas_config['template_status_prot']);               //get status parms in an array
$menu_parm = explode(",", $sas_config['template_menu_prot']);                   //get left menu parms in an array
$content_parm = explode(",", $sas_config['template_content_prot']);             //get content parms in an array
$footer_parm = explode(",", $sas_config['template_footer_prot']);               //get footer parms in an array
} 
else 
{
$header_parm = explode(",", $sas_config['template_header']);                    //get header parms in an array
$section_parm = explode(",", $sas_config['template_section']);                  //get section parms in an array
$status_parm = explode(",", $sas_config['template_status']);                    //get status parms in an array
$menu_parm = explode(",", $sas_config['template_menu']);                        //get left menu parms in an array
$content_parm = explode(",", $sas_config['template_content']);                  //get content parms in an array
$footer_parm = explode(",", $sas_config['template_footer']);                    //get footer parms in an array
}
$general_parm = explode(",", $sas_config['template_general']);                  //get footer parms in an array
print "<body bgcolor=\"$general_parm[1]\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">";

if($general_parm[0] == 1 ) 
{
print "<center>"; 
}

print "<table style=\"border:$general_parm[3]px solid $general_parm[4]\" cellpadding=\"0\" cellspacing=\"0\" width=\"$general_parm[2]\">";

                                                                        //load header script 
    if($header_parm[0] == 1) 
	{
    print "<tr><!-- Here starts header part -->
    <td colspan=\"2\">";
    include("$cmsdir/themes/$themelocation/".$header_parm[1]); 
    print "</td></tr>";
    } 
                                                                                //load section script
    if($section_parm[0] == 1) 
	{
    print "<tr><!-- Here starts section line -->
    <td colspan=\"2\">"; 
    include("$cmsdir/themes/$themelocation/".$section_parm[1]);
    print "</td></tr>";
    } 
                                                                                //load status script         
    if($status_parm[0] == 1) 
	{
    print "<tr><!-- Here starts status line -->
    <td colspan=\"2\">"; 
    include("$cmsdir/themes/$themelocation/".$status_parm[1]);
    print "</td></tr>";
    } 
                                                                                //load menu script
    if($menu_parm[0] == 1) 
	{
    print "<tr><!-- Here starts menu part -->
    <td width=\"160\" valign=\"top\" bgcolor=\"$menu_parm[2]\">";
    include("$cmsdir/themes/$themelocation/".$menu_parm[1]); 
	}
    ?>
    </td><!-- Here starts content part -->
    <td valign="top">
    <?php                                                                       //load content script
    include("$cmsdir/themes/$themelocation/".$content_parm[0]); 
    print "</td></tr>";    
                                                                                //load footer script   
    print "<tr><!-- Here starts footer part -->
    <td colspan=\"2\">";
    if($footer_parm[0] == 1) 
	{
    include("$cmsdir/themes/$themelocation/".$footer_parm[1]);
	}
    ?>
    </td></tr>
   </tr>
</table>
<?php
if($general_parm[0] == 1 ) 
{
print "</center>"; 
}
?>

</body>
</html>
