<?
if (isset($_SERVER['HTTP_USER_AGENT'])) {
  if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false) {
    $leftmod="3";
    $topmod="25";	//27
  } else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false) {
    $leftmod="0";
    $topmod="27";	//29
  }
}
?>

<script language="JavaScript" type="text/javascript">

function openWindow(myurl) {
  popupWin = window.open(myurl, '_blank')
}

function findPos(obj) { 
  var curleft = 0;
  var curtop = 0;
  if (obj.offsetParent) {
    while (obj.offsetParent) {
      curleft += obj.offsetLeft-obj.scrollLeft;
      curtop += obj.offsetTop-obj.scrollTop;
      var position='';
      if (obj.style&&obj.style.position) position=obj.style.position.toLowerCase();
      if ((position=='absolute')||(position=='relative')) break;
      while (obj.parentNode!=obj.offsetParent) {
        obj=obj.parentNode;
        curleft -= obj.scrollLeft;
        curtop -= obj.scrollTop;
      }
      obj = obj.offsetParent;
    }
  } else {
    if (obj.x) curleft += obj.x;
    if (obj.y) curtop += obj.y;
  }
  return {left:curleft,top:curtop};
}

function hover(what,which) {
   if (what=='1') {
      which.style.borderLeftStyle='none';
      which.style.borderRightStyle='none';
      which.style.borderTopStyle='outset';
      which.style.borderTopColor='#a3d1d1';
      which.style.borderBottomStyle='outset';
      which.style.borderBottomColor='#606060';
      which.style.borderWidth='2px';
      which.style.color='#ffffff';
      which.style.backgroundColor='#408080';
      which.style.cursor='pointer'; 
   }
   if (what=='2') {
      which.style.borderLeftStyle='none';
      which.style.borderRightStyle='none';
      which.style.borderTopStyle='none';
      which.style.borderBottomStyle='dotted';
      which.style.borderBottomColor='#808080';
      which.style.borderBottomWidth='1px';
      which.style.color='#404040';
      which.style.backgroundColor='#a3d1d1';
   }
}   
function coex(what,menu) {
   if (what=='1') {
     if (menu=='homemenu') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subhome').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subhome').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='projectmain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subproject').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subproject').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='purchasemain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subpurchase').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subpurchase').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='approvalmain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subapproval').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subapproval').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='reportmain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subreport').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subreport').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='mastermain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('submaster').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('submaster').style.left=coors['left']-<?=$leftmod;?>;
     } else if (menu=='adminmain') {
       linkobj = document.getElementById(menu);
       var coors = findPos(linkobj);
       document.getElementById('subadmin').style.top=coors['top']+<?=$topmod;?>;
       document.getElementById('subadmin').style.left=coors['left']-<?=$leftmod;?>;	//+12;?>;
     }
     if ((menu=='homemenu')||(menu=='subhome')) {
       daMenu = document.getElementById('subhome').style;
     } else if ((menu=='purchasemain')||(menu=='subpurchase')) {
       daMenu = document.getElementById('subpurchase').style;
     } else if ((menu=='projectmain')||(menu=='subproject')) {
       daMenu = document.getElementById('subproject').style;
     } else if ((menu=='approvalmain')||(menu=='subapproval')) {
       daMenu = document.getElementById('subapproval').style;
     } else if ((menu=='reportmain')||(menu=='subreport')) {
       daMenu = document.getElementById('subreport').style;
     } else if ((menu=='mastermain')||(menu=='submaster')) {
       daMenu = document.getElementById('submaster').style;
     } else if ((menu=='adminmain')||(menu=='subadmin')) {
       daMenu = document.getElementById('subadmin').style;
     }
     lastMenu.visibility = 'hidden';
     daMenu.visibility = 'visible';
     lastMenu = daMenu;
   }
   if (what=='2') {
     var subobjhome=document.getElementById('subhome');
     var subobjpurchase=document.getElementById('subpurchase');
     var subobjproject=document.getElementById('subproject');
     var subobjapproval=document.getElementById('subapproval');
     var subobjreport=document.getElementById('subreport');
     var subobjmaster=document.getElementById('submaster');
     var subobjadmin=document.getElementById('subadmin');
     if (subobjhome!=null) document.getElementById('subhome').style.visibility = 'hidden';
     if (subobjpurchase!=null) document.getElementById('subpurchase').style.visibility = 'hidden';
     if (subobjproject!=null) document.getElementById('subproject').style.visibility = 'hidden';
     if (subobjapproval!=null) document.getElementById('subapproval').style.visibility = 'hidden';
     if (subobjreport!=null) document.getElementById('subreport').style.visibility = 'hidden';
     if (subobjmaster!=null) document.getElementById('submaster').style.visibility = 'hidden';
     if (subobjadmin!=null) document.getElementById('subadmin').style.visibility = 'hidden';
   }
}

