$(document).ready(function() {

    var webServiceInput = { "listItemId": listItemId, "isWide": false };
    var jsonStr = JSON.stringify(webServiceInput);

    var loadL7Content = function() {
        $.ajax({
            type: 'POST',
            url: '/_vti_bin/PortalHousesService.asmx/GetNearestHousesContent',
            contentType: "application/json; charset=utf-8",
            data: jsonStr,
            dataFilter: function(data) {
                // This boils the response string down 
                // into a proper JavaScript Object().
                var msg = eval('(' + data + ')');

                // If the response has a ".d" top-level property,
                //  return what's below that instead.
                if (msg.hasOwnProperty('d')) {
                    return msg.d;
                }
                else {
                    return msg;
                }
            },
            success: function(nearestHousesContent) {
                var l17 = $("div[id$='wpL7Home']").find(".l17");
                $(l17).html(nearestHousesContent);
            }
        });
    }

    loadL7Content();
});
