// JavaScript Document
//global window reference
//usage onClick='javascript:myWindow=myOpenWindow("http://www.mathwarehouse.com/calculator.php", "myWin", "height=440,width=400,resizable,screenX=20,screenY=20,scrollbars", calc );   return false'

var theWin; // this will hold our opened window

  var calc; // this will hold our opened window

//pop up objects
// end pop up objects


function myOpenWindow(winURL, winName, winFeatures, winObj)
{
if(theWin)  //alreadyopened so close old and open new
	{
	theWin.close();
	}
  // first check to see if the window already exists
	  if (winObj != null)
	  {
	    // the window has already been created, but did the user close it?
	    // if so, then reopen it. Otherwise make it the active window.
	    if (!winObj.closed) {
	      winObj.focus();
	      return winObj;
	    }
    // otherwise fall through to the code below to re-open the window
	  }

  // if we get here, then the window hasn't been created yet, or it
  // was closed by the user.
	  theWin = window.open(winURL, winName, winFeatures);

if(typeof theWin.opener =='object')
	{
	;//then we were able to open window;
	}
else{
	;//not opened
	}
  return theWin;
}
