
// Rollover Variables and Function

var dir = "/";
var goodToGo = "no";


function flash(imageName,imageFile) {
	if(document.images && goodToGo == "yes") {
		eval('document.images[imageName].src = '+imageFile+'.src');
	}
}


function popPopperWin(thePage, theWidth, theHeight) {
		// alert("Popping");
		if (!theHeight || theHeight > 750) theHeight = 750;
		if (theHeight < 100) theHeight = 100;
		// theHeight += 50;
		// alert ("openHeight=" + theHeight);
		var winl = Math.floor((screen.width - theWidth) / 2);
		var wint = Math.floor((screen.height - theHeight) / 2);
		
		theWidth = theWidth - 2;
		theHeight = theHeight - 1;
		
		if (thePage.indexOf('.jpg',0) > 0 || thePage.indexOf('.gif',0) > 0) thePage = "/image.php?img=" + thePage;
		
		thePopper = window.open(thePage, 'child', 'width='+theWidth+',height='+theHeight+',top='+wint+',left='+winl+',toolbar=no,scrollbars=0,resizable=yes,dependent=yes');
		if (window.thePopper.focus()) setTimeout("focusPopper();",200);
		// window.thePopper.resizeTo(theWidth, theHeight);
		window.thePopper.innerWidth = theWidth;
		window.thePopper.innerHeight = theHeight;
}

var calledPage = '';
var openHeight = '';
function openPopper(thePage, theWidth, theHeight){
		calledPage = thePage
		openHeight = theHeight
		openWidth = theWidth
		if (window.thePopper) {
			if (!window.thePopper.closed && navigator.appVersion.indexOf('Safari',0) <= 0) {
				window.thePopper.close();
			}
			if (navigator.appVersion.indexOf('Safari',0) <= 0) delayToEnsurePopperPop = setTimeout("popPopperWin(calledPage,openWidth,openHeight);",500);
			else {
				popPopperWin(calledPage,openWidth,openHeight);
			}
		} else {
			popPopperWin(thePage,openWidth,openHeight);
		}
	}
	
function focusPopper() {
		window.thePopper.focus();
	}	