﻿function onload_Eve()
{
    var checkInDate = document.getElementsByName("checkInDate")[0]; 
    var now_date   = new Date();
    var s_year     = now_date.getYear();
    if( s_year<1900) s_year=s_year+1900;
    var s_month    = return0(now_date.getMonth()+1);
    var s_day      = return0(now_date.getDate()+7);
    now_date = new Date(s_year, s_month, s_day)
    s_year     = now_date.getYear();
    if( s_year<1900) s_year=s_year+1900;
    s_month    = return0(now_date.getMonth());
    s_day      = return0(now_date.getDate()+1);
    
	var room_2 = document.all["location1"];         
	    if(checkInDate.value=="")
	    {
       		checkInDate.value = s_year + "-" + s_month + "-" + s_day;
            ValofcheckOutDate();
            room_2.selectedIndex = 1;	                
	    }	  
                  		    
}

function Room_add() {
        var count = 0;
        for(i=1;i<4;i++) {
                name = 'pro'+(i+1);
                if(document.all[name].style.display == "") count++;                    
        }            
        
        if(count == 0) {
                //var room_1 = document.all["r_type1"];       
                //var room_2 = document.all["r_type2"];                                  
                name = 'pro2';
                var pro2 = document.all[name];
                /*
                   var tempHtml = "";
                   if(room_1.selectedIndex == 1)
                   {                        
                        tempHtml +=  "<OPTION value='DBL'>===DOUBLE(2人)===</OPTION> ";  
                        tempHtml +=  "<OPTION value='TRP'>===TWIN(2人)===</OPTION> "  
                        tempHtml +=  "<OPTION value='ETC'>===ETC(4人以上)===</OPTION>";                         
                   }
                   if(room_1.selectedIndex == 2)
                   {  
                        tempHtml +=  "<OPTION value=SGL>===SINGLE(1人)===</OPTION> ";
                        tempHtml +=  "<OPTION value=TRP>===TRIPLE(3人)===</OPTION> "  
                        tempHtml +=  "<OPTION value=ETC>===ETC(4人以上)===</OPTION>";                          
                   }
                   if(room_1.selectedIndex == 3)
                   {  
                        tempHtml +=  "<OPTION value=SGL>===SINGLE(1人)===</OPTION> ";
                        tempHtml +=  "<OPTION value=DBL>===DOUBLE(2人)===</OPTION> "; 
                        tempHtml +=  "<OPTION value=ETC>===ETC(4人以上)===</OPTION>";                            
                   }  
                   if(room_1.selectedIndex == 4)
                   {  
                        tempHtml +=  "<OPTION value=SGL>===SINGLE(1人)===</OPTION> ";
                        tempHtml +=  "<OPTION value=DBL>===DOUBLE(2人)===</OPTION> ";  
                        tempHtml +=  "<OPTION value=TRP>===TRIPLE(3人)===</OPTION> "; 
                  
                   }                                              
                //깨짐 나중에 해결
                //room_2.innerHTML = tempHtml;
                */
                pro2.style.display="";
                
        }
        else if(count == 1) {
                name = 'pro3';
                document.all[name].style.display = "";
        }
        else if(count == 2) {
                name = 'pro4';
                document.all[name].style.display = "";
        }
        else if(count == 3) {
                alert('Not Add Room Type.'); //더이상 룸타입을 추가 하실수 없습니다.');
                return;
        }
}
    
function selNum(param){
	var targetForm = document.form1;
	var r_num = "r_num"+param;
	var r_type = "r_type"+param;
	if(targetForm.elements[r_type].value == '') 
		targetForm.elements[r_num].selectedIndex = 0;
	else 
		targetForm.elements[r_num].selectedIndex = 1;
}
    
function addRoom() {
	var count = 0;
	for(i=1;i<4;i++) {
		name = 'pro'+(i+1);
		if(document.all[name].style.display == "") count++;
	}
	if(count == 0) {
		name = 'pro2'
		document.all[name].style.display = "";
	}
	else if(count == 1) {
		name = 'pro3'
		document.all[name].style.display = "";
	}
	else if(count == 2) {
		name = 'pro4'
		document.all[name].style.display = "";
	}
	else if(count == 3) {
        alert(document.getElementById("hidalert_addroom").value);
        return;
	}
}    


function agent_addRoom() {
	var count = 0;
	for(i=5;i<8;i++) {
		name = 'pro'+(i+1);
		if(document.all[name].style.display == "") count++;
	}
	if(count == 0) {
		name = 'pro6'
		document.all[name].style.display = "";
	}
	else if(count == 1) {
		name = 'pro7'
		document.all[name].style.display = "";
	}
	else if(count == 2) {
		name = 'pro8'
		document.all[name].style.display = "";
	}
	else if(count == 3) {
        alert(document.getElementById("hidalert_addroom").value);
        return;
	}
}    

