var myAnchors=document.all.tags("A");
function focusBlur()
{
	for (i=0;i<myAnchors.length;i++) {
		myAnchors[i].onfocus=new Function("myAnchors["+i+"].blur()");
	}
}

function Link(num){ 
	switch (num)
	{
		case 11: document.location.href="/intro/greeting.html";
			break;
		case 12: document.location.href="/intro/merit.html";
			break;
		case 21: document.location.href="/showroom/showroom.html";
			break;
		case 31: document.location.href="/reservation/info.html";
			break;
		case 32: document.location.href="/reservation/consulting.asp";
			break;
		case 33: document.location.href="javascript:alert('ÁË¼ÛÇÕ´Ï´Ù. ¿¹¾àÇöÈ²Àº ¾ÆÁ÷ ÁØºñÁßÀÔ´Ï´Ù.')";
//		case 33: document.location.href="/reservation/status.asp";
			break;
		case 41: document.location.href="/location/airport.html";
			break;
		case 42: document.location.href="/location/map.html";
			break;
		case 51: document.location.href="/japaninfo/japaninfo.html";
			break;
		case 52: document.location.href="/japaninfo/tokyoinfo.html";
			break;
		case 61: document.location.href="/community/free_list.asp"; 
			break;
		case 62: document.location.href="/news/news_list.asp";
			break;
		case 63: document.location.href="/photo/photo_list.asp";
			break;
	}
}	




//±âº» º¸¾È °ü·Ã
//document.oncontextmenu=function(){return false;}
//document.ondragstart=function(){return false;}
//document.onselectstart=function(){return false;} 
//document.onmousedown=click
//document.onkeydown=click
/*function click() {
	if ((event.button==2) || (event.button==3) || (event.keyCode == 93)) {
		return false;
	}
	else {
		if((event.ctrlKey) && (event.keyCode == 67)) {
			return false;
		}
	}
}

*/
//°æ·Î°¨Ãß±â °ü·Ã
window.defaultStatus='Welcom To HANABI JAPAN';
document.onmouseover=hidestatus ;
document.onmouseout=hidestatus ;
function hidestatus(){ 
	window.status='Welcom To HANABI JAPAN';
	return true;
}

//ÀÌ¹ÌÁö ÆÄÀÏ »õÃ¢ ¿©´Â ½ºÅ©¸³Æ®
	winObj=null;	// ÃÊ±âÈ­
	function OpenWin(sel,imgname)
	{
		img = new Image();
		img.src=sel.document[imgname].src;
		draw();
	}

	function draw()
	{
		if(img.complete == false) 
		{
			setTimeout("draw()", "100");
			return;
		}
		
	width		=img.width					// //ÀÌ¹ÌÁö ³Êºñ°ª
	height	=img.height					////ÀÌ¹ÌÁö ³ôÀÌ °ª

	var attr ="width="+width + ",height="+height

	// À©µµ¿ì¸¦ ¿­°í ÀÌ¹ÌÁö Ãâ·Â.
	if(winObj != null && winObj.closed == false) 
	{	winObj.close();	}

	winObj = window.open("","imgwindow",attr + ',top=160' + ',left=200, resizable=0,scrollbars=yes' );
	winObj.document.open()
	winObj.document.write("<html><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>")
	winObj.document.write("<img alt='ÀÌ¹ÌÁö¸¦ Å¬¸¯ ÇÏ½Ã¸é ÇöÀçÃ¢À» ´Ý½À´Ï´Ù' src=" + img.src + " style='cursor: hand;'" + " onClick='self.close()'")
	winObj.document.write("<body><html>")
	winObj.document.close()
	}		


//¿ÀÇÂÀ©µµ¿ì ¶ç¿ì´Â ½ºÅ©¸³Æ®
function openWin(filename,p_width,p_height,scrll)
{
	var filename,p_width,p_height,scrll,search
	win = window.open(filename, "","resizable=no,scrollbars="+scrll+",width="+p_width+",height="+p_height);
}

//»çÀÌÆ® ·Î±×ÀÎ½Ã °ø¶õÈ®ÀÎ ÇÏ´Â ½ºÅ©¸³Æ®
function checkBlank()
{
	getId		= document.loginForm.memId	
	getPass = document.loginForm.memPass	
									
	if (getId.value == "")
	{
			alert("¾ÆÀÌµð¸¦ ÀÔ·Â ÇÏ¼¼¿ä.");
			getId.focus();
			return;
	}

	if (getPass.value == "")
	{
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·Â ÇÏ¼¼¿ä.");
			getPass.focus();
			return;
	}
document.loginForm.submit();
}

