function newWindow(location) {
   mapWindow = window.open(location, 'mapWin', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=480,height=360')
}		

/*
function openWin(location, w, h) {
   if (openWin.arguments[0]) { location = openWin.arguments[0] } else { location = 'http://www.project2061.org' }
   if (openWin.arguments[1]) { w = openWin.arguments[1] } else { w = 450 }
   if (openWin.arguments[2]) { h = openWin.arguments[2] } else { h = 300 }
   if (openWin.arguments[3]) { bolMenu = openWin.arguments[3] } else { bolMenu = 0 }
   if (openWin.arguments[4]) { bolTool = openWin.arguments[4] } else { bolTool = 0 }
   popUp = window.open(location, 'popUp', 'toolbar='+bolTool+',location=0,directories=0,status=0,menubar='+bolMenu+',scrollbars=yes,resizable=yes,width='+w+',height='+h)
   popUp.focus();
}
*/

/*
Require values: PAGE, HEIGHT, WIDTH
openWin(PAGE, 'http://www.project2061.org', HEIGHT, 350, WIDTH, 200, STATUS)
*/

// Initialize openWin variables.
var HEIGHT = 'HEIGHT';
var MENUBAR = 'MENUBAR';
var NAME = 'NAME';
var RESIZE = 'RESIZE';
var SCROLL = 'SCROLL';
var STATUS = 'STATUS';
var TOOLBAR = 'TOOLBAR';
var WIDTH = 'WIDTH';
var PAGE = 'URL';
function openWin() {
   var strParam;
   var location = 'http://www.project2061.org';
   var winName = 'popup';
   var w = 450;
   var h = 300;
   var bolMenu = 0;
   var bolResize = 'no';
   var bolScroll = 'no';
   var bolStatus = 0;
   var bolTool = 0;
   for (i = 0; i <= openWin.arguments.length; i++) {
      switch (openWin.arguments[i]) {
         case 'HEIGHT':
            h = openWin.arguments[i+1];
            i++;
            break;
         case 'MENUBAR':
            bolMenu = 1;
            break;
         case 'NAME':
            winName = openWin.arguments[i+1];
            i++;
            break;
         case 'RESIZE':
            bolResize = 1;
            break;
         case 'SCROLL':
            bolScroll = 1;
            break;
         case 'STATUS':
            bolStatus = 1;
            break;
         case 'TOOLBAR':
            bolTool = 1;
            break;
         case 'WIDTH':
            w = openWin.arguments[i+1];
            i++;
            break;
         case 'URL':
            location = openWin.arguments[i+1];
            i++;
            break;
      }
   }
   eval(winName+"=window.open(location, winName, 'toolbar='+bolTool+',location=0,directories=0,status='+bolStatus+',menubar='+bolMenu+',scrollbars='+bolScroll+',resizable='+bolResize+',width='+w+',height='+h)");
   eval(winName+".focus()");
}

var aWindow = new Object;
aWindow.closed=true;
function open_window(location){
   if (aWindow && !aWindow.closed) {
      aWindow.location.href = location;
      aWindow.focus();
   } else {
      aWindow=window.open(location,"thewindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=450");
      aWindow.focus();
   }
}
function focusWin() {
   if (aWindow && !aWindow.closed) {
      setTimeout('aWindow.focus()', 100);
   }
}
