
//1) »ç°¡ µè±â ÆË¾÷
	function play_saga(){
		url = "http://www.tourbaksa.com/popup/player.htm" ;
		window.open(url,'','toolbar=no,menubar=no,location=no,directions=no, scrollbars=no,status=yes,width=355,height=154');
	}

// 2) ¹®ÀÚ ¸Þ¼¼Áö ¿¡µû¸¥ º¸³»´Â ºÎºÐ
	function checkBytes(){
		var msgVal = document.smsdata.msg.value;
		var bytesLen = 0;
		var curMsgLen = '';
		var curBytesLen = 0;
		var realVal = '';
		var realLen = 0;

		for(var i = 0; i < msgVal.length; i++)
		{
		var oneChar = msgVal.charAt(i);

		if ( escape(oneChar).length > 4 )
			bytesLen += 2;
		else if ( oneChar != '\r' || oneChar != '\n' )
			bytesLen++;

		if ( bytesLen <= bytesLimit ) {
			curMsgLen = i + 1;
			curBytesLen = bytesLen;
		}
		}

		if ( bytesLen > bytesLimit )
		{
		alert(bytesLimit + "bytes ÀÌ»óÀÇ ¸Þ¼¼Áö´Â Àü¼ÛÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		document.smsdata.msg.value = '';
		//		form.msg.value = msgVal.substr(0, curMsgLen);		// ÃÊ°ú ÀÔ·Â½Ã ÃÊ°úµÈ ¸¸Å­ Àß¶óÁÜ
		realLen = curBytesLen;
		}
		else
		realLen = bytesLen;

		window.bytes.innerText = realLen;
		window.maxBytes.innerText = bytesLimit;
	}

//  »óÇ° ÆäÀÌÁö ÀÌµ¿½Ã »ç¿ë ÇÏ´Â ÇÔ¼ö 
//	3)  sitecode ¾øÀÌ »ç¿ë
	function item_search(varCategory1, varRegioncode, varPkgtype, varDptcode){
		document.topfrm.category1.value = varCategory1;
		document.topfrm.regionCode.value = varRegioncode;
		document.topfrm.pkgtype.value = varPkgtype;
		document.topfrm.dptcode.value = varDptcode;
	//	document.topfrm.catecode.value = varItemSch;
		document.topfrm.action = "http://www.tourbaksa.com/item/index.asp";
		document.topfrm.submit();
		return ;
	}
//	4) sitecode ÀÖ¾î¾ß ÇÒ °æ¿ì
	function item_search2(varItemSch, varCategory1, varRegioncode, varPkgtype, varDptcode, sitecode){
		document.topfrm.category1.value = varCategory1;
		document.topfrm.regionCode.value = varRegioncode;
		document.topfrm.pkgtype.value = varPkgtype;
		document.topfrm.dptcode.value = varDptcode;
		document.topfrm.sitecode.value = sitecode;
	//	document.topfrm.catecode.value = varItemSch;
		document.topfrm.action = "http://www.tourbaksa.com/item/index.asp";
		document.topfrm.submit();
		return ;
	}


//5)ÀÔ±ÝÈ®ÀÎ
	function pop_schAcc(){
		window.open('http://www.tourbaksa.com/mypage/pop_payment.asp', 'search_acc', 'width=475, height=400, top=50, left=50, scrollbars=yes')
	}
//6)¿ë¾î ¼³¸í
	function pop_but(){
		url = "http://www.tourbaksa.com/item/pop_but_explan.asp" ;
		window.open(url,'','toolbar=no,menubar=no,location=no,directions=no, scrollbars=no,status=yes,width=420,height=325');
		}


//7) °Ë»öÃ¢ ÀÌ¹ÌÁö
	function searchImg(obj){
		obj.style.backgroundImage="";obj.onkeydown=obj.onmousedown=null;
	}


//8) ·Î±×ÀÎ ºÎºÐ
	function pop_login(){
		window.open('https://www.tourbaksa.com/mypage/login/login_s.asp?sitecode=<%=sitecode%>', 'poplogin', 'width=460, height=339, top=50, left=50, scrollbars=no');
	}

	function pop_login_s(){
		window.open('https://www.tourbaksa.com/mypage/login/login.asp?sitecode=<%=sitecode%>', 'poplogin', 'width=460, height=339, top=50, left=50, scrollbars=no');
	}

//9) À¥Áø ?????
	function webzine(window) {
		open (window,"webzine","left=0, top=0, toolbar=no, location=no, directories=no, status=no, fullscreen=no, menubar=no, scrollbars=no, resizable=no, width="+eval(screen.availWidth-38)+", height=710");
	}
	//À¥ÁøÃ¢
	function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}

//10) ¼îÇÎ¸ôÀÌº¥Æ®
	function tbfrm_move(){
		parent.tb.location.href="http://shop.tourbaksa.com/mall/m_view.php?ps_db=notice&ps_boid=4";
	}

