
// Global Navigation
function initNavigation(seq,subSeq){
    nav = document.getElementById("tab");
    nav.main=new Object();
    nav.main.arr=new Array();
    nav.main.ani=true; //true면 하위에 ul을찾아서 그 ul이있으면 block none;
    nav.main.curr=null;
    nav.sub1=new Object();
    nav.sub1.arr=new Array();
    nav.sub1.ani=true; //true면 하위에 ul을찾아서 그 ul이있으면 block none;
    nav.sub1.curr=null;
    nav.isOver = false;

    navLen = nav.childNodes.length;
    cnt=0;
    for(i=0; i<navLen; i++){
        if(nav.childNodes[i].tagName!="LI")continue;
        else{ //li가 맞다면
            li = nav.childNodes[i];
            aTag = li.getElementsByTagName("A").item(0);
            nav.main.arr[cnt]=aTag;
            nav.main.arr[cnt].parent=null;
            nav.main.arr[cnt].subMenu=li.getElementsByTagName("UL").item(0);

            nav.main.arr[cnt].onmouseover = nav.main.arr[cnt].onfocus = function(){
                nav.isOver=true;
                imgTag = this.getElementsByTagName("IMG").item(0);
                if(imgTag.src.indexOf("_on.gif")==-1) imgTag.src=imgTag.src.replace(".gif", "_on.gif");
                if(nav.main.ani==true) if(this.subMenu) this.subMenu.style.display="block";
                if(nav.main.curr!=null && nav.main.curr!=this){
                    imgTag = nav.main.curr.getElementsByTagName("IMG").item(0);
                    imgTag.src=imgTag.src.replace("_on.gif",".gif");
                    //하위메뉴 ul 감추기
                    if(nav.main.ani==true) if(nav.main.curr.subMenu) nav.main.curr.subMenu.style.display="none";
                }
                nav.main.curr=this;
            }

            nav.main.arr[cnt].onmouseout = nav.main.arr[cnt].onblur = function(){
                setTimeout(
                    function(){
                    if(nav.isOver==false){
                        if(seq>0) nav.main.arr[seq-1].onmouseover();
                        else{
                        if(nav.main.curr!=null){
                                imgTag = nav.main.curr.getElementsByTagName("IMG").item(0);
                                imgTag.src=imgTag.src.replace("_on.gif",".gif");
                                if(nav.main.ani==true) nav.main.curr.subMenu.style.display="none";
                                nav.main.curr=null;
                            }
                        }
                        if(subSeq>0) nav.sub1.arr[seq-1][subSeq-1].onmouseover();
                        else{
                            if(nav.sub1.curr!=null){
                                imgTag = nav.sub1.curr.getElementsByTagName("IMG").item(0);
                                imgTag.src=imgTag.src.replace("_on.gif",".gif");
                                if(nav.sub1.ani==true && nav.sub1.curr.subMenu) nav.sub1.curr.subMenu.style.display="none";
                                nav.sub1.curr=null;
                            }
                        }
                    }
                },200);
                nav.isOver=false;
            }
            cnt++;
        }

    }

    mainArrLen = nav.main.arr.length;
    for(i=0; i<mainArrLen; i++){
        ul = nav.main.arr[i].subMenu; //각 메인 메뉴의 서브 ul
        if(ul==null) continue;
        ulLen = ul.childNodes.length;
        cnt=0;
        nav.sub1.arr[i]=new Array();
        for(j=0; j<ulLen; j++){ //서브 ul에 li 찾음
            if(ul.childNodes[j].tagName!="LI") continue;
            else{ //li가 맞다면
                li = ul.childNodes[j];
                aTag = li.getElementsByTagName("A").item(0);
                nav.sub1.arr[i][cnt]=aTag;
                nav.sub1.arr[i][cnt].parent=nav.main.arr[i];
                nav.sub1.arr[i][cnt].onmouseover = nav.sub1.arr[i][cnt].onfocus = function(){
                    nav.isOver=true;
                    imgTag =this.getElementsByTagName("IMG").item(0);
                    if(imgTag.src.indexOf("_on.gif")==-1) imgTag.src=imgTag.src.replace(".gif", "_on.gif");
                    if(nav.sub1.curr!=null && nav.sub1.curr!=this){
                        imgTag = nav.sub1.curr.getElementsByTagName("IMG").item(0);
                        imgTag.src=imgTag.src.replace("_on.gif",".gif");
                    }
                    nav.sub1.curr=this;
                }

                nav.sub1.arr[i][cnt].onmouseout = nav.sub1.arr[i][cnt].onblur = function(){
                    setTimeout(
                    function(){

                        if(nav.isOver==false){
                            if(seq>0) nav.main.arr[seq-1].onmouseover();
                            else{
                                if(nav.main.curr!=null){
                                    imgTag = nav.main.curr.getElementsByTagName("IMG").item(0);
                                    imgTag.src=imgTag.src.replace("_on.gif",".gif");
                                    nav.main.curr=null;
                                }
                            }
                            if(subSeq>0) nav.sub1.arr[seq-1][subSeq-1].onmouseover();
                            else{
                                if(nav.sub1.curr!=null){
                                    imgTag = nav.sub1.curr.getElementsByTagName("IMG").item(0);
                                    imgTag.src=imgTag.src.replace("_on.gif",".gif");
                                    nav.sub1.curr=null;
                                }
                            }
                        }
                    },200);
                    nav.isOver=false;
                }
                cnt++;
            }
        }
    }
    if(seq>0){
        nav.main.arr[seq-1].onmouseover();
        if(subSeq>0) nav.sub1.arr[seq-1][subSeq-1].onmouseover();
    }
}

