window.onload = function() {
	popup_init();
}

function popup_init()
{
  var e = document.getElementsByTagName('a');
	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=390';

	/* window options */
  var win_options = 'left=100,top=100,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; 
}