
function openPopupResizablParam(url, width, height,resizable)
{
	var offset = 20;
	if (screen.width <= 820) {
		offset = 0;
	}
	win = window.open(url, "Game", "width="+width+",height="+height+",status=no,scrollbars=yes,screenX="+offset+",screenY="+offset+",top="+offset+",left="+offset+",resizable="+resizable);
	win.opener = window;
}
function openPopup(url, width, height)
{
    openPopupResizablParam(url, width, height, "no");
}
function openPopupResizable(url, width, height)
{
    openPopupResizablParam(url, width, height, "yes");
}
function openPopupWithJavaTest(url, width, height,resizable) {
   if (typeof JvmTester != 'undefined') {
       // Craft a return page that will trigger the popup on the post-install return page
       var newLocation = document.location.toString();
       if (newLocation.indexOf('&') < 0) {
          newLocation += '&';
       }
       var newLocation = document.location.toString();
       if (newLocation.indexOf('?') < 0) {
           newLocation += '?';
       }
       newLocation += '&autoPopupUrl=' + encodeURIComponent( url) + '&autoPopupWidth=' + width + '&autoPopupHeight=' + height + '&autoPopupResizable=' + resizable;
       if (typeof deployJava.isPluginInstalled == 'function' && !deployJava.isPluginInstalled()) {
           // encode the return page so that parameters are not eaten by Sun' s script.
           //   We might have to remove the "if" if Sun make returnPage encoding uniform between the JDT plugin & online installer 
           newLocation = encodeURIComponent(newLocation);
       }
       deployJava.returnPage = newLocation;
       if (!JvmTester.testJavaVersion()) {
          return;
       }
   }
   else {
      // If JvmTester is not there, have probably forgotten to include java-detect-glue.jsp
      //  Most of the users will have Java so open the popup anyway (uncomment the alert to track those cases)
//      alert('java not tested!'); 
   }
   openPopupResizablParam(url, width, height,resizable);
}

