//¸ÞÀÎ¸Þ´º : 4.0¹öÀü¿ë [start]===========================================================================
var prevLayer_mmenu = new Array();
prevLayer_mmenu[0] = 'subMenu_01';
prevLayer_mmenu[1] = 'subMenu_02';
prevLayer_mmenu[2] = 'subMenu_03';
prevLayer_mmenu[3] = 'subMenu_04';
prevLayer_mmenu[4] = 'subMenu_05';
prevLayer_mmenu[5] = 'subMenu_06';
prevLayer_mmenu[6] = 'subMenu_07';
prevLayer_mmenu[7] = 'subMenu_08';

var prevImg_mmenu = new Array();
prevImg_mmenu[0] = 'btn_mainMenu_01';
prevImg_mmenu[1] = 'btn_mainMenu_02';
prevImg_mmenu[2] = 'btn_mainMenu_03';
prevImg_mmenu[3] = 'btn_mainMenu_04';
prevImg_mmenu[4] = 'btn_mainMenu_05';
prevImg_mmenu[5] = 'btn_mainMenu_06';
prevImg_mmenu[6] = 'btn_mainMenu_07';
prevImg_mmenu[7] = 'btn_mainMenu_08';

function viewLayer_mmenu(nowLayer, no) {
	document.all[prevLayer_mmenu[no]].style.display = 'none';
	document.all[nowLayer].style.display = '';
	prevLayer_mmenu[no] = nowLayer;
}

function changeImg_mmenu(nowImg, no) {
	if (nowImg != prevImg_mmenu[no]) {
		prevImgSrc = document.all[prevImg_mmenu[no]].src.replace('ov.gif', '.gif');
		nowImgSrc = document.all[nowImg].src.replace('.gif', '.gif');

		document.all[prevImg_mmenu[no]].src = prevImgSrc.replace('.gif', '.gif');
		document.all[nowImg].src = nowImgSrc.replace('.gif', 'ov.gif');
		prevImg_mmenu[no] = nowImg;
	}
}
//¸ÞÀÎ¸Þ´º : 4.0¹öÀü¿ë [end]===========================================================================

function changeTab01(tabName) {
	if (tabName == 'tab_saseol') {
		tab_column.style.display = '';
		tab_saseol.style.display = 'none';
		document.all.column.src = '/images/main/interview_01_ov.gif';
		document.all.saseol.src = '/images/main/hn4_tab_saseol.gif';
	} else {
		tab_saseol.style.display = '';
		tab_column.style.display = 'none';
		document.all.column.src = '/images/main/r_interview_06_ov.gif';
		document.all.saseol.src = '/images/main/hn4_tab_saseol_ov.gif';
	}
}

var prevLayer_01 = new Array();
prevLayer_01[0] = 'tabMenu_01_01';

var prevImg_01  = new Array();
prevImg_01[0]  = 'btn_tabMenu_01_01';

function viewLayer_01(nowLayer, no) {
	document.all[prevLayer_01[no]].style.display = 'none';
	document.all[nowLayer].style.display = '';
	prevLayer_01[no] = nowLayer;
}

function changeImg_01(nowImg,no) {
	if (nowImg != prevImg_01[no]) {
		prevImgSrc = document.all[prevImg_01[no]].src.replace('_ov.gif', '.gif');
		nowImgSrc = document.all[nowImg].src.replace('.gif', '.gif');

		document.all[prevImg_01[no]].src = prevImgSrc.replace('.gif', '.gif');
		document.all[nowImg].src = nowImgSrc.replace('.gif', '_ov.gif');
		prevImg_01[no] = nowImg;
	}
}

var prevLayer_02 = new Array();
prevLayer_02[0] = 'tabnews_01';

var prevImg_02  = new Array();
prevImg_02[0]  = 'btn_tabMenu_02_01';

function viewLayer_02(nowLayer, no) {
	document.all[prevLayer_02[no]].style.display = 'none';
	document.all[nowLayer].style.display = '';
	prevLayer_02[no] = nowLayer;
}

function changeImg_02(nowImg, no) {
	if ( nowImg != prevImg_02[no]) {
		prevImgSrc = document.all[prevImg_02[no]].src.replace('_ov.gif', '.gif');
		nowImgSrc = document.all[nowImg].src.replace('.gif', '.gif');

		document.all[prevImg_02[no]].src = prevImgSrc.replace('.gif', '.gif');
		document.all[nowImg].src = nowImgSrc.replace('.gif', '_ov.gif');
		prevImg_02[no] = nowImg;
	}
}

