<?php
  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";  ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <?php
    include ("includes/metadata.php");
  ?>
   <link href="templates/ms_usa_mambo/css/template_css.css" rel="stylesheet" type="text/css" />
  <link rel="shortcut icon" href="<?php echo $mosConfig_live_site;?>/images/favicon.ico" />
    <?php
        $database->setQuery("SELECT * FROM #__menu WHERE menutype='topmenu' AND parent='0' AND published='1' AND access<='$gid' AND sublevel='0' ORDER BY ordering");
        $vmrows = $database->loadObjectList();
        $topbar = "<table border='0' cellpadding='0' cellspacing='2' width='100%'><tr>";
        $bottom_bar = "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>";
        $num_vmrows  = count($vmrows);
        $vmtab_width = floor(100 / $num_vmrows);
    foreach($vmrows as $vmrow) {
         $seflink = $vmrow->link;
        if ($vmrow->type != "url") {
          $seflink .= "&Itemid=$vmrow->id";
          $vmenulink = sefRelToAbs($seflink);
        } else {
          $vmenulink = $vmrow->link;}
          $targetnm=$vmrow->browserNav;
          $browser_class = 'buttonbar';
        if (stristr($_SERVER['HTTP_USER_AGENT'],"mozilla") and stristr($_SERVER['HTTP_USER_AGENT'],"msie")){$browser_class = 'topbar_msie';}
        if (stristr($_SERVER['HTTP_USER_AGENT'],"opera")){$browser_class = 'buttonbar';}
switch ($vmrow->browserNav) {
                // cases are slightly different
                case 1:
                // open in a new window
                $txt = "<td width='$vmtab_width%'><a href=\"$vmenulink\" target=\"_window\" class=\"$browser_class\">$vmrow->name</a></td>";
                $txt_bottom = "<td width='$vmtab_width%' align='center'><a class='pathway' href=$vmenulink target=\"_window\">$vmrow->name</a></td>";
                break;
                case 2:
                // open in a popup window
                $txt = "<td width='$vmtab_width%'><a href=\"#\" onClick=\"javascript: window.open('$vmenulink', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');\" class=\"$browser_class\">$vmrow->name</a></td>";
                $txt_bottom = "<td width='$vmtab_width%' align='center'><a class='pathway' href=\"#\" onClick=\"javascript: window.open('$vmenulink', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');\">$vmrow->name</a></td>";
                break;
                case 3:
                // don't link it
                $txt = "<td width='$vmtab_width%'><span class=\"$browser_class\">$vmrow->name</span></td>";
                $txt_bottom = "<td width='$vmtab_width%' align='center'><span class='pathway'>$vmrow->name</span></td>";
                break;
                default:
                // open in parent window
                $txt = "<td width='$vmtab_width%'><a href=\"$vmenulink\" class=\"$browser_class\">$vmrow->name</a></td>";
                $txt_bottom = "<td width='$vmtab_width%' align='center'><a class='pathway' href=$vmenulink>$vmrow->name</a></td>";
                break;}
           $topbar .=$txt;
      $bottom_bar .=$txt_bottom;}
  $topbar .="</tr></table>";
$bottom_bar .= "</tr></table>";?>
<style type="text/css">
<!--
body {
        background-color: #BaBaBa;
        background-image: url();
}-->
</style></head>
<body>
<a name="up" id="up"></a>
<table border="0" cellpadding="0" cellspacing="0" width="90%" height="100%" bgcolor="#464060" align="center">
<tr bgcolor="#464060" height="18">
<td height="18" colspan="3" align="center"><div align="left"></div>
<div align="right"></div>      <div align="left"></div>
<div align="left">
<table width="100%" height="18" border="0" cellspacing="0" cellpadding="0">
<tr><td width="2%" height="18"><div align="right"><img hspace="5" src="images/M_images/arrow.png" border="0" alt="arrow" /></div></td>
<td width="100%"><?php mosPathWay(); ?></td>

</tr></table>
</div></td></tr>
<tr><td height="37" colspan="3" align="left" valign="top" background="templates/ms_usa_mambo/images/headerbg.jpg" style="background-repeat:repeat-x; height: 72px;">
<?php mosLoadModules ( "top" ); ?>
</td></tr><tr><td height="18" colspan="3" align="left" valign="top"><div align="center"><?php echo $topbar ?></div></td>
</tr><tr><td width="168" rowspan="3" valign="top" class="leftcells"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td height="50%" valign="top"><?php mosLoadModules ( "left" ); ?></td>
</tr>
<tr>
  <td height="50%" valign="top"><?php mosLoadModules ( 'user1' ); ?></td>
</tr>
<tr><td></td></tr></table></td>
<td width="586" rowspan="3" valign="top" bgcolor="#F0F0F0">    <div align="center">
  <?php mosMainBody(); ?>
</div></td>


<td bgcolor="#FFFFFF" valign="top" width="132"><?php mosLoadModules ( "right" ); ?></td>


</tr>


<tr>
  <td bgcolor="#FFFFFF" valign="top"><?php mosLoadModules ( 'user2' ); ?></td>
</tr>


<tr>
  <td bgcolor="#FFFFFF" valign="top">

  </td>
</tr>


<tr bgcolor="#9A000B">
<td height="20" colspan="3" align="center">
<?php echo $bottom_bar; ?></td>
</tr>
<tr>
<td height="20" colspan="3" align="center" class="leftcells"><?php include_once("includes/footer.php"); ?> <br />
 <a href="http://www.mambosolutions.com"><img src="templates/ms_usa_mambo/images/ms_logo_badge.gif" border="0" alt="Designed by mambosolutions.com"></a>
</td>
</tr>
</table>
</body>
</html>