			$(document).ready(function() {
				/* Add Featured Listings to the page */
				//loadFeaturedListingsHTML(); 
				//getFeatPhotoListHTML();
				getFeatTilesHTML();
			});

			var currentFeatIndex = 0;
			function loadFeaturedListingsHTML(localFeatIndex) {
				if (localFeatIndex < 0) {localFeatIndex = featListings.length - 1;}
				if (typeof localFeatIndex == "undefined") {
					currentFeatIndex = 0;
				} else {
					currentFeatIndex = localFeatIndex;
				}
				
				if (featListings.length > 0) {
					var strHTML = GetPropertyHtml(currentFeatIndex) + "<br />" + GetPropertyHtml(currentFeatIndex + 1);
					/* Append the Next/Prev Button Links */
					$("#FeatListingsBox").html(strHTML);
				} else if (featListings.length <= 0) {
					$("#FeatListingsBox").html("<div class='NoFeatMsg'>No Featured Listings Found.<br /><a href='Search.aspx?wID=" + CurrentAgent.WebID + "'><i>Click Here to Search For Local Homes</i></a></div>");
				}
				/* setTimeout("fixFeaturedPhotos()", 500); */
			}
			function getFeatPhotoListHTML() {
				// ONLY PHOTOS !!!!
				var featBox = $("div#FeatPhotoListHTML");
				var pics = [];
				if (featListings.length < 1) {$(".FeatListingsBoxes").hide();}
				for (var i=0; i < featListings.length; i++) {
					pics.push( "<img src='" + getPropPhoto(featListings[i], 1) + "' />");
				}
				featBox.html(pics.join("\n"));
			}
			function getFeatTilesHTML() {
				/// FULL INFO TILES
				var featBox = $("div#FeatPhotoListHTML");
				var propTiles = [];
				var limit = 4;
				for (var i=0; i < featListings.length; i++) {
					propTiles.push(GetPropertyHtml(i));
					if (i >= limit) {i = featListings.length; /* BAIL OUT */}
				}
				featBox.html(propTiles.join("\n"));
				featBox.cycle({
					fx: 'fade'
				});

			}
			function GetPropertyHtml(propIndex) {
				if (propIndex >= featListings.length) {return "End of listings...";}
				var strHTML = "";
				var bkrInfo = ((featListings[propIndex] && featListings[propIndex].Broker) ? "<br />Courtesy of: " + featListings[propIndex].Broker : "");
				strHTML += "\
	<div class='FeaturedListingBox'>\
		<div class='PhotoBox'><div style='height: 150px; background: url(" + getPropPhoto(featListings[propIndex], 1) + ") no-repeat; background-position: center center; '></div></div>\
		<div class='ListingInfo'><a href='" + featListings[propIndex].Url + "' style='font: bold 20px;'>" + featListings[propIndex].Address + "</a><br />\nBeds: " + featListings[propIndex].Beds + "<br />\nBaths: " + featListings[propIndex].Baths + "<br />\nPrice: " + featListings[propIndex].Price + bkrInfo + "</div>\
	</div>\n";
				return strHTML;
			}
			function getPropPhoto(listing, picIndex, size) {
				// Note: picIndex MUST be between 1-99
				return "GetPhoto.aspx?LN=" + listing.ListingID + "&Size=" + (size ? size : "ExtraLarge") + "&PhotoIndex=" + picIndex + "&Board=" + CurrentAgent.Board;
			}
			function fixFeaturedPhotos() {
				$("div.FeaturedListingBox div.PhotoBox").each(function(index, obj) {
					var actualImageHeight = $("img", obj).height();
					if (actualImageHeight > 63) {
						$(obj).css({height: (10 + $("img", obj).height()) + "px"});
					}
				});
			}