//°Ô½ÃÆÇ ±Û¾²±â ÆûÃ¼Å©
function checkWriteForm()
{
		var getForm = document.checkForm
		if (isCkeckBlank(getForm.clientTitle,"Á¦¸ñ") == false)							{	return;	} //Á¦¸ñ Ã¼Å©
		if (isCkeckBlank(getForm.clientId,"ÀÌ¸§") == false)							{	return;	} //ÀÌ¸§ Ã¼Å©
		if (isCkeckBlank(getForm.clientPwd,"ºñ¹Ð¹øÈ£") == false)					{	return;	} //ºñ¹Ð¹øÈ£ Ã¼Å©
		if (checkEmail(getForm.clientEmail,"ÀÌ¸ÞÀÏ") == false)						{	return;	} //ÀÌ¸ÞÀÏ Ã¼Å©
		if (isCkeckBlank(getForm.clientContent,"³»¿ë") == false)					{	return;	} //³»¿ë Ã¼Å©

	getForm.submit();
}



//¿¹¾à °ü¸®ÀÚ ±Û¾²±â/¼öÁ¤ ÆûÃ¼Å©
function checkResWriteForm()
{
		var getForm = document.checkForm
		if (isCkeckBlank(getForm.inforTitle,"Á¦¸ñ") == false)							{	return;	} //Á¦¸ñ Ã¼Å©
		if (isCkeckBlank(getForm.inforAbout,"³»¿ë") == false)					{	return;	} //³»¿ë Ã¼Å©

	getForm.submit();
}


//°Ô½ÃÆÇ °ü¸®ÀÚ ±Û¾²±â ÆûÃ¼Å©
function checkWriteFormAdmin()
{
		var getForm = document.checkForm
		if (isCkeckBlank(getForm.clientTitle,"Á¦¸ñ") == false)							{	return;	} //Á¦¸ñ Ã¼Å©
		if (isCkeckBlank(getForm.clientContent,"³»¿ë") == false)					{	return;	} //³»¿ë Ã¼Å©

	getForm.submit();
}


//¿¹¾à °Ô½ÃÆÇ ±Û¾²±â ÆûÃ¼Å©
function checkWriteForm1()
{
		var getForm = document.checkForm
		if (isCkeckBlank(getForm.clientTitle,"Á¦¸ñ") == false)							{	return;	} //Á¦¸ñ Ã¼Å©
			if (isCkeckBlank(getForm.clientPwd,"ºñ¹Ð¹øÈ£") == false)					{	return;	} //ºñ¹Ð¹øÈ£ Ã¼Å©
		if (isCkeckBlank(getForm.clientId,"ÀÌ¸§") == false)							{	return;	} //ÀÌ¸§ Ã¼Å©
	
			if(getForm.memCel1.selectedIndex == 0)
		{
					alert("¹øÈ£¸¦ ¼±ÅÃ ÇÏ¼¼¿ä");
					return;
		}	
		if (checkEmail(getForm.clientEmail,"ÀÌ¸ÞÀÏ") == false)						{	return;	} //ÀÌ¸ÞÀÏ Ã¼Å©
		if (isCkeckBlank(getForm.zipcode1,"¿ìÆí¹øÈ£") == false)														{	return; 	} //¿ìÆí¹øÈ£1 Ã¼Å©
		if (isCkeckBlank(getForm.zipcode2,"¿ìÆí¹øÈ£") == false)														{	return;	} //¿ìÆí¹øÈ£2 Ã¼Å©
		if (isCkeckBlank(getForm.memAddr1,"ÁÖ¼Ò" ) == false)															{	return;	}//ÁÖ¼Ò Ã¼Å©

	
		if (isCkeckBlank(getForm.memCel2,"ÀüÈ­¹øÈ£") == false)					{	return;	}//ÈÞ´ëÆù2 Ã¼Å©
		if (isCkeckBlank(getForm.memCel3,"ÀüÈ­¹øÈ£" ) == false)					{	return ;	}//ÈÞ´ëÆù3 Ã¼Å©
		//if (isCkeckBlank(getForm.stayNum,"¼÷¹ÚÀÎ¿ø") == false)					{	return;	} // ¼ý¹ÚÀÎ¿øÃ¼Å©
		if (isCkeckBlank(getForm.arriveTime,"µµÂø ¿¹Á¤½Ã°£") == false)		{	return;	} //µµÂø½Ã°£ Ã¼Å©
	//	if (isCkeckBlank(getForm.clientContent,"±âÅ¸¹®ÀÇ»çÇ×") == false)					{	return;	} //³»¿ë Ã¼Å©

	getForm.submit();
}