var daMenu = '';
var lastMenu = '';

</script>

<style type="text/css">

.subMenu { 
	font-family: Arial,verdana,arial;
	font-size: 11px;
	font-style: normal;
	font-weight: bold;
	line-height: 20px;
	text-decoration: none;
	text-indent: 10px;
	color: #404040;
	padding-top: 2px;
	padding-bottom: 2px;
	padding-right: 10px;
	border-bottom: 1px dotted #808080;
	background: #a3d1d1;
	display: block;
}
.subError { 
	font-family: Arial,verdana,arial;
	font-size: 11px;
	font-style: normal;
	font-weight: bold;
	line-height: 20px;
	text-decoration: none;
	text-indent: 10px;
	color: #ff0000;
	padding-top: 2px;
	padding-bottom: 2px;
	padding-right: 10px;
	border-bottom: 1px dotted #808080;
	background: #a3d1d1;
	display: block;
}
/* .subMenu { font-family: verdana,arial; font-size: 11px; font-style: normal; font-weight: bold; line-height: 16px; text-decoration: none; text-indent: 10px; color:#ffffc0; padding-top: 2px; padding-bottom: 2px; border-bottom: 1px dotted #808080; color:#ffffc0; display: block;} */
/* a.subMenu:hover { font-size: 100%; border: 1px outset; border-bottom: 1px dotted #808080; background: #FFFFC0 } */
.sub { 
	padding: 0px;
	position: absolute;
	visibility: hidden;
	border-left: 2px outset #a3d1d1;
	border-top: 1px outset #a3d1d1;
	border-right: 2px outset #606060;
	border-bottom: 2px outset #606060;
	background: #408080;
}

</style>

<table border=0 cellspacing=0 cellpadding=0 width=960 align=center style="background: #408080; border-top: 2px solid #ffffff; border-bottom: 2px solid #408080;">
<tr valign=top>

<!-- start of info umum (all users) -->

<? if ($pubuserrole<1) { ?>

  <td valign=top width=160 class=cboxcontent>
  <a class=menulink href="index.php">Front Page</a>
  </td>
  <td valign=top width=160 class=cboxcontent>
  <a class=menulink href="index.php?module=news&task=main">Announcements</a>
  </td>

<? } ?>

<!-- end of info umum -->

<!-- public/home page for registered users -->

<? if ($pubuserrole>0) { ?>

  <td valign=top width=160 class=cboxcontent>
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->
      <a class=menulink id="homemenu" href="javascript:void(0);" onMouseOver="javascript:coex('1','homemenu')" onMouseOut="javascript:coex('2','homemenu')"><img src="gfx/options/b_home2.png" class="menubutton" align=left>Home</a>
      <div class="sub" id="subhome" onMouseOver="javascript:coex('1','subhome');" onMouseOut="javascript:coex('2','subhome');">
      <table border="0" cellspacing="0" cellpadding="0" align="left">

      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=news&task=list';">Bulletin</td></tr>
 
      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=user&task=update';">Update Personal Particulars</td></tr>

      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=user&task=chgpwd';">Update Password</td></tr>

      <!--<tr valign=top><td valign=top style="line-height: 0px; padding: 0px; background: #a3d1d1;"><hr size=2 style="padding: 0px; color: #000000;"></td></tr>-->

      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=main&task=logout';">Logout</td></tr>

      </table>
      </div>

    <? } else { ?>
      <a class=menulink href="index.php?module=menu&task=home"><img src="gfx/options/b_home2.png" class="menubutton" align=left>Home</a>
    <? } ?>

  </td>

<? } ?>

<!-- end of home page -->

<? if ($pubuserrole>0) { ?>

  <td valign=top width=160 class=cboxcontent>
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->
      <a class=menulink id="projectmain" href="javascript:void(0);" onMouseOver="javascript:coex('1','projectmain')" onMouseOut="javascript:coex('2','projectmain')"><img src="gfx/options/b_user2.png" class="menubutton" align=left>Project Informations</a>
      <div class="sub" id="subproject" onMouseOver="javascript:coex('1','subproject');" onMouseOut="javascript:coex('2','subproject');">
      <table border="0" cellspacing="0" cellpadding="0" align="left">

      <? if ($pubprojectid!="") { ?>

        <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=dashboard';">Dashboard</td></tr>
		
		<tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=view';">Project Details</td></tr>

        <!--<tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=view';">Project Details</td></tr>-->

        <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=select';">Project List</td></tr>
        
		
        <!--<tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=close';">Close Project</td></tr>-->

      <? } else { ?>

	<? // TODO: import project access; ?>

        <!--<tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=dashboard';">Dashboard</td></tr>-->

        <? //if (($pubuseraccess['access_project_selectproject']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=project&task=select';">Select Project</td></tr>
        <? //} ?>

      <? } ?>

      </table>
      </div>

    <? } else { ?>
      <a class=menulink href="index.php?module=menu&task=project"><img src="gfx/options/b_home2.png" class="menubutton" align=left>Project</a>
    <? } ?>

  </td>

