// JavaScript Document



<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

<!--

function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("Number of Debts", "House", "Income", "realname", "telephone", "Time To Call", "Address");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Number of Debts", "House", "Income", "Name", "Telephone/Mobile", "Time To Call", "Address");
	// dialog message
	var alertMsg = "Please complete the following fields:           \n\n";
        	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
// -->




function processform()
{
 
  if (document.frmCalculator.inpTotalDebts.value < 5000) {
    alert("Debt value too low - we can only offer advice for debts over €5,000" )
    document.frmCalculator.inpTotalDebts.focus()
    return false 
  }
  
  
  if (document.frmCalculator.inpTotalPayments.value < 150) {
    alert("Debt repayment are too low - we can only offer advice when repayments are > €150 per month" )
    document.frmCalculator.inpTotalPayments.focus()
    return false 
  }
  
  
  if (document.frmCalculator.inpTotalExpenditure.value < 300) {
    alert("Please Enter a Reasonable Expenditure Value (€300 minium)")
    document.frmCalculator.inpTotalExpenditure.focus()
    return false
  }
  
  
    if (document.frmCalculator.inpTotalIncome.value < 100) {
    alert("Please Enter a higher monthly income Value (€100 minium)")
    document.frmCalculator.inpTotalIncome.focus()
    return false 
  }
  
document.frmCalculator.submit()
}



function toggle() {
	var ele = document.getElementById("toggleText");
	var text = document.getElementById("HIDDENSECURED");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "hide";
	}
} 

	

function ShowHideCookieDetails()
{
	if (document.myform.inpHomeOwner.selectedIndex==1)
	{			
document.getElementById('homeowner').style.display='block' 

	}
	
	if (document.myform.inpHomeOwner.selectedIndex==2)
	{			
document.getElementById('homeowner').style.display='none' 

	}

}
// --> 

<!-- 

function AddIfValid(field) { 

    if ((field.value.length == 0) || (field.value == null)) { 
        return 0; 
    } else { 
        return eval(field.value); 
    } 

} 

function MakeSum() { 

                            // Initialize the total variable to 0 
    var t = 0;

                            // Add the values 
                            // Note that if a value is not numeric, 
                            // it is ignored without formally raising an error 
    t += AddIfValid(document.myform.txtIncome);
	t -= AddIfValid(document.myform.txtOutgoings);

                            // Display the total in the CategoryTotal text box 
    document.myform.disposableincome.value = "€"+t; 
	document.myform.disposableincome2.value = t;
} 

// --> 

<!--
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url()"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->