/* 탑 메뉴
---------------------------------------------------------*/
function initNavigation(seq, menuid) {
	//seq = 0; /* 서브메뉴활성화 안시킴. 20100325 */

	if(!menuid)
		var nav = document.getElementById("gnbmenu");
	else
		var nav = document.getElementById(menuid);

	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;

	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if(nav.menu[seq]) {
						nav.menu[seq].onmouseover();
					}
					else {

						if (nav.current) {
							menuImg = nav.current.childNodes.item(0);
							if(menuImg.tagName == "IMG") {
								menuImg.src = menuImg.src.replace("_on.gif", ".gif");
							}
							if (nav.current.submenu) {
								nav.current.submenu.style.display = "none";
							}
							nav.current = null;
						}

					}
				}
			}, 1000);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);

		if (navAnchor.submenu) {
			navAnchor.submenu.style.display = "none";
		}

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);

				if(menuImg.tagName == "IMG") {
					menuImg.src = menuImg.src.replace("_on.gif", ".gif");
				}
					if (nav.current.submenu) {
						nav.current.submenu.style.display = "none";
				}
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				if(menuImg.tagName == "IMG") {
					menuImg.src = menuImg.src.replace("_on.gif", ".gif");
					menuImg.src = menuImg.src.replace(".gif", "_on.gif");
				}
					if (this.submenu)
						this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}

		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}

	if (nav.menu[seq])
		nav.menu[seq].onmouseover();

	/* submenu img rollover */
	var subnavLen = nav.getElementsByTagName("ul").length;
	for(i=0; i < subnavLen; i++) {

		var subnav =  nav.getElementsByTagName("ul").item(i).childNodes;
		for(s = 0; s < subnav.length; s++) {

			var subnavItem = subnav.item(s);
			if (subnavItem.tagName != "LI")
				continue;

			subnavAnchor = subnavItem.getElementsByTagName("img").item(0);

			if(subnav.item(s).getElementsByTagName("a").item(0)) {
				subnav.item(s).getElementsByTagName("a").item(0).onmouseover = subnav.item(s).getElementsByTagName("a").item(0).onfocus = function () {

					menuImg = this.childNodes.item(0);

					if(menuImg.tagName == "IMG") {
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
						menuImg.src = menuImg.src.replace(".gif", "_on.gif");
					}
					else {
						this.className += " on";
					}
					nav.isOver = true;
				}

				subnav.item(s).getElementsByTagName("a").item(0).onmouseout = subnav.item(s).getElementsByTagName("a").item(0).onblur = function () {
					menuImg = this.childNodes.item(0);

					if(menuImg.tagName == "IMG") {
						menuImg.src = menuImg.src.replace("_on.gif", ".gif");
					}
					else {
						if(this.className) {
							this.className = this.className.replace(" on", "");
						}
					}

					nav.isOver = false;
					setTimeout(function () {
						if (nav.isOver == false) {
							if(nav.menu[seq]) {
								nav.menu[seq].onmouseover();
							}
							else {

								if (nav.current) {
									menuImg = nav.current.childNodes.item(0);
									if(menuImg.tagName == "IMG") {
										menuImg.src = menuImg.src.replace("_on.gif", ".gif");
									}
									else {
										if(this.className) {
											this.className = this.className.replace(" on", "");
										}
									}

									if (nav.current.submenu) {
										nav.current.submenu.style.display = "none";
									}
									nav.current = null;
								}

							}
						}
					}, 1000);
				}

			}
		}
	}
	
	/* end submenu img rollover */
}


/* aside menu
-----------------------------------------------*/
function menuOver() {
	this.getElementsByTagName("img").item(0).src = this.getElementsByTagName("img").item(0).src.replace("_on.gif", ".gif");
	this.getElementsByTagName("img").item(0).src = this.getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
	//this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.getElementsByTagName("img").item(0).src = this.getElementsByTagName("img").item(0).src.replace("_on.gif", ".gif");
	//this.src = this.src.replace("_on.gif", ".gif");
}

