/********** °Ë»ö¾î ÀÚµ¿¿Ï¼º **************/
var keystatus = 1;
function setTextBox(flag) {
	var textbox = document.formSearch.query; 
	var _event; 
	switch ( getNavigatorType() ) {
		case 1 : // IE
			_event = window.event;
			nodeName = _event.srcElement.nodeName;
			break;
		case 2 : // Netscape
			_event = event;
			nodeName = _event.target.nodeName;
			break;
		default :
			nodeName = "None"; 
			break;
	}
	key = _event.keyCode;
	if ( keystatus == 1 && flag && key != 13) {
		//textbox.value = "";
		keystatus = 2;
	}
}

function getNavigatorType() {
	if ( navigator.appName == "Microsoft Internet Explorer" )
		return 1;  
	else if ( navigator.appName == "Netscape" )
		return 2;	
	else 
		return 0;   
}

function get_nav() { 
	var ver=navigator.appVersion ;
	 if (navigator.appName.indexOf("Microsoft")!=-1 && ver.indexOf("MSIE 4")==-1 && ver.indexOf("MSIE 3")==-1) {
		return 1;
	 } else if (navigator.appName.indexOf("Netscape")!=-1) return 2;
			else return 0;
 }
 function chk_rt(t) { 
		if (t!=1) return 0;
		try { 
			//var Td=top.document;
			var Td=document;
			var Ip=Td.formSearch.query;
		} catch (e) { 
			return 0;
		} 
		return 1;
 } 
 var t=get_nav();
 var c=chk_rt(t);
 
 var Td=document ;
 var Ip=Td.formSearch.query;
 var host=location.host;

 var m_on=0,m_now=0,s_now=0,shl=0,a_now=0,a_on=0,arr_on=0,frm_on=0 ;
 var cn_use="use_ac" ;
 var wi_int=500 ;																		//µ¿ÀÛ½Ã°£
 var B="block",I="inline",N="none",UD="undefined" ;
 var bak="",old="" ;
 var qs_ac_list="",qs_ac_id="",qs_q="",qs_m=0,qs_ac_len=0 ;
 bak=old=Ip.value ;
 var acuse=1;																				//ÀÚµ¿¿Ï¼º»ç¿ë¿©ºÎ 0=»ç¿ë¾ÈÇÔ, 1=»ç¿ëÇÔ
 var acopen=0;																			//±â´ÉÃ¢ ¿­¸²¿©ºÎ 0=´ÝÈû, 1=¿­¸²
 var maxOutput = 7;																	//ÃÖ´ëÃâ·Â°Ç¼ö (7°Ç)
 var tWidth = 290;																	//°Ë»öÅ×ÀÌºí Å©±â
 var cc= new Object() ;
     
 if (t==1 && c==1) { 
	function wd(twidth) { 
		 var a = 1 ;
		 var b = 1;     
		 ac_body.style.top = a ;
		 ac_body.style.left = b ;
		 
		 if (twidth) tWidth = twidth;

		//if (acuse==1) Ip.autocomplete = "off" ;
		//else if (acuse==0) Ip.autocomplete = "on" ;
		Ip.onclick = req_ipc ;
		//Ip.onblur = dis_p ;
		//Td.body.onclick = dis_p ;
	}
	      
	 var dnc=0;
	 function req_ipc() {  
		dnc=1;                               
		frm_on=0;
		req_ac2(1) ;
	 }

	 function dis_p() {
		 if (dnc) { 
			 dnc=0;
			return ;
		} 
		if (arr_on) {
//			mp_layer() ;
			return ;
		}
		if (frm_on) { 
			return ;
		} 
		alw=0 ;
		ac_hide(5) ;
	 } 

	 function req_ac2(me) { 
		 if (Ip.value == "" || acuse==0 ) return ;
		 if (a_on && dnc) { 
			ac_hide(6) ;
			return ;
		} 
		var o = get_cc(me) ;
		 if (o && o[1][0] != "" ) ac_show(o[0], o[1], o[2], me) ;
		 else reqAC(me) ;
	 } 

	 var _req = null;
	 function get_req() {
		 if(_req && _req.readyState!=0) { 
			 _req.abort() ;
		 } 
		 try {
			 _req = new ActiveXObject("Msxml2.XMLHTTP") ;
		 } catch (e) { 
			 try { 
				 _req = new ActiveXObject("Microsoft.XMLHTTP") ;
			 } catch (e) { 
				 _req = false ;
			 } 
		}
		if (!_req && typeof XMLHttpRequest!=UD) _req = new XMLHttpRequest() ;
		return _req ;
	 } 

	 function showAC() {
		
		 if (_req.readyState==4 && _req.responseText && _req.status==200) { 
			 eval(_req.responseText) ;
			 set_cc(qs_q, qs_ac_list, qs_ac_id, qs_m) ;
			 ac_show(qs_q, qs_ac_list, qs_ac_id, qs_m) ;
		 }
	 } 

	 function reqAC(me) { 
		 var sv ;
		 var ke=trim_space(Ip.value, me) ;
		 ke = ke.replace(/ /g, "%20") ;
		 if (ke == "") { 
			 ac_hide(7) ;
			 return ;
		 } 
		 
		 /*** ÃÊ¼º,Áß¼º¿¡ ¹ÝÀÀÇÏ±â...***/
		 var lastChar = ke.charAt (ke.length - 1);
     if (lastChar >= '¤¡' && lastChar <= '¤¾') {
        ac_hide (8);
        return;
     }
     
		//common.ticketlink.co.kr µî ´Ù¸¥ µµ¸ÞÀÎÀÇ °æ¿ì XMLHttpRequest °¡ ¾ÈµÇ±â ¶§¹®¿¡
		//°øÅë¸Þ´ºÀÎ /menu/¿¡¼­ »ç¿ëÇÑ´Ù
		if (host.indexOf("www") == 0) {
			sv = "/common/menu/searchAutocomplete.jsp?p=" + me + "&q=" + ke ;
		} else {
			sv = "/menu/searchAutocomplete.jsp?p=" + me + "&q=" + ke ;	
		}
		 
		 //alert(sv);
		 _req = get_req() ;
		 if (_req) { 
			 _req.open("GET", sv, true) ;
			 _req.onreadystatechange = showAC ;
		 } 
		 try {
			 _req.send() ;
		 } catch (e) { 
			 return 0 ;
		 } 
	 } 
 
	 function ac_show(aq, al, ai, am) {
		 if (aq && aq!="" && aq!=trim_space(Ip.value, am)) return ;
		 qs_q = aq ;
		 qs_m = am ;
		 qs_ac_list = al ;
		 qs_ac_id = ai ;
		 qs_ac_len = qs_ac_list.length ;
		 var h = (qs_ac_len > maxOutput) ? maxOutput : qs_ac_len ;								//ÃÖ´ë °Ë»ö°Ç¼ö : maxOutput°Ç
		 h = h * 23 ;

		 print_ac() ;

		 if (qs_ac_list[0] == "" && (qs_m==1 || qs_m==2)) { 
			 qs_ac_len=1;
			 h=19;
			 if (qs_ac_list[0] == "") h = h + 20;
		 } 
		 
		 scrol.style.height = h ;
		 if (qs_ac_len) { 
			 h+=38;
			 a_on=1;
		 } else { 
			 a_on=0;
		 }
		 ac_body.width = tWidth ;
		 ac_body.height = h ;
			 
   

//		 if (qs_ac_list[0] != "")
			 ac_body.style.display = B;
		 if (a_on) { 
			 set_acpos(0);
			 scrol.scrollTop=0;
			 Ip.onkeydown = ackhl;
		 } 
	 } 

	 function set_acpos(v) { 
		a_now = v;
		setTimeout('set_ahl();', 10);
	 }

	 function set_ahl() { 
		 if (!a_on) return;
		 var o1, o2;
		 for (i=0;  i<qs_ac_len; i++) { 
			o1 = eval('ac' + (i+1));
			if ((i+1) == a_now) o1.style.backgroundColor = '#DDEFFC';
			else o1.style.backgroundColor = '';
		}
	 } 
	 
	 var max_row=5;
	 function ackhl() { 
		 //var e=top.window.event ;
		 var e= window.event ;
		 var o1, o2 ;
		 if (e.keyCode==39) { 
			 req_ac2(1) ;
		 }
		 if (e.keyCode==13) {
			 //if (a_now>0) search_keyword(qs_ac_list[a_now]);
		 }
		 if (e.keyCode==40 || (e.keyCode==9 && !e.shiftKey)) { 
			 if (m_on) return ;
			 if (!a_on) {
				 req_ac2(1) ;
				 return ;
			}
			if (a_now < qs_ac_len) { 
				if (a_now == 0) bak = Ip.value ;
				a_now++ ;
				if (a_now > max_row) scrol.scrollTop = parseInt((a_now-1)/max_row)*max_row*19 ;
				 o1 = eval('ac' + a_now) ;
				 o2 = eval('acq' + a_now) ;
				 old = Ip.value = o2.outerText ;
				 Ip.focus() ;
				 set_ahl() ;
				 e.returnValue = false;
			 } 
		 }
		 if (a_on && (e.keyCode==38 || (e.keyCode==9 && e.shiftKey))) {
			 if (!a_on) return ;
			 if (a_now <= 1) { 
				 ac_hide(9) ;
				 old = Ip.value = bak ;
			 } 
			 else {
				 a_now-- ;
				 if ((qs_ac_len-a_now)+1 > max_row) scrol.scrollTop = (qs_ac_len-(parseInt((qs_ac_len-a_now)/max_row)+1)*4)*19 ;
				 o1 = eval('ac'+ a_now) ;
				 o2 = eval('acq' + a_now) ;
				 old = Ip.value = o2.outerText ;
				 Ip.focus() ;
				 set_ahl() ;
				 e.returnValue = false ;
			 }
		 }
	 } 

	//½ÇÁ¦ °Ë»öÃ¢ÀÌ º¸ÀÌ´Â ¸í·É¾î
	 function print_ac() {
		 if (qs_ac_list[0] == "") {
			 scrol.innerHTML = get_ac0() ;
		 }
		 else {

			 scrol.innerHTML = get_aclist() ;
		 }
		 ac_body.style.display = B ;
		 
		if (acuse == 0) popup_ac(3);	
		else {
			if (Ip.value == "") popup_ac(1);	
			else 						popup_ac(2);
		}
		 
		 setTimeout('set_ahl();', 10) ;
	 } 



	 function get_aclist() { 
		 var d="",ds="",l=0,s="", cnt=0, pos=0, qlen=0;
		 if (qs_ac_list[0] != "") { 
			 s = "<table width="+tWidth+" border=0 cellspacing=0 cellpadding=0>" ;
			 for (i=0; i<qs_ac_len;	i++) { 
				 var query = qs_ac_list[i].split("_");
				 ds = d = query[0];
				 cnt = query[1];
				 l = js_strlen(d) ;
//				 if (l > 40) ds = js_substring(d, 0, 40) + "..." ;
				pos = d.indexOf(Ip.value);
				if (pos >= 0) {
					if (pos == 0) {
						ds = js_highlight (ds, Ip.value,  0);
					}
					else {
						ds = js_highlight (ds, Ip.value,  1);
					}
				}

				// s += "<a href='javascript:search_item2();'>";
				 s += "<tr id='ac" + (i+1) + "' onmouseover=\"set_acpos('" + (i+1) + "')\" onmouseout=\"set_acpos(0); \" onclick=\"search_item2();set_acinput('" + (i+1) + "')\" style=\"this.style.backgroundColor=''\">" ;
				 s += "<td align=left height=23 style='cursor:pointer'>&nbsp;" + ds + "</td>" ;
				 
				if (cnt >= 100)
				{
				   s += "<td align=right><img src='http://img2.ticketlink.co.kr/search/ra_05.gif'>&nbsp;</td>" ;
				}
				else if ( cnt >= 50 && cnt < 100)
				{
				  s += "<td align=right><img src='http://img2.ticketlink.co.kr/search/ra_04.gif'>&nbsp;</td>" ;
				}
				else if ( cnt >= 10 && cnt < 50)
				{
				  s += "<td align=right><img src='http://img2.ticketlink.co.kr/search/ra_03.gif'>&nbsp;</td>" ;
				}
				else if ( cnt >= 5 && cnt < 10)
				{
				  s += "<td align=right><img src='http://img2.ticketlink.co.kr/search/ra_02.gif'>&nbsp;</td>" ;
				}
				else if ( cnt >= 1 && cnt < 5)
				{
				  s += "<td align=right><img src='http://img2.ticketlink.co.kr/search/ra_01.gif'>&nbsp;</td>" ;
				}
				
				 //s += "<td align=right>" + cnt + "È¸</td>" ;
				 s += "</tr>" ;
				 s += "<span id='acq" + (i+1) + "' style='display:none'>" + d + "</span>" ;
			 } 
			 s += "</table>" ;
		 }
		 return s ;
	 } 
	 
	 
 	 function js_makehigh_pre(s, t) { 
		 var d="";
		 var s1=s.replace(/ /g, "");
		 var t1=t.replace(/ /g, "");
		 t1=t1.toLowerCase();
		 if (t1==s1.substring(0, t1.length)) {
			d="<font color=#ED5F00>";
			for (var i=0,j=0; j<t1.length; i++) 
			{
				if (s.substring(i, i+1)!=" ") j++;
				d+=s.substring(i, i+1)
			 }
			 d+="</font>"+s.substring(i, s.length)
		 } 
		 return d;
	 } 
	 
	 function js_makehigh_suf(s, t) { 
		 var d="";
		 var s1=s.replace(/ /g, "");
		 var t1=t.replace(/ /g, "");
		 t1=t1.toLowerCase();
		 if (t1==s1.substring(s1.length-t1.length))  { 
			for (var i=0,j=0 ; j<s1.length-t1.length ;  i++) { 
				if (s.substring(i, i+1)!=" ") j++;
				d+=s.substring(i, i+1);
			 } 
			d+="<font color=#ED5F00>";
			 for (var k=i,l=0;  l<t1.length;  k++) {
				if (s.substring(k, k+1)!=" ") l++;
				 d+=s.substring(k, k+1);
			 }
			 d+="</font>";
		 }
		 return d;
	 } 
	
	//±ÛÀÚ »ö»ó º¯°æ
	 function js_highlight(s, d, is_suf) {
		 var ret="";
		 if (!is_suf) { 
			ret=js_makehigh_pre(s, d);
		 } 
		 else { 
			ret=js_makehigh_suf(s, d);
		 }	
		 if (ret=="") return s;
		 else return ret;
	 } 

	 function set_acinput(v) { 
		 if (!a_on) return ;
		 var o = eval('acq' + a_now) ;
		 old = Ip.value = o.outerText ;
		 Ip.focus() ;
		 ac_hide(10) ;
	 } 

	 function get_ac0() { 
		 var s="",ment="" ;
		 if (qs_m==1) ment="ÇØ´ç ´Ü¾îÀÇ ÃßÃµ¾î°¡ ¾ø½À´Ï´Ù";
		 else if (qs_m==2) ment="ÇØ´ç ´Ü¾î·Î ³¡³ª´Â ÃßÃµ¾î°¡ ¾ø½À´Ï´Ù";
		 else ment="°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä";
		 if (Ip.value == "") ment="°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä";
		 if (acuse == 0) ment="°Ë»ö¾î ÀÚµ¿¿Ï¼º ±â´ÉÀÌ ²¨Á® ÀÖ½À´Ï´Ù";
		 
		 scrol.style.height = 40 ;
		 s += "<table width="+tWidth+" border=0 cellspacing=10 cellpadding=0>" ;
		 s += "<tr id=ac1 onmouseover=\"set_acpos(1); \" onmouseout=\"set_acpos(0); \" style=\"backgroundColor=''\">" ;
		 s += "<td align=left height=23>" + ment + "</td></tr>" ;
		 s += "</table>" ;
		 s += "<span id=acq1 style='display:none'>" + old + "</span>" ;
		 return s ;
	 }

	 function js_strlen(s) { 
		 var i,l=0;
		 for (i=0; i<s.length; i++) 
			 if (s.charCodeAt(i) > 127) l+=2;
			 else l++;
		 return l;
	 }

	 function js_substring(s, start, len) { 
		 var i,l=0;d="" ;
		 for (i=start; i<s.length && l<len; i++) {
			 if (s.charCodeAt(i) > 127) l+=2 ;
			 else l++ ;
			 d+=s.substr(i, 1) ;
		 } 
		 return d ;
	 } 

	function trim_space(ke, me) { 
		if (me!=2) {
			ke = ke.replace(/^ +/g, "") ;
			ke = ke.replace(/ +$/g, " ") ;
		} else { 
			ke = ke.replace(/^ +/g, " ") ;
			ke = ke.replace(/ +$/g, "") ;
		} 
		ke = ke.replace(/ +/g, " ") ;
		return ke ;
	 } 

	 function get_cc(me) { 
		 var ke=trim_space(Ip.value, me) + me ;
		 return typeof(cc[ke])==UD ? null : cc[ke] ;
	 } 

	 function set_cc(aq, al, ai, me) { 
		 cc[aq+me] = new Array(aq, al, ai) ;
	 } 

	 function ac_hide(a) {
		if (ac_body.style.display == N) return ;
		ac_body.style.display = N ;
		a_on = a_now = 0 ;
		switch_image(0);
		//alert('hide='+a);
	} 
	
	//»ç¿ë¾ÈÇÔÀ¸·Î º¯°æ½Ã returnµÇ±â ¶§¹®¿¡ ´Ù½Ã »ç¿ëÇÏ·Á¸é ½ÇÇà
	 function wi() {
		 if (acuse==0) return ;
		 if (m_on) { 
			 setTimeout("wi()", wi_int) ;
			return ;
		} 
		var now = Ip.value ;
		 if (now == "" && now != old) ac_hide(1) ;
		if (now != "" && now != old && keystatus!=1) { 
			var o=null, me=1 ;
			o = get_cc(me) ;
			if (o && o[1][0] != "") ac_show(o[0], o[1], o[2], me) ;
			else reqAC(me) ;
		} 
		old = now ;
		setTimeout("wi()", wi_int) ;
	 } 

	 function set_mouseon(f) { 
		 if (f==1) arr_on = 1 ;
		 else if (f==2) frm_on = 1 ;
	 }

	 function set_mouseoff(f) {
		 if (f==1) arr_on = 0 ;
		 else if (f==2) frm_on = 0 ;
	 } 

	 function req_pf() {
		 frm_on=1;
		 req_ac2(1);
		 Ip.focus();
		 cursor_end();
	 }

	 function req_sf() {
		 frm_on=1;
		 req_ac2(2);
		 Ip.focus();
		 cursor_end();
	 } 

	 function cursor_end() { 
		 if (t==1 && c==1) { 
			 var rng=Ip.createTextRange();
			 if (rng!=null) { 
				 rng.move("textedit");
				 rng.select();
			 }
		 }
	 }
	
 }
 
 function setCookie( name, value, expiredays )
 {
     var todayDate = new Date();
     todayDate.setDate( todayDate.getDate() + expiredays );
     document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + "; domain=.ticketlink.co.kr"
 }
 
 function getCookie(name) {
		var cookieName=name+"=";
		var x=0;
		while(x<=document.cookie.length) {
			var y=(x+cookieName.length);
			if(document.cookie.substring(x,y)==cookieName) {
				if((endOfCookie=document.cookie.indexOf(";",y))==-1) endOfCookie=document.cookie.length;
				return unescape(document.cookie.substring(y,endOfCookie));
			}
			x=document.cookie.indexOf(" ",x)+1;
			if(x == 0) break;
		}
		return "";
	}
	
	//ÀÚµ¿¿Ï¼º±â´É »ç¿ë¿©ºÎ
 function isUseAutoComplete()
 {
 	var autocompleteInfo = getCookie("autocomplete");
 	if (autocompleteInfo == "" || autocompleteInfo != "nouse") return true;
 	else return false;
 	
}
 
 //ÆäÀÌÁö ·Îµù½Ã ÀÚµ¿¿Ï¼º »ç¿ë¿©ºÎ È®ÀÎ
 function noUseImage()
 {
 	var autocompleteInfo = getCookie("autocomplete");
 	
 	if (isUseAutoComplete()) {
 		document.autocomplete_img.src = "http://img2.ticketlink.co.kr/search/b_acOff.gif";					//»ç¿ëÁßÀÎ°æ¿ì
 		acuse = 1;
 	} else {
 		document.autocomplete_img.src = "http://img2.ticketlink.co.kr/search/b_acOn.gif";				//»ç¿ë¾ÈÇÏ´Â°æ¿ì
 		acuse = 0;
 	}
}
 
 //¹öÆ°Å¬¸¯½Ã ÀÚµ¿¿Ï¼º »ç¿ë¿©ºÎ º¯°æ
 function noUseAutoComplete()
{
	var autocompleteInfo = getCookie("autocomplete");
	
    if (isUseAutoComplete()) {
    	setCookie( "autocomplete", "nouse" , 1000*60*60*24);																			//»ç¿ë¾ÈÇÔÀ¸·Î º¯°æ
    	document.autocomplete_img.src = "http://img2.ticketlink.co.kr/search/b_acOn.gif";
    	acuse = 0;
    } else {
    	setCookie( "autocomplete", "use" , 1000*60*60*24);																			//»ç¿ëÀ¸·Î º¯°æ
    	document.autocomplete_img.src = "http://img2.ticketlink.co.kr/search/b_acOff.gif";
    	acuse = 1;
    	if (Ip.value != "") wd();
    	setTimeout("wi()", wi_int) ;																												//´Ù½Ã È°¼ºÈ­
    	Ip.focus();
    }
    ac_hide(3);
}

