// 플래시 함수 호출
function Flash(id,url,w,h,bg,t){
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">");
document.write("<param name='movie' value="+url+" />");
document.write("<param name='wmode' value="+t+" />");
document.write("<param name='bgcolor' value="+bg+" />");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='menu' value='false' />");
document.write("<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}

function Flash2(id,url,w,h,bg,t){
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">");
document.write("<param name='movie' value="+url+" />");
document.write("<param name='wmode' value="+t+" />");
document.write("<param name='bgcolor' value="+bg+" />");
document.write("<param name='allowFullScreen' value='true' />");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='quality' value='high' />");
document.write("<param name='menu' value='false' />");
document.write("<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");
}


// 퀵메뉴2 :: 파이어폭스에서도 작동
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}

function InitializeStaticMenu() { 
	initMoving(document.getElementById('quick_menu'), 66, 207, 250);
}

// 퀵메뉴2 끝


// div 게시판 레이어로 보이기 제어 
function clickshow(num) {
	for (i=1; i<=10; i++) {
		if(document.all["Layer"+i]){
			menu=eval("document.all.Layer"+i+".style");
			if (num==i) {
				if (menu.display=="block") {
					menu.display="none";
					document.getElementById('title').style.color="#777777";
					document.getElementById('title').style.fontWeight="normal";
					}else {
					menu.display="block";
					document.getElementById('title').style.color="#21a1b8";
					document.getElementById('title').style.fontWeight="bold";
					}
				}
			}
		}
	}


// FAQ 게시판 레이어로
var old_answer = "";

function toggle(index) {
	//var now_btn = document.getElementById('btn'+index);
	var now_answer = document.getElementById('a'+index);
	var now_title = document.getElementById('title'+index);
	var now_line = document.getElementById('q'+index);
	if(old_answer != now_answer) {
		if(old_answer != "") {
			//old_btn.src = "../../../../../images/user/Common/btn_show.gif";
			old_answer.style.display = "none";
			old_title.className = "q_off";
			old_line.className = "q_solid_line";
		}
		//now_btn.src = "../../../../../images/user/Common/btn_hidden.gif";
		now_answer.style.display = "block";
		now_title.className = "q_on";
		now_line.className = "q_dot_line";
		//old_btn = now_btn;
		old_answer = now_answer;
		old_title = now_title;
		old_line = now_line;
	} else {
		//now_btn.src = "../../../../../images/user/Common/btn_show.gif";
		now_answer.style.display = "none";
		now_title.className = "q_off";
		now_line.className = "q_solid_line";
		//old_btn = "";
		old_answer = "";
		old_title = "";
		old_line = "";
	}
}

function over(now_answer,e) {
	if(now_answer.style.display != "block") {
		e.className = "over"
	}
}

function out(now_answer,e) {
	if(now_answer.style.display != "block") {
		e.className = ""
	}
}
// 게시판 레이어로 보기 끝


// 브라우저 버전 체크
function browser_chk()
{
	appname = navigator.appName;
	useragent = navigator.userAgent;
	 if(appname == "Microsoft Internet Explorer") appname = "IE";
	 IE55 = (useragent.indexOf('MSIE 5.5')>0);  //5.5 버전
	 IE6 = (useragent.indexOf('MSIE 6')>0);     //6.0 버전
	 IE7 = (useragent.indexOf('MSIE 7')>0);     //7.0 버전
}

function photoViewResize(){
	var browerVersion = navigator.appName;
	if (browerVersion == 'MSIE 6.0'){
	resizeTo(740,750);
	} else{
	resizeTo(740,800);
	}
}

//스페샬 이벤트 
window.onload=function pageConfirm(){
	var url=location.href;
	var obj = url.split('.jsp');
	var obj2 =obj[0].split('/');
	var str = obj2[obj2.length-1];
	for(i=0;i<obj.length;i++){
		if("RetrieveCommEventList"==str){
			specialEvent();
		}
	}
}
//스페샬 이벤트 
function specialEvent(){
	var val, obj;
	var url=location.href;
	obj = url.split('menu=');
	if(obj[1]!=undefined&&obj.length!=0){
		val=obj[1].substring(0,1);
	}
	else{
		val=1;
	}
	for(i=1;i<3;i++){
		if(i==val){
			document.getElementById("specialevent_tab"+val).style.display="";
			document.getElementById("tab_menu"+val).src="/images/user/Community/community_specialevent_tab"+val+"_on.gif";
		}else{
			document.getElementById("specialevent_tab"+i).style.display="none";
			document.getElementById("tab_menu"+i).src="/images/user/Community/community_specialevent_tab"+i+"_off.gif";
		}
	}
}
//스페샬 이벤트 
function goUrl(url, num){
	location.href=url+'?menu='+num;
}


