// Global variables to manage the navigation through the properties' photos
property_photos = new Array();
current_photo_index = 0;
property_photos_preloader = null;

// show or hide a layer depending on its visibility status
function show_hide_layer(layer_id){
  var layer = $('#' + layer_id);
  if(layer.is(':visible')){
	  layer.hide();
	  showhide_all_select_boxes("show");
  }
  else{
	  showhide_all_select_boxes("hide");
	  layer.show();
  }
}

// unchecks all the checkboxes contained in the layer identifed by the "layer_id" parameter
function clear_checkboxes(layer_id){
  var c1 = '#' + layer_id;
  var c1_checked_items = $(c1 + " :checked");
  if($(c1).is(':visible')){
    c1_checked_items.each(function() {
	  $(this).attr('checked', false);
    });
  }
}

// functions to replace broken images
function imgNotAvailableSmall(img){
	//this one is for the thumbnails
	img.src = "/images/search_results/img_not_available_small.gif";
	img.onerror = "";
	return true;
}
function imgNotAvailableBig(img){
	//this one is for the big images of the property details layer
	img.src = "/images/search_results/img_not_available_big.gif";
	img.onerror = "";
	return true;
}

//this function preloads the images, whose paths or urls are received as parameter
function preload_images(imgsToPreload) {
	 preloaded_image_objs = new Array();
	 for(var i=0; i < imgsToPreload.length; i++){
	   preloaded_image_objs[i]=new Image();
	   preloaded_image_objs[i].src= imgsToPreload[i];
	 }
}

//this function preloads the specific images, that are used in the "Search Results" section, 
//and that are not present in the document, when the page is loaded
function preload_sr_images(){
	 var sr_images_paths = new Array(
	 	"/images/globalnav/btn_go_on.jpg", 
		"/images/property_details/btn_previous_listing.jpg",
		"/images/property_details/btn_previous_listing_on.jpg",
		"/images/property_details/btn_next_listing.jpg",
		"/images/property_details/btn_next_listing_on.jpg",
		"/images/search_results/layer_bg_top_new.jpg",
		"/images/search_results/layer_bg_bottom.jpg",
		"/images/search_results/layer_bg_gred.jpg"
	 );
	 preload_images(sr_images_paths);
}

/* Property Details layer */
function show_hide_prop_details_layer()
{
  var detls_layer = "#module_pdetails";
  var grey_layer = "#grey_layer";
  if($(detls_layer).is(':visible')){
    $(detls_layer).fadeOut("slow");
	$(grey_layer).fadeOut("slow");
	showhide_all_select_boxes("show");
	remove_property_photos_preloader_obj();
  }
  else{
	showhide_all_select_boxes("hide");
    $(grey_layer).css({"opacity": "0.7"});
	$(grey_layer).fadeIn("slow");
	$(detls_layer).fadeIn("slow");
  }
}

function change_grey_layer_height(){
   var arr_ver = navigator.appVersion.split("MSIE");
   var ver = parseFloat(arr_ver[1]);
   if ((ver == 6) && (document.body.filters)){
	   var height = Math.max(document.body.scrollHeight, document.body.clientHeight, document.body.offsetHeight);
	   document.getElementById('grey_layer').style.height = height + 'px'; 
   }
}


function show_prop_details_layer()
{
  var detls_layer = "#module_pdetails";
  var grey_layer = "#grey_layer";
  if($(detls_layer).is(':visible') == false){
    showhide_all_select_boxes("hide");
    $(grey_layer).css({"opacity": "0.7"});
	change_grey_layer_height();
	$(grey_layer).fadeIn("slow");
	$(detls_layer).fadeIn("slow");
  }
}

function hide_prop_details_layer()
{
  var detls_layer = "#module_pdetails";
  var grey_layer = "#grey_layer";
  if($(detls_layer).is(':visible')){
    $(detls_layer).fadeOut("slow");
	$(grey_layer).fadeOut("slow");
	showhide_all_select_boxes("show");
	remove_property_photos_preloader_obj();
  }
}

/* functions to manage the preloading and presentation of the property photos */

function PropertyPhotosPreloader(photos_urls){
   //array where all the preloaded images are going to be kept
   this.thePhotos = new Array;
   //the value of this photos counter is incremented in the increment_photos_counter function
   this.ppp_counter = 0;
   //number of photos' urls that must be preloaded
   this.num_photos_urls = photos_urls.length;
   var index = 0;
   while(index < this.num_photos_urls){
     this.preload_photo(photos_urls[index]);
	 index = index + 1;
   }
}

PropertyPhotosPreloader.prototype.increment_photos_counter = function(){
   this.ppp_counter++;
   if ( this.ppp_counter == this.num_photos_urls ){
      onPreloadPhotos(this.thePhotos);
   }
}

PropertyPhotosPreloader.prototype.preload_photo = function(photo_url){
   var photo = new Image;
   photo.objPropertyPhotosPreloader = this;
   photo.photo_with_error = 0;
   photo.onload = function() {
	   this.objPropertyPhotosPreloader.increment_photos_counter();
   }
   photo.onerror = function(){
	   //the variable "photo_with_error" gets assigned a value of 1, when there is an error with its downloading process
	   this.photo_with_error = 1;
	   this.objPropertyPhotosPreloader.increment_photos_counter();
   }
   this.thePhotos.push(photo);
   photo.src = photo_url;
}

//this function clears all the references to the photos preloader object and its items
function remove_property_photos_preloader_obj(){
	if(property_photos_preloader != null){
	  (property_photos_preloader.thePhotos = null);
	  property_photos_preloader = null;
	}
}

//this is the call_back function of the photos preloading process
function onPreloadPhotos(thePhotos){
   if((thePhotos!=null) && (typeof(thePhotos)!="undefined")){
     //navigate through "thePhotos" array and push those images that presented no errors to the "property_photos" array;
     //these are the images that are going to be shown to the user, during navigation through the property photos 
     for (var i=0; i < thePhotos.length; i++){
	   if (thePhotos[i].photo_with_error == 0){
		  property_photos.push(thePhotos[i].src);
	   }
     }
     //now that the photos have been downloaded, show the navigation links:
     show_photos_navigation_links(property_photos.length);
   }
}

function show_photos_navigation_links(num_photos){
  var photos_navigation_links = "";
  if(num_photos > 1){
    photos_navigation_links += "<span class=\"txt_11px\"><a href=\"javascript:show_photo('prev');\" class=\"pt_red\">previous</a></span>";
    photos_navigation_links += "<img src=\"/images/property_details/separator_liney.gif\" alt=\"\"  style=\"margin: 0 6px 0 6px; vertical-align:bottom;\"/>";
    photos_navigation_links += "<span class=\"txt_11px\"><a href=\"javascript:show_photo('next');\" class=\"pt_red\">next</a></span>";
  }
  $("#photos_navigation_links").attr("innerHTML", photos_navigation_links);
}

//this function is called when the user clicks on the "previous" or "next" links, located bellow the
//property image in the property details layer. These are the ones that allow the user to navigate through
//the property's photos
function show_photo(navigation){
  var next_photo_index = 0;
  var prev_photo_index = 0;
  var img_obj = $("#property_img");
  
  if(navigation == "next"){
    next_photo_index = (current_photo_index == (property_photos.length - 1)) ? 0 : (current_photo_index + 1);
	img_obj.attr("src", '/images/search_results/image_loading.gif');
	img_obj.attr("src", property_photos[next_photo_index]);
	current_photo_index = next_photo_index;
  }
  if(navigation == "prev"){
    prev_photo_index = (current_photo_index == 0) ? (property_photos.length - 1) : (current_photo_index - 1);
	img_obj.attr("src", '/images/search_results/image_loading.gif');
	img_obj.attr("src", property_photos[prev_photo_index]);
	current_photo_index = prev_photo_index;
  }
}


function clear_search(data_source){
	if(data_source == "li")
	  window.location = '/templates/finder/results_li.xpnd';
	else
	  window.location = '/templates/finder/results_mht.xpnd';
}