/* www.rrl.go.kr submenu */
function initSubmenu(depth1, depth2, depth3) {
	var selectDepth1 = "sMenu" + depth1 + "-" + depth2;
	var selectDepth2 = "sMenu" + depth1 + "-" + depth2 + "-" + depth3;

	var nav = document.getElementById("asideMenu");
	var menuEl = nav.getElementsByTagName("li");

	for(i = 0; i < menuEl.length; i++) {
		if (menuEl.item(i).id == selectDepth1) {
			if(menuEl.item(i).getElementsByTagName("img").item(0)) {
				menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
			}
		} else if(menuEl.item(i).id == selectDepth2){
			menuEl.item(i).className = "on";
		} else{

			if (menuEl.item(i).getElementsByTagName("img").item(0)) {
				menuEl.item(i).getElementsByTagName("a").item(0).onmouseover = menuEl.item(i).getElementsByTagName("a").item(0).onfocus = menuOver;
				menuEl.item(i).getElementsByTagName("a").item(0).onmouseout = menuEl.item(i).getElementsByTagName("a").item(0).onblur = menuOut;
			}

			if (menuEl.item(i).getElementsByTagName("ul").item(0)) {
				menuEl.item(i).getElementsByTagName("ul").item(0).style.display = "none";
			}

		}
	}
}

function menu_onoff(sel){
	sel_div = document.getElementById(sel);
	if(sel_div.style.display=="none"){
		sel_div.style.display="";
	}else{
		sel_div.style.display="none";
	}
}


/* 퀵메뉴 이동
---------------------------------------------------------*/
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	targetId = document.getElementById(target);

	var obj = targetId;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {	//WebKit
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {	//WebKit
		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 imgRollover(){
 if(!document.getElementsByTagName) return;
 
 var item = document.getElementsByTagName('*');
 for(var i=0; i<item.length; i++){
  if(item[i].className == 'imgover'){
   var src = item[i].getAttribute('src');


   item[i].onmouseover = function(){
    var img = this.src.split('.gif');
    this.src = img[0] + '_on.gif';
   }


   item[i].onmouseout = function(){
    var img = this.src.split('_on.gif');
    this.src = img[0] + '.gif';
   }
  }
 }
}

/* Toggle : faq 형 리스트
-----------------------------------------------*/
function initToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
				}
				this.targetEl.style.display = "block";
				tabContainer.current = this;
			}
			return false;
		}
	}
}

/* 롤링탭  */
function tabRoll(lBt,rBt,rot){
var lBtn = document.getElementById(lBt);
var rBtn = document.getElementById(rBt) ;
var root = document.getElementById(rot);
var roota = root.getElementsByTagName('li');
var nowNum = 1;

 rBtn.onclick = function(){
  root.insertBefore(roota[roota.length-1],roota[0])
 }
 lBtn.onclick = function(){
  root.appendChild(roota[0])
 }
}


/* 탭 메뉴
---------------------------------------------------------*/
function initTabMenu(tabContainerID,useImgRoll,useOnMouse) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;
	var imgRoll = 0;
	var onMouse = 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);

		/* tab menu event */
		onMouse = useOnMouse;
		if(onMouse) {
			thismenu.onmouseover = thismenu.onfocus = 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("_on.gif", ".gif");
					this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
				} else {
					this.className += " on";
				}
				this.container.current = this;

				return false;
			}
		}
		else {
			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("_on.gif", ".gif");
					this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
				} else {
					this.className += " on";
				}
				this.container.current = this;

				return false;
			}

			/* tab img rollover */
			imgRoll = useImgRoll;
			if(imgRoll) {
				thismenu.onmouseover = thismenu.onfocus = function() {
					tabImg = this.getElementsByTagName("img").item(0);
					tabImg.src = tabImg.src.replace("_on.gif", ".gif");
					tabImg.src = tabImg.src.replace(".gif", "_on.gif");
				}
				thismenu.onmouseout = thismenu.onblur = function() {
					currentmenu = this.container.current;
					if (currentmenu == this)
						return false;

					tabImg = this.getElementsByTagName("img").item(0);
					tabImg.src = tabImg.src.replace("_on.gif", ".gif");
				}
			}
			/* end tab img rollover */
		}
		/* end tab menu event */

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first) {
		if(onMouse)
			tabContainer.first.onmouseover();
		else
			tabContainer.first.onclick();
	}
}



