  function loadSearchAreaCompleted() {
     if (typeof loadSearchAreaCompletedListener == "function") {
       try {
         setTimeout("loadSearchAreaCompletedListener();", 1000);
       }
       catch (err) {
       }
     }
  }

  function updateSearchArea(response, targetDir, location) {
    if (response) {
      var loadProfilesDiv = document.getElementById("loadProfilesDiv");
      loadProfilesDiv.innerHTML = "";
      loadProfilesDiv.innerHTML = response;
      //try {
      //  document.getElementById("AreaOfSearchDiv").innerHTML = location;
      //}
      //catch (err) {
      //}
      loadIntersectionToBusiness(targetDir);
    }
  }
  
  function loadIntersectionToBusiness(targetDir) {
    new Ajax.Request(targetDir + '/profiles/business.html?method=intersection2Business',
      {
        method: 'post',
          onSuccess: 
            function(transport) {
              updateIntersectionToBusiness(transport, targetDir);
            },
          onFailure: 
            function() {
              window.status = '';
            }
      });  
  }

  function updateIntersectionToBusiness(transport, targetDir) {
    var json = eval('(' + transport.responseText + ')');
    if (json) {
      try {
        var items = json.items;
        var i;
        for (i = 0; i < json.jids.length; i++) {
          var busList = eval('items.' + json.jids[i]);
          if (busList != null) {
            var html = '';
            var j;
            for (j = 0; j < busList.length; j++) {
              var bus = busList[j];
              if (bus) {
                if (html != '') {
                  html = html + '<br />';
                }
                html = html + '<a href="' + targetDir + '/profiles/business.html?id=' + bus.id + '">' + bus.name + '</a>  ';
                if (bus.isRegistered == 0) {
                  html = html + '<a href="javascript:void(0);"'
                              + '   onmouseover="return overlib(\'Business has not registered.\', CAPTION, \'\', AUTOSTATUS);"'
                              + '   onmouseout="nd();"><img src="' + targetDir + '/themes/images/question.gif" width="12" height="12" border="0" /></a>';
                  //html = html + '<a href="javascript:void(0);"'
                  //            + '   onmouseover="return OLgetAJAX(\'/vq/acct1/showVideo.html?id=1&source=/videouploads/COCHRANEBLVD_SUTTER_L1-3430179510761591\', VQovajax, 300, \'style1\');">'
                  //            + '<img src="' + targetDir + '/themes/images/question.gif" width="12" height="12" border="0" /></a>';
                }
              }
            } // for j
            var divElement = document.getElementById(json.jids[i]);
            if (html != '') {
              html = '<strong>Businesses On Intersection</strong><br />' + html;
            }
            divElement.innerHTML = html;
          } // if (busList != null)
        } // for i
      } // try
      catch (jerr) {
      } // catch
    }
  }
  