///////////////////////////////// 호텔검색 유효성 체크 ///////////////////////////////
function hotel_search(no_room, hidSi_Type, page, Type, re_search) {

    if(Type != null && (Type == "china" || Type == "world"))
    {
        if(document.getElementById("location1").value == '') 
        {
            //alert('Select City!\n'); //도시를 선택해 주세요!\n');
            alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
            
            if(document.getElementById("type") != null && document.getElementById("type").value != "china" && document.getElementById("type").value != "world")
                document.getElementById("location1").focus();
            return;
        }    
    }

    else if(document.getElementById("category") != null) {      
        if(document.getElementById("category").value == '')
        {
            if((document.getElementById("h_name").value).length <1) 
            {
                if(document.getElementById("location1").value == '') {
                        //alert('Select City!\n'); //도시를 선택해 주세요!\n');
                        alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
                        
                        if(document.getElementById("type") != null && document.getElementById("type").value != "china" && document.getElementById("type").value != "world")
                            document.getElementById("location1").focus();
                            
                        return;
                }
            }
        }	
    }
    else if(Type != "today")
    {
        if((document.getElementById("h_name").value).length <1) 
        {
            if(document.getElementById("location1").value == '') {
                    //alert('Select City!\n'); //도시를 선택해 주세요!\n');
                    alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
                    
                    if(document.getElementById("type") != null && document.getElementById("type").value != "china" && document.getElementById("type").value != "world")
                        document.getElementById("location1").focus();
                    return;
            }
        }	    
    }
//	 if((document.getElementById("h_name").value).length <1) 
//	{	
//		if(document.getElementById("category") && document.getElementsByName("category"))
//		{		
//			if(document.getElementById("category").id == "category") //호텔재팬 메인
//			{
//				if(document.getElementById("dis_category1").style.display == "") //호텔재팬메인페이지중 호텔 과 료칸 구분
//				{
//					if(document.getElementById("location1").value == "")
//					{
//						alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n'); 	
//						document.getElementById("location1").focus();
//						 return;
//					}
//				}	
//				else
//				{
//					if(document.getElementById("location11").value == "")
//					{
//						 alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n'); 
//						 document.getElementById("location11").focus();
//						 return;
//					}
//				}
//			}
//			else //bbc
//			{				
//				if(document.getElementById("location1").value == "")
//				{
//					alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n'); 
//					document.getElementById("location1").focus();
//					 return;
//				}
//			}
//		}
//		else //그외
//		{			
//			if(document.getElementById("location1").value == "")
//			{
//				alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');	
//				document.getElementById("location1").focus();
//				 return;
//			}
//		}
//	}  09-09-14 주석처리

    if(document.getElementById("checkInDate").value == '') {
            alert('Select Checkin!\n'); //체크인 일자를 선택해 주세요!\n');
            document.getElementById("checkInDate").focus();
            return;
    }
    if(document.getElementById("night").value == '') {
            //alert('Select Night!\n'); //박수를 선택해 주세요!\n');
            alert(document.getElementById("hidalert_selectcity").value);
            document.getElementById("night").focus();
            return;
    }
    
//    if(no_room == "")
//    {
//    
//        if(document.getElementById("r_type1").value == '' && document.getElementById("r_type2").value == '' && document.getElementById("r_type3").value == '' && document.getElementById("r_type4").value == '') {
//                //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
//                alert(document.getElementById("hidalert_selectroom").value); 
//                return;
//        }
//        if(document.getElementById("r_type1").value != '' && document.getElementById("r_num1").value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.getElementsByName("r_num1").focus();
//                return;
//        }
//        if(document.getElementById("r_type2").value != '' && document.getElementById("r_num2").value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.getElementsByName("r_num2").focus();
//                return;
//        }
//        if(document.getElementById("r_type3").value != '' && document.getElementById("r_num3").value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.getElementsByName("r_num3").focus();
//                return;
//        }
//        if(document.getElementById("r_type4").value != '' && document.getElementById("r_num4").value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.getElementsByName("r_num4").focus();
//                return;
//        }
//    }

        var strR_num1 = document.getElementById("r_num1").value;
        var strR_num2 = document.getElementById("r_num2").value;
        var strR_num3 = document.getElementById("r_num3").value;
        var strR_num4 = document.getElementById("r_num4").value;
        
        if(document.getElementById("r_num5") != null)
            var strR_num5 = document.getElementById("r_num5").value;
            
        else 
            var strR_num5 = "0";

        if(no_room == "" && strR_num1 == "0" && strR_num2 == "0" && strR_num3 == "0" && strR_num4 == "0" && strR_num5 == "0")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }

        var strR_type1 = document.getElementById("r_type1").value;
        var strR_type2 = document.getElementById("r_type2").value;
        var strR_type3 = document.getElementById("r_type3").value;
        var strR_type4 = document.getElementById("r_type4").value;
        
        if(document.getElementById("r_type5") != null && Type != null && Type == "agent")
        {
            if(document.getElementById("na_code") == null || document.getElementById("na_code").value == "" || document.getElementById("na_code").value == "1" || document.getElementById("na_code").value == "2")
            {
                var strR_type5 = "";
                Type = "";
            }
        }

        else if(document.getElementById("r_type5") != null)
	    var strR_type5 = document.getElementById("r_type5").value;
            
        else 
            var strR_type5 = "";

        if(no_room != "1" && strR_type1 == "" && strR_type2 == "" && strR_type3 == "" && strR_type4 == "" && strR_type5 == "")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }
        
        if(document.getElementById("r_num1").value == "0")
            document.getElementById("r_type1").value = ""
        
        if(document.getElementById("r_num2").value == "0")
            document.getElementById("r_type2").value = ""
            
        if(document.getElementById("r_num3").value == "0")
            document.getElementById("r_type3").value = ""
            
        if(document.getElementById("r_num4").value == "0")
            document.getElementById("r_type4").value = ""
        
    
    if(document.form1.location3 != null)
        document.form1.location3.value = "";
    
    if(document.form1.location4 != null)    
        document.form1.location4.value = "";
    
    if(document.form1.location5 != null)        
        document.form1.location5.value = "";
    
    if(document.form1.location6 != null)            
        document.form1.location6.value = "";
            
    //호텔인포 저팬 구분
    var arg1 = '', arg2 = '';    
    if(hidSi_Type != '')
    {
        arg1 = '?hidSi_Type=' + hidSi_Type 
        arg2 = '&hidSi_Type=' + hidSi_Type 
    }
    
    if(document.getElementById("OnlyBlock") != null && document.getElementById("OnlyBlock").value == "1")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&OnlyBlock=1";
            arg2 = arg2 + "&OnlyBlock=1";
        }
        else if(arg1 == "")
        {
            arg1 = "?OnlyBlock=1";
            arg2 = "&OnlyBlock=1";
        }
    }
    
    if(document.getElementById("location1")[1] != null && document.getElementById("location1")[1].na_code != null && document.getElementById("location1")[1].na_code == "3") // && document.getElementById("ddlNation") != null)
    {
        var _strLocation = document.getElementById("location1")[document.getElementById("location1").selectedIndex].na_code;

        if(document.getElementById("ddlNation") != null && document.getElementById("ddlNation").value == "" && _strLocation == null)
        {
            alert("国を入力してください");
            document.getElementById("ddlNation").focus();
            return;
        }
        
        else if(document.getElementById("ddlNation") != null && document.getElementById("ddlNation").value != "")
        {
            if(arg1 != "")
            {
                arg1 = arg1 + "&na_code=" + document.getElementById("ddlNation").value;
                arg2 = arg2 + "&na_code=" + document.getElementById("ddlNation").value;
            }
            else if(arg1 == "")
            {
                arg1 = "?na_code=" + document.getElementById("ddlNation").value;
                arg2 = "&na_code=" + document.getElementById("ddlNation").value;
            }
        }
        
        else if(_strLocation != "")
        {
            if(arg1 != "")
            {
                arg1 = arg1 + "&na_code=" + _strLocation;
                arg2 = arg2 + "&na_code=" + _strLocation;
            }
            else if(arg1 == "")
            {
                arg1 = "?na_code=" + _strLocation;
                arg2 = "&na_code=" + _strLocation;
            }
        }

    }
    
    if(page != null && page != "")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&page=" + page;
            arg2 = arg2 + "&page=" + page;
        }
        else if(arg1 == "")
        {
            arg1 = "?page=" + page;
            arg2 = "&page=" + page;
        }
    }
    
    if(Type != null && Type != "map" && Type != "gmarket")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&type=" + Type;
            arg2 = arg2 + "&type=" + Type;
        }
        else if(arg1 == "")
        {
            arg1 = "?type=" + Type;
            arg2 = "&type=" + Type;
        }
    }
    
    if(re_search != null && re_search == "1")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&re_search=1";
            arg2 = arg2 + "&re_search=1";
        }
        else if(arg1 == "")
        {
            arg1 = "?re_search=1";
            arg2 = "&re_search=1";
        }
    }
    
    if(document.getElementById("rboSearchType") != null && !(document.form1.rboSearchType[0].checked))
    {
        var SearchType = "";
        
        for(var i = 0; i < document.form1.rboSearchType.length; i++)
        {
            if(document.form1.rboSearchType[i].checked == true)
                SearchType = document.form1.rboSearchType[i].value;
        }
        if(arg1 != "")
        {
            arg1 = arg1 + "&h_level=" + SearchType;
            arg2 = arg2 + "&h_level=" + SearchType;
        }
        else if(arg1 == "")
        {
            arg1 = "?h_level=" + SearchType;
            arg2 = "&h_level=" + SearchType;
        }
    }

    if (document.getElementById("na_code") != null && document.getElementById("na_code").value != "" && document.getElementById("na_code").value != "1" && document.getElementById("na_code").value != "2" && Type == "agent")
        document.form1.action = "http://www.bicoing.com/Travel/Hotel/BicoIng/HotelSearchList.aspx" + arg1;
    else if (Type != null && (Type == "china" || Type == "world"))
        document.form1.action = "http://www.ohmyhotel.com/Travel/Hotel/OverSeas/HotelSearchList.aspx" + arg1;
    else if(Type != null && (Type == "map" || Type == "map_world"))
        document.form1.action = "../reservation/hotel_search_map.aspx"+arg1;
    else if(no_room == '')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else if(document.form1.r_type1.value != '' && document.form1.r_num1.value != '0')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else    
        document.form1.action = "../reservation/hotel_search_list.aspx?no_room_type=" + no_room + arg2;
    
    InsertScriptToHead();

    if(Type != null && Type == "gmarket")
        document.form1.target = "_top";

	document.form1.submit();
}

function InsertScriptToHead()
{
	var head= document.getElementsByTagName('head')[0];		
	var script= document.createElement('script');
	script.type= 'text/javascript';		
	script.charset = "euc-kr";
	script.src = "../../javascript/activex.js";
	head.appendChild(script);       
	var loaded = false;	
	if(navigator.appName == "Microsoft Internet Explorer"){
		script.onreadystatechange= function () {
			if (this.readyState == 'loaded' || this.readyState == 'complete') {
				if (loaded) {
					return;
				}
				loaded = true;

		if(document.getElementById('divMain') != null)
                    document.getElementById('divMain').style.display='none';

		if(document.getElementById('wrapper') != null)
                    document.getElementById('wrapper').style.display='none';

		if(document.getElementById('wrap') != null)
                    document.getElementById('wrap').style.display='none';
                    
                if(document.getElementById('Bar1') != null)
                    document.getElementById('Bar1').style.display='none';
                    
                if(document.getElementById('loading') != null)    
				    document.getElementById("loading").style.display = "";
				    
				if(document.getElementById("scrollBar") != null)
					document.getElementById("scrollBar").style.display = "";
			}
		}
	}
	else if(navigator.appName == "Netscape"){
		//script.onload = function () {	
		
		if(document.getElementById('divMain') != null)
                    document.getElementById('divMain').style.display='none';

		if(document.getElementById('wrapper') != null)
                    document.getElementById('wrapper').style.display='none';
                
            if(document.getElementById('Bar1') != null)
                document.getElementById('Bar1').style.display='none';
                
			if(document.getElementById('loading') != null)    
				    document.getElementById("loading").style.display = "";
				    
			if(document.getElementById("scrollBar") != null)
					document.getElementById("scrollBar").style.display = "";
		//}
	}

}

