	// Opens an iframe in the current window
	function ShowDetail(url)
	{
		document.getElementById("iframeDetail").src = url;
				
	}
	
	/// Called from the callee to tell that the data is ready
	function showData()
	{
		if (document.getElementById("divIFrameDetail") != null)
		{
		//jpk - hide the "add new story" box when in detail mode
			try
			{
				var joe = document.getElementById("freshFactsTable");
				joe.style.display = "none";
			}
			catch(err)
			{
				//moo ha ha
			}
			
			document.getElementById("divIFrameDetail").style.display = "block";
			
			//jpk: makit wider 
			document.getElementById("divIFrameDetail").style.width = "500px";
			
			document.getElementById("divProductListGrid").style.display = "none";
		}
		setIframeHeightWidth('iframeDetail');
	}
	
	// Gets the iframes height 
	function getDocHeight(doc) {
		var docHt = 0, sh, oh;
		if (doc.height) docHt = doc.height;
		else if (doc.body) {
			if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
			if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
			if (sh && oh) docHt = Math.max(sh, oh);
		}
		return docHt;
	}
	
	// Gets the iframes width
	function getDocWidth(doc)
	{
		var docWd = 0, sw, ow;
		if (doc.width) docWd = doc.width;
		else if (doc.body) {
			if (doc.body.scrollWidth) docHd = sw = doc.body.scrollWidth;
			if (doc.body.offsetWidth) docHd = ow = doc.body.offsetWidth;
			if (sw && ow) docWd = Math.max(sw, ow);
		}
		return docWd;	
	}

	// Sets the iframes Height And Width
	function setIframeHeightWidth(iframeName) {
	var iframeWin = window.frames[iframeName];
	var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	if ( iframeEl && iframeWin ) {
		iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
		var docHt = getDocHeight(iframeWin.document);
		var docWd = getDocWidth(iframeWin.document);
		if (docHt) iframeEl.style.height = docHt + 30 + "px";
		if (docWd) iframeEl.style.width  = docWd + 30 + "px"; 
	}
	} 

	/// Returns back to the navigator
	function goBack()
	{
		document.getElementById("divIFrameDetail").style.display = "none";
		document.getElementById("divProductListGrid").style.display = "block";	
		
				//jpk - and switch the lights back on
				try
				{
					var joe = document.getElementById("freshFactsTable");
					joe.style.display = "block";
				}
				catch(err)
				{
					//barfbag
				}
	}