<? } ?>

<!-- start of purchasing module -->

<? if ($pubuserrole>=1) { ?>

  <? //if (($pubuseraccess['access_crawl_initnew']==1)||($pubuseraccess['access_crawl_initfromspi']==1)||($pubuseraccess['access_crawl_initfromsaved']==1)||($pubuserrole>=2)) { ?>

    <td valign=top width=160 class=cboxcontent>
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->
      <a class=menulink id="purchasemain" href="javascript:void(0);" onMouseOver="javascript:coex('1','purchasemain')" onMouseOut="javascript:coex('2','purchasemain')"><img src="gfx/options/b_system2.png" class="menubutton" align=left>Purchasing</a>
      <div class="sub" id="subpurchase" onMouseOver="javascript:coex('1','subpurchase');" onMouseOut="javascript:coex('2','subpurchase');">
      <table border="0" cellspacing="0" cellpadding="0" align="left">

      <? if ($pubprojectid!="") { ?>

        <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=mbl&task=view';">Material Budget List (MBL)..</td></tr>

       
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=mro&task=list';">Material Requisition Order (MRO)..</td></tr>
       

        
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=itq&task=list';"><!-- Invitations to Quote (ITQ)..-->ITQ / RFQ</td></tr>
       

       

          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=po&task=main';">Purchase Orders (PO)..</td></tr>
        
		
		

        
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=do&task=main';">Delivery Orders (DO)..</td></tr>
        
        
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=invoice&task=main';">Invoices..</td></tr>
        

      <? } else { ?>

        <tr valign=top><td valign=top class="subError">Please select a Project from the Project Menu!</td></tr>

      <? } ?>

      </table>
      </div>

    <? } else { ?>
      <a class=menulink href="index.php?module=menu&task=purchasing"><img src="gfx/options/b_user2.png" class="menubutton" align=left>Purchasing</a>
    <? } ?>

    </td>

  <? //} ?>

  <? //if (($pubuseraccess['access_config_managespi']==1)||($pubuseraccess['access_config_managesaved']==1)||($pubuseraccess['access_config_manageseeds']==1)||($pubuseraccess['access_config_managecategories']==1)||($pubuseraccess['access_config_managesubjects']==1)||($pubuseraccess['access_config_managevocabulary']==1)||($pubuseraccess['access_config_managetemplates']==1)||($pubuseraccess['access_config_managelists']==1)||($pubuserrole>=2)) { ?>

    <td valign=top width=160 class=cboxcontent>
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->
      <a class=menulink id="reportmain" href="javascript:void(0);" onMouseOver="javascript:coex('1','reportmain')" onMouseOut="javascript:coex('2','reportmain')"><img src="gfx/options/b_reports2.png" class="menubutton" align=left>Reports</a>
      <div class="sub" id="subreport" onMouseOver="javascript:coex('1','subreport');" onMouseOut="javascript:coex('2','subreport');">
      <table border="0" cellspacing="0" cellpadding="0" align="left">

      <? if ($pubprojectid!="") { ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=mbl';">Material Budget List Report</td></tr>
        <? } ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=qv';">Quantity Variance Report</td></tr>
        <? } ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=po';">Purchase Order Report</td></tr>
        <? } ?>

        <?// if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
         <!--
		 <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=sp';">Supplier Performance Report</td></tr>
         -->
		<?// } ?>

        <? //if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <!--
		  <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=bm';">Budget Monitoring Report</td></tr>
          --> 
		<? //} ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=pmc';">Project Material Cost Report</td></tr>
        <? } ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=scm';">Sub-con Material Report</td></tr>
          <tr valign=top ><td style="color:#000; background: #428284;" class="subMenu" valign=top  onClick="location.href='#';">IQA Report</td></tr>
		  <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=iqa';">On Time Delivery Report</td></tr>
           <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=sp';">Supplier Performance Report</td></tr>
           <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=bm';">Budget Monitoring Report</td></tr>
          
     
		<? } ?>

      <? } else { ?>

        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=overall1';">IQA Report</td></tr>
        <? } ?>

        <!--
        <? if (($pubuseraccess['access_reports_all']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=report&task=overall2';">Overall Report 2</td></tr>
        <? } ?>
        -->

      <? } ?>

      </table>
      </div>

    <? } else { ?>
      <a class=menulink href="index.php?module=menu&task=reports"><img src="gfx/options/b_reports2.png" class="menubutton" align=left>Reports</a>
    <? } ?>

    </td>

  <? //} ?>

