﻿/*
Example:

<a href="#" onclick="SetPopupWidth('420');SetPopupHeight('450'); return OpenPopup('/MyPopUpPage.htm');" target="_blank">click me</a>
*/
var _popUp;
var _popupWidth = "450";
var _popupHeight = "400";
var _popupVars = "left=20,top=20,toolbar=0,location=0,resizable=1,scrollbars=yes";


function OpenPopup(urlToOpen) {
  _popUp = window.open(urlToOpen,'mypopup','width=' + _popupWidth + ',height=' + _popupHeight + ',' + _popupVars);
  if (_popUp && 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 SetPopupWidth(width) {
   _popupWidth=width;
}

function SetPopupHeight(height) {
   _popupHeight=height;
}

function SetPopupDisplay(displayConfig) {
   _popupVars=displayConfig;
}