var isSearchBarClick = false;
var searchRink;

var IngUrl = document.location.href;
var returnurl =  _encode(IngUrl);

function centerWindow() {
var xMax = document.body.clientWidth, yMax = document.body.clientHeight;
if(((xMax-200)/2-357) <= 0){
	var xOffset = 0, yOffset = 150;
}else{
	var xOffset = (xMax-200)/2-357, yOffset = 150;
}
var divMenu = document.all['allLayer'].style;
divMenu.top = yOffset;
divMenu.left = xOffset;
}

function allLayer_onoff() {
	var layer = document.getElementById("allLayer").style.display;
	if(layer=="none")
	document.getElementById("allLayer").style.display = "block";
	else
	document.getElementById("allLayer").style.display = "none";

	var button01 = document.getElementById("list_button01");
	var button02 = document.getElementById("list_button02");
	if(button01.style.display == "block"){
		button01.style.display = "none";
		button02.style.display = "block";
	}else{
		button01.style.display = "block";
		button02.style.display = "none";
	}
}

function allLayer_off() {
	document.getElementById("allLayer").style.display = "none";
	document.getElementById("list_button02").style.display = "none";
	document.getElementById("list_button01").style.display = "block";
}

function getCookieValue(cname){
	var ck = document.cookie;
	if(ck.length > 0){
		begin = ck.indexOf(cname);
		if(begin!=-1){
			begin += cname.length + 1;
			end = ck.indexOf(";", begin);
			if(end == -1) end = ck.length;
			ckval = ck.substring(begin,end);
			if(begin != end){
				return ckval;			//cval -> ckval
			}
			else return "";
		}
		else return "";
	}
	else return;
}

function login(){    //·Î±×ÀÎ.
	document.location = "https://member.tourvis.com/member/login.jsp?sid=TOURVIS&returnurl="+returnurl;
}

function Inquery(){    //È¸¿ø°¡ÀÔ.
	document.location = "https://member.tourvis.com/member/subscriber.agreement.assent.jsp?sid=TOURVIS&returnurl="+returnurl;
}

function idsearch() {	//ID / PASSWD Ã£±â.
	document.location = "https://member.tourvis.com/member/id.srch.jsp?sid=TOURVIS&returnurl=" + returnurl;
}

function useredit(){    //È¸¿øÁ¤º¸¼öÁ¤.
	document.location = "https://member.tourvis.com/member/mdfy.confirm.jsp?sid=TOURVIS&returnurl="+returnurl;
}

function logout(){    //·Î±×¾Æ¿ô.
	document.location = "https://member.tourvis.com/member/logout.ps.jsp?returnurl="+returnurl;
}

function search(){    //°Ë»ö.
	s = document.all.select.value;
	//document.location = "http://www.tourvis.com/Search/goodTotSearchList.jsp?searchType="+s+"&searchKeyWord="+document.all.search_text.value;
	
	if(document.all.search_text.value.length > 0){
		if(isSearchBarClick){
			document.location = "http://www.tourvis.com/Search/axGoodTotSearchList.jsp?searchType="+s+"&searchKeyWord="+document.all.search_text.value;
		}else{
			document.location = searchRink;
		}
	}else{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return;
	}
}

var zindex = 10000;
var select_count = new Array();
var ev_click     = new Array();

