var favoriteurl="http://www.stubbytour.com" //ÁÖ¼Ò³Ö´Â ºÎºÐÀÔ´Ï´Ù. 
var favoritetitle="½ºÅõºñÅõ¾î"            //È¨ÆäÀÌÁöÀÇ ÀÌ¸§À» ³ÖÀ¸¼¼¿ä 

function scrap(objtype,objserial,title,srcserial,optmemo,optopt)
{
	memo='';
	opt=''
	if(optmemo)
		memo=escape(optmemo);
	if(optopt)
		opt=escape(optopt);
	title=escape(title);
	window.open("/myscrap.asp?srcserial="+srcserial+"&objtype="+objtype+"&objserial="+objserial+"&title="+title+"&memo="+memo+"&opt="+opt,"smallwin","menubar=0,resizable=0,width=350,height=200,scrollbars=0");
}

function mainsearch(key)
{
	document.main_search.action=document.main_search.action+"?keywordX="+encodeURIComponent(encodeURIComponent(key))
	document.main_search.keyword.value=key;
	document.main_search.submit();
}
function bfSubmit()
{
	key=document.main_search.keyword.value;
	document.main_search.action=document.main_search.action+"?keywordX="+encodeURIComponent(encodeURIComponent(key))
	document.main_search.submit();
}
function addfavorites(){ 
if (document.all) 
window.external.AddFavorite(favoriteurl,favoritetitle)} 
function XRecommend(pid)
{
	var cnt_id="RV_CNT_"+pid;

	var xmlRequest = XHTTPObject();
	var pageUrl="/ajax/Recommend_b2.asp?serial="+pid;
	xmlRequest.open("GET", pageUrl, false);
	xmlRequest.onreadystatechange=function() {
	if (xmlRequest.readyState==4) 
	{
		if(xmlRequest.status == 200) 
		{
			var strv = xmlRequest.responseText;
			if(strv!=null)
			{
				var RcvData=decodeURIComponent(strv).replace(/\+/g, ' ');
				if(RcvData.indexOf("ok")==0)
				{
					var t_id=RcvData.substring(2);
					if(document.getElementById("RV_CNT_"+t_id))
						document.getElementById("RV_CNT_"+t_id).innerHTML=eval(document.getElementById("RV_CNT_"+t_id).innerText)+1;
					alert("ÃßÃµµÇ¾ú½À´Ï´Ù.");
				}
				else
				{
					alert("ÀÌ¹Ì ÃßÃµÇÏ¼Ì½À´Ï´Ù.");
				}
			}
		}
	}};
	xmlRequest.send(null);

}

function XURLEncode(sStr)
{ return escape(sStr).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27'); }

function XHTTPObject()
{
	var JXHR;
	if (window.ActiveXObject) 
	{
		if (_XML_ActiveX)
		{
		        JXHR = new ActiveXObject(_XML_ActiveX);
		}
		else
		{
			var versions = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP", "Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0"];
			for (var i = 0; i < versions.length ; i++)
			{
				try
				{
					JXHR = new ActiveXObject(versions[i]);
					if (JXHR)
					{
						var _XML_ActiveX = versions[i];
						break;
					}
				}
				catch (e)
				{
				}
			}
		}
	}
	if (!JXHR && typeof XMLHttpRequest != 'undefined') 
	{
		try
		{
			JXHR = new XMLHttpRequest();
		}
		catch (e) 
		{
			JXHR = false;
		}
	}
	return JXHR;
}

function openTourMap(srcserial,ds,mapid)
{
	if(ds)
	{
		if(mapid)
		{
			bindex=mapid.indexOf("b");
			cid=mapid.substring(1,bindex);
			bid=mapid.substring(bindex+1);

			NewWin=window.open("/tourmap/tourmap.asp?ds="+ds+"&bid="+bid+"&cid="+cid, "map", "width=1000,height=710,toolbar=No,location=No,scrollbars=no,status=No,resizable=yes"); 
			NewWin.moveTo(0,0);
			NewWin.focus();
		}
		else
		{
			NewWin=window.open("/tourmap/tourmap.asp?ds="+ds, "map", "width=1000,height=710,toolbar=No,location=No,scrollbars=no,status=No,resizable=yes"); 
			NewWin.moveTo(0,0);
			NewWin.focus();
		}
	}
	else
	{
		NewWin=window.open("/tourmap/tourmap.asp?SrcSerial="+srcserial, "map", "width=1000,height=710,toolbar=No,location=No,scrollbars=no,status=No,resizable=yes"); 
		NewWin.moveTo(0,0);
		NewWin.focus();
	}
}



function selectDiv(id)
{
	document.getElementById("new").style.display='none';
	document.getElementById("hot").style.display='none';
	document.getElementById("all").style.display='none';
	document.getElementById(id).style.display='block';

	document.getElementById("a_new").style.fontWeight="normal";
	document.getElementById("a_hot").style.fontWeight="normal";
	document.getElementById("a_all").style.fontWeight="normal";

	document.getElementById("a_"+id).style.fontWeight="bold";


}
function onlyNum()
{
	var key=event.keyCode;
	var messageArea = document.getElementById("cost");
	if(!(key==8||key==9||key==13||key==46||key==144||(key>=48&&key<=57)||key==110||key==190)){
	  alert('¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù');
	  event.returnValue = false;
	}
}


