  function showRequestAddressPopup(event) {
    $jq("#sendBtn").removeAttr("disabled");
    $jq("#closeBtn").removeAttr("disabled");

    var e = $jq("#addressRequestError");
    e.html("&nbsp;");

    e = $jq("#EMAIL");
    e.css("color", "");
    e.css("background", "white");
    e.val('');

    e = $jq("#NAME");
    e.val('');

    e = $jq("#PHONE");
    e.val('');

    //UIUtils.show($jq("addressRequestDIV"));
    //UIUtils.centreToBrowser($jq("addressRequestDIV"));

    $jq("#addressRequestDIV").show().centerInClient();
    $jq("#NAME").focus();

  } // showRequestAddressPopup()

  function requestAddress(propertyCode) {

    $jq("#sendBtn").attr("disabled", "disabled");
    $jq("#closeBtn").attr("disabled", "disabled");

    var eerror = $jq("#addressRequestError");
    eerror.css("color", "darkGreen");
    eerror.html("Please wait...");
    eerror.show();

    var ename = $jq("#NAME");
    var ephone = $jq("#PHONE");
    var eemail = $jq("#EMAIL");

    //Note: AJAX calls need to be on same domain.
    var url = "/wre/1.0/addreq.php?codes=" + propertyCode + "&email=" + escape(eemail.val()) + "&name=" + escape(ename.val()) + "&phone=" + escape(ephone.val());
    //alert(url); return;
    
    $jq.getJSON(url, {}, function(data, status) {
      var responseJSON = data;
      //console.log(data);

      if (responseJSON.status == "OK") {
        $jq("#addressRequestDIV").hide();
        alert("Property Address has been emailed.");
      } else {
        //Error.
        if (responseJSON.status == "BADEMAIL") {
           eemail.focus();
           eerror.html("Invalid or Empty Email Address.");
           eerror.css("color", "red");
        } else if (responseJSON.status == "NOPROPERTY") {
          eerror.html("Sorry, this Property address cannot be emailed.");
          eerror.css("color", "red");
        } else {
          eerror.html("Sorry an error has occured and the address could not be emailed.");
          eerror.css("color", "red");
        }

        $jq("#sendBtn").removeAttr("disabled");
        $jq("#closeBtn").removeAttr("disabled");
      } // if OK
    });

  } // requestAddress()

