﻿function AddToSearchCompare(regionid, mlnum, ctl) {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "/Services/PropertyCompare.asmx/AddToSearchCompare",
        data: "{'regionid':'" + regionid + "', 'mlnum':'" + mlnum + "','IsChecked':'" + ctl.checked + "'}",
        dataType: "json",
        async: true,
        success: function(msg) {
            if (msg.d == false) {
                ctl.checked = false;
                alert("6 properties already selected");
            }
        }
    });
}

function CheckForSearchSelected(ctl) {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "/Services/PropertyCompare.asmx/CheckForSearchSelected",
        data: "{}",
        dataType: "json",
        async: true,
        success: function(msg) {
            if (msg.d == false) {
                alert("At least 1 property must be selected.");
            }
        }
    }); return false;
}
