/* Flash */
function IE_HtmlRewrite(objParent) {
	if (window.ActiveXObject && objParent) {
		objParent.innerHTML = objParent.innerHTML;
	}
}

/* Roll Over Image */
function menuOn(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "on.gif");
}
function menuOut(imgEl) {
	imgEl.src = imgEl.src.replace("on.gif", ".gif");
}
/* MainMenu */
function initNavigation(seq) {
	var nav = document.getElementById("mainmenu");
	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);
						menuImg.src = menuImg.src.replace("on.gif", ".gif");
						*/
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 500);
		}
	}

	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("div").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				/*
				menuImg = nav.current.childNodes.item(0);
				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);
				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();
}
/* list toggle (sidebar) */
function initToggleList(ulEl, que, ans) {
	currentListNum = false;
	queEl = ulEl.getElementsByTagName(que);
	ansEl = ulEl.getElementsByTagName(ans);
	
	for (i=0;i<queEl.length;i++) {
		ansEl.item(i).listNum = i;
		queEl.item(i).listNum = i;
		ansEl.item(i).className = "off";
		queEl.item(i).onclick = toggleList;
	}
}
function toggleList () {
	if (currentListNum && currentListNum != this.listNum + 1) {
		queEl.item(currentListNum-1).className = null;
		ansEl.item(currentListNum-1).className = "off";
	}
	if (ansEl.item(this.listNum).className == "on") {
		queEl.item(this.listNum).className = null;
		ansEl.item(this.listNum).className = "off";
	} else {
		queEl.item(this.listNum).className ="on";
		ansEl.item(this.listNum).className ="on";
	}
	currentListNum = this.listNum + 1;
}
/* TabContent */
/* 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);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.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();
}

/* ¸Þ´º ÀÌ¹ÌÁö over, out */
function naviImgOn(imgEl, onImgSrc) {
	imgEl.src = onImgSrc;
}
function naviImgOut(imgEl, outImgSrc) {
	imgEl.src = outImgSrc;
}

/* ¸Þ´º ÀÌ¹ÌÁö2 over, out */
if( document.getElementById("head") != "undefined" && document.getElementById("head") != null ){
	var headObj = document.getElementById("head")
	img_el = headObj.getElementsByTagName("img")
	for (i = 0; i < img_el.length; i++) {
		if (1 != i) {
			img_el.item(i).onmouseover = function () {
				this.src = this.src.replace(".gif", "_on.gif");
			};
			img_el.item(i).onmouseout = function () {
				this.src = this.src.replace("_on.gif", ".gif");
			};
		} else {
			img_el.item(i).src = img_el.item(i).src.replace(".gif", "_on.gif");
		}
	}
}

// [[ Quick Menu ]]
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";
	}, 30)
}


// [[ Font Size Zoom In & Out ]]
defsize = 9;
function zoom_it(n) {
	defsize += n;
	objs = document.getElementsByTagName("body").item(0);
	objs.style.fontSize = defsize + "pt";
}// [[ END Font Size Zoom In & Out ]]

function fontInit(){
	defsize = 9;
	objs = document.getElementsByTagName("body").item(0);
	objs.style.fontSize = defsize + "pt";
}

// [[ È­¸éÈ®´ë - »ç¿ë¾ÈÇÔ ]]
var zoomRate = 10;
var maxRate = 150;
var minRate = 100;

function goZoom( method ) {
	if(getCookie("zoomVal") != null && getCookie("zoomVal") != ""){
		parent.document.body.style.zoom = getCookie("zoomVal");		
		currZoom=getCookie("zoomVal");
	}else{
		parent.document.body.style.zoom = '100%'; 
		currZoom = '100%';
	}

	if (((method == "+") && (parseInt(currZoom) >= maxRate)) || ((method == "-") && (parseInt(currZoom) <= minRate)) ) {
		return; 
	}

	if (method == "+") {
		parent.document.body.style.zoom = parseInt(parent.document.body.style.zoom)+zoomRate+'%';			
	}
	else if (method == "-") {
		parent.document.body.style.zoom = parseInt(parent.document.body.style.zoom)-zoomRate+'%';		
	}
	setPrintCookie("zoomVal",parent.document.body.style.zoom);

}

function defaultZoom() {
	parent.document.body.style.zoom = '100%'; 
	currZoom = '100%';
	setPrintCookie("zoomVal",parent.document.body.style.zoom);
}

function setPrintCookie(name,value){	
	document.cookie = name + "=" + escape( value ) + "; path=/; "
}// [[ END È­¸éÈ®´ë ]]

// [[ Screen Zoom In & Out ]]
var nowZoom = 100; // Screen
var maxZoom =140; // Maxium
var minZoom = 90; // Minium

//Zoom In
function zoomIn() {
	if (nowZoom < maxZoom) {
		nowZoom += 10; // 25% up
	} else {
		return;
	}
	parent.document.body.style.zoom = nowZoom + "%";
}

//Zoom Out
function zoomOut() 
{
	if (nowZoom > minZoom) {
		//25% down
		nowZoom -= 10;  
	} else {
		return;
	}
	parent.document.body.style.zoom = nowZoom + "%";
}

//Zoom Init
function zoomInit(){
	parent.document.body.style.zoom = "100%";
}// [[ END Screen Zoom In & Out ]]


// [[ Font Size Zoom In & Out ]]
defsize = 9;
function zoom_it(n) {
	defsize += n;
	objs = document.getElementsByTagName("body").item(0);
	objs.style.fontSize = defsize + "pt";
}

function fontInit(){
	defsize = 9;
	objs = document.getElementsByTagName("body").item(0);
	objs.style.fontSize = defsize + "pt";
}// [[ END Font Size Zoom In & Out ]]


//Zoom Init & Font Init
function printInit(){
	zoomInit();
	fontInit();
}


//ÇÃ·¡½¬ ¿µ¿ª

function flash(AMovie, AWMode, AWidth, AHeight) {
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + AWidth + '" height="' + AHeight + '">');
 document.write('<param name="movie" value="' + AMovie + '">');
 document.write('<param name="wmode" value="' + AWMode + '">');
 document.write('<param name="quality" value="high">');
 document.write('<embed src="' + AMovie + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + AWidth + '" height="' + AHeight + '"></embed>');
 document.write('</object>');
}