//°Ë»ö¾îÀÔ·ÂÃ¢ÀÇ ÀÚµ¿¿Ï¼º È­»ìÇ¥¸¦ À§, ¾Æ·¡·Î º¯°æÇÑ´Ù.
 //type 0 : Ã¢ÀÌ ´ÝÇûÀ»¶§ È­»ìÇ¥ ¾Æ·¡·Î È­»ìÇ¥
 //type 1 : Ã¢ÀÌ ÆîÃÄÁ³À»¶§ À§·Î È­»ìÇ¥
 function switch_image(type){ 
	if(type==0){
		document.autocomplete_img0.src="http://img2.ticketlink.co.kr/re_tem/gnb_btn_arrow.gif";
		acopen = 0;
	}else if(type==1){
		document.autocomplete_img0.src="http://img2.ticketlink.co.kr/re_tem/gnb_btn_arrow.gif";
		acopen = 1;
	}
 }
 
 //ÀÎÇ²¹Ú½ºÀÇ ¼¼¸ð ¹öÆ°À» ´­·¶À»¶§ ÀÚµ¿¿Ï¼ºÃ¢À» º¸¿©ÁØ´Ù.
 function show_ac()
 {
 	//±â´ÉÀÌ ²¨Á® ÀÖ´Â°æ¿ì
 	//alert("acuse="+acuse+" acopen="+acopen);
 	
	if (acuse == 0) {
		if (acopen == 0) 	popup_ac(3);
		else 						popup_ac(0);
	}else{
		if (Ip.value == "") {
			if (acopen == 0) 	popup_ac(1);					//´ÝÇôÀÖ´Â	°æ¿ì
			else						popup_ac(0);					
		} else {
			if (acopen == 0) 	{
				popup_ac(2);											//´ÝÇôÀÖ´Â °æ¿ì
				req_ipc();
			} else						popup_ac(0);
			
		}
	}
	//alert(ac_body.innerHTML);
}

