var yearSelect;
var monthSelect;

function memorialDay(name, month, day, solarLunar, holiday, type) {
	this.name = name;
	this.month = month;
	this.day = day;
	this.solarLunar = solarLunar;
	this.holiday = holiday;	/* true : »¡°£³¯ false : ¾È»¡°£³¯ */
	this.type = type;	/* true : real time setting */
	this.techneer = true;
}

var memorialDays = Array (
	new memorialDay("½ÅÁ¤", 1, 1, 1, true),
	new memorialDay("", 12, 0, 2, true, true),	/* ½Ç½Ã°£À¸·Î Á¤ÇØÁü */
	new memorialDay("¼³³¯", 1, 1, 2, true),
	new memorialDay("", 1, 2, 2, true),
	new memorialDay("»ïÀÏÀý", 3, 1, 1, true),
	new memorialDay("½Ä¸ñÀÏ", 4, 5, 1, true),
	new memorialDay("¼®°¡Åº½ÅÀÏ", 4, 8, 2, true),
	new memorialDay("¾î¸°ÀÌ³¯", 5, 5, 1, true),
	new memorialDay("ÇöÃæÀÏ", 6, 6, 1, true),
	new memorialDay("±¤º¹Àý", 8, 15, 1, true),
	new memorialDay("", 8, 14, 2, true),
	new memorialDay("Ãß¼®", 8, 15, 2, true),
	new memorialDay("", 8, 16, 2, true),
	new memorialDay("°³ÃµÀý", 10, 3, 1, true),
	new memorialDay("¼ºÅºÀý", 12, 25, 1, true),

	new memorialDay("Á¦ÇåÀý", 7, 17, 1, false),
	new memorialDay("Á¤¿ù´ëº¸¸§", 1, 15, 2, false),
	new memorialDay("´Ü¿À", 5, 5, 2, false),
	new memorialDay("±¹±ºÀÇ³¯", 10, 1, 1, false),
	new memorialDay("ÇÑ±Û³¯", 10, 9, 1, false),
	new memorialDay("625ÀüÀïÀÏ", 6, 25, 1, false),
	new memorialDay("»ïÁù³¯", 3, 3, 2, false),
	new memorialDay("¹°ÀÇ³¯", 3, 22, 1, false),
	new memorialDay("¸¸¿ìÀý", 4, 1, 1, false),
	new memorialDay("Àå¾ÖÀÎÀÇ³¯", 4, 20, 1, false),
	new memorialDay("°úÇÐÀÇ³¯", 4, 21, 1 , false),
	new memorialDay("Ãæ¹«°øÅº½ÅÀÏ", 4, 28, 1, false),
	new memorialDay("±Ù·ÎÀÚÀÇ³¯¡¤¹ýÀÇ³¯", 5, 1, 1, false),
	new memorialDay("¾î¹öÀÌ³¯", 5, 8, 1, false),
	new memorialDay("½º½ÂÀÇ³¯", 5, 15, 1, false),
	new memorialDay("¹ß¸íÀÇ³¯", 5, 19, 1, false),
	new memorialDay("¹Ù´ÙÀÇ³¯", 5, 31, 1, false),
	new memorialDay("È¯°æÀÇ³¯", 6, 5, 1, false),
	new memorialDay("À¯µÎ", 6, 15, 2, false),
	new memorialDay("Ä¥¿ùÄ¥¼®", 7, 7, 2, false),
	new memorialDay("Áß¾çÀý", 9, 9, 2, false),
	new memorialDay("Ã¶µµÀÇ³¯", 9, 18, 1, false),
	new memorialDay("¼Ò¹æÀÇ³¯", 11, 9, 1, false),
	
	new memorialDay("ÃÑ¼±", 4, 9, 1, true)
);
	

function myDate(year, month, day, leapMonth)
{
	this.year = year;
	this.month = month;
	this.day = day;
	this.leapMonth = leapMonth;
}

