// Added by Grant 03/07/2003
// Original MM function modified to open window in center
function MM_openBrWindow(theURL,winName,features) { //v2.0
	var startpos, endpos, intWidth, intHeight, top, left, length;
	
	// Get Width
	startpos = features.indexOf("width=") + 6;
	endpos = startpos;
	
	while ((features.charCodeAt(endpos) >= 48) && (features.charCodeAt(endpos) <= 57)) {
		endpos++;
	}

	intWidth = features.substring(startpos, endpos);

	// Get Height
	startpos = features.indexOf("height=") + 7;
	endpos = startpos;
	
	while ((features.charCodeAt(endpos) >= 48) && (features.charCodeAt(endpos) <= 57)) {
		endpos++;
	}
	
	intHeight = features.substring(startpos, endpos);
	
	// Now determine top and left positions (centering) based on height and width
	top = (screen.height - intHeight) / 2;
	left = (screen.width - intWidth) / 2;
	
	features += ", top=" + top + ", left=" + left;
	
  	return window.open(theURL,winName,features);
}

// Legacy Functions, left in place for backwards compatibility
var winCounter = 0;
function PopUp(strURL, isCustom, imgName)
{
	// Increment winCounter
	winCounter++;
	// Not the Custom Popup, the Howto Order Button
	if (strURL != "" && isCustom != "yes")
	{
	  var FlashWindow;
	  FlashWindow = window.open(strURL, imgName + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=345");
	}
	else // Custom Popup
	{
	  var FlashWindow;
	  FlashWindow = window.open(strURL, imgName + winCounter, "status=no,toolbar=no,location=no,menu=no,width=325,height=240");
	}
}

// Modifying fcnShowLarge to call MM_openBrWindow
function fcnShowLarge(strURL)
{
	winCounter++;
	
	var PopupWin;
	PopupWin = MM_openBrWindow(strURL, "win" + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=390");
	// PopupWin = window.open(strURL, "win" + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=390");
}