//type=0 : ¸ðµÎ °¨ÃáÁØ´Ù.
 //type=1 : ±â´ÉÀÌ ÄÑÁ® ÀÖ°í, °Ë»ö¾î°¡ ¾ø´Â°æ¿ì (°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä)
 //type=2 : ±â´ÉÀÌ ÄÑÁ® ÀÖ°í, °Ë»ö¾î°¡ ÀÖ´Â °æ¿ì (°Ë»ö°á°ú Ãâ·Â)
 //type=3 : ±â´ÉÀÌ ²¨Á® ÀÖ´Â °æ¿ì (ÀÚµ¿¿Ï¼º ±â´ÉÀÌ ²¨Á® ÀÖ½À´Ï´Ù)
 function popup_ac(type){
	if(type==0){
		switch_image(0);
		ac_hide(4);
	}else if(type==1){
		switch_image(1);
		scrol.innerHTML = get_ac0() ;
		ac_body.style.display = B;
	}else if(type==2){
		switch_image(1);
		ac_body.style.display = B;
	}else if(type==3){
		switch_image(1);
		scrol.innerHTML = get_ac0() ;
		ac_body.style.display = B;
	}
//	alert(scrol.innerHTML);
 }
 
 
 //Ä«Å×°í¸®º° hostÁ¤º¸
 function getCategory(cate_cd)
 {
 	if (cate_cd == "T") return "theater";
 	else if (cate_cd == "C") return "concert";
 	else if (cate_cd == "M") return "cinema";
 	else if (cate_cd == "D") return "life";		
 	else return cate_cd;
}

