var _Type;
var _Url;
var _Data;
var _ContentType;
var _DataType;
var _ProcessData;
function CallService_Audit() {
//var ii = 1;
$.ajax({
type: _Type, //GET or POST or PUT or DELETE verb
url: _Url, // Location of the service
data: _Data, //Data sent to server
contentType: _ContentType, // content type sent to server
dataType: _DataType, //Expected data format from server
processdata: _ProcessData, //True or False
success: function (msg) {//On Successfull service call
_Type = null; _Url = null; _Data = null; _ContentType = null; _DataType = null; _ProcessData = null;
},
error: function (result) { // When Service call fails
_Type = null; _Url = null; _Data = null; _ContentType = null; _DataType = null; _ProcessData = null;
}
});
}
function CommonAudit_Service(type) {
_Type = "POST";
_Url = "/Service.svc/AddCommonAuditRecord";
_Data = '{"domain": "mlsguide", "type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function ListingAudit_Service(mlsnum, type) {
_Type = "POST";
_Url = "/Service.svc/AddListingAuditRecord";
_Data = '{"domain": "mlsguide","mlsnum": "' + mlsnum + '","type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function OfficeAudit_Service(mlsnum, type) {
_Type = "POST";
_Url = "/Service.svc/AddOfficeAuditRecord";
_Data = '{"domain": "mlsguide","mlsnum": "' + mlsnum + '","type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function AgentAudit_Service(mlsnum, type) {
_Type = "POST";
_Url = "/Service.svc/AddAgentAuditRecord";
_Data = '{"domain": "mlsguide","mlsnum": "' + mlsnum + '","type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function OfficeAuditByOfficeCode_Service(officeCode, type) {
_Type = "POST";
_Url = "/Service.svc/AddOfficeAuditRecordByOfficeCode";
_Data = '{"domain": "mlsguide","officeCode": "' + officeCode + '","type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function CitySearchAudit_Service(cityName) {
_Type = "POST";
_Url = "https://www.mlsguide.com/Service.svc/AddCitySearchAuditRecord";
_Data = '{"domain": "mlsguide","cityName": "' + cityName + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function AgentAuditByAgentCode_Service(agentCode, type) {
_Type = "POST";
_Url = "/Service.svc/AddAgentAuditRecordByAgentCode";
_Data = '{"domain": "mlsguide","agentCode": "' + agentCode + '","type": "' + type + '"}';
_ContentType = "application/json; charset=utf-8";
_DataType = "json"; ProcessData = true;
CallService_Audit();
}
function SetSession_Service(name, value) {
$.ajax({
type: "POST",
url: "/Search.aspx/SetSession",
data: '{"name": "' + name + '","value": "' + value + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function AddFavorite_Service(mlsNum) {
$.ajax({
type: "POST",
url: "/Search.aspx/AddFavorite",
data: '{"mlsNum": "' + mlsNum + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function RemoveFavorite_Service(mlsNum) {
$.ajax({
type: "POST",
url: "/Search.aspx/RemoveFavorite",
data: '{"mlsNum": "' + mlsNum + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function AddSearchSave_Service(searchCriteria,filterCriteria) {
$.ajax({
type: "POST",
url: "/Search.aspx/AddSearchSave",
data: '{"searchCriteria": "' + searchCriteria + '","filterCriteria": "' + filterCriteria + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function RemoveSearchSave_Service(id) {
$.ajax({
type: "POST",
url: "/SavedSearches.aspx/RemoveSearchSave",
data: '{"id": "' + id + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function SendNotificationSelecteSearchSave_Service(id, send) {
$.ajax({
type: "POST",
url: "/SavedSearches.aspx/SendNotificationSelect",
data: '{"id": "' + id + '","send": "' + send + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function SendNotificationSelecteSearchSave_Service(id, send) {
$.ajax({
type: "POST",
url: "/SavedSearches.aspx/SendNotificationSelect",
data: '{"id": "' + id + '","send": "'+ send +'"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
function GetPropertyData_Service(id) {
var time = new Date();
console.log("Begin data load: " + time.getMinutes() + ":" + time.getSeconds());
$(".property-modal-content").hide();
$(".property-modal").show();
$("#LoadingImage").show();
$.ajax({
type: "POST",
url: "/Search.aspx/GetPropertyData",
data: '{"id": "' + id + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
var obj = result.d;
document.title = obj.Title;
$("#pAgentInfo").hide();
$("#pPrice-Price").hide();
$("#pVirtualTour").hide();
$("#pOpenHouses").hide();
$("#pFavorite").hide();
$("#pPrice-Price").html(obj.Price);
$("#pMain-Address").html(obj.Address);
$("#pMain-CityZip").html(obj.CityZip);
$("#pMain-MLSNum").html(obj.MLSNum);
$("#pMain-Description").html(obj.Description);
$("#pRemark-Remark").html(obj.Remark);
//Email
$("#FdMLSNum").val(obj.MLSNum);
$("#BrMLSNum").val(obj.MLSNum);
$("#pOfficeName").html(obj.OfficeName);
$("#pAgentNameLinkProp").attr("href", "#");
$("#pAgentNameLinkProp").attr("onclick", "showAgent('" + obj.AgentCode + "');return false;");
$("#pAgentNameProp").html(obj.AgentName);
$("#pOfficePhone").hide();
$("#pOfficePhone2").hide();
$("#pBtnShowOfficePhone").attr("onclick", "showOfficePhoneProperty('" + obj.OfficeCode + "','" + obj.AgentCode + "');");
$("#pBtnShowOfficePhone").show();
$("#pBtnShowOfficePhone2").attr("onclick", "showOfficePhoneProperty2('" + obj.OfficeCode + "');");
$("#pBtnShowOfficePhone2").show();
if (obj.OfficePhone.length > 0) {
$("#pOfficePhone").html(obj.OfficePhone);
$("#pPanel_OfficePhone").show();
if (obj.StatusCat != "1") {
$("#pOfficePhone2").html(obj.OfficePhone);
$("#pPanel_OfficePhone2").show();
} else {
$("#pPanel_OfficePhone2").hide();
}
} else {
$("#pPanel_OfficePhone").hide();
$("#pPanel_OfficePhone2").hide();
}
$("#pCellPhone").hide();
$("#pBtnShowCellPhone").attr("onclick", "showCellPhoneProperty('" + obj.AgentCode + "');");
$("#pBtnShowCellPhone").show();
if (obj.CellPhone.length > 0) {
$("#pCellPhone").html(obj.CellPhone);
$("#pPanel_CellPhone").show();
} else {
$("#pPanel_CellPhone").hide();
}
if (obj.AgentImage.length > 0) {
if (obj.AgentWebPage.length > 0) {
$("#pAgentImageProp").attr("src", obj.AgentImage);
$("#pAgentWebPageProp").attr("href", obj.AgentWebPage);
} else {
$("#pAgentImageProp").attr("src", obj.AgentImage);
$("#pAgentWebPageProp").removeAttr("href");
}
$(".p-agent-info-photo").show();
} else {
$(".p-agent-info-photo").hide();
}
if (obj.AgentType.length > 0) {
$("#pPremierAgentTypeName").html("
" + obj.AgentType);
}
if (obj.OfficeImage.length > 0) {
$("#pOfficeImageProp").attr("src", obj.OfficeImage);
if (obj.OfficeWebPage.length > 0) {
$("#pOfficeWebPageProp").attr("href", obj.OfficeWebPage);
} else {
$("#pOfficeWebPageProp").removeAttr("href");
}
$("#pOfficePanelProp").show();
} else {
$("#pOfficePanelProp").hide();
}
if (obj.StatusCat == '1' && obj.OpenHouses) {
var s = '';
var ln = obj.OpenHouses.length;
for (var i = 0; i < ln; i++) {
s += '
' + obj.OpenHouses[i].DayOfWeek + ' ' + obj.OpenHouses[i].Month + ' ' + obj.OpenHouses[i].Day + '
' +
obj.OpenHouses[i].BeginTime + ' - ' + obj.OpenHouses[i].EndTime + '
' + obj.OpenHousesLiveStreams[i].DayOfWeek + ' ' + obj.OpenHousesLiveStreams[i].Month + ' ' + obj.OpenHousesLiveStreams[i].Day + '
' +
obj.OpenHousesLiveStreams[i].BeginTime + ' - ' + obj.OpenHousesLiveStreams[i].EndTime + '
' + data.PropTypeName + '
'; s += '$' + data.Price + '
'; s += ''; s += '' + data.Address + ', '; s += data.City + ', NJ ' + data.Zip; s += '
'; s += '' + data.Beds + ' BR ' + data.Baths + ' Full Baths
'; s += '' + data.PropTypeName + '
'; s += '$' + data.Price + '
'; s += ''; s += '' + data.Address + ', '; s += data.City + ', NJ ' + data.Zip; s += '
'; s += '' + data.Beds + ' BR ' + data.Baths + ' Full Baths
'; s += '