try { document.execCommand("BackgroundImageCache", false, true);} catch(err) {}

//탑메뉴
function top2menuView(a) //2차메뉴보기
{
	if(this.id){
		eidStr = this.id;
		eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length);
		a = parseInt(eidNum);
	}
	top2menuHideAll();
	top1Menu = document.getElementById("top1m"+a);
	top2Menu = document.getElementById("top2m"+a);
	if(a<10){ann='0'+a;} else {ann=''+a;}
	if (a==0) { //메인은2차메뉴활성화안함
	} else {
		if (top1Menu) {
			top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_off.gif","_on.gif");
			if (top2Menu) { 
				top2Menu.style.display = 'inline';
				}
		}
	}
}
function top2menuHide(a) //2차메뉴감추기
{
	if(this.id){
		eidStr = this.id;
		eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length);
		a = parseInt(eidNum);
	}
	//top2menuHideAll();
	top1Menu = document.getElementById("top1m"+a);
	top2Menu = document.getElementById("top2m"+a);
	top1MenuCurr = document.getElementById("top1m"+d1n);
	top2MenuCurr = document.getElementById("top2m"+d1n);
	if(a<10){ann='0'+a;} else {ann=''+a;}
	if (top1Menu) {
		top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_on.gif","_off.gif");
		if (top2Menu) { top2Menu.style.display = 'none'; }
		
		if (top1MenuCurr) {
			top1MenuCurr.getElementsByTagName("img")[0].src = top1MenuCurr.getElementsByTagName("img")[0].src.replace("_off.gif","_on.gif");
		}
		
		if (top2MenuCurr) { 
			top2MenuCurr.style.display = 'inline';
		}
	}
}

function top2menuHideAll() //2차메뉴모두감추기
{
	top1menuEl = document.getElementById("top1menu").childNodes;
	for (i=1;i<=top1menuEl.length;i++)
	{
		top1Menu = document.getElementById("top1m"+i);
		top2Menu = document.getElementById("top2m"+i);
		if(i<10){inn='0'+i;} else {inn=''+i;}
		if (top1Menu) {
			top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_on.gif","_off.gif");
			if (top2Menu) { top2Menu.style.display = 'none'; }
		}
	}
}

function initTopMenu(d1,d2) {
	d1n = d1;
	d2n = d2;
	d1nn = (d1n<10) ? '0'+d1n : d1n;
	d2nn = (d2n<10) ? '0'+d2n : d2n;
 	var topmenu = document.getElementById("topmenu");
	//if(topmenu) topmenu.style.background = "url(../images/top_menu_"+d1nn+"_menubg.gif) no-repeat";
 	top1menuEl = document.getElementById("top1menu").childNodes;
	
	for (i=1;i<=top1menuEl.length;i++)
	{
		top1Menu = document.getElementById("top1m"+i);
		top2Menu = document.getElementById("top2m"+i);
		if (top1Menu) {
			top1Menu.onmouseover = top1Menu.onfocus = top2menuView;
			//top1Menu.onmouseout = top2menuHide;
			if (top2Menu) { 
				//top2Menu.onmouseover = top2Menu.onfocus = top2menuView;
				//top2Menu.onmouseout = top2menuHide;
			}
		}
	}
	top2MenuCurrAct = document.getElementById("top2m"+d1n+"m"+d2n);
	if (top2MenuCurrAct) {
		//top2MenuCurrAct.getElementsByTagName('a')[0].className = "active";
		top2MenuCurrAct.getElementsByTagName("a")[0].style.color="#247509";
	  top2MenuCurrAct.getElementsByTagName("a")[0].style.fontWeight="bold";
	}
	top2menuHide(d1);
}


function displayOver() {
	this.style.display = 'block';
}

function displayOut() {
	this.style.display = 'none';
}


// 새창띄위기
<!--
var win1Open = null

function displayImage(picName, windowName, windowWidth, windowHeight){
return window.open(picName,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15)) 
}

function winClose(){
if(win1Open != null) win1Open.close() 
}

function doNothing(){}
//-->

<!-- 
function displayImage(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>" 
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=창닫기></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
} 
if(winHandle != null) winHandle.focus()
return winHandle
}
//-->