function agent_hotel_search(no_room, hidSi_Type, page, Type) {
    
    if(document.form1.category1 != null) {        
        if(document.form1.category1.value == '')
        {
            if((document.form1.h_name1.value).length <1) 
            {
                if(document.form1.location3.value == '') {
                        //alert('Select City!\n'); //도시를 선택해 주세요!\n');
                        alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
                        document.form1.location3.focus();
                        return;
                }
            }
        }	
    }
    else
    {
        if((document.form1.h_name1.value).length <1) 
        {
            if(document.form1.location3.value == '') {
                    //alert('Select City!\n'); //도시를 선택해 주세요!\n');
                    alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
                    document.form1.location3.focus();
                    return;
            }
        }	    
    }

    if(document.form1.checkInDate1.value == '') {
            alert('Select Checkin!\n'); //체크인 일자를 선택해 주세요!\n');
            document.form1.checkInDate1.focus();
            return;
    }
    if(document.form1.night1.value == '') {
            alert('Select Night!\n'); //박수를 선택해 주세요!\n');
            document.form1.night1.focus();
            return;
    }
    if(no_room == '')
    {
    
//        if(document.form1.r_type5.value == '' && document.form1.r_type6.value == '' && document.form1.r_type7.value == '' && document.form1.r_type8.value == '') {
//                //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
//                alert(document.getElementById("hidalert_selectroom").value); 
//                return;
//        }
//        if(document.form1.r_type5.value != '' && document.form1.r_num5.value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.form1.r_num5.focus();
//                return;
//        }
//        if(document.form1.r_type6.value != '' && document.form1.r_num6.value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.form1.r_num6.focus();
//                return;
//        }
//        if(document.form1.r_type7.value != '' && document.form1.r_num7.value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.form1.r_num7.focus();
//                return;
//        }
//        if(document.form1.r_type8.value != '' && document.form1.r_num8.value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.form1.r_num8.focus();
//                return;
//        }

        var strR_num1 = document.getElementById("r_num5").value;
        var strR_num2 = document.getElementById("r_num6").value;
        var strR_num3 = document.getElementById("r_num7").value;
        var strR_num4 = document.getElementById("r_num8").value;

        if(no_room == "" && strR_num1 == "0" && strR_num2 == "0" && strR_num3 == "0" && strR_num4 == "0")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }

        var strR_type1 = document.getElementById("r_type5").value;
        var strR_type2 = document.getElementById("r_type6").value;
        var strR_type3 = document.getElementById("r_type7").value;
        var strR_type4 = document.getElementById("r_type8").value;
        

        if(no_room == "" && strR_type1 == "" && strR_type2 == "" && strR_type3 == "" && strR_type4 == "")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }
        
        if(document.getElementById("r_num5").value == "0")
            document.getElementById("r_type5").value = ""
        
        if(document.getElementById("r_num6").value == "0")
            document.getElementById("r_type6").value = ""
            
        if(document.getElementById("r_num7").value == "0")
            document.getElementById("r_type7").value = ""
            
        if(document.getElementById("r_num8").value == "0")
            document.getElementById("r_type8").value = ""
    }
        
    document.form1.h_name.value = document.form1.h_name1.value;
    document.form1.location1.value = "";
    document.form1.location2.value = "";
    
    if(document.form1.location5 != null)
        document.form1.location5.value = "";
    
    if(document.form1.location6 != null)    
        document.form1.location6.value = "";
        
    document.form1.checkInDate.value = document.form1.checkInDate1.value;
    document.form1.checkOutDate.value = document.form1.checkOutDate1.value;
    document.form1.night.value = document.form1.night1.value;
    document.form1.r_type1.value = document.form1.r_type5.value;
    document.form1.r_type2.value = document.form1.r_type6.value;
    document.form1.r_type3.value = document.form1.r_type7.value;
    document.form1.r_type4.value = document.form1.r_type8.value;
    document.form1.r_num1.value = document.form1.r_num5.value;
    document.form1.r_num2.value = document.form1.r_num6.value;
    document.form1.r_num3.value = document.form1.r_num7.value;
    document.form1.r_num4.value = document.form1.r_num8.value;

    document.form1.r_type5.value = "";
    document.form1.r_type6.value = "";
    document.form1.r_type7.value = "";
    document.form1.r_type8.value = "";
    
    
    //호텔인포 저팬 구분
    var arg1 = '', arg2 = '';    
    if(hidSi_Type != '')
    {
        arg1 = '?hidSi_Type=' + hidSi_Type 
        arg2 = '&hidSi_Type=' + hidSi_Type 
    }
    
    if(document.getElementById("OnlyBlock") != null && document.getElementById("OnlyBlock").value == "1")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&OnlyBlock=1";
            arg2 = arg2 + "&OnlyBlock=1";
        }
        else if(arg1 == "")
        {
            arg1 = "?OnlyBlock=1";
            arg2 = "&OnlyBlock=1";
        }
    }
    
    if(page != null)
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&page=" + page;
            arg2 = arg2 + "&page=" + page;
        }
        else if(arg1 == "")
        {
            arg1 = "?page=" + page;
            arg2 = "&page=" + page;
        }
    }
    
    if(Type != null && Type != "map")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&type=" + Type;
            arg2 = arg2 + "&type=" + Type;
        }
        else if(arg1 == "")
        {
            arg1 = "?type=" + Type;
            arg2 = "&type=" + Type;
        }
    }
    
    if(document.form1.rboSearchType1 != null && document.form1.rboSearchType1.value != "")
    {
        var SearchType = "";
        
        for(var i = 0; i < document.form1.rboSearchType1.length; i++)
        {
            if(document.form1.rboSearchType1[i].checked == true)
                SearchType = document.form1.rboSearchType1[i].value;
        }
        if(arg1 != "")
        {
            arg1 = arg1 + "&h_level=" + SearchType;
            arg2 = arg2 + "&h_level=" + SearchType;
        }
        else if(arg1 == "")
        {
            arg1 = "?h_level=" + SearchType;
            arg2 = "&h_level=" + SearchType;
        }
    }

    if (document.getElementById("na_code") != null && document.getElementById("na_code").value != "" && document.getElementById("na_code").value != "1" && document.getElementById("na_code").value != "2" && Type == "agent")
        document.form1.action = "http://www.ohmyhotel.com/Travel/Hotel/BicoIng/HotelSearchList.aspx" + arg1;
    else if (Type != null && (Type == "china" || Type == "world"))
        document.form1.action = "http://www.bicoing.com/Travel/Hotel/OverSeas/HotelSearchList.aspx" + arg1;
    else if(no_room == '')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else if(document.form1.r_type5.value != '' && document.form1.r_num5.value != '0')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else    
        document.form1.action = "../reservation/hotel_search_list.aspx?no_room_type=" + no_room + arg2;
        
    if(document.getElementById('divMain') != null)
        document.getElementById('divMain').style.display='none';
        
    if(document.getElementById('body_bg') != null)
        document.getElementById('body_bg').style.display='none';
        
    if(document.getElementById('wrapper') != null)
        document.getElementById('wrapper').style.display='none';
        
    if(document.getElementById('Bar1') != null)
        document.getElementById('Bar1').style.display='none';
        
    if(document.getElementById('loading') != null)
        document.getElementById('loading').style.display='';

	document.form1.submit();
}