//
function getMagazineInfo(basic_cd)
{ 
	if (basic_cd == "110") return "cinema";
	else if (basic_cd == "120") return "theater";
	else if (basic_cd == "130") return "concert";
	else if (basic_cd == "140") return "sports";		
	else if (basic_cd == "150") return "life";			
	else return basic_cd;
}
 
 //»ó¼¼ÆäÀÌÁö·Î ÀÌµ¿
 //detail : 01:±âº»Á¤º¸, 02:¿µÈ­Á¤º¸, 03:¸ÖÆ¼¹Ìµð¾î, 04:¸®ºä/º°Á¡, 06:°ü·Ã±â»ç
function goDetailPage(category, pro_cd, detail)
{
	if (!detail) detail = "01";
	//location.href = "http://"+category+".ticketlink.co.kr/detail/place_end"+detail+".jsp?pro_cd="+pro_cd;
	window.open("http://"+category+".ticketlink.co.kr/detail/place_end"+detail+".jsp?pro_cd="+pro_cd,"_blank");
}

//ÀÌº¥Æ®ÆäÀÌÁö·Î ÀÌµ¿()
function goEventPage(event_style, event_cd)
{
	//location.href = "http://event.ticketlink.co.kr/event_view.jsp?event_style="+event_style+"&event_cd="+event_cd;
	window.open("http://event.ticketlink.co.kr/event_view.jsp?event_style="+event_style+"&event_cd="+event_cd,"_blank");
}