//¿¹¾à °Ô½ÃÆÇ ±Û¾²±â ÆûÃ¼Å©
function checkWriteForm1Admin()
{
		var getForm = document.checkForm
		if (isCkeckBlank(getForm.clientTitle,"Á¦¸ñ") == false)							{	return;	} //Á¦¸ñ Ã¼Å©
		if (isCkeckBlank(getForm.clientContent,"¹®ÀÇ»çÇ× ´äº¯") == false)					{	return;	} //³»¿ë Ã¼Å©
	getForm.submit();
}

 //»ç¶÷ÀÌ¸§ ÀÔ·Â½Ã ¿µ¾î ¿Í ÇÑ±Û¸¸ °¡´É°Ô ÇÔ¼ö
function checkName(str,notice)
{
	if (isCkeckBlank(str,notice) == false)	{	return false;	}
	
	var sp_char = " !@#$%^&*()_-+|/;:,.?`~{}[]<>'1234567890" + '"'		//Á¦¾î ÇÒ °ªÀ» Ãß°¡ È¤Àº »èÁ¦ ÇÒ¼ö ÀÖÀ½
	for(var i=0; i < str.value.length; i++)
	{
		if(	sp_char.indexOf(str.value.charAt(i)) != -1)
		{
			alert(notice + " ¿¡´ÂÆ¯¼ö¹®ÀÚ³ª ¼ýÀÚ¸¦ »ç¿ë ÇÒ¼ö ¾ø½À´Ï´Ù.")
			str.value="";
			str.focus();
			return false;
		}
	}
return true;
}

//ÀÌ¸ÞÀÏ Ã¼Å©
function checkEmail(obj,notice)
{
	 if (isCkeckBlank(obj,notice) == false)	 		{	return false;	}

	 if( obj.value.length > 0 )
	{
            var regExp = /[a-z0-9]{2,}@[a-z0-9-]{2,}\.[a-z0-9]{2,}/i;
                if(!regExp.test(obj.value))
                {
                        alert('Àß¸øµÈ e-mail Çü½ÄÀÔ´Ï´Ù.');
                        obj.value = "";
                        obj.focus();
                        return false ;
               }
	}
 return true;
}


