<?php 
/*
	Freeway eCommerce
	http://www.openfreeway.org
	Copyright (c) 2007 ZacWare

	Released under the GNU General Public License 
*/	
// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
require(DIR_WS_JAVASCRIPT . "general.js");
require(DIR_WS_JAVASCRIPT . "popup.js");
?> 
<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?>
<?php 

if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
$header_text = '&nbsp;'
?>
<h3><?php echo HEADING_TITLE_1; ?></h3>
<?php
}else{
$header_text = HEADING_TITLE_1;
}

?>
<?php
  if ($messageStack->size('search') > 0) {
?>
      <div><?php echo $messageStack->output('search'); ?></div>

<?php
  }
?>
        <table width="100%" cellpadding="1" class="infoBox">
          <tr>
            <td><table width="100%" cellpadding="3" class="infoBoxContents">
              <tr>
                <td class="boxText" width="50%"><?php echo tep_draw_input_field('keywords', '', 'style="width: 100%"'); ?></td>
                <td class="smallText"><?php echo tep_draw_checkbox_field('search_in_description', '1') . ' ' . TEXT_SEARCH_IN_DESCRIPTION; ?></td>
              </tr>
            </table></td>
          </tr>
        </table>
		<table width="100%" cellspacing="1" cellpadding="2" class="infoBox">
			 <?php if(HIDE_FROM_BACKEND_MENU_PRODUCTS=='false') { ?> 
              <tr>
                <td class="fieldKey"><?php echo tep_draw_checkbox_field('inc_product', '1', true,'onClick=javascript:do_change(\'P\',this.checked)') . TEXT_PRODUCTS_1; ?></td>
                <td class="fieldValue"><?php echo tep_draw_pull_down_menu('product_category_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES))),'','style=width:110px'); ?></td>
                <td class="smallText"><?php echo tep_draw_checkbox_field('inc_subcat_product', '1', true,'id="inc_subcat_product"') . ' ' . ENTRY_INCLUDE_SUBCATEGORIES; ?></td>
              </tr>
			  <?php } ?>
              <tr>
                <td class="fieldKey"><?php echo ENTRY_PRICE_FROM; ?></td>
                <td class="fieldValue" colspan=2><?php echo tep_draw_input_field('pfrom'); ?></td>
              </tr>
              <tr>
                <td class="fieldKey"><?php echo ENTRY_PRICE_TO; ?></td>
                <td class="fieldValue" colspan=2><?php echo tep_draw_input_field('pto'); ?></td>
              </tr>
              <tr>
                <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
              </tr>
            </table>
            <div><?php echo tep_template_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH) . "&nbsp;&nbsp;"; ?></div>	

</form>
<script type="text/javascript">
do_change('P',document.advanced_search.inc_product.checked);
function do_change(type,obj){

		if(obj)
			document.getElementById('inc_subcat_product').disabled=!obj;
		else
			document.getElementById('inc_subcat_product').disabled=!obj;
	}

</script>