// Sub Navigation
function subNavigation(seq) {
    snav = document.getElementById("snb");
    snav.menu = new Array();
    snav.current = null;
    snav.menuseq = 0;
    snavLen = snav.childNodes.length;

    allA = snav.getElementsByTagName("a")
    for(k = 0; k < allA.length; k++) {
        allA.item(k).onmouseover = allA.item(k).onfocus = function () {
            snav.isOver = true;
            if(this.firstChild.src.indexOf("_on.gif")==-1)  this.firstChild.src=this.firstChild.src.replace(".gif", "_on.gif");
        }

        allA.item(k).onmouseout = allA.item(k).onblur = function () {
            snav.isOver = false;
            setTimeout(function () {
                if (snav.isOver == false) {
                    if (snav.menu[seq])
                        snav.menu[seq].onmouseover();
                    else if(snav.current) {
                        menuImg = snav.current.childNodes.item(0);
                        menuImg.src = menuImg.src.replace("_on.gif", ".gif");
                        if (snav.current.submenu)
                            snav.current.submenu.style.display = "block";
                        snav.current = null;
                    }
                }
            }, 200);
            if(this.parentNode.parentNode.id!="tab")    this.firstChild.src=this.firstChild.src.replace("_on.gif", ".gif");
        }
    }

    var i;
    for (i = 0; i < snavLen; i++) {
        snavItem = snav.childNodes.item(i);
        if (snavItem.tagName != "LI")
            continue;

        snavAnchor = snavItem.getElementsByTagName("a").item(0);
        snavAnchor.submenu = snavItem.getElementsByTagName("ul").item(0);

        snavAnchor.onmouseover = snavAnchor.onfocus = function () {
            if (snav.current) {
                menuImg = snav.current.childNodes.item(0);
                menuImg.src = menuImg.src.replace("_on.gif", ".gif");
                if (snav.current.submenu)
                    snav.current.submenu.style.display = "block"; //다른쪽 볼대 원래 선택되어있는 지우는함수
                snav.current = null;
            }
            if (snav.current != this) {
                menuImg = this.childNodes.item(0);
                menuImg.src = menuImg.src.replace(".gif", "_on.gif");
                if (this.submenu)
                    this.submenu.style.display = "block"; //다른거보고 돌아올때 다른서브메뉴 삭제
                snav.current = this;
            }
            snav.isOver = true;
        }
        snav.menuseq++;
        snav.menu[snav.menuseq] = snavAnchor;
    }
    if (snav.menu[seq])
        snav.menu[seq].onmouseover();
}
// Tab Content
function reportTabMenu(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 == "tabc")
			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);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		thismenu.onfocus = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		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("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

// Tab Content
function initTabMenu(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);
        if (thismenu.imgEl) {
            thismenu.onmouseover = function () {
                //this.onclick();
            }
        }
        thismenu.onmouseover = tabMenuClick;
        thismenu.onfocus = tabMenuClick;

        if (!thismenu.container.first)
            thismenu.container.first = thismenu;
    }
    tabContainer.first.onmouseover();
}

