function openPopper(thePage, theWidth, theHeight) {

	// Redirect an image link to the image.php page 
	if (thePage.indexOf('.jpg',0) > 0 || thePage.indexOf('.gif',0) > 0) thePage = "/image.php?img=" + thePage;
	
	
	if (window.thePopper && !window.thePopper.closed) {
		
		thePopper.resizeTo(theWidth,theHeight);		
		thePopper.location.href = thePage;
		thePopper.focus();
		
	} else {

		var winl = Math.floor((screen.width - theWidth) / 2);
		var wint = Math.floor((screen.height - theHeight) / 2);
			
		theWidth = theWidth - 2; // hide white edge in Safari
		theHeight = theHeight - 1; // hide white edge in Safari
					
		thePopper = window.open(thePage,'pop','top='+wint+',left='+winl+',width='+theWidth+',height='+theHeight+',toolbar=no,scrollbars=0,resizable=yes,dependent=yes');
	
	}
		
}





function openPopper2(thePage, theWidth, theHeight) {

		
	if (window.theMapPopper && !window.theMapPopper.closed) {
		
		theMapPopper.resizeTo(theWidth,theHeight);		
		theMapPopper.location.href = thePage;
		theMapPopper.focus();
		
	} else {

		var winl = Math.floor((screen.width - theWidth) / 2);
		var wint = Math.floor((screen.height - theHeight) / 2);
							
		theMapPopper = window.open(thePage,'mappop','top='+wint+',left='+winl+',width='+theWidth+',height='+theHeight+',toolbar=no,scrollbars,resizable=yes,dependent=yes');
	
	}
		
}