  // launch Property Gallery
  function launchPropertyGallery(mls_id) {
    url = "/home/gallery/property?mls_id=" + mls_id;
    searchWindow = open(url, "propertygallery", "width=520,height=350,resizable=yes,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no");
  }

  /*
    Javascript to manage the property gallery
  */
  function switchColorOn(index) {
    elementId = "featured-property-" + index;
    document.getElementById(elementId).style.background = "#fff";
  }

  function switchColorOff(index) {
    elementId = "featured-property-" + index;
    document.getElementById(elementId).style.background = "#f2f2ee";
  }

  function setSelectedProperty(index) {
    selectedElementId = "featured-property-" + index
    var otherElementId1;
    var otherElementId2;

    if (index == 0) {
      otherElementId1 = "featured-property-1";
      otherElementId2 = "featured-property-2";
    } else if (index == 1) {
      otherElementId1 = "featured-property-0";
      otherElementId2 = "featured-property-2";
    } else if (index == 2) {
      otherElementId1 = "featured-property-0";
      otherElementId2 = "featured-property-1";
    }

    document.getElementById(selectedElementId).style.background = "#fff";
    document.getElementById(otherElementId1).style.background = "#f2f2ee";
    document.getElementById(otherElementId2).style.background = "#f2f2ee";
  }

  // launch window for full size images
  function launchFullSizeImage(image_path) {
    url = image_path;
    searchWindow = open(url, "fullsize", "width=600,height=500,resizable=yes,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no");
  }