function agent_hotel_search_china(no_room, hidSi_Type, page, Type) {
    
    if(document.form1.Na_code)
   {
        if(document.form1.Na_code.value == '')
        {
            alert(document.getElementById("hidalert_selectnation").value);
            document.form1.Na_code.focus();
            return;  
        }
   } 
    
//    if((document.form1.h_name2.value).length <1) 
//    {
        if(document.form1.location5.value == '') {
                //alert('Select City!\n'); //도시를 선택해 주세요!\n');
                alert(document.getElementById("hidalert_selectcity").value); //도시를 선택해 주세요!\n');
                document.form1.location5.focus();
                return;
        }
//    }	

    if(document.form1.checkInDate2.value == '') {
            alert('Select Checkin!\n'); //체크인 일자를 선택해 주세요!\n');
            document.form1.checkInDate2.focus();
            return;
    }
    if(document.form1.night2.value == '') {
            alert('Select Night!\n'); //박수를 선택해 주세요!\n');
            document.form1.night2.focus();
            return;
    }
    if(no_room == '')
    {
//        if(document.form1.r_type9.value != '' && document.form1.r_num9.value == '0') {
//                //alert('Select number of rooms!\n'); //객실수를 선택해 주세요!\n');
//                alert(document.getElementById("hidalert_selectroomnum").value); 
//                document.form1.r_num9.focus();
//                return;
//        }

        var strR_num1 = document.getElementById("r_num9").value;
        var strR_num2 = document.getElementById("r_num10").value;
        var strR_num3 = document.getElementById("r_num11").value;
        var strR_num4 = document.getElementById("r_num12").value;

        if(no_room == "" && strR_num1 == "0" && strR_num2 == "0" && strR_num3 == "0" && strR_num4 == "0")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }

        var strR_type1 = document.getElementById("r_type9").value;
        var strR_type2 = document.getElementById("r_type10").value;
        var strR_type3 = document.getElementById("r_type11").value;
        var strR_type4 = document.getElementById("r_type12").value;
        

        if(no_room == "" && strR_type1 == "" && strR_type2 == "" && strR_type3 == "" && strR_type4 == "")
        {
            //alert('Select Rooms!\n'); //객실을 적어도 하나는 선택해 주세요\n!');
            alert(document.getElementById("hidalert_selectroom").value); 
            return;
        }
        
        if(document.getElementById("r_num9").value == "0")
            document.getElementById("r_type9").value = ""
        
        if(document.getElementById("r_num10").value == "0")
            document.getElementById("r_type10").value = ""
            
        if(document.getElementById("r_num11").value == "0")
            document.getElementById("r_type11").value = ""
            
        if(document.getElementById("r_num12").value == "0")
            document.getElementById("r_type12").value = ""
    }
        
    document.form1.h_name.value = document.form1.h_name2.value;
    document.form1.location1.value = "";
    document.form1.location2.value = "";
    document.form1.location3.value = "";
    document.form1.location4.value = "";
    document.form1.checkInDate.value = document.form1.checkInDate2.value;
    document.form1.checkOutDate.value = document.form1.checkOutDate2.value;
    document.form1.night.value = document.form1.night2.value;
    document.form1.r_type1.value = document.form1.r_type9.value;
    document.form1.r_type2.value = document.form1.r_type10.value;
    document.form1.r_type3.value = document.form1.r_type11.value;
    document.form1.r_type4.value = document.form1.r_type12.value;
    document.form1.r_num1.value = document.form1.r_num9.value;
    document.form1.r_num2.value = document.form1.r_num10.value;
    document.form1.r_num3.value = document.form1.r_num11.value;
    document.form1.r_num4.value = document.form1.r_num12.value;

    //호텔인포 저팬 구분
    var arg1 = '', arg2 = '';    
    if(hidSi_Type != '')
    {
        arg1 = '?hidSi_Type=' + hidSi_Type 
        arg2 = '&hidSi_Type=' + hidSi_Type 
    }
    
    if(document.getElementById("OnlyBlock") != null && document.getElementById("OnlyBlock").value == "1")
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&OnlyBlock=1";
            arg2 = arg2 + "&OnlyBlock=1";
        }
        else if(arg1 == "")
        {
            arg1 = "?OnlyBlock=1";
            arg2 = "&OnlyBlock=1";
        }
    }
    
    if(page != null)
    {
        if(arg1 != "")
        {
            arg1 = arg1 + "&page=" + page;
            arg2 = arg2 + "&page=" + page;
        }
        else if(arg1 == "")
        {
            arg1 = "?page=" + page;
            arg2 = "&page=" + page;
        }
    }
    
    if(Type != null && Type != "map")
    {
        if(document.getElementById("Na_code") != null && (document.getElementById("Na_code").value == "3" || document.getElementById("Na_code").value == "8"))
            Type = "china";

        if(arg1 != "")
        {
            arg1 = arg1 + "&type=" + Type;
            arg2 = arg2 + "&type=" + Type;
        }
        else if(arg1 == "")
        {
            arg1 = "?type=" + Type;
            arg2 = "&type=" + Type;
        }
    }

    if(document.getElementById("location5")[1] != null && document.getElementById("location5")[1].na_code != null && document.getElementById("location5")[1].na_code == "3") // && document.getElementById("ddlNation") != null)
    {
        var _strLocation = document.getElementById("location5")[document.getElementById("location5").selectedIndex].na_code;

        if(document.getElementById("ddlNation") != null && document.getElementById("ddlNation").value == "" && _strLocation == null)
        {
            alert("国を入力してください");
            document.getElementById("ddlNation").focus();
            return;
        }
        
        else if(document.getElementById("ddlNation") != null && document.getElementById("ddlNation").value != "")
        {
            if(arg1 != "")
            {
                arg1 = arg1 + "&na_code=" + document.getElementById("ddlNation").value;
                arg2 = arg2 + "&na_code=" + document.getElementById("ddlNation").value;
            }
            else if(arg1 == "")
            {
                arg1 = "?na_code=" + document.getElementById("ddlNation").value;
                arg2 = "&na_code=" + document.getElementById("ddlNation").value;
            }
        }
        
        else if(_strLocation != "")
        {
            if(arg1 != "")
            {
                arg1 = arg1 + "&na_code=" + _strLocation;
                arg2 = arg2 + "&na_code=" + _strLocation;
            }
            else if(arg1 == "")
            {
                arg1 = "?na_code=" + _strLocation;
                arg2 = "&na_code=" + _strLocation;
            }
        }

    }
    
    if(Type != null && (Type == "china" || Type == "world"))
       document.form1.action = "../../Travel/Hotel/OverSeas/HotelSearchList.aspx"+arg1;
    else if(no_room == '')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else if(document.form1.r_type5.value != '' && document.form1.r_num5.value != '0')
        document.form1.action = "../reservation/hotel_search_list.aspx"+arg1;
    else    
        document.form1.action = "../reservation/hotel_search_list.aspx?no_room_type=" + no_room + arg2;
        
    if(document.getElementById('divMain') != null)
        document.getElementById('divMain').style.display='none';
        
    if(document.getElementById('body_bg') != null)
        document.getElementById('body_bg').style.display='none';
        
    if(document.getElementById('wrapper') != null)
        document.getElementById('wrapper').style.display='none';
        
    if(document.getElementById('Bar1') != null)
        document.getElementById('Bar1').style.display='none';
        
    if(document.getElementById('loading') != null)
        document.getElementById('loading').style.display='';

	document.form1.submit();
}


///////////////////////////////// 호텔검색 submit 데이터 재설정///////////////////////////////
function SetIndex(ctr, text)
{	
	var boxLength = ctr.length;
	if (boxLength != 0) {
		for (i = 0; i < boxLength; i++) {
			thisitem = ctr[i].value;
			if (thisitem == text) {
			    if(document.getElementById("spnCityNameTop") && ctr.id == "location3")
			    {
			        if( ctr.options[i].innerHTML == "지역선택")
			        {
			             ctr.options[i].innerHTML = "";
			             document.getElementById("spnCityNameTop").innerHTML = ctr.options[i].innerHTML;
			        }
			        document.getElementById("spnCityNameTop").innerHTML = ctr.options[i].innerHTML;
			    }
			    if(document.getElementById("spnCityNameTop2") && ctr.id == "location4")
		        {
		            if( ctr.options[i].innerHTML == "지역선택")
			        {
		                ctr.options[i].innerHTML = "";
		                document.getElementById("spnCityNameTop2").innerHTML = ctr.options[i].innerHTML;
		            }
		            document.getElementById("spnCityNameTop2").innerHTML = ctr.options[i].innerHTML;
		        }
		        if(document.getElementById("spnCityNameTop2") && ctr.id == "Na_code1")
		        {
		            if( ctr.options[i].innerHTML == "지역선택")
			        {
		                ctr.options[i].innerHTML = "";
		                document.getElementById("spnCityNameTop2").innerHTML = ctr.options[i].innerHTML;
		            }
		            document.getElementById("spnCityNameTop2").innerHTML = ctr.options[i].innerHTML;
		        }
			    
				ctr.selectedIndex = i;
				return false;
			}
	   }
	} 
	
	if(ctr.id == "location1")
	{
        ctr[0].value = text;
        ctr.selectedIndex = 0;
	}
	
}

function PostDataBind(args)
{	
    var ctr = document.form1;
    
    if(arguments[16] != null && arguments[16] != "" && arguments[16] != "State" && arguments[16] != "None")
    {
        SetIndex(ctr.ddlNation, arguments[17]);
        SetNationIndex();
    }
  
    ctr.h_name.value = arguments[0];
    
    if(ctr.h_name.value != "")
        ctr.h_name.style.backgroundImage="";
    
    SetIndex(ctr.night, arguments[1]);
//    if(arguments[4] == "l_Onsen")
//	{ 		
//		SetIndex(ctr.location11, arguments[2]);
//		changeGroupRyokan();
//		SetIndex(ctr.location22, arguments[3]);
//	}
//	else
//	{	
		

//		if(arguments[16] != null && arguments[16] == "State")  
//		{
//		    ctr.location1.value = arguments[2];
//		    changeLocation("State","0", arguments[3]);			    
//		}        
//	}
	
	SetIndex(ctr.location1, arguments[2]);
	
	SetIndex(ctr.location2, arguments[3]);
	
	if(document.getElementById("location3") != null)
	    SetIndex(document.getElementById("location3"), arguments[2]);
	    
	if(document.getElementById("location4") != null)
	    SetIndex(document.getElementById("location4"), arguments[3]);
	    
	if(document.getElementById("Na_code1") != null)
	    SetIndex(document.getElementById("Na_code1"), arguments[17]);
	
    SetIndex(ctr.h_level, arguments[4]);
    
    if(ctr.rboSearchType != null)
    {
        for (i = 0; i < ctr.rboSearchType.length; i++) 
        {
			if (ctr.rboSearchType[i].value == arguments[4]) 
				ctr.rboSearchType[i].checked = true;
	   }
    }
        
    ctr.checkInDate.value = arguments[5];    
    ctr.checkOutDate.value = arguments[6];  
        
    if(arguments[19] != null && arguments[19] =="1")
    {
        for(var i=11; i < 15; i++)
        {
            if(arguments[i] == "SGL")
                SetIndex(ctr.r_num1, arguments[(i-4)]);
            
            else if(arguments[i] == "DBL")
                SetIndex(ctr.r_num2, arguments[(i-4)]);
                
            else if(arguments[i] == "TWN")
                SetIndex(ctr.r_num3, arguments[(i-4)]);
                
            else if(arguments[i] == "TRP")
                SetIndex(ctr.r_num4, arguments[(i-4)]);
                
            else if(arguments[i] == "QUAD")
                SetIndex(ctr.r_num5, arguments[(i-4)]);
        }
    }
    
    else
    {
        SetIndex(ctr.r_num1, arguments[7]);
        
        if(ctr.r_num2)
            SetIndex(ctr.r_num2, arguments[8]);
            
        if(ctr.r_num3)
            SetIndex(ctr.r_num3, arguments[9]);
            
        if(ctr.r_num4)
            SetIndex(ctr.r_num4, arguments[10]);
         
        if(ctr.r_type1)   
            SetIndex(ctr.r_type1, arguments[11]);
        
        if(ctr.r_type2)
            SetIndex(ctr.r_type2, arguments[12]);
            
        if(ctr.r_type3)
            SetIndex(ctr.r_type3, arguments[13]);
            
        if(ctr.r_type4)
            SetIndex(ctr.r_type4, arguments[14]);
    }    
    if(ctr.days)
        ctr.days.value = arguments[15];	
    
    if(document.all["pro2"] != null && arguments[12] != "")  
        document.all["pro2"].style.display = "";
        
    if(document.all["pro3"] != null && arguments[13] != "")  
        document.all["pro3"].style.display = "";

    if(document.all["pro4"] != null && arguments[14] != "")  
        document.all["pro4"].style.display = "";
        
    if(arguments[17] != null && arguments[17] != "" && ctr.Na_code != null)  
        SetIndex(ctr.Na_code, arguments[17]);

    if(arguments[18] != null && arguments[18] != "" && ctr.PgSize != null)  
        SetIndex(ctr.PgSize, arguments[18]);
        
    //if(arguments[19] != null && arguments[19] != "" && ctr.r_num5 != null)  
    //    SetIndex(ctr.r_num5, arguments[19]);   
}
///////////////////////////////// 식사 제공 여부 ///////////////////////////////

