
var Page = {
	init: function()
	{
		this.enhanceAnchors();
	},
	
	enhanceAnchors: function( parent )
	{
		var anchors = (parent || document).getElementsByTagName( "a" );
		for( var i = 0; i < anchors.length; i++ )
		{
			var a = anchors[i];
			var rel = a.rel ? a.rel : "";
			if( rel == "external" )
			{
				a.target = "_blank";
				a.onmouseover = function( e )
				{
					window.status = "External link: " + ( this.title ? this.title : this.href );
					return true;
				};
			}
			else if( rel == "email" )
			{
				a.onmouseover = function( e )
				{
					window.status = "Contact " + ( this.title ? this.title : this.innerHTML.replace( /<[^>]+>/gi, "" )) + " <" + this.href.substring( 7 ) + ">";
					return true;
				};
			}
			else
			{
				a.onmouseover = function( e )
				{
					window.status = ( this.title ? this.title : this.innerHTML.replace( /(<[^>]+>)|[\r\n\t]+/gi, "" ) ).replace( /&amp;/gi, "&" );
					return true;
				};
			}
			
			a.onmouseout = function( e )
			{
				window.status = "";
			};
		}
	}
}

window.onload = function(){ Page.init.apply( Page ); };
//Event.observe( window, "load", Page.init.bind( Page ), false );
