function	getMailLink( _address, _display, _domain )
{
var	domain		= ( ! _domain )
				? 'bruu.org'
				: _domain;
var	linkHref	= _address + '@' + domain;
var	linkTag		= '<a href=' + '"mai' + 'lto:' + linkHref + '" title="Send e-mail to ' + linkHref + '" >';
var	linkText	= '';
	if(	! _display
	||	_display.length	== 0
	||	_display.indexOf( '@' ) + 1 )
	{
		linkText	= linkHref;
	}else
	{
		linkText	= _display;
	}
	document.write( linkTag + linkText + '</a>');
}

function toggleSidebar()
{
var	oSidebar			= document.getElementById( 'id_sidebar' );
var	oShowHideLink		= document.getElementById( 'id_menuShowHideLink' );
var	oContentContainer	= document.getElementById( 'id_content' );
	if(	oSidebar
	&&	oShowHideLink
	&&	oContentContainer )
	{
	var	state		= oSidebar.style.display;
	var	dummy;
		oSidebar.style.display	= ( state == 'none' )
								? 'block'
								: 'none';
		oShowHideLink.innerHTML	= ( state == 'none' )
								? 'Hide Menu'
								: 'Show Menu';
		oShowHideLink.title		= oShowHideLink.innerHTML;
		dummy					= ( state == 'none' )
		? AddClass(		oContentContainer, 'cls-contentWithSidebar' )
		: KillClass(	oContentContainer, 'cls-contentWithSidebar' );
	}
}

function initializeExternalLinks() {
// I search for all <a> tags looking for those marked with the xhtml attribute @rel=
//	If a <a> tag has rel="external", then I set its target property to "_blank"
//	XHTML does not allow the old attribute @target="_blank". But we can set that
//	property on the DOM using JavaScript.
//	If the browser does not allow JavaScript, then the target property is not set
//	and the link will open in the current window.
//	We could set the classNames here, too, but then those users without
//	JavaScript would not see the styles.
// Call me once when the page loads.
//

	if(	!document.getElementsByTagName )	return;
	var	aAnchors		= document.getElementsByTagName( 'a' );
	for(	var i=0; i<aAnchors.length; i++ )
	{
	var	oAnchor		= aAnchors[i];
		if(	oAnchor.getAttribute( 'href' )
		&&	oAnchor.getAttribute( 'rel' )	== "external" )
		{
			oAnchor.target		= '_blank';
			oAnchor.title		+= ' (An external site. Opens in a new window.)';
		}
		if(	oAnchor.getAttribute( 'href' )
		&&	oAnchor.getAttribute( 'rel' )	== "newwindow" )
		{
			oAnchor.target		= '_blank';
			oAnchor.title		+= ' (Opens in a new window.)';
		}
	}
}	// initializeExternalLinks

/*********** Start of JavaScript Library *********/

//*** This JavaScript library is copyright 2002 by Gavin Kistner and Refinery; www.refinery.com
//*** Re-use or modification permitted provided the previous line is included
// Revised by S Giese, 14 Jan 2005: Changed return value to show whether the class changed.

//Adds a new class to an object, preserving existing classes
//function AddClass(obj,cName){ KillClass(obj,cName); return obj.className+=(obj.className.length>0?' ':'')+cName; }
function AddClass( obj, cName ){ var original_name = obj.className; KillClass( obj, cName ); obj.className+=(obj.className.length>0?' ':'')+cName; return ( original_name != obj.className ); }

//Removes a particular class from an object, preserving other existing classes.
//function KillClass(obj,cName){ return obj.className=obj.className.replace(new RegExp("^"+cName+"\\b\\s*|\\s*\\b"+cName+"\\b",'g'),''); }
function KillClass( obj, cName ){ var original_name = obj.className; obj.className=obj.className.replace(new RegExp("^"+cName+"\\b\\s*|\\s*\\b"+cName+"\\b",'g'),''); return ( original_name != obj.className ); }

//Looks for a particular class for an object.
function HasClass( obj, cName ){ return new RegExp( "^" + cName + "\\b\\s*|\\s*\\b" + cName + "\\b", 'g' ).test( obj.className ); }

/*********** End of JavaScript Library ***********/


/* Initialize the nav on page menus for IE
	Run on page load
*/
startNavOnPage = function()
{
	// For an IE browser
	if(	document.all
	&&	document.getElementById )
	{
		aPossibleNav	= document.getElementsByTagName( 'UL' );
		for(	var	ul=0; ul < aPossibleNav.length; ul++ )
		{
//		navRoot = document.getElementById( 'navOnPage' );
			navRoot = aPossibleNav[ ul ];
			if(	navRoot.className.search( 'cls-navOnpage' ) != -1 )
			{
				for(	var	i=0; i < navRoot.childNodes.length; i++ )
				{
					node = navRoot.childNodes[ i ];
					if(	node.nodeName == 'LI' )
					{
						node.onmouseover=function()
						{
							this.className+=" cls-navHover";
						}
						node.onmouseout=function()
						{
							this.className=this.className.replace( " cls-navHover", "" );
						}
					}
				}
			}
		}
	}
}
if (window.attachEvent) window.attachEvent( "onload", startNavOnPage );

