<?php
/*
  $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
  if (WARN_INSTALL_EXISTENCE == 'true') {
    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
    }
  }

// check if the configure.php file is writeable
  if (WARN_CONFIG_WRITEABLE == 'true') {
    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (fileperms(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')& 18) ) {
      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
    }
  }

// check if the session folder is writeable
  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
    if (STORE_SESSIONS == '') {
      if (!is_dir(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
      } elseif (!is_writeable(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
      }
    }
  }

// check session.auto_start is disabled
  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
    if (ini_get('session.auto_start') == '1') {
      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
    }
  }

  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
    if (!is_dir(DIR_FS_DOWNLOAD)) {
      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
    }
  }

  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
?>
<?php if (DOWN_FOR_MAINTENANCE_WARNING == 'true') 
 { ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
	    <td valign="middle" align="center" width="100%" bgcolor="red">
	      <font size="3" color="white"><?php echo DOWN_FOR_MAINTENANCE_MESSAGE; ?></font>
	    </td>
	  </tr>
	<table>
<?php 
 }	?>

  <!--<table cellspacing=0 cellpadding=0 bgcolor=#FFFFFF width=749 height=100% align=center>
   <tr><td valign=top align=center> -->
    <table width=750 border="0" align=center cellpadding=0 cellspacing=0>
     <!-- Level1 -->
  <tr align="left" valign="top">
    <td><img src="images/sp.gif"  border=0 width="5" height="8"></td> 
    <td ><img src="images/sp.gif" width="250" height="8" border="0"></td>
    <td><img src="images/sp.gif" width="440" height="8" border="0"></td>
    <td ><img src="images/sp.gif" width="5" height="8" border="0"></td>
  </tr>
  <tr align="left" valign="top">
    <td><img src="images/sp.gif" width="5" height="72" border="0"></td>
    <td ><a href=<?=tep_href_link('index.php')?>><img border="0" src="images/toplogo.gif" width="250" height="72"></a></td>
    <td>
    <!--<img src="images/sp.gif" width="440" height="45">-->
    <? // SEARCH ?> 
    <table  align="right" cellspacing=0 cellpadding=0 >
      <?=tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get')?>
      <tr><td width=113 height=45 class=ch1><?php echo HEADER_TITLE_SEARCH ?></td> 
       <td width=110>
         <?=tep_draw_input_field('keywords', '', 'size="20" maxlength="50"    onclick="this.value=\'\'" value="keyword"   class=se ') . ' ' . tep_hide_session_id()?></td>
       <td><input type=image src=images/m02.gif></td></tr>
       <tr><td width=113 class=ch1><?php echo HEADER_TITLE_SEARCH_DESCRIPTION ?></td> 
       <td width=110>
         <?=tep_draw_checkbox_field('search_in_description', '1', checked)?>
         <td></td></tr>
       </form>
   </table>
<? // END SEARCH ?>
    </td>
    <td><img src="images/sp.gif" width="5" height="72" border="0"></td>
  </tr>
  <tr align="left" valign="top">
    <td colspan="4"><img src="images/sp.gif" width="750" height="5" border="0"></td>
  </tr>
     <!-- Level1 -->  
  <tr align="left" valign="top">
    <td ><img src="images/sp.gif" width="5" height="1" border="0"></td>
    <td colspan="2" bgcolor="#9B9D9F"><img src="images/sp.gif" height="1" border="0"></td>
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
  </tr>
  <tr align="left" valign="top">
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
    <td colspan="2" bgcolor="#CBCCCD"><img src="images/sp.gif" height="1" border="0"></td>
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
  </tr>
  <!-- Menue -->  
  
  <tr>
     <td height="14"><img src="images/sp.gif" width="5" height="13" border="0"></td>
     <td colspan="2" >
     <span style="padding-left: 7px"></span>
     <a href="http://www.no-germs.com" class=ml1><?php echo HEADER_TITLE_HOME ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 align=absbottom><span class=ch2></span>
     <a href=<?=tep_href_link('products_new.php')?> class=ml1><?php echo HEADER_TITLE_NEWPRODUCTS ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 border="0" align=absbottom><span class=ch2></span>
     <a href=<?=tep_href_link('create_account.php')?> class=ml1><?php echo HEADER_TITLE_CREATE_ACCOUNT ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 border="0" align=absbottom><span class=ch2></span>
     <a href=<?=tep_href_link('account.php')?> class=ml1><?php echo HEADER_TITLE_MY_ACCOUNT ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 border="0" align=absbottom><span class=ch2></span>
     <a href=<?=tep_href_link('shopping_cart.php')?> class=ml1><?php echo HEADER_TITLE_CART_CONTENTS ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 border="0" align=absbottom><span class=ch2></span>
     <a href=<?=tep_href_link('checkout_confirmation.php')?> class=ml1><?php echo HEADER_TITLE_CHECKOUT ?></a>
     <span class=ch2></span><img src=images/m01.gif width=1 height=7 border="0" align=absbottom><span class=ch2></span>
     <a href="http://www.no-germs.com/ng/about-us" class=ml1><?php echo BOX_INFORMATION_CONTACT ?></a>
     </td>
     <td><img src="images/sp.gif" width="5" height="13" border="0"></td>
  </tr>
   <tr align="left" valign="top">
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
    <td colspan="2" bgcolor="#CBCCCD"><img src="images/sp.gif" height="1" border="0"></td>
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
  </tr>
  <tr align="left" valign="top">
    <td><img src="images/sp.gif" width="5" height="1" border="0"></td>
    <td colspan="2" bgcolor="#9B9D9F"><img src="images/sp.gif"  height="1" border="0"></td>
	<td><img src="images/sp.gif" width="5" height="1" border="0"></td>
  </tr>
  <tr align="left" valign="top">
    <td><img src="images/sp.gif" width="5" height="5" border="0"></td>
    <td colspan="2"><img src="images/sp.gif" height="5" border="0"></td>
	<td><img src="images/sp.gif" width="5" height="5" border="0"></td>
  </tr>
    </table>
   