/*
init()
Initialise the page.
*/
function init()
{
	externalLinks();
}

/*
externalLinks()
Allow external links to be opened in an XHTML standards compliant way.
http://www.sitepoint.com/article/1041/1
*/
function externalLinks()
{
	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") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}

/*
nospam()
Prevent spammers from leeching my email address from site pages.
*/
function nospam(user, domain)
{
	var loc = "mailto:" + user + "@" + domain;
	window.location = loc;
}

/*
ChangeStyle()
Change the current style sheet
*/
function ChangeStyle()
{
	var f = document.forms[0];
	var style = f.StyleChooser.options[f.StyleChooser.selectedIndex].value;
	
	if(style == "") return;
	
	setActiveStyleSheet(style);
	
}