//11) ¸ÞÀÎ ÆäÀÌÁö Ç×°ø±Ç
	function jsTabChange2(idx, chk) {
		for(var i = 1; i <7; i++){
			if(i == idx){
				document.getElementById("ticket_id1" + idx).style.display = "block";
				
			}
			else{
				document.getElementById("ticket_id1" + i).style.display = "none";
			}
		}
		if(chk == 1){
			clearInterval(flyLayer);
		}
		if(num == 6){
			num = 0;
		}		
		num = num + 1;
	}

//12) ¸ÞÀÎ ÆäÀÌÁö ´º½ºÆ¼Ä¿

var msgs = new Array();
var chkOver = true;

var step = 5; // °£°Ý Á¶Á¤(ºÎµå·¯¿ò)
var layerHeight = 18; // ·¹ÀÌ¾î ³ôÀÌ
var interval = 10; // °£°Ý Á¶Á¤(¼Óµµ)

// Begin T_N_listRow 
msgs[0]="<div id='msg_0' style='position:relative; z-index:2;cursor:hand'><table cellpadding=0 cellspacing=0 border=0><tr><td><img src=/images/main0706/search_arrow.gif border=0 align=absmiddle> <a href=#>5¿ù13ÀÏ ÈªÄ«ÀÌµµ 3¹Ú4ÀÏ <b><font color=#1f59b1>199.000¿ø ¼±Âø¼ø 10¸í</font></b></a> <img src=/images/main0706/search_hot.gif border=0 align=absmiddle></td></tr></table></div>"
msgs[1]="<div id='msg_1' style='position:relative; z-index:2;cursor:hand'><table cellpadding=0 cellspacing=0 border=0><tr><td><img src=/images/main0706/search_arrow.gif border=0 align=absmiddle> <a href=#>5¿ù13ÀÏ ÈªÄ«ÀÌµµ 3¹Ú4ÀÏ <b><font color=#1f59b1>199.000¿ø ¼±Âø¼ø 10¸í</font></b></a> <img src=/images/main0706/search_hot.gif border=0 align=absmiddle></td></tr></table></div>"
msgs[2]="<div id='msg_2' style='position:relative; z-index:2;cursor:hand'><table cellpadding=0 cellspacing=0 border=0><tr><td><img src=/images/main0706/search_arrow.gif border=0 align=absmiddle> <a href=#>5¿ù13ÀÏ ÈªÄ«ÀÌµµ 3¹Ú4ÀÏ <b><font color=#1f59b1>199.000¿ø ¼±Âø¼ø 10¸í</font></b></a> <img src=/images/main0706/search_hot.gif border=0 align=absmiddle></td></tr></table></div>"
// End T_N_listRow 

function stopLayer()
{
	chkOver = false;
}

function startLayer()
{
	chkOver=true;
	moveLayer()
}

function initMsg()
{
	for (i=0;i < msgs.length;i++)
	{
		document.all['outerLayer'].innerHTML += msgs[i];
		Obj = eval("document.all['msg_"+i+"']");
		Obj.style.top = i * layerHeight;
	}
	moveLayer();
}
function moveLayer()
{
	for (i=0;i < msgs.length;i++)
	{
		Obj = eval("document.all['msg_"+i+"']");
		Obj.style.top = Obj.style.top.substr(0,Obj.style.top.length - 2) - step;
		if (Obj.style.top.substr(0,Obj.style.top.length - 2) == -layerHeight) Obj.style.top = (msgs.length - 1) * layerHeight;
		if(Obj.style.top == '0px')
			{
				stopLayer();
				setTimeout("startLayer()", 2000) ;
			}
	}
	if (chkOver) setTimeout("moveLayer()",interval);
}


// 13) Áßº¹·¹ÀÌ¾î º¸ÀÌ°í °¨Ãß±â
function LayerDisplay(totalnum, showNum, obj){
	for (var i = 1;i <= totalnum;i++){
		if(i == showNum){
			document.getElementById(obj + i).style.display = "";
		}
		else{
			document.getElementById(obj + i).style.display = "none";
		}
	}
}

// ¿ìÆí¹øÈ£ Ã£±â
function zipSearch(frmName, zipName, addrName, prot){
	var ht = "http";
	if ((prot == undefined) || (prot == ""))
	{
		var ht = "http";
	}else{
		var ht = prot;
	}
    var url = ht + "://www.tourbaksa.com/include/pop_zipcode_new.asp?frmName=" + frmName + "&zipName=" + zipName + "&addrName=" + addrName;
    window.open(url, "", "height=215, width=440, menubar=0, scrollbars=yes, status=0, titlebar=0, toolbar=0, left=200, top=100");
}


function Imgresize(_this){
	var dft_iw = 800;		//MaxImgSize
	var MaxImgSize = 800;
	var ta_image = new Image(); 
	ta_image.src = _this.src; 

	iw = eval(ta_image.width);
	ih = eval(ta_image.height);
	
	
	if(iw > MaxImgSize){
		ih = (MaxImgSize * ih) / iw;
		iw = MaxImgSize;
		_this.width = iw;
		_this.height = ih;
	}
}