// À½·Â µ¥ÀÌÅÍ (Æò´Þ - ÀÛÀº´Þ :1,  Å«´Þ:2 )
// (À±´ÞÀÌ ÀÖ´Â ´Þ - Æò´ÞÀÌ ÀÛ°í À±´Þµµ ÀÛÀ¸¸é :3 , Æò´ÞÀÌ ÀÛ°í À±´ÞÀÌ Å©¸é : 4)
// (À±´ÞÀÌ ÀÖ´Â ´Þ - Æò´ÞÀÌ Å©°í À±´ÞÀÌ ÀÛÀ¸¸é :5,  Æò´Þ°ú À±´ÞÀÌ ¸ðµÎ Å©¸é : 6)
var lunarMonth = [
[2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
[1, 2, 1, 1, 2, 1, 2, 5, 2, 2, 1, 2],
[1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],   /* 1901 */
[2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
[1, 2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2],
[2, 2, 1,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 1, 1],
[2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1],
[2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],   /* 2041 */
[1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
[1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2]];

/* ¾ç·Â <-> À½·Â º¯È¯ ÇÔ¼ö
 * type : 1 - ¾ç·Â -> À½·Â
 *        2 - À½·Â -> ¾ç·Â
 * leapmonth : 0 - Æò´Þ
 *             1 - À±´Þ (type = 2 ÀÏ¶§¸¸ À¯È¿)
*/ 
function lunarCalc(year, month, day, type, leapmonth)
{

	var solYear, solMonth, solDay;
	var lunYear, lunMonth, lunDay;
	var lunLeapMonth, lunMonthDay;	
	var i, lunIndex;

	var solMonthDay = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

	/* range check */
	if (year < 1900 || year > 2040)
	{
		alert('1900³âºÎÅÍ 2040³â±îÁö¸¸ Áö¿øÇÕ´Ï´Ù');
		return;
	}

	/* ¼Óµµ °³¼±À» À§ÇØ ±âÁØ ÀÏÀÚ¸¦ ¿©·¯°³·Î ÇÑ´Ù */
	if (year >= 2000)
	{
		/* ±âÁØÀÏÀÚ ¾ç·Â 2000³â 1¿ù 1ÀÏ (À½·Â 1999³â 11¿ù 25ÀÏ) */
		solYear = 2000;
		solMonth = 1;
		solDay = 1;
		lunYear = 1999;
		lunMonth = 11;
		lunDay = 25;
		lunLeapMonth = 0;

		solMonthDay[1] = 29;	/* 2000 ³â 2¿ù 28ÀÏ */
		lunMonthDay = 30;	/* 1999³â 11¿ù */
	}
	else if (year >= 1970)
	{
		/* ±âÁØÀÏÀÚ ¾ç·Â 1970³â 1¿ù 1ÀÏ (À½·Â 1969³â 11¿ù 24ÀÏ) */
		solYear = 1970;
		solMonth = 1;
		solDay = 1;
		lunYear = 1969;
		lunMonth = 11;
		lunDay = 24;
		lunLeapMonth = 0;

		solMonthDay[1] = 28;	/* 1970 ³â 2¿ù 28ÀÏ */
		lunMonthDay = 30;	/* 1969³â 11¿ù */
	}
	else if (year >= 1940)
	{
		/* ±âÁØÀÏÀÚ ¾ç·Â 1940³â 1¿ù 1ÀÏ (À½·Â 1939³â 11¿ù 22ÀÏ) */
		solYear = 1940;
		solMonth = 1;
		solDay = 1;
		lunYear = 1939;
		lunMonth = 11;
		lunDay = 22;
		lunLeapMonth = 0;

		solMonthDay[1] = 29;	/* 1940 ³â 2¿ù 28ÀÏ */
		lunMonthDay = 29;	/* 1939³â 11¿ù */
	}
	else
	{
		/* ±âÁØÀÏÀÚ ¾ç·Â 1900³â 1¿ù 1ÀÏ (À½·Â 1899³â 12¿ù 1ÀÏ) */
		solYear = 1900;
		solMonth = 1;
		solDay = 1;
		lunYear = 1899;
		lunMonth = 12;
		lunDay = 1;
		lunLeapMonth = 0;

		solMonthDay[1] = 28;	/* 1900 ³â 2¿ù 28ÀÏ */
		lunMonthDay = 30;	/* 1899³â 12¿ù */
	}

	lunIndex = lunYear - 1899;

	while (true)
	{

		if (type == 1 &&
			year == solYear &&
			month == solMonth &&
			day == solDay)
		{
			return new myDate(lunYear, lunMonth, lunDay, lunLeapMonth);
		}	
		else if (type == 2 &&
				year == lunYear &&
				month == lunMonth &&
				day == lunDay && 
				leapmonth == lunLeapMonth)
		{
			return new myDate(solYear, solMonth, solDay, 0);
		}

		/* add a day of solar calendar */
		if (solMonth == 12 && solDay == 31)
		{
			solYear++;
			solMonth = 1;
			solDay = 1;

			/* set monthDay of Feb */
			if (solYear % 400 == 0)
				solMonthDay[1] = 29;
			else if (solYear % 100 == 0)
				solMonthDay[1] = 28;
			else if (solYear % 4 == 0)
				solMonthDay[1] = 29;
			else
				solMonthDay[1] = 28;

		}
		else if (solMonthDay[solMonth - 1] == solDay)
		{
			solMonth++;
			solDay = 1;	
		}
		else
			solDay++;

		/* add a day of lunar calendar */
		if (lunMonth == 12 &&
			((lunarMonth[lunIndex][lunMonth - 1] == 1 && lunDay == 29) ||
			(lunarMonth[lunIndex][lunMonth - 1] == 2 && lunDay == 30)))
		{
			lunYear++;
			lunMonth = 1;
			lunDay = 1;

			if (lunYear > 2043) {
				alert("ÀÔ·ÂÇÏ½Å ´ÞÀº ¾ø½À´Ï´Ù.");
				break;
			}

			lunIndex = lunYear - 1899;

			if (lunarMonth[lunIndex][lunMonth - 1] == 1)
				lunMonthDay = 29;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 2)
				lunMonthDay = 30;
		}
		else if (lunDay == lunMonthDay)
		{
			if (lunarMonth[lunIndex][lunMonth - 1] >= 3
				&& lunLeapMonth == 0)
			{
				lunDay = 1;
				lunLeapMonth = 1;
			}
			else
			{
				lunMonth++;
				lunDay = 1;
				lunLeapMonth = 0;
			}

			if (lunarMonth[lunIndex][lunMonth - 1] == 1)
				lunMonthDay = 29;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 2)
				lunMonthDay = 30;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 3)
				lunMonthDay = 29;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 4 &&
					lunLeapMonth == 0)
				lunMonthDay = 29;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 4 &&
					lunLeapMonth == 1)
				lunMonthDay = 30;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 5 &&
					lunLeapMonth == 0)
				lunMonthDay = 30;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 5 &&
					lunLeapMonth == 1)
					lunMonthDay = 29;
			else if (lunarMonth[lunIndex][lunMonth - 1] == 6)
				lunMonthDay = 30;
		}
		else
			lunDay++;
	}
}