//xslt sort
//검색 결과 리스트 SORT
function sort_xslt(code, hidSi_Type, page, Noroom)    
{    
        var h_sort_1 = document.getElementsByName("h_sort_1")[0]; 
	    var h_sort_2 = document.getElementsByName("h_sort_2")[0]; 
	    var h_sort_3 = document.getElementsByName("h_sort_3")[0]; 
	    var h_sort_4 = document.getElementsByName("h_sort_4")[0]; 
	    var h_sort = document.getElementsByName("h_sort")[0]; 	    
        
        //즉시예약 + 낮은 가격순
        if(code=="1")
        {
            if(h_sort_1.value=="DOWN"||h_sort_1.value=="")
            {
                h_sort_1.value = "UP";       
            }
            else if(h_sort_1.value=="UP")
            {
                h_sort_1.value = "DOWN";     
            }
        }    
        else if(code =="2")
        {
            if(h_sort_2.value=="UP" || h_sort_2.value=="")
            {
                h_sort_2.value = "DOWN";       
            }
            else if(h_sort_2.value=="DOWN")
            {
                h_sort_2.value = "UP";     
            }
        } 	
        else if(code =="3")
        {
            if(h_sort_3.value=="UP"||h_sort_3.value=="")
            {
                h_sort_3.value = "DOWN";       
            }
            else if(h_sort_3.value=="DOWN")
            {
                h_sort_3.value = "UP";     
            }
        } 		          	       		    
   		else if(code =="4")
        {
            if(h_sort_4.value=="UP"||h_sort_4.value=="")
            {
                h_sort_4.value = "DOWN";       
            }
            else if(h_sort_4.value=="DOWN")
            {
                h_sort_4.value = "UP";     
            }
        } 		 
        
        h_sort.value = code;

        if(Noroom != null)
            hotel_search(Noroom, hidSi_Type);  
        
        else if(page != null)
            hotel_search('',hidSi_Type,page);
            
        else
            hotel_search('',hidSi_Type);      		       		       		    
}

//xslt sort
//검색 결과 리스트 SORT(호텔재팬 DDL용)
function sort_xslt_ddl(code, hidSi_Type, page, Noroom, Type)    
{    
        var h_sort_1 = document.getElementsByName("h_sort_1")[0]; 
	    var h_sort_2 = document.getElementsByName("h_sort_2")[0]; 
	    var h_sort_3 = document.getElementsByName("h_sort_3")[0]; 
	    var h_sort_4 = document.getElementsByName("h_sort_4")[0]; 
	    var h_sort = document.getElementsByName("h_sort")[0]; 	    
        
        //즉시예약 + 낮은 가격순
        if(code=="1")
        {
            h_sort_1.value = "DOWN"
        } 
        else if(code=="2")
        {
            h_sort_1.value = "UP";
            code="1"
        }   
        else if(code =="3")
        {
            h_sort_2.value = "DOWN";       
            code="2"
        } 	
        else if(code =="4")
        {
            h_sort_2.value = "UP";
            code="2"
        } 
        else if(code =="5")
        {
            if(h_sort_3.value=="UP"||h_sort_3.value=="")
            {
                h_sort_3.value = "DOWN";       
            }
            else if(h_sort_3.value=="DOWN")
            {
                h_sort_3.value = "UP";     
            }
            code="3"
        } 		          	       		    
   		else if(code =="6")
        {
            if(h_sort_4.value=="UP"||h_sort_4.value=="")
            {
                h_sort_4.value = "DOWN";       
            }
            else if(h_sort_4.value=="DOWN")
            {
                h_sort_4.value = "UP";     
            }
            code="4"
        } 		 
        
        h_sort.value = code;	
        
        hotel_search(Noroom,hidSi_Type,page,Type);
}

//xslt sort
//검색 결과 리스트 SORT 세팅(호텔재팬 DDL용)
function sort_xslt_ddl_set()    
{    
        var h_sort_1 = document.getElementsByName("h_sort_1")[0]; 
	    var h_sort_2 = document.getElementsByName("h_sort_2")[0]; 
	    var h_sort_3 = document.getElementsByName("h_sort_3")[0]; 
	    var h_sort_4 = document.getElementsByName("h_sort_4")[0]; 
	    var h_sort = document.getElementsByName("h_sort")[0]; 	    
        
        //즉시예약 + 낮은 가격순
        if(h_sort_1.value == "DOWN" && h_sort.value == "1")
           document.getElementById("ddlsort").options[1].selected = true;
           
        else if(h_sort_1.value == "UP" && h_sort.value == "1")
            document.getElementById("ddlsort").options[2].selected = true;
            
        else if(h_sort_2.value == "DOWN" && h_sort.value == "2")
            document.getElementById("ddlsort").options[3].selected = true;
            
        else if(h_sort_2.value == "UP" && h_sort.value == "2")
            document.getElementById("ddlsort").options[4].selected = true;
            
        else if(h_sort.value == "3")
            document.getElementById("ddlsort").options[5].selected = true;
            
   		else if(h_sort.value == "4")
            document.getElementById("ddlsort").options[6].selected = true;       		       		    
}

//식사 상태 정보
function Break_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, i)
{
    if(request_breack_use == 1)
        request_breack_use = 1;
    else
        request_breack_use = 0;
        
    if(request_breack_inc == 1)
        request_breack_inc = 1;
    else
        request_breack_inc = 0;
        
    if(request_dinner_use == 1)    
        request_dinner_use = 1;
    else
        request_dinner_use = 0;
        
    if(request_dinner_inc == 1)    
        request_dinner_inc = 1;
    else        
        request_dinner_inc = 0;

     
    if(arguments[5] != null)
    {
        if(arguments[5] == 1)
        {
            var spanfood = document.getElementsByName("spanfood["+i+"]")[0];
            Set_Room_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, spanfood, '1');
        }
    } 
    else
    {
        var spanfood = document.getElementsByName("spanfood["+i+"]")[0];
        Set_Room_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, spanfood, '1');
    }  
}

//룸별 식사 상태 정보
function Break_Room_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, i, j)
{
    if(request_breack_use == 1)
        request_breack_use = 1;
    else
        request_breack_use = 0;
        
    if(request_breack_inc == 1)
        request_breack_inc = 1;
    else
        request_breack_inc = 0;
        
    if(request_dinner_use == 1)    
        request_dinner_use = 1;
    else
        request_dinner_use = 0;
        
    if(request_dinner_inc == 1)    
        request_dinner_inc = 1;
    else        
        request_dinner_inc = 0;

    if(j == 1)
    {
        var spanfood = document.getElementsByName("spanfood["+i+"]["+j+"]")[0];
        Set_Room_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, spanfood, '2');
    }
}

