// If user's browser understands DOM, call site functions
if (document.getElementById && document.createTextNode)
{
	window.onload = run_onload;
}


// Site functions
function run_onload()
{
	pop_us();
}


/**
* Add JavaScript functionality to all a tags with classname "popme"
*/
function pop_us()
{
	var as, i;
	as = document.getElementsByTagName('a');
	
	for (i = 0; i < as.length; i++)
	{
		if (/popme/.test(as[i].className))
		{
			as[i].onclick = function() { return popup(this); }
			as[i].onkeypress = function() { popup(this) }
		}
	}
}


function popup(o)
{
	var page, name, pos_left, pos_top, location, scrollbars, resizable, settings, width, height;
	page = o.href;
	name = '';
	pos_left = 0;
	pos_top = 0;
	location = 1;
	scrollbars = 1;
	resizable = 1;
	width = 950;
	height = 630;
	
	if ((pos_left + width) >= screen.width)
	{
		width = (screen.width - 50);
	}
	
	if ((pos_top + height) >= screen.height)
	{
		height = (screen.height - 75);
	}
	
	settings = "width=" + width + ",height=" + height + ",left=" + pos_left + ",top=" + pos_top + ",toolbar=0,menubar=0,location=" + location + ",status=0,resizable=" + resizable + ",scrollbars=" + scrollbars;
	
	window.open(page,name,settings)
	return false;
}