function goMlEventPage(seq)
{
	//location.href = "http://event.ticketlink.co.kr/event_view.jsp?event_style="+event_style+"&event_cd="+event_cd;
	window.open("http://www.movielink.co.kr/event/progress/progressRead.jsp?event_seq="+seq,"_blank");
}


//ÄÃÃÄ½ÃÆ¼·Î ÀÌµ¿
function goCultureCity(category, pro_cd)
{
	
}

//¸Å°ÅÁø ÆäÀÌÁö·Î ÀÌµ¿
function goMagazine(seq_no, basic_cd, brd_cd)
{
	//location.href = "http://magazine.ticketlink.co.kr/"+getMagazineInfo(basic_cd)+"/all/view.jsp?s_ViewPage="+seq_no+"&s_BasicCd="+basic_cd+"&s_BrdCd="+brd_cd;
	window.open("http://magazine.ticketlink.co.kr/view.jsp?s_ViewPage="+seq_no+"&s_BasicCd="+basic_cd+"&s_BrdCd="+brd_cd,"_blank");
}

//¹«ºñ¸µÅ© ¸Å°ÅÁø ÆäÀÌÁö·Î ÀÌµ¿
function goMagazine2(seq_no, basic_cd, brd_cd)
{
	//location.href = "http://magazine.ticketlink.co.kr/"+getMagazineInfo(basic_cd)+"/all/view.jsp?s_ViewPage="+seq_no+"&s_BasicCd="+basic_cd+"&s_BrdCd="+brd_cd;
	window.open("http://www.movielink.co.kr/magazine/magazineView.jsp?section="+brd_cd+"&magazine_type="+basic_cd+"&magazine_seq="+seq_no,"_blank");
}

