﻿/*탑버튼시작*/
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;
	el.cy = el.sy = sy;
	el.sP=function(x,y){
		this.style.left=x+px;
		this.style.top=y+px;
	};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.getElementById("wrap_sub").clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.getElementById("wrap_sub").scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.getElementById("wrap_sub").clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}
//사용법: 움직일 객체 다음에 아래코드 삽입
//JSFX_FloatDiv("wing", 880,143).floatIt();
/*탑버튼끝*/


/*새창시작*/
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}



/*서브왼쪽메뉴시작*/
function menuOver() {
	this.src = this.src.replace("off.gif", "on.gif");
	
}
function menuOut() {
	this.src = this.src.replace("on.gif", "off.gif");
}


function initSubmenu(depth1, depth2, depth3) {
	selectDepth1 = "menu" + depth1 + "-" + depth2;
	selectDepth2 = "menu" + depth1 + "-" + depth2 + "-" + depth3;
	
	
	if(eval(depth2)<=9) depth2 = "0"+depth2;
	if(eval(depth3)<=9) depth3 = "0"+depth3;
	var aNum=depth2+depth3;
	
	nav = document.getElementById("left_menu");
	menuEl = nav.getElementsByTagName("li");
	
	for(i = 0; i < menuEl.length; i++) {
	   
	   
		if (menuEl.item(i).id == selectDepth1 || menuEl.item(i).id == selectDepth2  ) {
			menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace("off.gif", "on.gif");
		} else {
		   
   		   if ( menuEl.item(i).id.length > 8 && menuEl.item(i).id.substring(0,7) != selectDepth1) {
   				menuEl.item(i).style.display = 'none';
   		   }
			
		}
	}
	
}
/*서브왼쪽메뉴끝*/




/*게시판탭시작*/

function board_showHideLayers() { //v6.0
  var i,p,v,obj,args=board_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
    obj.display=v; }
}

function board(o) {
	images_on = new Array("/img/main/board_tab01.gif","/img/main/board_tab02.gif");
	images = new Array("board_tab01","board_tab02");

//alert("SRC::"+document.getElementById("board_tab").src);

	for(i=0;i < images.length;i++) {
		if(images[i]==o) {
			///document.board_tab1.src = images_on[i];
			document.getElementById("board_tab").src = images_on[i];
			eval(images[i]).style.display="block";
		}else {
			eval(images[i]).style.display="none";
		}
	}

}

function board2(o) {
	images_on = new Array("/images/board_tab01.gif","/images/board_tab02.gif","/images/board_tab03.gif","/images/board_tab04.gif");
	images = new Array("board_tab01","board_tab02","board_tab03","board_tab04");

//alert("SRC::"+document.getElementById("board_tab").src);

	for(i=0;i < images.length;i++) {
		if(images[i]==o) {
			///document.board_tab1.src = images_on[i];
			document.getElementById("board_tab").src = images_on[i];
			eval(images[i]).style.display="block";
		}else {
			eval(images[i]).style.display="none";
		}
	}
}
/*게시판탭끝*/


/*VR시작*/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
/*VR끝*/