function insert_select ( sn,w,f,b,g,c,img,event) {	
	ev_click[sn]    = event;
	select_count[sn] = 0;
	zindex--;

	document.write("\<input type=hidden name="+sn+" id="+sn+" value='' >");
	document.write("\    <table border='0' cellspacing='0' cellpadding='0' width='"+w+"' style='table-layout:fixed;width:"+w+";' bgcolor='"+b+"' onclick='select_click(\""+sn+"\");' >");
	document.write("\    <tr>");
	document.write("\        <td bgcolor='"+g+"'>");
	document.write("\            <input type='text' id='"+sn+"_select_name' name='"+sn+"_select_name' style='border:none;cursor:hand;width:100%;background:FFFFFF;color:#006699;font-size:"+f+"pt;' onselectstart=\"return false\" readonly> ");
	document.write("\       </td>");

	if(img != "") {
		document.write("\    <td width=18 bgcolor='"+g+"' align=center valign=middle style='cursor:hand'><img src='"+img+"' align='absmiddle'></td>");
	}else{
		document.write("\    <td width=18 bgcolor='"+g+"' align=center valign=bottom style='cursor:hand'>¡ä</td>");
	}
		document.write("\    </tr>");
		document.write("\    </table>");
		document.write("\<div id='"+sn+"_select_div' name='"+sn+"_select_div'  style='display:none;z-index:"+zindex+";position:absolute;cursor:hand'  onmouseover='"+sn+"_select_div.style.display=\"\";' onmouseout='"+sn+"_select_div.style.display=\"none\";'>");
		document.write("\        <table border='0' cellspacing='1' cellpadding='0' bgcolor='c7e6f5' width="+w+" onmouseover='"+sn+"_select_div.style.display=\"\";'>");
		document.write("\        <tr><td bgcolor='"+g+"' style='line-height:1.3em;padding-left:6px' id='"+sn+"_select_span'></td></tr>");
		document.write("\        </table>");
		document.write("\    </div>");
	}

function insert_select_option(sn,f,b,g,c,v,vv,chk){	
	select_count[sn] ++;
	option_html = "<span style='width:100%;color:006699;font-size:"+f+"pt' onclick='"+sn+"_select_name.value=\""+vv+"\";"+sn+".value=\""+v+"\";"+sn+"_select_div.style.display=\"none\";"+ev_click[sn]+";' onmouseover='this.style.background=\""+g+"\"' onmouseout='this.style.background=\""+g+"\"' >"+vv+"</span><br>";

	if(select_count[sn] == 1 || chk == "Y" ) {		
		document.getElementById( sn+"_select_name" ).value = vv
		document.getElementById( sn).value = v
			
	}
	document.getElementById( sn+"_select_span").innerHTML += option_html;
}

function  select_click(sn){   
	if ( document.getElementById( sn+"_select_div").style.display == "none") {
		document.getElementById( sn+"_select_div").style.display = "";
	} else {
		document.getElementById( sn+"_select_div").style.display = "none"; 
	}
}

function keyDaum(){
	if (event.keyCode == 13 && document.all.search_text.value.length>0){
		search();
	}
}

function getsearchText(searchText, searchRink){
	document.all.search_text.value = searchText;
	this.searchRink = searchRink;
	document.getElementById("search_text").style.color = "#f26522";
}

