var js_DOMAIN_HTTP = "http://www.designdb.com";


//-----------------------------------------------------------
// title : °øÅë½ºÅ©¸³Æ®
// update : 2008.06.19 jeon
//-----------------------------------------------------------

// °´Ã¼ Æò¼Ç
function $(id) {
   return document.getElementById(id);
}

// Trim
function Trim(obj1)
{
	obj1 = obj1.replace(/^(\s+)|(\s+)$/g, "")
	return obj1;
}

// Input String null checking
function validFieldText(objInput, msgStr)
{
	if(Trim(objInput.value) == "") 
	{
		alert("" + msgStr + " ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		objInput.focus();
		return false;
	}

	return true;
}

// Á¦¸ñ ¹ÙÀÌÆ® Á¦ÇÑ ÇÔ¼ö
function validFieldTitle(fd)
{
	var val = fd.value;
	if (returnByteCount(fd.value) > 200)
	{
		alert("Á¦¸ñÀº ÇÑ±Û±âÁØ 100ÀÚ, ¿µ¹®±âÁØ 200ÀÚ ÀÌ³»·Î ÇØÁÖ¼¼¿ä.");
		fd.focus();
		return false;
	}
	else
		return true;
}
// ¹ÙÀÌÆ®¼ö¸¦ ¸®ÅÏÇÏ´Â ÇÔ¼ö
function returnByteCount(val)
{ 
	var len = val.length;            //ÇöÀç value°ªÀÇ ±ÛÀÚ ¼ö 
	var cnt = 0;                    //ÇÑ±ÛÀÏ °æ¿ì 2 ±×¿Ü¿¡´Â 1¹ÙÀÌÆ® ¼ö ÀúÀå 
	var chr = "";                 //ÇöÀç ÇÑ/¿µ Ã¼Å©ÇÒ letter¸¦ ÀúÀå 

	for (i=0; i<len; i++) 
	{ 
		chr = val.charAt(i); 

		// Ã¼Å©¹®ÀÚ°¡ ÇÑ±ÛÀÏ °æ¿ì 2byte ±× ¿ÜÀÇ °æ¿ì 1byte Áõ°¡ 
		if (escape(chr).length > 4) 
		   cnt += 2; 
		else
		   cnt++; 
	} 
	return cnt;
}

// ÀÚ¸®¼ö Çü½Ä Ã¼Å©
function validFieldLeng(obj, str, len)
{
	if(obj.value.length < len)	// ÀÛÀ¸¸é false °°°Å³ª Å©¸é »ó°ü¾øÀ½ maxlength·Î Á¦ÇÑÇÏ±â ¶§¹®¿¡ Å¬ ¼ö´Â ¾øÀ½
	{
		alert(str + " ÀÚ¸®¼ö°¡ ¸ÂÁö ¾Ê½À´Ï´Ù.\n"+len+" ÀÚ¸® ¶Ç´Â ±× ÀÌ»óÀ¸·Î ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}
	else
		return true;
}

// ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
function validFieldMail(obj, str, len)
{
	if(obj.value.match(/^(\w+)@(\w+)[.](\w+)$/ig) == null && obj.value.match(/^(\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null)
	{
		alert(str + " Çü½ÄÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
		obj.focus();
		return false;
	}
	else
		return true;
}

// Input String null checking(with select)
function validFieldSelect(objInput, msgStr)
{
	if(Trim(objInput.value) == "") 
	{
		alert("" + msgStr + " ¼±ÅÃÇØÁÖ¼¼¿ä.");
		objInput.focus();
		return false;
	}

	return true;
}

// ¸µÅ© Á¡¼± Å×µÎ¸® ÇÑ¹ø¿¡ ¾ø¾Ö±â
function bluring()
{
	if (event.srcElement.tagName == "a" || event.srcElement.tagName == "img")	document.body.focus();
}
//document.onfocusin = bluring;

// ¼ýÀÚ Á¦°Å
function SetNum(obj)
{
	val=obj.value;
	re=/[^0-9]/gi;
	obj.value=val.replace(re,"");
}

// Input String null checking (NoMsg)
function validFieldTextNoMsg(objInput)
{
	if(Trim(objInput.value) == "") 
	{
		return false;
	}

	return true;
}

// Input String null checking (for English)
function validFieldTextEng(objInput, msgStr)
{
	if(Trim(objInput.value) == "") 
	{
		alert("Please enter a " + msgStr + "");
		objInput.focus();
		return false;
	}

	return true;
}

// Input Webedit null checking
function validFieldWebEdit(objInput, msgStr)
{
	if(objInput == false) 
	{
		alert("\n" + msgStr + " ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return false;
	}

	return true;
}

// Æ÷¸Ë Ã¼Å©
function isValidFormat(input, format) 
{
    if (input.value.search(format) != -1) 
	{
        return true;
    }
    return false;
}

//¼ýÀÚÀÔ·Â Ã¼Å©(onblur)
function isValidNumber(theForm, firstNum) 
{
	if(Trim(theForm.value) != "") 
	{
		theForm.value=Trim(theForm.value);

		var str=theForm.value;
		for (var i = 0; i< str.length; i++) 
		{
			var ch = str.substring(i, i + 1);

			if (i==0 && ch=="-") {}
			else
			{
				if ( (ch<"0" || ch>"9") ) 
				{
					alert(firstNum+" ¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
					theForm.readonly = false;
					theForm.value="";
					theForm.focus();
					return false;
				}
			}
		}
	}

	return true;
}

//¼ýÀÚÀÔ·Â Ã¼Å©(onblur) - ¿µ¹® ¹öÁ¯
function isValidNumber2(theForm, firstNum) 
{
	if(Trim(theForm.value) != "") 
	{
		theForm.value=Trim(theForm.value);

		var str=theForm.value;
		for (var i = 0; i< str.length; i++) 
		{
			var ch = str.substring(i, i + 1);

			if (i==0 && ch=="-") {}
			else
			{
				if ( (ch<"0" || ch>"9") ) 
				{
//					alert(firstNum+" ¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä....");
					alert("Enter numbers ...");

					theForm.readonly = false;
					theForm.value="";
					theForm.focus();
					return false;
				}
			}
		}
	}

	return true;
}

//³¯Â¥ Çü½Ä Ã¼Å©
function isValidDate(o)
{	
	if (Trim(o.value) != ""){
		if(o.value.indexOf("-") +""=="-1")
		{
			alert("Àß¸øµÈ Çü½ÄÀÔ´Ï´Ù.")
			o.focus();
			return false;
		}
	}
	return true;
}

//³¯Â¥ Çü½Ä Ã¼Å©(À¯È¿ÇÑ ³¯Â¥ÀÎÁö Ã¼Å©)
function isValidDate2(o,msgType)
{
	var regexp = /[^0-9]/g;
	var repexp = '';
	var tmpVal = Trim(o.value);
	var tmpYYYY, tmpMM, tmpDD;
	var i, tmpCharAt, tmpEndDay;
	var tmpMsg;


	tmpVal = tmpVal.replace(regexp,repexp);
	// ¼ýÀÚ·Î 8ÀÚ¸®ÀÎÁö Ã¼Å©...
	if ( tmpVal.length != 8 ){
		tmpMsg = "³¯Â¥¸¦ Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.";
		if (msgType == "E"){	// ¿µ¹®ÀÏ °æ¿ì...
			tmpMsg = "To input a date of birth accurately.";
		}

		alert(tmpMsg);
		o.focus();
		return false;
	}

	tmpVal = Trim(o.value);

	// ³¯Â¥Áß ±¸ºÐÀÚ Á¸Àç Çü½ÄÀÏ°æ¿ì...
	if ( tmpVal.length > 8 ){
		tmpVal = String(tmpVal.substr(0,4)) + String(tmpVal.substr(5,2)) + String(tmpVal.substr(8,2));
	}

	// ³¯Â¥ Çü½ÄÀÎÁö ´Ù½Ã Ã¼Å©...
	tmpVal = tmpVal.replace(regexp,repexp);
	if ( tmpVal.length < 8 ){
		tmpMsg = "³¯Â¥ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.";
		if (msgType == "E"){	// ¿µ¹®ÀÏ °æ¿ì...
			tmpMsg = "Not date type.";
		}

		alert(tmpMsg);
		o.focus();
		return false;
	}


	tmpYYYY = Number(tmpVal.substr(0,4));
	tmpMM = Number(tmpVal.substr(4,2));
	tmpDD = Number(tmpVal.substr(6,2));

	tmpEndDay = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    if ((tmpYYYY % 4 == 0 && tmpYYYY % 100 != 0) || tmpYYYY % 400 == 0) {
        tmpEndDay[1] = 29;
    }

	tmpMsg = "³¯Â¥ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.";
	if (msgType == "E"){	// ¿µ¹®ÀÏ °æ¿ì...
		tmpMsg = "Not date type.";
	}

	if (tmpYYYY < 1000 || tmpYYYY > 2500){		// ³âµµ Ã¼Å©´Â ³»°¡ Á×±âÀü±îÁö·Î Á¤ÇÔ.
		alert(tmpMsg);
		o.focus();
		return false;
	}

	if (tmpMM < 1 || tmpMM > 12){
		alert(tmpMsg);
		o.focus();
		return false;
	}

	if (tmpDD > tmpEndDay[tmpMM-1]){
		alert(tmpMsg);
		o.focus();
		return false;
	}

	return true;
}

//ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
function isValidMail(o)
{
	if (Trim(o.value) != ""){
		if(o.value.indexOf("@") +""=="-1" || o.value.indexOf(".") +""=="-1")
		{
			alert("Àß¸øµÈ ÀÌ¸ÞÀÏ Çü½ÄÀÔ´Ï´Ù.")
			o.focus();
			return false;
		}
	}
	return true;
}

//ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©(¿µ¹® ¹öÁ¯)
function isValidMail2(o)
{
	if (Trim(o.value) != ""){
		if(o.value.indexOf("@") +""=="-1" || o.value.indexOf(".") +""=="-1")
		{
			alert("The mail type is not right.Input do as a favor accurately.")
			o.focus();
			return false;
		}
	}
	return true;
}

// ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
function CheckEmail(strEmail)
{
	var format = /^((\w|[\-\.])+)\.([A-Za-z]+)$/;
    	return isValidFormat(strEmail, format);
}


// ÀÌ¸ÞÀÏÇü½Ä Ã¼Å©2
function mail_check(str) 
{
	emailEx1 = /[^@]+@[A-Za-z0-9_\-]+\.[A-Za-z]+/;
	emailEx2 = /[^@]+@[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z]+/;
	emailEx3 = /[^@]+@[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z]+/;
	if(emailEx1.test(str)){ return true; };
	if(emailEx2.test(str)){ return true; };
	if(emailEx3.test(str)){ return true; };
	return false;
}

// ±ÛÀÚ¼ö ¹ÙÀÌÆ®·Î Á¦ÇÑ
function ChkByte(objname,maxlength) 
{
	var objstr = objname.value; // ÀÔ·ÂµÈ ¹®ÀÚ¿­À» ´ãÀ» º¯¼ö
	var objstrlen = objstr.length; // ÀüÃ¼±æÀÌ

	// º¯¼öÃÊ±âÈ­
	var maxlen = parseInt(maxlength,10); // Á¦ÇÑÇÒ ±ÛÀÚ¼ö ÃÖ´ëÅ©±â
	var i = 0; // for¹®¿¡ »ç¿ë
	var bytesize = 0; // ¹ÙÀÌÆ®Å©±â
	var strlen = 0; // ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÇ Å©±â
	var onechar = ""; // char´ÜÀ§·Î ÃßÃâ½Ã ÇÊ¿äÇÑ º¯¼ö
	var objstr2 = ""; // Çã¿ëµÈ ±ÛÀÚ¼ö±îÁö¸¸ Æ÷ÇÔÇÑ ÃÖÁ¾¹®ÀÚ¿­

	// ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÇ ÃÑ¹ÙÀÌÆ®¼ö ±¸ÇÏ±â
	for(i=0; i< objstrlen; i++) 
	{
		// ÇÑ±ÛÀÚÃßÃâ
		onechar = objstr.charAt(i);

		if (escape(onechar).length > 4) 
		{
			bytesize += 2;			// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
		} 
		else 
		{
			bytesize++;				// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
		}

		if(bytesize <= maxlen)		// ÀüÃ¼ Å©±â°¡ maxlen¸¦ ³ÑÁö¾ÊÀ¸¸é
		{   
			strlen = i + 1;			// 1¾¿ Áõ°¡
		}
	}

	// ÃÑ¹ÙÀÌÆ®¼ö°¡ Çã¿ëµÈ ¹®ÀÚ¿­ÀÇ ÃÖ´ë°ªÀ» ÃÊ°úÇÏ¸é
	if (bytesize > maxlen)
	{
		objstr2 = objstr.substr(0, strlen);
		objname.value = '';
		return true;
	}
	else 
	{
		maxlength = bytesize;
		return false;
	}
}

// ¸ðµÎ ¼±ÅÃ ÇØÁ¦
var checkAllFlag = true;

function CheckAll(A,B,C)	// CheckAll(ÆûÀÌ¸§, °³Ã¼ÀÌ¸§, true/false)
{
	var X=eval("document.forms."+A+"."+B)
	var Xlength;
	if (X != undefined)	{
		Xlength = document.getElementsByName('listChk').length;
		if (Xlength == 1){
			X.checked=C;
		}else if(Xlength > 1){
			for (c=0;c<X.length;c++)
			X[c].checked=C;
		}
		checkAllFlag = !checkAllFlag;
	}

}

// ±âº»Ã¢ ¶ç¿ì±â
function WindowOpen(Url, popName, popwidth, popheight)
{
	var height = screen.height;
	var width = screen.width;
	var left = 0;
	var top = 0;
	popheight = popheight + 27;
	window.open(Url, popName, "width="+popwidth+",height="+popheight+",scrollbars=no,toolbar=no,left="+left+",top="+top+"")
}

// ¼¾ÅÍ Ã¢ ¶ç¿ì±â(scrollbars no)
function WindowOpenImage(Url, popName, popwidth, popheight)
{
	//var LeftPosition = (screen.width) ? (screen.width-popwidth)/2 : 0;
	//var TopPosition = (screen.height) ? (screen.height-popheight)/2 : 0;
	popwidth =800;
	popheight = 600;
	var LeftPosition = (screen.width) ? (screen.width)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height)/2 : 0;
	var settings = 'height='+popheight+',width='+popwidth+',top='+TopPosition+',left='+LeftPosition+',status=no,toolbar=no,menubar=no,location=no,fullscreen=yes,resizable=yes,scrollbars=yes';
	win = window.open(Url,popName,settings)
}

// ¼¾ÅÍ Ã¢ ¶ç¿ì±â(scrollbars no)
function WindowOpenCenter(Url, popName, popwidth, popheight)
{
	var LeftPosition = (screen.width) ? (screen.width-popwidth)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-popheight)/2 : 0;
	var settings = 'height='+popheight+',width='+popwidth+',top='+TopPosition+',left='+LeftPosition+',status=no,toolbar=no,menubar=no,location=no,fullscreen=no,resizable=no,scrollbars=no';
	win = window.open(Url,popName,settings)
}

// ¼¾ÅÍ Ã¢ ¶ç¿ì±â(scrollbars yes)
function WindowOpenCenter2(Url, popName, popwidth, popheight)
{
	var LeftPosition = (screen.width) ? (screen.width-popwidth)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-popheight)/2 : 0;
	var settings = 'height='+popheight+',width='+popwidth+',top='+TopPosition+',left='+LeftPosition+',status=no,toolbar=no,menubar=no,location=no,fullscreen=no,resizable=no,scrollbars=yes';
	win = window.open(Url,popName,settings)
}

// E7.0 ºê¶ó¿ìÁ® Ã¢ ³ôÀÌ Á¶Àý
function WindowOpenNomargin(Url, popName, popwidth, popheight)
{
	var height = screen.height;
	var width = screen.width;
	popheight = popheight + 27;
	window.open(Url, popName, "width="+popwidth+",height="+popheight+",scrollbars=no,toolbar=no,left=0,top=0")
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function jumin_check(o, registNum1, registNum2 )
{
	var chk =0;
	var yy = registNum1.value.substring(0,2);
	var mm = registNum1.value.substring(2,4);
	var dd = registNum1.value.substring(4,6);
	var sex = registNum2.value.substring(0,1);


	if((registNum1.value.length!=6) || (yy <25||mm <1||mm>12||dd<1))
	{
		o.msg.value = "ÁÖ¹Îµî·Ï¹øÈ£¸¦ ¹Ù·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.";
		registNum1.value="";
		registNum2.value="";
		registNum1.focus();
		return true;
	}

	if((sex != 1 && sex !=2 && sex != 3 && sex != 4) || (registNum2.value.length!= 7))
	{
		o.msg.value = "ÁÖ¹Îµî·Ï¹øÈ£¸¦ ¹Ù·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.";
		registNum1.value="";
		registNum2.value="";
		registNum1.focus();
		return true;
	}

	for (var i = 0; i <=5 ; i++)
	{
		chk = chk + ((i%8+2) * parseInt(eval(registNum1.value.substring(i,(i+1)))));
	}
	for (var i = 6; i <=11 ; i++)
	{
		chk = chk + ((i%8+2) * parseInt(eval(registNum2.value.substring((i-6),(i-5)))));
	}

	chk = 11 - (chk %11);
	chk = chk % 10;

	if (chk != registNum2.value.substring(6,7))	
	{
		o.msg.value = "À¯È¿ÇÏÁö ¾Ê´Â ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\nÅ¸ÀÎÀÇ ÁÖ¹Îµî·Ï¹øÈ£¸¦ µµ¿ëÇÏ°Å³ª ÇãÀ§ ±âÁ¦ÇÒ °æ¿ì È¸¿ø°¡ÀÔÀÌ Ãë¼ÒµË´Ï´Ù.";
		registNum1.value="";
		registNum2.value="";
		registNum1.focus();
		return true;
	}
}

// ActiveX Start 1
function flashMovie(fid,src,wid,hei,fvs,wmd) 
{
	this.fPrint = '';
	this.Id = document.getElementById(fid);
	this.Src = src;
	if(wid == 0)
	{
		this.Width = '100%';
	}
	else{
		this.Width = wid;
	}
	if(hei == 0){
		this.Height = '100%';
	}
	else{
		this.Height = hei;
	}
	this.FlashVars = (fvs != undefined)? fvs :'';
	this.Wmod = (wmd != undefined)? wmd :'';
	if(isObject(Id)) 
	{
		fPrint = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
		fPrint += ' width="'+Width+'"';
		fPrint += ' height="'+Height+'">';
		fPrint += '<param name="allowScriptAccess" value="always">';
		fPrint += '<param name="movie" value="'+Src+'">';
		fPrint += '<param name="menu" value="false" />';
		fPrint += '<param name="quality" value="high">';
		fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
		fPrint += '<param name="wmode" value="'+Wmod+'">';
		fPrint += '<embed';
		fPrint += ' src="'+Src+'"';
		fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
		fPrint += ' wmode="'+Wmod+'"' ;
		fPrint += ' quality="high"';
		fPrint += ' allowScriptAccess="always"';
		fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
		fPrint += ' type="application/x-shockwave-flash"';
		fPrint += ' width="'+Width+'"';
		fPrint += ' height="'+Height+'"';
		fPrint += '></embed>';
		fPrint += '</object>';
		Id.innerHTML = fPrint;
	}
}

// ActiveX Start 2
function flash(fid,fnm,wid,hei,fvs,bgc,wmd) {
	var flash_tag = "";
	flash_tag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wid+'" height="'+hei+'" id="'+fid+'" align="middle">';
	flash_tag +='<param name="allowScriptAccess" value="always" />';
	flash_tag +='<param name="allowFullScreen" value="false" />';
	flash_tag +='<param name="movie" value="'+fnm+'" />';
	flash_tag +='<param name="FlashVars" value="'+fvs+'" />';
	flash_tag +='<param name="quality" value="high" />';
	flash_tag +='<param name="bgcolor" value="'+bgc+'" />';
	flash_tag +='<param name="wmode" value="'+wmd+'" />';
	flash_tag +='<embed src="'+fnm+'" quality="high" bgcolor="'+bgc+'" FlashVars="'+fvs+'" wmode="'+wmd+'" width="'+wid+'" height="'+hei+'" name="'+fid+'" id="'+fid+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flash_tag +='</object>';
	
	document.write(flash_tag);
}

// ActiveX Start 3
function reEmbed(cont_id)
{
	var swf_src = "http://media.inempire.com/player/ExtendASPPlayer.swf" ;
	var swf_width   	= "414";
	var swf_height  	= "340";
	var swf_version  = "9.0.47.00";
	var swf_id    = (tmp = swf_src.split("/"), tmp = tmp[tmp.length - 1], tmp.split(".swf").shift());
	var swf_fullscreen = "true";
	var swf_script   = "always";
	var swf_wmode  = "window";
	var swf_networking = "all";
	var swf_bgcolor  = "";
	var swf_vars    = "cid="+ cont_id; // pink, gray, purple, black
	var nocache    = Math.random()*3600000;

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+swf_version+'" name="'+swf_id+'" width="'+swf_width+'" height="'+swf_height+'" id="'+swf_id+'">  <param name="movie" value="'+swf_src+'?nocache='+nocache+'" /> <param name="quality" value="high" />  <param name="allowFullScreen" value="'+swf_fullscreen+'" />  <param name="bgColor" value="' + swf_bgcolor + '" /> <param name="allowScriptAccess" value="'+swf_script+'" />  <param name="allowNetworking" value="'+swf_networking+'" />  <param name="wmode" value="'+swf_wmode+'" />  <param name="FlashVars" value="'+swf_vars+'" />  <embed src="'+swf_src+'?nocache='+nocache+'" allowFullScreen="'+swf_fullscreen+'" FlashVars="'+swf_vars+'" allowScriptAccess="'+swf_script+'" allowNetworking="'+swf_networking+'" width="'+swf_width+'" height="'+swf_height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="'+swf_id+'"></embed></object>');
}

// ActiveX Start 4 (½Å¹öÁ¯ 20080704)
///////////////////////////////////////////
// IE activeX patch
// author Jackie Lee (jackie72@korea.com)
// http://www.727406.com
// create date 2008.07.03
// version 2.0
// powered by Park Sung-Jin
// ¹èÆ÷½Ã À§³»¿ëÀ» Æ÷ÇÔÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù
///////////////////////////////////////////

//flashObject(ID¹×NAME,ÇÃ·¡½ÃÆÄÀÏ°æ·Î,°¡·ÎÇÈ¼¿,¼¼·ÎÇÈ¼¿,º¯¼ö,¹è°æ»ö,À©µµ¿ì¸ðµå)
//°¡·Î, ¼¼·Î ÇÈ¼¿À» 100%·Î ÇÒ °æ¿ì '100%'·Î ¾²¸é µË´Ï´Ù


function flashString(mID, mUrl, mWidth, mHeight, mParams) {
	var buff = [];
	buff.push("<object style='border:1px' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' id='" + mID + "' width='" + mWidth + "' height='" + mHeight + "'>");
	buff.push("<param name='allowScriptAccess' value='always' />");
	buff.push("<param name='movie' value='" + mUrl + "' />");
	buff.push("<param name='menu' value='false' />");
	buff.push("<param name='quality' value='high' />");
	buff.push("<param name='wmode' value='transparent' />");
	buff.push("<param name='bgcolor' value='#FFFFFF' />");
	buff.push("<param name='wmode' value='transparent' />");
	buff.push("<param name='flashvars' value='" + mParams + "' />");
	buff.push("<embed name='" + mID + "' allowScriptAccess='always' src='" + mUrl + "' quality='high' wmode='transparent' bgcolor='#FFFFFF' width='" + mWidth + "' height='" + mHeight + "' ");
	buff.push("flashvars='" + mParams + "' ");
	buff.push("type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	buff.push("</object>");
	
	return buff.join("");
}

function flashObject(mID, mUrl, mWidth, mHeight, mParam) {
	document.write(flashString(mID, mUrl, mWidth, mHeight, mParam));
}

// object type È®ÀÎ
function isObject(a) 
{
    return (a && typeof a == 'object');
}

// display¼³Á¤ º¯°æ
function changeTb(tbName, tbCount, tbNum) 
{
	var a;
	for(i=1;i<=tbCount;i++)
	{
		a = eval("document.all."+tbName+i);

		if(i != tbNum) 
		{
			a.style.display = 'none';
		}
		else 
		{
			a.style.display = 'block';
		}
	}
}

// ¾ÆÀÌÇÁ·¹ÀÓ ÀÚµ¿ ±æÀÌ Á¶Àý ½ºÅ©¸³Æ®
function resizeFrame(iframeObj)
{
	var innerBody = iframeObj.contentWindow.document.body;
	oldEvent = innerBody.onclick;
	innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
	var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight) + 5;
	iframeObj.style.height = innerHeight;
	var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
	iframeObj.style.width = innerWidth;
	if( !arguments[1] )        /* Æ¯Á¤ ÀÌº¥Æ®·Î ÀÎÇÑ È£Ãâ½Ã ½ºÅ©·ÑÀ» ±×³É µÐ´Ù. */
		this.scrollTo(1,1);
}

// image
function clrImg(obj)
{
    obj.style.backgroundImage="";
	obj.onkeydown=obj.onmousedown=null;
}

// ¿µ¹®°Ë»ç
function isEng(str)
{
	for(var i=0; i < str.length; i++)
	{
		achar = str.charCodeAt(i);
		if(achar > 255)
		{
			return false;
		}
	}

	return true;
}

// Alphabet ÇÊµå
function IsAlphabet(str)
{
	var vStr = str.toUpperCase();
	for(var i = 0; i < vStr.length; i++)
	{
		if(vStr.charAt(i) < 'A' || vStr.charAt(i) > 'Z')
		{
			return false;
		}
	}
	return true;
}

// Alphabet + Number ÇÊµå
function IsAlphaDigit(obj, str)
{
	var strTemp = obj.value.toUpperCase();
	for(var i = 0; i < strTemp.length; i++)
	{
		if(strTemp.charAt(i) < '0' || (strTemp.charAt(i) > '9' && strTemp.charAt(i) < 'A') ||  strTemp.charAt(i) > 'Z') 
		{
		    alert( str + " ¹Ù¸£°Ô ÀÔ·ÂÇØ ÁÖ¼¼¿ä." );
			obj.value = "";
			obj.focus();
			return false;
		}
	}
	return true;
}

// Number ÇÊµå
function comFuncIsDigit(obj, str)
{
	for (i=0; i < obj.value.length; i++)
	{
		if (obj.value.charAt(i) < '0' || obj.value.charAt(i) > '9')
		{
			alert( str + " ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä." );
			obj.value = "";
			obj.focus();
			return false;
		}
	}
	return true;
}

// ÇÊµå Length
function CheckLength(obj, min, max, str)
{
	var iLength = obj.value.length;
	if(iLength < min || iLength > max) 
	{
		alert(str + " " + min + "ÀÚ ÀÌ»ó " + max + "ÀÚ ÀÌ³»·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}
	else return true;
}

// ÇÊµå Length
function CheckLength1(obj, strNum, str)
{
	var iLength = obj.value.length;
	if(iLength < strNum || iLength > strNum) 
	{
		alert( str + " " + strNum + "ÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä." );
		obj.focus();
		return false;
	}
	else return true;
}

// Æ®·¢¹é º¹»çÇÏ±â
function SelectCopy(s)
{
    var doc = document.body.createTextRange();
    doc.moveToElementText(document.all(s));
    doc.select();
    doc.execCommand('copy');
    alert('ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\n\nÁÖ¼ÒÃ¢¿¡ Ctrl + V ¸¦ ´­·¯ÁÖ¼¼¿ä.');
}

// ·¹ÀÌ¾î Ã³¸® ½ºÅ©¸³Æ®
var previd = null;

function displaysub(subid) 
{
	if (previd != null) 
	{
		if (previd != subid) 
		{
			previd.style.display = "none";
		}
	}

	if (subid.style.display == "none") 
	{
		subid.style.display = "block";
	} 
	else 
	{
		subid.style.display = "none";
	}
	previd = subid;
}


// °´Ã¼»ý¼º

function createXMLHttpRequest() {
	var reqHttp;
	if (window.ActiveXObject) {
		try {
			reqHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e) {
			try	{
				reqHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e1){
				reqHttp = null;
			}
		}
		
	} else if (window.XMLHttpRequest) {
		try {
			reqHttp = new XMLHttpRequest();
		}catch (e){
			reqHttp = null;
		}		
	}	
	return reqHttp;
}

// openPopup /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function openPopup(goUrl, PName, PWidth, PHeight, PScroll)
{
	var winLeft	= (screen.width - PWidth) / 2;
	var winTop	= (screen.height - PHeight) / 2;
	
	window.open(goUrl, PName, 'width='+PWidth+',height='+PHeight+',statusbar=no,scrollbars='+PScroll+',toolbar=no,resizable=no,left='+winLeft+',top='+winTop);
}

// PrintPopup /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function PrintPopup(goUrl, PWidth, PHeight)
{
	var winLeft	= (screen.width - PWidth) / 2;
	var winTop	= (screen.height - PHeight) / 2;
	
	window.open(goUrl, 'popup', 'width='+PWidth+',height='+PHeight+',statusbar=no,scrollbars=yes,toolbar=no,resizable=no,left='+winLeft+',top='+winTop);
}


// ¼ýÀÚ¸¸ ÀÔ·Â ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// »ç¿ë : <input type='text' name='name' maxLength=10 onKeyDown="JavaScript:onlyNumber(this);">
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////s
function onlyNumber(inbuf)
{
var e = window.event;

	if (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode == 8 || e.keyCode == 46 || e.keyCode >= 35 && e.keyCode <= 39 || e.keyCode == 9)
	{
		if (e.keyCode == 48 || e.keyCode == 96)
		{
//			if (inbuf.value == '')
//				e.returnValue = false;
//			else
				return;
		} else
			return;
	} else
		e.returnValue = false;
}


/*  Function Equivalent to java.net.URLEncoder.encode(String, "UTF-8")
	 Copyright (C) 2002, Cresc Corp.
	 Version: 1.0
 */
 function encodeURL(str){
	 var s0, i, s, u;
	 s0 = "";                // encoded str
	 for (i = 0; i < str.length; i++){   // scan the source
		 s = str.charAt(i);
		 u = str.charCodeAt(i);          // get unicode of the char
		 if (s == " "){s0 += "+";}       // SP should be converted to "+"
		 else {
			 if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))){       // check for escape
				 s0 = s0 + s;            // don't escape
			 }
			 else {                  // escape
				 if ((u >= 0x0) && (u <= 0x7f)){     // single byte format
					 s = "0"+u.toString(16);
					 s0 += "%"+ s.substr(s.length-2);
				 }
				 else if (u > 0x1fffff){     // quaternary byte format (extended)
					 s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
					 s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
					 s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					 s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				 }
				 else if (u > 0x7ff){        // triple byte format
					 s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
					 s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					 s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				 }
				 else {                      // double byte format
					 s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
					 s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				 }
			 }
		 }
	 }
	 return s0;
 }

/*  Function Equivalent to java.net.URLDecoder.decode(String, "UTF-8")
	 Copyright (C) 2002, Cresc Corp.
	 Version: 1.0
 */
 function decodeURL(str){
	 var s0, i, j, s, ss, u, n, f;
	 s0 = "";                // decoded str
	 for (i = 0; i < str.length; i++){   // scan the source str
		 s = str.charAt(i);
		 if (s == "+"){s0 += " ";}       // "+" should be changed to SP
		 else {
			 if (s != "%"){s0 += s;}     // add an unescaped char
			 else{               // escape sequence decoding
				 u = 0;          // unicode of the character
				 f = 1;          // escape flag, zero means end of this sequence
				 while (true) {
					 ss = "";        // local str to parse as int
						 for (j = 0; j < 2; j++ ) {  // get two maximum hex characters for parse
							 sss = str.charAt(++i);
							 if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f"))  || ((sss >= "A") && (sss <= "F"))) {
								 ss += sss;      // if hex, add the hex character
							 } else {--i; break;}    // not a hex char., exit the loop
						 }
					 n = parseInt(ss, 16);           // parse the hex str as byte
					 if (n <= 0x7f){u = n; f = 1;}   // single byte format
					 if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}   // double byte format
					 if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}   // triple byte format
					 if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}   // quaternary byte format (extended)
					 if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}         // not a first, shift and add 6 lower bits
					 if (f <= 1){break;}         // end of the utf byte sequence
					 if (str.charAt(i + 1) == "%"){ i++ ;}                   // test for the next shift byte
					 else {break;}                   // abnormal, format error
				 }
			 s0 += String.fromCharCode(u);           // add the escaped character
			 }
		 }
	 }
	 return s0;
 }

 
