/*
function setURL() {
	var objURL = location.href;
	objURL = objURL.replace('http://dev.olympus.co.kr:10017/', '');
	var pathLen = objURL.indexOf("/");
	var strExt = objURL.substring(0, pathLen);
	//alert(strExt);
	objStyle = document.createElement('link');
	objStyle.setAttribute('rel', 'stylesheet');
	objStyle.setAttribute('type', 'text/css');
	objStyle.setAttribute('media', 'screen, print');
	if (strExt == 'dslr') {
		objStyle.setAttribute('href', '/common/css/dslr.css');
	} else if (strExt == 'fun' || strExt == 'Fun') {
		objStyle.setAttribute('href', '/common/css/fun.css');
	} else if (strExt == 'CustomerService') {
		objStyle.setAttribute('href', '/common/css/customer.css');
	} else if (strExt == 'Global' || strExt == 'MyOlympus') {
		objStyle.setAttribute('href', '/common/css/customer.css');
	}

	document.documentElement.getElementsByTagName('head')[0].appendChild(objStyle);
}
setURL();
*/
function setURL() {
	var objURL = location.href;
	objURL = objURL.replace('http://', '');
	var pathLen = objURL.indexOf("/", 1);
	var strExt = objURL.substring(0, pathLen);
	objURL = objURL.replace(strExt + '/', '');
	var pathLen2 = objURL.indexOf("/", 2);
	strExt = objURL.substring(0, pathLen2);
	objStyle = document.createElement('link');
	objStyle.setAttribute('rel', 'stylesheet');
	objStyle.setAttribute('type', 'text/css');
	objStyle.setAttribute('media', 'screen, print');
	if (strExt == 'dslr' || strExt == 'DSLR') {
		objStyle.setAttribute('href', '/common/css/dslr.css');
	} else if (strExt == 'fun' || strExt == 'Fun' || strExt == 'webzine') {
		objStyle.setAttribute('href', '/common/css/fun.css');
	} else if (strExt == 'CustomerService') {
		objStyle.setAttribute('href', '/common/css/customer.css');
	} else if (strExt == 'global' || strExt == 'Global') {
		objStyle.setAttribute('href', '/common/css/customer.css');
	} else if (strExt == 'member') {
		objStyle.setAttribute('href', '/common/css/member.css');
	} else if (strExt == 'MyOlympus') {
		objStyle.setAttribute('href', '/common/css/myolympus.css');
	}
	document.documentElement.getElementsByTagName('head')[0].appendChild(objStyle);
}
setURL();

//ie6 png alpha 값 작성용 (사용 방법 : class="png24")
function setPng24(obj) {
	obj.width = obj.height=1;
	obj.className = obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src+"', sizingMethod='image');"
	obj.src = '';
	return '';
}


//flash
function swfprint(furl,fwidth,fheight,transoption, Id) {
	if (Id) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+ fwidth +'" height="' + fheight +'" align="middle" id="'+Id+'">');
	} else {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+ fwidth +'" height="' + fheight +'" align="middle">');
	}
	document.write('<param name="movie" value="'+ furl +'"/>');
	document.write('<param name="allowScriptAccess" value="always"/>');
	if (transoption == "t") {
		document.write('<param name="wmode" value="transparent"/>');
	} else if (transoption == "o") {
		document.write('<param name="wmode" value="opaque"/>');
	}
	document.write('<!-- Hixie method -->');
	document.write('<!--[if !IE]> <-->');
	document.write('<object type="application/x-shockwave-flash" allowScriptAccess="always" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"');
	if (Id) {
		document.write(' id="'+Id+'"');
	}
	if (transoption == "t") {
		document.write(' wmode="transparent"');
	} else if (transoption == "o") {
		document.write(' wmode="opaque"');
	}
	document.write('></object>');
	document.write('<!--> <![endif]-->');
	document.write('</object>');
}