/* rolling
-----------------------------------------------*/
/*
#jsRolling

#설명
자식 노드를 롤링 시킨다.
롤링배너를 만든다.

#정보
개발자 : 공대여자(http://mins01.com)
만든날 : 2010-04-05
고친날 : NULL

#제약조건
"공대여자는 이쁘다"는 걸 알아야함.

#테스트
IE7
FF 3.6.x
Crome 4.x
Opera 9.x

주의
direction 이 2,4일 땐 태그 사이에 줄바꿈, 빈칸 등도 있으면 안된다(IE계열에서 빈칸으로 보일 수 있다.)
*/
var jsRolling = function(target){
	this.timer = null; //interval 타이머
	this.timerNextPause = null;

	this.direction = 1; //방향
	this.gapTime = 10; //이동딜레이
	this.gapMove = 1; //이동간격
	this.gapNextPause = 1000; //다음 대상 동작에 대한 딜레이, 0이면 사용안함.

	this.target = null;
	this.targetW = 0;
	this.chilNodesW = 0;

	this.started = false; //현재 동작중인가?
	this.paused = false; //현재 잠시 멈춤 중인가?
	this.nextPaused = false; //다음 개체가 보일때 잠시 멈춤 중인가?
	this.checkStart = true; //start 할때 자식노드들의 너비를 체크해서 start가능한지 체크, 없으면 무조건 동작!

	if(target){
		this.init(target);
	}
}
jsRolling.prototype = {
	//초기화, 타겟을 지정하고 타겟의 child를 초기화시킨다.
	'init':function(target){
		this.target = target;

	}
	//--- 타겟 설정 초기화
	,'initChild':function(child){
		child.style.margin = '0';
	}
	//--- 방향과 자식 설정 초기화
	,'setDirection':function(direction){
		this.changeDirection(direction);
		var tNode = [];
		//--- 타겟 초기화
		this.target.style.overflow = 'hidden';
		this.target.style.position = 'relative';
		this.target.onmouseover = function(thisC){
			return function(){
				thisC.onmouseover()
			}
		}(this);
		this.target.onmouseout = function(thisC){
			return function(){
				thisC.onmouseout()
			}
		}(this);

		if(this.direction == 1 || this.direction == 3){
			this.target.style.whiteSpace = 'normal';
			this.targetW = this.target.offsetWidth;

			for(var child = this.target.firstChild; child; child = child.nextSibling){
				if(child.nodeType==1){
					child.style.margin = 0;
					child.style.display = 'block';
					this.chilNodesW += child.offsetWidth;
				}else{
					tNode.push(child);
				}
			}
		}else if(this.direction == 2 || this.direction == 4){
			this.target.style.whiteSpace = 'nowrap';
			this.targetW = this.target.offsetHeight;

			for(var child = this.target.firstChild; child; child = child.nextSibling){
				if(child.nodeType==1){
					child.style.margin = 0;
					child.style.display = 'inline-block';
					//child.style.cssText += ';/display:inline'; //FOR IE6,7
					this.chilNodesW += child.offsetHeight;
				}else{
					tNode.push(child);
				}
			}
		}
		for(var i=0,m=tNode.length;i<m;i++){
			tNode[i].parentNode.removeChild(tNode[i]); //택스트 노드 제거

		}
		tNode = null;
	}
	//--- 방향 변경
	,'changeDirection':function(direction){
		this.direction = direction
	}
	//--- 처음노드 가져오기
	,'getFirst':function(){
		return this.target.firstChild;
	}
	//--- 마지막노드 가져오기
	,'getLast':function(){
		return this.target.lastChild;
	}
	//--- 동작
	,'_act':function(){
		if(this.paused || this.nextPaused){return;}
		switch(this.direction){
			case 1:this._act_up();	break;
			case 2:this._act_right(); break;
			case 3:this._act_down(); break;
			case 4:this._act_left();	break;
		}
	}
	//--- 동작 위 (1)
	,'_act_up':function(){
		//---초기화
		var n = this.getFirst();
		var mt = Math.abs(parseInt(n.style.marginTop));
		var mtg = mt+this.gapMove
		var h = n.offsetHeight;
		if(mtg>=h){
			this.target.appendChild(n);
			this.initChild(n);
			this.nextPause();
			this._act();
			return;
		}else{
			n.style.marginTop = '-'+mtg.toString()+'px';
		}
		//document.title = n.style.marginTop;
	}
	//--- 동작 오른쪽 (2)
	,'_act_right':function(){
		//---초기화
		var n = this.getFirst();
		var ml = Math.abs(parseInt(n.style.marginLeft));
		var mlg = ml-this.gapMove
		if(mlg<=0){
			var l = this.getLast();
			var w = l.offsetWidth;
			l.style.marginLeft = '-'+w+'px';
			this.target.insertBefore(l,n); //마지막 노드를 맨 처음으로

			this.initChild(n);
			this.nextPause();
			this._act();
			return;
		}else{
			n.style.marginLeft = '-'+mlg.toString()+'px';
		}
		//document.title = n.style.marginLeft;
	}
	//--- 동작 아래(3)
	,'_act_down':function(){
		//---초기화
		var n = this.getFirst();
		var mt = Math.abs(parseInt(n.style.marginTop));
		var mtg = mt-this.gapMove;

		if(mtg<=0){
			var l = this.getLast();
			var h = l.offsetHeight;
			l.style.marginTop = '-'+h+'px';
			this.target.insertBefore(l,n); //마지막 노드를 맨 처음으로
			this.initChild(n);
			this.nextPause();
			this._act();
			return;
		}else{
			n.style.marginTop = '-'+mtg.toString()+'px';
		}
		//document.title = n.style.marginTop;
	}
	//--- 동작 왼쪽 (4)
	,'_act_left':function(){
		//---초기화
		var n = this.getFirst();
		var ml = Math.abs(parseInt(n.style.marginLeft));
		var mlg = ml+this.gapMove
		var w = n.offsetWidth;
		if(mlg>=w){
			this.target.appendChild(n);
			this.initChild(n);
			this.nextPause();
			this._act();
			return;
		}else{
			n.style.marginLeft = '-'+mlg.toString()+'px';
		}
		//document.title = n.style.marginLeft;
	}
	//---  롤링시작
	,'start':function(){
		if(!this.started && this.startAble()){
			this.nextPause();
			this.timer = setInterval(function(thisC){return function(){thisC._act()}}(this),this.gapTime);
			this.started = true;
		}
	}
	//--- 롤링 멈춤
	,'stop':function(){
		clearInterval(this.timer);
		this.started = false;
	}
	//--- 롤링을 시작할 수 있는가? 외각의 1.5배만큼의 자식 노드가 있어야한다.
	,'startAble':function(){
		if(!this.checkStart){return true;}
		if(this.chilNodesW > (this.targetW*1.5)){
			return true;
		}
		return false;
	}
	//--- pause(bool이 true면 멈춘다. false면 멈춤이 해제)
	//stop과 차이점은 clearInterval을 하지 않는다는 것!
	,'pause':function(bool){
		this.paused = bool?true:false;
	}
	//--- 다음 객체가 보일때 잠시 멈춘다.
	,'nextPause':function(){
		if(this.nextPaused){
			clearTimeout(this.timerNextPause);
		}
		this.nextPaused = true;
		this.timerNextPause = setTimeout(function(thisC){
								return function(){
									thisC.nextPaused = false;
								}
							}(this)
							,this.gapNextPause);
	}
	//--- 마우스 오버 이벤트, 보통 잠시 멈춘다.
	,'onmouseover':function(){
		this.pause(true);
	}
	//--- 마우스 아웃 이벤트, 보통 잠시 멈춘을 해제한다.
	,'onmouseout':function(){
		this.pause(false);
	}
	//--- 위로 넘김
	,'up':function(){
		var n = this.getFirst();
		var l = this.getLast();
		this.target.appendChild(n);
		this.initChild(n);
		this.nextPause();
	}
	//--- 아래로 넘김
	,'down':function(){
		var n = this.getFirst();
		var l = this.getLast();
		this.target.insertBefore(l,n); //마지막 노드를 맨 처음으로
		this.initChild(l);
		this.initChild(n);
		this.nextPause();
	}
	//--- 왼쪽으로 넘김, up과 동작이 같다.
	,'left':function(){
		this.up();
	}
	//--- 오른쪽으로 넘김 , down과 동작이 같다.
	,'right':function(){
		this.down();
	}


	/* 무한롤링안되게~
	/*-------------------------------------------------------------------------*/
	//--- 왼쪽으로 넘김, up과 동작이 같다. *마지막 경고
	,'leftStop':function(){
		if(this.getFirst().className == "thumb"+this.target.childNodes.length) {
			alert("더 이상 사진이 없습니다.");
			return false;
		}
		this.up();
	}
	,'leftDownStop':function(){
		if(this.getFirst().className == "thumb"+this.target.childNodes.length) {
			//alert("더 이상 사진이 없습니다. down");
			return false;
		}
		this.up();
	}

	//--- 오른쪽으로 넘김 , down과 동작이 같다. *마지막경고
	,'rightStop':function(){
		if(this.getFirst().className == "thumb1") {
			alert("첫번째 사진입니다.");
			return false;
		}
		this.down();
	}
	,'rightDownStop':function(){
		if(this.getFirst().className == "thumb1") {
			//alert("첫번째 사진입니다. down");
			return false;
		}
		this.down();
	}
	/*--- end -----------------------------------------------------------------*/
}



