<!--
window.onload = resizeAndCenter;

function winBRopen(theURL, Name, popW, popH) {
	var winHorz = (screen.width-popW)/2;
	var winVert = (screen.height-popH)/2;
	winProp = 'width='+popW+',height='+popH+',left='+winHorz+',top='+winVert+',scrollbars=yes,resizable=yes';
	var Win = window.open(theURL, Name, winProp);
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function closeupwindow(){
	window.close();
}

function popupWindow(filename){
	if(filename.length > 0 && strPopUpDirURL.length > 0) {
		puwURL = strPopUpDirURL + filename;
		winBRopen(puwURL,'popupWin1',640,480);
	}
}

function popupWindowNV(){
	if(strPopUpFileURL.length > 0) winBRopen(strPopUpFileURL,'popupWin2',640,480);
}

function closeAndMove(){
	if(strBuyNowURL.length > 0) window.open(strBuyNowURL);
}

function resizeAndCenter() {
	var oAPC = document.getElementById('allPageContent');
	var oFC = document.getElementById('flashcontent');

	if((oAPC || oFC) && window.opener != null) {
		var oBody = document.getElementsByTagName("body")[0];
		oBody.style.overflow = 'hidden';
	
		// Check sizes and resize window accordingly.
		var arrWinSizes = checkWindowSizes();
		var arrContentSizes = checkContentSizes();
		var iDiffWidth = (arrContentSizes[0] - arrWinSizes[0]) + 2;
		var iDiffHeight = (arrContentSizes[1] - arrWinSizes[1]) + 2;
		window.resizeBy(iDiffWidth, iDiffHeight);
	
	} else if(window.opener != null) {
		window.resizeTo(intWinWidth,intWinHeight);
	}
	
	if(window.opener != null) {
		// Check window size and center on screen.
		var scrWidth = self.screen.width;
		var scrHeight = self.screen.height;
		var arrWinSizes = checkWindowSizes();
		var newX = Math.round((scrWidth - arrWinSizes[0] - 10)/2);
		var newY = Math.round((scrHeight - arrWinSizes[1] - 50)/2);
		window.moveTo(newX,newY);
	}
}

function checkWindowSizes() {
	var x,y;
	if (self.innerWidth) {
		// all except Explorer
		x = self.innerWidth;
		y = self.innerHeight;
		
	} else if(document.documentElement && document.documentElement.clientWidth) {
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
		
	} else if(document.body) {
		// other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
		
	} else {
		x = intWinWidth;
		y = intWinHeight;
	}
	
	return [x,y];
}

function checkContentSizes() {
	var x,y;
	var oAPC = document.getElementById('allPageContent');
	var oFC = document.getElementById('flashcontent');
	
	if(oAPC) {  // All page content is contained in a table with id="allPageContent"
		x = oAPC.offsetWidth;
		y = oAPC.offsetHeight;

	} else if(oFC) {  // Assumes width of Flash. Adds together position of Flash from top and height of Flash. 
		var oFOTag = oFC.getElementsByTagName("object")[0];		
		x = parseInt(oFOTag.width);	
		var arrPos = findTopLeft(oFOTag);
		y = arrPos[1] + parseInt(oFOTag.height);
		
	} else {
		x = intWinWidth;
		y = intWinHeight;
	}

	return [x,y];
}

function findTopLeft(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}
//-->