//Popup
function WinPop(url,name,w,h,s) {
	var position, top, left;
	top = screen.height/2 - h/2;
	left = screen.width/2 - w/2;
	position = ",top="+top+",left="+left;
	if(s!==0) {
		sOp = ",scrollbars=yes";
	} else {
		sOp = "";
	}
	winOptions = 'width='+w+',height='+h+sOp+position;
	window.open(url,name,winOptions);
}
//Popup Close
function closeWin() {
	window.close();
}

//이미지 크게 보기
function article_img() {
	var objLi = document.getElementById('article_img').getElementsByTagName('li');
	var objOn = null;
	var prev = document.getElementById('img_prev');
	var next = document.getElementById('img_next');
	var maxNum = objLi.length - 1;
	for (i=0; i<objLi.length; i++) {
		objLi[i].getElementsByTagName('a')[0].onclick = function() {
			objImg(this);
			return false;
		}
	}
	var objImg = function(obj) {
		for (i=0; i<objLi.length; i++) {
			objLi[i].className = '';
		}
		document.getElementById('big').getElementsByTagName('img')[0].src = obj.href;
		obj.parentNode.className = 'on';
	}
	prev.onclick = function() {
		for (i=0; i<objLi.length; i++) {
			if (objLi[i].className == 'on')
				objOn = i;
		}
		if (objOn > 0)
			objOn = objOn - 1;
		else if (objOn == 0)
			objOn = maxNum;
		objImg(objLi[objOn].getElementsByTagName('a')[0]);
		return false;
	}
	next.onclick = function() {
		for (i=0; i<objLi.length; i++) {
			if (objLi[i].className == 'on')
				objOn = i;
		}
		if (objOn == maxNum)
			objOn = 0;
		else
			objOn = objOn + 1;
		objImg(objLi[objOn].getElementsByTagName('a')[0]);
		return false;
	}
	objImg(objLi[0].getElementsByTagName('a')[0]);
}

//imageOver
function imageOver(objImg) {	objImg.src = objImg.src.replace("off.gif", "on.gif");}
function imageOut(objImg) {	objImg.src = objImg.src.replace("on.gif", "off.gif");}

// Embeded function image Over
function menuOver() {	this.src = this.src.replace("_off.gif", "_on.gif");}
function menuOut() {	this.src = this.src.replace("_on.gif", "_off.gif");}

// 탭메뉴
function TabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);

		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//호출할때(탭이름,탭갯수,현재탭)
function tab(tab_name,max,tab_num) {
	for( i = 1; i <= max; i++){
		if (i == tab_num) { document.getElementById(tab_name+i).style.display = 'block'; }
		else { document.getElementById(tab_name+i).style.display = 'none'; }
	}
}

