﻿$(document).ready(function() {
    $("a[rel^='prettyPhoto']").prettyPhoto();
    
    $(".query_hint").bind("click", function(e) {
        $("#q").val($(this).html());
    });
    
    $(".area_hint").bind("click", function(e) {
        $("#a").val($(this).html());
    });

    $("#a").autocomplete(areaSearchAPI,
    {
        minChars: 3,
        dataType: "json",
        formatItem: function(data, i, max, value, term) {
            return value;
        },
        valueChanged: function() {
        },
        selected: function(data) {
        },
        parse: function(data) {
            var rows = new Array();
            $.each(data, function(i, item) {
                rows.push({ data: item.Key, value: item.Value, result: item.Value });
            });
            return rows;
        }
    });
});

            