function tabMenuClick() {
    currentmenu = this.container.current;
    if (currentmenu != this) {
        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("", "");
            }
        }

        this.targetEl.style.display = "block";
        if (this.imgEl) {
            this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
        } else {
            this.className += " on";
        }
        this.container.current = this;
    }
    return false;
}

// Tab Content 20101115 추가
function initTabMenu(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);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		thismenu.onfocus = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		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("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

// Tab Content_Click 20101115 추가
function initTabMenu02(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);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		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("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

//빠른서비스
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	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)
}
/*
QuickMenu = function(element, startPoint, endPoint) {
    var STATICMENU = element;
    var stmnScrollSpeed = 1;
    var stmnTimer;

    RefreshStaticMenu = function ()
    {
        var stmnStartPoint = parseInt(STATICMENU.style.top, 10);
        var stmnEndPoint = parseInt(document.documentElement.scrollTop, 10)+endPoint;
        var stmnRefreshTimer = 1;

        if ( stmnStartPoint != stmnEndPoint ) {
                stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 17 );
                STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + "px";
                stmnRefreshTimer = stmnScrollSpeed;
        }
        stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
    }

    this.InitializeStaticMenu = function ()
    {
            STATICMENU.style.top = startPoint + "px";
            RefreshStaticMenu();
    }
}
*/

//글자 크기 크게/작게
defsize = 73;
var TF = 12;
function zoom_it(n) {
    defsize += n*10;
    var mFont = TF ;
    n=parseInt(n);
    mFont+=n;

    if(defsize >= 43 &&  defsize <= 103){

        objs = document.getElementsByTagName("body").item(0);

        //objs.style.fontSize = defsize + "%";
        objs.style.fontSize = mFont+'px';

        objs=document.getElementsByTagName("td");

        for (i=0;i<objs.length;i++) {
            try {
                objs[i].style.fontSize=mFont+'px';
            } catch(e) {}
        }

        objs=document.getElementsByTagName("a");

        for (i=0;i<objs.length;i++) {
            try {
                objs[i].style.fontSize=mFont+'px';
            } catch(e) {}
        }

        objs=document.getElementsByTagName("th");

        for (i=0;i<objs.length;i++) {
            try {
                objs[i].style.fontSize=mFont+'px';
            } catch(e) {}
        }

        objs=document.getElementsByTagName("span");

        for (i=0;i<objs.length;i++) {
            try {
                objs[i].style.fontSize=mFont+'px';
            } catch(e) {}
        }
    }
    TF = mFont;

}

// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,w,h,id,bg,vars,win){
     // 플래시 코드 정의
     var flashStr=
     "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
     "<param name='allowScriptAccess' value='always' />"+
     "<param name='movie' value='"+url+"' />"+
     "<param name='FlashVars' value='"+vars+"' />"+
     "<param name='wmode' value='"+win+"' />"+
     "<param name='menu' value='false' />"+
     "<param name='quality' value='high' />"+
     "<param name='bgcolor' value='"+bg+"' />"+
     "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />"+
     "</object>";
     // 플래시 코드 출력
     document.write(flashStr);
}