//Æû °ª °ø¶õÃ¼Å© ÈÄ °æ°í ¸Þ½ÃÁö ¶ç¿ì±â 
function isCkeckBlank(checkBlank,notice)
{
	if(checkBlank.value.length == 0) 
		{
			alert(notice+" À»(¸¦) ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
			checkBlank.focus();
			return false;
		}
 return true;
}

//Å°º¸µå ÀÔ·Â½Ã ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ°Ô ÇÔ.
function onlyNmber()
{   
	if((event.keyCode<48)||(event.keyCode>57))
			event.returnValue=false;
}	

// Å°º¸µå ÀÔ·Â½Ã ÇÑ±Û ¿µ¹®¸¸ ÀÔ·Â °¡´É ÇÏ°ÔÇÔ.
function onlyString()
{   
	if((event.keyCode<65)||(event.keyCode>122))
			event.returnValue=false;
}	

//¼ýÀÚ Ã¼Å©
function isNum(str)
{
		alert(str.value)	
  	for(i = 0; i < str.length; i++)
  	{
    		ch = str.charAt(i);
    		if(ch < "0" || ch > "9")
    			return false;
  	}
 return true;
}
 
//ÇÑ±Û Ã¼Å©
function isKor(str)
{
	for(i=0; i<str.length; i++)
	{
		if(str.charCodeAt(i) > 12593)
				return true;
  	}
	return false;
}


//°Ô½ÃÆÇ °Ë»ö
function checkWordSearch()
{	
		chkForm=document.searchForm
					
		if (chkForm.SrchWord.value == "")
		{
				alert("°Ë»ö¾î¸¦ ÀÔ·Â ÇÏ¼¼¿ä");
				chkForm.SrchWord.focus();
				return;
		}
		chkForm.submit();		
}


//´Þ·Â ³âµµ º¯°æ ÇÔ¼ö
function changeYear(year1)
{
	location.href = "status.asp?year1="+year1		
}

		//¿¹¾à ³¯Â¥ ¼±ÅÃÇÏ±â¿¡ ÇÊ¿äÇÑ ¼Ò½º ¿©±â¼­ ºÎÅÍ	
			Now = new Date();									//now ¶ó´Â ÀÎ½ºÅÏ½º ³¯Â¥ÇÔ¼ö »ý¼º
			NowDay = Now.getDate();						//ÀÏ ±¸ÇØ¼­ NowDay º¯¼ö¿¡ ÀÔ·Â
			NowMonth = Now.getMonth();					//¿ù ±¸ÇØ¼­ NowDay º¯¼ö¿¡ ÀÔ·Â
			NowYear = Now.getYear();						//³â ±¸ÇØ¼­ NowDay º¯¼ö¿¡ ÀÔ·Â
			//if (NowYear < 2000) NowYear += 1900;	//for Netscape

			function DaysInMonth(WhichMonth, WhichYear)	//°¢´ÞÀÇ ¸¶Áö¸· ÀÏ ±¸ÇÏ´Â ÇÔ¼ö
			{
				var DaysInMonth = 31;
				if (WhichMonth == "4¿ù" || WhichMonth == "6¿ù" || WhichMonth == "9¿ù" || WhichMonth == "11¿ù") DaysInMonth = 30;		//4¿ù6¿ù 9¿ù 11¿ùÀº 30ÀÏ
				if (WhichMonth == "2¿ù" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;		//2¿ù´ÞÀº 4·Î³ª´©¾î(À±´ÞÀº4³â¸¶´Ù ÇÑ¹ø¾¿)Ã¼Å©
				if (WhichMonth == "2¿ù" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;	//2¿ù´ÞÀº 4·Î³ª´©¾î(À±´ÞÀº4³â¸¶´Ù ÇÑ¹ø¾¿)Ã¼Å©
				return DaysInMonth;			//DaysInMonth È£ÃâÇÑ ÇÔ¼ö·Î µ¹·Á ÁØ´Ù
			}

			function ChangeOptionDays(formName,Which)
			{
				DaysObject = eval("document."+formName+"." + Which + "Day");
				MonthObject = eval("document."+formName+"." + Which + "Month");
				YearObject = eval("document."+formName+"." + Which + "Year");

				Month = MonthObject[MonthObject.selectedIndex].text;
				//Year = YearObject[YearObject.selectedIndex].text;
				//Month = MonthObject[MonthObject.selectedIndex].value;
				Year = YearObject[YearObject.selectedIndex].value;
				
				DaysForThisSelection = DaysInMonth(Month, Year);

				CurrentDaysInSelection = DaysObject.length;

				if (CurrentDaysInSelection > DaysForThisSelection)
				{
					for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
					{
						DaysObject.options[DaysObject.options.length - 1] = null
					}
				}

				if (DaysForThisSelection > CurrentDaysInSelection)
				{
					for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
					{
						NewOption = new Option(DaysObject.options.length + 1);
						DaysObject.add(NewOption);
					}
				}

				if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
			}

			function SetToToday(formName,Which)
			{

				DaysObject = eval("document."+formName+"." + Which + "Day");
				MonthObject = eval("document."+formName+"." + Which + "Month");
				YearObject = eval("document."+formName+"." + Which + "Year");


			//	YearObject[0].selected = true;
				MonthObject[NowMonth].selected = true;

				ChangeOptionDays(formName,Which);

				DaysObject[NowDay-1].selected = true;
			}

		/*
			function WriteYearOptions(YearsAhead)
			{
				line = "";

				for (i=0; i<YearsAhead; i++)
				{
					line += "<OPTION value=";
					line += NowYear + i + ">";
					line += NowYear + i + "³â" ;
				}

				return line;
			}
		*/
	//¿¹¾à ³¯Â¥ ¼±ÅÃÇÏ±â¿¡ ÇÊ¿äÇÑ ¼Ò½º ¿©±â±îÁö ÀÔ´Ï´Ù.	