//È£ÅÚ°Ë»ö
function fn_HSearchLink(layerName,layerNum,layerVal){
	location.href = "/Lodg/HSearch/HSearch.asp?ln="+layerName+"&lu="+layerNum+"&lv="+layerVal;
}

//ÁöÇÏÃ¶°Ë»ö
function fn_SSearchLink(val){
	location.href = "/Lodg/HSearch/HSearch_Subway.asp?ln="+val;
}

//¿øÆäÀÌÁö ¸µÅ©
function fn_onePageLink(val){
	top.location.href = "/Lodg/OnePage.asp?acode="+val;
}

//¿øÆäÀÌÁö »õÃ¢¶ß±â
function fn_onePageTopLink(val) {
	window.open ("/Lodg/OnePage.asp?acode="+val);
}

//¿øÆäÀÌÁö ¹Ì¸®º¸±â
function fn_onePagePreView(val) {
	var WndName = "LodgPreView";
	var Width = 610;
	var Height = 600;
	var scr = "no";
	var rs = "no";
	var Top = (screen.height - Height) / 2 - 200;
	var Left = (screen.width - Width) / 2;
	var url = "/Lodg/HOnePage/HOnePage_QView.asp?acode="+val;
	var str_param  = "width="+Width+",height="+Height+",top="+Top+",left="+Left+",scrollbars="+scr+",resizable="+rs+",status=yes,directories=no,location=no,menubar=no,toolbar=no";
	var Pop = window.open(url, WndName, str_param);
}

//È£ÅÚÃßÃµÇÏ±â(¼öÁ¤ÇÏ±â)
function fn_Vote(ACode,AName,UserID) {	
	if (UserID == ''){
		confirm_OnePagelogin();	return false;
	}
	if (!confirm(AName + ' È£ÅÚÀ» ÃßÃµÇÏ½Ã°Ú½À´Ï±î?')) { return; }
	var s_url = '/Lodg/Common/Lodg_Vote.asp?ACode=' + ACode;
	voteframe.location.href = s_url;	
}
//ÇÁ·ÎÆ÷ÁîEventÈ£ÅÚÃßÃµÇÏ±â(¼öÁ¤ÇÏ±â)
function fn_Vote2(ACode,AName,UserID) {	
	if (UserID == ''){
		confirm_OnePagelogin();	return false;
	}
	if (!confirm(AName + ' È£ÅÚÀ» ÃßÃµÇÏ½Ã°Ú½À´Ï±î?')) { return; }
	var s_url = '/Event/2010/09_Propose/Event_Proc.asp?ACode=' + ACode;
	voteframe.location.href = s_url;	
}

//ºí·Î±× ÆÛ°¡±â
function fn_BlogPOP(vAcode) {
	var h = 760;
	var w = 660;
	var scr = 'yes';
	var rs = 'no';
	var ntop = (screen.height- h) / 2;
	var nleft = (screen.width - w) / 2;
	var wndnm = 'blog_popup';
	var url = '/Lodg/Common/Blog_Write_Web.asp?acode=' + vAcode;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=yes,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(url, wndnm, strParam);
	wnd.window.focus();
}

//ÃßÃµ¸ÞÀÏ º¸³»±â
function fn_recommMailPOP(acode) {
	var h = 600;
	var w = 540;
	var scr = 'no';
	var rs = 'no';
	var ntop = (screen.height- h) / 3;
	var nleft = (screen.width - w) / 3;
	var wndnm = 'recommMail_popup';
	var url = '/Lodg/Common/Send_Recomm_Mail_Popup.asp?acode=' + acode;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(url, wndnm, strParam);
	wnd.focus();
}

//°ü½ÉÈ£ÅÚ µî·Ï
function fn_Favorite(ACode,AName,UserID) {	
	if (UserID == ''){
		confirm_OnePagelogin();	return false;
	}
	if (!confirm(AName + ' È£ÅÚÀ» °ü½ÉÈ£ÅÚ·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î?')) { return; }
	var s_url = '/Lodg/Common/Lodg_Favorite.asp?ACode=' + ACode;
	voteframe.location.href = s_url;	
}

