<!--
 
/* -----------------------------------------------------
	   큰이미지보기 창띄우기
	----------------------------------------------------- */
 
function fnPic_Show(hCode)
{
	LeftPosition=(screen.width)?(screen.width)/2 - 200:300;
	TopPosition=(screen.height)?(screen.height)/2 - 150:450;

	window.open('/hotel/hotel_imgshow.asp?hCode='+hCode,'IMAGE_VIEW','width=600, height=588,top='+TopPosition+',left='+LeftPosition+',scrollbars=no, status=no');
}


/* -----------------------------------------------------
	   작은이미지가 큰이미지 창으로 교체되어 보이게 됨.
	----------------------------------------------------- */

function fnViewimg(mode)
{
	var nowcnt = frmimgcnt.nowcnt.value;
	var imgcnt = frmimgcnt.imgcnt.value;

	for(var i=1;i<=imgcnt;i++)
	{
		var img = "img"+i;
		document.all[img].style.display='none';
	}

	if(mode=="pre")
	{
		if(nowcnt==1)
		{
			var imgs = "img"+nowcnt;
			document.all[imgs].style.display='';
			alert("가장 처음 이미지입니다.");
			return;
		}else{
			frmimgcnt.nowcnt.value=parseInt(frmimgcnt.nowcnt.value)-1;
			nowcnt = frmimgcnt.nowcnt.value;
			var imgs = "img"+nowcnt;
			document.all[imgs].style.display='';
		}
	}else{
		if(nowcnt==imgcnt)
		{
			var imgs = "img"+nowcnt;
			document.all[imgs].style.display='';
			alert("가장 마지막 이미지입니다.");
			return;
		}else{
			frmimgcnt.nowcnt.value=parseInt(frmimgcnt.nowcnt.value)+1;
			nowcnt = frmimgcnt.nowcnt.value;
			var imgs = "img"+nowcnt;
			document.all[imgs].style.display='';
		}

	}
}


function imgchg(name,img){
name.src = img;
}			 



//사이트 즐겨찾기

var favoriteurl="http://www.hoteljoa.com/" 
var favoritetitle="실기간 호텔예약 - 호텔조아" 
	function addfavorites(){ 
	if (document.all) 
	window.external.AddFavorite(favoriteurl,favoritetitle)
} 

//호텔상세보기에서 즐겨찾기
function addfavoritesView(favoriteurl,favoritetitle){ 
if (document.all) 
window.external.AddFavorite(favoriteurl,favoritetitle)} 

 
function Fun_Copy(strData) {
clipboardData.setData("Text", strData);
alert("해당 호텔 페이지의 주소가 복사되었습니다.\n Ctrl+V로 붙혀넣기 하시면 됩니다.");}
 