function __lunarCalc(year, month, day, sollun, leapyear) {

	var gan = new Array("Ë£","ëà","Ü°","ïË","Ùæ","Ðù","ÌÒ","ãô","ìó","Í¤");
	var jee = new Array("í­","õä","ìÙ","ÙÖ","òã","ÞÓ","çí","Ú±","ãé","ë·","âù","ú¤");
	var ddi = new Array("Áã","¼Ò","¹ü","Åä³¢","¿ë","¹ì","¸»","¾ç","¿ø¼þÀÌ","´ß","°³","µÅÁö");
	var week = new Array("ÀÏ","¿ù","È­","¼ö","¸ñ","±Ý","Åä");

	var md = new Array(31,0,31,30,31,30,31,31,30,31,30,31);

	if (sollun == 1) {

		// ¾ç·ÂÀ» À½·ÂÀ¸·Î º¯È¯
		var ly, lm, ld;
		var sy, sm, sd;
		var m1, m2, mm, i, j, w;
		dt = new Array(203);
		var k1, k2, td, td1, td2, yoon;

		// ±âÁØÀÏÀÚ ¾ç·Â 1841 ³â 1 ¿ù 23 ÀÏ (À½·Â 1840 ³â 1 ¿ù 1 ÀÏ) °è»ê
		td1=(1840*365)+(1840/4)-(1840/100)+(1840/400)+23;
		sy = year;
		sm = month;
		md[1] = febdays(sy);
		sd = day;
		var sy1 = sy-1;
		td2 = sy1*365+sy1/4-sy1/100+sy1/400+parseInt(sd, 10);

		for (i=0; i<sm-1; i++) {
			td2 = td2 + md[i];
		}
		td =  td2 - td1 + 1;
		td = Math.floor(td);

		for (i=0; i<=sy-1841; i++) {
			dt[i] =0;
			for(j=0; j<12; j++) {
				switch(lunarMonth[i][j]) {
					case 1 :
					mm=29;
					break;
					case 2 :
					mm=30;
					break;
					case 3 :
					mm=58;     // 29+29
					break;
					case 4 :
					mm=59;     // 29+30
					break;
					case 5 :
					mm=59;     // 30+29
					break;
					case 6 :
					mm=60;     // 30+30
					break;
				}
				dt[i] = dt[i] + mm;
			}
		}
		ly =0 ;
		while(1) {
			if (td > dt[ly] ) {
				td = td - dt[ly];
				ly=ly+1;
			}
			else {
				break;
			}
		}
		lm=0;
		yoon = "";
		while(1) {
			if (lunarMonth[ly][lm] <=2) {
				mm = lunarMonth[ly][lm] +28;
				if (td>mm) {
					td = td - mm;
					lm = lm +1;
				}
				else {
					break;
				}
			}
			else {
				switch (lunarMonth[ly][lm]) {
					case 3:
					m1 = 29;
					m2 = 29;
					break;
					case 4:
					m1 = 29;
					m2 = 30;
					break;
					case 5:
					m1 = 30;
					m2 = 29;
					break;
					case 6:
					m1 = 30;
					m2 = 30;
					break;
				}
				if (td>m1) {
					td = td - m1;
					if (td>m2) {
						td = td - m2;
						lm=lm+1;
					}
					else {
						yoon ="À±";
						break;
					}
				}
				else {
					break;
				}
			}
		}
		ly = ly + 1841;
		lm = lm + 1;
		ld = td;
		w = (parseInt(td2, 10)) % 7;
		i = (parseInt(td2, 10)+4) % 10;
		j = (parseInt(td2, 10)+2) % 12;
		k1 = (parseInt(ly, 10)+6) %10;
		k2 = (parseInt(ly, 10)+8) % 12;

		return new myDate(ly, lm, ld, (yoon == "À±" ? true : false));

//		document.write("¾ç·Â ",sy," ³â ",sm," ¿ù ",sd," ÀÏ ",week[w],"¿äÀÏ","<br>");
//		document.write("À½·Â ",gan[k1],jee[k2],"³â ",ddi[k2],"¶ì",yoon,"ÇØ ",ly," ³â ",lm," ¿ù ",ld," ÀÏ ","(",gan[i],jee[j],")");
	}
	else if (sollun == 2) {
		// À½·Â¿¡¼­ ¾ç·ÂÀ¸·Î º¯È¯
		var lyear, lmonth, lday, leapyes;
		var syear, smonth, sday;
		var mm, y1, y2, m1;
		var i, j, k1, k2, leap, w;
		var td, y;
		lyear = year;
		lmonth = month;

		y1 = lyear - 1841;
		m1 = lmonth - 1;
		leapyes = 0;
		if (lunarMonth[y1][m1] > 2)  {
			if (leapyear) {
				leapyes = 1;
				switch (lunarMonth[y1][m1]) {
					case 3:
					case 5:
					mm = 29;
					break;
					case 4:
					case 6:
					mm = 30;
					break;
				}
			}
			else {
				switch (lunarMonth[y1][m1]) {
					case 1:
					case 3:
					case 4:
					mm = 29;
					break;
					case 2:
					case 5:
					case 6:
					mm = 30;
					break;
				}
			}
		}

		lday = day;

		td = 0;
		for (i=0; i<y1; i++) {
			for (j=0; j<12; j++) {
				switch (lunarMonth[i][j]) {
					case 1:
					td = td + 29;
					break;
					case 2:
					td = td + 30;
					break;
					case 3:
					td = td + 58;    // 29+29
					break;
					case 4:
					td = td + 59;    // 29+30
					break;
					case 5:
					td = td + 59;    // 30+29
					break;
					case 6:
					td = td + 60;    // 30+30
					break;
				}
			}
		}
		for (j=0; j<m1; j++) {
			switch (lunarMonth[y1][j]) {
				case 1:
				td = td + 29;
				break;
				case 2:
				td = td + 30;
				break;
				case 3:
				td = td + 58;    // 29+29
				break;
				case 4:
				td = td + 59;    // 29+30
				break;
				case 5:
				td = td + 59;    // 30+29
				break;
				case 6:
				td = td + 60;    // 30+30
				break;
			}
		}
		if (leapyes == 1) {
			switch(lunarMonth[y1][m1]) {
				case 3:
				case 4:
				td = td + 29;
				break;
				case 5:
				case 6:
				td = td + 30;
				break;
			}
		}
		td =  td + parseFloat(lday) + 22;
		// td : 1841 ³â 1 ¿ù 1 ÀÏ ºÎÅÍ ¿øÇÏ´Â ³¯Â¥±îÁöÀÇ ÀüÃ¼ ³¯¼öÀÇ ÇÕ
		y1 = 1840;
		do {
			y1 = y1 +1;
			if  ((y1 % 400 == 0) || ((y1 % 100 != 0) && (y1 % 4 == 0))) {
				y2 = 366;
			}
			else {
				y2 = 365;
			}
			if (td <= y2) {
				break;
			}
			else {
				td = td- y2;
			}
		} while(1);
		syear = y1;
		md[1] = parseInt(y2, 10) -337;
		m1 = 0;
		do {
			m1= m1 + 1;
			if (td <= md[m1-1]) {
				break;
			}
			else {
				td = td - md[m1-1];
			}
		} while(1);
		smonth = parseInt(m1, 10);
		sday = parseInt(td, 10);
		y = parseInt(syear -1, 10);
		td = y * 365 + y/4 - y/100 +  y/400;
		for ( i=0; i<smonth-1; i++) {
			td = td + md[i];
		}
		td = Math.floor(td) + sday;
		w = td % 7;
		i = (td + 4) % 10;
		j = (td + 2) % 12;
		k1 = (parseInt(lyear, 10) + 6) % 10;
		k2 =(parseInt(lyear, 10) + 8) % 12;

		return new myDate(syear, smonth, sday, false);		
//		document.write("À½·Â ",gan[k1],jee[k2],"³â ",ddi[k2],"¶ìÇØ ",lyear," ³â ",lmonth," ¿ù ",lday," ÀÏ ","(",gan[i],jee[j],")","<br>");
//		document.write("¾ç·Â ",syear," ³â ",smonth," ¿ù ",sday," ÀÏ ",week[w],"¿äÀÏ");
	}
}

