function ProcessLinks()
{
	// This function serves two purposes:
	//	- make links marked as "external" open in a new window without upsetting the XHTML Strict validator
	//	- make add @domain at the end of the text in e-mail links. We don't want the entire mail text in the
	// HTML because of spam bots.
	
	if(!document.getElementsByTagName)
		return;
		
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++)
	{
		var anchor = anchors[i];
		if(!anchor.getAttribute("href"))
			continue;
		
		var type = anchor.getAttribute("rel");
		if(type == "external")
			anchor.target = "_blank";
		else if(type == "email")
			anchor.innerHTML = anchor.innerHTML + "@griffinlair.com";
	}
}

function ResizeShadowBorders()
{
	// Resize the drop shadow borders to the real height of the page container.
	var realHeight = document.getElementById('page_container').offsetHeight + "px";
	document.getElementById('drop_shadow_left').style.height = realHeight;
	document.getElementById('drop_shadow_right').style.height = realHeight;
}

function OnBodyLoad()
{
	ProcessLinks();
	ResizeShadowBorders();
}

function MailToGriffin(addr)
{
	document.location = "mailto:" + addr + "@griffinlair.com";
}