// 통합검색 상세검색
function detailSearchLayer(){
    var id = document.getElementById('detailSearchWrap');

    if( id.style.display  == "none"){
        //new Effect.SlideDown(id);
        id.style.display  = "block";
        flag = true;
    }else{
        id.style.display  = "none";
    }
}

// 분야별서비스 상세검색
function categoryServiceLayer(){
    var id = document.getElementById('category_service');

    if( id.style.height  == "100px" || id.style.height==""){
        //new Effect.SlideDown(id);
        id.style.height  = "425px";
    }else{
        id.style.height  = "100px";
    }
}

// TabNav
function tabNavigation(seq) {
    tabnav = document.getElementById("tabNav");
    tabnav.menu = new Array();
    tabnav.current = null;
    tabnav.menuseq = 0;
    tabnavLen = tabnav.childNodes.length;

    allA = tabnav.getElementsByTagName("a")
    for(k = 0; k < allA.length; k++) {
        allA.item(k).onmouseover = allA.item(k).onfocus = function () {
            tabnav.isOver = true;
        }
        allA.item(k).onmouseout = allA.item(k).onblur = function () {
            tabnav.isOver = false;
            setTimeout(function () {
                if (tabnav.isOver == false) {
                    if (tabnav.menu[seq])
                        tabnav.menu[seq].onmouseover();
                    else if(tabnav.current) {
                        menuImg = tabnav.current.childNodes.item(0);
                        menuImg.src = menuImg.src.replace("_on.gif", ".gif");
                        if (tabnav.current.submenu)
                            tabnav.current.submenu.style.display = "block";
                        tabnav.current = null;
                    }
                }
            }, 10);
        }
    }

    for (i = 0; i < tabnavLen; i++) {
        tabnavItem = tabnav.childNodes.item(i);
        if (tabnavItem.tagName != "LI")
            continue;

        tabnavAnchor = tabnavItem.getElementsByTagName("a").item(0);
        tabnavAnchor.submenu = tabnavItem.getElementsByTagName("ul").item(0);

        tabnavAnchor.onmouseover = tabnavAnchor.onfocus = function () {
            if (tabnav.current) {
                menuImg = tabnav.current.childNodes.item(0);
                menuImg.src = menuImg.src.replace("_on.gif", ".gif");
                if (tabnav.current.submenu)
                    tabnav.current.submenu.style.display = "block";
                tabnav.current = null;
            }
            if (tabnav.current != this) {
                menuImg = this.childNodes.item(0);
                menuImg.src = menuImg.src.replace(".gif", "_on.gif");
                if (this.submenu)
                    this.submenu.style.display = "block";
                tabnav.current = this;
            }
            tabnav.isOver = true;
        }
        tabnav.menuseq++;
        tabnav.menu[tabnav.menuseq] = tabnavAnchor;
    }
    if (tabnav.menu[seq])
        tabnav.menu[seq].onmouseover();
}

/**
* 파일명: lib.textSlider.js
* 설  명: 뉴스 Ticker 라이브러리
* 작성자: lainTT[김군우] - jstoy project
* 날  짜: 2004-03-25
*
*   2004-04-12 : 마우스오버시 pause기능 추가
*   2004-05-24 : 아이템 하나의 size가 길이나 높이(width || height)보다 작을 때 발생하는 버그 해결
*   2007-02-15 : 문도철  파이어폭스에서 상단이나 하단으로 스크롤할때 top속성값에 값을 할당할 수 없어 파폭에서 오류나던
*                     부분 수정
***********************************************
*/

