
//popupOnClick
//Centers a popup window where the user clicks there mouse
//Parameters:
//   filename     - HTML file for the contents of the window. Relative to the file that the click event
//                  occured in.
//   windowWidth  - width of the popup window in pixels
//   windowHeight - height of the popup window in pixels
//   scrollbars   - indicates whether or not to have scrollbars ("yes" or "no")
//
//  Example: (note the use of double and single quotes
//<a href="JavaScript:void(0);" onClick="popupOnClick('foobar.html', 200, 200, 'no')">Click me</a>!

//function popupOnClick(filename, windowWidth, windowHeight, scrollbars)
//{
//  var clickX = (window.event.screenX) - (windowWidth  / 2);
//  var clickY = (window.event.screenY) - (windowHeight / 2);
//  window.open(filename,
//              "My_popup",  //name must have no whitespaces!
//              "dependent=yes,resizable=yes,titlebar=no,status=no" +
//              ",scrollbars=" +scrollbars+
//              ",width="      +windowWidth+
//              ",height="     +windowHeight+
//              ",x="          +clickX+  //for Netscape
//              ",y="          +clickY+  //for Netscape
//              ",left="       +clickX+  //for IE
//              ",top="        +clickY); //for IE
//}



/* Declaring a global variable which will store a reference to the new window to be created */
var WindowObjectReference; 
var windowWidth;
var windowHeight;
var clickX = (screen.width) - (windowWidth/2);
var clickY = (screen.height) - (windowHeight/2);
function popupOnClick(filename, windowWidth, windowHeight, scrollbars)
{
  
//  WindowObjectReference = window.open(filename,
//  "DescriptiveWindowName", "resizable=yes,scrollbars=no,status=no,width="+windowWidth+",height="+windowHeight+",left="+clickX+",top="+clickY+"x="+clickX+",y="+clickY+"");

  WindowObjectReference =  window.open(filename,
              "my_popup",  //name must have no whitespaces!
              "dependent=yes,resizable=yes,titlebar=no,status=no" +
              ",scrollbars=" +scrollbars+
              ",width="      +windowWidth+
              ",height="     +windowHeight+
              ",x="          +clickX+  //for Netscape
              ",y="          +clickY+  //for Netscape
              ",left="       +clickX+  //for IE
              ",top="        +clickY); //for IE
  

}

