// JavaScript Document

function flash(url, width, height, allowDomain) {
 if (allowDomain = "") {allowDomain = false;}
 try {document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + url + '">');
 if (allowDomain = true) {
  document.write('<param name="allowScriptAccess" value="sameDomain"/>');}
  document.write('<param name="quality" value="high"><param name="wmode" value="transparent"><PARAM NAME="menu" VALUE="false">');
  document.write('<embed src="' + url + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" menu="false"></embed>');
  document.write('</object>');} catch(E){}
}

/* ·¹ÀÌ¾î ÆË¾÷ */
function popupLayer(s,w,h){
	if (!w) w = 600;
	if (!h) h = 400;

	var pixelBorder = 6;
	var titleHeight = 15;
	w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;

	var bodyW = document.body.clientWidth;
	var bodyH = document.body.clientHeight;

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;

	hiddenSelectBox('hidden');

/* ¹é±×¶ó¿îµå ·¹ÀÌ¾î */
	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		zIndex =999;
		left = 0;
		top = 0;
		height = document.body.scrollHeight;
		width= document.body.clientWidth;
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=65)";
		opacity = "0.5";
	}
	obj.id = "objPopupLayerBg";
	document.body.appendChild(obj);

/* ³»¿ë */
	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		zIndex = 9999;
		left = posX + document.body.scrollLeft;
		top = posY + document.body.scrollTop;
		width = w - 13;
		height = h;
		backgroundColor = "#ffffff";
		padding = "20px 0 0 13px";
		overflow= "hidden"
		border = "5px solid #8d24b7";
	}
	obj.id = "objPopupLayer";
	document.body.appendChild(obj);

/* ´Ý±â¹öÆ° ·¹ÀÌ¾î */
	var bottom = document.createElement("div");
	with (bottom.style){
		position = "absolute";
		zIndex = 9999;
		width = w;
		height = titleHeight;
		left = 0;
		top =0;
		padding = "2px 0 5px 0";
		textAlign = "right";
		backgroundColor = "#8d24b7";
		color = "#8d24b7";
	}
	bottom.innerHTML = "<a href='javascript:closeLayer()'><img src='/img/gall_close.gif' border='0'/></a>&nbsp;&nbsp;&nbsp;";
	obj.appendChild(bottom);

/* ¾ÆÀÌÇÁ·¹ÀÓ */
	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w - 6;
		height = h - pixelBorder * 2 - titleHeight+8;
		border = "0 solid #000000";

	}
	ifrm.frameBorder = 0;
	ifrm.src = s;
	ifrm.className = "scroll";
	obj.appendChild(ifrm);
}

function _ID(obj){
	return document.getElementById(obj)
}

function hiddenSelectBox(mode){
	var obj = document.getElementsByTagName('select');
	for (i=0;i<obj.length;i++){
		obj[i].style.visibility = mode;
	}

}

function closeLayer(){
	hiddenSelectBox('visible');
	_ID('objPopupLayer').parentNode.removeChild( _ID('objPopupLayer') );
	_ID('objPopupLayerBg').parentNode.removeChild( _ID('objPopupLayerBg') );
}

function evt01(){
	popupLayer("../page/form01.html", 700, 530);
}
function evt02(){
	popupLayer("../page/form02.html", 700, 500);
}
function evt03(){
	popupLayer("../page/form03.html", 700, 500);
}
function evt04(){
	popupLayer("../page/form04.html", 700, 500);
}