// 이미지 롤오버
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


/* 이미지 오버 아웃 */
function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace("_off.gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", "_off.gif");
}

// 이미지 롤오버
function imgMenuOver(containderID) {
	var objwrap = document.getElementById(containderID);
	var imgMenu = objwrap.getElementsByTagName("a");

	for (i=0; i<imgMenu.length; i++) {
		if(imgMenu[i].getElementsByTagName("img").length == 0) continue;

		if (imgMenu[i].getElementsByTagName("img")[0].src.indexOf("_on.gif") != -1 ) {
			continue;
		}
		imgMenu[i].onmouseover = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_on.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onfocus = function() {
			subImage = this.getElementsByTagName("img")[0];
			if (subImage.src.indexOf("_on.gif") != -1) return false;
			subImage.src = subImage.src.replace("_off.gif","_on.gif");
		}
		imgMenu[i].onmouseout = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
		imgMenu[i].onblur = function() {
			subImage = this.getElementsByTagName("img")[0];
			subImage.src = subImage.src.replace("_on.gif", "_off.gif");
		}
	}
}


//------------------- SWF 제어함수 시작

function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a,wm) {
		width = w; //넓이
		height = h; //높이
		src = s; //파일경로
		arg = a; // 매개변수
		if(!wm){
		wmode = 'transparent'; //모드설정
		}

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='high'>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='FlashVars' value='"+a+"'>\n";
	}
	
	

	//플래시 오브젝트 옵션설정
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	// 플래시 wmode 설정 setFlash.wmode('window')
	this.wmode = function ( value ) {
		wmode = value;
	}

	// 플래시 아이디 설정
	this.id = function ( value ) {
		id = value;
	}
	
	// 플래시 대체텍스트 설정
	
	this.alt = function ( value ) {
		altText = value;
	}

	// 플래시 삽입 레이어 설정
	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);
		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

function hideSWFLayer( div) {
	var div = document.getElementById( div);
	div.style.display = "";
	div.innerHTML = "";
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	}
	else {
		return document[movieName];
	}
 }

 function callExternalInterface(movieId) {
    thisMovie(movieId).moveMc();	
}
//------------------- SWF 제어함수 끝


// 탭메뉴 공통적으로 사용
//ex) tabOn(1,1);
function tabOn(tabid,a) {
	for (i=1;i<=10;i++) {
		if(i<10){inn="0"+i;} else {inn=""+i;}
		tabMenu = document.getElementById("tab"+tabid+"m"+i);
		tabContent = document.getElementById("tab"+tabid+"c"+i);
		tabMore = document.getElementById("tab"+tabid+"more"+i);
		if (tabMenu) { //객체가존재하면
			if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace("on.gif", ".gif"); } //이미지일때
			if (tabMenu.tagName=="A") { tabMenu.className=""; } //앵커일때
		}
		if (tabContent) { tabContent.style.display="none"; }
		if (tabMore) { tabMore.style.display="none"; }

	}
	if(a<10){ann="0"+a;} else {ann=""+a;}
	tabMenu = document.getElementById("tab"+tabid+"m"+a);
	tabContent = document.getElementById("tab"+tabid+"c"+a);
	tabMore = document.getElementById("tab"+tabid+"more"+a);
//	alert(tabMenu.tagName);
	if (tabMenu) { //객체가존재하면
		if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace(".gif", "on.gif"); } //이미지일때
		if (tabMenu.tagName=="A") { tabMenu.className="on"; } //앵커일때
	}
	if (tabContent) { tabContent.style.display="block"; }
	if (tabMore) { tabMore.style.display="block"; }
}

