//<![CDATA[

//	오픈윈도우 
function openWindow(theURL,theName,theWidth,theHeight,theScroll) { 
	window.open(theURL, theName,'width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}

function openPopupZone(theURL,theName,theTop,theLeft,theWidth,theHeight,theScroll) { 
	var xpie_SP2 = browserVersion();
	if (xpie_SP2) {
		theHeight = theHeight + 20;
	}	
	window.open(theURL, theName,'top='+theTop+',left='+theLeft+',width='+theWidth+',height='+theHeight+',marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+theScroll+',resizable=no');
}

function browserVersion() {    
	var tmp_MSIE = window.navigator.userAgent.indexOf("MSIE");
	if (tmp_MSIE && window.navigator.userAgent.indexOf("SV1") > tmp_MSIE) {
		return true; 
	} else {
		return false;
	}
}

function pop_window(arg1,arg2,arg3) {
	window.open(arg1,'','width='+arg2+',height='+arg3+',scrollbars=1');
}

function opener_win (url) {
	var result = url.replace(/&amp;/gi, '&'); 
	opener.location.href = result;
	window.close();
}

			
// 메인 메뉴
function initNavigation(seq) {
	var nav = document.getElementById("topmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	var navLen = nav.childNodes.length;
	var menuImg;
	
	var allA = nav.getElementsByTagName("a");
	for(var 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;
					}
				}
			}, 900000);
		}
	}

	for (var i = 0; i < navLen; i++) {
		var navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI") {
			continue;
		}
		var navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").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();
	}
}

// 화면 확대 축소
var zoomRate = 10;
var curRate = 100;
var minRate = 100;
var maxRate = 200;

function zoomInOut(value) {
	var browserEl = navigator.userAgent.toLowerCase();
	if(browserEl.indexOf('firefox')!=-1) { alert("익스플로러전용기능입니다. 보기메뉴 - 크기조정 - 확대/축소를 이용하세요."); }
	else if(browserEl.indexOf('opera')!=-1) { alert("익스플로러전용기능입니다. 보기메뉴 - zoom을 이용하세요."); }
	else if(browserEl.indexOf('safari')!=-1) { alert("익스플로러전용기능입니다. 보기메뉴 - 텍스트크게/작게를 이용하세요."); }
	if (((value == "plus")&&(curRate >= maxRate))||((value == "minus") && (curRate <= minRate))) {
	    return;
	}  
	if (value == "plus") {
		curRate = parseInt(curRate) + parseInt(zoomRate);
	} else if (value == "minus") {
		curRate = parseInt(curRate) - parseInt(zoomRate);
	} else {
		curRate = 100;
	}
	document.body.style.zoom = curRate + '%';
}

// 메인 전체 메뉴 보기
function if_showhidden() {
	var obj = document.getElementById("allmenu-wrapper");
	if(obj.style.display == "none" || obj.style.display == "") {
		obj.style.display = "block";
	} else {
		obj.style.display = "none";		
	}
}

// 이미지 오버
function initImgOver(as_ID) {
	var rollNav = document.getElementById(as_ID);	
	var rollLan = rollNav.childNodes.length;	
	var rollItem;	
	var rollAnchor;
	var rollImg;	
	
	for (var i=0; i<rollLan; i++) {
		rollItem = rollNav.childNodes.item(i);
		if (rollItem.tagName != "LI") {
			continue;
		}
		rollAnchor = rollItem.getElementsByTagName("a").item(0);
		if (rollAnchor.className != "over") {		
			rollAnchor.onmouseover = rollAnchor.onfocus = function () {
				if (rollNav.current) {
					rollImg = rollNav.current.childNodes.item(0);
					rollImg.src = rollImg.src.replace("_on.gif", ".gif");
					rollNav.current = null;				
				}
				if ((rollNav.current == null) || (rollNav.current != this)) {
					rollImg = this.childNodes.item(0);
					rollImg.src = rollImg.src.replace(".gif", "_on.gif");
					rollNav.current = this;
				}
				rollNav.isOver = true;			
			}
			rollAnchor.onmouseout = rollAnchor.onblur = function () {
				if (rollNav.current) {
					rollImg = rollNav.current.childNodes.item(0);
					rollImg.src = rollImg.src.replace("_on.gif", ".gif");
					rollNav.current = null;				
				}
			}
		}
	}	
}
//]]>
