window.onload = function() {
	external_links();
	popup_init();
}

function external_links() {
	if (!document.getElementsByTagName) {return false;}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++)
		if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external")
			anchors[i].target = "_blank";
}

function popup_init()
{
	var e = document.getElementsByTagName('area');
	for(i=0; i<e.length; i++)
		if (e[i].className == 'popup')
			e[i].onclick = popup;
	return true;
}
function popup()
{
	var size = this.getAttribute('title');
	var url = this.getAttribute('href');

var scrollbars = 0;

/* computes dimensions passed from "rel" tag; format: <width>x<height>, output: width=<width>,height=<height> */
	var popup_size = 'width=400,height=370';

	/* window options */
	var win_options = 'left=0,top=0,dependent=1,resizable=1,scrollbars='+scrollbars+',location=0,menubar=0,statusbar=0,'+popup_size;

	/* creates new window */
  if (win = window.open(this.href,'_blank',win_options))
		return false;

  /* follows link on failure */
	return true; 
}