function febdays(src) {
	if ((src%4 !=0) || ((src%100 == 0) && (src%400 !=0))) {
		return 28;	// À±³âÀÌ ¾Æ´Ô
	}
	else {
		return  29;	// À±³âÀÓ
	}
}


function getWeekday(year, month, day) {
	var weekday = Array("ÀÏ", "¿ù", "È­", "¼ö", "¸ñ", "±Ý", "Åä");
	var date = new Date(year, month - 1, day);

	if (date)
		return weekday[date.getDay()];
}

function getPassDay(year, month, day) {
	var today = new Date();
	var date = new Date(year, month - 1, day);

	var interval = Math.floor((today - date) / (1000 * 60 * 60 * 24) + 1);

	return interval;
}

function getDDay(year, month, day) {
	var today = new Date();
	var date = new Date(year, month - 1, day);

	var interval = Math.floor((date - today) / (1000 * 60 * 60 * 24) + 1);

	return interval;
}

function getDateSpecificInterval(year, month, day, interval) {
	var date = new Date(year, month - 1, parseInt(day, 10) + parseInt(interval, 10) - 1);

	return date;
}

function dayCalcDisplay(type) {
	var startYear = document.getElementById("startYear").value;
	var startMonth = document.getElementById("startMonth").value;
	var startDay = document.getElementById("startDay").value;

	if (!startYear || startYear == 0 ||
		!startMonth || startMonth == 0 ||
		!startDay || startDay == 0)
	{
		alert('±âÁØÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä');
		return;
	}

	var startDate = new Date(startYear, startMonth - 1, startDay);
	var today = new Date();
	today = new Date(today.getYear(), today.getMonth(), today.getDate());

	switch (type)
	{
	/* ¿À´ÃÀº ¸îÀÏÂ° */
	case 1:
		if (today < startDate)
		{
			alert("±âÁØÀÏÀ» ¿À´Ãº¸´Ù ÀÌÀü ³¯Â¥·Î ¼³Á¤ÇÏ¼¼¿ä");
			return;
		}

		var interval = getPassDay(startYear, startMonth, startDay);
		document.getElementById("day1").value = interval;
		break;
	/* x ÀÏ µÇ´Â ³¯Àº */
	case 2:
		if (today < startDate)
		{
			alert("±âÁØÀÏÀ» ¿À´Ã ÀÌÀü ³¯Â¥·Î ¼³Á¤ÇÏ¼¼¿ä");
			return;
		}

		var day2 = document.getElementById("day2").value;

		if (day2 <= 0)
		{
			alert("0 º¸´Ù Å« ¼ö¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			return;
		}

		var date = getDateSpecificInterval(startYear, startMonth, startDay, day2);

		document.getElementById("resultYear").value = date.getYear();
		document.getElementById("resultMonth").value = date.getMonth() + 1;
		document.getElementById("resultDay").value = date.getDate();

		break;
	/* D-Day */
	case 3:
		var targetYear = document.getElementById("targetYear").value;
		var targetMonth = document.getElementById("targetMonth").value;
		var targetDay = document.getElementById("targetDay").value;
		var interval = getDDay(targetYear, targetMonth, targetDay);

		if (!targetYear || targetYear == 0 ||
			!targetMonth || targetMonth == 0 ||
			!targetDay || targetDay == 0)
		{
			alert('³¯Â¥¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä');
			return;
		}

		var targetDate = new Date(targetYear, targetMonth - 1, targetDay);

		if (today > targetDate)
		{
			alert("±âÁØÀÏÀ» ¿À´Ã ÀÌÈÄ ³¯Â¥·Î ¼³Á¤ÇÏ¼¼¿ä");
			return;
		}

		document.getElementById("day3").value = interval;

		break;

	/* ¿äÀÏ °è»ê */
	case 4:
		var year = document.getElementById("weekdayYear").value;
		var month = document.getElementById("weekdayMonth").value;
		var day = document.getElementById("weekdayDay").value;
		var weekday = document.getElementById("weekday");

		if (!year || year == 0 ||
			!month || month == 0 ||
			!day || day == 0)
		{
			alert('³¯Â¥¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä');
			return;
		}
		weekday.value = getWeekday(year, month, day) + "¿äÀÏ";

		break;

	/* ¾ç·Â/À½·Â º¯È¯ */
	case 5:
		if (document.getElementById('solarLunar').value == 'solar')
		{
			var leapMonth = document.getElementById('leapMonth').checked;
			var date = lunarCalc(startYear, startMonth, startDay, 2, leapMonth);
		}
		else
		{
			var date = lunarCalc(startYear, startMonth, startDay, 1);
		}

		document.getElementById('solarLunarYear').value = date.year;
		document.getElementById('solarLunarMonth').value = 
			(date.leapMonth ? "À±" : "") + date.month;
		document.getElementById('solarLunarDay').value = date.day;

		break;
	}
}

function memorialDayCheck(solarDate, lunarDate) {
	var i;
	var memorial;


	for (i = 0; i < memorialDays.length; i++)
	{
		if (memorialDays[i].month == solarDate.month &&
			memorialDays[i].day == solarDate.day &&
			memorialDays[i].solarLunar == 1) {

			// 2006³âºÎÅÍ´Â ½Ä¸ñÀÏÀÌ °øÈÞÀÏÀÌ ¾Æ´Ô.
			// ±×·¡¼­ 2005À» Æ÷ÇÔÇØ¼­ ±× ÀÌÀü¿¡¸¸ °øÈÞÀÏ·Î Ã³¸®¸¦ ÇÔ.
			if ( solarDate.year >= 2006 && solarDate.month == 4 && solarDate.day == 5 ) {
				return null;
			}

			if ( solarDate.year != 2008 && solarDate.month == 4 && solarDate.day == 9 ) {
				return null;
			}

			return memorialDays[i];

		}

		if (memorialDays[i].month == lunarDate.month &&
			memorialDays[i].day == lunarDate.day &&
			memorialDays[i].solarLunar == 2 &&
			!memorialDays[i].leapMonth)
			return memorialDays[i];
	}

	return null;
}

function setStartDate(year, month, day) {
	document.getElementById('startYear').value = year;
	document.getElementById('startMonth').value = month;
	document.getElementById('startDay').value = day;
}

function get_today() {
    today = new Date();
    if(cal_data.year.value == 0) {
		document.cal_data.year.value = today.getFullYear();
    }

    if(cal_data.month.value == 0) {
		document.cal_data.month.value = today.getMonth()+1;
	}
}
get_today();

function drawCalendar( mode ) {

		// ¿©±â¿¡¼­ ÀÌÀü´Þ°ú ´ÙÀ½´Þ¿¡ ´ëÇÑ ³¯Â¥°ªÀ» »ý¼ºÇØ ÁØ´Ù.

		current_year = "";
		current_month = "";
		
		// ¿ä±â ÁÖ¼® 2007-04-11 ¿ÀÀü 11:30:23
		//try {
		//	current_year = yearSelect.Items.value;
		//	current_month = monthSelect.Items.value;
		//} catch (e) {
		//	current_year = document.cal_data.year.value;
		//	current_month = document.cal_data.month.value;
		//}
		
		// ¿ä±â Ãß°¡ 2007-04-11 ¿ÀÀü 11:30:30
		current_year = document.cal_data.year.value;
		current_month = document.cal_data.month.value;
		

		pre_year	= current_year;
		pre_month = parseInt(current_month, 10) - 1;

		if ( pre_month < 1 ) { 
			pre_year = parseInt(pre_year, 10) - 1;
			pre_month = 12;
		}

		next_year = current_year;
		next_month = parseInt(current_month, 10) + 1;

		if ( next_month > 12 ) {
			next_year = parseInt(next_year, 10) + 1;
			next_month = 1;
		}

		if (mode == 1) { 
			setCalendar( pre_year, pre_month );
		} else if (mode == 2) {  
			setCalendar( next_year, next_month );
		} else {
			// do nothing
		}
}

function getAgentYear(year) {
	if(navigator.userAgent.indexOf("MSIE") == -1) {
		year = year + 1900;
	}
	return year;
}

function setCalendar(year, month) {

	var i;

	if (!year)
	{
		year = yearSelect.Items.value;
		month = monthSelect.Items.value;
	}
	else
	{

		year_select = document.getElementById("yearSelect");
		month_select = document.getElementById("monthSelect");

		year_length = year_select.length;
		month_length = month_select.length;


		for (i = 0; i < year_length; i++) {
			if ( year_select.options[i].value == year ) {
				year_select.options[i].selected = true;
			}
		}

		for (i = 0; i < month_length; i++) {
			if ( month_select.options[i].value == month ) {
				month_select.options[i].selected = true;
			}
		}

		try {
			nYearSelectLen = yearSelect.Items.length;
		} catch (e) {
			nYearSelectLen = 0;
		}

		try {
			nMonthSelectLen = monthSelect.Items.length;
		} catch (e) {
			nMonthSelectLen = 0;
		}

		for (i = 0; i < nYearSelectLen; i++)
			if (yearSelect.Items[i].value == year)
			{
				yearSelect.Items.selectedIndex = i;
				yearSelect.ChangeTitle();
				break;
			}
	
		for (i = 0; i < nMonthSelectLen; i++)
			if (monthSelect.Items[i].value == month)
			{
				monthSelect.Items.selectedIndex = i;
				monthSelect.ChangeTitle();
				break;
			}

	}

	var monthDay = Array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	/* set monthDay of Feb */
	if (year % 400 == 0)
		monthDay[1] = 29;
	else if (year % 100 == 0)
		monthDay[1] = 28;
	else if (year % 4 == 0)
		monthDay[1] = 29;
	else
		monthDay[1] = 28;

	/* set the day before ¼³³¯ */
	if (lunarMonth[year - 1 - 1899][11] == 1)
		memorialDays[1].day = 29;
	else if (lunarMonth[year - 1 - 1899][11] == 2)
		memorialDays[1].day = 30;

	var date = new Date(year, month - 1, 1);
	var startWeekday = date.getDay();

	/* clean all day cell */
	for (i = 0; i < 42; i++)
	{
		document.getElementById('dayCell' + i).innerHTML = "";
		document.getElementById('memoCell' + i).innerHTML = "";
		// ÀÏÀÚÀÇ ¹ÙÅÁ»öÀ» Èò»öÀ¸·Î ÃÊ±âÈ­ ÇÔ.
		document.getElementById('dayCell' + i).bgColor = "FFFFFF";
		document.getElementById('memoCell' + i).bgColor = "FFFFFF";
	}

	/* fill day cell */		
	for (i = 0; i < monthDay[month - 1]; i ++)
	{
		var index = startWeekday + i;
		var dayHTML;
		var memoHTML;

		var solarDate = new myDate(year, month, i + 1);
		var lunarDate = lunarCalc(year, month, i + 1, 1);		

		/* memorial day */
		var memorial = memorialDayCheck(solarDate, lunarDate);

		/* ½¬Áö¾Ê´Â ±â³äÀÏ */
		var memorialDay = false;
		if (memorial && memorial.holiday == false)
			memorialDay = true;

		/* ¿À´Ã */
		var todayDate = new Date();

		/* day print */

		dayHTML = "<font color='COLOR' title='TITLE'>" + 
				"HIGHLIGHT_START" + ( i + 1 ) + "HIGHLIGHT_END" +
				"</font>";

		/* decoration */
		if ((memorial && memorial.holiday) || index % 7 == 0) {
			dayHTML = dayHTML.replace("COLOR", "#CF2549");
			
		} else if (index % 7 == 6) {
			dayHTML = dayHTML.replace("COLOR", "#0046AD");
			dayHTML = dayHTML.replace("COLOR", "#0046AD");

			; // do nothing
		}

		if (memorial)
			dayHTML = dayHTML.replace("TITLE", "(À½)" + lunarDate.month + "." + lunarDate.day + " " + memorial.name);


		if (todayDate.getFullYear() == year &&
			todayDate.getMonth() + 1 == month &&
			todayDate.getDate() == i + 1)
		{
			dayHTML = dayHTML.replace("HIGHLIGHT_START", "<b>");
			dayHTML = dayHTML.replace("HIGHLIGHT_END", "</b>");
			document.getElementById('dayCell' + index).bgColor = "#CF2549";
//			document.getElementById('dayCell' + index).bgColor = "red";
		}

		dayHTML = dayHTML.replace("TITLE", "(À½)" + lunarDate.month + "." + lunarDate.day);	
		dayHTML = dayHTML.replace("COLOR", "");
		dayHTML = dayHTML.replace("HIGHLIGHT_START", "");
		dayHTML = dayHTML.replace("HIGHLIGHT_END", "");

		document.getElementById('dayCell' + index).innerHTML = dayHTML;

		/* lunar calnedar print */
		if (lunarDate.day == 1 || lunarDate.day == 15)
		{
			// bLeapMonth (À±´Þ¿©ºÎ)
			// 1 : À±´Þ
			// 0 : Æò´Þ

			bLeapMonth = lunarDate.leapMonth; 

//			if ( bLeapMonth == 0 ) {
				memoHTML = "<img src=http://img.nate.com/search_home/img/topic_add/cal_2007/" + (lunarDate.month < 10 ? "0" + lunarDate.month : lunarDate.month) + (lunarDate.day < 10 ? "0" + lunarDate.day: lunarDate.day) + ".jpg border=0>";
//			} else {

				// == À±´ÞÀÇ °æ¿ì ³¯Â¥ ÇÏ´Ü À½·Â ÀÌ¹ÌÁö Ã³¸®¸¦ ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù.

//				sImgURL = ""; // À±´Þ ÀÌ¹ÌÁö °æ·Î
		
//				if ( lunarDate.day == 1 ) { 
					// À±´Þ 7¿ù 1ÀÏ
//					sImgURL = 'http://img.nate.com/search_home/img/topic_add/cal_2007/0701.jpg';
//				} else {
					// À±´Þ 7¿ù 15ÀÏ
//					sImgURL = 'http://img.nate.com/search_home/img/topic_add/cal_2007/0715.jpg';
//				}

//				memoHTML = "<img src=" + sImgURL + " border=0>";
//			}
		}
		else
			memoHTML = "<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></td><tr></table>";

		document.getElementById('memoCell' + index).innerHTML = memoHTML;

	}

	document.getElementById('dayRow5').style.display = "";

	if(monthDay[month - 1] + startWeekday < 36) {
		document.getElementById('dayRow5').style.display = "none";
	}
	document.cal_data.year.value = year;
	document.cal_data.month.value = month;
}

function lunarMonthCheck()
{
	if (document.getElementById('solarLunar').value == "solar") 
		document.getElementById('leapMonth').disabled = false;
	else
		document.getElementById('leapMonth').disabled = true;
}


function initCalendar()
{
	try {
		var nYear = document.cal_data.year.value;
		var nMonth = document.cal_data.month.value;
	} catch (e) {
		return
	}

	document.write("	<li class=cal_t><a href=javascript:drawCalendar(1);>ÀÌÀü</a>");

	var selectStr;
	var i, j;
	document.write("	<select class=selectb style=margin-bottom:-2px; id=yearSelect onChange=\"setCalendar(this[this.selectedIndex].value, document.getElementById('monthSelect').value)\">" );

	for (i = 2020; i >= 1900; i--) {
		if ( i == nYear ) { 
			selectStr += "<option value='" + i + "' selected>" + i + "³â </option>";
		} else {
			selectStr += "<option value='" + i + "'>" + i + "³â </option>";
		}
	}

	document.write(selectStr);

	document.write("	</select>");
	document.write("	<select class=selectb style=margin-bottom:-2px; id=monthSelect onChange=\"setCalendar(document.getElementById('yearSelect').value, this[this.selectedIndex].value)\">");


	selectStr = "";
	for (i = 1; i <= 12; i++) {

		if ( i == nMonth ) {
			selectStr += "<option value='" + i + "' selected>" + i + "¿ù</option>";
		} else {
			selectStr += "<option value='" + i + "'>" + i + "¿ù</option>";
		}
	}

	document.write(selectStr);

	document.write("	</select> <a href=javascript:drawCalendar(2);>´ÙÀ½</a>");
	document.write("	</li>");

	document.write("	<li>");
	document.write("	<table class=cal_b>");
	document.write("	  <tr> ");
	document.write("	    <td class=cel01><font color=#CF2549>ÀÏ</font></td>");
	document.write("	    <td class=cel01>¿ù</td>");
	document.write("	    <td class=cel01>È­</td>");
	document.write("	    <td class=cel01>¼ö</td>");
	document.write("	    <td class=cel01>¸ñ</td>");
	document.write("	    <td class=cel01>±Ý</td>");
	document.write("	    <td class=cel01><font color=#0046AD>Åä</font></td>");
	document.write("	  </tr>");

	for (i = 0; i < 6; i++)	{
		document.write("<tr id='dayRow"+i+"'>");

		for (j = 0; j < 7; j++) {
			document.write("<td class=cel02><span id='dayCell" + ( i * 7 + j )+ "'></span><br><span id='memoCell" + ( i * 7 + j )+ "'></span></td>");
		}
	}

	var today = new Date(); // ¿À´Ã ³¯Â¥¸¦ ¾ò¾î³½´Ù.

	if (today.getYear()==2004) {
		setCalendar(2005, 1);
	} else {
		// ¿©±â´Ù°¡ ³âµµ¿Í ¿ùÀ» settingÇÏ¸é µÊ.
		setCalendar(nYear, nMonth);
	}

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

initCalendar();

