
var showwindow;
var showwindow1;
var showwindow2;

function shownewwindow(windowName, link, height, width) {
  shownewwindow(windowName, link, height, width, 50, 50);
}

function shownewwindow(windowName, link, height, width, left, top) {
  var xpos = ((window.screen.width-height)/2);
  var ypos = ((window.screen.height-width)/2);
  closeWindow(showwindow);
  showwindow = window.open(link,windowName,"height=" + height + ",width=" + width + ",resizable=yes,left=" + left + ",top=" + top + ",screenX=" + xpos + ",screenY=" + ypos + ",status=no,scrollbars=yes,menubar=no,toolbar=no,location=no");
  
  showwindow.focus();
}

function shownewwindow1(windowName, link, height, width)
{
  shownewwindow1(windowName, link, height, width, 0, 0, 'yes');
}

function shownewwindow1(windowName, link, height, width, menubar)
{
  shownewwindow1(windowName, link, height, width, 0, 0, menubar);
}

function shownewwindow1(windowName, link, height, width, left, top, menubar)
{
  var xpos = ((window.screen.width-height)/2);
  var ypos = ((window.screen.height-width)/2);
  closeWindow(showwindow1);
  showwindow1 = window.open(link,windowName,"height=" + height + ",width=" + width + ",resizable=yes,left=" + left + ",top=" + top + ",screenX=" + xpos + ",screenY=" + ypos + ",status=no,scrollbars=yes,menubar=" + menubar + ",toolbar=no");
  
  showwindow1.focus();
}

function shownewwindow2(windowName, link, height, width) {
  shownewwindow2(windowName, link, height, width, 50, 50);
}

function shownewwindow2(windowName, link, height, width, left, top) {
  var xpos = ((window.screen.width-height)/2);
  var ypos = ((window.screen.height-width)/2);
  closeWindow(showwindow2);
  showwindow2 = window.open(link,windowName,"height=" + height + ",width=" + width + ",resizable=yes,left=" + left + ",top=" + top + ",screenX=" + xpos + ",screenY=" + ypos + ",status=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes");
  
  showwindow2.focus();
}

function closeWindow(theWindow)
{
        if (theWindow) {
           if (!theWindow.closed)
            {
               theWindow.close();
            }
         }
}

function closePopUpWindows()
{
        closeWindow(showwindow);
        closeWindow(showwindow2);
}


function closenewwindow1(str)
{
  if (showwindow1)
  {
    if (!showwindow1.closed)
    {
      if (confirm(str))
      {
        showwindow1.close();
      }
    }
  }
}

function showdocs(link)
{
 shownewwindow1('DisplayDocumentsWindow',link,600,800);
}

function closedocs(str)
{
  closenewwindow1(str);
}

function closereceiptwindow()
{
  closenewwindow1('Close receipt window?');
}

function closeseatmapwindow()
{
  closenewwindow1('Close seat map window?');
}

function closewindowConfirmation()
{
  closenewwindow1('Close popup window?');
}

function closeboardingdocwindow()
{
  closenewwindow1('Close boarding documents window?');
}


function closeAllPopUpWindows()
{
        closereceiptwindow();
        closePopUpWindows();
}





