var isSearchBarClick = false;
var searchRink;

var IngUrl = document.location.href;
var returnurl =  _encode(IngUrl);
var c=false;

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.img_box.value.length > 0){
	if(isSearchBarClick){
		window.location = "http://www.tourvis.com/Search/axGoodTotSearchList.jsp?searchType="+s+"&searchKeyWord="+document.all.img_box.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='100%' onclick='select_click(\""+sn+"\");' >");
	document.write("\    <tr>");
	document.write("\        <td class='txt_skyb' style='padding-top:0px'>");
	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:11;' 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.img_box.value.length>0){
		s = document.all.select.value;

		if(document.all.img_box.value.length > 0){	
			search();
		}
	}else
		return;
}

function getsearchText(searchText, searchRink){
	document.all.img_box.value = searchText;
	this.searchRink = searchRink;
	document.getElementById("img_box").style.color = "#f26522";
}

function searchBarClick(){
	if(!isSearchBarClick){
		document.all.img_box.value = "";
	}
	isSearchBarClick = true;
	document.getElementById("img_box").style.color = "#666666";
}
function Img_in (value) {

        document.getElementById("img_box").style.backgroundImage="";
        c=true;
}

function Img_out (value) {
        if (value != ""){
         document.getElementById("img_box").style.backgroundImage="";
         }else{
        document.getElementById("img_box").style.backgroundImage="url(http://www.tourvis.com/Common/images/topMenu/m_okcash.jpg)";
        c= false;
        }
}

var ant= 0;
function top_rolling(aaa){	
	var html = "";
	var titles = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";	
	var t0 = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";
	var t1 = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";
	var t2 = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";
	var t3 = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";
	var t4 = "<a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'> <img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/>";		
	if(aaa == 1 ){			
			ant++;		
			if(ant == 4){
				ant = ant-4;
			}
			if(ant < 4){
				if(ant==0){
					html = t0;
				}else if(ant==1){
					html = t1;
				}else if(ant==2){
					html = t2;
				}else if(ant==3){
					html = t3;
				}else if(ant==4){
					html = t4;	
				}else
					html = t0;	
			 }			
		}else{
			ant--;
		
		if(ant < 0){
			ant = ant+4;
		}		
		if (ant < 4) {
			if(ant==0){
				html = t0;
			}else if(ant==1){
				html = t1;
			}else if(ant==2){
				html = t2;
			}else if(ant==3){
				html = t3;
			}else if(ant==4){
				html = t4;	
			}else
				html = t0;	
		 }
		}
		
	document.getElementById("result").innerHTML = html;
}


