'; html += '
' + result[i].name + '
'; html += '
'; if(result[i].special.length > 0){ html += '

' + result[i].price + '

'; html += '

' + result[i].special + '

'; } else if (result[i].price.length > 0) { html += '

' + result[i].price + '

'; } html += '
'; html += ''; html += ''; } html += ''; if( $('#ajax_search_results').length > 0 ) { $('#ajax_search_results').remove(); } $('#search').append(html); } }}); return true; } function upDownEvent( ev ) { var elem = document.getElementById('ajax_search_results_body'); var fkey = $('#search').find('[name=search]').first(); if( elem ) { var length = elem.childNodes.length - 1; if( updown != -1 && typeof(elem.childNodes[updown]) != 'undefined' ) { $(elem.childNodes[updown]).removeClass('selected'); } if( ev.keyCode == 38 ) { updown = ( updown > 0 ) ? --updown : updown; } else if( ev.keyCode == 40 ) { updown = ( updown = 0 && updown 0 ) { if($('.selected').find('a').first().attr('href')){ document.location.href = $('.selected').find('a').first().attr('href'); } } } catch(e) {} }); });