<?php

/* @var $this Mage_Core_Block_Template */
/* @var $catalogSearchHelper Mage_Catalogsearch_Helper_Data */
$catalogSearchHelper =  $this->helper('catalogsearch');
?>


 <div id="form-search" class="search-bar">
   <form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">                     
        <input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" value="<?php echo $catalogSearchHelper->getEscapedQueryText() ?>" class="search-bar-input" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" />
        <input class="search-bar-submit" type="submit" value=""><span class="search-icon"><img src="<?php echo $this->getSkinUrl('images/search-icon.png') ?>" alt="<?php echo $this->__('Search Icon') ?>" /></span>

        
        <div id="search_autocomplete" class="search-autocomplete"></div>
        <script type="text/javascript">
        //<![CDATA[
            var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
            searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
        //]]>
        </script>    
   </form>
 </div> <!--search-bar-->

 <script type="text/javascript">
     new UISearch(document.getElementById('form-search'));
 </script>