/* set up global variables */
var PageURL="http://www.nationaldebtadviceline.co.uk/";
var PageTitle="National Debt Advice Line";
/* inline mailto function to stop "phishing" of e-mail addresses */
function fncMailTo(who,where,what) {
	document.write('<A HREF="mailto:'+who+'&#64;'+where+'?subject='+what+'">'+who+'&#64;'+where+'</A>');
}
/* function to add site to user's favourites folder */
function fncBookMarkUs() {
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		document.write('<A HREF="javascript:window.external.AddFavorite(PageURL,PageTitle);" ');
		document.write('onMouseOver="window.status=');
		document.write("'Click here to add National Debt Advice Line to your favorites folder.'; return true;");
		document.write('" onMouseOut="JavaScript:window.status=');
		document.write("' '; return true;");
		document.write('">Add National Debt Advice Line to your Favourites</A>'); }
	else {
		var msg = "Bookmark www.NationalDebtAdviceLine.co.uk now!";
		if (navigator.appName=="Netscape") msg+=" (press CTRL-D)";
		document.write(msg); }
}
/* function to validate and submit Query Form */
function fncSubmitForm() {
	window.alert('This function is not yet available!');
}
/* function to open calculator in separate window */
function fncOpenWin(wTyp) {
	if (wTyp==0) { cWin=window.open('calculator.htm','cWin','toolbar=no,status=no,width=506,height=506'); }
	if (wTyp==1) { iWin=window.open('income.htm','iWin','toolbar=no,status=no,width=524,height=626'); }
	if (wTyp==2) { lWin=window.open('consolidation.htm','lWin','toolbar=no,status=no,width=680,height=496'); }
}
/* function to control display of left-hand side drop-down menus */
function fncShowHead(id) {
	var targetId=id+'text';
	var targetElement=document.getElementById(targetId);
	if (targetElement.style.display=='none') {
		targetElement.style.display='';
	} else {
		targetElement.style.display='none';
	}
}
/* function to control display of left-hand side drop-down menus */
function OLDfncShowHead() {
	var srcElement=window.event.srcElement;
	var targetId=srcElement.id+'text';
	var targetElement=document.all(targetId);
	if (targetElement.style.display=='none') {
		targetElement.style.display='';
	} else {
		targetElement.style.display='none';
	}
}
/* function to change font size of paragraphs and lists */
var ParaFontSize=14;
function fncFontSize(pm) {
	ParaFontSize+=pm;
	if (ParaFontSize<10) { ParaFontSize=26; }
	if (ParaFontSize>26) { ParaFontSize=10; }
	var fontSize=ParaFontSize+'px';
	var paraElements=document.getElementsByTagName('p')
	for (n=0; n<paraElements.length; n++) { paraElements[n].style.fontSize=fontSize; }
	var paraElements=document.getElementsByTagName('ul')
	for (n=0; n<paraElements.length; n++) { paraElements[n].style.fontSize=fontSize; }
	var paraElements=document.getElementsByTagName('ol')
	for (n=0; n<paraElements.length; n++) { paraElements[n].style.fontSize=fontSize; }
}
