
if(window.addEventListener) {window.addEventListener("load", autoPOP, false);}
else if(window.attachEvent) {window.attachEvent("onload", autoPOP);}
else{window.onload = autoPOP;}
if(window.addEventListener) {window.addEventListener("load", autoPOP2, false);}
else if(window.attachEvent) {window.attachEvent("onload", autoPOP2);}
else{window.onload = autoPOP2;}

function autoPOP()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popup' || x[i].getAttribute('class') == 'popup')
		{
			x[i].onclick = function () {
			return winOpen(this.href)
			}
			x[i].title += '別窓で開きます';
		}
	}
};

function autoPOP2()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popup2' || x[i].getAttribute('class') == 'popup2')
		{
			x[i].onclick = function () {
			return winOpen2(this.href)
			}
			x[i].title += '別窓で開きます';
		}
	}
};

function winOpen(url) {
	window.open(
		url,
		'popup',
		'width=640,height=505,scrollbars=0,resizable=1'
	);

	return false;
};

function winOpen2(url) {
	window.open(
		url,
		'popup2',
		'width=590,height=500,scrollbars=1,resizable=1'
	);

	return false;
};


