// ----------------------------------------------------------------
// Author: InterFincial
// Description: Loan Application Forms
// Last edited: 12 Nov 2006 - made domain independent
// -----------------------------------------------------------------
function alert_err() { // shows an alert box on load with error message
	alert("<?php echo($alertmsg)?>");
}
function popupCustom(url, pageTitle, height, width) {
		
	   	var newWindow = window.open(url, pageTitle, 'height=' + height + ', width=' + width + ', toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
	   	if (window.focus) {
	   		newWindow.focus()
	   	}
	   	return false;
}

function showMore1() {
	id=document.getElementById("moreInfo1");
	id.className="showmore";
	showLess2();
	showLess3();
	showLess4();
	showLess5();
	showLess6();
	showLess7();
	showLess8();
}
function showLess1() {
	id=document.getElementById("moreInfo1");
	id.className="showless";
}
function showMore2() {
	id=document.getElementById("moreInfo2");
	id.className="showmore";
	showLess1();
	showLess3();
	showLess4();
	showLess5();
	showLess6();
	showLess7();
	showLess8();
}
function showLess2() {
	id=document.getElementById("moreInfo2");
	id.className="showless";
}

function showMore3() {
	id=document.getElementById("moreInfo3");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess4();
	showLess5();
	showLess6();
	showLess7();
	showLess8();
}
function showLess3() {
	id=document.getElementById("moreInfo3");
	id.className="showless";
}
function showMore4() {
	id=document.getElementById("moreInfo4");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess3();
	showLess5();
	showLess6();
	showLess7();
	showLess8();
}
function showLess4() {
	id=document.getElementById("moreInfo4");
	id.className="showless";
}
function showMore5() {
	id=document.getElementById("moreInfo5");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess3();
	showLess4();
	showLess6();
	showLess7();
	showLess8();
}
function showLess5() {
	id=document.getElementById("moreInfo5");
	id.className="showless";
}
function showMore6() {
	id=document.getElementById("moreInfo6");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess3();
	showLess4();
	showLess5();
	showLess7();
	showLess8();
}
function showLess6() {
	id=document.getElementById("moreInfo6");
	id.className="showless";
}
function showMore7() {
	id=document.getElementById("moreInfo7");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess3();
	showLess4();
	showLess5();
	showLess6();
	showLess8();
}
function showLess7() {
	id=document.getElementById("moreInfo7");
	id.className="showless";
}
function showMore8() {
	id=document.getElementById("moreInfo8");
	id.className="showmore";
	showLess1();
	showLess2();
	showLess3();
	showLess4();
	showLess5();
	showLess6();
	showLess7();
}
function showLess8() {
	id=document.getElementById("moreInfo8");
	id.className="showless";
}


function showLessAll() {
	showLess1();
	showLess2();
	showLess3();
	showLess4();
	showLess5();
	showLess6();
	showLess7();
	showLess8();
}

function chk_opt(){ // switches between homeowner apps
   if (location.search.length > 0){
	//n = unescape(location.search.substring(1))
	//document["prism-homeowner-form"]["Homeowner"].options[n].selected=true
   }
}
function chk_opt2(){
   if (location.search.length > 0){
	//n = unescape(location.search.substring(1))
	//document["prism-tenant-form"]["Homeowner"].options[n].selected=true
   }
}
function Navigate2(fObj) {
 var number = fObj["Homeowner"].selectedIndex;

 if(fObj["Homeowner"].options[number].text == "Homeowner With Mortgage"){
  location.href = "https://www.allaboutloans.co.uk/compare/loans.html?h=1";
 }
}
function Navigate(fObj) {
 var number = fObj["Homeowner"].selectedIndex;
 
 if(fObj["Homeowner"].options[number].text == "Homeowner No Mortgage"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=2";
 }
 
 if(fObj["Homeowner"].options[number].text == "Living With Parents"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=3";
 }
 
 if(fObj["Homeowner"].options[number].text == "Living With Friends"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=4";
 }
  if(fObj["Homeowner"].options[number].text == "Living With Relatives"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=5";
 }
  if(fObj["Homeowner"].options[number].text == "Council Tenant"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=6";
 }
 if(fObj["Homeowner"].options[number].text == "Private Tenant"){
  location.href = "https://www.allaboutloans.co.uk/compare/tenant-loans.html?h=7";
 }
 
}