var ClvrPopUpWin = null;

function CloseClvrPopUp()
{
  if (ClvrPopUpWin != null)
  {
    if (!ClvrPopUpWin.closed)
    {
      ClvrPopUpWin.close();
    }
  }
}

function ClvrPopUp(ClvrURL,ClvrType,ClvrWidth,ClvrHeight,ClvrLeft,ClvrTop)
{
  CloseClvrPopUp();
  
  var ClvrOptions = '';
  
  if (ClvrType == 'default')
  {
    ClvrOptions = 'width='+ClvrWidth+',height='+ClvrHeight+',screenX='+ClvrLeft+',left='+ClvrLeft+',screenY='+ClvrTop+',top='+ClvrTop+',channelmode=0,dependent=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
  }

  if (ClvrType == 'console')
  {
    ClvrOptions = 'resizable,height='+ClvrHeight+',width='+ClvrWidth;
  }
  if (ClvrType == 'fixed')
  {
    ClvrOptions = 'status,height='+ClvrHeight+',width='+ClvrWidth;
  }
  if (ClvrType == 'elastic')
  {
    ClvrOptions = 'toolbar,menubar,scrollbars,resizable,location,height='+ClvrHeight+',width='+ClvrWidth;
  }
  
  ClvrPopUpWin = window.open(ClvrURL,'ClvrPopUpWin',ClvrOptions);
  ClvrPopUpWin.focus();
}