//임시 이미지 바꾸기
function changeImage(id,url){
	document.getElementById(id).src = url;
}
//탭메뉴
function tab_menu(num1, num2){
	for(i=1;i<num2;i++){
		if(i==num1){
			document.getElementById("tab_menu"+num1).style.display="";
		}else if(i!=num1){
			document.getElementById("tab_menu"+i).style.display="none";
		}
	}
}

//뷰메뉴
function view_menu(num1, num2,imgId, tabname){
	var imgSrc =document.getElementById(imgId+num1).src;
	var arr = imgSrc.split("/");
	var img =arr[arr.length -1];
	var imgArr = img.split("_");
	var imgName =imgArr[imgArr.length-2];
	var len =imgName.length;
	var img2 = imgName.substring(0,len);
	for(i=1;i<num2;i++){
		if(i==num1){
			document.getElementById(imgId+num1).src="/"+arr[3]+"/"+arr[4]+"/"+arr[5]+"/"+imgArr[0]+"_"+img2+"_on.gif";
			document.getElementById(tabname+num1).style.display="";
		}else if(i!=num1){
			document.getElementById(imgId+i).src="/"+arr[3]+"/"+arr[4]+"/"+arr[5]+"/"+imgArr[0]+"_"+tabname+i+"_off.gif";
			document.getElementById(tabname+i).style.display="none";
		}
	}
}

//시설현황 상세보기
function view_facility(url){
	document.getElementById("institution_pop").style.display="";	
	var winName=window.open(url, 'institution_view', 'menubar=0,resizable=0,top=200, left=200, no,width=650,height=605');
}

function show_page(url){
	var winName=window.open(url, 'institution_view', 'menubar=0,resizable=0,top=200, left=200, no,width=650,height=605');
}
	
function win_close(){
	parent.document.getElementById("institution_pop").style.display="none";
}

//팝업 
function popUp(url, t, l, w, h){
	window.open(url,'', 'menubar=0,resizable=0,top='+t+', left='+l+', no,width='+w+',height='+h);
}


