// 네비게이션
function unfold(todo){
	// unfold('gnv','true'); 네비게이션 영역 제어
	var temp = document.getElementById('globalNav');
	if (todo != 'true') {
		temp.className="fold";
	} else {
		temp.className="unfold";
	}
}

// 롤 오버
function smartRollover() { 
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

// 토글
function toggle(obj,n) {
	for(i = 1; i <= 18; i++){
		faq = document.getElementById(obj+i);
		if(i == n){
    		faq.style.display = "block";
		} else {
			faq.style.display = "none";
	    }
    }
}

// 토글 toggleMax('map','1','18');
function toggleMax(obj,n,max) {
	for(i = 1; i <= max; i++){
		faq = document.getElementById(obj+i);
		if(i == n){
    		faq.style.display = "block";
		} else {
			faq.style.display = "none";
	    }
    }
}

function stripeHover(obj) {
	switch(obj.className) {
		case "odd":
    		obj.className="odd_over";
    		break;
		case "odd_over":
			obj.className="odd";
			break;
		case "over":
			obj.className="";
			break;
		default:
			obj.className="over";
			break;
	}
}

function toggleFaq(n){
/*
	for(i = 1; i <= 10; i++){
	faq = document.getElementById("answer"+i);
		if(i == n){
			if(faq.className == "show") {
				faq.className = "hide";
			} else {
				faq.className = "show";
			}
		}else{
    		faq.className = "hide";
		}
	}
*/
    faq = document.getElementById("answer"+n);
    if ( faq.className == "show" ) {
        faq.className = "hide";
    } else {
        faq.className = "show";
    }
}

function openWin(url){
	window.open(url, '', 'width=100, height=100, top=100, left=100, scrollbars=yes, status=no, resizable=yes');
}

function popCenter(openUrl, windowWidth, windowHeight) {
	var windowLeft = (screen.width - windowWidth)/2;
	var windowTop= (screen.height - windowHeight)/2;
	popUp = window.open(openUrl, "popUp", "titlebar=1, resizable=1, scrollbars=yes, width="+windowWidth+", height="+windowHeight+", top="+windowTop+", left="+windowLeft);
	if(!popUp) {
	     alert("팝업차단을 해제해주세요.");
	     return false;
	}
	popUp.focus();
}


function resizeWin(w,h) {
	var clintAgent = navigator.userAgent;
	if ( clintAgent.indexOf("MSIE") != -1 ) {
		window.resizeBy(w-document.body.clientWidth, h-document.body.clientHeight);
	} else {
		window.resizeBy(w-window.innerWidth, h-window.innerHeight);
	}
}

function popCenter(openUrl, windowWidth, windowHeight) {
	var windowLeft = (screen.width - windowWidth)/2;
	var windowTop= (screen.height - windowHeight)/2;
	popUp = window.open(openUrl, "popUp", "titlebar=1, resizable=1, scrollbars=yes, width="+windowWidth+", height="+windowHeight+", top="+windowTop+", left="+windowLeft);
	if(!popUp) {
	     alert("팝업차단을 해제해주세요.");
	     return false;
	}
	popUp.focus();
}
function flashNav() { }

