//////////////////////////////////////////////////////////////////
// (c) 2002 DirectLine plc
//
// File: /Generic/js/MMO_app.js
// Desc: produces maximised popup windows allowing the user
//       to apply for Money Matters Online products
// Author: Nigel Byrnes
// Date: 17/07/2002
//
//////////////////////////////////////////////////////////////////

// nxb1: 'does exactly what it says on the tin'
function openAppWindow(url) 
{
  var opts = "menubar=0,location=0,toolbar=0,personalbar=0,";
  opts = "status=1,scrollbars=1,left=0,top=0,";
  if (navigator.appName == "Microsoft Internet Explorer")
    opts += "height=" + screen.availHeight + ",width=" + screen.availWidth;
  else
    opts += "outerHeight=" + screen.availHeight + ",outerWidth=" + screen.availWidth;
  window.open (url, "appnWindow", opts);
}

function openCCAppWindow (linkId)
{
  openAppWindow ("https:\/\/info.directline.com/xxx/moneym.NSF/CreditCards?OpenForm");
  theUrl = "/tracking/redirect/info_directline/info_directline_savings.htm";
  if ( typeof linkId != "undefined" ){
     theUrl = theUrl + "?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openEthicalAppWindow (linkId)
{
  theUrl = "https://info.directline.com/xxx/moneym.NSF/Ethical?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_ethical.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openCashISAAppWindow (linkId)
{
  theUrl = "https:\/\/info.directline.com/xxx/moneym.NSF/CashMiniISA?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_cashminiisa.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openTrackerISAAppWindow (linkId)
{
  theUrl = "https://info.directline.com/xxx/moneym.NSF/TrackerISA?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_trackerisa.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openMortgageAppWindow (linkId)
{
  theUrl = "https://info.directline.com/xxx/moneym.NSF/Mortgages?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_mortgages.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openPensionAppWindow (linkId)
{
  theUrl = "https://info.directline.com/xxx/moneym.NSF/Pensions?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_pensions.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

function openSavingsAppWindow (linkId)
{
  theUrl = "https://info.directline.com/xxx/moneym.NSF/Savings?OpenForm";
  if ( typeof linkId != "undefined" ){
     theUrl = "/tracking/redirect/info_directline/info_directline_savings.htm?linkType="+linkId;
  }
  openAppWindow (theUrl);
}

