// JavaScript Document

<!--
var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)

{
left = (640 - width)/2, top = (480 - height)/2;

    if (screen) {
        top = (screen.availHeight - height)/2;
        left = (screen.availWidth - width)/2;
    }

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}


function popUpWindow1(URLStr, left, top, width, height)

{
left = (640 - width)/2, top = (480 - height)/2;

    if (screen) {
        top = (screen.availHeight - height)/2;
        left = (screen.availWidth - width)/2;
    }

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}
function PopupPic(sPicURL) { 
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=1,HEIGHT=200,WIDTH=200,left=50, top=50,screenX=50,screenY=50"); 
   }
//-->
<!-- Paste this code into an external JavaScript file named: centeredPopup.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Updated by: Mike Weiner :: http://www.wearebent.com 
Original author: Eric King (eric_andrew_king@hotmail.com)
Last Updated: May 2006

Changes: Added parameters for optional scrollbars, resizablility,
menubar, toolbar, addressbar, statusbar, fullscreen. Also tweaked the
implementation a bit - links will now give the user a popup window
even if JavaScript is disabled.

Notes: Some parameters are not cross-browser capable (e.g. fullscreen).
Browsers that do not support these abilities will ignore them.

Usage: The link is written as follows: 
onclick="newWindow(this.href, 'popup', 600, 500, 1, 1, 0, 0, 0, 1, 0);

Usage Description:
"this.href" refers to the URL given in the "a" tag; "'popup'" is the name of the popup window;
600 is the width of the popup window; 500 is the height of the popup window; the numbers that
follow designate whether a property is turned on ("1") or off ("0"), in this order:
scrollbars, resizable, menubar, toolbar, addressbar, statusbar, fullscreen

  var int_windowLeft = (screen.width - a_int_windowWidth) / 2+180;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2+140;

*/

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=yes, resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}



/*<!-- Paste this code into the HEAD section of your HTML document.
     You may need to change the path of the file.  -->*/

function popuponclick()
{
	//newWindow('Subscription.php', 'mywindow', 450, 450,0, 1, 0, 0, 0, 1, 0); 
my_window =newWindow('Subscription.php', 'my_window', 485, 473,0, 0, 0, 0, 0, 1, 0); 
 //newWindow("",//    "mywindow","status=1,width=350,height=150");
//my_window.document.write('<H1>The Popup Window</H1>');   
} 

function closepopup()
{
 if(false == my_window.closed) 
 {
    my_window.close ();
 }
 else
 {
    alert('Window already closed!');
 }
}
	