TextSlider = function(className) {
    document.write("<div id='TextSliderPLayer_"+ className +"'><div id='TextSliderLayer_"+ className +"'></div></div>");

    this.item = [];
    this.width = this.height = this.speed = this.pixel = this.interval =
        this.size = this.moveCount = this.X = this.Y = 0;
    this.direction = "";
    this.pLayer = document.getElementById("TextSliderPLayer_"+ className);
    this.layer = document.getElementById("TextSliderLayer_"+ className);
    this.align = "left";
    this.intervalId = null;
    this.className = className;
    this.isPause = false;
}
TextSlider.prototype.init = function() {



    with (this.pLayer.style) {
        width = this.width+"px";
        height = this.height+"px";
        overflow = "hidden";

    }
    with (this.layer.style) {
        width = this.direction=='up' || this.direction=='down' ? this.width+"px" : this.size*(this.item.length+1)+"px";
        height = this.direction=='up' || this.direction=='down' ? this.size*(this.item.length+1)+"px" : this.height+"px";
        top = 0;
        left = 0;
        position = "relative";

    }
    for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++) {
        this.item[this.item.length] = this.item[i];
    }


    switch (this.direction) {
        case "up": this.X = this.Y = 0; break;
        //case "down": this.X = 0; this.layer.style.top = this.Y = -this.size*(this.item.length-1); break;
        //case "left": this.X = this.Y = 0; break;
        //case "right": this.Y = 0; this.layer.style.left = this.X = -this.size*(this.item.length-1); break;
    }


    var __html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";
    if (this.direction=='up' || this.direction=='down') {
        __html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
        for (var i = 0 ; i < this.item.length; i++)
            __html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='top'>"+this.item[i]+"</td></tr>";
        __html += "</table>";
    } else {
        __html += "<table cellspacing='0' cellpadding='0' border='0'><tr>";
        for (var i = 0 ;  i < this.item.length; i++)
            __html += "<td width='"+this.size+"' height='"+ this.layer.style.height +"' align='"+this.align+"' valign='top' style='overflow:hidden;'>"+this.item[i]+"</td>";
        __html += "</tr></table>";
    }
    __html += "</div>";
    this.layer.innerHTML = __html;
    this.start();
}
TextSlider.prototype.start = function() {
    this.intervalId = setInterval(this.className+".move()", this.speed);
}
TextSlider.prototype.move = function() {
    if (this.isPause) return;
    switch (this.direction) {
        case "up": this.Y -= this.pixel; break;
        /*
        case "down": this.Y += this.pixel; break;
        case "left": this.X -= this.pixel; break;
        case "right": this.X += this.pixel; break;
        */
    }
    if (this.direction=='up' || this.direction=='down') {

        if (Math.abs(this.Y)%this.size==0) this.stop();
        // mdcgood top속성값은 스타일값으로 String이므로 this.Y 에 "px"이란 단어를 붙여준다.
        this.layer.style.top = this.Y+"px";

    } else {
        if (Math.abs(this.X)%this.size==0) this.stop();
        this.layer.style.left = this.X;
    }
}
TextSlider.prototype.stop = function() {
    clearInterval(this.intervalId);
    switch (this.direction) {
    case "up":
        if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
        break;

    case "down":
        if (Math.abs(this.Y) <= 0) this.Y = this.layer.style.top = -this.size*(this.item.length-1);
        break;

    case "left":
        if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.left = 0;
        break;

    case "right":
        if (Math.abs(this.X) <= 0) this.X = this.layer.style.left = -this.size*(this.item.length-1);
        break;
    }
    setTimeout(this.className+".start()", this.interval);
}
TextSlider.prototype.pause = function() {this.isPause = true;}
TextSlider.prototype.unpause = function() {this.isPause = false;}

//사이트 바로가기
function goLink(oid_name) {
    var objLayer = document.getElementById(oid_name);
    var url;
    if(objLayer.value == "") {
        return;
    } else {
        url = objLayer.value;
        window.open(url,"","");
    }
}