/* 화면 확대, 축소
-----------------------------------------------*/
var nowZoom = 100; // 현재비율
var maxZoom = 150; // 최대비율(500으로하면 5배 커진다)
var minZoom = 80; // 최소비율

function zoomInOut(value) {
	var browser = navigator.userAgent.toLowerCase();
	if(browser.indexOf('msie') == -1){ alert("익스플로러에서만 동작합니다. \n브라우저 메뉴의 확대축소 기능을 이용하세요.") }
	else {

		if(value == "in") {
			if (nowZoom < maxZoom) {
				nowZoom += 10;
			} else {
				alert("더이상 커지지 않습니다.");
				return;
			}
		}
		else if(value == "out") {
			if (nowZoom > minZoom) {
				nowZoom -= 10;
			} else {
				alert("더이상 작아지지 않습니다.");
				return;
			}
		}
		else if(value == "base") {
			nowZoom = 100;
		}
		else {
			return;
		}

		document.getElementsByTagName("body").item(0).style.position = "relative";
		document.getElementsByTagName("body").item(0).style.zoom = nowZoom + "%";
	}
}


/* IE6 Flicker Bug를 execCommand문으로 해결
-----------------------------------------------*/
try {document.execCommand('BackgroundImageCache', false, true);} catch(e) {}


