function resizeOuterTo(w,h) {
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
		    top.outerWidth=w;
		    top.outerHeight=h;
		}
    else top.resizeTo(w,h);
	}
}

function FindCenter(width, height) 
{ 
        var str = "height=" + height + ",innerHeight=" + height; 
        str += ",width=" + width + ",innerWidth=" + width; 
        if (window.screen) { 				
		
                var ah = screen.availHeight - 30; 
                var aw = screen.availWidth - 10; 

                var xc = (aw - width) / 2; 
                var yc = (ah - height) / 2; 

                str += ",left=" + xc + ",screenX=" + xc; 
                str += ",top=" + yc + ",screenY=" + yc; 
        } 
        return str; 
} 

function popupMap(url) {
	w1=window.open(url,'popupmap', FindCenter(450,400) + ',resizable=yes,scrollbars=no,toolbar=no,location=no,status=yes');
	//window.resizeTo(img.Width, img.clientHeight+20);	
	w1.focus();
	
}	

function AfterLoad()
		{
		
		/* this function resizes the popup window after it loads, to make it fit an image properly.
		it should only be called body.onload, to make sure the image has already loaded. */
		
			//get the size of the map image and use it to resize the page after the map has loaded
			var img = document.getElementById("imgMap");
			img.style.position = "relative"; 
			//offsetTop and offsetLeft work in ie and ff, if relative positioning is specified first.
			// x and y only work in firefox
			//alert(img.offsetTop +  " , " + img.offsetLeft);
			//alert("clientWidth=" + document.body.clientWidth);
			//alert(img.width);
			//alert(img.clientHeight+img.y); //height has to account for window top bar and bottom status bar also!			
			var border = 20;
			var neededx = img.offsetLeft + img.width + border*2;
			var neededy = img.offsetTop + img.height + border;
			//alert(neededx - document.body.clientWidth);
			//alert(neededy - document.body.clientHeight);			
			window.resizeTo(neededx, neededy);
			//adjust to account for window borders etc
			window.resizeBy(neededx - document.body.clientWidth, neededy - document.body.clientHeight);
		}