คอนโดมิเนียม for Sale at Maestro 02 Ruamrudee, Patum Wan, Bangkok, ประเทศไทย
฿154,197 / ตร.ม.
') } } ]).bind('typeahead:selected', function (obj, datum) { $("#QueryText").val(datum.label); $("#QueryId").val(datum.value); $("#QueryType").val(datum.type); if (datum.type == 9 || datum.type == 10 || datum.type == 11 || datum.type == 12 || datum.type == 13) { //console.log("window.location.href:" + window.location.href); var contractTypeQuery = ""; if ($('input:radio[name=sfForRentOrSale]') != undefined) { contractTypeQuery = '&ContractType=' + $('input:radio[name=sfForRentOrSale]:checked').val(); } // If not on the search page, redirect to map search page. if ($('body').width() > 1024) { // desktop var path = window.location.pathname.toString(); if (path.indexOf("//Search") > -1) { console.log("SEARch thing"); // On Search page, clear map and move location. ClearZones(); $("#GoogleSearchId").val(datum.value); // Google Location update_map_location(datum.value); // Redirect to the map search page. return; } window.location.href = '/th/search?GoogleSearchId=' + datum.value + contractTypeQuery; } else {// Mobile $("#GoogleSearchId").val(datum.value); PerformSearch(_getSearchQuery(), OnUpdateSearchSuccess); } } else if (datum.type == 14) { // Building selected view_building_clicked(datum.value); } else if (datum.type == 4) { // Neighborhood selected view_neighborhood_clicked(datum.value); } else if (datum.type == 7) { // Agency selected view_agency_clicked(datum.value); } else if (datum.type == 8) { // Developer selected view_developer_clicked(datum.value); } }); }); function SendLoginRequest(data) { return $.ajax({ url: '/th/account/login', type: 'POST', data: data }).fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); // Redirect to the main login page window.location.href = '/th/account/login'; }); }; function GetFavourites() { return $.ajax({ url: "/th/user/getfavourites", data: { __RequestVerificationToken:"WD-vyjV-fxP6pBCMkBKLoSQtIHZnd8YdKIMnMIAyemHpEvQeNa3OvDAurNbay6esvLmk224uqb1lyKSlghGoYbVvUDU1" }, type: 'POST' }).fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }); } function AddPropertyToFavourite(propertyId) { if ('False' == 'False') { $.ajax({ url: '/th/user/getlogindialog', data: { __RequestVerificationToken:"sezNvbNaCUv5-676ahY8Ncvl3gaQ_wiFGvM2Mt2Aam2lhyzSC39gkxyXli43o9TK2TbgBYsS-wkaLYzCe2pg7nGzfA01" }, type: 'POST' }).done(function (data) { if (data.Success) { $('#ModalDialogTitle').html(data.Title); $('#ModalDialogBody').html(data.Html); var frm = $('#login-form'); frm.on('submit', function (event) { event.preventDefault(); SendLoginRequest(frm.serialize()).done(function (data) { if (data.Success) { SendFavouriteRequest('add', propertyId).done(function (d) { // If the request success, reload the page if (d.Success) { window.location.reload(); } }); } else if (data.InvalidModelState) { // Do nothing, let the form displays validation messages } else { // Redirect to the main login page window.location.href = '/th/account/login'; } }); }); $('#ModalDialog').modal('show'); } else { alert(data.ErrorMessage); } }).fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }); } else { SendFavouriteRequest('add', propertyId); } } function RemovePropertyFromFavourite(propertyId) { SendFavouriteRequest('remove', propertyId); } function SendFavouriteRequest(action, propertyId) { var url = action == 'add' ? '/th/user/addpropertytofavourite' : '/th/user/removepropertyfromfavourite'; return $.ajax({ url: url, data: { propertyId: propertyId, __RequestVerificationToken:"zYuHf3HSWgJ68oyT_q2xBX1Yo_UjrLpUYkc_pyt4XoLbAkzLxDRFHMxQ0X7Xz4Clb-a3a69ZNBf-nQPPSOMWifRGenk1" }, type: 'POST' }).done(function (data) { if (data.Success) { if (typeof UpdateFavouriteState == "function") { // Declared in ~/View/Shared/PartialViews/_PropertyList & ~/View/Property/Index UpdateFavouriteState(action == 'add', propertyId); } } else { alert(data.ErrorMessage); } }).fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }); } function Enquire(agencyId) { $.ajax({ url: '/th/user/getenquirydialog', data: { agencyId: agencyId, __RequestVerificationToken:"bRA7Gwsb7RXJ-phwORbUe2yseLOcUiFKpSjNn5frEwvhvEmGz1Dvz7_uVbZZwNhaXxxYL2LkEJmbxSvo4x-8LRmRM601" }, type: 'POST', beforeSend: function (xhr) { $.spin('true'); } }) .done(function (data) { if (data.Success) { PopulateEnquiryForm(data); } }) .fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }) .always(function () { $.spin('false'); }); } function EnquireForPropertyDetailed(propertyId, title, externalPropertyId, agencyId, agencyName, agencyLogo, agencyEmail) { $.ajax({ url: '/th/user/getpropertyenquirydialogdetailed', data: { propertyId: propertyId, title: title, externalPropertyId: externalPropertyId, agencyId: agencyId, agencyName: agencyName, agencyLogo: agencyLogo, agencyEmail: agencyEmail, __RequestVerificationToken:"I4Psf92AJejN1H7G2RIoO_wvTDjiQUBE-NC_b1BzGvT_ARntR6PpQxFBVD8xR_bxv8aGUWeqFVFO9Bbwajc1aafkt_M1" }, type: 'POST', beforeSend: function (xhr) { $.spin('true'); } }) .done(function (data) { if (data.Success) { //console.log("EnquireForProperty dialog opened"); PopulateEnquiryForm(data); } }) .fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }) .always(function () { $.spin('false'); }); } function EnquireForProperty(propertyId) { $.ajax({ url: '/th/user/getpropertyenquirydialog', data: { propertyId: propertyId, __RequestVerificationToken:"84-Rvrs04i7n1gCKEAmPbjRJYmJCBNtLWfMwWUGRbj7swQVdBQWrxhWXN8HX-sqcxEQ987Y8SFf1fd6dQ91lkz9Akds1" }, type: 'POST', beforeSend: function (xhr) { $.spin('true'); } }) .done(function (data) { if (data.Success) { //console.log("EnquireForProperty dialog opened"); PopulateEnquiryForm(data); } }) .fail(function (xhr, textStatus, errorThrown) { alert(xhr.responseText); }) .always(function () { $.spin('false'); }); } function PopulateEnquiryForm(data) { $('#ModalDialogTitle').html(data.Title); $('#ModalDialogBody').html(data.Html); $('#ModalDialog').modal('show'); ga('set', 'dimension5', data.RepresentantName); ga('send', 'event', 'PropertyEnquiry', 'enquiry_dialog_opened', { 'eventLabel': data.RepresentantName, 'nonInteraction': true }); var frm = $('#SendEnquiryEmailForm'); frm.on('submit', function (event) { SendEnquiryEmail(frm.serialize()) event.preventDefault(); }); } function SendEnquiryEmail(params) { return $.ajax({ url: '/th/user/sendenquiryemail', type: 'POST', data: params, beforeSend: function (xhr) { $.spin('true'); } }).done(function (data) { if (data.Success) { goog_report_conversion(); ga('send', 'event', 'PropertyEnquiry', 'enquiry_sent', { 'eventLabel': data.RepresentantName, 'dimension5': data.RepresentantName, 'dimension6': data.PropertyId, 'dimension7': data.RepresentantId, 'nonInteraction': true }); $.notify({ // options message: 'Enquiry sent!' }, { // settings element: 'body', type: 'success', placement: { from: "top", align: "center" }, newest_on_top: true }); $('#ModalDialog').modal('hide'); } else { ga('send', 'exception', { 'exDescription': 'SendEnquiryEmail failed', 'exFatal': true, 'appName': 'FindYourSpace Web', 'appVersion': '1.0' }); ga('send', 'event', 'PropertyEnquiry', 'enquiry_failed', { 'eventLabel': data.RepresentantName, 'nonInteraction': true }); // alert('Internal error: Failed sending property enquiry. Please try again.'); $.notify({ // options message: 'Failed sending enquiry.' + data.ErrorMessage }, { // settings element: '#ModalDialog', type: 'danger', placement: { from: "top", align: "center" }, newest_on_top: true }); } }).fail(function (xhr, textStatus, errorThrown) { $.notify({ // options message: 'Failed sending enquiry.' + errorThrown }, { // settings element: '#ModalDialog', type: 'danger', placement: { from: "top", align: "center" }, newest_on_top: true }); }) .always(function () { $.spin('false'); }); } ////////////////////////////////////////// // // Get / Set Cookies // ///////////////////////////////////////// function getCookie(cname) { if (cname.indexOf('.') != -1) { var names = cname.split('.'); if (names.length != 2 || names[0].trim() == '' | names[1].trim() == '') { return ''; } else { var values = getCookieValue(names[0], document.cookie, ';'); return getCookieValue(names[1], values, '&'); } } else { return getCookieValue(cname, document.cookie, ';'); } } function getCookieValue(key, values, delimiter) { var name = key + "="; var arr = values.split(delimiter); for (var i = 0; i < arr.length; i++) { var c = arr[i]; while (c.charAt(0) == ' ') c = c.substring(1); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return ""; } function setCookie(cname, cvalue) { if (cname.indexOf('.') != -1) { var names = cname.split('.'); if (names.length != 2 || names[0].trim() == '' || names[1].trim() == '') { return ''; } else { var values = getCookieValue(names[0], document.cookie, ';'); var value = getCookieValue(names[1], values, '&'); if (value != '') { document.cookie = names[0] + "=" + values.replace(names[1] + '=' + value, names[1] + '=' + cvalue) + "; path=/"; } else { var c = names[0] + "=" + names[1] + '=' + cvalue; if (values != '') { document.cookie = c + '&' + values + ' path=/'; } else { document.cookie = c + '; path=/'; } } } } else { document.cookie = cname + "=" + cvalue + ";"; } }