// Tabbed menu
function initTabMenu(menuElId) {
	var tabMenu = document.getElementById(menuElId).getElementsByTagName("a");
	if(tabMenu.length > 0){
		for(i=0; i<tabMenu.length; i++) {
			thismenu = tabMenu.item(i);
			thismenu.menuContainer = document.getElementById(menuElId);
			thismenu.targetEl = document.getElementById(tabMenu.item(i).href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			if(thismenu.getElementsByTagName("img").length>0)	{
				thismenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
				thismenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
			}
			thismenu.onclick = tabMenuClick;
		}
		initmenu = tabMenu.item(0);
		initmenu.menuContainer = document.getElementById(menuElId);
		initmenu.targetEl = document.getElementById(initmenu.href.split("#")[1]);
		initmenu.targetEl.style.display = "block";
		initmenu.className = "activate";
		if(initmenu.getElementsByTagName("img").length>0)	{
			initmenu.getElementsByTagName("img").item(0).onmouseover();
			initmenu.getElementsByTagName("img").item(0).onmouseover = null;
			initmenu.getElementsByTagName("img").item(0).onmouseout = null;
		}
		initmenu.menuContainer.current = initmenu;
	}
}
function tabMenuClick() {
	currentmenu = this.menuContainer.current;
	if (currentmenu != this) {
		currentmenu.targetEl.style.display = "none";
		currentmenu.className = null;
		if(currentmenu.getElementsByTagName("img").length>0)	{
			currentmenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
			currentmenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
			currentmenu.getElementsByTagName("img").item(0).onmouseout();
		}
		this.targetEl.style.display = "block";
		this.className = "activate";
		if(this.getElementsByTagName("img").length>0)	{
			this.getElementsByTagName("img").item(0).onmouseover = null;
			this.getElementsByTagName("img").item(0).onmouseout = null;
		}
		this.menuContainer.current = this;
	}
	return false;
}

//lightbox
function objLightBox(obj) {
	var objLightBox;
	var mHeight;
	var sHeight = document.documentElement.scrollHeight;
	var cHeight = document.documentElement.clientHeight;
	var sTop = document.documentElement.scrollTop;

	//잘못된 마크업으로 contnet안에 들어가있는 마크업을 content밖으로 빼낸다.
	var objPositionMove = document.getElementById(obj).parentNode.removeChild(document.getElementById(obj));
	document.documentElement.getElementsByTagName('body')[0].appendChild(objPositionMove);

	if (!document.getElementById('objLightBox')) {
		objLightBox = document.createElement('div');
		objLightBox.setAttribute('id', 'objLightBox');
		document.documentElement.getElementsByTagName('body')[0].appendChild(objLightBox);

		objLightFrame = document.createElement('iframe');
		objLightFrame.setAttribute('id', 'objLightFrame');
		document.documentElement.getElementsByTagName('body')[0].appendChild(objLightFrame);

		if (navigator.appName.indexOf('Explorer') != -1 && document.all) {
			objLightBox.style.filter = 'Alpha(opacity=50)';
			objLightFrame.style.filter = 'Alpha(opacity=10)';
		} else {
			objLightBox.style.opacity = 0.5;
			objLightFrame.style.opacity = 0.1;
		}
		if (sHeight <= cHeight)
			mHeight = cHeight;
		else
			mHeight = sHeight;
		objLightBox.style.height = mHeight + 'px';
		objLightFrame.style.height = mHeight + 'px';
		objLightFrame.style.width = '100%';
		objLightFrame.style.position = 'absolute';
		objLightFrame.style.left = '0';
		objLightFrame.style.top = '0';
		objLightFrame.frameBorder = '0';

		document.getElementById(obj).style.display = 'block';
			document.getElementById(obj).style.top = ((cHeight / 2) + sTop) + 'px';
			//alert(((cHeight / 2) + sTop));
		document.getElementById('l_close').onclick = function() {
			clear_lightbox(obj);
			return false;
		}
		objLightBox.onclick = function() { clear_lightbox(obj); }
	} else {
		clear_lightbox(obj);
	}
}
function clear_lightbox(obj) {
	var objLightBox = document.getElementById('objLightBox');
	var objLightFrame = document.getElementById('objLightFrame');

	objLightBox.parentNode.removeChild(objLightBox);
	objLightFrame.parentNode.removeChild(objLightFrame);
	document.getElementById(obj).style.display = 'none';
	if (document.getElementById("ifrm")) {
		document.getElementById("ifrm").style.width = parseInt(document.getElementById("ifrm").style.width) - 20 + 'px';
	}
}
function img_meta(obj) {
	var imgMeta = document.getElementById('img_meta');

	imgMeta.onclick = function() {
		objLightBox(obj);
	}
}
function other_lightbox(obj, btnObj) {
	var btn = document.getElementById(btnObj);

	btn.onclick = function() {
		this.style.zIndex = '999';
		objLightBox(obj);
		if ((document.getElementById(obj).offsetHeight + 230) >= document.getElementById('objLightBox').offsetHeight) {
			document.getElementById('objLightBox').style.height = document.getElementById(obj).offsetHeight + 480 + 'px';
			document.getElementById('body').style.height = document.getElementById(obj).offsetHeight + 60 + 'px';
		}
		if (navigator.appName.indexOf("Explorer") != -1) {
			document.getElementById(obj).style.top = this.offsetTop + 230 + 'px';
		} else {
			document.getElementById(obj).style.top = this.offsetTop + 218 + 'px';
		}
		document.getElementById(obj).style.left = document.getElementById('body').offsetLeft + 30 + 'px';
		return false;
	}
	window.onload = function() {
		if (!document.getElementById('objLightBox')) {
			document.getElementById('l_close2').onclick = function() {
				clear_lightbox(obj);
				return false;
			}
		}
	}
}


//이미지 크게 보기 (lightbox)
var objImg = null;
function lightbox_image(obj) {
	var aTags = document.getElementsByTagName('a');
	for (i=0; i<aTags.length; i++) {
		if (aTags[i].getAttribute('rel') == 'objlightbox') {
			aTags[i].onclick = function() {
				document.getElementById('lImage').getElementsByTagName('img')[0].id = 'imgTemp';
				objLightBox(obj);

				objImg = document.getElementById('imgTemp');
				objImg.style.marginTop = 0;
				var tempImage = new Image();
				tempImage.src = this.getAttribute('href');
				tempImage.id = objImg.id;
				var temp2 = objImg.parentNode;

				temp2.removeChild(objImg);
				temp2.appendChild(tempImage);
				objImg = tempImage;
				/*
				if (objImg.offsetHeight < 391) {
					objImg.style.marginTop = (391 - objImg.offsetHeight) / 2 + 'px';
				} else {
					objImg.style.marginTop = 0;
				}
				*/
				return false;
			}
		}
	}
}

//글 내용 보기
function view_content(obj) {
	var objId = document.getElementById('g_list');
	var objLi = objId.getElementsByTagName('li');
	for (i=0; i<objLi.length; i++) {
		objLi[i].getElementsByTagName('p')[0].onclick = function() {
			objLightBox(obj);
		}
	}
}



function r_frame(objId) {

		window.open("/controls/ImgView.aspx?imgsrc=" + escape(objId.src.toString()) +"&file_seq=" + objId.getAttribute('imgseq'), "ImgPopup", "toolbar=no, statusbar=no, scrollbars=yes");
/*
		var iframes = document.getElementById('ifrm');

		iframes.src = "/controls/ImgView.aspx?imgsrc=" + escape(objId.src.toString()) +"&file_seq=" + objId.getAttribute('imgseq');
		//파이어 폭스 테스트를 위해서 수정했습니다.
		//+ objId.imgseq;

		var objId = document.getElementById("if_box");

		objLightBox("if_box");
		innerDoc = (iframes.contentDocument) ? iframes.contentDocument.documentElement : iframes.contentWindow.document.getElementsByTagName('body')[0];
		var sWidth = objId.width+120;//innerDoc.scrollWidth + 36;
		var sHeight = objId.height+120;//innerDoc.scrollHeight;



		if (sHeight >= document.documentElement.clientHeight) {
			sHeight = document.documentElement.clientHeight - 100;
			sWidth = sWidth - 100;
		}
		if (sWidth >= document.documentElement.clientWidth) {
			sWidth = document.documentElement.clientWidth - 100;
			sHeight = sHeight - 100;
		}

		iframes.height = sHeight + 'px';
		iframes.width = sWidth - 36 + 'px';
		objId.style.width = sWidth + 'px'
		objId.style.height = sHeight + 'px';

		objId.style.marginLeft = - sWidth / 2 + 'px';
		objId.style.marginTop = - sHeight / 2 + 'px';*/

}


function resizeifrm(obj)
{
	try
	{
		var viewHeight = parseInt(obj.contentWindow.document.body.scrollHeight) + 30;
		var viewWidth = parseInt(obj.contentWindow.document.body.scrollWidth) + 30;

		obj.style.height = viewHeight + "px";
		obj.style.width = viewWidth + "px";

		var objId = document.getElementById("if_box");
			objId.style.position = "absolute";

			objId.style.width = viewWidth + 36 + "px";
			objId.style.height = viewHeight + "px";
			objId.style.marginLeft = - (viewWidth + 36) / 2 + 'px';
			objId.style.marginTop = - viewHeight / 2 + 'px';

	}
	catch(e){}
}



function fn_open_image_detail(obj, src) {
	//var imgBox = document.getElementById(objId);

	imgBox.onclick = function() {
		var iframes = document.getElementById('ifrm');

		var objId = document.getElementById(obj);
		objLightBox(obj);
		innerDoc = (iframes.contentDocument) ? iframes.contentDocument.documentElement : iframes.contentWindow.document.getElementsByTagName('body')[0];
		var sWidth = innerDoc.scrollWidth + 36;
		var sHeight = innerDoc.scrollHeight;
		if (sHeight >= document.documentElement.clientHeight) {
			sHeight = document.documentElement.clientHeight - 100;
			sWidth = sWidth - 100;
		}
		if (sWidth >= document.documentElement.clientWidth) {
			sWidth = document.documentElement.clientWidth - 100;
			sHeight = sHeight - 100;
		}
		iframes.height = sHeight + 'px';
		iframes.width = sWidth - 36 + 'px';
		objId.style.width = sWidth + 'px'
		objId.style.height = sHeight + 'px';
		objId.style.marginLeft = - sWidth / 2 + 'px';
		objId.style.marginTop = - sHeight / 2 + 'px';
	}
}


//동영상 목록
function class_list() {
	var objId = document.getElementById('class_list');
	var objTr = objId.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
	for (i=0; i<objTr.length; i++) {
		if (i % 2 == 0) {
			objTr[i].onclick = function() {
				for (i=0; i<objTr.length; i++) {
					if (i % 2 == 0) {
						//objTr[i].getElementsByTagName('td')[1].style.fontWeight = 'normal';
						objTr[i+1].className = 'none';
					}
					if (this == objTr[i]) {
						objTr[i+1].className = 'view';
					}
				}
				//this.getElementsByTagName('td')[1].style.fontWeight = 'bold';
			}
		}
	}
}


//직영점
function photo_list() {
	var objLi = document.getElementById('photo_list').getElementsByTagName('li');
	var objOn = null;
	for (i=0; i<objLi.length; i++) {
		objLi[i].getElementsByTagName('a')[0].onclick = function() {
			objImg(this);
			return false;
		}
	}
	var objImg = function(obj) {
		for (i=0; i<objLi.length; i++) {
			if (i == 0)
				objLi[i].className = 'first';
			else
				objLi[i].className = '';
		}
		document.getElementById('big_image').getElementsByTagName('img')[0].src = obj.href;
		if (obj.parentNode.className == 'first')
			obj.parentNode.className = 'first on';
		else
			obj.parentNode.className = 'on';
	}

}



/*패밀리 사이트*/
function family_site() {
	var obj = document.getElementById('family_site');
	obj.onmouseover = function() {
		//this.getElementsByTagName('dd')[0].style.display = 'block';
	}
	obj.onmouseout = function() {
		//this.getElementsByTagName('dd')[0].style.display = 'none';
	}
	obj.onclick = function () {
		document.getElementById("familyflash").style.display = "";
	}
}

function closeFamilysitePopup()
{
	document.getElementById("familyflash").style.display = "none";
}


/*world wide warranty*/
function global_home() {
	var objList = document.getElementById('w_map').getElementsByTagName('dl');
	for (i=0; i<objList.length; i++) {
		objList[i].getElementsByTagName('dt')[0].onmouseover = function() {
			this.getElementsByTagName('img')[0].src = this.getElementsByTagName('img')[0].src.replace("off.gif", "on.gif");
		}
		objList[i].getElementsByTagName('dt')[0].onmouseout = function() {
			this.getElementsByTagName('img')[0].src = this.getElementsByTagName('img')[0].src.replace("on.gif", "off.gif");
		}
		objList[i].getElementsByTagName('dt')[0].onclick = function() {
			for (i = 0; i<objList.length; i++) {
				objList[i].getElementsByTagName('dd')[0].style.display = 'none';
			}
			this.parentNode.getElementsByTagName('dd')[0].style.display = 'block';
			return false;
		}
		for (j=0; j<objList[i].getElementsByTagName('span').length; j++) {
			if (objList[i].getElementsByTagName('span')[j].className == 'close') {
				objList[i].getElementsByTagName('span')[j].onclick = function() {
					this.parentNode.style.display = 'none';
					return false;
				}
			}
		}
	}
}

 function ViewImg(what) {
	var imgwin = window.open('','ViewImg','scrollbars=no,resizable=yes');
	imgwin.focus();
	imgwin.document.open();
	imgwin.document.write("<html>\n");
	imgwin.document.write("<head>\n");
	imgwin.document.write("<title>View Images</title>\n");
	imgwin.document.write("<sc"+"ript>\n");
	imgwin.document.write("function resize() {\n");
	imgwin.document.write("  pic = document.img;\n");
	imgwin.document.write("  if (eval(pic).height) {\n");
	imgwin.document.write("    var name = navigator.appName\n");
	imgwin.document.write("    if (name == 'Microsoft Internet Explorer') {\n");
	imgwin.document.write("      myWidth = eval(pic).width + 10;\n");
	imgwin.document.write("      myHeight = eval(pic).height + 30;\n");
	imgwin.document.write("    } else {\n");
	imgwin.document.write("      myWidth = eval(pic).width+ 10;\n");
	imgwin.document.write("      myHeight = eval(pic).height + 30;\n");
	imgwin.document.write("    }\n");
	imgwin.document.write("    clearTimeout();\n");
	imgwin.document.write("    var width = screen.width;\n");
	imgwin.document.write("    var height = screen.height;\n");
	imgwin.document.write("    var leftpos = width / 2 - myWidth / 2;\n");
	imgwin.document.write("    var toppos = height / 2 - myHeight / 2; \n");
	imgwin.document.write("    self.moveTo(leftpos, toppos);\n");
	imgwin.document.write("    self.resizeTo(myWidth, myHeight);\n");
	imgwin.document.write("  } else setTimeOut(resize(), 100);\n");
	imgwin.document.write("}\n");
	imgwin.document.write("</sc"+"ript>\n");
	imgwin.document.write("</head>\n");
	imgwin.document.write("<body bgcolor='#313131' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' oncontextmenu='return false' ondragstart='return false' onselectstart='return false'>\n");
	imgwin.document.write("<a href='javascript:;' onClick='window.close();opener.focus();'><img border='0' src='"+what+"' name='img' onload='resize();'></a>\n");
	imgwin.document.write("</body>\n");
	imgwin.document.write("</html>\n");
	imgwin.document.close();
 }


var funBoxTop = 0;
function callExternalInterface(type) {
	var objBox = document.getElementById('fun_main');
	thisMovie("main_fun").controlFlash(type);

	if (type == 'open') {
		clearInterval(moveDown);
		var moveUp = setInterval(function() {
			if (funBoxTop >= 120) {
				clearInterval(moveUp);
			} else {
				callExternalInterface(type);
				funBoxTop = funBoxTop + 3;
			}
		}, 1);
		objBox.style.marginTop = - funBoxTop + 'px';
		//alert(mTop);
		document.getElementById('fun_open').style.display = 'none';
		document.getElementById('fun_close').style.display = 'block';
	} else {
		clearInterval(moveUp);
		var moveDown = setInterval(function() {
			if (funBoxTop <= 0) {
				clearInterval(moveDown);
			} else {
				callExternalInterface(type);
				funBoxTop = funBoxTop - 3;
			}
		}, 1);
		objBox.style.marginTop = - funBoxTop + 'px';
		document.getElementById('fun_open').style.display = 'block';
		document.getElementById('fun_close').style.display = 'none';
	}
}
function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}


/*뮤지엄*/
/*museum list*/
function museum(obj) {
	var objId = document.getElementById('m_list');
	var objLi = objId.getElementsByTagName('li');
	for (i=0; i<objLi.length; i++) {
		objLi[i].onmouseover = function() {
			this.className = 'on';
		}
		objLi[i].onmouseout = function() {
			this.className = '';
		}
		objLi[i].onclick = function() {
			objLightBox(obj);
			document.getElementById(obj).style.top = '30px';
			document.getElementById(obj).style.left = '210px';
			var objView = document.getElementById('l_view').getElementsByTagName('iframe')[0];
			objView.src = this.getElementsByTagName('a')[0].href;
			return false;
		}
	}
}


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";
		obj.style.left = document.getElementById('body').offsetLeft + document.getElementById('body').offsetWidth + 'px';
	}, 30)
}