//¸ð¹ÙÀÏ·Î ÀúÀå
function fn_MobilePOP(acode,UserID) {
	var h = 355;
	var w = 420;
	var scr = 'no';
	var rs = 'no';
	var ntop = (screen.height- h) / 3;
	var nleft = (screen.width - w) / 3;
	var wndnm = 'topresMail_popup';
	var url = '/Lodg/Common/Mobile_Write.asp?acode=' + acode
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(url, wndnm, strParam);
	wnd.focus();
}

//Áöµµ¼­ºñ½º(Ã£¾Æ°¡´Â±æ)
function fn_MapfindPOP(vACode, vX, vY, vName){
//	var strURL = "/Map/HotelMap/map_search.asp?ACode="+vACode+"&x="+vX+"&y="+vY+"&level=2&mty=2";
//	window.open(strURL);

	var WndName = "map_popup";
	var Width = 1000;
	var Height = 800;
	var url = "/Map/HotelMap/map_search.asp?ACode="+vACode+"&x="+vX+"&y="+vY+"&level=2&mty=2";
	var str_param  = "width="+Width+",height="+Height+",top=10,left=10,scrollbars=yes,resizable=yes,status=yes,directories=yes,location=yes,menubar=yes,toolbar=yes";
	var wnd = window.open(url, WndName, str_param);
	wnd.focus();
}

//ÄíÆù ÇÁ¸°Æ®
function fn_CouponPOP(vACode, vCpId, vParam_Except) {
	var h = 600;
	var w = 590;
	var scr = 'yes';
	var rs = 'no';
	var ntop = (screen.height- h) / 2;
	var nleft = (screen.width - w) / 2;
	var strWndName = 'coupon_popup';
	vParam_Except = ((typeof(vParam_Except) == 'undefined') ? '' : ((vParam_Except.length > 0) ? ('&except=' + vParam_Except) : ''));
	var strURL = '/Lodg/Common/Coupon_View.asp?acode=' + vACode + '&groupcode=' + vCpId + vParam_Except;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(strURL, strWndName, strParam);
	wnd.focus();
}


// ¿øÆäÀÌÁö °Ë»ö ·¹ÀÌ¾î ºÒ·¯¿À±â
function fn_OneMidLayer(status, searchval){
	if (status == 'block')
	{
		var acode	= '';
		var xmlhttp = getXmlHttpRequest();
		var url =  'http://' + window.location.hostname;
		url += ('/Lodg/HOnePage/HOnePage_SearchLayerList.asp');
		url += ('?'+searchval);
		
		if(url){
			xmlhttp.open("GET", url, true);
			xmlhttp.onreadystatechange = function() {
				if(xmlhttp.readyState == 4) {
					if(xmlhttp.status == 200) {
						var respTxt = xmlhttp.responseText;
						if(respTxt.substring(0, 8) == 'Success:')
						{
							var url = '/Lodg/OnePage.asp?Acode='+respTxt.substring(8, 16);
							var str_param  = "width=1000,height=800,top=10,left=10,scrollbars=yes,resizable=yes,status=yes,directories=yes,location=yes,menubar=yes,toolbar=yes";
							var wnd = window.open(url, "onepage_popup", str_param);
							wnd.focus();
//							top.location.href='/Lodg/OnePage.asp?Acode='+respTxt.substring(8, 16);
						}else{
							document.getElementById('OPMidSearchList').innerHTML = respTxt;
						}
					}
					xmlhttp = null; 
				}
			}
			xmlhttp.send(null);
		}
		
		document.getElementById('OPMidSearch').style.display='block';
		document.getElementById('OPMidSearchList').style.display='block';
		//document.getElementById('RSchButton').style.display='none';		
		return false;
	}
	else{
		document.getElementById('OPMidSearch').style.display='none';
		//document.getElementById('RSchButton').style.display='block';		
	}
}

//ÆäÀÌÂ¡
function fn_Page(val){
	var oFrm = document.OnePageSearchForm;
	oFrm.PG.value = val;
	fn_OneMidLayer('block', 'PG='+val+'&SG='+oFrm.SG.value+'&QW='+oFrm.QW.value+'&QT='+oFrm.QT.value)
}