document.writeln('<style type="text/css">');
document.writeln('ul { margin:10px; list-style:inside circle; font-weight:bold; }');
document.writeln('li { cursor:pointer; } ');
document.writeln('td {font-size:12px; font-family:dotum ,seoul,arial; color:#666666; line-height:17px; letter-spacing:-0.04em}');
document.writeln('A:link  {color:#666666; text-decoration:none}');
document.writeln('A:visited  {color:#666666; text-decoration:none}');
document.writeln('A:hover  {color:#666666; text-decoration:none}');
document.writeln('.input_search_top { padding-left:7px;font-family: ±¼¸²; font-size:12px;  border:0px solid #CCCCCC; color:#666666; line-height:14px; background-color:#ffffff; letter-spacing:-0.1em}');
document.writeln('.txt_search {font-family: ±¼¸²; color:#0055a8; font-size:12px; line-height:16px;letter-spacing:-0.04em; }');
document.writeln('.txt_search a:link {font-family: ±¼¸²; color:#0055a8; font-size:12px; line-height:16px;letter-spacing:-0.02em; }');
document.writeln('.txt_search a:visited {font-family: ±¼¸²; color:#0055a8; font-size:12px; line-height:16px;letter-spacing:-0.02em; }');
document.writeln('.txt_search a:hover {font-family: ±¼¸²; color:#0055a8; font-size:12px; line-height:16px;letter-spacing:-0.02em; }');
document.writeln('</style>');
document.write("\
<table width='915' border='0' align='center' cellpadding='0' cellspacing='0' style='margin-bottom:5px'>\
  <tr>\
    <td><table width='915' border='0' align='center' cellpadding='0' cellspacing='0' style='margin-bottom:5px'>\
        <tr>\
          <td width='270' rowspan='2'><a href='http://www.tourvis.com/' onFocus='this.blur();'><img src='http://www.tourvis.com/Common/images/topMenu/m_toplogo.jpg' width='269' height='81' border='0' /></a></td>\
          <td align='right'>\
		  <!--GNB ·Î±×ÀÎ¹× ¸¶ÀÌÆäÀÌÁö ½ÃÀÛ --------------------------->\
		  <table width='646' height='35' border='0' cellpadding='0' cellspacing='0' style='margin-bottom:10px'>\
            <tr>\
			 <td width='246'></td>\
              <td width='16'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_left.jpg' width='16' height='34' /></td>\
              <td background='http://www.tourvis.com/Common/images/topMenu/m_tm_bg.jpg'><table border='0' cellpadding='0' cellspacing='0'>\
                <tr>\
				");
					var CookieValue = null;
					CookieValue = getCookieValue("TOURVIS_COOKIE");

					if(CookieValue == null || CookieValue.length == 0 || CookieValue.length == "null"){
				document.write("\
                  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='javascript:login();'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_login.jpg' width='31' height='13' border='0' /></a></td>\
                  <td align='center'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_btn.jpg' width='3' height='13' /></td>\
                  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='javascript:Inquery();'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_member.jpg' width='40' height='13' border='0' /></a></td>\
                  <td  align='center'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_btn.jpg' width='3' height='13' /></td>\
                  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='javascript:idsearch();'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_idpw.jpg' width='54' height='13' 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 style='padding-left:3px; padding-right:3px'>\
						<a href='https://member.tourvis.com/member/logout.ps.jsp?returnurl="+returnurl+"'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_logout.jpg' border='0' /></a></td>\
						<td align='center'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_btn.jpg'/></td>\
						<td style='padding-left:3px; padding-right:3px'>\
						<a href='javascript:useredit();'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_member2.jpg'border='0' /></a></td>\
					");
				}
				function win_alert()
				{
					alert("ÁË¼ÛÇÕ´Ï´Ù.½Ã½ºÅÛÁ¡°ËÁßÀÔ´Ï´Ù.");
				}
				document.write("\
				  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='http://www.tourvis.com/sk/' target='_blank'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_sk.jpg' width='77' height='21' border='0' /></a></td>\
                  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='http://www.ebiztrip.com/' target='_blank'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_ebiz.jpg' width='61' height='21' border='0' /></a></td>\
                  <td style='padding-left:3px; padding-right:3px'>\
				  <a href='http://www.tourvis.com/Info/index.jsp'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_tour.jpg' width='41' height='13' border='0' /></a></td>\
                  <td align='center'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_btn2.jpg' width='3' height='13' /></td>\
                  <td style='padding-left:3px; padding-right:3px'><a href='http://www.tourvis.com/Customer/index.jsp'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_cs.jpg' width='41' height='13' border='0' /></a></td>\
                  <td align='center'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_btn2.jpg' width='3' height='13' /></td>\
				  <td style='padding-left:3px; padding-right:10px'><a href='http://www.tourvis.com/newMypage/index.jsp'><img src='http://www.tourvis.com/Common/images/topMenu/m_tm_mypage.jpg' width='51' height='13' /></a></td>\
                </tr>\
              </table></td>\
            </tr>\
          </table>\
		  <!--GNB ·Î±×ÀÎ¹× ¸¶ÀÌÆäÀÌÁö ³¡--------------------------->\
		  </td>\
        </tr>\
        <tr>\
          <td><table width='100%' border='0' cellpadding='0' cellspacing='0'>\
            <tr>\
              <td width='415' valign='bottom'>\
			  <!-- »ó´Ü°Ë»ö ½ÃÀÛ-->\
			  <table width='100%' border='0' cellpadding='0' cellspacing='0'>\
                  <tr>\
                    <td width='8' valign='top'><img src='http://www.tourvis.com/Common/images/topMenu/m_search_left.jpg' width='8' height='40' /></td>\
                    <td background='http://www.tourvis.com/Common/images/topMenu/m_search_bg.jpg'><table width='100%' height='32' border='0' align='left' cellpadding='0' cellspacing='0'>\
                        <tr>\
                          <td valign='middle' style='padding-left:0px; padding-bottom:5px'>\
						  ");
				document.writeln('<script> ');
				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("select","8","FFFFFF","FFFFFF","FFFFFF","1","ÇØ¿Ü¿©Çà","Y"); ');
				document.writeln('insert_select_option("select","8","FFFFFF","FFFFFF","FFFFFF","2","±¹³»¿©Çà"); ');
				document.writeln('</script>');
				document.write("\
							</td>\
						  <td width='5' ><img src='http://www.tourvis.com/Common/images/topMenu/search_b.jpg' width='7' height='24' /></td>\
                          <td valign='top' style='padding-top:7px'>\
						  <input name='img_box' class='input_search_top' type='text'  onClick='searchBarClick();' onKeyPress='keyDaum()' STYLE='width:270px; background-image:url(http://www.tourvis.com/Common/images/topMenu/m_okcash.jpg); background-repeat:no-repeat;' onFocus='return Img_in();' onFocusout='return Img_out(this.value);'>\
                          </td>\
						  <td width='15' onClick='search();' valign='top'><img src='http://www.tourvis.com/Common/images/topMenu/m_search_btn.jpg' width='60' height='40' border='0' /></td>\
                        </tr>\
                    </table>\
					 <!-- »ó´Ü °Ë»ö ³¡  ----------------------------------------------------------->\
					 </td>\
                  </tr>\
              </table></td>\
              <td width='10'></td>\
              <td>\
			  <!-- »ó´Ü ·Ñ¸µ ¹è³Ê ½ÃÀÛ  ----------------------------------------------------------->\
			  <table width='210' border='0' align='center' cellpadding='0' cellspacing='0'>\
                  <tr>\
                    <td width='20' onClick='top_rolling(2);'><img src='http://www.tourvis.com/Common/images/topMenu/m_allow_pre.jpg' width='18' height='16' border='0' /></td>\
                    <td width='170'><div id='result'><a href='http://www.tourvis.com/Event/event/11090101/index.html?src=image&kw=0000D6'><img src='http://www.tourvis.com/Event/event/11090101/ban/ban170_45.jpg' border='0'></a><br/></div></td>\
                    <td width='20' onClick='top_rolling(1);'><img src='http://www.tourvis.com/Common/images/topMenu/m_allow_next.jpg' width='18' height='16' border='0' /></td>\
                  </tr>\
              </table>\
			   <!-- »ó´Ü ·Ñ¸µ ¹è³Ê ³¡  ----------------------------------------------------------->\
	      </td>\
        </tr>\
          </table></td>\
		</tr>\
	  </table>\
      <table width='915' border='0' align='center' cellpadding='0' cellspacing='0' style='margin-bottom:10px'>\
        <tr>\
          <td background='http://www.tourvis.com/Common/images/topMenu/m_menu_bg.jpg'><a href='http://www.tourvis.com/Abroad/index.jsp' onfocus='this.blur();'></a><a href='/Abroad/index.jsp' onfocus='this.blur();'></a><a href='/Golf/index.jsp' onfocus='this.blur();'></a><a href='/Honeymoon/index.jsp' onfocus='this.blur();'></a><a href='http://free.tourvis.com/main/main.html?refer=http://www.tourvis.com/Honeymoon/index.jsp&amp;FR=' onfocus='this.blur();'></a><a href='#' onfocus='this.blur();'></a><a href='#' onfocus='this.blur();'></a><a href='/Domestics/index.jsp' onfocus='this.blur();'></a><a href='/newLodging/index.jsp' onfocus='this.blur();'></a>\
		   <!-- »ó´Ü ¸Þ´º ½ÃÀÛ  ----------------------------------------------------------->\
            <table border='0' cellpadding='0' cellspacing='0'>\
              <tr>\
                <td><a href='javascript:allLayer_onoff()' onfocus='this.blur();'>\
				  <div id='list_button01' style='display:block'><img src='http://www.tourvis.com/Common/images/topMenu/m_all_btn.jpg' width='202' height='48' border='0' /></div>\
				  <div id='list_button02' style='display:none'><img src='http://www.tourvis.com/Common/images/topMenu/m_all_btn_close.jpg' width='202' height='48' border='0' /></div>\
				</a></td>\
                <td><a href='http://www.tourvis.com/Abroad/index.jsp' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/topMenu/m_menu01.jpg' width='89' height='48' 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/topMenu/m_menu02.jpg' width='73' height='48' 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/topMenu/m_menu03.jpg' width='59' height='48' border='0' /></a></td>\
                <td><a href='http://naeil.tourvis.com/' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/topMenu/m_menu04.jpg' width='72' height='48' border='0' /></a></td>\
                <td><a href='http://saleair.tourvis.com/common/comPlusfile.lts?type=M' onfocus='this.blur();'><img src='http://www.tourvis.com/Common/images/topMenu/m_menu05.jpg' width='62' height='48' 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/topMenu/m_menu06.jpg' width='73' height='48' 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/topMenu/m_menu07.jpg' width='73' height='48' 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/topMenu/m_menu08.jpg' width='73' height='48' 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/topMenu/m_event_btn.jpg' width='93' height='48' border='0' /></a></td>\
              </tr>\
            </table></td>\
          <td width='23'><img src='http://www.tourvis.com/Common/images/topMenu/m_menu_right.jpg' width='23' height='48' border='0' /></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='340' scrolling='no'></iframe>\
		<div>\
	</td>\
  </tr>\
</table>\
");
