// Give the URL to go to, the width & height of the popup lesson
// for netscape, x,y of where on the screen you want it to appear,
// and 'y' or 'n' for each of the possible IE width/height fixes
function create_popup_lesson (url, width, height, xoff, yoff, wfix, hfix)
{
  var modwidth, modheight, modx, mody, options;

  // First give this window a name so that it can be referred to later
  window.name = 'original';

  // Allow for IE's vertical scrollbar & extra space
  modwidth = width * 1;
  modheight = height * 1;
  modx = xoff * 1;
  mody = yoff * 1;

  if (navigator.appName == "Microsoft Internet Explorer")
  {
    // If we want to fix the width
    if (wfix == 'y')
      {
        modwidth += 20;
        modx = (modx < 10) ? 0 : modx - 10;
      }
   
    // If we want to fix the height
    if (hfix == 'y')
      {
        modheight += 10;
        mody = (mody < 5) ? 0 : mody - 5;
      }
  }
  
  // Create the options list
  options = "scrollbars,resizable";

  // Add width & height
  options += ",width="+modwidth;
  options += ",height="+modheight;

  // Add where to appear
  options += ",screenX="+modx+",left="+modx;
  options += ",screenY="+mody+",top="+mody;

  window.open(url, '_blank', options);
}

