/* These scripts allow you to open a page in another window,
   without creating multiple windows. Also, the window will come
   to the front when the same link is clicked */

var anotherWindow = "";
var anotherWindowURL = "";

/* use this one if you don't need to change the initial params.
   This window must be closed by the user.
 */
function openOtherWindow(theURL, width, height) {

if ((anotherWindow != "") && (anotherWindow.closed == false)) { 
	anotherWindow.close();
}
	
if ((anotherWindow != "") && (anotherWindow.closed == false)) { 
    // the otherWindow has been created and is still open so...
    if (anotherWindowURL != theURL) {
      // the previous URL is not the same as the new one so ...
      anotherWindow.focus(); // this is done first because of a problem in Navigator
      anotherWindow.location.replace(theURL);
      anotherWindowURL = theURL;
    }
    
  } 
  else { 
    // hasn't been created OR isn't open anymore 
    anotherWindowURL = theURL;
    anotherWindow = window.open(theURL, "_blank",
			   "toobar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no," +
			      "width=" + width +
			      ",height=" + height);
  } 
 anotherWindow.focus(); 
}


var otherWindow = ""; 
var otherWindowURL = "";

/* use this one if you are likely to change the window size
   - it closes the window before opening it again */
function openNewWindow(theURL, width, height) { 
  if ((otherWindow != "") && (otherWindow.closed == false)) { 
    // the otherWindow has been created and is still open so...
    
      otherWindow.close();
   
  }
  // otherWindow isn't open now because either it doesn't exist or we closed it
  // hasn't been created OR isn't open anymore 
  otherWindowURL = theURL;
  otherWindow = window.open(theURL, "_blank",
			    "toobar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no," +
			    "width=" + width +
			    ",height=" + height);
  otherWindow.focus(); 
}   