//ÀÎ¹°Á¤º¸ÆäÀÌÁö·Î ÀÌµ¿
function goManInfo(category, mseq_no)
{
	//location.href = "http://"+category+".ticketlink.co.kr/info/end_maninfo.jsp?mseq_no="+mseq_no;
	window.open("http://"+category+".ticketlink.co.kr/info/end_maninfo.jsp?mseq_no="+mseq_no,"_blank");
}

//½ºÆ÷Ã÷ ¿¹¸ÅÇÏ±â ¹öÆ° Å¬¸¯
function goReserve(pro_cd)
{
	window.open("http://sports.ticketlink.co.kr/detail/end_product01.jsp?pro_cd="+pro_cd,"_blank");
}

//½ºÆ÷Ã÷ÀÎ¹° ÆäÀÌÁö·Î ÀÌµ¿
function goPlayer(code_cd, team_cd, player_id)
{
	//window.open("http://sports.ticketlink.co.kr/info/info_p01_03.jsp?s_codecd="+code_cd+"&s_teamcd="+team_cd,"_blank");
	window.open("http://sports.ticketlink.co.kr/info/info_p01_view.jsp?s_gubun="+code_cd+"&s_bdcd="+team_cd+"&s_num=03", "_blank");
	
}

//Àå¼ÒÆäÀÌÁö·Î ÀÌµ¿
function goPlace(category, place_id)
{
	//location.href = "http://"+category+".ticketlink.co.kr/place/place_view.jsp?flag=0&place="+place_id;
	if (category == "cinema") {
		window.open("http://"+category+".ticketlink.co.kr/place/end_place.jsp?flag=0&area=001&place="+place_id,"_blank");	
	} else {
		window.open("http://"+category+".ticketlink.co.kr/place/place_view.jsp?flag=0&place="+place_id,"_blank");	
	}
}