///식사 설정
function Set_Room_Food(request_breack_use, request_breack_inc, request_dinner_use, request_dinner_inc, spanfood, div)
{
    var doc = document.form1;

    if(document.getElementById("si_currency") != null)
    {
        if(document.getElementById("si_currency").value == "KRW")
        {
            var si_currency = "<img src='http://image.bico.jp/Site/100002/ko/mark_won_03.gif'/>";
        }
        
        if(document.getElementById("si_lang").value == "ko")
        {
            var beack_lang = " 조식요금 :";
            var diner_lang = " 석식요금 :";
        }
        
        if(document.getElementById("si_currency").value == "JPY")
        {
            var si_currency = "<img src='http://image.bico.jp/Site/100002/ko/mark_yen_03.gif'/>";
        }
        
        if(document.getElementById("si_lang").value == "ja")
        {
            var beack_lang = " 朝食料金 :";
            var diner_lang = " 夕食料金 :";
        }
        
        if(document.getElementById("si_currency").value == "USD")
        {
            var si_currency = "<img src='http://image.bico.jp/Site/100002/ko/mark_dol_03.gif'/>";
        }
        
        if(document.getElementById("si_lang").value == "en")
        {
            var beack_lang = " Breakfast Price :";
            var diner_lang = " Diner Price :";
        }
        
        if(document.getElementById("si_lang").value == "zh")
        {
            var beack_lang = " 早餐费用 :";
            var diner_lang = " 晚餐價格 :";
        }

        var TempHtml = "";
        if(request_breack_use == "1")
        {
	        if(request_breack_inc == "1")
	        {			
	        //조식제공 (선택사항)
                TempHtml += document.getElementById("txt_breack_o_inc").value + beack_lang + si_currency + formatCurrency((document.getElementById("h_break").value * document.getElementById("Exchange").value),0) + " ";				
	        }
	        else
	        {
	        //조식 불포함 (추가선택가능)
                TempHtml += document.getElementById("txt_breack_x_inc").value + beack_lang + si_currency + formatCurrency((document.getElementById("h_break").value * document.getElementById("Exchange").value),0) +  " ";				                
	        }			
        }
        if(request_breack_use == "0")
        {
	        if(request_breack_inc == "1")
	        {			
	        //조식제공
                TempHtml += document.getElementById("txt_breack_o").value +" ";	
	        }
	        else
	        {
	        //조식불포함
                TempHtml += document.getElementById("txt_breack_x").value + " ";				
	        }			
        }		

        if(request_dinner_use == "1")
        {
	        if(request_dinner_inc == "1")
	        {					
	        //석식 제공 (선택가능)
                TempHtml += document.getElementById("txt_dinner_o_inc").value + diner_lang + si_currency + formatCurrency((document.getElementById("h_dinner").value * document.getElementById("Exchange").value),0);					
	        }
	        else
	        {
	        //석식불포함 (추가선택가능)
		        TempHtml += document.getElementById("txt_dinner_x_inc").value + diner_lang + si_currency + formatCurrency((document.getElementById("h_dinner").value * document.getElementById("Exchange").value),0);
	        }
        	
        }
        if(request_dinner_use == "0")
        {
	        if(request_dinner_inc == "1")
	        {	
	        //석식제공
		        TempHtml += document.getElementById("txt_dinner_o").value;					
	        }
	        else
	        {
	        //석식불포함
		        //TempHtml += doc.txt_dinner_x.value;					
	        }					
        }
    }

    else
    {
    var TempHtml = "";
	if(request_breack_use == "1")
	{
		if(request_breack_inc == "1")
		{			
		//조식제공 (선택사항)
            TempHtml += document.getElementById("txt_breack_o_inc").value + "  ";				
		}
		else
		{
		//조식 불포함 (추가선택가능)
            TempHtml += document.getElementById("txt_breack_x_inc").value + "  ";				
		}			
	}
	if(request_breack_use == "0")
	{
		if(request_breack_inc == "1")
		{			
		//조식제공
            TempHtml += document.getElementById("txt_breack_o").value +"  ";	
		}
		else
		{
		//조식불포함
            TempHtml += document.getElementById("txt_breack_x").value + "  ";				
		}			
	}		
	
    if(request_dinner_use == "1")
    {
		if(request_dinner_inc == "1")
		{					
		//석식 제공 (선택가능)
            TempHtml += document.getElementById("txt_dinner_o_inc").value;					
		}
		else
		{
		//석식불포함 (추가선택가능)
			TempHtml += document.getElementById("txt_dinner_x_inc").value;						
		}
		
	}
	if(request_dinner_use == "0")
	{
		if(request_dinner_inc == "1")
		{	
		//석식제공
			TempHtml += document.getElementById("txt_dinner_o").value;					
		}
		else
		{
		//석식불포함
			//TempHtml += doc.txt_dinner_x.value;					
		}					
	}	
	}

    //if(div == '2')
    //    TempHtml = TempHtml.replaceAll("<br>","&nbsp;");
    //TempHtml = TempHtml.substr(0, TempHtml.length-2);
    //TempHtml = TempHtml.replaceAll(",","&nbsp;");
    spanfood.innerHTML	= TempHtml;	
}

//원하는 문자열 전부 replace 하기
String.prototype.replaceAll = function(from, to) { 
return this.replace(new RegExp(from, "g"), to); 
} 

/////////////////////////////////////// 금액 재계산 하기
function round (n, d) {
	n = n - 0;
	d = d || 2;

	var f = Math.pow(10, d);
	n = Math.ceil(n * f) / f;
	n += Math.pow(10, - (d + 1));
	n += '';

	return d == 0 ? n.substring(0, n.indexOf('.')) : n.substring(0, n.indexOf('.') + d + 1);
}

///통화형으로 변환
function formatCurrency (n, d) {
	n = round (n, d);
	var dec = "";

	if(d > 0)
	    dec = "." + n.substring(n.indexOf('.')+1, n.indexOf('.') + d + 1);

	for (var i = n.indexOf('.') - 3; i > 0; i -= 3) {
		n = n.substring(0, i) + ',' + n.substring (i);
	}
	
    n = n.substring(0, n.indexOf('.')) + dec;
	return n;
}

function Check_Price_M(param,param1,price_currency,site_currency,flgCurrencyDisplay)
{
//     var ROOM_TYPE_CNT = document.getElementsByName("ROOM_TYPE_CNT["+param+"]")[0];          
//     var span_price = document.getElementsByName("span_price["+param+"]")[0]; 
//     //var addnight = document.getElementsByName("addnight["+param+"]")[0];                    

//     var total_price=0.0;
//     var total_price_r = 0.0;         
//     var ntemp = 0;
//     
//     for(var i=0;i<ROOM_TYPE_CNT.value;i++)
//     {
//         var t = i+1;
//         var room_type = document.getElementsByName("room_type["+param+"]["+t+"]")[0];            
//         
//         if(room_type.checked==true)
//         {
//            var room_price = document.getElementsByName("room_price["+param+"]["+t+"]")[0];
//            var room_priceW = document.getElementsByName("room_priceW["+param+"]["+t+"]")[0]; 
//            
//            //total_price = parseInt(total_price) + parseInt(room_price.value);
//            //total_price_r = parseInt(total_price_r) + parseInt(room_priceW.value); 
//            total_price = total_price + Math.ceil(room_price.value);
//            total_price_r = total_price_r + parseFloat(round(room_priceW.value,2));   

//         }  
//     }     
//     
//    var room_priceStr  = (price_currency == "KRW" || price_currency == "JPY" || price_currency == "CNY")? formatCurrency(total_price,0):formatCurrency(total_price,2);
//	var room_price2Str = (site_currency == "KRW" || site_currency == "JPY" || site_currency == "CNY")? formatCurrency(total_price_r,0):formatCurrency(total_price_r,2);     

//    var p_currency = GetCurrencyFlg(price_currency);
//    
//    if(flgCurrencyDisplay == "A")
//    {
//        if(price_currency != site_currency)
//        {        
//            span_price.innerHTML  = '<b>'+p_currency+'<FONT class=jp_tx_cost>' + room_priceStr + '</FONT> <FONT class=jp_tx_cost3>(' + GetCurrencyFlg(site_currency) +	room_price2Str  + ')</FONT></b>&nbsp;&nbsp;';
//        }
//        else
//        {
//            span_price.innerHTML  = '<b>'+p_currency+'<FONT class=jp_tx_cost>' + room_priceStr + '</FONT> </b>&nbsp;&nbsp;';
//        }
//    } 
//    
//    if(flgCurrencyDisplay == "H")
//    {
//        span_price.innerHTML  = '<b>'+p_currency+'<FONT class=jp_tx_cost>' + room_priceStr + '</FONT> </b>;';
//    }
//    
//    if(flgCurrencyDisplay == "S")
//    {
//        span_price.innerHTML  = '<b>'+GetCurrencyFlg(site_currency)+'<FONT class=jp_tx_cost3>' + room_price2Str + '</FONT> </b>';
//        
//        if(site_currency == "USD")
//             span_price.innerHTML  = span_price.innerHTML + '(<b>'+p_currency+'<font style="font-size:14px;font-weight:bold;">' + room_priceStr + '</font> </b>)';
//    }   
                              
}

function search() {
	if(form1.location1.value == 0) {
		alert('Not Selected CityName.');
		form1.location1.focus();
		return;
	}

	form1.action = 'hotel_search_list.aspx';
	form1.submit();
}

//예약 페이지로 이동
function goHotel(h_code, hidSi_Type)
{
    if(hidSi_Type == null)
        document.location.href="../reservation/reservation_input.aspx?h_code="+h_code;
    else
        document.location.href="../reservation/reservation_input.aspx?h_code="+h_code+"&hidSi_Type="+hidSi_Type;
    
    //parent.document.location.href="../reservation/reservation_input.aspx?h_code="+h_code;
}

function go_RecomHotel(h_code, location1)
{  
	var locationUrl;

    if(location1 == null)
        locationUrl="../reservation/reservation_input.aspx?h_code="+h_code;
    else
        locationUrl="../reservation/reservation_input.aspx?h_code="+h_code+"&location1="+location1;    
    
	document.location.href =  locationUrl;
    
    //parent.document.location.href="../reservation/reservation_input.aspx?h_code="+h_code;
}

function go_RecomHotel_gmarket(h_code, location1)
{  
	var locationUrl;

    if(location1 == null)
        locationUrl="../reservation/Gmarket_reservation.aspx?h_code="+h_code;
    else
        locationUrl="../reservation/Gmarket_reservation.aspx?h_code="+h_code+"&location1="+location1;    
    
	top.location.href = locationUrl;
    
    //parent.document.location.href="../reservation/reservation_input.aspx?h_code="+h_code;
}