<? } ?>

<!-- end of purchasing module -->

<!-- start of admin (normal admin and special users only) -->

<? if ($pubuserrole>=1) { ?>

  <? //if (($pubuseraccess['access_system_managewelcome']==1)||($pubuseraccess['access_system_managenews']==1)||($pubuserrole>=2)) { ?>

    <td valign=top width=160 class=cboxcontent>
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->
      <a class=menulink id="mastermain" href="javascript:void(0);" onMouseOver="javascript:coex('1','mastermain')" onMouseOut="javascript:coex('2','mastermain')"><img src="gfx/options/b_settings2.png" class="menubutton" align=left>Master Data</a>
      <div class="sub" id="submaster" onMouseOver="javascript:coex('1','submaster');" onMouseOut="javascript:coex('2','submaster');">
      <table border="0" cellspacing="0" cellpadding="0" align="left">

      <!-- TODO: make it so everyone can view -->
      <? if ((($pubuseraccess['access_supplier_edit']==1)||($pubuseraccess['access_supplier_recommend']==1)||($pubuseraccess['access_supplier_approve']==1)||($pubuseraccess['access_supplier_activate']==1))||($pubuserrole>=2)) { ?>
        <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=supplier&task=main';">Supplier Information</td></tr>
      <? } ?>

      <!-- TODO: make it so everyone can view? -->
      <? if (($pubuseraccess['access_trade_edit']==1)||($pubuserrole>=2)) { ?>
        <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=trade&task=main';">Trade Categories</td></tr>
      <? } ?>

      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=client&task=main';">Client Information</td></tr>

      <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=subcon&task=main';">Sub-contractor Information</td></tr>

      </table>
      </div>

    <? } else { ?>
      <a class=menulink href="index.php?module=menu&task=master"><img src="gfx/options/b_settings2.png" class="menubutton" align=left>Master Data</a>
    <? } ?>

    </td>

  <? //} ?>

  <? //if (($pubuseraccess['access_system_managestaff']==1)||($pubuseraccess['access_system_manageusers']==1)||($pubuseraccess['access_system_manageaccess']==1)||($pubuserrole>=2)) { ?>

    <td valign=top width=160 class=cboxcontent style="vertical-align: middle;">
    <?
    if (isset($_SERVER['HTTP_USER_AGENT']) && ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0') !== false)||(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false))) {
    ?>
      <!-- IE 7.0 -->

      <? if ($pubuserrole>=2) { ?>

        <a class=menulink id="adminmain" href="javascript:void(0);" onMouseOver="javascript:coex('1','adminmain')" onMouseOut="javascript:coex('2','adminmain')"><img src="gfx/options/b_config2.png" class="menubutton" align=left>System Admin</a>
        <div class="sub" id="subadmin" onMouseOver="javascript:coex('1','subadmin');" onMouseOut="javascript:coex('2','subadmin');">
        <table border="0" cellspacing="0" cellpadding="0" align="left">

        <? //if (($pubuseraccess['access_system_access']==1)||($pubuserrole>=2)) { ?>
          <!--<tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=access&task=list';">Manage Access Levels</td></tr>-->
        <? //} ?>

        <? if (($pubuseraccess['access_system_manageusers']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=user&task=list';">Manage Users</td></tr>
        <? } ?>

        <? if (($pubuseraccess['access_system_manageaccess']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=user&task=groups';">Manage Access Groups</td></tr>
        <? } ?>

        <? if (($pubuseraccess['access_system_managenews']==1)||($pubuserrole>=2)) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=news&task=list';">Manage Bulletin</td></tr>
        <? } ?>

        <? if ($pubuserrole>=2) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=system&task=settings';">Manage System Settings</td></tr>
        <? } ?>

        <? if ($pubuserrole>=2) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=system&task=audit';">Manage Audit Trail</td></tr>
        <? } ?>
		
		
		<? if ($pubuserrole>=2) { ?>
          <tr valign=top><td valign=top class="subMenu" onMouseOver="hover('1',this);" onMouseOut="hover('2',this);" onClick="location.href='index.php?module=system&task=date_change';">Manage / Edit Date</td></tr>
        <? } ?>
       

        </table>
        </div>

      <? } else { ?>

        <a class=menulinkdisabled id="adminmain" href="javascript:void(0);" style="color: #808080;"><img src="gfx/options/b_user2.png" class="menubutton" align=left>System Admin</a>

      <? } ?>

    <? } else { ?>

      <a class=menulink href="index.php?module=menu&task=system"><img src="gfx/options/b_config2.png" class="menubutton" align=left>System Administration</a>

    <? } ?>

    </td>

  <? //} ?>

<? } ?>

<!-- end of admin -->

</tr>
</table>