var hitlistFrame = parent.ios_Discover_Main;
if (!hitlistFrame) hitlistFrame = parent.ios_Profile_Main;

var documentWindow = null;
var lasthighlightedObject = "clickAll";

function showHitList(xslFilename, documentIds, theme, loadContentHits, themeAncestry)
{
	var resultDoc = getHitlistTransform(xslFilename, documentIds, theme, loadContentHits, themeAncestry);
	hitlistFrame.document.open();
	if (ie)
	{
		hitlistFrame.document.write(resultDoc);
	}
	else if (moz)
	{
		var theContent = (new XMLSerializer()).serializeToString(resultDoc);
		replaceSubstring(theContent, "&lt;", "<");
		hitlistFrame.document.write(theContent);
	}
	hitlistFrame.document.close();
}

function fixBRInIdea()
{
	var theTextSpan = document.getElementById("ideaText");
	if (theTextSpan)
	{
		theTextSpan.innerHTML = replaceSubstring(theTextSpan.innerHTML, "&lt;br /&gt;", "<br />");
	}
}

/* No Longer Needed - MJM 2005-10-25
function showContextHits()
{
	return;
}

function showContentHits()
{
	var contentHits = document.getElementById("contentHits");
	var contentHitsTitle = document.getElementById("contentHitsTitle");
	var numContentHits = 0;

	// First, create a list of theHits to move
	var list = new Array();
	for (var i = 0; i < theHits.length; i++)
	{
		if (theHits[i].id.indexOf("content") == 0 && theHits[i].id.indexOf("Hits") < 0)
		{
			list.push(theHits[i].id);
		}
	}

	for (var j = 0; j < list.length; j++)
	{
		var theHit = document.getElementById(list[j]);
		if (theHit)
		{
			contentHits.appendChild(theHit);
			numContentHits = numContentHits + 1;
		}
	}

	if (numContentHits > 0 && isShowContentHits == "true")
	{
		contentHitsTitle.style.display = "";
		contentHits.style.display = "";
	}
}
*/

function loadURL( urlToLoad )
{
	if (documentWindow)
	{
		if (!documentWindow.closed) documentWindow.close();
	}

	documentWindow = window.open(urlToLoad, "DocumentWindow", "resizable,top=10,left=10,width=900,height=600");
	documentWindow.focus();
}

function blankWindow( urlToLoad )
{
	var blankWindow = window.open(urlToLoad, "_blank", "status=yes,resizable=yes,toolbar=yes,titlebar=yes,location=yes,scrollbars=yes,menubar=yes,top=10,left=10,width=900,height=600");
	blankWindow.focus();
}

var profileWindow = null;
function openProfileWindow( urlToLoad )
{
	if (profileWindow)
	{
		if (!profileWindow.closed) profileWindow.close();
	}

	profileWindow = window.open(urlToLoad, "ProfileWindow", "resizable,top=10,left=10,width=900,height=600");
	profileWindow.focus();
}

function clickTheme( theme, paras )
{}

function highlightObject(theId)
{
	var oldElem = document.getElementById(lasthighlightedObject);
	if (oldElem)
	{
		oldElem.className = "highlighting-off " + removeText(oldElem.className, "highlighting");
	}

	var elem = document.getElementById(theId);
	if (elem)
	{
		elem.className = "highlighting " + removeText(elem.className, "highlighting-off");
		lasthighlightedObject = theId;
	}
}
