var mapWindow = null; function openMap() { var url = 'http://www.tracer2.com/cgi/databrowsing/countyMap.asp'; var name = 'mapWindow'; var x = parseInt(window.screen.width - 400); var y = parseInt((window.screen.height/2) - (256/2)); var xCord = (document.all) ? 'left=' + x.toString():'screenX=' + x.toString(); var yCord = (document.all) ? 'top=' + y.toString():'screenY=' + y.toString(); var features = 'width=728,height=500,scrollbars=yes,' + xCord + ',' + yCord; if(!(mapWindow && !mapWindow.closed)) { mapWindow = window.open(url, name, features); mapWindow.focus(); } else if(mapWindow && !mapWindow.closed) { mapWindow.focus(); } } function closeMap() { if(mapWindow && !mapWindow.closed) { mapWindow.close(); mapWindow = null; } }