//·¹ÀÌ¾î ÆË¾÷ ºÒ·¯¿À±â layPop(ÇÁ·¹ÀÓÁÖ¼Ò,ÇÁ·¹ÀÓID,ÇÁ·¹ÀÓÅ©±â,ÇÁ·¹ÀÓ ³ôÀÌ)
function layPop(url,id,width, height){

	if(document.getElementById("layPop")) return false; // Áßº¹»ý¼ºÀ» ¸·À½

	var alertID=(id==''|| id==null)? "popFrame" : id;
	// ÆË¾÷»ý¼º
	var layerPop=document.createElement("div");
		layerPop.setAttribute("id", "layPop");
		layerPop.className="layPop";

	// ¶ó¿îµå ¸ð¾ç ¸¸µé±â
	var rbox=document.createElement("div");
		rbox.setAttribute("id", "layBox");
		rbox.className="popType1";
	var rboxIn=document.createElement("div");
		rboxIn.setAttribute("id", "layBoxIn");
		rboxIn.className="popIn";
		rbox.appendChild(rboxIn);

	//¾ÆÀÌÇÁ·¹ÀÓ µ¿ÀûÀ¸·Î »ý¼ºÇÏ±â
	var inFrame="<iframe name='"+alertID+"'' id='"+alertID+"' src='"+url+"' width='"+width+"' height='"+height+"'";
		inFrame=inFrame+" scrolling='auto' allowTransparency='true' frameborder='0'></iframe>";		
		rboxIn.innerHTML=inFrame;

	//´Ý±â¹öÆ°
	var btnCls=document.createElement("p");
		btnCls.className="popClose";

	var btnClose=document.createElement("a");
		btnClose.setAttribute("href", "#");
		btnClose.onclick= function(){
			closeMsg("layPop");return false;
		};

		btnClose.appendChild(document.createElement("img"));
		btnClose.getElementsByTagName("img").item(0).src="/wyzhome/images/common/popup/btn_close.gif";
		btnCls.appendChild(btnClose);

	//·¹ÀÌ¾î¿¡ ÄÁÅÙÃ÷ ³Ö±â
	layerPop.appendChild(rbox);
	layerPop.appendChild(btnCls);
	document.getElementById("wrapper").appendChild(layerPop);

	doPosition("layPop");
	initLayout("layBox","layBoxIn");
}

//·¹ÀÌ¾î ALERT alertMsg(ÆË¾÷¾ÆÀÌµð, µé¾î°¥ ¸Þ¼¼Áö, Ãë¼Ò¿©ºÎ:Y, N,È®ÀÎ½Ã URL)
function alertMsg(id,msg,cen,link1){

	var alertID=(id==''|| id==null)? "altMsg" : id;
	var alertBox=document.createElement("div");
		alertBox.setAttribute("id", alertID);
		alertBox.className="alertPop";

	//alert ¹®±¸
	var msgTxt1=document.createElement("div");
		msgTxt1.className="msgBox";
		msgTxt1.appendChild(document.createTextNode(msg));
		alertBox.appendChild(msgTxt1);

	//¹öÆ°¿µ¿ª
	var btnSec=document.createElement("p");
		btnSec.className="btnSec";

	//È®ÀÎ¹öÆ°
	var btn1=document.createElement("a");
		btn1.onclick= function(){
			if(link1){
				location.href=link1;
				btn1.setAttribute("href", link1);
				alert(link1);
			};
			closeMsg(alertID);
			return false;
		};
		btn1.appendChild(document.createElement("img"));
		btn1.getElementsByTagName("img").item(0).src="/wyzhome/images/common/btn/btn_b_ok1.gif";
		btnSec.appendChild(btn1);

	//Ãë¼Ò¹öÆ°
	if(cen=="Y"){
	var btn2=document.createElement("a");
		btn2.setAttribute("href", "#");
		btn2.onclick= function(){
			closeMsg(alertID);return false;
		};
		btn2.appendChild(document.createElement("img"));
		btn2.getElementsByTagName("img").item(0).src="/wyzhome/images/common/btn/btn_b_cancel1.gif";
		btnSec.appendChild(btn2);
	}

	//´Ý±â¹öÆ°
	var btnCls=document.createElement("p");
		btnCls.className="popClose";

	var btnClose=document.createElement("a");
		btnClose.setAttribute("href", link1);
		btnClose.onclick= function(){
			closeMsg(alertID);return false;
		};
		btnClose.appendChild(document.createElement("img"));
		btnClose.getElementsByTagName("img").item(0).src="/wyzhome/images/common/popup/btn_close.gif";
		btnCls.appendChild(btnClose);

	//·¹ÀÌ¾î¿¡ ÄÁÅÙÃ÷ ³Ö±â
	alertBox.appendChild(btnSec);
	alertBox.appendChild(btnCls);
	document.getElementById("wrapper").appendChild(alertBox);
	doPosition(alertID);

}

//·¹ÀÌ¾î ´Ý±â
function closeMsg(id){
	var msgBox=document.getElementById(id);
	if (!msgBox) return false;
	document.getElementById("wrapper").removeChild(msgBox);
}

//ÆË¾÷ Æ÷Áö¼Å´×
function doPosition(id) {
	var topPos = document.documentElement.scrollTop;
	var popBox = document.getElementById(id);
	var posCenter=(document.documentElement.clientHeight-popBox.clientHeight)/2;
	window.scrollTo(0,topPos); //À©µµ¿ì ½ºÅ©·ÑÀÇ ±âÁØÀ» left: 0À¸·Î ¹Ù²ß´Ï´Ù.
	popBox.style.top=(topPos+posCenter)+"px";
	popBox.style.marginLeft=(popBox.clientWidth/2*-1)+"px";
}



//·¹ÀÌ¾î ÆË¾÷ ¿­±â
function openLayer(IdName, tpos){
	//alert(IdName);
	var pop = dEI(IdName);
	pop.style.display = "block";
	pop.style.top = tpos + "px";
	pop.style.left = 50 + "%";
	pop.style.position = "absolute";
}

//·¹ÀÌ¾î ÆË¾÷ ´Ý±â
function closeLayer(IdName){
	var pop = dEI(IdName);
	pop.style.display = "none";
}