function searchBarClick(){
	if(!isSearchBarClick){
		document.all.search_text.value = "";
	}
	isSearchBarClick = true;
	document.getElementById("search_text").style.color = "#666666";
}
document.write("\
<!-- start Å¾¿µ¿ª-->\
<table width='915' height='140' border='0' cellpadding='0' cellspacing='0' style='margin-bottom:0px'>\
  <tr>\
    <td><table width='915' height='140' border='0' align='center' cellpadding='0' cellspacing='0'>\
      <tr>\
        <td width='25'><img src='http://www.tourvis.com/Common/images/top/top_left.gif' width='25' height='140' /></td>\
        <td width='865' valign='top' background='http://www.tourvis.com/Common/images/top/top_bar_bg.gif'><table width='865' border='0' cellspacing='0' cellpadding='0'>\
          <tr>\
            <td width='178' rowspan='2'><a href='http://www.tourvis.com' onFocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/logo.jpg' width='178' height='91' border='0' /></a></td>\
            <td height='41'><table border='0' align='right' cellpadding='0' cellspacing='0' style='margin-top:20px'>\
              <tr>\
			  ");
					var CookieValue = null;
					CookieValue = getCookieValue("TOURVIS_COOKIE");

					if(CookieValue == null || CookieValue.length == 0 || CookieValue.length == "null"){
					document.write("\
                <td><a href='javascript:login();' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_login.gif' width='40' height='19' border='0' /></a></td>\
                <td><a href='javascript:Inquery();' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_join.gif' width='49' height='19' border='0' /></a></td>\
                <td><a href='javascript:idsearch();' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_idpw.gif' width='63' height='19' border='0' /></a></td>\
				");
				}else{
					var TmpString = CookieValue;

					Strvalue = new Array(6);	//Str ÀÓ½Ã ÀúÀå
					CookieResultValue = new Array(6);	//½ÇÁ¦ ÄíÅ°°ª ÀúÀå(0)¾ÆÀÌµð(1)ÀÌ¸§(2)ecuserid(3)ecid(4)type(5)¾÷µ¥ÀÌÆ®³¯Â¥

					for(i=0 ; i<6 ; i++){
						strlength = TmpString.length;
						intval = TmpString.indexOf("~");
						Strvalue[i] = TmpString.substring(0,intval);
						TmpString = TmpString.substring(intval+1,strlength);

						if(i == 5){
							Strvalue[i] = TmpString;
						}

						strlength2 = Strvalue[i].length;
						intval2 = Strvalue[i].indexOf("=");
						CookieResultValue[i] = Strvalue[i].substr(intval2+1,strlength2)
					}
					document.write("\<td><table border='0' cellspacing='0' cellpadding='0'><tr><td><a href='https://member.tourvis.com/member/logout.ps.jsp?returnurl="+returnurl+"'><img src='http://www.tourvis.com/Common/images/head/tm_logout.gif' border='0'></a></td><td><a href='javascript:useredit();'><img src='http://www.tourvis.com/Common/images/head/tm_memberinfo.gif' border='0'></a></td></tr></table></td>");
				}
				document.write("\
                <td><a href='http://www.tourvis.com/sk/' target='_blank' onFocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_sk.gif' width='80' height='19' border='0' /></a></td>\
				<td><a href='http://www.ebiztrip.com/' target='_blank' onFocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_ebiztrip.gif' width='65' height='19' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Info/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_tourinfo.gif' width='55' height='19' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Customer/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_center.gif' width='49' height='19' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Mypage/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/tm_mypage.gif' width='64' height='19' border='0' /></a></td>\
				");
				document.write("\
              </tr>\
            </table></td>\
            </tr>\
          <tr>\
            <td><table border='0' align='right' cellpadding='0' cellspacing='0'>\
              <tr>\
                <td><a href='http://www.tourvis.com/Abroad/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu01.gif' width='77' height='50' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Golf/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu02.gif' width='73' height='50' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Honeymoon/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu03.gif' width='63' height='50' border='0' /></a></td>\
                <td><a href='http://free.tourvis.com/main/main.html?refer' onFocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu04.gif' width='78' height='50' border='0' /></a></td>\
                <td><a href='http://fit.tourvis.com/web/air/b2c/doMain.action' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu05.gif' width='64' height='50' border='0' /></a></td>\
                <td><a href='http://fit.tourvis.com/web/hotel/b2c/doMain.action' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu06.gif' width='79' height='50' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Domestics/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu07.gif' width='73' height='50' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/newLodging/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu08.gif' width='72' height='50' border='0' /></a></td>\
                <td><a href='http://www.tourvis.com/Event/index.html' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/menu09.gif' width='90' height='50' border='0' /></a></td>\
              </tr>\
            </table></td>\
            </tr>\
        </table>\
          <table width='865' border='0' cellspacing='0' cellpadding='0' style='margin-top:7px'>\
            <tr>\
              <td width='170'><a href='javascript:allLayer_onoff()' onfocus='this.blur();'>\
			  <div id='list_button01' style='display:block'><img src='http://www.tourvis.com/Common/images/top/tour_list.jpg' width='162' height='42' border='0'/></div>\
			  <div id='list_button02' style='display:none'><img src='http://www.tourvis.com/Common/images/top/tour_list_close.jpg' width='162' height='42' border='0'/></div>\
			  </a></td>\
              <td style='padding-left:60px; padding-right:15px'>\
			  <!-- »ó´Ü°Ë»ö ½ÃÀÛ-->\
			  <table width='100%' border='0' cellspacing='0' cellpadding='0'>\
                <tr>\
                  <td width='18'><img src='http://www.tourvis.com/Common/images/top/search_left.jpg' width='18' height='42' /></td>\
                  <td align='left' valign='top' background='http://www.tourvis.com/Common/images/top/search_bg2.jpg' style='padding-left:5px; padding-top:12px'>\
				");
				document.writeln('<script> ');
				document.writeln('//insert_select(ÀúÀåº¯¼ö¸í,°¡·Î,ÆùÆ®Å©±â,º¸µå»ö,¹è°æ»ö,¼±ÅÃ»ö,È­»ìÇ¥ÀÌ¹ÌÁö); ');
				document.writeln('insert_select("select","75","8","FFFFFF","FFFFFF","FFFFFF","http://www.tourvis.com/Common/images/top/searchm_right.jpg"); ');
				document.writeln('//insert_select_option(ÀúÀåº¯¼ö¸í,ÆùÆ®Å©±â,º¸µå»ö,¹è°æ»ö,¼±ÅÃ»ö,value,view_value,ÃÊ±â¼±ÅÃ¿©ºÎ:(Y¼±ÅÃ); ');
				document.writeln('insert_select_option("select","8","FFFFFF","FFFFFF","FFFFFF","1","ÇØ¿Ü¿©Çà","Y"); ');
				document.writeln('insert_select_option("select","8","FFFFFF","FFFFFF","FFFFFF","2","±¹³»¿©Çà"); ');
				//document.writeln('insert_select_option("sbox","8","FFFFFF","FFFFFF","FFFFFF","3","ÀÚÀ¯¿©Çà"); ');
				document.writeln('</script>');
				document.write("\
					  <!--table width='100%' border='0' cellspacing='0' cellpadding='0'>\
						<tr>\
						  <td class='txt_skyb' style='padding-top:5px'><a href='#' >ÇØ¿Ü¿©Çà</a></td>\
						  <td style='padding-top:5px'><a href='#' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/top/searchm_right.jpg' width='11' height='11' border='0' /></a></td>\
						</tr>\
					  </table-->\
				  </td>\
                  <td width='15' background='http://www.tourvis.com/Common/images/top/search_bg.jpg' ><div align='center'><img src='http://www.tourvis.com/Common/images/top/search_b.jpg' width='7' height='24' /></div></td>\
                  <td valign='top' background='http://www.tourvis.com/Common/images/top/search_bg.jpg' style='padding-top:12px'><label>\
                    <input name='search_text' id='search_text' onclick='searchBarClick()' onKeyPress='keyDaum()' type='text' class='input_search' value='' size='20' />\
                  </label></td>\
                  <td width='15' valign='top'><a href='javascript:search();'><img src='http://www.tourvis.com/Common/images/top/search_right.jpg' width='60' height='42' border='0' /></a></td>\
                </tr>\
              </table>\
			  <!-- »ó´Ü°Ë»ö ³¡-->\
			  </td>\
              <td width='290'><img src='http://www.tourvis.com/Common/images/top/point.jpg' width='291' height='42' /></td>\
            </tr>\
          </table></td>\
        <td width='25'><img src='http://www.tourvis.com/Common/images/top/top_right.gif' width='25' height='140' /></td>\
      </tr>\
    </table></td>\
  </tr>\
  <tr>\
	<td>\
		<div id='allLayer' style='display:none;position:absolute;z-index:800' >\
			<iframe src = 'http://www.tourvis.com/TourvisInfo/tourAllList.jsp?domain="+document.domain+"' frameborder='0' width='915' height='240' scrolling='no'></iframe>\
		<div>\
	</td>\
</tr>\
</table>\
<iframe id='searchTextIfm' src='http://www.tourvis.com/searchBarSet.jsp?domain="+document.domain+"' width='0' height='0'></iframe>\
");
 var HTTP_MSN_MEMBER_NAME="";/*È¸¿ø¸í*/
 var _HUsrSvrAddr="http://asp24.http.or.kr",_HRndTmpGuid="r"+(new Date().getTime()*Math.random()*9*Math.random()*0.9);
 function _HLogChkHead(){
  if(document.getElementsByTagName("head")[0]){_HDwnLogSrc()}else{window.setTimeout(_HLogChkHead,30)}
 }
 function _HDwnLogSrc(){
  var h=document.getElementsByTagName("head")[0];var s=document.createElement("script");s.type="text/javascript";
  if(h){h.appendChild(s);s.src=_HUsrSvrAddr+"/HTTP_MSN/UsrConfig/tourvis/js/ASP_Conf.js?s="+_HRndTmpGuid;}
 };
 document.write('<img src="'+_HUsrSvrAddr+'/[sr].gif?d='+_HRndTmpGuid+'" style="width:1px;height:1px;display:none;position:absolute;" onload="_HLogChkHead()" />');