//DOCUMENT READY: all the functions that have to be called and the tasks that have to be performed, 
//when the "Search Results" section is loaded
/* DOCUMENT READY: start */
$(document).ready(function(){
    
	/* preload images */
	preload_sr_images();
	
	/* City, Zip, MLS section */
	$("#f_city_zip_mls").bind("focus", function() {
	  var elem = $("#f_city_zip_mls");
	  if ((trim(elem.val()) == "ENTER CITY, ZIP OR MLS #") || (trim(elem.val()) == "")){ 
		elem.val(""); 
		elem.css('color', '#383838');
	  }
	});
	$("#f_city_zip_mls").bind("blur", function() {
	  var elem = $("#f_city_zip_mls");
	  if ((trim(elem.val()) == "ENTER CITY, ZIP OR MLS #") || (trim(elem.val()) == "")){ 
		elem.css('color', '#e6e6e6');
		elem.val("ENTER CITY, ZIP OR MLS #"); 
	  }
	});
	
	/* hover effect for the "Enter City, Zip, MLS number" go button */
	$("#f_city_zip_mls_go_btn").hover(function(){
	    $(this).attr("src", "/images/globalnav/btn_go_on.jpg");
      }, function() {
         $(this).attr("src", "/images/globalnav/btn_go.jpg");										  
	});
	
	
	/* "Featured Properties" and "Search Results" Tabs */
	$("#sr_feat_props_tab").bind("click", function() {
		var elem_on = "sr_feat_props";
		var elem_off = "sr_search_results";
		var tab_on_id = elem_on + "_tab";
		var tab_off_id = elem_off + "_tab";
		var tab_on = $("#" + tab_on_id);
		var tab_off = $("#" + tab_off_id);
		var panel_on = $("#" + elem_on + "_panel");
		var panel_off = $("#" + elem_off + "_panel");
		tab_on.removeClass(tab_on_id + "_off");
		tab_on.addClass(tab_on_id + "_on");
		tab_off.removeClass(tab_off_id + "_on");
		tab_off.addClass(tab_off_id + "_off");
		panel_off.hide();
		panel_on.show();
	});
	$("#sr_search_results_tab").bind("click", function() {
		var elem_on = "sr_search_results";
		var elem_off = "sr_feat_props";
		var tab_on_id = elem_on + "_tab";
		var tab_off_id = elem_off + "_tab";
		var tab_on = $("#" + tab_on_id);
		var tab_off = $("#" + tab_off_id);
		var panel_on = $("#" + elem_on + "_panel");
		var panel_off = $("#" + elem_off + "_panel");
		tab_on.removeClass(tab_on_id + "_off");
		tab_on.addClass(tab_on_id + "_on");
		tab_off.removeClass(tab_off_id + "_on");
		tab_off.addClass(tab_off_id + "_off");
		panel_off.hide();
		panel_on.show();
	});
	
	/* Sort by functionality */
	$("#select_sort_by").bind("change", function() {
		set_sort_values($(this).val(), "");
	});
	
	$("#sr_sort_asc").bind("click", function() {
		var sort_by_value = $("#select_sort_by").val();
		set_sort_values(sort_by_value, "asc");
	});
	
	$("#sr_sort_dsc").bind("click", function() {
		var sort_by_value = $("#select_sort_by").val();
		set_sort_values(sort_by_value, "dsc");
	});
	
	/*search need help popup*/
	$("#search_need_help_popup").bind("click", function() {
		show_hide_layer('search_help_popup_container');
		$('#select_sort_by').hide();
	});
	
	$("#search_help_close_btn").bind("click", function() {
		show_hide_layer('search_help_popup_container');
		$('#select_sort_by').show();
	});
});