//ID Ã£±â Ã¼Å©
function idcheck(obj)
{
	var comp = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
	var str = Trim(obj.value);
	var len = str.length;

	if (len > 0) {
		for(i=0;i<len;i++) {
			if (comp.indexOf(str.substring(i,i+1))<0) {
				alert("Çã¿ëµÈ ¹®ÀÚ°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
				obj.focus();
				return false;
			}
		}

		if (len <4) {
			alert("¾ÆÀÌµð´Â 4ÀÚÀÌ»óÀÔ´Ï´Ù.");
			obj.focus();
			return false;
/*
		} else if (len > 12) {
			alert("¾ÆÀÌµð´Â 12ÀÚÀÌÇÏÀÔ´Ï´Ù.");
			obj.focus();
			return false;
		}
*/
		} else if (len > 8) {
			alert("¾ÆÀÌµð´Â 8ÀÚÀÌÇÏÀÔ´Ï´Ù.");
			obj.focus();
			return false;
		}
	}

	if(str == ""){
		alert("¸ÕÀú ¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}

	return true;
}

//PW ÀÔ·Â Ã¼Å©
function pwcheck(obj,msg)
{
	var comp = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
	var str = Trim(obj.value);
	var len = str.length;

	if (len > 0) {
		for(i=0;i<len;i++) {
			if (comp.indexOf(str.substring(i,i+1))<0) {
				alert("Çã¿ëµÈ ¹®ÀÚ°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
				obj.focus();
				return false;
			}
		}

		if (len <4) {
			alert(msg + "´Â(Àº) 4ÀÚÀÌ»óÀÔ´Ï´Ù.");
			obj.focus();
			return false;
		} else if (len > 8) {
			alert(msg + "´Â(Àº) 8ÀÚÀÌÇÏÀÔ´Ï´Ù.");
			obj.focus();
			return false;
		}
	}

	if(str == ""){
		alert(msg + "¸¦(À») ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}

	return true;
}

//ID Ã£±â Ã¼Å©(¿µ¹®¹öÁ¯)
function idcheck2(obj)
{
	var comp = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
	var str = Trim(obj.value);
	var len = str.length;

	if (len > 0) {
		for(i=0;i<len;i++) {
			if (comp.indexOf(str.substring(i,i+1))<0) {
				alert("Çã¿ëµÈ ¹®ÀÚ°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
				obj.focus();
				return false;
			}
		}

		if (len <4) {
			alert("ID is the 4 characters Awards.");
			obj.focus();
			return false;
		} else if (len > 8) {
			alert("ID is 8 characters or less.");
			obj.focus();
			return false;
		}
	}

	if(str == ""){
		alert("Enter the ID.");
		obj.focus();
		return false;
	}

	return true;
}

//************************ Selection Function
function SelOpt(selObj, pvalue, opt)
{
	if (selObj)
	{
		for (var i=0; i<selObj.options.length; i++)
		{
			var tval;

			if (opt==1)	tval = selObj.options[i].text;
			else		tval = selObj.options[i].value;

			if (tval==pvalue)
			{
				selObj.options[i].selected = true;
				return;
			}
		}
	}
}
function SelRdo(rdoObj, pvalue)
{
	if (rdoObj)
	{
		if (rdoObj.length)
		{
			for (var i=0; i<rdoObj.length; i++)
			{
				if (rdoObj[i].value==pvalue)
				{
					rdoObj[i].checked=true;
					return;
				}
			}
		}
	}
}
function SelChk(chkObj, pvalues)
{
	// Init
	for (var i=0; i<chkObj.length; i++)
	{
		chkObj[i].checked=false;
	}

	//---------------------
	pvalues=Trim(pvalues);
	if (pvalues=="") return;

	var ar_values=pvalues.split(",");

	for (var i=0; i<ar_values.length; i++)
	{
		ar_values[i]=Trim(ar_values[i]);
	}

	if (chkObj)
	{
		if (chkObj.length)
		{
			for (var i=0; i<chkObj.length; i++)
			{
				if (ar_values.indexOf(chkObj[i].value)>-1)
				{
					chkObj[i].checked=true;
				}
			}
		}
		else
		{
			if (ar_values.indexOf(chkObj.value)>-1)
			{
				chkObj.checked=true;
			}
		}
	}
}
Array.prototype.indexOf=function(pVal) {
	for (var i=0; i<this.length; i++)
	{
		if (this[i]==pVal) return i;
	}
	return -1;
}
function InitRdo(oRdo)
{
	if (oRdo)
	{
		if (oRdo.length)
		{
			for (var i=0; i<oRdo.length; i++)
			{
				oRdo[i].checked=false;
			}
		}
		else
		{
			oRdo.checked=false;
		}
	}
}


// ´Þ·Â ½ÃÀÛ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var target;                                                                    // È£ÃâÇÑ ObjectÀÇ ÀúÀå
var stime;
	document.write("<div id=\"temp_minical\" oncontextmenu='return false' ondragstart='return false' onselectstart='return false' style=\"background:buttonface; margin:0; padding:0;margin-top:2;border-top:0 solid buttonshadow;border-left: 0 solid buttonshadow;border-right: 0 solid buttonshadow;border-bottom:0 solid buttonshadow;width:160;display:none;position: absolute; z-index: 99\"><iframe width='150' height='130' border='0' frameborder=0 ></iframe></div>");
    document.write("<div id=\"minical\" oncontextmenu='return false' ondragstart='return false' onselectstart='return false' style=\"background:buttonface; margin:5; padding:5;margin-top:2;border-top:1 solid buttonshadow;border-left: 1 solid buttonshadow;border-right: 1 solid buttonshadow;border-bottom:1 solid buttonshadow;width:160;display:none;position: absolute; z-index: 99\"></div>");

function Calendar(obj,event) {                                                        // jucke
    var now = obj.value.split("-");
    var x, y;
    
    target = obj;                                                                // Object ÀúÀå;	

    x = (document.layers) ? loc.pageX : event.clientX;
    y = (document.layers) ? loc.pageY : event.clientY;
    
    x = Event.pointer(event).x;                                            // ½ºÅ©·Ñ ¿µ¿ª º¸Á¤
    y = Event.pointer(event).y;

	$('minical').style.top    = (y+7)+"px";
    $('minical').style.left    = (x-50)+"px";
    $('minical').style.display = ($('minical').style.display == "block") ? "none" : "block";

	$('temp_minical').style.top    = (y+7)+"px";
    $('temp_minical').style.left    =(x-50)+"px";
    $('temp_minical').style.display = ($('temp_minical').style.display == "block") ? "none" : "block";

    if (now.length == 3) {                                                        // Á¤È®ÇÑÁö °Ë»ç
        Show_cal(now[0],now[1],now[2]);                                            // ³Ñ¾î¿Â °ªÀ» ³â¿ùÀÏ·Î ºÐ¸®
    } else {
        now = new Date();
        Show_cal(now.getFullYear(), now.getMonth()+1, now.getDate());            // ÇöÀç ³â/¿ù/ÀÏÀ» ¼³Á¤ÇÏ¿© ³Ñ±è.
    }
}
    
function doOver(event) {                                                                // ¸¶¿ì½º°¡ Ä®·»´ÙÀ§¿¡ ÀÖÀ¸¸é
    var el = (document.layers) ? loc : event;
    cal_Day = el.title;
	if(cal_Day)
	{
		if (cal_Day.length > 7) {                                                    // ³¯ÀÚ °ªÀÌ ÀÖÀ¸¸é.
		    el.style.borderTopColor = el.style.borderLeftColor = "buttonhighlight";
		    el.style.borderRightColor = el.style.borderBottomColor = "buttonshadow";
		}
	}
    window.clearTimeout(stime);                                                    // Clear
}

function doClick(event) {                                                            // ³¯ÀÚ¸¦ ¼±ÅÃÇÏ¿´À» °æ¿ì
	 var el = (document.layers) ? loc : event;
    cal_Day = el.title;
    el.style.borderColor = "red";                            // Å×µÎ¸® »öÀ» »¡°£»öÀ¸·Î
	if(cal_Day)
	{
		if (cal_Day.length > 7) {                                                    // ³¯ÀÚ °ªÀÌÀÖÀ¸¸é
			target.value= cal_Day.substr(0,4) + "-" + cal_Day.substr(4,2) +  "-" + cal_Day.substr(6,2)     // °ª ¼³Á¤
		}
	}
    $('minical').style.display='none';                                                // È­¸é¿¡¼­ Áö¿ò
    $('temp_minical').style.display='none';                                                // È­¸é¿¡¼­ Áö¿ò
}

function doOut(event) {
    var el = (document.layers) ? loc : event;
    cal_Day = el.title;
	if(cal_Day)
	{
		if (cal_Day.length > 7) {
			el.style.borderColor = "white";
		}
	}
    //stime=window.setTimeout("minical.style.display='none';", 200);
}

function day2(d) {                                                                // 2ÀÚ¸® ¼ýÀÚ·á º¯°æ
    var str = new String();
    
    if (parseInt(d) < 10) {
        str = "0" + parseInt(d);
    } else {
        str = "" + parseInt(d);
    }
    return str;
}

function Show_cal(sYear, sMonth, sDay) {
    var Months_day = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31)
    var Weekday_name = new Array("ÀÏ", "¿ù", "È­", "¼ö", "¸ñ", "±Ý", "Åä");
    var intThisYear = new Number(), intThisMonth = new Number(), intThisDay = new Number();
    $('minical').innerHTML = "";
    datToday = new Date();                                                    // ÇöÀç ³¯ÀÚ ¼³Á¤
    
    intThisYear = parseInt(sYear);
    intThisMonth = parseInt(sMonth);
    intThisDay = parseInt(sDay);
    
    if (intThisYear == 0) intThisYear = datToday.getFullYear();                // °ªÀÌ ¾øÀ» °æ¿ì
    if (intThisMonth == 0) intThisMonth = parseInt(datToday.getMonth())+1;    // ¿ù °ªÀº ½ÇÁ¦°ª º¸´Ù -1 ÇÑ °ªÀÌ µÅµ¹·Á Áø´Ù.
    if (intThisDay == 0) intThisDay = datToday.getDate();
    
    switch(intThisMonth) {
        case 1:
                intPrevYear = intThisYear -1;
                intPrevMonth = 12;
                intNextYear = intThisYear;
                intNextMonth = 2;
                break;
        case 12:
                intPrevYear = intThisYear;
                intPrevMonth = 11;
                intNextYear = intThisYear + 1;
                intNextMonth = 1;
                break;
        default:
                intPrevYear = intThisYear;
                intPrevMonth = parseInt(intThisMonth) - 1;
                intNextYear = intThisYear;
                intNextMonth = parseInt(intThisMonth) + 1;
                break;
    }

    NowThisYear = datToday.getFullYear();                                        // ÇöÀç ³â
    NowThisMonth = datToday.getMonth()+1;                                        // ÇöÀç ¿ù
    NowThisDay = datToday.getDate();                                            // ÇöÀç ÀÏ
    
    datFirstDay = new Date(intThisYear, intThisMonth-1, 1);                        // ÇöÀç ´ÞÀÇ 1ÀÏ·Î ³¯ÀÚ °´Ã¼ »ý¼º(¿ùÀº 0ºÎÅÍ 11±îÁöÀÇ Á¤¼ö(1¿ùºÎÅÍ 12¿ù))
    intFirstWeekday = datFirstDay.getDay();                                        // ÇöÀç ´Þ 1ÀÏÀÇ ¿äÀÏÀ» ±¸ÇÔ (0:ÀÏ¿äÀÏ, 1:¿ù¿äÀÏ)
    
    intSecondWeekday = intFirstWeekday;
    intThirdWeekday = intFirstWeekday;
    
    datThisDay = new Date(intThisYear, intThisMonth, intThisDay);                // ³Ñ¾î¿Â °ªÀÇ ³¯ÀÚ »ý¼º
    intThisWeekday = datThisDay.getDay();                                        // ³Ñ¾î¿Â ³¯ÀÚÀÇ ÁÖ ¿äÀÏ

    varThisWeekday = Weekday_name[intThisWeekday];                                // ÇöÀç ¿äÀÏ ÀúÀå
    
    intPrintDay = 1                                                                // ´ÞÀÇ ½ÃÀÛ ÀÏÀÚ
    secondPrintDay = 1
    thirdPrintDay = 1
    
    Stop_Flag = 0
    
    if ((intThisYear % 4)==0) {                                                    // 4³â¸¶´Ù 1¹øÀÌ¸é (»ç·Î³ª´©¾î ¶³¾îÁö¸é)
        if ((intThisYear % 100) == 0) {
            if ((intThisYear % 400) == 0) {
                Months_day[2] = 29;
            }
        } else {
            Months_day[2] = 29;
        }
    }
    intLastDay = Months_day[intThisMonth];                                        // ¸¶Áö¸· ÀÏÀÚ ±¸ÇÔ
    Stop_flag = 0
    
    Cal_HTML = "<TABLE WIDTH=150 BORDER=0 CELLPADDING=0 CELLSPACING=0 ONMOUSEOVER=doOver(event); ONMOUSEOUT=doOut(event); STYLE='border:1px solid #ddd;font-size:8pt;font-family:Tahoma;'>"
            + "<TR ALIGN=CENTER><TD COLSPAN=7 nowrap=nowrap ALIGN=CENTER><SPAN TITLE='ÀÌÀü´Þ' STYLE=cursor:hand; onClick='Show_cal("+intPrevYear+","+intPrevMonth+","+intThisDay+");'><FONT COLOR=Navy>¢¸</FONT></SPAN> "
            + "<B STYLE=color:red>"+get_Yearinfo(intThisYear,intThisMonth,intThisDay)+"³â"+get_Monthinfo(intThisYear,intThisMonth,intThisDay)+"¿ù</B>"
            + " <SPAN TITLE='´ÙÀ½´Þ' STYLE=cursor:hand; onClick='Show_cal("+intNextYear+","+intNextMonth+","+intThisDay+");'><FONT COLOR=Navy>¢º</FONT></SPAN></TD></TR>"
            + "<TR ALIGN=CENTER BGCOLOR=ThreedFace STYLE='color:White;font-weight:bold;'><TD>ÀÏ</TD><TD>¿ù</TD><TD>È­</TD><TD>¼ö</TD><TD>¸ñ</TD><TD>±Ý</TD><TD>Åä</TD></TR>";
            
    for (intLoopWeek=1; intLoopWeek < 7; intLoopWeek++) {                        // ÁÖ´ÜÀ§ ·çÇÁ ½ÃÀÛ, ÃÖ´ë 6ÁÖ
        Cal_HTML += "<TR ALIGN=RIGHT BGCOLOR=WHITE>"
        for (intLoopDay=1; intLoopDay <= 7; intLoopDay++) {                        // ¿äÀÏ´ÜÀ§ ·çÇÁ ½ÃÀÛ, ÀÏ¿äÀÏ ºÎÅÍ
            if (intThirdWeekday > 0) {                                            // Ã¹ÁÖ ½ÃÀÛÀÏÀÌ 1º¸´Ù Å©¸é
                Cal_HTML += "<TD onClick=doClick(event);>";
                intThirdWeekday--;
            } else {
                if (thirdPrintDay > intLastDay) {                                // ÀÔ·Â ³¯Â¦ ¿ù¸»º¸´Ù Å©´Ù¸é
                    Cal_HTML += "<TD onClick=doClick(event);>";
                } else {                                                        // ÀÔ·Â³¯Â¥°¡ ÇöÀç¿ù¿¡ ÇØ´ç µÇ¸é
                  // Cal_HTML += "<TD onClick=doClick(); title="+intThisYear+"-"+day2(intThisMonth).toString()+"-"+day2(thirdPrintDay).toString()+" STYLE=\"cursor:Hand;border:1px solid white;";
				   Cal_HTML += "<TD onClick=doClick(this); title="+intThisYear+day2(intThisMonth).toString()+day2(thirdPrintDay).toString()+" STYLE=\"cursor:Hand;border:1px solid white;";
                    if (intThisYear == NowThisYear && intThisMonth==NowThisMonth && thirdPrintDay==intThisDay) {
                        Cal_HTML += "background-color:cyan;";
                    }
                    
                    switch(intLoopDay) {
                        case 1:                                                    // ÀÏ¿äÀÏÀÌ¸é »¡°£ »öÀ¸·Î
                            Cal_HTML += "color:red;"
                            break;
                        case 7:
                            Cal_HTML += "color:blue;"
                            break;
                        default:
                            Cal_HTML += "color:black;"
                            break;
                    }
                    
                    Cal_HTML += "\">"+thirdPrintDay;
                    
                }
                thirdPrintDay++;
                
                if (thirdPrintDay > intLastDay) {                                // ¸¸¾à ³¯Â¥ °ªÀÌ ¿ù¸» °ªº¸´Ù Å©¸é ·çÇÁ¹® Å»Ãâ
                    Stop_Flag = 1;
                }
            }
            Cal_HTML += "</TD>";
        }
        Cal_HTML += "</TR>";
        if (Stop_Flag==1) break;
    }
    Cal_HTML += "</TABLE>";

    $('minical').innerHTML = Cal_HTML;
}

function get_Yearinfo(year,month,day) {                                            // ³â Á¤º¸¸¦ ÄÞº¸ ¹Ú½º·Î Ç¥½Ã
    var min = parseInt(year) - 100;
    var max = parseInt(year) + 10;
    var i = new Number();
    var str = new String();
    
    str = "<SELECT onChange='Show_cal(this.value,"+month+","+day+");' ONMOUSEOVER=doOver(event);>";
    for (i=min; i<=max; i++) {
        if (i == parseInt(year)) {
            str += "<OPTION VALUE="+i+" selected ONMOUSEOVER=doOver(event);>"+i+"</OPTION>";
        } else {
            str += "<OPTION VALUE="+i+" ONMOUSEOVER=doOver(event);>"+i+"</OPTION>";
        }
    }
    str += "</SELECT>";
    return str;
}


function get_Monthinfo(year,month,day) {                                        // ¿ù Á¤º¸¸¦ ÄÞº¸ ¹Ú½º·Î Ç¥½Ã
    var i = new Number();
    var str = new String();
    
    str = "<SELECT onChange='Show_cal("+year+",this.value,"+day+");' ONMOUSEOVER=doOver(event);>";
    for (i=1; i<=12; i++) {
        if (i == parseInt(month)) {
            str += "<OPTION VALUE="+i+" selected ONMOUSEOVER=doOver(event);>"+i+"</OPTION>";
        } else {
            str += "<OPTION VALUE="+i+" ONMOUSEOVER=doOver(event);>"+i+"</OPTION>";
        }
    }
    str += "</SELECT>";
    return str;
}

function checkEvent(event) {
    if (!event) { //IEÀÏ °æ¿ì
      event = window.event;
      event.target = event.srcElement;
    }
    return event;
  }
// ´Þ·Â ³¡////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//************************// Selection Function

function replaceAll( str, from, to) {
	var idx = str.indexOf(from);
	while (idx > -1){
		str = str.replace(from, to);
		idx = str.indexOf(from);
	}
	return str;
}




// String Left ÇÔ¼ö
function Left(str, n){
	if (n <= 0)
		return "";
	else if (n > String(str).length)
		return str;
	else
		return String(str).substring(0,n);
}

// String Right ÇÔ¼ö
function Right(str, n){
	if (n <= 0)
	   return "";
	else if (n > String(str).length)
	   return str;
	else {
	   var iLen = String(str).length;
	   return String(str).substring(iLen, iLen - n);
	}
}

// Replace ÇÔ¼ö
function ReplaceStr(strOriginal, strFind, strChange) {
  return strOriginal.split(strFind).join(strChange);
}


// ÆË¾÷Ã¢ ÀÚµ¿ ¸®»çÀÌÁî
// ÆË¾÷Ã¢¿¡¼­ window.onload = popupResize;
// ¿Â·Îµå ÀÌº¥Æ®¸¦ ÀÌ¹Ì »ç¿ëÇÏ°í ÀÖÀ¸¸é 
//	window.onload = function() {
//		popupResize();	// Ãß°¡
//	}
///¹öÀü Ã¼Å© Ãß°¡
	var strAgent = navigator.userAgent.toLowerCase();
	var intFirstPos = strAgent.indexOf("msie");
	var strVersion = strAgent.substr(intFirstPos+5,1);

function popupResize()
{
	if (strVersion == 6){
		var innerBody = document.body;
		var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight) + 55;
		var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth) + 10;
		window.resizeTo(innerWidth,innerHeight);
	}else if (strVersion == 7){
		var innerBody = document.body;
		var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight) + 70;
		var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth) + 10 ;
		window.resizeTo(innerWidth,innerHeight);
	}else{
		var Dwidth = parseInt(document.body.scrollWidth);
		var Dheight = parseInt(document.body.scrollHeight);
		var divEl = document.createElement("div");
		divEl.style.position = "absolute";
		divEl.style.left = "0px";
		divEl.style.top = "0px";
		divEl.style.width = "100%";
		divEl.style.height = "100%";
	    document.body.appendChild(divEl);
	    window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
		document.body.removeChild(divEl);
	}
}

function popResizeTo(pWidth, pHeight, pMinHeight) {
	var vWinTop = window.screenTop-29;
	var vWinLeft = window.screenLeft-3;

	if (pHeight < pMinHeight) pHeight = pMinHeight;

	// È­¸é °æ°è¼±À» °í·ÁÇÏ¿© ÆË¾÷À©µµ¿ìÀÇ À§Ä¡¸¦ Á¶Á¤(ÆË¾÷À©µµ¿ì¸¦ ÇÊ¿äÇÑ¸¸Å­ À§·Î ¿Å±ä´Ù)
	var alpha = vWinTop + pHeight - screen.availHeight;

	if (alpha > 0) {
		window.moveTo(vWinLeft, vWinTop-alpha);
	}

	// ÆË¾÷À©µµ¿ì ÀÌµ¿
	window.resizeTo(pWidth,pHeight);
}



/* 
	family site 
	2010-05-06
	¹ÚÈ¿Á¤
*/
function u_initLayers(id,seq) {
	nav = document.getElementById(id);
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	
	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
			if(this.firstChild.src.indexOf("_on.gif")==-1)	this.firstChild.src=this.firstChild.src.replace(".gif", "_on.gif");
			
		}

		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						/*nav.current = null;*/
					}	
				}
			}, 200);
			if(this.parentNode.parentNode.id!=id)	this.firstChild.src=this.firstChild.src.replace("_on.gif", ".gif");	
		}
	}
	
	var i;
	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "_on.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}



/*
function initNavigation(id,seq) {
	var nav = document.getElementById(id);
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	
	allA = nav.getElementsByTagName("a")
	//alert("allA.length" + allA.length);
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
			if(this.firstChild.src.indexOf("_on.gif")==-1)	this.firstChild.src=this.firstChild.src.replace("_off.gif", "_on.gif");
			
		}

		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_on.gif", "_off.gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
					
					}	
				}
			}, 200);
			if(this.parentNode.parentNode.id!=id)	this.firstChild.src=this.firstChild.src.replace("_on.gif", "_off.gif");	
		}
	}
	
	var i;
	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on.gif", "_off.gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_off.gif", "_on.gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}

*/