// 메인 팝업존
<!--

	var popScrollerHeight = 127;		// 스크롤러의 세로
	var popTotalArea = 0;
	var pWait = true;
	var pMouseOver = false;
	var popScrollSpeed = 1;			// popchanging 속도
	var popWaitTime = 4000;			// 멈추는 시간 팝업존
	var popTemp = 0;
	var popMovingAmount = popScrollerHeight * 1;	//height 곱에 따라 스크롤링 되는 레이어 크기 지정
	var arrScrollContent2 = new Array();
	var poploop = 1;
	var popObjCnt;



	function startscroll2(totCnt) {			// 스크롤 시작
		popObjCnt = totCnt;
		popchanging();

		if (!pMouseOver && pWait) {
			window.setInterval('popchanging()', popWaitTime);
		}
	}

	function popchanging() {// 실제로 스크롤 하는 부분

		if (!pMouseOver && pWait) {
			var imgNum = "";

			if(poploop < 10) imgNum = '0';
			imgNum = imgNum + poploop;

			var objName = "popbt" + imgNum;
			var viewObjName = "mainpop" + imgNum;
			var obj = document.getElementById(objName);
			var viewObj = document.getElementById(viewObjName);

			viewObj.style.visibility = 'visible';
			obj.src = "images/main/number_on_" + imgNum + ".gif";

			for(var i = 1; i <= popObjCnt; i++) {

				if(i == poploop) continue;
				imgNum = "";

				if(i < 10) imgNum = "0";

				imgNum = imgNum + i;

				var tmpobjName = "popbt" + imgNum;
				var tmpviewObjName = "mainpop" + imgNum;

				var tmpobj = document.getElementById(tmpobjName);
				var tmpviewObj = document.getElementById(tmpviewObjName);


				tmpviewObj.style.visibility = "hidden";

				tmpobj.src = "images/main/number_off_" + imgNum + ".gif";


			}

			poploop++;

			if(poploop > popObjCnt) poploop = 1;
		}
	}
//-->

<!--

	function goPage(url) {
		parent.top.location.href = url;
	}

	function popoverImage(imgNum) {

		var objName = "popbt" + imgNum;
		var viewObjName = "mainpop" + imgNum;
		var scrollNum = parseInt(imgNum) - 1;
		var obj = document.getElementById(objName);
		var viewObj = document.getElementById(viewObjName);

		obj.src = "images/main/number_on_" + imgNum + ".gif";

		if(imgNum == "08") {
			poploop = 8;

		} else if(imgNum == "09") {
			poploop = 9;

		} else {
			poploop = parseInt(imgNum);
		}

		viewObj.style.visibility = "visible";

		for(var i = 1; i <= popObjCnt; i++) {
			if(i == poploop) continue;
			imgNum = "";

			if(i < 10) imgNum = "0";

			imgNum = imgNum + i;

			var tmpobjName = "popbt" + imgNum;
			var tmpviewObjName = "mainpop" + imgNum;
			var tmpobj = document.getElementById(tmpobjName);

			var tmpviewObj = document.getElementById(tmpviewObjName);
			tmpviewObj.style.visibility = "hidden";

			tmpobj.src = "images/main/number_off_" + imgNum + ".gif";
		}

		pMouseOver = true;
	}


	function popoutImage(imgNum) {

		if(pWait) {
			var objName = "popbt" + imgNum;
			var viewObjName = "mainpop" + imgNum;
			var obj = document.getElementById(objName);
			var viewObj = document.getElementById(viewObjName);
			var movingObj = document.getElementById("mainpop00");

			obj.src = "images/main/number_off_" + imgNum + ".gif";
			viewObj.style.visibility = "hidden";
			movingObj.style.visibility = "visible";

//			poploop = 1;

			pMouseOver = false;
			popchanging();
		}
	}

	function startpopchanging() {		// 스크롤 재시작
		pWait = true;
		popoutImage("01");
	}

	function stopscroll() {		// 스크롤 정지
		pWait = false;
	}
  
//-->

/* 관련사이트 새창 */
function getSiteGo (num) {
	var obj = document.getElementById ("site_link"+num);
	
	if (obj.value != '') {window.open (obj.value);}
}

function DisplayView( obj1, obj2 ) {

	var objElement = document.getElementById(obj1);

	objElement.onclick = function() {

		document.getElementById(obj2).style.display = "block";

	}

}

function displayOff() {
	var i,j,a=displayOff.arguments;
	for(i=0;i<a.length;i++) {
		obj = document.getElementById(a[i]);
		if (obj) { obj.style.display = "none"; }
	}
}