function FunWinOpen(Hcode,URL,Title,Height,Width)
{
	 LeftPosition=(screen.width)?(screen.width)/2 - 200:300;
	TopPosition=(screen.height)?(screen.height)/2 - 150:450;

  window.open(URL+'?Hcode='+Hcode,Title,'width='+Width +', height='+Height +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes, status=no');
}

function FunWinOpen2(URL,Title,Height,Width)
{
	 LeftPosition=(screen.width)?(screen.width)/2 - 200:300;
	TopPosition=(screen.height)?(screen.height)/2 - 150:450;

  window.open(URL,Title,'width='+Width +', height='+Height +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes, status=no');
}




		/* 사용HTML
		
		   <table width="268" height="207" cellpadding="0" cellspacing="1" border="0" bgcolor="#CCCCCC">
			<tr>
			<td bgcolor="#FFFFFF" align="center">
			
			<!-- 큰 사진 -->
			<img id="mainimg" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_1.jpg" width="260" height="199" border="0" align="absmiddle" onerror="this.src='/img/bg_noimagel.gif'"></td>
			</tr>
			</table>

			<!-- 작은사진 -->
			<table height="62" cellpadding="0" cellspacing="0" border="0">
			<tr>
			<td width="14"><a href="Javascript:fnViewimg('pre');"><img src="http://www.hoteltrees.com/img/hotel/bt_preimage.gif" border="0" align="absmiddle"></a></td>
			<td width="240" align="center">
				<table border="0" width="100%">
					<tr id="img1">

				<td width="60" align="center"><img id="imgCnt1" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_1.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_1.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center"><img id="imgCnt2" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_2.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_2.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center"><img id="imgCnt3" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_3.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_3.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center"><img id="imgCnt4" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_4.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_4.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

					</tr>
					<tr id="img2" style="display:none">

				<td width="60" align="center"><img id="imgCnt5" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_5.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_5.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center"><img id="imgCnt6" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_6.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_6.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center"><img id="imgCnt7" style="display:" src="http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_7.jpg" width="57" height="45" border="0" align="absmiddle" onclick="mainimg.src='http://www.hoteltrees.com/hotel/hotelimg/JP/TYO/JPTYO_0132_7.jpg'" style="cursor:hand" onerror="this.src='/img/bg_noimages.gif'">
				</td>

				<td width="60" align="center">&nbsp;</td>

					</tr>
				</table>
			</td>
			<td width="14" align="right"><a href="Javascript:fnViewimg('next');"><img src="http://www.hoteltrees.com/img/hotel/bt_nextimage.gif" style="cursor:hand" border="0" align="absmiddle"></a></td>
			</tr>
			<form name="frmimgcnt">
			<input type="hidden" name="imgcnt" value="2">
			<input type="hidden" name="nowcnt" value="1">
			</form>
			</table>

			<table width="268" height="20" cellpadding="0" cellspacing="0" border="0">
			<tr>
			<td align="right">
			
			<!-- 크게보기 버튼 -->
			<a href="Javascript:fnPic_Show('JPTYO_0132');"><img src="http://www.hoteltrees.com/img/hotel/bt_zoom.gif" border="0"></a><!--<a href="/Hotel/hotel_list.asp?smode=S&page=&area=JP&nationcd=JP&citycd=TYO&Shnm=&ciDt=2007-11-06&coDt=2007-11-07&ngt=1&rmType1=SB&rmQty1=1&rmType2=&rmQty2=0">aaa</a>--></td>
			</tr>
			</table>	*/
  
	

	
	/* -----------------------------------------------------
	   예약자 본인포함
	----------------------------------------------------- */
 

//-------------------------------------------------------
// 주민번호 check Main Function.
//-------------------------------------------------------
function id_no_chk(obj1,obj2)    
{
    // CheckSum 체크
    if (chksumID(obj1,obj2) == false)
        return false;

    strReg1 = obj1.value;
    strReg2 = obj2.value;

    sGender = strReg2.substring(0,1);
    sYear = strReg1.substring(0,2);

    // 두번째 단락 첫번째 숫자는 4보다 클 수 없다.
    if (sGender > 4) {
        return false;
    }
    
    // 2000년도 이전은 남자는 1, 여자는 2
    // 2000년도 이후는 남자는 3, 여자는 4
    if (sYear != '00') {
        if ((sGender != '1') && (sGender != '2')) {
            alert( "aaa" );
            return false;
        }
    } else {
        if ((sGender != '3') && (sGender != '4')) {
            return false;
        }
    }
        
    // 생성기로 만든게 아닌가 생년월일 체크
    if (ValidRegNo(obj1) == false)
        return false; 
}

//-------------------------------------------------------
// 주민번호 앞자리 check check.
//-------------------------------------------------------
function ValidRegNo(obj1)    
{
    strReg1 = obj1.value;

    // YYMMDD가 맞는지 확인한다.
    a = new String(strReg1);

    if(a == '') return false;
    if(a.length != 6 ) return false;

    intYear = parseInt(a.substring(0,2) , 10);
    intMonth = parseInt(a.substring(2,4) , 10);
    intDay = parseInt(a.substring(4,6) , 10);
    
    if(intMonth < 0 || intMonth > 12){ 
        return false;
    }
        
    switch(intMonth){
        case 2 :
            if(intDay < 0 || intDay > 29){
                return false;
                breake;
            }
        case 4 :
            if(intDay < 0 || intDay > 30){
                return false;
                breake;
            }
        case 6 :
            if(intDay < 0 || intDay > 30){
                return false;
                breake;
            }
        case 9 :
            if(intDay < 0 || intDay > 30){
                return false;
                breake;
            }
        case 11 :
            if(intDay < 0 || intDay > 30){
                return false;
                breake;
            }
        default :
            if(intDay < 0 || intDay > 31){
                return false;
                breake;
            }
    }
    
    return true;
}

//-------------------------------------------------------
// 주민번호 checksum check.
//-------------------------------------------------------
function chksumID(obj1,obj2)    
{
    //숫자로만구성되어 있는지 Test할 정규표현.
	var regExpr = /^[0-9]+$/;

    var str1 = obj1.value;
    var str2 = obj2.value;
    var li_lastid,li_mod,li_minus,li_last;
    var value0,value1,value2,value3,value4,value5,value6;
    var value7,value8,value9,value10,value11,value12;
    
    if (regExpr.test(str1) &&  regExpr.test(str2)) {
        li_lastid    = parseFloat(str2.substring(6,7));
        value0  = parseFloat(str1.substring(0,1))  * 2;
        value1  = parseFloat(str1.substring(1,2))  * 3;
        value2  = parseFloat(str1.substring(2,3))  * 4;
        value3  = parseFloat(str1.substring(3,4))  * 5;
        value4  = parseFloat(str1.substring(4,5))  * 6;
        value5  = parseFloat(str1.substring(5,6))  * 7;
        value6  = parseFloat(str2.substring(0,1))  * 8;
        value7  = parseFloat(str2.substring(1,2))  * 9;
        value8  = parseFloat(str2.substring(2,3))  * 2;
        value9  = parseFloat(str2.substring(3,4))  * 3;
        value10 = parseFloat(str2.substring(4,5))  * 4;
        value11 = parseFloat(str2.substring(5,6))  * 5;
        value12 = 0;
        
        value12 = value0+value1+value2+value3+value4+value5+value6+value7+value8+value9+value10+value11+value12 ;
        
        li_mod = value12 %11;
        li_minus = 11 - li_mod;
        li_last = li_minus % 10;
        if (li_last != li_lastid){
            return false;
        } else
            return true;
    } else
    return false;
}



// 주어진 문자열이 비어있는지 검사한다.(true:비어진경우, false:비지않은경우)
function IsEmpty(m_str)
{
	var LNum;
	
	LNum = m_str.length;
	
	for(i=0;i<LNum;i++) {
		m_str = m_str.replace(" ", "");
	}
	
	if (m_str == "") {
		return true;
	} else {
		return false;
	}
}

//메일주소가 적합한지 검사(true:적합한 메일주소, false:적합하지않은 메일)
function IsEmail(E_value)
{
	var strEmail = E_value.value;
    var i;
    var strCheck1 = false;
    var strCheck2 = false;
	var iEmailLen = strEmail.length

	if (iEmailLen > 0) {
		// strEmail 에 '.@', '@.' 이 있는 경우 에러메시지.
		// strEmail의 맨앞 또는 맨뒤에  '@', '.' 이 있는 경우 에러메시지.
		if ((strEmail.indexOf(".@") != -1) || (strEmail.indexOf("@.") != -1) ||
			(strEmail.substring(0,1) == ".") || (strEmail.substring(0,1) == "@") ||
			(strEmail.substring(iEmailLen-1,iEmailLen) == ".") || (strEmail.substring(iEmailLen-1,iEmailLen) == "@"))
		{   
			return false;
		}
		
	    for(i=0; i < iEmailLen; i++) {
	        if ((strEmail.substring(i,i+1) == ".") || 
	        	(strEmail.substring(i,i+1) == "-") || (strEmail.substring(i,i+1) == "_") ||
	           ((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) ||
	           ((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) ||
	           ((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z"))) {
	                if (strEmail.substring(i,i+1) == ".")
						strCheck1 = true;
	                if (strEmail.substring(i,i+1) == "@")
						strCheck2 = true;
	        }
	        else {
				return false;
	        }
	    }
	
	    if ((strCheck1 == false) || (strCheck2 == false)) {
	        return false;
	    }
	}
    return true;
}

// 주어진 문자열이 숫자로만 이루어져있는지 검사한다.
function IsNumber(m_num)
{
	if (!IsEmpty(m_num)) {
		for (j = 0; j < m_num.length; j++)
			if (((m_num.substring(j, j+1) < "0") || (m_num.substring(j, j+1) > "9")))
				return false;
	} else {
		return false;
	}
	return true;
}


function doBlink() {
var blink = document.all.tags("BLINK")
for (var i=0; i < blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
if (document.all)
setInterval("doBlink()",500)
}

 -->