//Áö¿ª°Ë»ö
function fn_OPSearchArea(val){
	var oFrm = document.OnePageSearchForm;
	var OpTxt	= document.getElementById("OPLayerSearchTxt");
	oFrm.SG.value = val;
	oFrm.QW.value = '';
	oFrm.QT.value = '';
	OpTxt.value	= '';
	fn_OneMidLayer('block', 'SG='+val)
}

//·¹ÀÌ¾î °Ë»ö
function CheckLayerSearch(theForm, chk){

	var oFrm = document.OnePageSearchForm;
	var OpTxt	= document.getElementById("OPLayerSearchTxt");
	if (OpTxt.value == ''){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
	}else{
		oFrm.QW.value = OpTxt.value;
		oFrm.QT.value = chk;
		fn_OneMidLayer('block', 'QW='+OpTxt.value+'&QT='+chk);
	}
	return false;
}



function fn_MultiPsBoardLayer(searchval){
		var acode	= '';
		var xmlhttp = getXmlHttpRequest();
		var url =  'http://' + window.location.hostname;
		url += ('/Lodg/HOnePage/HOnePage_MultiPsBoard.asp');
		url += ('?'+searchval);
		
		if(url){
			xmlhttp.open("GET", url, true);
			xmlhttp.onreadystatechange = function() {
				if(xmlhttp.readyState == 4) {
					if(xmlhttp.status == 200) {
						var respTxt = xmlhttp.responseText;
						document.getElementById('Layer_MultiPsBoard').innerHTML = respTxt;
					}
					xmlhttp = null; 
				}
			}
			xmlhttp.send(null);
		}
}

//ÆäÀÌÂ¡
function fn_Page_m(val){
	var oFrm = document.MultiPsBoardForm;
	oFrm.PG.value = val;
	fn_MultiPsBoardLayer('PG='+val+'&ACode='+oFrm.ACode.value)
}


//¸ÖÆ¼¹æ ÈÄ±âº¸±â
function fn_MultiView(vPsIdx) {
	var h = 650;
	var w = 800;
	var scr = 'yes';
	var rs = 'no';
	var ntop = (screen.height- h) / 2;
	var nleft = (screen.width - w) / 2;
	var strWndName = 'mpsview_popup';
	vParam_Except = ((typeof(vParam_Except) == 'undefined') ? '' : ((vParam_Except.length > 0) ? ('&except=' + vParam_Except) : ''));
	var strURL = '/Community/MultiPsBoard/PsBoard_View.asp?id=' + vPsIdx;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(strURL, strWndName, strParam);
	wnd.focus();
}
//¸ÖÆ¼¹æ ±Û¾²±â
function fn_MultiWrite(vACode) {
	var h = 650;
	var w = 800;
	var scr = 'yes';
	var rs = 'no';
	var ntop = (screen.height- h) / 2;
	var nleft = (screen.width - w) / 2;
	var strWndName = 'mpsview_popup';
	vParam_Except = ((typeof(vParam_Except) == 'undefined') ? '' : ((vParam_Except.length > 0) ? ('&except=' + vParam_Except) : ''));
	var strURL = '/Community/MultiPsBoard/PsBoard_Write.asp?vACode=' + vACode;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(strURL, strWndName, strParam);
	wnd.focus();
}

//¸ÖÆ¼¹æ ÄíÆù
function fn_MultiCouponPOP(vACode) {
	var h = 600;
	var w = 590;
	var scr = 'yes';
	var rs = 'no';
	var ntop = (screen.height- h) / 2;
	var nleft = (screen.width - w) / 2;
	var strWndName = 'coupon_popup';
	vParam_Except = ((typeof(vParam_Except) == 'undefined') ? '' : ((vParam_Except.length > 0) ? ('&except=' + vParam_Except) : ''));
	var strURL = '/Lodg/Common/Coupon_MultiView.asp?acode=' + vACode;
	var strParam  = 'height='+h+',width='+w+',top='+ntop+',left='+nleft+',scrollbars='+scr+',resizable='+rs+',status=no,directories=no,location=no,menubar=no,toolbar=no';
	var wnd = window.open(strURL, strWndName, strParam);
	wnd.focus();
}
