/* 플래시 start */

function Flash(id,url,w,h,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='sameDomain' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

/* 푸터 고정 플래시 */
function Flash_footer(id,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='1000' height='160' id="+id+">\
<param name='movie' value='/english/swf/footer.swf' />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='sameDomain' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src='/english/swf/footer.swf' wmode="+t+" width='1000' height='160' name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

/* 퀵메뉴 고정 플래시 : 080605 장웅:퀵메뉴수정을 위한 함수추가*/
function Flash_quick(id,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='75' height='340' id="+id+">\
<param name='movie' value='' />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='sameDomain' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src='' wmode="+t+" width='75' height='340' name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

/* 플래시 end */



/* 퀵메뉴 start */

var stmnLEFT = 0; // 스크롤메뉴의 좌측 위치 690
var stmnGAP1 = 30; // 페이지 헤더부분의 여백 (이보다 위로는 올라가지 않음) 
var stmnGAP2 = 130; // 스크롤시 브라우저 상단과 약간 띄움. 필요없으면 0으로 세팅 
var stmnBASE = 230; // 스크롤메뉴 초기 시작위치 (아무렇게나 해도 상관은 없지만 stmnGAP1과 약간 차이를 주는게 보기 좋음) 
var stmnActivateSpeed = 200; // 움직임을 감지하는 속도 (숫자가 클수록 늦게 알아차림) 
var stmnScrollSpeed = 10; // 스크롤되는 속도 (클수록 늦게 움직임) 
var mainScroll = document.getElementsByTagName('html')[0];
//var mainScroll = document.body.scrollTop;


function RefreshStaticMenu() { 
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer; 
	stmnStartPoint = parseInt(document.getElementById('quick_menu').style.top, 10); 
	stmnEndPoint = mainScroll.scrollTop + stmnGAP2 - 180; 
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 
	
	if ( stmnStartPoint != stmnEndPoint ) { 
	stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 20); 
	document.getElementById('quick_menu').style.top = parseInt(document.getElementById('quick_menu').style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ); 
	stmnRefreshTimer = stmnScrollSpeed; 

	} 
	
	else { 
		stmnRefreshTimer = stmnActivateSpeed; 
	}
	setTimeout ("RefreshStaticMenu();", stmnRefreshTimer); 

	}

function InitializeStaticMenu() { 
	document.getElementById('quick_menu').style.top = mainScroll.scrollTop + stmnBASE; 
	RefreshStaticMenu(); 
	document.getElementById('quick_menu').style.left = stmnLEFT; 
} 




/* 퀵메뉴 end */


/*div 보이기 제어 */

function clickshow(num) {
    for (i=1; i<=10; i++) {
        menu=eval("document.all.Layer"+i+".style");
        if (num==i) {
            if (menu.display=="block") {
                menu.display="none";
            }
            else {
                menu.display="block";
            }
        }
    }
}

/* 센터 레이어 띄우기 */

function _ID(obj){return parent.document.getElementById(obj)}
function _IDD(obj){return parent.document.getElementById(obj)}



function popupLayer(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);

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = document.body.clientWidth / 5;
		//alert(left);
		top = document.body.clientHeight / 9;
		zIndex = 50;
		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.src = s;
	obj.appendChild(ifrm);
}
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);

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = 40;
		//alert(left);
		top = 245;;
		zIndex = 50;
		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.src = s;
	obj.appendChild(ifrm);
}
	function closeLayer(){

		_ID('objPopupLayer').parentNode.removeChild( _ID('objPopupLayer') );
		_IDD('objPopupLayerBg').parentNode.removeChild( _IDD('objPopupLayerBg') );
	}

/* 센터 레이어 띄우기 */

/* 사이버투어 팝업 */
function OpenWindow(url,intWidth,intHeight) {
      window.open(url, "cybertour", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0") ;
} 