function newWindow(loc,winname,tb,lb,db,st,mb,sb,rs,hs,wd,hg,top,left) {
  if (loc != null) {
    tb = (tb ? 'yes' : 'no');		// Toolbar
    lb = (lb ? 'yes' : 'no');		// Location Bar
    db = (db ? 'yes' : 'no');		// Directory
    st = (st ? 'yes' : 'no');		// Status Bar
    mb = (mb ? 'yes' : 'no');		// Menu Bar
    sb = ((sb == 0) ? 'no' : 'yes');	// Scroll Bars
    rs = (rs ? 'yes' : 'no');		// Resizable
    hs = (hs ? 'yes' : 'no');		// History
	
	if (wd==0 && hg==0) {
      if (screen.width) {
        wd=screen.width-10;
	    hg=screen.height-60;
      }
	}
	
    wd = ((wd == null) ? '460' : wd);		// Width
    hg = ((hg == null) ? '375' : hg);		// Height
    
    var newwin = window.open(loc, winname,
      'toolbar=' + tb + ',' +
      'location=' + lb + ',' +
      'directories=' + db + ',' +
      'status=' + st + ',' +
      'menubar=' + mb + ',' +
      'scrollbars=' + sb + ',' +
      'resizable=' + rs + ',' +
      'copyhistory=' + hs + ',' +
      'width=' + wd + ',' +
      'height=' + hg + ',' +
      'top=' + top + ',' +
      'left=' + left);
    
    if (newwin != null) {
      newwin.creator = self;
      newwin.focus();
    }
  }
}
