﻿/*
Example:

<a href="#" onclick="return OpenPopup('/MyPopUpPage.htm','450','500');" target="_blank">click me</a>
*/
var _popUp=false;
var _popupVars = "left=20,top=20,toolbar=0,location=0,resizable=1,scrollbars=yes";


function OpenPopup(urlToOpen, width, height) {
  if (_popUp ) {
     _popUp.close();
     _popUp = null;
  }
  _popUp = window.open(urlToOpen,'mypopup','width=' + width + ',height=' + height + ',' + _popupVars);
  if (_popUp ) {
    //assert: popup worked - not blocked
    if (window.focus) {
      _popUp.focus();
    }
  } else {
    alert('We have detected that you are using popup blocking software.\nYou need to allow popups for this link to work...');
  }
  return  false;
}

function SetPopupDisplay(displayConfig) {
   _popupVars=displayConfig;
}
