//<![CDATA[

// Scripted by webmaster@mulder21c.com
// Use Document Object Model Level 1, 2
// 가능한 웹 표준 준수 지향
// IE6.0, FF3.0.3, Google Chrome 0.2.149.30, Safari 3.1.2, Opera9.60 에서 test 완료


// 엘리먼트 요소의 좌표 계산
// showPopupDiv 함수를 위한 기초 함수
function getElementTop(argElemnt){
	var currElemnt = argElemnt;
	var top = 0;

	while(currElemnt != null && (currElemnt.tagName.toUpperCase()!="body" || currElemnt.tagName.toUpperCase()!="html")){
		top+=currElemnt.offsetTop;
		currElemnt=currElemnt.offsetParent;
	}

	return top;
}

function getElementLeft(argElemnt){
	var currElemnt=argElemnt;
	var left=0;

	while(currElemnt != null && (currElemnt.tagName.toUpperCase()!="body" || currElemnt.tagName.toUpperCase()!="html")){
		left+=currElemnt.offsetLeft;
		currElemnt=currElemnt.offsetParent;
	}

	return left;
}

// 블럭 숨기기 & 나타내기 Show & Hide
function showHide(argElementID){
	var el = document.getElementById(argElementID);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	} else {
		el.style.display = 'block';
	}
}

// 사이드바 메뉴 접기 & 펼치기 Sidebar Menu Fold & Expand
function foldMenuBox(argElement, argElementID){

	var el = document.getElementById(argElementID);

	if(argElement.className == 'arrowup'){
		argElement.className = 'arrowdown';
		argElement.src = './image/arrowdown.gif';
		el.style.display = 'none';
	} else {
		argElement.className = 'arrowup';
		argElement.src = './image/arrowup.gif';
		el.style.display = 'block';
	}
}


// 팝업 레이어 띄우기 Let Popup Layer 

function showPopupDiv(argElement){

	var newNode;

	newNode = argElement.nextSibling;
	newNode.style.top = getElementTop(argElement.previousSibling)  + 'px';
	newNode.style.left = getElementLeft(argElement.previousSibling)  - 252 +'px';
	newNode.style.display = 'block';
	
	argElement.onmouseout = function(){
		newNode.style.display = 'none';
	}
}

// 드래그, 우클릭 금지 시키기 //
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
	function disableselect(e){
		if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
			return false
}

function reEnable(){
	return true
}

if (typeof document.onselectstart!="undefined")
	document.onselectstart=new Function ("return false")
else{
	document.onmousedown=disableselect
	document.onmouseup=reEnable
}

document.oncontextmenu = function() {return false;};
document.onselectstart = function() {return false;};
document.ondragstart = function() {return false;};


function unlock() {
	document.oncontextmenu = null;
	document.onselectstart = null;
	document.ondragstart = null;
}

function lock() {
	document.oncontextmenu = function() {return false;};
	document.onselectstart = function() {return false;};
	document.ondragstart = function() {return false;};
}

//링크 테두리 점선 없애기
function hidefocus() { 
	var el_a = document.getElementsByTagName("a");
	var el_btn = document.getElementsByTagName("button");
	for (i = 0; i < el_a.length; i++) { 
		el_a[i].onfocus = function () { this.blur(); } ;
	}
	for (i = 0; i < el_btn.length; i++ ){
		el_btn[i].onfocus = function () { this.blur(); } ;
	}
}

//]]>