function go_AgentRecomHotel(h_code, location1, hidSi_Type)
{
    if(location1 == null)
        document.location.href="../reservation/reservation_input.aspx?h_code="+h_code+"&hidSi_Type="+hidSi_Type;
    else
        document.location.href="../reservation/reservation_input.aspx?h_code="+h_code+"&location1="+location1+"&hidSi_Type="+hidSi_Type;
    
    //parent.document.location.href="../reservation/reservation_input.aspx?h_code="+h_code;
}

function delRoom() {
        var count = 0;
        for(i=1;i<4;i++) {
                name = 'pro'+(i+1);
                if(document.all[name].style.display == "") count++;
        }
		if(count == 3) {
                name = 'pro4'
				document.getElementById("r_type4").selectedIndex = 0;
                document.all[name].style.display = "none";
        }
		else if(count == 2) {
                name = 'pro3'
				document.getElementById("r_type3").selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 1) {
                name = 'pro2'                
				document.getElementById("r_type2").selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 0) {
                //alert('Not Delete Room Type.'); //더이상 룸타입을 삭제 하실수 없습니다.');
                alert(document.getElementById("hidalert_delroom").value);
                return;
        }
}


function agent_delRoom() {
        var count = 0;
        for(i=5;i<8;i++) {
                name = 'pro'+(i+1);
                if(document.all[name].style.display == "") count++;
        }
		if(count == 3) {
                name = 'pro8'
				document.form1.r_type4.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
		else if(count == 2) {
                name = 'pro7'
				document.form1.r_type3.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 1) {
                name = 'pro6'
				document.form1.r_type2.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 0) {
                //alert('Not Delete Room Type.'); //더이상 룸타입을 삭제 하실수 없습니다.');
                alert(document.getElementById("hidalert_delroom").value);
                return;
        }
}

function cancellation() { 
    window.open('../hoteljapan/etc/cancellation.html','cancellation','left=50, top=50, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=730, height=552"'); 
}
/*
function delRoom() {
        var count = 0;
        for(i=1;i<4;i++) {
                name = 'pro'+(i+1);
                if(document.all[name].style.display == "") count++;
        }
		if(count == 3) {
                name = 'pro4'
				document.form1.r_type4.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
		else if(count == 2) {
                name = 'pro3'
				document.form1.r_type3.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 1) {
                name = 'pro2'
				document.form1.r_type2.selectedIndex = 0;
                document.all[name].style.display = "none";
        }
        else if(count == 0) {
                alert('Not Delete Room Type.'); //더이상 룸타입을 삭제 하실수 없습니다.');
                return;
        }
}
*/
function an(param) 
{ 
	window.open('../etc/an.aspx?lang='+param,'','left=50, top=50, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=600, height=550"'); 
}

var C_FLAG = "up";

function hotelsearch_Control(divname) 
{
 
    switch(parseInt(divname)) 
    {  
   
        case 1 : 
            document.getElementById("hotel_title_01").src = "http://image.bico.jp/Site/100002/ko/v6/img/new_hotel_search2_btn1.gif";
            document.getElementById("hotel_title_02").src = "http://image.bico.jp/Site/100002/ko/v6/img/new_hotel_search2_btn2_off.gif";
            document.getElementById("r_type1").options[1].selected = true;
            document.getElementById("h_level").options[0].selected = true;
            document.getElementById("dis_category1").style.display = "";
			document.getElementById("location1").selectedIndex = 0;
			document.getElementById("location2").selectedIndex = 0;
            document.getElementById("dis_category2").style.display = "none";
        break;
        case 2 : 
            document.getElementById("hotel_title_01").src = "http://image.bico.jp/Site/100002/ko/v6/img/new_hotel_search2_btn1_off.gif";
            document.getElementById("hotel_title_02").src = "http://image.bico.jp/Site/100002/ko/v6/img/new_hotel_search2_btn2.gif";
            document.getElementById("r_type1").options[3].selected = true;
            document.getElementById("h_level").options[10].selected = true;
            document.getElementById("dis_category1").style.display = "none"; 
            document.getElementById("location1").selectedIndex = 0;
			document.getElementById("location2").selectedIndex = 0;
            document.getElementById("dis_category2").style.display = "";
        break; 
        case 3 : 
            document.getElementById("hotel_title_01").src = "http://image.bico.jp/Site/100010/ko/v2/img/japan/but_hotel_o.gif";
            document.getElementById("hotel_title_02").src = "http://image.bico.jp/Site/100010/ko/v2/img/japan/but_ryokan.gif";
            document.getElementById("r_type1").options[1].selected = true;
            document.getElementById("h_level").options[0].selected = true;
            document.getElementById("dis_category1").style.display = "";
			document.getElementById("location1").selectedIndex = 0;
			document.getElementById("location2").selectedIndex = 0;	
			
			if(document.getElementById("s_price") && document.getElementById("s_price"))
			{
				if(C_FLAG == "down")
				{
					document.getElementById("s_price").style.top = document.getElementById("s_price").offsetTop + 30 + "px";
					document.getElementById("e_price").style.top = document.getElementById("e_price").offsetTop + 30 + "px";				
					document.getElementById("priceScope").style.top = document.getElementById("priceScope").offsetTop + 30 + "px";
					C_FLAG = "up";
				}
			}
        break;
        case 4 : 
            document.getElementById("hotel_title_01").src = "http://image.bico.jp/Site/100010/ko/v2/img/japan/but_hotel.gif";
            document.getElementById("hotel_title_02").src = "http://image.bico.jp/Site/100010/ko/v2/img/japan/but_ryokan_o.gif";
            document.getElementById("r_type1").options[3].selected = true;
            document.getElementById("h_level").options[10].selected = true;
            document.getElementById("dis_category1").style.display = "none"; 
            document.getElementById("location1").selectedIndex = 0;
			document.getElementById("location2").selectedIndex = 0;
			
			if(document.getElementById("s_price") && document.getElementById("s_price"))
			{
				if(C_FLAG == "up")
				{
					document.getElementById("s_price").style.top = document.getElementById("s_price").offsetTop - 30 + "px";
					document.getElementById("e_price").style.top = document.getElementById("e_price").offsetTop - 30 + "px";			
					document.getElementById("priceScope").style.top = document.getElementById("priceScope").offsetTop - 30 + "px";
					C_FLAG = "down";
				}	
			}
        break;                                      
    }
}
  
function Search_Enter(NoRoom,SiType) 
{   
	if(event.keyCode ==13)    //엔터키가 눌려지면,
		hotel_search(NoRoom,SiType)    //검색 함수 호출
}



function Agent_Search_Enter(NoRoom,SiType) 
{   
	if(event.keyCode ==13)    //엔터키가 눌려지면,
		agent_hotel_search(NoRoom,SiType)    //검색 함수 호출
}

function Click_Room(i,j) 
{   
    for(var k = 0; document.getElementsByName("ROOM_TYPE_CNT[" + i + "]")[0].value > k; k++)
    {
        document.getElementsByName("room_type[" + i + "][" + (k + 1) + "]")[0].checked = false;
    }
    
	document.getElementsByName("room_type[" + i + "][" + j + "]")[0].checked = true;
}

function ChangeCity(SeleteValue)
{
	if(SeleteValue == "")
	{
		document.getElementById("location1").selectedIndex = 1;
		var nextData = document.getElementById("location1")[1].value;
		 document.getElementById("div_st_" + nextData).style.display = "";
		 return; 
	}

    for(var i = 0; i < document.getElementById("location1").length; i++)
    {
        if(document.getElementById("location1")[i].value == SeleteValue)
            document.getElementById("location1")[i].selected = true;            
    }
    
    for(var i = 0; i < 999; i++)
    {
        if(document.getElementById("div_st_" + i) != null)
            document.getElementById("div_st_" + i).style.display = "none";
    }
    
    document.getElementById("div_st_" + SeleteValue).style.display = "";
}

function Click_St_name(st_name, st_code)
{
    var State_Name = escape(st_name);
    
    if (navigator.appName.indexOf("Microsoft") == -1)
        document.getElementById("spn_SelectSt").innerHTML = st_name
        
    else
        document.getElementById("spn_SelectSt").innerHTML = decodeURI(State_Name);
        
    document.getElementById("location2").value = st_code;
}

function ChangeLevel(SeleteValue)
{
    var SpnValue = "";
    
    if (SeleteValue == "l_Deluxe3")
        SpnValue = "★★★★★☆ Deluxe";
        
    else if (SeleteValue == "l_Deluxe")
        SpnValue = "★★★★★ Deluxe";
        
    else if (SeleteValue == "l_Deluxe2")
        SpnValue = "★★★★☆ Deluxe";
        
    else if (SeleteValue == "l_Superior")  
	    SpnValue = "★★★★ Superior";
	    
	else if (SeleteValue == "l_Superior2")
	    SpnValue = "★★★☆ Superior";
	    
	else if (SeleteValue == "l_Standard")
	    SpnValue = "★★★ Standard";
	    
	else if (SeleteValue == "l_Standard2")
	    SpnValue = "★★☆ Standard";
	    
	else if (SeleteValue == "l_Business")
	    SpnValue = "★★ Business";
	    
	else if (SeleteValue == "I_Economy")
	    SpnValue = "★ Economy";
	    
	else if (SeleteValue == "l_Onsen")
	    SpnValue = "(♨)Onsen/Ryokan ";
	    
	else if (SeleteValue == "l_Condo")
	    SpnValue = "Residence";
	    
	else if (SeleteValue == "I_Low")
	    SpnValue = "Low Price";
	    
    else
        SpnValue = "all class";
	
    document.getElementById("spn_SelectClass").innerHTML = SpnValue;
}

function go_top_hotel_search(Na_code)
{
    var type = "";
    
    if(Na_code != null && Na_code != "" && Na_code == "1")
        type = "japan";
        
    else if(Na_code != null && Na_code != "" && Na_code == "2")
        type = "";
        
    else if(Na_code != null && Na_code != "" && Na_code == "3")
        type = "cina";
        
    else
        type = "world";
        
    if(document.getElementById('wrapper') != null)
        document.getElementById('wrapper').style.display='none';
        
    if(document.getElementById('Bar1') != null)
        document.getElementById('Bar1').style.display='none';
        
    if(document.getElementById('loading') != null)
        document.getElementById('loading').style.display='';
        
    if(document.getElementById("ddlsrc_type").value == "City1" && Na_code != null && Na_code != "")
        document.location.href = "../reservation/hotel_search_list.aspx?no_room_type=1&na_code=" + Na_code + "&location1=" + document.getElementById("location3").value + "&location2=" + document.getElementById("location4").value + "&type=" + type;
        
    else if(document.getElementById("ddlsrc_type").value == "City1")
    { 
        if(document.getElementById("location4") != null)
            document.location.href = "../reservation/hotel_search_list.aspx?no_room_type=1&na_code=" + document.getElementById("Na_code1").value + "&location1=" + document.getElementById("location3").value + "&location2=" + document.getElementById("location4").value + "&type=" + type;
                
        else
            document.location.href = "../reservation/hotel_search_list.aspx?no_room_type=1&na_code=" + document.getElementById("Na_code1").value + "&location1=" + document.getElementById("location3").value + "&type=" + type;
    }
    
    else if(document.getElementById("ddlsrc_type").value == "Pakage")
        document.location.href = "../reservation/package_list.aspx?ci_code=" + document.getElementById("location3").value;
        
    else
        document.location.href = "../reservation/hotel_search_list.aspx?no_room_type=1&category="  + document.getElementById("location3").value + "&type=" + type;
}

function search_category(category, type)
{
    if(document.getElementById('wrapper') != null)
        document.getElementById('wrapper').style.display='none';
        
    if(document.getElementById('Bar1') != null)
        document.getElementById('Bar1').style.display='none';
        
    if(document.getElementById('loading') != null)
        document.getElementById('loading').style.display='';

    if(type == null)
        type = "";
        
    document.location.href = "../reservation/hotel_search_list.aspx?no_room_type=1&category="  + category + "&type=" + type;
}

function chkBlockOnly(chk, NoRoom, hidType) {
    if (chk == true)
        document.getElementById("OnlyBlock").value = "1";

    else
        document.getElementById("OnlyBlock").value = "0";

    hotel_search(NoRoom, hidType);
}

function changeSearchTab(na_code, all, hidSi_Type) {
    if (parent.document.getElementById("Site_Lang") != null)
        var Site_Lang = parent.document.getElementById("Site_Lang").value;

    else
        var Site_Lang = document.getElementById("Site_Lang").value;

    if (na_code == "0") {
        for (i = document.getElementById("location1").length - 1; i > -1; i--) {
            document.getElementById("location1").options[i].value = null;
            document.getElementById("location1").options[i] = null;
        }

        var _strCity = "도시선택";
        var _strNation = "국가선택";

        if (Site_Lang == "en") {
            _strCity = "City Select";
            _strNation = "Nation Select";
        }

        else if (Site_Lang == "ja") {
            _strCity = "都市を選択";
            _strNation = "国家選択";
        }

        else if (Site_Lang == "zh") {
            _strCity = "城市選擇";
            _strNation = "選擇國家";
        }

        else if (Site_Lang == "zh-cn") {
            _strCity = "城市选择";
            _strNation = "选择国家";
        }

        document.getElementById("location1")[0] = new Option(_strCity, 1);
        document.getElementById("location1")[0].value = "";
        document.getElementById("location1").selectedIndex = 0;

        document.getElementById("Na_code")[0] = new Option(_strNation, 1);
        document.getElementById("Na_code")[0].value = "";
        document.getElementById("Na_code").selectedIndex = 0;
        document.getElementById("Na_code").style.display = "";

        document.getElementById("location2").style.display = "";

        document.getElementById("r_type1").style.display = "";
        document.getElementById("r_type2").style.display = "";

        document.getElementById("r_num1")[0].text = "0";
        document.getElementById("r_num2")[0].text = "0";

        document.getElementById("r_num3").style.display = "none";
        document.getElementById("r_num4").style.display = "none";
        document.getElementById("r_num5").style.display = "none";

        document.getElementById("r_type1").selectedIndex = 2;
        document.getElementById("r_type2").selectedIndex = 0;

        document.getElementById("r_num1").selectedIndex = 1;
        document.getElementById("r_num2").selectedIndex = 0;
        document.getElementById("r_num3").selectedIndex = 0;
        document.getElementById("r_num4").selectedIndex = 0;
        document.getElementById("r_num5").selectedIndex = 0;
    }

    else if (na_code == "3" || na_code == "8") {
        document.getElementById("location2").style.display = "";
        document.getElementById("Na_code").style.display = "none";
        changeLocation('City_Std', '', '', '', na_code);

        document.getElementById("Na_code")[0].value = na_code;
        document.getElementById("Na_code").selectedIndex = 0;

        document.getElementById("r_type1").style.display = "";
        document.getElementById("r_type2").style.display = "";

        document.getElementById("r_num1")[0].text = "0";
        document.getElementById("r_num2")[0].text = "0";

        document.getElementById("r_num3").style.display = "none";
        document.getElementById("r_num4").style.display = "none";
        document.getElementById("r_num5").style.display = "none";

        document.getElementById("r_type1").selectedIndex = 2;
        document.getElementById("r_type2").selectedIndex = 0;

        document.getElementById("r_num1").selectedIndex = 1;
        document.getElementById("r_num2").selectedIndex = 0;
        document.getElementById("r_num3").selectedIndex = 0;
        document.getElementById("r_num4").selectedIndex = 0;
        document.getElementById("r_num5").selectedIndex = 0;
    }

    else {
        document.getElementById("location2").style.display = "";
        document.getElementById("Na_code").style.display = "none";
        changeLocation('City', '', '', '', na_code);

        document.getElementById("Na_code")[0].value = na_code;
        document.getElementById("Na_code").selectedIndex = 0;

        document.getElementById("r_type1").style.display = "none";
        document.getElementById("r_type2").style.display = "none";

        document.getElementById("r_num1").style.display = "";
        document.getElementById("r_num2").style.display = "";

        if (Site_Lang == "ko") {
            document.getElementById("r_num1")[0].text = "싱글";
            document.getElementById("r_num2")[0].text = "더블";
        }
        else if (Site_Lang == "ja") {
            document.getElementById("r_num1")[0].text = "シングル";
            document.getElementById("r_num2")[0].text = "ダブル";
        }
        else if (Site_Lang == "en") {
            document.getElementById("r_num1")[0].text = "Single";
            document.getElementById("r_num2")[0].text = "Double";
        }
        else if (Site_Lang == "zh") {
            document.getElementById("r_num1")[0].text = "单人间";
            document.getElementById("r_num2")[0].text = "单床双人房";
        }
        else if (Site_Lang == "zh-cn") {
            document.getElementById("r_num1")[0].text = "单人间";
            document.getElementById("r_num2")[0].text = "大床间";
        }

        document.getElementById("r_num3").style.display = "";
        document.getElementById("r_num4").style.display = "";
        document.getElementById("r_num5").style.display = "";

        document.getElementById("r_type1").selectedIndex = 1;
        document.getElementById("r_type2").selectedIndex = 2;

        document.getElementById("r_num1").selectedIndex = 0;
        document.getElementById("r_num2").selectedIndex = 0;
        document.getElementById("r_num3").selectedIndex = 0;
        document.getElementById("r_num4").selectedIndex = 0;
        document.getElementById("r_num5").selectedIndex = 0;
    }

    for (i = 0; i < all; i++) {
        if (document.getElementById("aTab" + i) != null)
            document.getElementById("aTab" + i).className = "";
    }

    document.getElementById("aTab" + na_code).className = "on";

    //div_img_control('mToggle', 'imgTab', all, id, '_off');
    document.getElementById("hidSi_Type").value = hidSi_Type;
}

function check_search_enter(no_room, hidSi_Type, page, Type) 
{
    if(event.which || event.keyCode)
    {
        if ((event.which == 13) || (event.keyCode == 13)) 
        {
            if(Type == "world")
                agent_hotel_search_china(no_room, hidSi_Type, page, Type);
            else 
                hotel_search(no_room, hidSi_Type, page, Type);
            return false;
        }
    }
    else 
    {
        return true
    }
}
