function embedEmail( idName ) 
{
	// jQuery
	// Assumptions: 
	//   idName exists and has links
	//	 email link has a title where the '@' is a '+' and the '.' is a '-'
	//	 email link class contains 'email'
	//alert("embedEmail invoked. idName="+idName);
	var rtn = false;
	$( '#'+idName+' a.email' ).each( function( i ) {
		var title = $( this ).attr( 'title' );
		if( title.indexOf( '+' )!=-1 && title.indexOf( '-' )!=-1 ) 
		{	
			var newTitle = 
				title.slice( 0, title.indexOf( '+' )) + '@' + 
				title.slice( title.indexOf( '+' )+1, title.indexOf( '-' )) + '.' + 
				title.slice( title.indexOf( '-' )+1, title.length );
			
			$( this ).attr( 'href', 'mai'+'lto:' + newTitle );
			$( this ).attr( 'title', newTitle );
			$( this ).contents( ':first' ).replaceWith( newTitle );
			rtn = true;
		};
	});
	return rtn;
};
function setExternalLinkage() 
{
	// jQuery
	// Assumptions: An external link will have rel="external"
	//alert ("setExternalLinkage()");
	var rtn = false;
	$( 'a[ href ][rel="external"]' ).each( function( i ) {
		$( this ).attr( 'target', '_blank' );
		rtn = true;							 
	});
	return rtn;
};
function setCopyrightDate ( copyrightYear ) {
//alert ("setCopyrightDate(): copyrightYear ="+copyrightYear );
	if ( !document.getElementById ) return;
	if ( !document.getElementById( copyrightYear )) return;
	var copy = document.getElementById( copyrightYear );
	var copyText = document.createTextNode( new Date().getFullYear() );
	copy.replaceChild( copyText, copy.firstChild );
};
function init_accordion() 
{
	if( !$( 'dl.accordion' ).length ) return;
 
	$( 'dl.accordion' ).each( function() 
	{
	    $( this ).find('dt:first a').addClass( 'accordion_expanded' )
			.end().find('dd:first').show();
	});
	// Event listener for click.
	$('dl.accordion dt a').click( function () 
	{
		// Get parent <dl>
		var $dl = $( this ).parents( 'dl:first' );
	
		// Get the next <dd>.
		var $dd = $( this ).parent( 'dt' ).next( 'dd' );
	
		// Class final <dt>.
		function findLast() 
		{
			if( $dl.find( 'dd:last' ).is( ':hidden' ))
				$dl.find( 'dt:last' ).addClass( 'last' );
		};
		// Is it visible?
		if( $dd.is( ':hidden' )) 
		{
		  // Expand the <dd>, hide others.
		  $dd.animate({ opacity: 'toggle', height: 'toggle' }, 'slow' ).siblings( 'dd:visible' ).hide( 'slow', findLast );
		
		  // Change arrow state, remove class="last" from <dt>.
		  $( this ).addClass( 'accordion_expanded' ).parent( 'dt' )
				 .removeClass( 'last' ).siblings( 'dt' ).find( 'a' )
				 .removeClass( 'accordion_expanded' );
		};	
		// Nofollow.
		this.blur();
		return false;
	});
};