//presents the property details layer
function show_property_details_layer(ml_num, data_source, navigation, results_arr_idx){
  var url = '/templates/finder/includes/property_details_results.xpnd';
  var url = url + '?ml_num=' + ml_num;
  var url = url + '&data_source=' + data_source;
  var i = 0;
  var keep_looking = true;
  var next_ml_num = '';
  var prev_ml_num = '';
  var next_prop_data_source = '';
  var prev_prop_data_source = '';
  
  var page_results_arr = null;
  if(typeof(results_arr_idx)!="undefined"){
	  switch(results_arr_idx){
		  case 0:
			page_results_arr = page;
			break;
		  case 1:
			page_results_arr = page_fp;
			break;
	  }
  }
  else{
    results_arr_idx = 0;
	page_results_arr = page;
  }
  
  while((i < page_results_arr.RESULTS.length) && keep_looking){
	 if(page_results_arr.RESULTS[i].ml_num == ml_num){
		 next_ml_num = (i < (page_results_arr.RESULTS.length - 1)) ? page_results_arr.RESULTS[i + 1].ml_num : page_results_arr.RESULTS[0].ml_num;
		 next_prop_data_source = (i < (page_results_arr.RESULTS.length - 1)) ? page_results_arr.RESULTS[i + 1].data_source : page_results_arr.RESULTS[0].data_source;
		 prev_ml_num = (i == 0) ? page_results_arr.RESULTS[page_results_arr.RESULTS.length - 1].ml_num : page_results_arr.RESULTS[i - 1].ml_num;
		 prev_prop_data_source = (i == 0) ? page_results_arr.RESULTS[page_results_arr.RESULTS.length - 1].data_source : page_results_arr.RESULTS[i - 1].data_source;
		 keep_looking = false;
	 }
	 i++;
  }
  
  if(navigation == "next"){
    if($("#td_next_listing").length){
      $("#td_next_listing").attr("innerHTML", "<div style=\"width:93px; height:26px; line-height:26px; text-align:center;\"><b>Loading...</b></div>");
    }
  }
  if(navigation == "previous"){
    if($("#td_previous_listing").length){
      $("#td_previous_listing").attr("innerHTML", "<div style=\"width:115px; height:26px; line-height:26px; text-align:center;\"><b>Loading...</b></div>");
    }
  }
	
  $.getJSON(url, function(result){
	var content = "";
	//initialize the property photos preloading variables
	remove_property_photos_preloader_obj();
	property_photos = new Array();
	current_photo_index = 0;
	
	//if the property selected (identified by the ml_num) belongs to the LI data source
	if(data_source == "li"){
		var property_class = "";
		var li_land_features = "";
		var li_res_sales_features = "";
		var li_res_rentals_features = "";
		var li_com_sales_features = "";
		var li_com_rentals_features = "";
		var features = "";
		
		//var li_tmp_photos_str = (result.photos != '') ? result.photos.replace(/"|\[|\]/g, "") : '';
		var li_tmp_photos_str = (result.photos != '') ? result.photos.replace(/"/g, "") : '';
		li_tmp_photos_str = (li_tmp_photos_str != '') ? li_tmp_photos_str.replace(/^\[/, "") : '';
        li_tmp_photos_str = (li_tmp_photos_str != '') ? li_tmp_photos_str.replace(/\]$/, "") : '';
		var li_property_photos = li_tmp_photos_str.split(',');
		property_photos_preloader = new PropertyPhotosPreloader(li_property_photos);
		
		li_land_features += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		li_land_features += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		li_land_features += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		li_land_features += "              <tr><td class=\"txt_upper\">PRICE</td></tr>";
		li_land_features += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.price + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		li_land_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_land_features += "              <tr><td class=\"txt_upper\">Annual Taxes</td></tr>";
		li_land_features += "              <tr><td><span class=\"txt_14px\"><b>" + result.taxes + "</b></span></td></tr>";
		li_land_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		if(result.vill_tax != ''){
		  li_land_features += "              <tr><td class=\"txt_upper\">Village Taxes</td></tr>";
		  li_land_features += "              <tr><td><b>" + result.vill_tax + "</b></td></tr>";
		  li_land_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		}
		/*li_land_features += "              <tr><td class=\"txt_upper\">Maintenance/<br>Common Charges</td></tr>";
		li_land_features += "              <tr><td><b>" + result.maint_value + "</b></td></tr>";
		li_land_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"3\"></td></tr>";*/
		li_land_features += "              <tr><td class=\"txt_upper\">School District:</td></tr>";
		li_land_features += "              <tr><td><span class=\"txt_12px\">" + result.school_district + "</span></td></tr>";
		li_land_features += "            </table>";
		li_land_features += "          </div>";
		li_land_features += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		li_land_features += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		li_land_features += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		li_land_features += "              <tr>";
		li_land_features += "                <td>";
		li_land_features += "                  <span class=\"txt_12px\">"
		li_land_features += "                    " + result.acres + "";
		li_land_features += "                    " + result.lot_sz + "";
		li_land_features += "                    " + result.num_plots + "";
		li_land_features += "                    " + result.wood_clear + "";
		li_land_features += "                    " + result.bldg_permt + "";
		li_land_features += "                    " + result.poss_suvdv + "";
		li_land_features += "                  </span>";
		li_land_features += "                </td>";
		li_land_features += "              </tr>";
		li_land_features += "            </table>";
		li_land_features += "          </div>";
		li_land_features += "          <div class=\"clear\"></div>";
		if((result.city_water!='') || (result.sewer!='') || (result.elec!='') || (result.gas!='') || (result.paved_unpv!='') || (result.level_roll!='') || (result.beach_rights!='') || (result.dock_r!='') || (result.waterfront!='') || (result.waterview!='')){
		  li_land_features += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		  li_land_features += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		  li_land_features += "              <tr><td class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		  li_land_features += "              <tr>";
		  li_land_features += "                <td width=\"148\" valign=\"top\">";
		  li_land_features += "                    " + result.city_water + "";
		  li_land_features += "                    " + result.sewer + "";
		  li_land_features += "                    " + result.elec + "";
		  li_land_features += "                    " + result.gas + "";
		  li_land_features += "                    " + result.paved_unpv + "";
		  li_land_features += "                    " + result.level_roll + "";
		  li_land_features += "                    " + result.beach_rights + "";
		  li_land_features += "                    " + result.dock_r + "";
		  li_land_features += "                    " + result.waterfront + "";
		  li_land_features += "                    " + result.waterview + "";
		  li_land_features += "                </td>";
		  li_land_features += "              </tr>";
		  li_land_features += "            </table>";
		  li_land_features += "          </div>";
		}
		li_land_features += "        </div>";
		
		li_res_rentals_features += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		li_res_rentals_features += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		li_res_rentals_features += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		li_res_rentals_features += "              <tr><td class=\"txt_upper\">RENT</td></tr>";
		li_res_rentals_features += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.rent + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		li_res_rentals_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_res_rentals_features += "              <tr><td class=\"txt_upper\">RENTAL TERM</td></tr>";
		li_res_rentals_features += "              <tr><td><span class=\"txt_14px\"><b>" + result.rent_type + "</b></span></td></tr>";
		li_res_rentals_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_res_rentals_features += "              <tr><td class=\"txt_upper\">School District:</td></tr>";
		li_res_rentals_features += "              <tr><td><span class=\"txt_12px\">" + result.school_district + "</span></td></tr>";
		li_res_rentals_features += "            </table>";
		li_res_rentals_features += "          </div>";
		li_res_rentals_features += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		li_res_rentals_features += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		li_res_rentals_features += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		li_res_rentals_features += "              <tr>";
		li_res_rentals_features += "                <td>";
		li_res_rentals_features += "                  <span class=\"txt_12px\">"
		li_res_rentals_features += "                    " + result.style + "";
		li_res_rentals_features += "                    " + result.yr_built + "";
		li_res_rentals_features += "                    " + result.unit_on_fl + "";
		li_res_rentals_features += "                    " + result.sqft + "";
		li_res_rentals_features += "                    " + result.bedrooms + "";
		li_res_rentals_features += "                    " + result.bath_full + "";
		li_res_rentals_features += "                    " + result.bath_half + "";
		li_res_rentals_features += "                    " + result.multifamily + "";
		li_res_rentals_features += "                  </span>";
		li_res_rentals_features += "                </td>";
		li_res_rentals_features += "              </tr>";
		li_res_rentals_features += "            </table>";
		li_res_rentals_features += "          </div>";
		li_res_rentals_features += "          <div class=\"clear\"></div>";
		li_res_rentals_features += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		li_res_rentals_features += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		li_res_rentals_features += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		li_res_rentals_features += "              <tr>";
		li_res_rentals_features += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Exterior</span><br>";
		li_res_rentals_features += "                    " + result.condition + "";
		li_res_rentals_features += "                    " + result.construction + "";
		li_res_rentals_features += "                    " + result.park_fac + "";
		li_res_rentals_features += "                    " + result.beach_rights + "";
		li_res_rentals_features += "                    " + result.handi_acss + "";
		li_res_rentals_features += "                    " + result.pvt_ent + "";
		li_res_rentals_features += "                </td>";
		li_res_rentals_features += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		li_res_rentals_features += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		li_res_rentals_features += "                    " + result.dish + "";
		li_res_rentals_features += "                    " + result.wash_dry + "";
		li_res_rentals_features += "                    " + result.furnished + "";
		li_res_rentals_features += "                    " + result.pets + "";
		li_res_rentals_features += "                </td>";
		li_res_rentals_features += "              </tr>";
		li_res_rentals_features += "            </table>";
		li_res_rentals_features += "          </div>";
		li_res_rentals_features += "        </div>";
		
		li_res_sales_features += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		li_res_sales_features += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		li_res_sales_features += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		li_res_sales_features += "              <tr><td class=\"txt_upper\">PRICE</td></tr>";
		li_res_sales_features += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.price + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		li_res_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_res_sales_features += "              <tr><td class=\"txt_upper\">Annual Taxes</td></tr>";
		li_res_sales_features += "              <tr><td><span class=\"txt_14px\"><b>" + result.taxes + "</b></span></td></tr>";
		li_res_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		if(result.vill_tax != ''){
		  li_res_sales_features += "              <tr><td class=\"txt_upper\">Village Taxes</td></tr>";
		  li_res_sales_features += "              <tr><td><b>" + result.vill_tax + "</b></td></tr>";
		  li_res_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		}
		/*li_res_sales_features += "              <tr><td class=\"txt_upper\">Maintenance/<br>Common Charges</td></tr>";
		li_res_sales_features += "              <tr><td><b>" + result.maint_value + "</b></td></tr>";
		li_res_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"3\"></td></tr>";*/
		li_res_sales_features += "              <tr><td class=\"txt_upper\">School District:</td></tr>";
		li_res_sales_features += "              <tr><td><span class=\"txt_12px\">" + result.school_district + "</span></td></tr>";
		li_res_sales_features += "            </table>";
		li_res_sales_features += "          </div>";
		li_res_sales_features += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		li_res_sales_features += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		li_res_sales_features += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		li_res_sales_features += "              <tr>";
		li_res_sales_features += "                <td>";
		li_res_sales_features += "                  <span class=\"txt_12px\">";
		li_res_sales_features += "                    " + result.style + "";
		li_res_sales_features += "                    " + result.type_own + "";
		li_res_sales_features += "                    " + result.yr_built + "";
		li_res_sales_features += "                    " + result.acres + "";
		li_res_sales_features += "                    " + result.sqft + "";
		li_res_sales_features += "                    " + result.bedrooms + "";
		li_res_sales_features += "                    " + result.bath_full + "";
		li_res_sales_features += "                    " + result.bath_half + "";
		li_res_sales_features += "                    " + result.multifamily + "";
		li_res_sales_features += "                  </span>";
		li_res_sales_features += "                </td>";
		li_res_sales_features += "              </tr>";
		li_res_sales_features += "            </table>";
		li_res_sales_features += "          </div>";
		li_res_sales_features += "          <div class=\"clear\"></div>";
		li_res_sales_features += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		li_res_sales_features += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		li_res_sales_features += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		li_res_sales_features += "              <tr>";
		li_res_sales_features += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Exterior</span><br>";
		li_res_sales_features += "                    " + result.condition + "";
		li_res_sales_features += "                    " + result.construction + "";
		li_res_sales_features += "                    " + result.patio + "";
		li_res_sales_features += "                    " + result.greenfeat + "";
		li_res_sales_features += "                    " + result.horse_prop + "";
		li_res_sales_features += "                    " + result.tennis_ct + "";
		li_res_sales_features += "                    " + result.cul_de_sac + "";
		li_res_sales_features += "                    " + result.gar_type + "";
		li_res_sales_features += "                    " + result.waterfront + "";
		li_res_sales_features += "                    " + result.waterview + "";
		li_res_sales_features += "                    " + result.pool + "";
		li_res_sales_features += "                    " + result.beach_rights + "";
		li_res_sales_features += "                </td>";
		li_res_sales_features += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		li_res_sales_features += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		li_res_sales_features += "                    " + result.fireplaces + "";
		li_res_sales_features += "                    " + result.rms + "";
		li_res_sales_features += "                    " + result.den_fr + "";
		li_res_sales_features += "                    " + result.dining_room + "";
		li_res_sales_features += "                    " + result.basement + "";
		li_res_sales_features += "                    " + result.fuel + "";
		li_res_sales_features += "                    " + result.heat + "";
		li_res_sales_features += "                    " + result.a_c + "";
		li_res_sales_features += "                    " + result.amenities + "";
		li_res_sales_features += "                    " + result.wood_floor + "";
		li_res_sales_features += "                </td>";
		li_res_sales_features += "              </tr>";
		li_res_sales_features += "            </table>";
		li_res_sales_features += "          </div>";
		li_res_sales_features += "        </div>";
		
		li_com_sales_features += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		li_com_sales_features += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		li_com_sales_features += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		li_com_sales_features += "              <tr><td class=\"txt_upper\">PRICE</td></tr>";
		li_com_sales_features += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.price + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		li_com_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_com_sales_features += "              <tr><td class=\"txt_upper\">ANNUAL TAXES</td></tr>";
		li_com_sales_features += "              <tr><td><span class=\"txt_14px\"><b>" + result.taxes + "</b></span></td></tr>";
		li_com_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_com_sales_features += "              <tr><td class=\"txt_upper\">VILLAGE TAXES</td></tr>";
		li_com_sales_features += "              <tr><td><b>" + result.vill_tax + "</b></td></tr>";
		li_com_sales_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_com_sales_features += "              <tr><td class=\"txt_upper\">SCHOOL DISTRICT:</td></tr>";
		li_com_sales_features += "              <tr><td><span class=\"txt_12px\">" + result.school_district + "</span></td></tr>";
		li_com_sales_features += "            </table>";
		li_com_sales_features += "          </div>";
		li_com_sales_features += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		li_com_sales_features += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		li_com_sales_features += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		li_com_sales_features += "              <tr>";
		li_com_sales_features += "                <td>";
		li_com_sales_features += "                  <span class=\"txt_12px\">";
		li_com_sales_features += "                    " + result.type_sale + "";
		li_com_sales_features += "                    " + result.bus_type + "";
		li_com_sales_features += "                    " + result.yr_built + "";
		li_com_sales_features += "                    " + result.acres + "";
		li_com_sales_features += "                    " + result.sqft + "";
		li_com_sales_features += "                    " + result.bus_age + "";
		li_com_sales_features += "                    " + result.inventory + "";
		li_com_sales_features += "                  </span>";
		li_com_sales_features += "                </td>";
		li_com_sales_features += "              </tr>";
		li_com_sales_features += "            </table>";
		li_com_sales_features += "          </div>";
		li_com_sales_features += "          <div class=\"clear\"></div>";
		li_com_sales_features += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		li_com_sales_features += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		li_com_sales_features += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		li_com_sales_features += "              <tr>";
		li_com_sales_features += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Exterior</span><br>";
		li_com_sales_features += "                    " + result.condition + "";
		li_com_sales_features += "                    " + result.construction + "";
		li_com_sales_features += "                    " + result.greenfeat + "";
		li_com_sales_features += "                    " + result.park_spcs + "";
		li_com_sales_features += "                    " + result.waterfront + "";
		li_com_sales_features += "                    " + result.waterview + "";
		li_com_sales_features += "                </td>";
		li_com_sales_features += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		li_com_sales_features += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		li_com_sales_features += "                    " + result.num_units + "";
		li_com_sales_features += "                    " + result.handi_acss + "";
		li_com_sales_features += "                    " + result.sprinklers + "";
		li_com_sales_features += "                    " + result.ceil_ht + "";
		li_com_sales_features += "                </td>";
		li_com_sales_features += "              </tr>";
		li_com_sales_features += "            </table>";
		li_com_sales_features += "          </div>";
		li_com_sales_features += "        </div>";
		
		li_com_rentals_features += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		li_com_rentals_features += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		li_com_rentals_features += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		li_com_rentals_features += "              <tr><td class=\"txt_upper\">RENT</td></tr>";
		li_com_rentals_features += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.rent + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		li_com_rentals_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_com_rentals_features += "              <tr><td class=\"txt_upper\">RENTAL TERM</td></tr>";
		li_com_rentals_features += "              <tr><td><span class=\"txt_14px\"><b>" + result.rent_type + "</b></span></td></tr>";
		li_com_rentals_features += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		li_com_rentals_features += "              <tr><td class=\"txt_upper\">School District:</td></tr>";
		li_com_rentals_features += "              <tr><td><span class=\"txt_12px\">" + result.school_district + "</span></td></tr>";
		li_com_rentals_features += "            </table>";
		li_com_rentals_features += "          </div>";
		li_com_rentals_features += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		li_com_rentals_features += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		li_com_rentals_features += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		li_com_rentals_features += "              <tr>";
		li_com_rentals_features += "                <td>";
		li_com_rentals_features += "                  <span class=\"txt_12px\">";
		li_com_rentals_features += "                    " + result.bus_type + "";
		li_com_rentals_features += "                    " + result.yr_built + "";
		li_com_rentals_features += "                    " + result.acres + "";
		li_com_rentals_features += "                    " + result.sqft + "";
		li_com_rentals_features += "                    " + result.bus_age + "";
		li_com_rentals_features += "                    " + result.inventory + "";
		li_com_rentals_features += "                  </span>";
		li_com_rentals_features += "                </td>";
		li_com_rentals_features += "              </tr>";
		li_com_rentals_features += "            </table>";
		li_com_rentals_features += "          </div>";
		li_com_rentals_features += "          <div class=\"clear\"></div>";
		li_com_rentals_features += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		li_com_rentals_features += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		li_com_rentals_features += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		li_com_rentals_features += "              <tr>";
		li_com_rentals_features += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Exterior</span><br>";
		li_com_rentals_features += "                    " + result.condition + "";
		li_com_rentals_features += "                    " + result.construction + "";
		li_com_rentals_features += "                    " + result.greenfeat + "";
		li_com_rentals_features += "                    " + result.park_spcs + "";
		li_com_rentals_features += "                    " + result.waterfront + "";
		li_com_rentals_features += "                    " + result.waterview + "";
		li_com_rentals_features += "                </td>";
		li_com_rentals_features += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		li_com_rentals_features += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		li_com_rentals_features += "                    " + result.num_units + "";
		li_com_rentals_features += "                    " + result.handi_acss + "";
		li_com_rentals_features += "                    " + result.sprinklers + "";
		li_com_rentals_features += "                </td>";
		li_com_rentals_features += "              </tr>";
		li_com_rentals_features += "            </table>";
		li_com_rentals_features += "          </div>";
		li_com_rentals_features += "        </div>";
	
	
		property_class = result.property_class;
		switch(property_class){
		  case "Lan":
			features = li_land_features;
			break;
		  case "Ren":
			features = li_res_rentals_features;
			break;
		  case "Com":
			features = (result.s_r == 'S') ? li_com_sales_features : li_com_rentals_features;
			break;
		  default:
			features = li_res_sales_features;
			break;
		}
							  
		content += "  <div id=\"top_property\" class=\"mgrt_16px\" >";
		content += "    <div class=\"width_484px left style_logo\" ><a href=\"/index.xpnd\"><img src=\"/images/globalnav/logo.gif\" alt=\"EAST EGG REALTY\" width=\"345\" height=\"89\"></a></div>";
		content += "      <div class=\"width_516px left dnone_top\" >";
		content += "        <table width=\"516\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
		content += "          <tr><td colspan=\"5\" width=\"1\"><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"5\"></td></tr>";
		content += "          <tr>";
		content += "            <td width=\"18\"><img src=\"/images/search_results/spacer.gif\"  width=\"29\" height=\"1\"></td>";
		content += "            <td id=\"td_previous_listing\" width=\"115\"><img id=\"btn_previous_listing\" src=\"/images/property_details/btn_previous_listing.jpg\" width=\"115\" height=\"26\" alt=\"PREVIOUS LISTING\" style=\"cursor:pointer;\" class=\"rOver\" onclick=\"show_property_details_layer('" + prev_ml_num + "','" + prev_prop_data_source + "', 'previous', " + results_arr_idx + ");\"></td>";
		content += "            <td width=\"12\"><img src=\"/images/search_results/spacer.gif\"  width=\"12\" height=\"1\"></td>";
		content += "            <td id=\"td_next_listing\" width=\"93\"><img id=\"btn_next_listing\" src=\"/images/property_details/btn_next_listing.jpg\" width=\"93\" height=\"26\" alt=\"NEXT LISTING\" style=\"cursor:pointer;\" class=\"rOver\" onclick=\"show_property_details_layer('" + next_ml_num + "','" + next_prop_data_source + "', 'next', " + results_arr_idx + ");\"/></td>";
		content += "            <td width=\"307\" align=\"right\"><img id=\"close_sign\" src=\"/images/property_details/btn_close.gif\" width=\"58\" height=\"26\" alt=\"Close\" style=\"cursor:pointer;\" style=\"cursor:pointer;\" /></td>";
		content += "          </tr>";
		content += "        </table>";
		content += "      </div>";
		content += "      <div class=\"clear\"></div>";
		content += "    </div>";
		content += "    <div id=\"content_property\" class=\"mrgl_10px\">";
		content += "      <div class=\"width_484px left\">";
		content += "        <div id=\"img_property\"><img id=\"property_img\" src=\"" + li_property_photos[0] + "\"  width=\"480\" height=\"360\" alt=\"\" onerror=\"imgNotAvailableBig(this)\"/></div>";
		content += "        <div id=\"property_tour\" class=\"mgrt_16px\">";
		content += "          <table width=\"484\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
		content += "            <tr>";
		content += "              <td align=\"left\" class=\"txt_14px\"><!--PROPERTY TOUR--></td>";
		content += "              <td id=\"photos_navigation_links\" valign=\"middle\" align=\"right\">";
		content += "                Loading photos...";
		content += "              </td>";
		content += "            </tr>";
		content += "            <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"7\"></td></tr>";
		content += "            <tr>";
		content += "              <td colspan=\"2\" valign=\"middle\" align=\"left\">";
		content += "                <!--<span class=\"txt_11px\"><a href=\"#\" class=\"pt_red\">virtual tour</a></span>";
		content += "                <img src=\"/images/property_details/separator_liney.gif\" alt=\"\" style=\"margin: 0 6px 0 6px; vertical-align:bottom;\"/>";
		content += "                <span class=\"txt_11px\"><a href=\"#\" class=\"pt_red\">floorplan</a></span>-->";
		content += "              </td>";
		content += "            </tr>";
		content += "          </table>";
		content += "        </div>";
		content += "        <div id=\"property_detail_module\">";
		content += "          <div class=\"detail_top_gred\" ></div>";
		content += "          <div class=\"detail_middle_gred\">";
		content += "            <div class=\"detail_main txt_11px\">";
		content += "              " + result.ad_text + "";
		content += "              " + result.greendesc + "";
		content += "              " + result.fl_1 + "";
		content += "              " + result.fl_2 + "";
		content += "              " + result.fl_3 + "";
		content += "            </div>";
		content += "          </div>";
		content += "          <div class=\"detail_bottom_gred\"></div>";
		content += "        </div>";
		content += "      </div>";
		content += "      <div class=\"width_516px left\" style=\"margin:0; padding:0;\">";
		content += "        <div id=\"global_links\">";
		content += "          <table width=\"475\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
		content += "            <tr><td colspan=\"12\"><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"9\"></td></tr>";
		content += "            <tr>";
		content += "              <td width=\"11\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		content += "              <td width=\"27\" align=\"left\"><img id=\"pdl_atmf_icon_" + ml_num + "\" src=\"/images/search_results/little_elephant_grey.gif\" width=\"18\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"93\" align=\"left\"><div id=\"pdl_atmf_error_holder_" + ml_num + "\" class=\"add_to_myfavs_error_holder\" onClick=\"$(this).hide();\"></div><span class=\"txt_11px\"><a href=\"javascript:add_to_my_favs('" + data_source + "', '" + ml_num + "', 2);\" class=\"link_red\">add to my favorites</a></span></td>";
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"17\" align=\"left\"><img src=\"/images/property_details/contactus_icon.png\" width=\"12\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"52\" align=\"left\"><span class=\"txt_11px\"><a id=\"email_contact_us_link\" href=\"#\" class=\"link_red\" onClick=\"show_contact_popup('"+ ml_num +"','"+ data_source +"',false);\">contact us</a></span></td>";
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"24\" align=\"left\"><img src=\"/images/property_details/email_icon.png\" width=\"15\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"78\" align=\"left\"><span class=\"txt_11px\"><a href=\"#\" class=\"link_red\" onClick=\"show_email_this_listing_popup('"+ ml_num +"',false);\">email this listing</a></span></td>";
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"25\" align=\"left\"><img src=\"/images/property_details/print_icon.png\" width=\"16\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"73\" align=\"left\"><span class=\"txt_11px\"><a href=\"\" class=\"link_red\" onClick=\"window.print(); return false\">print this listing</a></span></td>";
		content += "            </tr>";
		content += "          </table>";
		content += "        </div>";
		content += "        <div id=\"property_name\">";
		content += "          <span class=\"txt_11px txt_size_16px\"><b>" + result.town + ", " + result.ste + " " + result.zip + "</b><br><span class=\"txt_gray\">MLS #</span> " + result.ml_num + "</span>";
		content += "        </div>";
		
		// Concatenate the additional features string: start
		content = content + features;
		// Concatenate the additional features string: end
				
		content += "          <div id=\"mcph\" class=\"left\">";
		content += "            <div class=\"top\"></div>";
		content += "            <div class=\"content\">";
		content += "              <div class=\"frame\">";		
		
		content += "                <div class=\"header mrg_bot_20px\">need advice?</div>";
		content += "                <div id=\"mcph_financing_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">financing</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF09', 'returns', 602, 400 , 258, 339, 'yes', 0)\">How much home can I afford?</a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF05', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Should I rent or buy?</a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF01', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Should I refinance?</a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_mortgage_calcs_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">mortgage calculators</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF02', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Fixed Rate ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF03', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Adjustable Rate ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF06', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Which mortgage is right for me?</a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_locations_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">locations</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/neighborhood_profiles_popup.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">Neighborhood Profiles ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/school_statistics_popup.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">School Statistics ></a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_home_buyer_res_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">homebuyer resources</div>";
		content += "                  <div><a id=\"first_time_homebuyer\" href=\"#\">First Time Homebuyer Credit ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/real_estate_glossary.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">Real Estate Glossary ></a></div>";
		content += "                  <div><a id=\"working_wab_broker\" href=\"#\">Working With a Buyer&#39;s Agent ></a></div>";
		content += "                </div>";		
		
		content += "                <div id=\"mcph_elephants_holder\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"center\"><img src=\"/images/search_results/mcph_elephants.jpg\" width=\"50\" height=\"18\" /></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_contact_panel\" class=\"txt_black\">";
		content += "                  <div class=\"mrg_bot_5px\">Questions or concerns?</div>";
		content += "                  <div class=\"mrg_bot_5px\">Not finding the home of your dreams?</div>";
		content += "                  <div class=\"mrg_bot_5px\">East Egg agents are full-time real estate experts and we're happy to serve you.  Our Real Estate Ambassadors can use industry resources to identify properties that fit your criteria.</div>";
		content += "                  <div class=\"center\">1.877.328.9421<br />info@easteggrealty.com</div>";
		content += "                </div>";
		content += "              </div>";
		content += "            </div>";
		content += "            <div class=\"bottom\"></div>";
		content += "          </div>";
		
		content += "          <div class=\"clear\"></div>";
		content += "        </div>";
		content += "        <div class=\"clear\"></div>";
		content += "      </div>";
		content += "      <div id=\"footer_property\" class=\"mgrt_16px\" style=\"margin:20px 12px 10px 12px;\">";
		content += "        <div id=\"pd_disclaimer\" class=\"txt_11px\">";
		content += "          All material herein is intended for information purposes only and has been compiled from sources deemed reliable. Though information is believed to be correct, it is presented subject to errors,ommissions, changes or withdrawal without notice. East Egg Realty is a licensed real estate broker. Owned and operated by East Egg Realty, LLC. The source of the displayed data is either the property owner or public record provided by non-governmental third parties. It is believed to be reliable but not guaranteed. Listing provided courtesy of " + result.rltr_firm + ".";
		content += "        </div>";
		/*content += "        <div id=\"footer_logo\" class=\"left\"> <img src=\"/images/property_details/mls_logo.png\" alt=\"\" border=\"0\"><img src=\"/images/search_results/spacer.gif\"  width=\"10\" height=\"1\"> </div>";
		content += "        <div id=\"footer_info\" class=\"txt_11px left\">";
		content += "          <span class=\"txt_gray\">Listing Agent </span>" + result.list_ag + "<br>";
		content += "          <span class=\"txt_gray\">Realtor Firm </span>" + result.rltr_firm + "";
		content += "        </div>";
		content += "        <div class=\"clear\"></div>";*/
		content += "      </div>";
	}
	//if the property selected (identified by the ml_num) belongs to the MHT data source
	if(data_source == "ny" || data_source == "sm"){
		var sale_rental = result.sale_rental;
		var mht_res_sales = "";
		var mht_res_rentals = "";
		var mht_features = "";
		//var mht_tmp_photos_str = (result.photos != '') ? result.photos.replace(/"|\[|\]/g, "") : '';
		var mht_tmp_photos_str = (result.photos != '') ? result.photos.replace(/"/g, "") : '';
		mht_tmp_photos_str = (mht_tmp_photos_str != '') ? mht_tmp_photos_str.replace(/^\[/, "") : '';
        mht_tmp_photos_str = (mht_tmp_photos_str != '') ? mht_tmp_photos_str.replace(/\]$/, "") : '';
		var mht_property_photos = mht_tmp_photos_str.split(',');
		property_photos_preloader = new PropertyPhotosPreloader(mht_property_photos);
		
		mht_res_sales += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 0 0 9px; width:308px;\">";
		mht_res_sales += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		mht_res_sales += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		mht_res_sales += "              <tr><td class=\"txt_upper\">PRICE</td></tr>";
		mht_res_sales += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.price + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		mht_res_sales += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		mht_res_sales += "              <tr><td class=\"txt_upper\">MAINTENANCE/<br>COMMON CHARGES</td></tr>";
		mht_res_sales += "              <tr><td><b>" + result.maint + "</b></td></tr>";
		mht_res_sales += "              <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"3\"></td></tr>";
		mht_res_sales += "              <tr><td class=\"txt_upper\">REAL ESTATE TAXES</td></tr>";
		mht_res_sales += "              <tr><td><span class=\"txt_14px\"><b>" + result.re_taxes + "</b></span></td></tr>";
		mht_res_sales += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		mht_res_sales += "              <tr><td class=\"txt_upper\">FINANCING ALLOWED:</td></tr>";
		mht_res_sales += "              <tr><td><span class=\"txt_14px\"><b>" + result.financing + "</b></span></td></tr>";
		mht_res_sales += "            </table>";
		mht_res_sales += "          </div>";
		mht_res_sales += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		mht_res_sales += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		mht_res_sales += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		mht_res_sales += "              <tr>";
		mht_res_sales += "                <td>";
		mht_res_sales += "                  <span class=\"txt_12px\">";
		mht_res_sales += "                    " + result.apt_type + "";
		mht_res_sales += "                    " + result.yr_built + "";
		mht_res_sales += "                    " + result.sqft + "";
		mht_res_sales += "                    " + result.bedrooms + "";
		mht_res_sales += "                    " + result.bath_tot + "";
		mht_res_sales += "                    " + result.rooms + "";
		mht_res_sales += "                  </span>";
		mht_res_sales += "                </td>";
		mht_res_sales += "              </tr>";
		mht_res_sales += "            </table>";
		mht_res_sales += "          </div>";
		mht_res_sales += "          <div class=\"clear\"></div>";
		mht_res_sales += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		mht_res_sales += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		mht_res_sales += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		mht_res_sales += "              <tr>";
		mht_res_sales += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Building</span><br>";
		mht_res_sales += "                    " + result.elevators + "";
		mht_res_sales += "                    " + result.doorman + "";
		mht_res_sales += "                    " + result.attended_lobby + "";
		mht_res_sales += "                    " + result.pets + "";
		mht_res_sales += "                    " + result.num_fl + "";
		mht_res_sales += "                </td>";
		mht_res_sales += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		mht_res_sales += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		mht_res_sales += "                    " + result.outdoor_spaces + "";
		mht_res_sales += "                    " + result.views + "";
		mht_res_sales += "                    " + result.fireplace + "";
		mht_res_sales += "                    " + result.furnished + "";
		mht_res_sales += "                </td>";
		mht_res_sales += "              </tr>";
		mht_res_sales += "            </table>";
		mht_res_sales += "          </div>";
		mht_res_sales += "        </div>";
		
		mht_res_rentals += "        <div id=\"property_sales\" class=\"left\" style=\"margin:0 5px 0 9px; width:308px;\">";
		mht_res_rentals += "          <div id=\"ps_column1\" class=\"left\" style=\"width:148px;\">";
		mht_res_rentals += "            <table width=\"148\" cellspacing=\"0\" class=\"txt_14px\">";
		mht_res_rentals += "              <tr><td class=\"txt_upper\">RENT</td></tr>";
		mht_res_rentals += "              <tr><td><span class=\"txt_size_18px\"><b>" + result.rent + "</b></span><br><!--<span class=\"txt_12px\">contract status</span>--></td></tr>";
		mht_res_rentals += "              <tr><td><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"3\"></td></tr>";
		mht_res_rentals += "              <tr><td class=\"txt_upper\">MINIMUM<br>RENTAL TERM:</td></tr>";
		mht_res_rentals += "              <tr><td><b>" + result.minterm + "</b></td></tr>";
		mht_res_rentals += "              <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"3\"></td></tr>";
		mht_res_rentals += "            </table>";
		mht_res_rentals += "          </div>";
		mht_res_rentals += "          <div id=\"ps_column2\" class=\"left\" style=\"width:155px; margin-left:5px;\">";
		mht_res_rentals += "            <table width=\"155\" cellspacing=\"0\" class=\"txt_14px\">";
		mht_res_rentals += "              <tr><td class=\"txt_upper\">PROPERTY FEATURES</td></tr>";
		mht_res_rentals += "              <tr>";
		mht_res_rentals += "                <td>";
		mht_res_rentals += "                  <span class=\"txt_12px\">";
		mht_res_rentals += "                    " + result.apt_type + "";
		mht_res_rentals += "                    " + result.yr_built + "";
		mht_res_rentals += "                    " + result.sqft + "";
		mht_res_rentals += "                    " + result.bedrooms + "";
		mht_res_rentals += "                    " + result.bath_tot + "";
		mht_res_rentals += "                    " + result.rooms + "";
		mht_res_rentals += "                  </span>";
		mht_res_rentals += "                </td>";
		mht_res_rentals += "              </tr>";
		mht_res_rentals += "            </table>";
		mht_res_rentals += "          </div>";
		mht_res_rentals += "          <div class=\"clear\"></div>";
		mht_res_rentals += "          <div id=\"ps_column_additional\" style=\"padding-top:21px; width:308px;\">";
		mht_res_rentals += "            <table width=\"308\" cellspacing=\"0\" class=\"txt_12px\">";
		mht_res_rentals += "              <tr><td colspan=\"3\" class=\"txt_14px txt_upper\">ADDITIONAL PROPERTY FEATURES</td></tr>";
		mht_res_rentals += "              <tr>";
		mht_res_rentals += "                <td width=\"148\" valign=\"top\"><span class=\"txt_italicbold\">Building</span><br>";
		mht_res_rentals += "                    " + result.elevators + "";
		mht_res_rentals += "                    " + result.doorman + "";
		mht_res_rentals += "                    " + result.attended_lobby + "";
		mht_res_rentals += "                    " + result.pets + "";
		mht_res_rentals += "                    " + result.num_fl + "";
		mht_res_rentals += "                </td>";
		mht_res_rentals += "                <td width=\"9\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		mht_res_rentals += "                <td width=\"155\" valign=\"top\"><span class=\"txt_italicbold\">Interior</span><br>";
		mht_res_rentals += "                    " + result.outdoor_spaces + "";
		mht_res_rentals += "                    " + result.views + "";
		mht_res_rentals += "                    " + result.fireplace + "";
		mht_res_rentals += "                    " + result.furnished + "";
		mht_res_rentals += "                </td>";
		mht_res_rentals += "              </tr>";
		mht_res_rentals += "            </table>";
		mht_res_rentals += "          </div>";
		mht_res_rentals += "        </div>";
		
		switch(sale_rental){
		  case "Sale":
			mht_features = mht_res_sales;
			break;
		  case "Rental":
			mht_features = mht_res_rentals;
			break;
		}
		
		content += "  <div id=\"top_property\" class=\"mgrt_16px\" >";
		content += "    <div class=\"width_484px left style_logo\" ><a href=\"/index.xpnd\"><img src=\"/images/globalnav/logo.gif\" alt=\"EAST EGG REALTY\" width=\"345\" height=\"89\"></a></div>";
		content += "      <div class=\"width_516px left dnone_top\" >";
		content += "        <table width=\"516\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
		content += "          <tr><td colspan=\"5\" width=\"1\"><img src=\"/images/search_results/spacer.gif\" width=\"1\" height=\"5\"></td></tr>";
		content += "          <tr>";
		content += "            <td width=\"18\"><img src=\"/images/search_results/spacer.gif\"  width=\"29\" height=\"1\"></td>";
		if(data_source == "ny"){
			content += "            <td id=\"td_previous_listing\" width=\"115\"><img id=\"btn_previous_listing\" src=\"/images/property_details/btn_previous_listing.jpg\" width=\"115\" height=\"26\" alt=\"PREVIOUS LISTING\" style=\"cursor:pointer;\" class=\"rOver\" onclick=\"show_property_details_layer('" + prev_ml_num + "','" + prev_prop_data_source + "', 'previous', " + results_arr_idx + ");\"></td>";
			content += "            <td width=\"12\"><img src=\"/images/search_results/spacer.gif\"  width=\"12\" height=\"1\"></td>";
			content += "            <td id=\"td_next_listing\" width=\"93\"><img id=\"btn_next_listing\" src=\"/images/property_details/btn_next_listing.jpg\" width=\"93\" height=\"26\" alt=\"NEXT LISTING\" style=\"cursor:pointer;\" class=\"rOver\" onclick=\"show_property_details_layer('" + next_ml_num + "','" + next_prop_data_source + "', 'next', " + results_arr_idx + ");\"/></td>";
		}else{
			content += "            <td id=\"td_previous_listing\" width=\"115\"></td>";
			content += "            <td width=\"12\"><img src=\"/images/search_results/spacer.gif\"  width=\"12\" height=\"1\"></td>";
			content += "            <td id=\"td_next_listing\" width=\"93\"></td>";
		}
		content += "            <td width=\"307\" align=\"right\"><img id=\"close_sign\" src=\"/images/property_details/btn_close.gif\" width=\"58\" height=\"26\" alt=\"Close\" style=\"cursor:pointer;\" /></td>";
		content += "          </tr>";
		content += "        </table>";
		content += "      </div>";
		content += "      <div class=\"clear\"></div>";
		content += "    </div>";
		content += "    <div id=\"content_property\" class=\"mrgl_10px\">";
		content += "      <div class=\"width_484px left\">";
		content += "        <div id=\"img_property\"><img id=\"property_img\" src=\"" + mht_property_photos[0] + "\"  width=\"480\" height=\"360\" alt=\"\" onerror=\"imgNotAvailableBig(this)\"/></div>";
		content += "        <div id=\"property_tour\" class=\"mgrt_16px\">";
		content += "          <table width=\"484\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
		content += "            <tr>";
		content += "              <td align=\"left\" class=\"txt_14px\"><!--PROPERTY TOUR--></td>";
		content += "              <td id=\"photos_navigation_links\" valign=\"middle\" align=\"right\">";
		content += "                Loading photos...";
		content += "              </td>";
		content += "            </tr>";
		content += "            <tr><td><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"7\"></td></tr>";
		content += "            <tr>";
		content += "              <td colspan=\"2\" valign=\"middle\" align=\"left\">";
		content += "                <!--<span class=\"txt_11px\"><a href=\"#\" class=\"pt_red\">virtual tour</a></span>";
		content += "                <img src=\"/images/property_details/separator_liney.gif\" alt=\"\" style=\"margin: 0 6px 0 6px; vertical-align:bottom;\"/>";
		content += "                <span class=\"txt_11px\"><a href=\"#\" class=\"pt_red\">floorplan</a></span>-->";
		content += "              </td>";
		content += "            </tr>";
		content += "          </table>";
		content += "        </div>";
		content += "        <div id=\"property_detail_module\">";
		content += "          <div class=\"detail_top_gred\" ></div>";
		content += "          <div class=\"detail_middle_gred\">";
		content += "            <div class=\"detail_main txt_11px\">";
		content += "              " + result.bldg_name + "";
		if(result.amenities!=''){
			content += "              <em><b>Amenities</b></em><br />";
			content += "              " + result.amenities + "";
		}
		content += "              " + result.main_desc + "";
		content += "            </div>";
		content += "          </div>";
		content += "          <div class=\"detail_bottom_gred\"></div>";
		content += "        </div>";
		content += "      </div>";
		content += "      <div class=\"width_516px left\" style=\"margin:0; padding:0;\" >";
		content += "        <div id=\"global_links\">";
		content += "          <table width=\"475\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
		content += "            <tr><td colspan=\"12\"><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"9\"></td></tr>";
		content += "            <tr>";
		content += "              <td width=\"11\"><img src=\"/images/search_results/spacer.gif\"  width=\"9\" height=\"1\"></td>";
		if(data_source == "ny"){
			content += "              <td width=\"27\" align=\"left\"><img id=\"pdl_atmf_icon_" + ml_num + "\" src=\"/images/search_results/little_elephant_grey.gif\" width=\"18\" height=\"14\" alt=\"\"/></td>";
			content += "              <td width=\"93\" align=\"left\"><div id=\"pdl_atmf_error_holder_" + ml_num + "\" class=\"add_to_myfavs_error_holder\" onClick=\"$(this).hide();\"></div><span class=\"txt_11px\"><a href=\"javascript:add_to_my_favs('" + data_source + "', '" + ml_num + "', 2);\" class=\"link_red\">add to my favorites</a></span></td>";
		}else{
			content += "              <td width=\"27\" align=\"left\"></td>";
			content += "              <td width=\"93\" align=\"left\"></td>";		
		}
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"17\" align=\"left\"><img src=\"/images/property_details/contactus_icon.png\" width=\"12\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"52\" align=\"left\"><span class=\"txt_11px\"><a id=\"email_contact_us_link\" href=\"#\" class=\"link_red\" onClick=\"show_contact_popup('"+ ml_num +"','"+ data_source +"',false);\">contact us</a></span></td>";
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"24\" align=\"left\"><img src=\"/images/property_details/email_icon.png\" width=\"15\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"78\" align=\"left\"><span class=\"txt_11px\"><a id=\"email_this_listing_link\" href=\"#\" class=\"link_red\"  onClick=\"show_email_this_listing_popup('"+ ml_num +"',false);\">email this listing</a></span></td>";
		content += "              <td width=\"25\"><img src=\"/images/search_results/spacer.gif\"  width=\"25\" height=\"1\"></td>";
		content += "              <td width=\"25\" align=\"left\"><img src=\"/images/property_details/print_icon.png\" width=\"16\" height=\"14\" alt=\"\"/></td>";
		content += "              <td width=\"73\" align=\"left\"><span class=\"txt_11px\"><a href=\"\" class=\"link_red\" onClick=\"window.print(); return false\">print this listing</a></span></td>";
		content += "            </tr>";
		content += "          </table>";
		content += "        </div>";
		content += "        <div id=\"property_name\">";
		content += "          <span class=\"txt_11px txt_size_16px\"><b>" + result.location_det + "</b><br><span class=\"txt_gray\">MLS #</span> " + result.ml_num + "</span>";
		content += "        </div>";
		
		// Concatenate the additional features string: start
		content = content + mht_features;
		// Concatenate the additional features string: end
		
		content += "          <div id=\"mcph\" class=\"left\">";
		content += "            <div class=\"top\"></div>";
		content += "            <div class=\"content\">";
		content += "              <div class=\"frame\">";		
			
		content += "                <div class=\"header mrg_bot_20px\">need advice?</div>";
		content += "                <div id=\"mcph_financing_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">financing</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF09', 'returns', 602, 400 , 258, 339, 'yes', 0)\">How much home can I afford?</a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF05', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Should I rent or buy?</a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF01', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Should I refinance?</a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_mortgage_calcs_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">mortgage calculators</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF02', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Fixed Rate ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF03', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Adjustable Rate ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/need_advice/calculators.html?CALCULATORID=HF06', 'returns', 602, 400 , 258, 339, 'yes', 0)\">Which mortgage is right for me?</a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_locations_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">locations</div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/neighborhood_profiles_popup.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">Neighborhood Profiles ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/school_statistics_popup.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">School Statistics ></a></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_home_buyer_res_panel\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"txt_black_uc\">homebuyer resources</div>";
		content += "                  <div><a id=\"first_time_homebuyer\" href=\"#\">First Time Homebuyer Credit ></a></div>";
		content += "                  <div><a href=\"javascript:popWinEER('/templates/finder/includes/real_estate_glossary.xpnd', 'returns', 590, 410 , 159, 323, 'no', 0)\">Real Estate Glossary ></a></div>";
		content += "                  <div><a id=\"working_wab_broker\" href=\"#\">Working With a Buyer&#39;s Agent ></a></div>";
		content += "                </div>";
		
		content += "                <div id=\"mcph_elephants_holder\" class=\"mrg_bot_20px\">";
		content += "                  <div class=\"center\"><img src=\"/images/search_results/mcph_elephants.jpg\" width=\"50\" height=\"18\" /></div>";
		content += "                </div>";
		content += "                <div id=\"mcph_contact_panel\" class=\"txt_black\">";
		content += "                  <div class=\"mrg_bot_5px\">Questions or concerns?</div>";
		content += "                  <div class=\"mrg_bot_5px\">Not finding the home of your dreams?</div>";
		content += "                  <div class=\"mrg_bot_5px\">East Egg agents are full-time real estate experts and we're happy to serve you.  Our Real Estate Ambassadors can use industry resources to identify properties that fit your criteria.</div>";
		content += "                  <div class=\"center\">1.877.328.9421<br />info@easteggrealty.com</div>";
		content += "                </div>";
		content += "              </div>";
		content += "            </div>";
		content += "            <div class=\"bottom\"></div>";
		content += "          </div>";
		
		content += "          <div class=\"clear\"></div>";
		content += "        </div>";
		content += "        <div class=\"clear\"></div>";
		content += "      </div>";
		content += "      <div id=\"footer_property\" class=\"mgrt_16px\" style=\"margin:20px 12px 10px 12px;\">";
		/*content += "        <div id=\"pd_disclaimer\" class=\"txt_11px_light_grey\" style=\"margin-bottom:16px;\">";*/
		content += "        <div id=\"pd_disclaimer\" class=\"txt_11px\">";
		content += "          All material herein is intended for information purposes only and has been compiled from sources deemed reliable. Though information is believed to be correct, it is presented subject to errors, ommissions, changes or withdrawal without notice. East Egg Realty is a licensed real estate broker. Owned and operated by East Egg Realty, LLC. The source of the displayed data is either the property owner or public record provided by non-governmental third parties. It is believed to be reliable but not guaranteed. Listing provided courtesy of " + result.rltr_firm + ".";
		content += "        </div>";
		/*content += "        <div id=\"footer_logo\" class=\"left\"><img src=\"/images/search_results/mls_logo_mht.gif\" alt=\"\" border=\"0\"><img src=\"/images/search_results/spacer.gif\"  width=\"17\" height=\"25\"></div>";
		content += "        <div id=\"footer_info\" class=\"txt_11px left\">";
		content += "          Listing Agent " + result.list_agent + "<br>";
		content += "          " + result.rltr_firm + "";
		content += "        </div>";
		content += "        <div class=\"clear\"><img src=\"/images/search_results/spacer.gif\"  width=\"1\" height=\"33\"></div>";*/
		content += "      </div>";
	}
		
	$("#module_pdetails").attr("innerHTML", '');
	$("#module_pdetails").attr("innerHTML", content);
	
	$("#close_sign").click(function(){
	  show_hide_prop_details_layer();
	});

	$("#btn_previous_listing").hover(function(){
	    $(this).attr("src", "/images/property_details/btn_previous_listing_on.jpg");
      }, function() {
         $(this).attr("src", "/images/property_details/btn_previous_listing.jpg");										  
	});
	
	$("#btn_next_listing").hover(function(){
	    $(this).attr("src", "/images/property_details/btn_next_listing_on.jpg");
      }, function() {
         $(this).attr("src", "/images/property_details/btn_next_listing.jpg");										  
	});
	
	//need advice events
	$("#first_time_homebuyer").click(function(){
	  show_hide_layer('first_time_homebuyer_credit_popup_container');
	});
	$("#working_wab_broker").click(function(){
	  show_hide_layer('working_buyer_broker_agent_popup_container');
	});
	
	
	//find out if property is in my favorites
	request_fav_property_registered(get_ulrp_usrlogin_cookie_value(), data_source, ml_num, 2);
	
	show_prop_details_layer();
	
  });
  
  window.scrollTo(0,0);
}
/* Property Details layer: end */
