var ppI = new Array()
var ppN = new Array()
var ppT = new Array()
var ppS = new Array()
var iMOff = true

function returnGraphic(iScore)
{

	if (iScore == 100)
	{
		return "<IMG ALT='Perfect match - Has everything you wanted!' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m100.gif'>"
	}
	else if (iScore >= 90)
	{
		return "<IMG ALT='Very close match, having almost all of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m90.gif'>"
	}
	else if (iScore >= 80)
	{
		return "<IMG ALT='Very close match, having almost all of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m80.gif'>"
	}
	else if (iScore >= 70)
	{
		return "<IMG ALT='Close match - has almost all of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m70.gif'>"
	}
	else if (iScore >= 60)
	{
		return "<IMG ALT='Close match - has most of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m60.gif'>"
	}
	else if (iScore >= 50)
	{
		return "<IMG ALT='Close match for most of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m50.gif'>"
	}
	else if (iScore < 50)
	{
		return "<IMG ALT='Other match. Scored 50% or less of your search criteria.' STYLE='margin-right: 5px; margin-top: 1px' WIDTH=9 HEIGHT=9 SRC='http://www.oceanisle.us/_rc/oib/html/images/m50.gif'>"
	}
}

function FillSearchResults(iStartPosition)
{
	var iiLoop
	var sHtml = ""
	var iLoopCounter
	var iPrevCounter
	var bBreak
	var iTmpStartPosition
	var iPageSize = 20
	var iPageLooper
	var iEndPageLooper
	var bPageLooper = false
	var divSearchResults = document.getElementById("divSearchResults")
	var oPrevA, oPrevB
	var oMoreA, oMoreB

	if (divSearchResults == null) {return}

	if (ppI.length == 0) {return}

	if (iStartPosition == -1)
	{
		if (ppI.length > 0)
		{
			iEndPageLooper = (ppI.length / 20)
		}
		else
		{
			iEndPageLooper = 50
		}
		iStartPosition = 0
	}
	else
	{
		iEndPageLooper = 1
	}

	iTmpStartPosition = iStartPosition

	for (iPageLooper = 0; iPageLooper < iEndPageLooper; iPageLooper++)
	{
		iLoopCounter = 0
		bBreak = false
		sHtml = "<TABLE STYLE='background-color: #ECF7FD; border: 1px solid #ACA899; width: 265px' WIDTH='100%' CELLPADDIN='0' CELLSPACING='0'>"
		sHtml = sHtml + "<TR>"
		sHtml = sHtml + "<TD STYLE='padding: 5px' COLSPAN=10>"
		sHtml = sHtml + "	<TABLE WIDTH='100%' CELLPADDIN='0' CELLSPACING='0'>"
		sHtml = sHtml + "		<TD WIDTH='100%'><B>Your Search Results</B></TD>"
		sHtml = sHtml + "		<TD ID='prevResultsA'></TD>"
		sHtml = sHtml + "		<TD ID='moreResultsA'></TD>"
		sHtml = sHtml + "	</TR></TABLE>"
		sHtml = sHtml + "</TD>"
		sHtml = sHtml + "</TR>"
		for (iiLoop = iStartPosition; iiLoop < ppI.length; iiLoop++)
		{
			iLoopCounter = iLoopCounter + 1
			if (iLoopCounter > iPageSize) {bBreak = true; break}

			if (ppT[iiLoop] == "")
			{
				if (ppI[iiLoop] == curProp)
				{
					sHtml = sHtml + "<TR><TD WIDTH=9 STYLE='padding-bottom: 5px; padding-left: 10px'>"
					sHtml = sHtml + returnGraphic(ppS[iiLoop])
					sHtml = sHtml + "</TD><TD WIDTH=100% STYLE='padding-bottom: 5px' COLSPAN=2><A CLASS='lmenub' HREF='" + baseUrl + "/" + ppI[iiLoop] + "_d?sid=" + sGuid + "'>" + ppN[iiLoop] + "</A></TD></TR>"
					bPageLooper = true
				}
				else
				{
					sHtml = sHtml + "<TR><TD WIDTH=9 STYLE='padding-bottom: 5px; padding-left: 10px'>"
					sHtml = sHtml + returnGraphic(ppS[iiLoop])
					sHtml = sHtml + "</TD><TD WIDTH=100% STYLE='padding-bottom: 5px' COLSPAN=2><A CLASS='lmenu' HREF='" + baseUrl + "/" + ppI[iiLoop] + "_d?sid=" + sGuid + "'>" + ppN[iiLoop] + "</A></TD></TR>"
				}
			}
			else
			{
				if (ppI[iiLoop] == curProp)
				{
					sHtml = sHtml + "<TR><TD WIDTH=9 STYLE='padding-bottom: 5px; padding-left: 10px'>"
					sHtml = sHtml + returnGraphic(ppS[iiLoop])
					sHtml = sHtml + "</TD><TD WIDTH=100% STYLE='padding-bottom: 5px' COLSPAN=2><A TITLE='" + ppN[iiLoop] + ppT[iiLoop] + "' CLASS='lmenub' HREF='" + baseUrl + "/" + ppI[iiLoop] + "_d?sid=" + sGuid + "'>" + ppN[iiLoop] + "...</A></TD></TR>"
					bPageLooper = true
				}
				else
				{
					sHtml = sHtml + "<TR><TD WIDTH=9 STYLE='padding-bottom: 5px; padding-left: 10px'>"
					sHtml = sHtml + returnGraphic(ppS[iiLoop])
					sHtml = sHtml + "</TD><TD WIDTH=100% STYLE='padding-bottom: 5px' COLSPAN=2><A TITLE='" + ppN[iiLoop] + ppT[iiLoop] + "' CLASS='lmenu' HREF='" + baseUrl + "/" + ppI[iiLoop] + "_d?sid=" + sGuid + "'>" + ppN[iiLoop] + "...</A></TD></TR>"
				}
			}
		}
		sHtml = sHtml + "</TABLE>"
		divSearchResults.innerHTML = sHtml

		iPrevCounter = (iiLoop - iPageSize - iLoopCounter)
		if (iPrevCounter < 0) {iPrevCounter = 0} else {iPrevCounter = iPrevCounter + 1}
		if (bBreak == false) {iPrevCounter = iPrevCounter - 1}

		oPrevA = document.getElementById('prevResultsA')
		oMoreA = document.getElementById('moreResultsA')

		if ((iiLoop - iPageSize) > 0)
		{
			oPrevA.innerHTML = "<A HREF='javascript:FillSearchResults(" + iPrevCounter + ")'><IMG BORDER=0 WIDTH=18 HEIGHT=17 ALT='Previous Page of Results' SRC='http://www.oceanisle.us/_rc/oib/html/images/button_greenarrow_menul.gif'></A>"
		}
		else
		{
			oPrevA.innerHTML = "<IMG BORDER=0 WIDTH=18 HEIGHT=17 SRC='http://www.oceanisle.us/_rc/oib/html/images/clear.gif'>"
		}

		if (iiLoop < ppI.length)
		{
			oMoreA.innerHTML = "<A HREF='javascript:FillSearchResults(" + iiLoop + ")'><IMG BORDER=0 WIDTH=18 HEIGHT=17 ALT='Next Page of Results' SRC='http://www.oceanisle.us/_rc/oib/html/images/button_greenarrow_menu.gif'></A>"
		}
		else
		{
			oPrevA.innerHTML = "<A HREF='javascript:FillSearchResults(" + iPrevCounter + ")'><IMG BORDER=0 WIDTH=18 HEIGHT=17 ALT='Previous Page of Results' SRC='http://www.oceanisle.us/_rc/oib/html/images/button_greenarrow_menul.gif'></A>"
			oMoreA.innerHTML = "<IMG BORDER=0 WIDTH=18 HEIGHT=17 SRC='http://www.oceanisle.us/_rc/oib/html/images/clear.gif'>"
		}

		iStartPosition = iStartPosition + iPageSize
		if (bPageLooper) {break}
	}

	if (bPageLooper)
	{
	}
	else
	{
		if (iStartPosition == -1)
		{
			iMOff = false
			//document.getElementById("searchParent").style.display = "none"
			//document.getElementById("tSearch").style.display = "none"
			//document.getElementById("resultsParent").style.display = "none"
			//document.getElementById("tResults").style.display = "none"
		}
	}
}

function showCurrent()
{
	for (iiLoop = 0; iiLoop < ppI.length; iiLoop++)
	{
		if (ppI[iiLoop] == curProp)
		{
			document.write(ppN[iiLoop] + ppT[iiLoop])
			break
		}
	}
}

function hilightBook()
{
	var oBookIt1 = document.getElementById("bookIt1")
	var oBookIt2 = document.getElementById("bookIt2")
	if (oBookIt1.style.textDecoration == 'none')
	{
		oBookIt1.style.textDecoration = 'underline'
		oBookIt2.style.textDecoration = 'underline'
	}
	else
	{
		oBookIt1.style.textDecoration = 'none'
		oBookIt2.style.textDecoration = 'none'
	}
	setTimeout("hilightBook()",800)
}