var prevLayer_03 = new Array();
prevLayer_03[0] = 'tabMenu_03_01';

var prevImg_03  = new Array();
prevImg_03[0]  = 'btn_tabMenu_03_01';

function viewLayer_03(nowLayer, no) {
	document.all[prevLayer_03[no]].style.display = 'none';
	document.all[nowLayer].style.display = '';
	prevLayer_03[no] = nowLayer;
}

function changeImg_03(nowImg, no) {
	if ( nowImg != prevImg_03[no]) {
		prevImgSrc = document.all[prevImg_03[no]].src.replace('_ov.gif', '.gif');
		nowImgSrc = document.all[nowImg].src.replace('.gif', '.gif');

		document.all[prevImg_03[no]].src = prevImgSrc.replace('.gif', '.gif');
		document.all[nowImg].src = nowImgSrc.replace('.gif', '_ov.gif');
		prevImg_03[no] = nowImg;
	}
}

//¸µÅ©Á¡¼±
function bluring() {
	if (event.srcElement.tagName == 'A' || event.srcElement.tagName == 'IMG') {
		document.body.focus();
	}
}
document.onfocusin=bluring;

//·¹ÀÌ¾îÅøÆÁ °ü·Ã [start]  /////////////////////////////////////////////
var offsetxpoint = 60; //Customize x offset of tooltip
var offsetypoint = 130; //Customize y offset of tooltip
var ie = document.all;
var ns6 = document.getElementById && !document.all;
var enabletip = false;
if (ie || ns6) {
	var tipobj = document.all? document.all['dhtmltooltip'] : document.getElementById? document.getElementById('dhtmltooltip') : '';
}

function ietruebody(){
	return (document.compatMode && document.compatMode != 'BackCompat')? document.documentElement : document.body;
}

function ddrivetip(thetext, thecolor, thewidth) {
	if (ns6||ie){
		if (typeof thewidth != 'undefined') {
			tipobj.style.width = thewidth + 'px';
		}
		if (typeof thecolor != 'undefined' && thecolor != '') {
			tipobj.style.backgroundColor = thecolor;
		}
		tipobj.innerHTML = thetext;
		enabletip = true;
		return false;
	}
}

function positiontip(e) {
	if (enabletip){
		var curX = (ns6) ? e.pageX : event.x+ietruebody().scrollLeft;
		var curY = (ns6) ? e.pageY : event.y+ietruebody().scrollTop;
		//Find out how close the mouse is to the corner of the window
		var rightedge = ie && !window.opera ? ietruebody().clientWidth - event.clientX - offsetxpoint : window.innerWidth - e.clientX - offsetxpoint - 20;
		var bottomedge = ie && !window.opera ? ietruebody().clientHeight - event.clientY - offsetypoint : window.innerHeight - e.clientY - offsetypoint - 20;

		var leftedge = (offsetxpoint < 0) ? offsetxpoint * (-1) : -1000;

		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge < tipobj.offsetWidth) {
			//move the horizontal position of the menu to the left by it's width
			tipobj.style.left = ie ? ietruebody().scrollLeft + event.clientX - tipobj.offsetWidth + 'px' : window.pageXOffset + e.clientX - tipobj.offsetWidth + 'px';
		} else if (curX < leftedge) {
			tipobj.style.left = '5px';
		} else {
		//position the horizontal position of the menu where the mouse is positioned
			tipobj.style.left = curX + offsetxpoint + 'px';
		}
		//same concept with the vertical position
		if (bottomedge<tipobj.offsetHeight) {
			tipobj.style.top = ie? ietruebody().scrollTop + event.clientY - tipobj.offsetHeight - offsetypoint + 'px' : window.pageYOffset + e.clientY - tipobj.offsetHeight - offsetypoint + 'px';
		} else {
			tipobj.style.top = curY + offsetypoint + 'px';
			tipobj.style.visibility = 'visible';
		}
	}
}

function hideddrivetip() {
	if (ns6 || ie){
		enabletip = false;
		tipobj.style.visibility = 'hidden';
		tipobj.style.left = '-1000px';
		tipobj.style.backgroundColor = '';
		tipobj.style.width = '';
	}
}
document.onmousemove = positiontip;
//·¹ÀÌ¾îÅøÆÁ °ü·Ã [end]  /////////////////////////////////////////////