//이메일무단수집거부 팝업
function EmailPopup(url){
	window.open(url,"","width=541,height=193,left=400,top=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

//골프,레포트 탭메뉴
function tabmenu(count,index,tabname){
	for (i=1; i<count+1; i++){
		if(i==index){
			document.getElementById("tab"+i).className = "on";
			document.getElementById("tabname"+i).src = tabname+i+"_on.gif";
			document.getElementById("Layer"+i).style.display = "block";
		}else{
			document.getElementById("tab"+i).className = "off";
			document.getElementById("tabname"+i).src = tabname+i+"_off.gif";
			document.getElementById("Layer"+i).style.display = "none";
		}
	}
}
//700골프클럽 탭메뉴
function tabmenu11(count,index,tabname){
	for (i=1; i<count+1; i++){
		if(i==index){
			document.getElementById("tab1"+i).className = "on";
			document.getElementById("tabname11"+i).src = tabname+i+"_on1.gif";
			document.getElementById("Layer1"+i).style.display = "block";
		}else{
			document.getElementById("tab1"+i).className = "off";
			document.getElementById("tabname11"+i).src = tabname+i+"_off1.gif";
			document.getElementById("Layer1"+i).style.display = "none";
		}
	}
}


//골프,레포트 탭메뉴
function tabmenu2(count,index,tabname){
	for (i=0; i<count+1; i++){
		if(i==index){
			document.getElementById("intabname"+i).src = tabname+i+"_on.gif";
			document.getElementById("use04Layer"+i).style.display = "block";
		}else{
			document.getElementById("intabname"+i).src = tabname+i+"_off.gif";
			document.getElementById("use04Layer"+i).style.display = "none";
		}
	}
}

function facility_info(url){
	parent.location.href = url;
}


//사이트맵
function showSitemap(url){
	document.getElementById("sitemap").style.display = "block";
	document.getElementById("sitemap_iframe").src=url;
	var h = document.documentElement.scrollTop;
	var appname=navigator.appName;
	var useragent=navigator.userAgent;
	if(appname=="Microsoft Internet Explorer") appname="IE";
	IE8=(useragent.indexOf('MSIE 8')>0);
	IE7=(useragent.indexOf('MSIE 7')>0);
	IE6=(useragent.indexOf('MSIE 6')>0);
	if(IE8 || IE7){
	document.getElementById("sitemap").style.position= "fixed";
	document.getElementById("sitemap").style.posTop= 150;
	}else if(IE6){ // IE 6버전에서는 fixed가 적용이 안되므로 스크롤높이에 따라 높이값 변경
	document.getElementById("sitemap").style.position= "absolute";
	document.getElementById("sitemap").style.posTop= h+50;
	}
}
function hiddenSitemap(){
	parent.document.getElementById("sitemap").style.display = "none";
}

/*function hiddenSitemap(){
	var divState = document.getElementById("sitemap");
	if(divState.style.display == "none"){
		divState.style.display = "block";
	}else if(divState.style.display == "block"){
		divState.style.display = "none";
	}
}*/

//트룬골프코스
function courseSubView(mNum,sNum){
//	for(i=1; i<4; i++){
//		for(j=1; j<10; j++){
			if((mNum==i) && (sNum==j)){
			document.getElementById("Layer"+i+"_"+j).style.display="block";
			}else{
			document.getElementById("Layer"+i+"_"+j).style.display="none";
			}
//		}
//	}
}

/* 인터컨티넨탈 객실 평면도 큰이미지보기 */
function showInterRommImg(index){
	document.getElementById("interroomimg_view").style.display="block";
	document.getElementById("interroomimg_img").src="/images/user/HotelCondo/interroom_roomimg"+index+".gif"
}
function hiddenInterRommImg(){
	document.getElementById("interroomimg_view").style.display="none";
}

/* 인터컨티넨탈 레스토랑바  평면도 큰이미지보기 */
function showInterRestaurantImg(index){
	document.getElementById("interrestaurantimg_view").style.display="block";
	document.getElementById("interrestaurantimg_img").src="/images/user/HotelCondo/interrestaurantimg_img"+index+".gif"
}
function hiddenInterRestaurantImg(){
	document.getElementById("interrestaurantimg_view").style.display="none";
}

/* 인터컨티넨탈 레스토랑바  평면도 큰이미지보기 */
function showInterRestaurantImg_img(index){
	document.getElementById("interrestaurantimg_view1").style.display="block";	
}
function hiddenInterRestaurantImg_img(){
	document.getElementById("interrestaurantimg_view1").style.display="none";
}
	
/* 홀리데이인 스위트 객실 평면도 큰이미지보기 */
function showHisRommImg(index){
	document.getElementById("hisroomimg_view").style.display="block";
	document.getElementById("hisroomimg_img").src="/images/user/HotelCondo/hisroom_roomimg"+index+".gif"
}
function hiddenHisRommImg(){
	document.getElementById("hisroomimg_view").style.display="none";
}

/* 인터컨티넨탈 편의시설 위치보기 */
function showLocation(index){
	document.getElementById("location_view").style.display="block";
	document.getElementById("location_img").src="/images/user/HotelCondo/location_pop"+index+".gif"
	var h = document.documentElement.scrollTop;
	var appname=navigator.appName;
	var useragent=navigator.userAgent;
	if(appname=="Microsoft Internet Explorer") appname="IE";
	IE8=(useragent.indexOf('MSIE 8')>0);
	IE7=(useragent.indexOf('MSIE 7')>0);
	IE6=(useragent.indexOf('MSIE 6')>0);
	if(IE8 || IE7){
	document.getElementById("location_view").style.position= "fixed";
	//document.getElementById("location_view").style.posTop= 310;
	}else if(IE6){ // IE 6버전에서는 fixed가 적용이 안되므로 스크롤높이에 따라 높이값 변경
	document.getElementById("location_view").style.position= "absolute";
	//document.getElementById("location_view").style.posTop= h+100;
	}
}

function hiddenLayer(){
	document.getElementById("location_view").style.display="none";
}

//스키강습
function goTab(tabname,tabname2){//이미지 url을  변수로 받음(기존 방식 유지)
	var val, obj; 
	var url=location.href; // 현재페이지의 url을 변수에 저장
	obj = url.split('menu='); // url 중 'menu=' 을 기준으로 나누어 배열을 만듦 그러면 두개의 값이 나옴.
	if(obj[1]!=undefined&&obj.length!=0){  //그중에서 두번째 값에 값이 있을 경우
		val=obj[1].substring(0,1); // 두번째값, 즉 숫자를 뽑아냄.
	}
	else{
		val=1; //없을 경우 초기값으로 1을 넣어줌.
	}
	if(val==6){ // 스키강습페이지(외부링크)에서 menu값을 5로 정했기 때문에 5일 경우에는 이용요금과 강습탭을 초기에 보여주도록 함. 2009-12-18 : 사용안함
		for (i=1; i<5; i++){
			if(i==4){
				document.getElementById("tab4").className = "on";
				document.getElementById("tabname4").src = tabname+i+"_on.gif";
				document.getElementById("Layer4").style.display = "block";
			}else{
				document.getElementById("tab"+i).className = "off";
				document.getElementById("tabname"+i).src = tabname+i+"_off.gif";
				document.getElementById("Layer"+i).style.display = "none";
			}
		}
		for (j=1; j<7; j++){
			if(j==5){
				document.getElementById("intabname5").src = tabname2+j+"_on.gif";
				document.getElementById("use04Layer5").style.display = "block";
			}else{
				document.getElementById("intabname"+j).src = tabname2+j+"_off.gif";
				document.getElementById("use04Layer"+j).style.display = "none";
			}
		}
	}
	else{ // 그 외에 menu값이 1~5일 경우 기존 탭소스와 똑같이 다른 탭을 보여줌.
		for (i=1; i<6; i++){
			if(i==val){
				document.getElementById("tab"+val).className = "on";
				document.getElementById("tabname"+val).src = tabname+i+"_on.gif";
				document.getElementById("Layer"+val).style.display = "block";
			}else{
				document.getElementById("tab"+i).className = "off";
				document.getElementById("tabname"+i).src = tabname+i+"_off.gif";
				document.getElementById("Layer"+i).style.display = "none";
			}
		}
	}
}

/* 호텔콘도 배경이미지 캐싱 */
function preLoadBgImage(){
	var bgImage=new Image();
	bgImage.src="/images/user/HotelCondo/bg_InterconIntro.jpg";
	bgImage.src="/images/user/HotelCondo/bg_hir.jpg";
	bgImage.src="/images/user/HotelCondo/bg_HisInfo.jpg";
}

//메인 예약 플렉스레이어
function showReservFlex(index){
	var divStatus = document.getElementById("reservFlex");
	if(index==1){
		if (divStatus.style.display == "block"){
			divStatus.style.display = "none";
		}else{
			divStatus.style.display = "block";
		}
	}else{
	location.replace('/MemberLoginForm.gdc');
	}
}

function hiddenReservFlex(){
	parent.document.getElementById("reservFlex").style.display = "none";
}

//푸터 베리사인 팝업
function veriSignPop(url){
	window.open(url,"","width=517,height=420,left=400,top=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}	
	
function workingPop(){
	document.getElementById("workingPop_outbox").style.display="block";
}

function workingPopHidden(){
	parent.document.getElementById("workingPop_outbox").style.display="none";
}

//셔틀버스 팝업
function shuttleBusPop(url){
	window.open(url,"","width=722,height=700,left=400,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}
//요금안내 팝업
function feeInfoPop(url){
	window.open(url,"","width=722,height=700,left=400,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}



/*function quick_pop(idv){
	if(idv=="bus_open"){;document.getElementById("bus_info").style.display="block";}
	else if(idv=="bus_close"){parent.document.getElementById("bus_info").style.display="none";}
	else if(idv=="fee_open"){document.getElementById("fee_info").style.display="block";}
	else if(idv=="fee_close"){document.getElementById("fee_info").style.display="none";}
	else{}
}*/

//외부사이트 링크
function goSite(url){
var pro= "https";
var pro1=pro.substring(0,4);
var fullUrl = pro1+"://"+url;
window.open(fullUrl,"m1","width=800, height=600,left=0,top=0,menubar=1, status=1, directories=1, resizable=1, location=1, toolbar=1, scrollbars=1");
//alert(fullUrl);
}

/* 객실VR 레이어 띄우기 */

function _ID(obj){return parent.document.getElementById(obj)}
function _IDD(obj){return parent.document.getElementById(obj)}

function popupLayer_room(s,w,h)
{
	if (!w) w = 600;
	if (!h) h = 400;

	var pixelBorder = 0;
	var titleHeight = 0;
	w += pixelBorder * 0;
	h += pixelBorder * 0 + titleHeight;

	var bodyW = document.documentElement.clientWidth;
	var bodyH = document.documentElement.clientHeight;

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		height = document.documentElement.scrollHeight;
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=70)";
		opacity = "0.5";
	}
	obj.id = "objPopupLayerBg";
	document.body.appendChild(obj);
	obj.title = "클릭하면 레이어가 닫힙니다.";
	obj.onclick = closeLayer1;

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 0;
		//alert(left);
		top = 0;
		zIndex = 10000;
		width = w;
		height = h;
		backgroundColor = "#FFFFFF";
		border = "0px solid #000000";
	}
	obj.id = "objPopupLayer";
	document.body.appendChild(obj);

	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w;
		height = h;
	}
	ifrm.frameBorder = 0;
	ifrm.scrolling = 'no';
	ifrm.src = s;
	obj.appendChild(ifrm);
}

function closeLayer(){
	_ID('objPopupLayer').parentNode.removeChild( _ID('objPopupLayer') );
	_IDD('objPopupLayerBg').parentNode.removeChild( _IDD('objPopupLayerBg') );
}

function closeLayer1(){
	var aa = parent.document.getElementById('objPopupLayer');
	parent.objPopupLayerBg.parentNode.removeChild(parent.objPopupLayerBg);
	aa.parentNode.removeChild(aa);
}

/* 객실VR 레이어 띄우기 */



