
function Chg_BG()
{
	
	if (document.objPopupLayerBg != "undefined" && document.objPopupLayerBg != null) {    //ÆË¾÷Ã¢ÀÌ ¾Æ´Ï¸é
		
		var bodyW = document.body.clientWidth;
		var bodyH = document.body.clientHeight;		
		
		if (f.scrollWidth > bodyW){
		posX = (f.scrollWidth - objPopupLayer.width) / 2;
		}
		else
		{
		posX = (bodyW - objPopupLayer.width) / 2;
		}
		
		if (f.scrollHeight > bodyH){
		posY = (f.scrollHeight - objPopupLayer.height) / 2;
		}
		else
		{
		posY = (bodyH - objPopupLayer.height) / 2;
		}
		
		if (document.body.scrollWidth > bodyW){
		objPopupLayerBg.width = document.body.scrollWidth;
		}
		else
		{
		objPopupLayerBg.width = bodyW;
		}
		if (document.body.scrollHeight > bodyH){
		objPopupLayerBg.height = document.body.scrollHeight;
		}
		else
		{
		objPopupLayerBg.height = bodyH;
		}
		
		objPopupLayer.left = posX;
		objPopupLayer.top = posY;
	}
	

}


function _ID(obj){return document.getElementById(obj)}
function _PID(obj){return parent.document.getElementById(obj)}
function popupLayer(s,w,h,m,popup)
{
	
	
	if (!w) w = 600;
	if (!h) h = 400;
	
	var f = document.body
	var ff = document

	var pixelBorder = 3;
	var titleHeight = 32;
	var wtop = 0;
	w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;

	var bodyW = f.clientWidth;
	var bodyH = f.clientHeight;

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;
	
	if (f.scrollWidth > bodyW){
	posX = (f.scrollWidth - w) / 2;
	}
	else
	{
	posX = (bodyW - w) / 2;
	}

	if (f.scrollHeight > bodyH){
	posY = (f.scrollHeight - h) / 2;
	}
	else
	{
	posY = (bodyH - h) / 2;
	}

	var obj = ff.createElement("div");
	with (obj.style){		
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		if (f.scrollWidth > bodyW){
		width = f.scrollWidth;
		}
		else
		{
        width = bodyW;
		}
		if (f.scrollHeight > bodyH){
		height = f.scrollHeight;
		}
		else
		{
        height = bodyH;
		}
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=50)";
		opacity = "0.5";
	}

	obj.id = "objPopupLayerBg" + popup;
	
	f.appendChild(obj);
		
	
	
	
	var obj = ff.createElement("div");
	with (obj.style){
		position = "absolute";
		left = posX;
		top = posY;
		wtop = top;
		width = w - 6;		
		if(m == "1"){
		height = h - 32;
		}else{
		height = h;
		}
		backgroundColor = "#FFFFFF";
		border = "3px solid #003366";
	}
	obj.id = "objPopupLayer" + popup;		
	f.appendChild(obj);
	
	
	var ifrm = ff.createElement("iframe");
	with (ifrm.style){
		width = w - 6;
		
		if(m == "1"){
		height = h - pixelBorder * 2 - titleHeight;
		}else{
		height = h - pixelBorder * 2;
		}
	}
	ifrm.frameBorder = 0;
	ifrm.src = s;
	ifrm.scrolling = "no";
	
	obj.appendChild(ifrm);
	
	
	var obj = ff.createElement("div");
	with (obj.style){
		position = "absolute";		
		width = w;
		if(m != "1"){
		height = titleHeight;
		}
		else
		{
		height = 0;
		}
		
		left = posX;		
		//top =  posY + f.scrollTop - titleHeight - 35 - pixelBorder * 3; 
		if(m == "1"){
		top = 0;	
		
		}else{
		top = posY - 27;			
		}			
		padding = "0 0 0 0";
		textAlign = "right";
		backgroundColor = "#003366";
		color = "#ffffff";
		font = "bold 11px tahoma";
			
	}
	obj.id = "objPopupBottom" + popup;		
	f.appendChild(obj);
	
	
	var ifrm = ff.createElement("iframe");
	with (ifrm.style){
		width = w;				
		if(m != "1"){
		height = 32;		
		}
		else
		{
		height = 0;		
		}
	}
	ifrm.frameBorder = 0;
	ifrm.id = "title_ifrm";
	ifrm.src = "/common/inc/layer_title.asp?buf_id=" + popup;
	ifrm.scrolling = "no";
	obj.appendChild(ifrm);
	
		
}


	function closeLayer(){ //ÆäÀÌÁö ¶Ç´Â ¾Ë¸²Ã¢
		
		var popup = title_ifrm.document.all.Layer_ID.value;
		
		
		_ID('objPopupLayerBg' + popup).parentNode.removeChild( _ID('objPopupLayerBg' + popup) );
				
		_ID('objPopupLayer' + popup).parentNode.removeChild( _ID('objPopupLayer' + popup) );		
		
		_ID('objPopupBottom' + popup).parentNode.removeChild( _ID('objPopupBottom' + popup) );				
		
		
	}
	

