function display_links($max_page_links, $post_array, $parameters = '')
 {
     extract(tep_load('defs'));
     $display_links_string = '';
     $parameters = str_replace('&', '&', $parameters);
     if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     if (!is_array($post_array)) {
         $post_array = array();
     }
     $hidden_string = '';
     foreach ($post_array as $key => $value) {
         $hidden_string .= tep_draw_hidden_field($key, $value);
     }
     // previous button - not displayed on first page
     if ($this->current_page_number == 2) {
         $display_links_string .= tep_draw_form('split_page_previous', tep_href_link($cDefs->script, $parameters, $cDefs->request_type), '', 'class="floater"');
         $display_links_string .= $hidden_string;
         $display_links_string .= tep_text_submit('split_name_previous', TEXT_PREVIOUS);
         $display_links_string .= '</form>';
     } else {
         if ($this->current_page_number > 1) {
             $display_links_string .= tep_draw_form('split_page_p' . ($this->current_page_number - 1), tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $cDefs->request_type), '', 'class="floater"');
             $display_links_string .= $hidden_string;
             $display_links_string .= tep_text_submit('split_name_p' . ($this->current_page_number - 1), TEXT_PREVIOUS);
             $display_links_string .= '</form>';
         }
     }
     // check if number_of_pages > $max_page_links
     $cur_window_num = intval($this->current_page_number / $max_page_links);
     if ($this->current_page_number % $max_page_links) {
         $cur_window_num++;
     }
     $max_window_num = intval($this->number_of_pages / $max_page_links);
     if ($this->number_of_pages % $max_page_links) {
         $max_window_num++;
     }
     // previous window of pages
     if ($cur_window_num > 1) {
         $index = ($cur_window_num - 1) * $max_page_links;
         $display_links_string .= tep_draw_form('split_page_' . $index, tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . $index, $cDefs->request_type), '', 'class="floater"');
         $display_links_string .= $hidden_string;
         $display_links_string .= tep_text_submit('split_name_' . $index, '...');
         $display_links_string .= '</form>';
     }
     // page nn button
     for ($jump_to_page = 1 + ($cur_window_num - 1) * $max_page_links; $jump_to_page <= $cur_window_num * $max_page_links && $jump_to_page <= $this->number_of_pages; $jump_to_page++) {
         if ($jump_to_page == $this->current_page_number) {
             $display_links_string .= '<b>' . $jump_to_page . '</b>';
         } elseif ($jump_to_page == 1) {
             $display_links_string .= tep_draw_form('split_page_' . $jump_to_page, tep_href_link($cDefs->script, $parameters, $cDefs->request_type), '', 'class="floater"');
             $display_links_string .= $hidden_string;
             $display_links_string .= tep_text_submit('split_name' . $jump_to_page, $jump_to_page);
             $display_links_string .= '</form>';
         } else {
             $display_links_string .= tep_draw_form('split_page_' . $jump_to_page, tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . $jump_to_page, $cDefs->request_type), '', 'class="floater"');
             $display_links_string .= $hidden_string;
             $display_links_string .= tep_text_submit('split_name' . $jump_to_page, $jump_to_page);
             $display_links_string .= '</form>';
         }
     }
     // next window of pages
     if ($cur_window_num < $max_window_num) {
         $index = $cur_window_num * $max_page_links + 1;
         $display_links_string .= tep_draw_form('split_page_' . $index, tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . $index, $cDefs->request_type), '', 'class="floater"');
         $display_links_string .= $hidden_string;
         $display_links_string .= tep_text_submit('split_name_' . $index, '...');
         $display_links_string .= '</form>';
     }
     // next button
     if ($this->current_page_number < $this->number_of_pages && $this->number_of_pages != 1) {
         $display_links_string .= tep_draw_form('split_page_n' . ($this->current_page_number + 1), tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number + 1), $cDefs->request_type), '', 'class="floater"');
         $display_links_string .= $hidden_string;
         $display_links_string .= tep_text_submit('split_name_n' . ($this->current_page_number + 1), TEXT_NEXT);
         $display_links_string .= '</form>';
     }
     return $display_links_string;
 }
function tep_link_to_form($name, $link, $type = 'image', $image_name = '', $alt = '', $width = '', $height = '', $form_params = '', $img_params = '')
{
    $result = tep_draw_form($name, $link, '', $form_params);
    if ($type == 'image') {
        $result .= tep_main_image_submit($image_name, $alt, $width, $height, $img_params);
    } else {
        $result .= tep_text_submit($form_name, $name);
    }
    $result .= '</form>';
    return $result;
}