// JavaScript Document
/** Following code: (c) Dan Levy - Updated: 2008-10-25 **/
var DisplayedListingIDs = [];
function isListingVisible(listingID) {
	var idList = "|" + DisplayedListingIDs.join("|") + "|";
	if (idList.indexOf("|" + listingID + "|") > -1) {
		return true;
	}
	return false;
}

/*    Featured Property 1   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */

function LoadListingData(VariablePrefix) {
	var strHTML = "";
	if (!VariablePrefix) {VariablePrefix = "";}
	/* Loop through each listing and append it's details to the strHTML string */
	
	for (i = 0; i < eval(VariablePrefix + "photo.length"); i++) {
		if (!isListingVisible(eval(VariablePrefix + "listingIDs[" + i + "]"))) {
			/* To check if a photo exists, this will do the trick:*/
			strHTML += " " + eval(VariablePrefix + "address[" + i + "]") + "<br />";
			if (eval(VariablePrefix + "photo[" + i + "]")) {
				strHTML += "<a href=\"FullDetails.cfm?URL="+ escape(eval(VariablePrefix+ "link[" + i + "]"))+ "\" target=\"blank\"><img width=\"130\" height=\"100\" src=\""  + eval(VariablePrefix + "photo[" + i + "]") + "\" alt=\"Listing Photo\" +  border=\"0\" /><br />";
			} else {
				strHTML += "<a href=\"FullDetails.cfm?URL="+ escape(eval(VariablePrefix+ "link[" + i + "]"))+ "\" target=\"blank\"><img width=\"150\" height=\"100\" src=\"http://www.myhomecards.com/images/NoPhoto.gif\" alt=\"No Photo\" +  border=\"0\"  /></a><br />";/* No Photo - make sure the img src exists */
			}
			
			strHTML += "Beds: " + eval(VariablePrefix + "beds[" + i + "]") + "&nbsp; &nbsp; &nbsp; &nbsp;";
			strHTML += "Baths: " + new Number(eval(VariablePrefix + "baths[" + i + "]")).toPrecision(2) + "<br />";
			strHTML += "Price: " + eval(VariablePrefix + "price[" + i + "]") + "<br />";
			strHTML += "<a href=\"FullDetails.cfm?URL="+ escape(eval(VariablePrefix+ "link[" + i + "]"))+ "\" target=\"blank\">&raquo;Full Details</a><br />";
			
			
		
			
			/* ADD THE LISTING ID TO THE LIST OF DISPLAYED IDS */
			DisplayedListingIDs.push(eval(VariablePrefix + "listingIDs[" + i + "]"));
			/* Now that a listing's HTML has been added, set i so we get out of this "for" loop */
			i = eval(VariablePrefix + "photo.length");
		}
	}	
	var DivNumber = VariablePrefix.replace("S", "");
	document.getElementById("ListingResults" + DivNumber).innerHTML = strHTML;
}

/*    Featured Property 2   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML2 = "";
function LoadListingData2() { 
	LoadListingData("S2");
}
/*    Featured Property 3   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML3 = "";
function LoadListingData3() { 
	LoadListingData("S3");
}

/*    Featured Property 4   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML4 = "";
function LoadListingData4() {	
	LoadListingData("S4");
}
/*    Featured Property 5   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML5 = "";
function LoadListingData5() { 
	LoadListingData("S5");
}
/*    Featured Property 6   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML6 = "";
function LoadListingData6() { 
	LoadListingData("S6");
}
/*    Featured Property 7   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML7 = "";
function LoadListingData7() { 
	LoadListingData("S7");
}
/*    Featured Property 8   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML8 = "";
function LoadListingData8() { 
	LoadListingData("S8");
}
/*    Featured Property 9   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML9 = "";
function LoadListingData9() { 
	LoadListingData("S9");
}
/*    Featured Property 10   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML10 = "";
function LoadListingData10() { 
	LoadListingData("S10");
}
/*    Featured Property 11   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML11 = "";
function LoadListingData11() { 
	LoadListingData("S11");
}
/*    Featured Property 12   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML12 = "";
function LoadListingData12() { 
	LoadListingData("S12");
}
/*    Featured Property 13   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML13 = "";
function LoadListingData13() { 
	LoadListingData("S13");
}
/*    Featured Property 14   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML14 = "";
function LoadListingData14() { 
	LoadListingData("S14");
}
/*    Featured Property 15   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML15 = "";
function LoadListingData15() { 
	LoadListingData("S15");
}
/*    Featured Property 16   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML16 = "";
function LoadListingData16() { 
	LoadListingData("S16");
}
/*    Featured Property 17   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML17 = "";
function LoadListingData17() { 
	LoadListingData("S17");
}
/*    Featured Property 18   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML18 = "";
function LoadListingData18() { 
	LoadListingData("S18");
}
/*    Featured Property 19   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML19 = "";
function LoadListingData19() { 
	LoadListingData("S19");
}
/*    Featured Property 20   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML20 = "";
function LoadListingData20() { 
	LoadListingData("S20");
}
/*    Featured Property 21   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML21 = "";
function LoadListingData21() { 
	LoadListingData("S21");
}
/*    Featured Property 22   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML22 = "";
function LoadListingData22() { 
	LoadListingData("S22");
}
/*    Featured Property 23   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML23 = "";
function LoadListingData23() { 
	LoadListingData("S23");
}
/*    Featured Property 24   */
/* strHTML will hold our complete HTML string - this is what will be loaded into the <div> with id 'ListingResults' */
var strHTML24 = "";
function LoadListingData24() { 
	LoadListingData("S24");
}
