
/*
Function addded for Insurance pages"
*/
function go_toUrlExt(){
	if (document.getElementById("selectproducts").value != "0"){
		box = document.getElementById("selectproducts");
		destination = box.options[box.selectedIndex].value;
		if (destination) location.href = destination;
	}else{
		window.alert("Please select ....");
	}
}

//Function added to Hide/Show the Application Form / STEP 2 / Guide to insurance 

function show_guidetoinsurance() {
	var targ=document.forms[0];
 	var disp = document.getElementById('guidetoins');
 	var coveroption = targ.COVEROPTIONn;

 	var mpicoveryes = document.getElementById('mpicoveryes');
 	var mpicoverno = document.getElementById('mpicoverno');

	if(!coveroption.checked && mpicoveryes.checked) //nonPPI
		disp.style.display = "";
}
function hide_guidetoinsurance() {
	var disp = document.getElementById('guidetoins');
	if(!(disp.style.display)){
	disp.style.display = "none";
	}
}

//Function added for Application Form / STEP 2 / COVER LEVEL OPTION TEXT
function coverleveloption(id) {

	var mpicoveryes = '';
	var mpicoverno = '';

	if(!typeof(document.getElementById('mpicoveryes')==null))
		mpicoveryes =document.getElementById('mpicoveryes');
	if(!typeof(document.getElementById('mpicoveryes')==null))
		mpicoverno =document.getElementById('mpicoveryes');

	if(id == 'opt2') {
	document.getElementById("coveropt").innerHTML = "<p style='margin-left:0px;font-size:1.0em;padding-top:9px;'>As you have selected Life & Accident and Sickness Insurance you will still be required to meet the repayments in the event of involuntary unemployment and critical illness </p>";
	} else if(id == 'opt3') {
	document.getElementById("coveropt").innerHTML = "<p style='margin-left:0px;font-size:1.0em;padding-top:9px;'>As you have selected Life and Involuntary Unemployment Insurance cover you will still be required to meet the repayments in the event of accident & sickness and critical illness </p>";
	} else if(id == 'opt4') {
	document.getElementById("coveropt").innerHTML = "<p style='margin-left:0px;font-size:1.0em;padding-top:9px;'>As you have selected Life and Involuntary Unemployment Insurance cover you will still be required to meet the repayments in the event of Accident & Sickness and Critical illness </p>";
	} else {
	document.getElementById("coveropt").innerHTML = "<p style='margin-left:0px;font-size:1.0em;padding-top:9px;'><strong>Dependent on the cover selected our Payment Protection could offer you protection cover for your repayments in case of<br /></strong><ul class='bulletpt' ><li>Death</li><li>Accident and Sickness</li><li>Involuntary Unemployment</li>		<li>Critical Illness</li></ul></p>";
	}
}

//Function added for open a popup window
function newWindow(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
} 
