﻿//
// ページ内では以下のように呼び出してください。
// <a href="呼び出したいページ" onclick="openSubWindow(this.href,'小窓名',横サイズ[px],縦サイズ[px]);return false;"><img src="btn_slideshow.gif" border="0" width="160" height="50" alt="Slide Show"></a>
// 例）<a href="slideshow.html" onclick="openSubWindow(this.href,this.target,500,500);return false;" target="slideshow"><img src="btn_slideshow.gif" border="0" width="160" height="50" alt="Slide Show"></a>
//

function openSubWindow(uri,name,w,h) {
	subWindow=window.open(uri,name,",status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes,width="+w+",height="+h+",left=5,top=5");
	subWindow.focus();
	return false;
}

function popuplink() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup"){
			winPop(anchor);
		}
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup01"){
			winPop01(anchor);
		}
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup02"){
			winPop02(anchor);
		}
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup03"){
			winPop03(anchor);
		}
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup04"){
			winPop04(anchor);
		}
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup05"){
			winPop05(anchor);
		}
	}
}
function winPop(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"levelWin","width=425,height=675,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}

function winPop01(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"levelWin01","width=630,height=750,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}

function winPop02(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"levelWin02","width=550,height=550,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}

function winPop03(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"levelWin03","width=425,height=483,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}

function winPop04(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"map","width=680,height=750,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}
function winPop05(element){
	var link = element.getAttribute('href');
	element.onclick = function(){
		var wo = window.open(link,"map","width=517,height=643,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=yes");
		return false;
	}
}

window.onload = popuplink
