function letters_list($data = '')
{
    $output = '
<table bgcolor="' . COLOR_TABLE_GENERAL . '">
';
    $output .= '
	<tr>';
    // letters
    // total 32-95
    $offset = 32;
    $col = -1;
    $color = 0;
    $dishes_letters = letters_list_creator();
    for ($i = 17; $i <= 92 - $offset; $i++) {
        $letter = chr($i + $offset);
        if ($letter == "'") {
            $letter = "\\'";
        }
        if ($letter == '%') {
            continue;
        }
        $bgcolor = COLOR_TABLE_GENERAL;
        //RTG: if there is some dishes begginnig with this letter
        if (in_array($letter, $dishes_letters, false)) {
            $letter = htmlentities($letter);
            $link = 'orders.php?command=dish_list&amp;data[letter]=' . $letter;
            if (isset($data['quantity']) && $data['quantity']) {
                $link .= '&amp;data[quantity]=' . $data['quantity'];
            }
            if (isset($data['priority']) && $data['priority']) {
                $link .= '&amp;data[priority]=' . $data['priority'];
            }
            $bgcolor = color($color++);
            $output .= '
			<td bgcolor="' . $bgcolor . '" onclick="redir(\'' . $link . '\');return(false);">
			<a href="' . $link . '">
			<strong>' . $letter . '</strong>
			</a>
			</td>';
            $col++;
        } else {
            continue;
            $output .= '
			<td bgcolor="' . $bgcolor . '">
			&nbsp;
			</td>';
        }
        if (($col + 1) % 6 == 0) {
            $color++;
            $output .= '
		</tr>
		<tr>';
        }
    }
    $output .= '
	</tr>';
    $output .= '
	</tbody>
</table>';
    return $output;
}
/**
* My Handy Restaurant
*
* http://www.myhandyrestaurant.org
*
* My Handy Restaurant is a restaurant complete management tool.
* Visit {@link http://www.myhandyrestaurant.org} for more info.
* Copyright (C) 2003-2005 Fabio De Pascale
* 
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* @author		Fabio 'Kilyerd' De Pascale <*****@*****.**>
* @package		MyHandyRestaurant
* @copyright		Copyright 2003-2005, Fabio De Pascale
*/
function keys_orders()
{
    $links = order_last_modified_links();
    $output = '
<script language="JavaScript1.2">
<!--
	if(!document.all) {
		window.captureEvents(Event.KEYUP);
	} else {
		document.onkeypress = keypressHandler;
	}
	function keypressHandler(e) {
		var e;
		if(document.all) { //it\'s IE
			e = window.event.keyCode;
		} else {
			e = e.which;
		}
		
		// key bindings
		if(e == 36) { /* home key */
			top.location=\'' . $links[-1] . '\';
		}
		if (e == 37 && 9) { /* left arrow */';
    if ($links[10]) {
        $output .= '
			top.location=\'' . $links[11] . '\';';
    }
    $output .= '}
		if (e == 38) { /* up arrow (unusable) */
		}
		if (e == 39) { /* right arrow */';
    if ($links[11]) {
        $output .= '
			top.location=\'' . $links[10] . '\';';
    }
    $output .= '}
		if (e == 40) { /* down arrow (unusable) */
		}';
    // letters
    $dishes_letters = letters_list_creator();
    for ($i = 65; $i <= 90; $i++) {
        $letter = chr($i);
        if (in_array($letter, $dishes_letters, false)) {
            $link = 'orders.php?command=dish_list&data[letter]=' . $letter;
            $output .= '
		if (e == ' . $i . ') top.location=\'' . $link . '\';';
        }
    }
    // numbers
    for ($i = 0; $i < 10; $i++) {
        if (empty($links[$i])) {
            continue;
        }
        $key = $i + 48;
        $output .= '
		if (e == ' . $key . ') top.location=\'' . $links[$i] . '\';';
    }
    $output .= '
		if (e == 10 || e == 13) { /* enter */
		}
		if (e == 27) { /* escape */
		}
		if (e == 108) { /* plus (unusable) */
		}
		if (e == 109) { /* minus (unusable) */
		}
		// key bindings end
	}
	window.onkeyup = keypressHandler;
//-->
</script>';
    return $output;
}