//------------------------------------------//
// Javascript Functions                     //
// (C) Copyright 2008 Kevin Green           //
// kevin@green.id.au                        //
// ---------------------------------------- //
// Use of this code is not permitted        //
// unless this header remains intact        //
//------------------------------------------//


//------------------------------------------
// Simple E-Mail address spam protection
//------------------------------------------
function nospam(nm,dm,showText) {
	var mt1 = 'ma';
	var mt2 = 'o:';
	var mt3 = '@';

	var ad1 = mt1 + 'ilt' + mt2 + nm + mt3 + dm;

	if(!showText) {
		var showTextReal = nm + mt3 + dm;
	} else {
		var showTextReal = showText;
	}

	document.write('<a href=\"' + ad1 + '\">' + showTextReal + '</a>');
}

//------------------------------------------
// Toggle <div> display status
//------------------------------------------
function toggleview(id) {
	if ( ! id ) return;

	itm = document.getElementById(id);

	if (itm.style.display == "none") {
		my_show_div(id);
	} else {
		my_hide_div(id);
	}
}

//------------------------------------------
// Toggle 2 <div>'s display status
//------------------------------------------
function togglediv(id1, id2) {
        toggleview(id1);
        toggleview(id2);
}

//------------------------------------------
// Hide <div>
//------------------------------------------
function my_hide_div(id) {
	itm = document.getElementById(id);

	if ( ! itm ) return;
	itm.style.display = "none";
}

//------------------------------------------
// Show <div>
//------------------------------------------
function my_show_div(id) {
	itm = document.getElementById(id);

	if ( ! itm ) return;
	itm.style.display = "";
}