// faq 토글 보기
function setFaqToggle(id) {

    var curDisplay = document.getElementById(id).style.display;

    if (curDisplay == 'none' || curDisplay == '') {

        document.getElementById(id).style.display = 'block';
    } else {

        document.getElementById(id).style.display = 'none';
    }
}

// faq 전체보기
function setFaqShowToggle() {

    var i = 1;

    var toggleImg = document.getElementById('butShowAll').src;

    var btnShowAll = 'http://static.naver.com/event/opencast/launching/btn_show_all_1.gif';

    // 보이기
    if (toggleImg == btnShowAll) {

        for( i = 1; i < 9; i++) {

            document.getElementById('faq0' + i).style.display = 'block';
            document.getElementById('butShowAll').src = 'http://static.naver.com/event/opencast/launching/btn_close_all_1.gif';
            document.getElementById('butShowAll').alt = '전체 답변 닫기';
        }


    } else {
    // 숨기기
        for( i = 1; i < 9; i++) {

            document.getElementById('faq0' + i).style.display = 'none';
            document.getElementById('butShowAll').src = btnShowAll;
            document.getElementById('butShowAll').alt = '전체 답변 열기';
        }

    }
}

// 용어 검색
function setDtCng(id) {

    var dtBg = document.getElementById(id).style.background;
    var dtColor = document.getElementById(id).style.fontWeight;
    var dtWeight = document.getElementById(id).style.color;

    if (dtBg == 'none' || dtBg == '') {

        document.getElementById(id).style.background = '#fffce4';
    } else {

        document.getElementById(id).style.background = 'none';
    }
    if (dtColor == 'none' || dtColor == '') {

        document.getElementById(id).style.color = '#996633';
    } else {

        document.getElementById(id).style.color = '#000000';
    }
    if (dtWeight == 'none' || dtWeight == '') {

        document.getElementById(id).style.fontWeight = 'bold';
    } else {

        document.getElementById(id).style.fontWeight = 'normal';
    }
}

// 레이어 노출
function stdShow(id) {
    document.getElementById(id).style.display = "block";
}
function stdHidden(id) {
    document.getElementById(id).style.display = "none";
}

// 이미지 롤오버
function over(obj,type){
if(type) obj.src = obj.src.replace(".gif","_on.gif");
else  obj.src = obj.src.replace("_on.gif",".gif");
}

