// JavaScript Document

// Sniff for browser version to implement workaround for css positioning bug in IE Mac
// Adjust css below to account for location of this file in web directory hierarchy
var boolIsMac = navigator.userAgent.indexOf("Mac") != -1;
var boolIsIe = navigator.appName.indexOf("Microsoft") != -1;

function ShowExploreSite( strExplorePage )
{
	// Set the HTML in the Explore Site windwo to the correct page
	// Set the HTML page in the <iframe> to blank.htm
	var objIFrame;
	objIFrame = document.getElementById('exploresitecontainertext');
	if (!objIFrame)
	{
		// Try alternative means to get access to IFrame for IE Mac
		objIFrame = document.frames['exploresitecontainertext'];
	}
	
	if (objIFrame)
	{
		objIFrame.src = strExplorePage;
	}
	
	// Display the Explore Site HTML window
	var xPos = 0;
	var yPos = 0;
	
	// Determine the x dimension by adjusting for the width of the browser window
	var windowWidth = 800;
	if (parseInt(navigator.appVersion)>3)
	{
		if (navigator.appName == "Netscape")
		{
			windowWidth = window.innerWidth;
		}
		if (navigator.appName.indexOf("Microsoft") != -1)
		{
			windowWidth = document.body.offsetWidth;
		}
	}
	
	//alert("windowWidth = " + windowWidth);
	
	xPos = ((windowWidth - 800) / 2) + 340;			
	//alert("xPos = " + xPos);
	
	if (boolIsMac && boolIsIe) 
	{
		yPos = 174;	
	}
	else
	{
		yPos = 339;
	}
			
	// Move the pop-up window into place
	var objExploreSiteWindow = window.document.getElementById('exploresitecontainer');
	objExploreSiteWindow.style.left = xPos + 'px';
	objExploreSiteWindow.style.top = yPos + 'px';

}

function HideExploreSite()
{
	// Hide the pop-up window again
	var objExploreSiteWindow = window.document.getElementById('exploresitecontainer');
	objExploreSiteWindow.style.left = '-500px';
	objExploreSiteWindow.style.top = '-500px';
	
	// Set the HTML page in the <iframe> to blank.htm
	var objIFrame;
	objIFrame = document.getElementById('exploresitecontainertext');
	if (!objIFrame) 
	{
		// Try alternative means to get access to IFrame for IE Mac
		objIFrame = document.frames['exploresitecontainertext'];
	}
	
	if (objIFrame)
	{
		objIFrame.src = "blank.htm"
	}
}

function PrintExploreSite()
{
	if (window.frames)
	{
		window.frames['exploresitecontainertext'].focus();
		window.frames['exploresitecontainertext'].print();		
	}
	else
	{
		window.exploresitecontainertext.focus();
		window.exploresitecontainertext.print();	
	}
}

function DisplayExploreSpotlight()
{
	// Display the Explore Spotlight graphic 
	var xPos = 0;
	var yPos = 0;
	
	// Determine the x dimension by adjusting for the width of the browser window
	var windowWidth = 800;
	if (parseInt(navigator.appVersion)>3)
	{
		if (navigator.appName == "Netscape")
		{
			windowWidth = window.innerWidth;
		}
		if (navigator.appName.indexOf("Microsoft") != -1)
		{
			windowWidth = document.body.offsetWidth;
		}
	}
	
	//alert("windowWidth = " + windowWidth);
	
	xPos = ((windowWidth - 800) / 2) + 600;			
	//alert("xPos = " + xPos);
	
	if (boolIsMac && boolIsIe) 
	{
		yPos = 39;	
	}
	else
	{
		yPos = 203;
	}
			
	// Move the spotlight graphic into place
	var objExploreSpotlight = window.document.getElementById('spotlight');
	objExploreSpotlight.style.left = xPos + 'px';
	objExploreSpotlight.style.top = yPos + 'px';
	
}