// Functions to open applications in a separate browser window.
// Code below points to a non-secure site. 
// Change the code below to the https protocol and point to the secure site when promoting
// to the SSL site.

//ISAPI version


function openApplwindow() {
     var Applwindow;
     srcwin="https://isapi.scottishmutual.co.uk/cobol/ZFP002_Web_Individual_Frames_m.htm";
     swidth=screen.width;
     newwidth=(((swidth - 684)/2)-4);
     if (!Applwindow || Applwindow.closed)
        {
        settings=
            "toolbar=no,location=no,directories=no,"+
            "status=yes,menubar=no,scrollbars=yes,"+
            "resizable=yes,width=685,height=412," +
            "left=" + newwidth + ",top=106";
        Applwindow = window.open(srcwin,"Appl",settings)
        }
     else
        {
        Applwindow.focus()
        }
}

function openAVCApplwindow() {
     var Applwindow;
     srcwin="https://isapi.scottishmutual.co.uk/cobol/ZFP002_AVC_WEB_INDIVIDUAL_FRAMES_M.HTM";
     swidth=screen.width;
     newwidth=(((swidth - 684)/2)-4);
     if (!Applwindow || Applwindow.closed)
        {
        settings=
            "toolbar=no,location=no,directories=no,"+
            "status=yes,menubar=no,scrollbars=yes,"+
            "resizable=yes,width=685,height=412," +
            "left=" + newwidth + ",top=106";
        Applwindow = window.open(srcwin,"Appl",settings)
        }
     else
        {
        Applwindow.focus()
        }
}

function openCalcwindow() {
     var Applwindow;
     //srcwin = "http://10.50.3.22/cgi-bin/flexi-m.dll"; 
     srcwin = "https://isapi.scottishmutual.co.uk/cobol/1stpage-m.htm"; 
     swidth=screen.width;
     newwidth=(((swidth - 684)/2)-4);
     if (!Applwindow || Applwindow.closed)
        {
        settings=
            "toolbar=no,location=no,directories=no,"+
            "status=yes,menubar=no,scrollbars=yes,"+
            "resizable=yes,width=685,height=375," +
            "left=" + newwidth + ",top=106";
        Applwindow = window.open(srcwin,"Appl",settings)
        }
     else
        {
        Applwindow.focus()
        }
}

function openDesignatewindow() {
     var Applwindow;
     srcwin = "https://isapi.scottishmutual.co.uk/cgi-bin/ZFP002_Web_designation_m.dll"; 
     swidth=screen.width;
     newwidth=(((swidth - 684)/2)-4);
     if (!Applwindow || Applwindow.closed)
        {
        settings=
            "toolbar=no,location=no,directories=no,"+
            "status=yes,menubar=no,scrollbars=yes,"+
            "resizable=yes,width=685,height=412," +
            "left=" + newwidth + ",top=106";
        Applwindow = window.open(srcwin,"Appl",settings)
        }
     else
        {
        Applwindow.focus()
        }
}


//Java version of calculator function
function openJavaCalcwindow() {
     var Applwindow;

//     srcwin = "http://10.50.3.42/servlet/StakeCalculator?BusinessProcess=START&Action=NEXT"; 
     srcwin = "https://www2.sma-bureau.co.uk/SHCalculator/StakeCalculator?BusinessProcess=START&Action=NEXT";
     swidth=screen.width;
     newwidth=(((swidth - 684)/2)-4);
     if (!Applwindow || Applwindow.closed)
        {
        settings=
            "toolbar=no,location=no,directories=no,"+
            "status=yes,menubar=no,scrollbars=yes,"+
            "resizable=yes,width=685,height=412," +
            "left=" + newwidth + ",top=106";
        Applwindow = window.open(srcwin,"Appl",settings)
        }
     else
        {
        Applwindow.focus()
        }
}

//Opens the employer updates application in a separate browser
//and displays the splash screen in the original window
function	EmployerUpdates() {

var	strParm = top.location.search.substring(1) + '';
var	wndNew;

//need to find out if a "Splash" parameter was passed

	if	(strParm != '') {
		top.location.href = 'https://www.royallondonpension.co.uk/pension_plan/employer_updates/Logon.HTM';
	} else {
		top.location.href = 'http://www.royallondonpension.co.uk/pension_plan/Splash.HTM';
		wndNew = window.open("https://www.royallondonpension.co.uk/pension_plan/employer_updates/Logon.HTM",
					"EmployerUpdates",
					"width=684,height=440,status=no,resizable=no"); 		
	} // endif

	return;

} 