/* getElementsByClass
-----------------------------------------------*/
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


/* KillNode
-----------------------------------------------*/
function KillNode(obj) {
	var length = 0;
	var obj2 = obj.childNodes;
	length = obj2.length;
	for(var i=length-1; i>=0; i--) {
		if(obj2[i].nodeType != 1 ) {
			obj.removeChild(obj2[i]);
		}
	}
}


/* ie6전용 png이미지 투명처리
-----------------------------------------------*/
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 '';
}



<!-- DO NOT MODIFY -->
<!-- cwlogger logging script -->

  var _cw_logger_id = 3;
  var _cw_logger_domain = "www.yj21.net, yj21.net";
  var _cw_logger_url = "http://www.yj21.net/kor/cms/logger.jsp";

  function _cw_setcookie(name, value, expiredays) {
    var todayDate = new Date();
    todayDate.setDate(todayDate.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
    return;
  }
  function _cw_getcookie(name) {
    var nameOfCookie = name + "=";
    var x = 0;
    while (x <= document.cookie.length) {
      var y = (x + nameOfCookie.length);
      if (document.cookie.substring(x, y) == nameOfCookie) {
        if ((endOfCookie=document.cookie.indexOf(";", y)) == -1) endOfCookie = document.cookie.length;
        return unescape(document.cookie.substring(y, endOfCookie ));
      }
      x = document.cookie.indexOf(" ", x) + 1;
      if (x == 0) break;
    }
    return null;
  }
  function _cw_delcookie(name) {
    var now = new Date();
    document.cookie = name + "=;exprires=" + now + ";path=/";
    return;
  }
  function _cw_trim(str) {                                    
    index = 0;                                                
    while (str.charAt(index) == " ") {                        
      index = index + 1;                                      
    }
    str = str.substring(index, (str.length));                 
    index = str.length -1;                                    
    while (str.charAt(index) == " ") {                        
      index = index -1;                                       
    }                                                         
    str = str.substring(0, index +1 );                        
    return str;                                               
  }
  function replaceAll(str, src, tgt) {
    try {
      while (str.indexOf("^^") != -1) {
        str = str.replace(src, tgt);
      }
      return str;
    } catch(e) {
      return str;
    }
  }

  var _cw_uri = location.href;
  var _cw_split_domain = _cw_logger_domain.split(",");
  var _cw_href_flag = false;
  for (i = 0; i < _cw_split_domain.length; i++) {
    if(_cw_uri.indexOf("http://" + _cw_trim(_cw_split_domain[i])) != -1) {
      _cw_href_flag = true;
      break;
    }
  }

  if (_cw_href_flag) {

    _cw_uri = _cw_uri.substring(7, _cw_uri.length);
    if (_cw_uri.indexOf("?") != -1) {
      while((ch = _cw_uri.indexOf("&")) > 0) {
        _cw_uri = _cw_uri.substr(0, ch) + "%26" + _cw_uri.substr(ch + 1, _cw_uri.length);
      }
    }
    _cw_uri = replaceAll(_cw_uri.substring(_cw_uri.indexOf("/"), _cw_uri.length), "^^", "--");
    
    var _cw_title;
    try {
      _cw_title = document.cwlogger.title.value;
      if (_cw_title == null) {
        _cw_title = document.title;
      }
    } catch(e) {
      _cw_title = document.title;
    }
    if (_cw_title == "") {
      _cw_title = "No Title";
    }
    _cw_title = replaceAll(_cw_title, "^^", "--");
    _cw_title = encodeURI(_cw_title);
    
    var _cw_directory;
    try {
      _cw_directory = document.cwlogger.directory.value;
      if (_cw_directory == null) {
        _cw_directory = "";
      }
    } catch(e) {
      _cw_directory = "";
    }
    _cw_directory = replaceAll(_cw_directory, "^^", "--");
    _cw_directory = encodeURI(_cw_directory);

    var _cw_referrer;
    try {
      _cw_referrer = document.cwlogger.referrer.value;
    } catch (e) {
      _cw_referrer = document.referrer;
    }
    if (_cw_referrer == "") {
      _cw_referrer = "-";
    } else {
      while((ch = _cw_referrer.indexOf("&")) > 0) {
        _cw_referrer = _cw_referrer.substr(0, ch) + "%26" + _cw_referrer.substr(ch + 1, _cw_referrer.length);
      }
    }
    _cw_referrer = replaceAll(_cw_referrer, "^^", "--");
    _cw_referrer = encodeURI(_cw_referrer);

    var _cw_cookie = "Y";
    _cw_setcookie("cwlogger_temp_cookie", "1", 1);
    if (_cw_getcookie("cwlogger_temp_cookie") == null) {
      _cw_cookie = "N";
    }
    _cw_delcookie("cwlogger_temp_cookie");
    var _cw_java = navigator.javaEnabled()?"Y":"N";
    var _cw_screen_size = "unknown";
    var _cw_color_depth = "unknown";
    if (window.screen.width) {
      _cw_screen_size = window.screen.width + 'x' + window.screen.height;
    }
    if (window.screen.colorDepth) {
      _cw_color_depth = window.screen.colorDepth;
    }
    var _cw_language = "unknown";
    if (navigator.language) {
      _cw_language = navigator.language.substring(0,2);
    } else if (navigator.userLanguage) {
      _cw_language = navigator.userLanguage.substring(0,2);
    }
    var _cw_cpu = "unknown";
    if (navigator.cpuClass) {
      _cw_cpu = navigator.cpuClass;
    }
    var _cw_os = "unknown";
    var _cw_browser = "unknown";
    var _cw_pf = navigator.platform;
    var _cw_av = navigator.appVersion;
    var _cw_an = navigator.appName;
    var _cw_ua = navigator.userAgent;
    if (_cw_pf) {
      if(_cw_pf.indexOf('Win32') != -1){
        if(_cw_av.indexOf('95') != -1) _cw_os = 'Windows 95';
        else if(_cw_av.indexOf('98') != -1) _cw_os = 'Windows 98';
        else if(_cw_av.indexOf('Me') != -1) _cw_os = 'Windows Me';
        else if(_cw_av.indexOf('NT 5.0') != -1) _cw_os = 'Windows 2000';
        else if(_cw_av.indexOf('NT 5.1') != -1) _cw_os = 'Windows XP';
        else if(_cw_av.indexOf('NT 5.2') != -1) _cw_os = 'Windows Server 2003';
        else if(_cw_av.indexOf('NT') != -1) _cw_os = 'Windows NT';
        else _cw_os = 'Windows';
      } else if(_cw_pf.indexOf('Linux') != -1) {
        _cw_os = 'Linux';
      } else if(_cw_pf.indexOf('Sun') != -1) {
        _cw_os = 'SunOS';
      } else if(_cw_pf.indexOf('Mac') != -1) {
        _cw_os = 'Mac';
      } else if(_cw_pf.indexOf('AIX') != -1) {
        _cw_os = 'AIX';
      } else if(_cw_pf.indexOf('Free') != -1) {
        _cw_os = 'FreeBSD';
      }
    }
    if (_cw_ua) {
      if (_cw_ua.indexOf('Opera') != -1) {
        _cw_browser = "Opera";
      } else if (_cw_ua.indexOf('MSIE') != -1) {
        temp = _cw_ua.split(';')[1].split(' ');
        _cw_browser = "Internet Explorer " + parseInt(temp[2]) + ".X";
      } else if (_cw_ua.indexOf('Firefox') != -1) {
        _cw_browser = "Firefox";
      } else if (_cw_ua.indexOf('Mozilla') != -1) {
        _cw_browser = "Mozilla";
      } else if (_cw_an.indexOf('Netscape') != -1) {
        _cw_browser = "Netscape";
      } else if (_cw_an) {
        _cw_browser = _cw_an;
      }
    }

    var _cw_params = "?id=" + _cw_logger_id + "&title=" + _cw_title + "&directory=" + _cw_directory + "&uri=" + _cw_uri + "&referrer=" + _cw_referrer 
                    + "&cookie=" + _cw_cookie + "&java=" + _cw_java + "&screen=" + _cw_screen_size + "&color=" + _cw_color_depth 
                    + "&lang=" + _cw_language + "&cpu=" + _cw_cpu + "&os=" + _cw_os + "&browser=" + _cw_browser; 

    var _cw_browser_ie = (document.all)?true:false;
    var _cw_js12 = (window.screen)?true:false;
    if (_cw_js12) {
      var _cw_logger_img = new Image();
      if(_cw_browser_ie) {
        _cw_logger_img.src = _cw_logger_url + _cw_params;
      } else {
        setTimeout("_cw_logger_img.src = _cw_logger_url + _cw_params;", 1);
      }
    } else {
      if(_cw_browser_ie) document.write('<div style=\"display: none\">');
      document.write('<img src=\"' + _cw_logger_url + _cw_params + '\" height=\"0\" width=\"0\">');
      if(_cw_browser_ie) document.write('</div>');
    }

  }

<!-- DO NOT MODIFY --> 