//ÀÌ¹ÌÁö ·Ñ¿À¹ö--------------------------------------------------------------------------------------------------------

function setPng24(obj)
{
    obj.width = obj.height = 1;
    obj.className = obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src = '';
    return '';
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//ÀÚµ¿ ÅÇ ÀÌµ¿ (¿øÇÏ´Â ±ÛÀÚ ¼ýÀÚ ³Ö¾úÀ»¶§ Æ÷Ä¿½º ÀÌµ¿)------------------------------------------------------------------

function tab_order(arg, nextname, len) { 
	if (arg.value.length == len) { 
	  nextname.focus() 
	  return; 
	} 
}

//¿ÏÀü ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â-------------------------------------------------------------------------------------------------

function only_num() { 
	var key = event.keyCode;
    var messageArea = document.getElementById("ssnMessage");
    if(!(key==8||key==9||key==13||key==46||key==144||(key>=48&&key<=57)||key==110||key==190)){     
     event.returnValue = false;
    }
}



function onlynum(objtext1, msg){
	var inText = objtext1.value;
	var ret;

	for (var i = 0; i < inText.length; i++) {
    ret = inText.charCodeAt(i);
		if (!((ret > 47) && (ret < 58))){
			if (msg == "1"){
				alert("¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.");
				objtext1.value = "";
				objtext1.focus();
			}
			return false;
		}
	}
	return true;
}

function onlyInt(objtext1){
	var inText = objtext1.value;
	var ret;

	for (var i = 0; i < inText.length; i++) {
    ret = inText.charCodeAt(i);
		if (!((ret > 47) && (ret < 58))){
			if (ret!= 45){
				alert("¼ýÀÚ ¶Ç´Â À½¼öºÎÈ£(-)¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.");
				objtext1.value = "";
				objtext1.focus();
				return false;
			}
		}
	}
	return true;
}

function onlyBoardID(objtext1){
	var inText = objtext1.value;
	var ret;

	for (var i = 0; i < inText.length; i++) {
		ret = inText.charCodeAt(i);
		if ((ret > 122) || (ret < 48) || (ret > 57 && ret < 65) || (ret > 90 && ret < 97)) {
			if (ret!=95){
				alert("¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ¼¼¿ä");objtext1.value = "";objtext1.focus();return false;
			}
		}
	}
	return true;
}


//±âÅ¸ --------------------------------------------------------------------------------------------------------
function Change_Etc(a,b){

		var f = document.mform[b];

		if(a.value == "etc"){			
			
			f.style.display = "";
			f.value = "";
			f.focus();
			
		}else{
		
			f.style.display = "none";
			f.value = a.value;

		}	

}		


//ÀÌ¸ÞÀÏ ÁÖ¼Ò ¹× ¼­¹ö---------------------------------------------------------------------------------------------------
function domainChange()
{

	var f = document.send_form;
	var value=f.domain[f.domain.selectedIndex].value;

		if( value == "direct"){
			f.emailserver.readOnly = false;
			f.emailserver.value='';
			f.emailserver.focus();
		}else{
			f.emailserver.readOnly = true;
			f.emailserver.value = value;
		}
	return;
}


function selectbox_hidden(layer_id) 
{ 
var ly = eval(layer_id); 

// ·¹ÀÌ¾î ÁÂÇ¥ 
var ly_left = ly.offsetLeft; 
var ly_top = ly.offsetTop; 
var ly_right = ly.offsetLeft + ly.offsetWidth; var ly_bottom = ly.offsetTop + ly.offsetHeight; 


// ¼¿·ºÆ®¹Ú½ºÀÇ ÁÂÇ¥ 
var el; 

for (i=0; i<document.forms.length; i++) { 
for (k=0; k<document.forms[i].length; k++) { 
el = document.forms[i].elements[k]; 
if (el.type == "select-one") { 
var el_left = el_top = 0; 
var obj = el; 
if (obj.offsetParent) { 
while (obj.offsetParent) { 
el_left += obj.offsetLeft; 
el_top += obj.offsetTop; 
obj = obj.offsetParent; 
} 
} 
el_left += el.clientLeft; 
el_top += el.clientTop; 
el_right = el_left + el.clientWidth; 
el_bottom = el_top + el.clientHeight; 

// ÁÂÇ¥¸¦ µûÁ® ·¹ÀÌ¾î°¡ ¼¿·ºÆ® ¹Ú½º¸¦ Ä§¹üÇßÀ¸¸é ¼¿·ºÆ® ¹Ú½º¸¦ hidden ½ÃÅ´
if ( (el_left >= ly_left && el_top >= ly_top && el_left <= ly_right && el_top <= ly_bottom) || 
(el_right >= ly_left && el_right <= ly_right && el_top >= ly_top && el_top <= ly_bottom) || 
(el_left >= ly_left && el_bottom >= ly_top && el_right <= ly_right && el_bottom <= ly_bottom) || 
(el_left >= ly_left && el_left <= ly_right && el_bottom >= ly_top && el_bottom <= ly_bottom) ) 
el.style.visibility = 'hidden'; 
} 
} 
} 
} 


// °¨Ãß¾îÁø ¼¿·ºÆ® ¹Ú½º¸¦ ¸ðµÎ º¸ÀÌ°Ô ÇÔ 
function selectbox_visible() 
{ 
for (i=0; i<document.forms.length; i++) { 
for (k=0; k<document.forms[i].length; k++) { 
el = document.forms[i].elements[k]; 
if (el.type == "select-one" && el.style.visibility == 'hidden') 
el.style.visibility = 'visible'; 
} 
} 
} 



function MiniCal(jucke) {
	target=jucke
	x = (document.layers) ? loc.pageX : event.clientX;
	y = (document.layers) ? loc.pageY : event.clientY;
	minical.style.pixelTop	= y - 50  + document.body.scrollTop;
	minical.style.pixelLeft	= x-100;
	minical.style.display = (minical.style.display == "block") ? "none" : "block";
	
	if (target.value.length == 0){
	Show_cal(0,0,0)
	selectbox_hidden('minical')
	}
	else
	{
	Show_cal(target.value.substr(0,4),target.value.substr(5,2),target.value.substr(8,2))
	selectbox_hidden('minical')
	}
}


function MiniCal_adjust(jucke , a , b) {
	target=jucke
	x = (document.layers) ? loc.pageX : event.clientX;
	y = (document.layers) ? loc.pageY : event.clientY;
	minical.style.pixelTop	= y + a  + document.body.scrollTop;
	minical.style.pixelLeft	= x + b;
	minical.style.display = (minical.style.display == "block") ? "none" : "block";
	
	if (target.value.length == 0){
	Show_cal(0,0,0)
	selectbox_hidden('minical')
	}
	else
	{
	Show_cal(target.value.substr(0,4),target.value.substr(5,2),target.value.substr(8,2))
	selectbox_hidden('minical')
	}
}


var stime
function doOver() {
	var el = window.event.srcElement;
	cal_Day = el.title;
	
		el.style.borderTopColor = el.style.borderLeftColor = "buttonhighlight";
		el.style.borderRightColor = el.style.borderBottomColor = "buttonshadow";
	
	window.clearTimeout(stime);
	selectbox_hidden('minical')
}
function doClick() {
	cal_Day = window.event.srcElement.title;
	window.event.srcElement.style.borderColor = "red";
	if (cal_Day.length > 7) {
		target.value=cal_Day
	}
	selectbox_visible();
		
	
}
function doOut() {
	var el = window.event.fromElement;
	cal_Day = el.title;

	
		el.style.borderColor = "white";
	
	stime=window.setTimeout("minical.style.display='none';", 200);
	selectbox_visible();
}
//-----------------------------------------------------------------------------------------------------------

/***********************************
/ ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô »õÃ¢¶ç¿ì±â
/***********************************/
function OpenImage(s , w , h){
 //
 // º¯¼ö Á¤ÀÇ
 //
 srcImg = new Image();
 clientWidth = screen.width;
 clientHeight = screen.height;
 srcImg.src = s;
 //
 // ¿­·Á´Â ÆÄÀÏÀ» ÀÌ¸§
 //
 var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length);
 //
 // »õÃ¢ ¶ç¿ì°í ÀÌ¹ÌÁö »ðÀÔ
 //
 win = window.open("","","width=0,height=0,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2-15)+"");
 win.document.writeln("<html>");
 win.document.writeln("<head>");
 win.document.writeln("<title>"+document.title+" ["+srcFileName+"]</title>");
 win.document.writeln("</head>");
 win.document.writeln("<body style='margin:0px;'>");
 win.document.writeln("<table border='0' cellpadding='0' cellspacing='0' style='cursor:hand' onclick='self.close()'>");
 win.document.writeln(" <tr>");
 win.document.writeln("  <td align='center'><img src="+s+" name='winImg' style='cursor:hand' onclick='self.close()' alt='Å¬¸¯ÇÏ¸é »ç¶óÁý´Ï´Ù'></td>");
 win.document.writeln(" </tr>");
 win.document.writeln("</table>");
 win.document.writeln("</body>");
 win.document.writeln("</html>");

 srcImg = win.document.winImg;
 //
 // ÀÌ¹ÌÁö°¡ ¸ðµÎ ·ÎµùµÉ¶§±îÁö ±â´Ù¸²
 //
 while(true)
 if(srcImg.readyState == "complete")
 break;
 
 //
 // »õÃ¢ÀÇ Å©±â ¼³Á¤
 //
 var winWidth = srcImg.width + 10;
 var winHeight = srcImg.height + 75;
 //
 // »õÃ¢ÀÌ ¶ç¿öÁú À§Ä¡ ¼³Á¤
 //
 var left = (clientWidth/2)-(srcImg.width/2);
 var top = (clientHeight/2)-(srcImg.height/2);
 //
 // ÀÌ¹ÌÁöÀÇ Å©±â overflow È®ÀÎÈÄ »õÃ¢ÀÇ Å©±â¿Í À§Ä¡ Àç¼³Á¤
 //
 if(clientWidth <= srcImg.width){
  winWidth = clientWidth;
  left = 0;
  win.document.body.scroll = "auto";
 }
 if(clientHeight <= srcImg.height){
  winHeight = clientHeight - 10;
  top = 0;
  win.document.body.scroll = "auto";
 }
 //
 // ÀÌ¹ÌÁö·ÎµùÀÌ ³¡³µÀ½À¸·Î ÀÌ¹ÌÁöÀÇ Å©±â¸¦ »ç¿ëÇÒ¼ö ÀÖ´Ù.
 // ÇØ´ç ÀÌ¹ÌÁöÀÇ »çÀÌÁî¿¡ ¸Â°Ô À©µµ¿ì¸¦ Àç¼³Á¤ÇÑ´Ù.
 win.moveTo(left, top);
 win.resizeTo(winWidth, winHeight);
}

//-----------------------------------------------------------------------------------------------------------


