
/*
function 1  ---> TO
function 2  ---> FROM
ÇÏ´Â ÀÏÀº °°Áö¸¸ ¼­·Î µ¿½Ã¿¡ ´Ù¸£°Ô µ¿ÀÛ ÇØ¾ß ÇÏ±â ¶§¹®¿¡ ³ª´®
*/
	var context_root = "/home";
	var jsp_root	= "";

	var dDate = new Date();
	var dCurMonth = dDate.getMonth();
	var dCurDayOfMonth = dDate.getDate();
	var dCurYear = dDate.getFullYear();
	var objPrevElement1 = new Object();
	var objPrevElement2 = new Object();
	var objPrevElement3 = new Object();
	var divFlag = false;
	var divFlag2 = false;
	var divFlag3 = false;

// ¼±ÅÃ ³¯Â¥¸¦ ¼¼ÆÃ ÇÑ´Ù.
	function fSetSelectedDay1(myElement){ // ( ÇØ´ç ³¯Â¥, ³¯Â¥¸¦ ¼¼ÆÃ ÇÒ¶§ 0À» ºÙ¿© ÁÙÁö ¿©ºÎ¸¦ ÆÇ´Ü ÇÑ´Ù.)
		if (myElement.id == "calCel1") {
			if (!isNaN(parseInt(myElement.children["calDateText1"].innerText))) {
				document.all.calSelectedDate1.value = parseInt(myElement.children["calDateText1"].innerText);
				var today = dCurYear+"³â"+(dCurMonth+1)+"¿ù"+dCurDayOfMonth+"ÀÏ";
				var month_real = dCurMonth+1;
				if(LayerCal1.next == null || LayerCal1.next != '1'){
	                if(document.all.tbSelYear1.value*1 > dCurYear){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ³âµµ¸¦ ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear1.value*1 == dCurYear && document.all.tbSelMonth1.value*1 > month_real){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ´ÞÀ» ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear1.value*1 == dCurYear && document.all.tbSelMonth1.value*1 == month_real && document.all.calSelectedDate1.value*1 > dCurDayOfMonth){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ³¯Â¥¸¦ ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
				}
				else{
	                if(document.all.tbSelYear1.value*1 < dCurYear){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³âµµ¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear1.value*1 == dCurYear && document.all.tbSelMonth1.value*1 < month_real){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ´ÞÀ» ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear1.value*1 == dCurYear && document.all.tbSelMonth1.value*1 == month_real && document.all.calSelectedDate1.value*1 < dCurDayOfMonth){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³¯Â¥¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
				}

				myElement.bgColor = "#a29db0";
				objPrevElement1.bgColor = "";
				document.all.START_YEAR.value=document.all.tbSelYear1.value;
				if(LayerCal1.plus == "0"){
					if(document.all.tbSelMonth1.value.length == 1){
                		document.all.START_MONTH.value=0 + document.all.tbSelMonth1.value;
					}else{
						document.all.START_MONTH.value=document.all.tbSelMonth1.value;
					}
					if(document.all.calSelectedDate1.value.length == 1){
						document.all.START_DAY.value=0 + document.all.calSelectedDate1.value;
					}else{
						document.all.START_DAY.value=document.all.calSelectedDate1.value;
					}
				}else{
					document.all.START_MONTH.value=document.all.tbSelMonth1.value;
					document.all.START_DAY.value=document.all.calSelectedDate1.value;
				}

				document.all["LayerCal1"].style.visibility='hidden';
				objPrevElement = myElement;
			}
		}
	}

	function fSetSelectedDay2(myElement){
		if (myElement.id == "calCel2") {
			if (!isNaN(parseInt(myElement.children["calDateText2"].innerText))) {

				document.all.calSelectedDate2.value = parseInt(myElement.children["calDateText2"].innerText);
				var today = dCurYear+"³â"+(dCurMonth+1)+"¿ù"+dCurDayOfMonth+"ÀÏ";
				var month_real = dCurMonth+1;
				if(LayerCal2.next == null || LayerCal2.next != '1'){
	                if(document.all.tbSelYear2.value*1 > dCurYear){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ³âµµ¸¦ ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear2.value*1 == dCurYear && document.all.tbSelMonth2.value*1 > month_real){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ´ÞÀ» ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear2.value*1 == dCurYear && document.all.tbSelMonth2.value*1 == month_real && document.all.calSelectedDate2.value*1 > dCurDayOfMonth){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù"+"ÇöÀç ³¯Â¥¸¦ ÃÊ°ú ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
				}
				else {
	                if(document.all.tbSelYear2.value*1 < dCurYear){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³âµµ¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear2.value*1 == dCurYear && document.all.tbSelMonth2.value*1 < month_real){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ´ÞÀ» ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
					if(document.all.tbSelYear2.value*1 == dCurYear && document.all.tbSelMonth2.value*1 == month_real && document.all.calSelectedDate2.value*1 < dCurDayOfMonth){
						alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³¯Â¥¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
						return;
					}
				}

                myElement.bgColor = "#a29db0";
				objPrevElement2.bgColor = "";
				document.all.END_YEAR.value=document.all.tbSelYear2.value;
                if(LayerCal2.plus == "0"){
					if(document.all.tbSelMonth2.value.length == 1){
                			document.all.END_MONTH.value=0 + document.all.tbSelMonth2.value;
					}else{
						document.all.END_MONTH.value=document.all.tbSelMonth2.value;
					}
					if(document.all.calSelectedDate2.value.length == 1){
						document.all.END_DAY.value=0 + document.all.calSelectedDate2.value;
					}else{
						document.all.END_DAY.value=document.all.calSelectedDate2.value;
					}
				}else{
					document.all.END_MONTH.value=document.all.tbSelMonth2.value;
					document.all.END_DAY.value=document.all.calSelectedDate2.value;
				}

				document.all["LayerCal2"].style.visibility='hidden';
				objPrevElement2 = myElement;
			}
		}
	}

	function fSetSelectedDay3(myElement){ // ¹Ì·¡ÀÇ ³¯Â¥µµ ¼±ÅÃÀÌ °¡´ÉÇÏµµ·Ï ÇÑ´Ù.
		if (!isNaN(parseInt(myElement.children["calDateText3"].innerText))) {
			document.all.calSelectedDate3.value = parseInt(myElement.children["calDateText3"].innerText);
			var today = dCurYear+"³â"+(dCurMonth+1)+"¿ù"+dCurDayOfMonth+"ÀÏ";
			var month_real = dCurMonth+1;
			if(LayerCal3.next == null || LayerCal3.next != '1'){
			}
			else{
                if(document.all.tbSelYear3.value*1 < dCurYear){
					alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³âµµ¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
					return;
				}
				if(document.all.tbSelYear3.value*1 == dCurYear && document.all.tbSelMonth3.value*1 < month_real){
					alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ´ÞÀ» ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
					return;
				}
				if(document.all.tbSelYear3.value*1 == dCurYear && document.all.tbSelMonth3.value*1 == month_real && document.all.calSelectedDate3.value*1 < dCurDayOfMonth){
					alert("¿À´Ã ³¯Â¥´Â"+today+"ÀÔ´Ï´Ù."+" ÀÌÀü ³¯Â¥¸¦ ¼±ÅÃ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù.");
					return;
				}
			}

			myElement.bgColor = "#a29db0";
			objPrevElement3.bgColor = "";
			document.all.START_YEAR.value=document.all.tbSelYear3.value;
			if(LayerCal3.plus == "0"){
				if(document.all.tbSelMonth3.value.length == 1){
            		document.all.START_MONTH.value=0 + document.all.tbSelMonth3.value;
				}else{
					document.all.START_MONTH.value=document.all.tbSelMonth3.value;
				}
				if(document.all.calSelectedDate3.value.length == 1){
					document.all.START_DAY.value=0 + document.all.calSelectedDate3.value;
				}else{
					document.all.START_DAY.value=document.all.calSelectedDate3.value;
				}
			}else{
				document.all.START_MONTH.value=document.all.tbSelMonth3.value;
				document.all.START_DAY.value=document.all.calSelectedDate3.value;
			}

			document.all["LayerCal3"].style.visibility='hidden';
			objPrevElement = myElement;
		}
	}

	function fGetDaysInMonth(iMonth, iYear) {
		var dPrevDate = new Date(iYear, iMonth, 0);
		return dPrevDate.getDate();
	}

	function fBuildCal(iYear, iMonth, iDayStyle) {
		var aMonth = new Array();
		aMonth[0] = new Array(7);
		aMonth[1] = new Array(7);
		aMonth[2] = new Array(7);
		aMonth[3] = new Array(7);
		aMonth[4] = new Array(7);
		aMonth[5] = new Array(7);
		aMonth[6] = new Array(7);
		var dCalDate = new Date(iYear, iMonth-1, 1);
		var iDayOfFirst = dCalDate.getDay();
		var iDaysInMonth = fGetDaysInMonth(iMonth, iYear);
		var iVarDate = 1;
		var i, d, w;
		if (iDayStyle == 2) {
			aMonth[0][0] = "Sunday";
			aMonth[0][1] = "Monday";
			aMonth[0][2] = "Tuesday";
			aMonth[0][3] = "Wednesday";
			aMonth[0][4] = "Thursday";
			aMonth[0][5] = "Friday";
			aMonth[0][6] = "Saturday";
		} else if (iDayStyle == 1) {
			aMonth[0][0] = "ÀÏ";
			aMonth[0][1] = "¿ù";
			aMonth[0][2] = "È­";
			aMonth[0][3] = "¼ö";
			aMonth[0][4] = "¸ñ";
			aMonth[0][5] = "±Ý";
			aMonth[0][6] = "Åä";
		} else {
			aMonth[0][0] = "Su";
			aMonth[0][1] = "Mo";
			aMonth[0][2] = "Tu";
			aMonth[0][3] = "We";
			aMonth[0][4] = "Th";
			aMonth[0][5] = "Fr";
			aMonth[0][6] = "Sa";
		}
		for (d = iDayOfFirst; d < 7; d++) {
			aMonth[1][d] = iVarDate;
			iVarDate++;
		}
		for (w = 2; w < 7; w++) {
			for (d = 0; d < 7; d++) {
				if (iVarDate <= iDaysInMonth) {
					aMonth[w][d] = iVarDate;
					iVarDate++;
				}
			}
		}
		return aMonth;
	}

	function drawOneCal(iYear, iMonth, iCellWidth, iCellHeight, sDateTextSize, sDateTextWeight, iDayStyle, num) {
		document.write("<input type=hidden name=calSelectedDate"+num +" value=''>");
		document.write("<table border=0 cellspacing=0 cellpadding=1 width=200>");
		document.write("<tr bgcolor=#4d495b>");
		document.write("<td>");
		document.write("<table border=0 cellspacing=1 cellpadding=1 width=100%>");
		document.write("<tr>");
		document.write("<td bgcolor=#FFFDDC align=center valign=top width=66>");
		document.write("<table border=0 cellspacing=0 cellpadding=0>");
		document.write("<tr><td align=center nowrap>");
		document.write("<a href=\"javascript:yearChange"+num+"('back')\" style='text-decoration:none;font-weight: bold'>&lt;</a>&nbsp;");
		document.write("<input align=center size=4 type=text name=tbSelYear"+num +" value='"+dCurYear + "' style='border=0;background-color:#FFFDDC;font-weight: bold'>&nbsp;<a href=\"javascript:yearChange"+num+"('forward')\" style='text-decoration:none;FONT-WEIGHT: bold'>&gt;</a>");

		document.write("</td></tr><tr><td align=center><select name=tbSelMonth"+num+ " onchange='fUpdateCal"+num + " (form1.tbSelYear"+num+".value, form1.tbSelMonth"+num+".value)' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:12px;background-color:#FFFDDC'>");
		document.write("	<option value='1'>1</option>");
		document.write("	<option value='2'>2</option>");
		document.write("	<option value='3'>3</option>");
		document.write("	<option value='4'>4</option>");
		document.write("	<option value='5'>5</option>");
		document.write("	<option value='6'>6</option>");
		document.write("	<option value='7'>7</option>");
		document.write("	<option value='8'>8</option>");
		document.write("	<option value='9'>9</option>");
		document.write("	<option value='10'>10</option>");
		document.write("	<option value='11'>11</option>");
		document.write("	<option value='12'>12</option>");
		document.write("</select>");
		document.write("</td></tr>");
		document.write("<tr><td align=left valign=bottom height=58>&nbsp;");
		document.write("<a href='javascript:showCarDiv"+num+"()'>´Ý±â</a>");
		document.write("</td></tr></table>");
		document.write("</td>");
		document.write("<td bgcolor='#FFFFFF'>");

		var myMonth;
		myMonth = fBuildCal(iYear, iMonth, iDayStyle);
		document.write("<table border='0'>")
		document.write("<tr bgcolor=#FFFFFF>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=red>" + myMonth[0][0] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=#4D495B>" + myMonth[0][1] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=#4D495B>" + myMonth[0][2] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=#4D495B>" + myMonth[0][3] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=#4D495B>" + myMonth[0][4] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=#4D495B>" + myMonth[0][5] + "</font></td>");
		document.write("<td align='center' style='FONT-FAMILY:µ¸¿ò;FONT-SIZE:11px;FONT-WEIGHT: bold'><font color=blue>" + myMonth[0][6] + "</font></td>");
		document.write("</tr>");
		for (w = 1; w < 7; w++) {
			document.write("<tr>")
			for (d = 0; d < 7; d++) {
					if (!isNaN(myMonth[w][d])) { // blank check
						if(dCurDayOfMonth == myMonth[w][d]){ // ¿À´Ã ³¯Â¥ Ç¥½Ã
							document.write("<td bgcolor='blue' align='center' valign='top' width='" + iCellWidth + "' height='" + iCellHeight + "' id=calCel"+num+" onclick=fSetSelectedDay"+num+"(this)>");
							document.write("<font id=calDateText" + num+" color='white' style='CURSOR:Hand;FONT-FAMILY:±¼¸²;line-height: 7pt;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "'>" + myMonth[w][d] + "</font>");
						}else{
							document.write("<td align='right' valign='top' width='" + iCellWidth + "' height='" + iCellHeight + "' id=calCel"+num+" onclick=fSetSelectedDay"+num+"(this)>");
							document.write("<font id=calDateText" + num+"  style='CURSOR:Hand;FONT-FAMILY:±¼¸²;line-height: 7pt;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "'>" + myMonth[w][d] + "</font>");
						}
					} else {
						document.write("<td align='right' valign='top' width='" + iCellWidth + "' height='" + iCellHeight + "' id=calCel"+num+" onclick=fSetSelectedDay"+num+"(this)>");
						document.write("<font id=calDateText" + num+"  style='CURSOR:Hand;FONT-FAMILY:±¼¸²;line-height: 7pt;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "'</font>");
					}

				document.write("</td>")
			}
			document.write("</tr>");
		}
		document.write("</table>")
		document.write("</td>");
		document.write("</tr>");
		document.write("</table>");
		document.write("</td>");
		document.write("</tr>");
		document.write("</table>");
	}

	function fUpdateCal1(iYear, iMonth) {
		myMonth = fBuildCal(iYear, iMonth);
		objPrevElement1.bgColor = "";
		document.all.calSelectedDate1.value = "";
		for (w = 1; w < 7; w++) {
			for (d = 0; d < 7; d++) {
				if (!isNaN(myMonth[w][d])) {
					calDateText1[((7*w)+d)-7].innerText = myMonth[w][d];
				} else {
					calDateText1[((7*w)+d)-7].innerText = " ";
				}
			}
		}
	}

	function fUpdateCal2(iYear, iMonth) {
		myMonth = fBuildCal(iYear, iMonth);
		objPrevElement2.bgColor = "";
		document.all.calSelectedDate2.value = "";
		for (w = 1; w < 7; w++) {
			for (d = 0; d < 7; d++) {
				if (!isNaN(myMonth[w][d])) {
					calDateText2[((7*w)+d)-7].innerText = myMonth[w][d];
				} else {
					calDateText2[((7*w)+d)-7].innerText = " ";
				}
			}
		}
	}

	function fUpdateCal3(iYear, iMonth) {
		myMonth = fBuildCal(iYear, iMonth);
		objPrevElement3.bgColor = "";
		document.all.calSelectedDate3.value = "";
		for (w = 1; w < 7; w++) {
			for (d = 0; d < 7; d++) {
				if (!isNaN(myMonth[w][d])) {
					calDateText3[((7*w)+d)-7].innerText = myMonth[w][d];
				} else {
					calDateText3[((7*w)+d)-7].innerText = " ";
				}
			}
		}
	}

function showCalendar(num,formname, inputname) {
	var url		= context_root + jsp_root + "/common/Calendar.jsp?NUM="+num+"&FORMNAME="+formname+"&INPUTNAME="+inputname+"&DISPLAY=1";	
	document.all("CAL"+num).src = url;
	return ;
}

function showEnCalendar(num,formname, inputname) {
	var url		= context_root + jsp_root + "/common/Calendar.jsp?NUM="+num+"&FORMNAME="+formname+"&INPUTNAME="+inputname+"&DISPLAY=3";	
	document.all("CAL"+num).src = url;
	return ;
}

// layer Ãâ·ÂÀ§Ä¡ Ç¥½Ã
function setPosition(LayerName) {
	if(LayerName == "LayerCal1") {
		document.all["LayerCal1"].style.left = event.x + 10 ;
		document.all["LayerCal1"].style.top  = event.y + 10;
	}else if(LayerName == "LayerCal2"){
		document.all["LayerCal2"].style.left = event.x + 10;
		document.all["LayerCal2"].style.top  = event.y + 10;
	}else if(LayerName == "LayerCal3"){
		document.all["LayerCal3"].style.left = event.x + 10;
		document.all["LayerCal3"].style.top  = event.y + 10;
	}
}

// ´Þ·Â ÀÌ¹ÌÁö¸¦ Å¬¸¯ ÇØ¼­ ´Þ·Â º¸ÀÌ±â ¿©ºÎ °áÁ¤
function showCarDiv1(formname, inputname){//½ÃÀÛ³¯Â¥ ¼³Á¤
	if(divFlag == false){
		document.all["LayerCal1"].style.visibility='visible';
		divFlag = true;
	}else{
		document.all["LayerCal1"].style.visibility='hidden';
		divFlag = false;
	}
	showCalendar('1',formname, inputname);
}

function showCarDiv2(formname, inputname){//Á¾·á³¯Â¥ ¼³Á¤
	if(divFlag2 == false){
		document.all["LayerCal2"].style.visibility='visible';
		divFlag2 = true;
	}else{
		document.all["LayerCal2"].style.visibility='hidden';
		divFlag2 = false;
	}
	showCalendar('2',formname, inputname);
}

function showCarDiv3(formname, inputname){//¹Ì·¡ÀÇ ³¯Â¥ ¼³Á¤¶§ »ç¿ë
	if(divFlag3 == false){
		document.all["LayerCal3"].style.visibility='visible';
		divFlag3 = true;
	}else{
		document.all["LayerCal3"].style.visibility='hidden';
		divFlag3 = false;
	}
	showCalendar('3',formname, inputname);
}

// ´Þ·Â ÀÌ¹ÌÁö¸¦ Å¬¸¯ ÇØ¼­ ´Þ·Â º¸ÀÌ±â ¿©ºÎ °áÁ¤
function showEnCarDiv1(formname, inputname){//½ÃÀÛ³¯Â¥ ¼³Á¤
	if(divFlag == false){
		document.all["LayerCal1"].style.visibility='visible';
		divFlag = true;
	}else{
		document.all["LayerCal1"].style.visibility='hidden';
		divFlag = false;
	}
	showEnCalendar('1',formname, inputname);
}

function showEnCarDiv2(formname, inputname){//Á¾·á³¯Â¥ ¼³Á¤
	if(divFlag2 == false){
		document.all["LayerCal2"].style.visibility='visible';
		divFlag2 = true;
	}else{
		document.all["LayerCal2"].style.visibility='hidden';
		divFlag2 = false;
	}
	showEnCalendar('2',formname, inputname);
}

function showEnCarDiv3(formname, inputname){//¹Ì·¡ÀÇ ³¯Â¥ ¼³Á¤¶§ »ç¿ë
	if(divFlag3 == false){
		document.all["LayerCal3"].style.visibility='visible';
		divFlag3 = true;
	}else{
		document.all["LayerCal3"].style.visibility='hidden';
		divFlag3 = false;
	}
	showEnCalendar('3',formname, inputname);
}

// year°¡ ¹Ù²î ¾úÀ»¶§
function yearChange1(direction){
	if(direction == 'back'){
		document.form1.tbSelYear1.value = eval(document.form1.tbSelYear1.value) - 1;
	}else{
		document.form1.tbSelYear1.value = eval(document.form1.tbSelYear1.value) + 1;
	}
	fUpdateCal1(form1.tbSelYear1.value, form1.tbSelMonth1.value);
}

function yearChange2(direction){
	if(direction == 'back'){
		document.form1.tbSelYear2.value = eval(document.form1.tbSelYear2.value) - 1;
	}else{
		document.form1.tbSelYear2.value = eval(document.form1.tbSelYear2.value) + 1;
	}
	fUpdateCal2(form1.tbSelYear2.value, form1.tbSelMonth2.value);
}

function yearChange3(direction){
	if(direction == 'back'){
		document.form1.tbSelYear3.value = eval(document.form1.tbSelYear3.value) - 1;
	}else{
		document.form1.tbSelYear3.value = eval(document.form1.tbSelYear3.value) + 1;
	}
	fUpdateCal2(form1.tbSelYear3.value, form1.tbSelMonth3.value);
}

// ÆäÀÌÁö ·Îµù½Ã ÇöÀç ³â/¿ù setting
function setCalendar(){
	if(form1.tbSelMonth1 != null) {
		form1.tbSelMonth1.options[dCurDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear1.length; i++)
			if (form1.tbSelYear1.options[i].value == dCurDate.getFullYear())
				form1.tbSelYear1.options[i].selected = true;
	}
	
	if(form1.tbSelMonth2 != null) {
		form1.tbSelMonth2.options[dCurDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear2.length; i++)
			if (form1.tbSelYear2.options[i].value == dCurDate.getFullYear())
				form1.tbSelYear2.options[i].selected = true;
	}

	if(form1.tbSelMonth3 != null) {
		form1.tbSelMonth3.options[dCurDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear3.length; i++)
			if (form1.tbSelYear3.options[i].value == dCurDate.getFullYear())
				form1.tbSelYear3.options[i].selected = true;
	}
}

function initCal(){
	if(form1.tbSelMonth1 != null) {
		form1.tbSelMonth1.options[dDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear1.length; i++)
			if (form1.tbSelYear1.options[i].value == dDate.getFullYear())
				form1.tbSelYear1.options[i].selected = true;
	}

	if (form1.tbSelMonth2 != null) {
		form1.tbSelMonth2.options[dDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear2.length; i++)
			if (form1.tbSelYear2.options[i].value == dDate.getFullYear())
				form1.tbSelYear2.options[i].selected = true;
	}
	
	if (form1.tbSelMonth3 != null) {
		form1.tbSelMonth3.options[dDate.getMonth()].selected = true;
		for (i = 0; i < form1.tbSelYear3.length; i++)
			if (form1.tbSelYear3.options[i].value == dDate.getFullYear())
				form1.tbSelYear3.options[i].selected = true;
	}
	
	setTodayByCal();
}

function setTodayByCal() {
	var		today = new Date();
	document.form1.START_YEAR.value = today.getFullYear();

	document.form1.START_MONTH.value = today.getMonth() + 1;
	if(document.form1.START_MONTH.value.length < 2){
		document.form1.START_MONTH.value = '0' + document.form1.START_MONTH.value;
	}

	document.form1.START_DAY.value = today.getDate();
	if(document.form1.START_DAY.value.length < 2){
		document.form1.START_DAY.value = '0' + document.form1.START_DAY.value;
	}

	document.form1.END_YEAR.value = today.getFullYear();

	document.form1.END_MONTH.value = today.getMonth() + 1;
	if(document.form1.END_MONTH.value.length < 2){
		document.form1.END_MONTH.value = '0' + document.form1.END_MONTH.value;
	}

	document.form1.END_DAY.value = today.getDate();
	if(document.form1.END_DAY.value.length < 2){
		document.form1.END_DAY.value = '0' + document.form1.END_DAY.value;
	}
}