// 팝업
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no,status=1'); } //Popup(스크롤바없음)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes'); } //Popup(스크롤바있음)
function newwin(url){ window.open(url,'new','location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(스크롤바없음)


// 출판물 토글 보기
function setFaqToggle(id) {
    var i=1;
    var content, img;
    while(content = document.getElementById("faq"+i)){
        if(content.style.display=="none" || content.style.display=="") content.style.display="block";
        else content.style.display="none";

        img = document.getElementById("faq"+i+"Img");
        if(content.style.display=="block" && img.getAttribute("src").indexOf("_on.gif")==-1) img.setAttribute("src",img.getAttribute("src").replace(".gif","_on.gif"));
        else if(content.style.display=="none" && content!=document.getElementById(id)) img.setAttribute("src",img.getAttribute("src").replace("_on.gif",".gif"));
        i++;
    }

}

//출판물 마우스오버
function setFaqMouseOver(id){
    if(document.getElementById(id).style.display=="block") return false;
    var imgNode=document.getElementById(id+"Img")
    imgNode.setAttribute("src",imgNode.getAttribute("src").replace(".gif","_on.gif"))
}
//출판물 마우스아웃
function setFaqMouseOut(id){
    if(document.getElementById(id).style.display=="block") return false;
    var imgNode=document.getElementById(id+"Img")
    imgNode.setAttribute("src",imgNode.getAttribute("src").replace("_on.gif",".gif"))
}

// 출판물 전체보기
function setFaqShowToggle() {

    var i = 1;

    var toggleImg = document.getElementById('butShowAll').src;

    var btnShowAll = 'http://static.naver.com/event/opencast/launching/btn_show_all_1.gif';

    // 보이기
    if (toggleImg == btnShowAll) {

        for( i = 1; i < 9; i++) {

            document.getElementById('faq0' + i).style.display = 'block';
            document.getElementById('butShowAll').src = 'http://static.naver.com/event/opencast/launching/btn_close_all_1.gif';
            document.getElementById('butShowAll').alt = '전체 답변 닫기';
        }


    } else {
    // 숨기기
        for( i = 1; i < 9; i++) {

            document.getElementById('faq0' + i).style.display = 'none';
            document.getElementById('butShowAll').src = btnShowAll;
            document.getElementById('butShowAll').alt = '전체 답변 열기';
        }

    }
}


// 출판물02 토글 보기
function setPubToggle(id) {

	var curDisplay = document.getElementById(id).style.display;

	if (curDisplay == 'none' || curDisplay == '') {
		aTag = document.getElementById(id); 
		aTag.style.display = 'block';
		var imgNode=document.getElementById(id+"Img")
		if(imgNode.getAttribute("src").indexOf("_on.gif")>=0) return;
		imgNode.setAttribute("src",imgNode.getAttribute("src").replace(".gif","_on.gif"))
		
	} else {
		aTag = document.getElementById(id); 
		aTag.style.display = 'none';
		var imgNode=document.getElementById(id+"Img")
		imgNode.setAttribute("src",imgNode.getAttribute("src").replace("_on.gif",".gif"))
		
	}
}

//출판물02 마우스오버
function setPubMouseOver(id){
    if(document.getElementById(id).style.display=="block") return false;
    var imgNode=document.getElementById(id+"Img")
    imgNode.setAttribute("src",imgNode.getAttribute("src").replace(".gif","_on.gif"))
}
//출판물02 마우스아웃
function setPubMouseOut(id){
    if(document.getElementById(id).style.display=="block") return false;
    var imgNode=document.getElementById(id+"Img")
    imgNode.setAttribute("src",imgNode.getAttribute("src").replace("_on.gif",".gif"))
}

// 출판물02 전체보기
function setPubShowToggle() {

    var i = 1;

    var toggleImg = document.getElementById('butShowAll').src;

    var btnShowAll = 'http://static.naver.com/event/opencast/launching/btn_show_all_1.gif';

    // 보이기
    if (toggleImg == btnShowAll) {

        for( i = 1; i < 9; i++) {

            document.getElementById('pub0' + i).style.display = 'block';
            document.getElementById('butShowAll').src = 'http://static.naver.com/event/opencast/launching/btn_close_all_1.gif';
            document.getElementById('butShowAll').alt = '전체 답변 닫기';
        }


    } else {
    // 숨기기
        for( i = 1; i < 9; i++) {

            document.getElementById('pub0' + i).style.display = 'none';
            document.getElementById('butShowAll').src = btnShowAll;
            document.getElementById('butShowAll').alt = '전체 답변 열기';
        }

    }
}

//후원참여 Layer
function prodLayerView(CiPSeq,url){
		var params = {CiPSeq : CiPSeq}
		$("#supportLayer").html();
		$.post(url, params, function(responseData){
			$("#supportLayer").html(responseData);
				$("#supportLayer").modal({
					overlayCss: {backgroundColor:"#000"},
					containerCss:{
						backgroundColor:"transparent",
						padding:0,
						height:230,
						width:476
					},
					autoResize:true
				});
		});
}

//페이지 이동
 function setTimeHref(address,time){
	setTimeout(function(){location.href=address;},time);
}

/*ActiveX 플래쉬 // t: wmode (none/transparent/opaque) 20110110추가 */
function Flash(id,url,w,h,bg,t,b,f){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,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='always' />\
<param name='quality' value='high' />\
<param name='base' value="+b+" />\
<param name='menu' value='false' />\
<param name='flashVars' value='+f+' />\
<embed src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" base="+b+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}
