<!--

// Browser-type detection variables
var minNav3 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >=  3);
var minNav5 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >=  5);
var minIE4 = (navigator.appName.indexOf("Microsoft") >= 0 &&  parseInt(navigator.appVersion) >= 4);
var minDOM = minNav3 || minIE4;   // Minimum baseline Document Object Model (DOM)  supported?

// Fixed (common) page-global variables
var ImgGalleryHref = "/images/Gallery/Gallery-Frames.htm";
var PFFramesHref = "/Printing/PF-Frames.htm";
var PODFramesHref = "/Misc/POD-Frames.htm";

/*
// Don't display any script errors:
window.onerror = PC_ErrorHandler;
function PC_ErrorHandler()
{
  return true;
}
*/

function closeThisWindow(thisWindow)
{
	thisWindow.close();
//	thisWindow.top.window.parent.close(); 
//	return thisWindow.top.window.opener.parent.focus();
}

function initPFPage()
{
	window.parent.PF_Header.initPrintPage();
}

function setCaption(objWindow, strCaption)
{
	objWindow.document.title = strCaption;
}

function forcepopupintoframe(pagehref, framewindowname)
{
	// Is this page within its required frame?  If so, exit

	// Re-display the page in its required frame structure

	// Change this page to the main page
	switch(framewindowname)
	{
		case "ImgGallery":
			return dispImgGalleryPg(pagehref);
	}

	// Done
	return;
}

function dispPFPg(href)
{
	var objPopupWindow = dispPopupPg(href, PFFramesHref, "PFFrame",
		"width=800,height=600,status=1,resizable=1");
//		"width=800,height=600,toolbar=1,status=1,menubar=1,location=1,resizable=1");
	if( objPopupWindow )
	{
		setCaption(objPopupWindow, objPopupWindow.PF_MainFrm.window.document.title);
		return true;
	}
	else
		return false;
}

function dispPODPg(href)
{
	var objPopupWindow = dispPopupPg(href, PODFramesHref, "PODFrame",
		"width=400,height=400,status=1,resizable=1");
	if( objPopupWindow )
	{
		setCaption(objPopupWindow, objPopupWindow.POD_MainFrm.window.document.title);
		return true;
	}
	else
		return false;
}

function dispImgGalleryPg(href)
{
	var objPopupWindow = dispPopupPg(href, ImgGalleryHref, "ImgGallery",
		"width=800,height=600,toolbar=1,status=1,menubar=1,location=1,resizable=1");
//		"width=800,height=600,toolbar=1,resizable=1");
	if( objPopupWindow )
		return true;
	else
		return false;
}

function dispSecurity(href)
{
	return popup(href, 'BeeCARESecure', 'scrollbars=yes,width=640,height=510')
}

function dispDSB(href)
{
	return popup(href, 'BeeCAREDSB', 'toolbar=no,resizable=yes,scrollbars=yes,width=640,height=480')
}

function dispESB(href)
{
	return popup(href, 'BeeCAREESB', 'toolbar=no,resizable=yes,scrollbars=yes,width=640,height=480')
}

function dispPopupPg(contentHref, frameHref, popupName, windowParms)
{
	var href = frameHref + "?content=" + contentHref;
	return popup(href, popupName, windowParms);
}

function popup(mylink, windowname, dimensions)
{
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	var mywin = window.open(href, windowname, dimensions);
	mywin.focus();
	return false;
//	return mywin;
}

function targetopener(mylink, closeme, closeonly)
{
	if( !(window.focus && window.parent.opener) )
		return true;
	window.parent.opener.focus();
	if( !closeonly )
		window.parent.opener.location.href = mylink.href;
	if( closeme )
		window.close();
	return false;
}

function getBookmark()
{
	return listBookmark;
}

function displayDetailPage()
{
	return displayMainFramePage(linkDetailPage);
}

function getPath(strPath)
{
	// Find the last slash position
	var iLastSlashPos = strPath.lastIndexOf("\\");
	if( iLastSlashPos == -1 )
		iLastSlashPos = strPath.lastIndexOf("/");

	// If no slashes, return the original path
	if( iLastSlashPos == -1 )
		return strPath;
	
	// Strip off the last part of the string
	strPath = strPath.substr(0, iLastSlashPos);
	return strPath;
}

function displayMainFramePage(url)
{
	window.parent.opener.parent.focus();
	if( window.parent.opener.parent.BeeCAREMainFrame.location.href )
	{
		var pagePath;
		var framesPath = getPath(window.parent.location.pathname);
		if( framesPath != "" )
			pagePath = framesPath + "/" + url;
		else
			pagePath = url;
		window.parent.opener.parent.BeeCAREMainFrame.location.href = pagePath;
	}
}

function setExternalLinks()
{
	// Set up Catalog page link in header for this content
	window.parent.BeeCAREGallery_Header.setupMainPgLink(linkDetailPage);

	// Set up Previous and Next page links for this content
	window.parent.BeeCAREGallery_PrevNextFrm.setupPrevLink(linkPrevPage);
	window.parent.BeeCAREGallery_PrevNextFrm.setupNextLink(linkNextPage);

	// Set up category tab image and list document -- the list window will 
	//  automatically synchronize with this content in its own onload event
	window.parent.BeeCAREGallery_Header.setupTabCategory(tabName);

	// Ensure this window has focus
	window.focus();
}

-->
