<!--

//
// SUPPORT FOR SETTING OPACITY OF AN IMAGE FILE
//

// Put inside <img> tag to set rollover opacity to 100% and mouseout to 20%:
// style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="setOpacity(this,1)" 
//	onMouseout="setOpacity(this,0)"
function setOpacity(objTarget, bVisible)
{
	var flVisibility = bVisible ? 1 : 0.2;
	if( objTarget.style.MozOpacity )
		objTarget.style.MozOpacity = flVisibility;
	else
		if( objTarget.filters )
			objTarget.filters.alpha.opacity = flVisibility * 100;
}

//
// SUPPORT FOR AUTO-SIZED POPUP WINDOW TO DISPLAY ANY IMAGE FILE
//

// Standard URL of HTML doc to display the image, to be used by the document
//	requesting the image display (i.e., the caller of dispImg()).  The 
//	dispImg caller is free to use another URL instead of this global variable.
var strBCIDPD = "/GBBImages/DisplayPic.htm";

// The following global-scope javascript code executes automatically within
//	any HTML document that includes this script, namely the document performing
//	the image display (strBCIDPD, etc.).  The global variables below are 
//	automatically populated during <head> processing , and are therefore
//	available to the including document anywhere within its <body> tag.
//	Presumably, the document doing the actual image display will use these
//	values when building its own <body> code using document.write and
//	when calling fitWindowToImg() to resize its window to fit the image.

// NOTE: "fWTI_" prefaces all variables germaine to the fitWindowToImg function
//	and its calling document (i.e. the doc performing the display).

// Build a 2(+)-element string array (elements split around "?" delimiters,
//	[0] and [1] are required):

//	[0] = URL of HTML doc to display the image (strBCIDPD, etc.)
//	[1] = URL of IMG file
//	[2] = Caption at bottom of image (optional)
//	[3] = Title for display window (optional)
//	[4] = URL of originating page (optional)

var fWTI_aryHrefStrElems = self.location.href.split("?"); 
var fWTI_HTMLDocURL = (fWTI_aryHrefStrElems.length > 0) ? fWTI_aryHrefStrElems[0] : "";
var fWTI_ImgURL = (fWTI_aryHrefStrElems.length > 1) ? fWTI_aryHrefStrElems[1] : "";
var fWTI_Caption = (fWTI_aryHrefStrElems.length > 2) ? unescape(fWTI_aryHrefStrElems[2]) : "";
var fWTI_Title = (fWTI_aryHrefStrElems.length > 3) ? unescape(fWTI_aryHrefStrElems[3]) : "";
var fWTI_OrgDocURL = (fWTI_aryHrefStrElems.length > 4) ? fWTI_aryHrefStrElems[4] : "";

// dispImg: Creates a popup window from strImgPopup_URL to display the image
function dispImg(strImgPopup_URL, strOrigPageURL, strWindowTitle, strImgCaption, strImgURL)
{
	// If no display URL is provided, use the default URL (strBCIDPD)
	if( strImgPopup_URL == "" )
		strImgPopup_URL = strBCIDPD;

	// Display the popup, passing its display parameters (to be later parsed into
	//	a string array by the above global variable-init code within the popup)
	window.open(strImgPopup_URL + "?" + // [0]
			strImgURL + "?" + // [1]
			strImgCaption + "?" +  // [2]
			strWindowTitle + "?" + // [3]
			strOrigPageURL, // [4]
			"gBBDynImgDisp", "resizable=1, HEIGHT=300, WIDTH=300, scrollbars=yes"); 
} 


// Netscape-browser detection variable
var fWTI_NS = (navigator.appName == "Netscape") ? true : false; 

// fitWindowToImg: Fits (resizes) a window around an image; to be called by the document
//	performing the image display (strBCIDPD, etc.).  This function assumes the
//	image governing the window size is the first image in the document (images[0]).
function fitWindowToImg(strImgWindowTitle, iRightBuffer, iBottomBuffer)
{ 
	var iWidth = (fWTI_NS) ? window.innerWidth : document.body.clientWidth; 
	var iHeight = (fWTI_NS) ? window.innerHeight : document.body.clientHeight; 
	iWidth = document.images[0].width - iWidth + iRightBuffer;
	iHeight = document.images[0].height - iHeight + iBottomBuffer;
	document.title = unescape(strImgWindowTitle);
	window.resizeBy(iWidth, iHeight);
	self.focus();
};

-->
