function IIf(i, j, k) {
  if (i) return j; else return k;
}
function GetRadWindow() {
  var oWindow = null;
  if (window.radWindow) oWindow = window.radWindow;
  else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
  return oWindow;
}
//Redirects Browser window and closes 'this' window
function doRedirectAndClose(loc) {
  GetRadWindow().BrowserWindow.doRedirectToPage(loc);
  doCloseRad();
}

function doCloseRad() {
  GetRadWindow().close();
}

function OpenPOP(url, width, height, txt) {
  var oWnd = radopen(url, null);
  //window.setTimeout(function () {
  //  oWnd.SetWidth(document.body.scrollWidth + 4);
  //  oWnd.SetHeight(document.body.scrollHeight + 70);
  //}, 400);
  oWnd.SetWidth(width + 10);
  oWnd.SetHeight(height + 40);
  oWnd.set_title(txt);
  oWnd.set_visibleStatusbar(false)
  oWnd.set_modal(true);
  oWnd.set_behaviors("Close");
 
  return false;
}
function OpenParentPOP(url, width, height, txt) {
  var oWnd = GetRadWindow().BrowserWindow.radopen(url, null);
  oWnd.SetWidth(width + 10);
  oWnd.SetHeight(height + 40);
  oWnd.set_modal(true);
  oWnd.set_title(txt);
  oWnd.set_visibleStatusbar(false)
  return false;
}