//Àå¼Ò¾È³» ÆË¾÷

function showPlace(master_place_cd, place_cd)
{
	window.open("http://common.ticketlink.co.kr/popup/place_popup.jsp?master_place_cd="+master_place_cd+"&place_cd="+place_cd, "show_place", "toolbar=no,directories=no,scrollbars=yes,resizable=yes,status=yes,menubar=no,width=625, height=500, top=0,left=20");
}





//ÆäÀÌÁö resize
//body onLoad
function page_resize(page_content){
	try{

		if(this.window.name!='') 
		{
			page_content=(page_content==null)?'page_content':page_content;
			var dataobj=document.getElementById(page_content) ;
			dataobj.style.top=0 ;
			dataobj.style.left=0 ;
			var iframe_main;
			if(iframe_main=parent.document.getElementById(this.window.name)) {
				iframe_main.height=dataobj.offsetHeight ;
			}
		}
	}
	catch(e){}
}

//iframe ¸®»çÀÌÁî
function resizeFrame(iframeObj){
   var innerBody = iframeObj.contentWindow.document.body;
   
   var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
   var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
   
   iframeObj.style.height = innerHeight;
   iframeObj.style.width = innerWidth;
   
   this.scrollTo(1,1);  // ¾ÆÀÌÇÁ·¹ÀÓ¾ÈÀÇ ¸µÅ©¸¦ ´­·¶À»¶§ È­¸é»ó´ÜÀ¸·Î ÆäÀÌÁö°¡ À§Ä¡µÇ°Ô ÇÔ
 }


 //°Ë»ö°ø±ÞÀÚ Ãß°¡ÇÏ±â
 function setDefaultSearch() 
 {
 	var isIE = false;
 	var isFire = false;
 	var isVersion = -1;
 	
 	var navi = navigator;
	var usrAgent = navi.userAgent;
	var appVer = navi.appVersion;

	var  strPos = appVer.indexOf("MSIE");
	
	//IE-7.0 ¹öÁ¯¿¡¼­¸¸ À¯È¿	
	if(strPos != -1 && usrAgent.indexOf("Win") != -1){
		isIE = true;
		isVersion =  parseFloat(appVer.substring(strPos+4));
	}
	
	//FireFox2 µµ °¡´É
	isFire = (usrAgent.toLowerCase().indexOf("firefox")!=-1 ? true : false);
	if (isFire) {
		isVersion =  parseFloat(appVer.substring(0,1));
	}
	
	if ((isFire && isVersion >= 5) || (isIE && isVersion >= 7)) {
		if (confirm('Æ¼ÄÏ¸µÅ© °Ë»öÃ¢À» Ãß°¡ ÇÏ½Ã°Ú½À´Ï±î ?')) {
 			window.external.AddSearchProvider("http://common.ticketlink.co.kr/ticketlink_search.xml");	
 		}
	} else if (isFire) {
		alert('ÆÄÀÌ¾îÆø½º 2 ÀÌ»ó ¹öÀü¿¡¼­¸¸ °¡´ÉÇÕ´Ï´Ù');
	} else {
		alert('ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 7.0 ÀÌ»ó ¹öÀü¿¡¼­¸¸ °¡´ÉÇÕ´Ï´Ù');
	}
 }

