
addEvent(window, 'load', initPopups);

//********************************

function initPopups()
{
	var poplinks = document.getElementsByClassName("pop")
	var A = poplinks.length-1

	for (var i=A; i>=0;i--)
		{
		poplinks[i].target= ''
		poplinks[i].inc = i
		poplinks[i].onclick = popUp;
		}
}

function popUp()
{
	var classes = this.className
	var dims = this.rel.split(',')
	var popWidth = dims[0]
	var popHeight = dims[1]

/*	if (classes.match("pop-small"))
		{
		popWidth = 300
		popHeight = 300
		}
	else if (classes.match("pop-med"))
		{
		popWidth = 500
		popHeight = 500
		}

	else if (classes.match("pop-big"))
		{
		popWidth = 700
		popHeight = 700
		}*/

	if (classes.match("pop-console"))
		{var options = "resizable,toolbar=no,location=no,scrollbars=yes,width="+popWidth+",height="+popHeight+",top=100,left=100";}
	else
		{var options = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+popWidth+",height="+popHeight+",top=100,left=100";}

	popWindow = window.open(this.href, 'popWindow' + this.inc, options)
	if (window.focus)
		{popWindow.focus()}
	return false;
}
