go_url				=	new Array();
go_blank			=	new Array();
go_cpopup			=	new Array();
go_alert			=	new Array();
go_cpop_s			=	new Array();

go_url[100]			=	"/";										//	홈
go_url[9000]		=	"/Member/join.php";							//	회원가입
go_url[9100]		=	"/Member/find.php";							//	아이디/비밀번호찾기
go_url[9200]		=	"/Member/modify.php";						//	정보수정
go_url[9300]		=	"/Member/out.php";							//	회원탈퇴
go_cpopup[9800]		=	"/Member/mybox.php";						//	멘토/쪽지
go_cpop_s[9800]		=	new Array(650,310,0,0,"myBoxWindows");
go_cpopup[9700]		=	"/Crop/";									//	이미지박스
go_cpop_s[9700]		=	new Array(850,900,1,1,"imgBoxWindows");
go_url[9900]		=	"/Member/login.php";						//	로그인
go_url[9990]		=	"/Member/Member.Process.php?Proc=Logout";	//	로그아웃
go_url[9999]		=	"/Admin/";									//	관리자

function go_site(num) {
	//alert(num);
	if(go_url[num]) {
		goPage(go_url[num]);
	}
	else if(go_blank[num]) {
		goWinPage(go_blank[num]);
	}
	else if(go_cpopup[num]) {
		zPop(go_cpopup[num],go_cpop_s[num][0],go_cpop_s[num][1],go_cpop_s[num][2],go_cpop_s[num][3],go_cpop_s[num][4]);
	}
	else if(go_alert[num]) {
		alert(go_alert[num]);
	}
	else {
		alert("Unspecified error!");
	}
}

//	마우스 현재위치
var now_mouse_x, now_mouse_y;
function thisMousePosition(e) {
	e	=	e || window.event;
	now_mouse_x	=	e.pageX ? e.pageX : document.documentElement.scrollLeft + event.clientX;
	now_mouse_y	=	e.pageY ? e.pageY : document.documentElement.scrollTop + event.clientY;
}
if(document.addEventListener) {
	document.addEventListener("mousedown", thisMousePosition, false);
} else if(document.attachEvent) {
	document.attachEvent("onmousedown", thisMousePosition, false);
}


/* 시작페이지 */
function setHome(obj, url) {
	obj.style.behavior	=	"url(#default#homepage);";
	obj.setHomePage(url);
}

/* 즐겨찾기 */
function addSite(title, url) {
	var favoriteurl		=	url;
	var favoritetitle	=	title;
	if(document.all)	window.external.AddFavorite(favoriteurl,favoritetitle);
}

/* Move Page */
function goPage(page) {
	document.location.href = page;
}

/* New Windows Page */
function goWinPage(page) {
	var WinPage = null;
	WinPage	 =	window.open("");
	WinPage.document.location.href = page;
}

/* TR Color */
function trColor(obj, color) {
	obj.style.backgroundColor = color;
}

/* Original Image View */
function zImgBigViewer(path, img) {
	zPop(path + "/g2h.image.view.php?img=" + img, "150", "150", "0", "0", "ViewOriginalImage");
}

/* Recomm Member Viewer */
function zRecMemberList(act, uid) {
	if(act && uid) {
		zPop(act + "?eUid=" + uid, "250", "400", "1", "0", "enRecommMemberViewer");
		return false;
	}
}

/* Focus input box class change */
function boxStyle(obj, cls) {
	if(cls) {
		obj.className	=	cls;
	}
}

//	검색어 길이 체크
function tSearchChk(val,min,max,msg) {
    var tmpStr;
    var temp=0;
    var onechar;
    var tcount;
    tcount = 0;
    tmpStr = new String(val);
    temp = tmpStr.length;
    for (k=0;k<temp;k++) {
       onechar = tmpStr.charAt(k);
       if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
    }
	if(tcount < min || tcount > max) {
		alert(msg);	
		return false;
	}
	else return true;
}

//	폼 포커싱시 비우기
function isNull(obj, val) {
	if(obj.value == val)		obj.value	=	"";
}

// 문자길이  바이트 체크
function charChk(obj,view_obj,max_cnt) {
	var str_cnt = 0;
	var tempStr, tempStr2;
	var str_cnt_viewer = document.getElementById(view_obj);

	for(i=0; i<obj.value.length; i++) {
		tempStr = obj.value.charAt(i);
		if(escape(tempStr).length > 4) str_cnt += 2;
      	else str_cnt += 1 ;
    }

	if(str_cnt > max_cnt){
		alert("Until " + max_cnt + "byte can be entered.\n\nThe contents which " + max_cnt + "byte is exceeded will be deleted.");
		str_cnt = 0;
		tempStr2 = "";
		for(i = 0; i < obj.value.length; i++) {
			tempStr = obj.value.charAt(i);
			if(escape(tempStr).length > 4) str_cnt += 2;
	      	else str_cnt += 1 ;
	      	if(str_cnt > max_cnt) {
	      		if(escape(tempStr).length > 4) str_cnt -= 2;
	      		else str_cnt -= 1 ;
	      		break;
	      	}
	      	else tempStr2 += tempStr;
	    }
		obj.value = tempStr2;
	}
	str_cnt_viewer.innerHTML = str_cnt;
}

//	Textarea 줄수제한
function textareaLine(obj, line) {
	var temp;
	var f		=	obj.value.length;
	var tmpstr	=	"";
	var enter	=	0;
	var strlen;

	for(k = 0; k < f; k++) {
		temp = obj.value.charAt(k);
		if(temp == '\n') {
			enter++;
		}
		if(enter >= line) {
			alert("You can not enter more than " + line + " lines.");
			enter = 0;
			strlen = tmpstr.length - 1;
			obj.value = tmpstr.substring(0,strlen);
			break;
		}
		else {
			tmpstr += temp;
		}
	}
}

function getTop(oNode) {
	var oCurrentNode=oNode;
	var iTop=0;
	while(oCurrentNode.tagName!="body") {
		iTop+=oCurrentNode.offsetTop - oCurrentNode.scrollTop;
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iTop;
}

function getLeft(oNode) {
	var oCurrentNode=oNode;
	var iLeft=0;
	iLeft+=oCurrentNode.offsetWidth;
	while(oCurrentNode.tagName!="body") {
		iLeft+=oCurrentNode.offsetLeft;
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iLeft;
}

function getPosition(obj) {
	var x = 0, y = 0, cobj = obj;
	while (obj) {
		x += obj.offsetLeft || 0; y += obj.offsetTop || 0;
		obj = obj.offsetParent;
	}
	/**@ ie의 경우 최상위 엘리먼트의 offsetLeft를 그대로 유지하는 버그가 있음 이를해결 */
	if(AshUtil.browser.ie) {
		for(;;) {
			if(cobj.parentNode == document.body || !cobj) break;
			else cobj = cobj.parentNode;
		}
		if(cobj) {
			x += - parseInt(AshUtil.getStyle(cobj, 'paddingLeft')) || 0;
			y += - parseInt(AshUtil.getStyle(cobj, 'paddingTop')) || 0
		}
	}
	return new Array(x,y);
}

/************ 개인 레이어 메뉴용 ************/

String.prototype.trim = function () {
	return this.replace(/^ *| *$/g, "");
}

/* View Profile */
function myProfile(pLink) {
	zPop(pLink, '360', '420', '0', '0', 'MyProfileWindows');
}

/* daum Map */
function myMap(pLink, addr) {
	if(addr.trim().length > 0)	zPop(pLink + '?addr=' + addr, '650', '450', '0', '0', 'AddressMapWindows');
	else						alert('No address information.');
}

/* Send Memo */
function sendMemo(pLink) {
	zPop(pLink, '650', '310', '0', '0', 'SendMemoWindows');
}

/* Add Mentor */
function myMentor(pLink) {
	zPop(pLink, '300', '150', '0', '0', 'myMentorWindows');
}

/* Send Mail */
function sendMail(pLink) {
	zPop(pLink, '650', '350', '0', '0', 'SendMailWindows');
}
/* myBox */
function myBox(pLink) {
	zPop(pLink, '650', '310', '0', '0', 'myBoxWindows');
}

/* Board Search */
function bbsSearch(sType, sVal) {
	goPage(zDir_Board + "/?eb=" + zDir_BoardCode + "&st=" + sType + "&sv=" + sVal);
}

/* checkbox check */
function thisChk(obj) {
	if(obj) {
		if(obj.checked == false)	obj.checked = true;
		else						obj.checked = false;
	}
}

/* Numerical index Graph */
function aChimBarGraph(div, per, ovr_color, height, def_color) {
	if(document.getElementById(div)) {
		height			=	(height)		?	height : 12;
		var	height6		=	(height >= 12)	?	height : 12;		//	ie6
		def_color		=	(def_color)	?	def_color : "fff";
		ovr_color		=	(ovr_color)	?	ovr_color : "f63";
		var barHtml		= "";
		barHtml	+=	'<ul style="position:relative; width:100%; height:' + height + 'px; _height:' + height6 + 'px; background:#' + def_color + ';">';
		barHtml	+=	'<li style="position:absolute; width:' + per + '%; height:100%; background:#' + ovr_color + '; z-index:2;"></li>';
		barHtml	+=	'</ul>';
		document.getElementById(div).innerHTML = barHtml;
	}
}

/* Add Comma */
function setComma(vals) {
	var rtn	=	"";
	var val	=	"";
	var j	=	0;
	x		=	vals.length;
	for(i = x; i > 0; i--) {
		if(vals.substring(i,i-1) != ",") {
			val = vals.substring(i,i-1) + val;
		}
	}
	x = val.length;
	for(i = x; i > 0; i--) {
		if(j % 3 == 0 && j != 0) {
			rtn = val.substring(i,i-1) + "," + rtn; 
		}else {
			rtn = val.substring(i,i-1) + rtn;
		}
		j++;
	}
	return rtn;
}

/* Delete Comma */
function delComma(str) {
	while(str.indexOf(",") > -1) {
		str = str.replace(",", "");
	}
	return str;
}


var CenterPopupWindows = null;
/* Center Popup Windows */
function zPop(URL,W,H,S,R,N) { // 0일때는 NO 1일때는 YES
	var WINWIDTH = (screen.width-W)/2;
	var WINHEIGHT = (screen.height-H)/2;
	var PopSet  ='width='+W+',';
	PopSet  +='height='+H+',';
	PopSet  +='top='+WINHEIGHT+',';
	PopSet  +='left='+WINWIDTH+',';
	PopSet  +='scrollbars='+S+',';
	PopSet  +='resizable='+R;
	CenterPopupWindows	 =	window.open(URL, N, PopSet);
	if(parseInt(navigator.appVersion) >= 4)	 CenterPopupWindows.window.focus();
}

// 이미지 전체체크 2007-09-23 18:42:11
var AllChecker	=	0;
function imgChecker(frm, cBox, imgPath, checkBtn, nocheckBtn) {
	var f = eval("document." + frm);
	if(f[cBox]) {
		if(AllChecker == 0) {
			if(f[cBox].length) {
				for(var i = 0; i < f[cBox].length; i++) {
					f[cBox][i].checked = true;
				}
			} else {
				f[cBox].checked = true;
			}
			AllChecker = 1;
			if(imgPath)
				if(!nocheckBtn || nocheckBtn == "") {
					document.getElementById('AllChecker').src = imgPath + "action_non_check.gif";
					document.getElementById('AllChecker').title = "Release";
				}
				else {
					document.getElementById('AllChecker').src = imgPath + nocheckBtn;
					document.getElementById('AllChecker').title = "Release";
				}
			else {
				document.getElementById('AllChecker').innerHTML = nocheckBtn;
				document.getElementById('AllChecker').title = nocheckBtn;
			}
		} else {
			if(f[cBox].length) {
				for(var i = 0; i < f[cBox].length; i++) {
					f[cBox][i].checked = false;
				}
			} else {
				f[cBox].checked = false;
			}
			AllChecker = 0;
			if(imgPath)
				if(!checkBtn || checkBtn == "") {
					document.getElementById('AllChecker').src = imgPath + "action_check.gif";
					document.getElementById('AllChecker').title = "Selection";
				}
				else {
					document.getElementById('AllChecker').src = imgPath + checkBtn;
					document.getElementById('AllChecker').title = "Selection";
				}
			else {
				document.getElementById('AllChecker').innerHTML = checkBtn;
				document.getElementById('AllChecker').title = checkBtn;
			}
		}
	} else {
		alert("There is not an item which will select.");
	}
}

// 산택반전
function imgBansa(frm, cBox, imgPath) {
	var f = eval("document." + frm);
	var onCnt = 0;
	var offCnt = 0;
	if(f[cBox]) {
		if(f[cBox].length) {
			for(var i = 0; i < f[cBox].length; i++) {
				if(f[cBox][i].checked == true) {
					f[cBox][i].checked = false;
					offCnt++;
				} else {
					f[cBox][i].checked = true;
					onCnt++;
				}
			}
			// 전체가 선택되어 있는 상태라면 반전시 선택과 해제 이미지를 변경해줌
			if(f[cBox].length == onCnt) {
				if(imgPath)
					document.getElementById('AllChecker').src = imgPath + "action_non_check.gif";
				else
					document.getElementById('AllChecker').value = "Clear All";
			} else if(f[cBox].length == offCnt) {
				if(imgPath)
					document.getElementById('AllChecker').src = imgPath + "action_check.gif";
				else
					document.getElementById('AllChecker').value = "Clear All";
			}
		} else {
			if(f[cBox].checked == true) {
				f[cBox].checked = false;
				if(imgPath)
					document.getElementById('AllChecker').src = imgPath + "action_check.gif";
				else
					document.getElementById('AllChecker').value = "Select All";
			} else {
				f[cBox].checked = true;
				if(imgPath)
					document.getElementById('AllChecker').src = imgPath + "action_non_check.gif";
				else
					document.getElementById('AllChecker').value = "Select All";
			}
		}
	} else {
		alert("There is not an item which will select.");
	}
}

// 선택된 항목 Submit
function ChkSubmit(frm, cBox, okStr, noStr, Path, Target, Mode) { // 폼네임, 체크박스네임, true일때경고, false일때경고, 파일경로, 타겟, 모드&value
	var f = eval("document." + frm);
	var T = "";
	var cnt = 0;
	if(!f[cBox]) {
		alert("No Selected items.");
		return;
	}
	if(f[cBox].length) {
		for(var i=0; i< f[cBox].length; i++) {
			if(f[cBox][i].checked == true) {
				T += (f[cBox][i].value) + ",";
				cnt++;
			}
		}
	} else {
		cnt = 1;
		if(f[cBox].checked == true) {
			T = (f[cBox].value) + ",";
		}
	}
	if(T != "") {
		var que = confirm(okStr);	//	"총 " + cnt + "개의 선택한 " + okStr
		if(que == true) {
			if(Mode) {
				var MODE = Mode.split("=");
				var tmp = eval("document." + frm + "." + MODE[0]);
				tmp.value = MODE[1];
			}
			zSubmit(frm, Path, Target);
		} else {
		}
	} else {
		alert(noStr);
	}
}

// Submit
function zSubmit(frm, act, Target) {
	var f = eval("document." + frm);
	document.getElementById("gButtonDiv").style.display		=	"none";
	document.getElementById("gLoadingDiv").style.display	=	"inline";
	if(Target)
		f.target = Target;
	f.action = act;
	f.submit();
}

/* Text Length Checking */
var oldText;
var oldCount;
function CheckLen(frm, div, cnt) {
	var temp;
	var m_count;
	if(!cnt || cnt == "") cnt = 80;
	m_count = 0;
	len = document.getElementById(frm).value.length;

	for(k=0;k<len;k++) {
		temp = document.getElementById(frm).value.charAt(k);
		if(escape(temp).length > 4) m_count += 2;
		else m_count++;
	}
	document.getElementById(div).innerHTML = '(' + m_count / 2 + '/' + cnt + ')';


	if(m_count / 2 > cnt ) {
		alert("You can write " + cnt + " character limitation.");
		document.getElementById(frm).value = oldText;
		document.getElementById(div).innerHTML = '(' + oldCount / 2 + '/' + cnt + ')';
		return;
	} else {
		oldText = document.getElementById(frm).value;
		oldCount = m_count;
	}
	return m_count/2;
}

/* Only Number */
function OnlyNo(obj, isComma) {
	isComma		=	(isComma) ? isComma : "";
	var retxt = "";
	for(i=0; i<obj.value.length; i++){
		if(obj.value.charAt(i) >= 0 || obj.value.charAt(i) <= 9 || (isComma != "" && obj.value.charAt(i) == ",")){
			retxt += obj.value.charAt(i);
		}
	}
	if(isComma != "")
		obj.value = setComma(retxt);
	else
		obj.value = retxt;
}

/* Only Number */
function usOnlyNo(obj) {
	var retxt = "";
	for(i=0; i<obj.value.length; i++){
		if(obj.value.charAt(i) >= 0 || obj.value.charAt(i) <= 9 || obj.value.charAt(i) == ".") {
			retxt += obj.value.charAt(i);
		}
	}
	obj.value = retxt;
}


/************************ 유틸용 클릭 레이어 ************************/

var IE4 = (navigator.appName.indexOf("Microsoft Internet Explorer") == 0);  // 미니홈피용 Flag 추가 패치 (2007.10.12)
var isMouseOver = false;
var isLayerOver = false;
var viewCount = 0;
var layerColumnHeight = 20;

function utilShowLayer(e, lay_id, is_top, is_left) {
	if(!isMouseOver) {
		utilPrintLayer(e, lay_id, is_top, is_left);
		utilSetMouseOvr();
	}
}

function utilPrintLayer(e, lay_id, is_top, is_left) {
	if (lay_id == "none") return;
	menuLocBod = window.document.body;

	// 레이어 위치 지정 2007-11-11 12:18:10
	var isTop	=	(is_top)	?	is_top : 0;
	var isLeft	=	(is_left)	?	is_left : 0;

	xPos = (IE4) ? menuLocBod.scrollLeft + e.clientX : e.pageX;
	yPos = (IE4) ? e.clientY + menuLocBod.scrollTop : e.pageY;

	screen_height = window.document.body.offsetHeight;
	screen_width = window.document.body.offsetWidth;
	mouse_top = (IE4) ? e.y : e.pageY;
	mouse_left = (IE4) ? e.x : e.pageX;

	var pmn = document.getElementById(lay_id);

	if(IE4) {
		mainmenu_top_indent = pmn.children.length; // pmn.children[0].children[0].children[0].children[0].children[0].children[0].children.length;
	} else {
		var objNodes = pmn.getElementsByTagName("table");
		mainmenu_top_indent = objNodes.length;
	}
	mainmenu_top_indent = viewCount * layerColumnHeight;

	if(screen_height > mouse_top + mainmenu_top_indent)
		yPos = e.clientY + menuLocBod.scrollTop;
	else
		yPos = (e.clientY + menuLocBod.scrollTop) - mainmenu_top_indent;

	if(mouse_top - mainmenu_top_indent < 0)
		yPos = e.clientY + menuLocBod.scrollTop;

	var objAr = document.getElementById(lay_id);

	if(IE4) {
		xPos = e.clientX + menuLocBod.scrollLeft + isLeft;
		yPos = e.clientY + menuLocBod.scrollTop + isTop;
		objAr.style.pixelTop = yPos;
		objAr.style.pixelLeft = xPos;
	} else {
		yPos = yPos + isTop;
		xPos = xPos + isLeft;
		objAr.style.top = yPos + "px";
		objAr.style.left = xPos + "px";
	}
	objAr.style.display = "";
}

function utilSetLayOvr()			{	isLayerOver	=	true; }
function utilSetLayOut()			{	isLayerOver	=	false; }
function utilSetMouseOvr()			{	isMouseOver	=	true; }
function utilSetMouseOut()			{	isMouseOver	=	false; }
function utilHideLayer(lay_id)		{	setTimeout("utilHiddenLayer('"+lay_id+"')", 1); }
function utilHiddenLayer(lay_id) {
	if(!isLayerOver){
		eval(lay_id + ".style.display = \"none\"");
		utilSetMouseOut();
		viewCount = 0;
	}
}

function utilHideLayer2(lay_id) {
	if(!isLayerOver){
		eval(lay_id + ".style.display = \"none\"");
		utilSetMouseOut();
		viewCount = 0;
	}
}

/************************ 메뉴용 클릭 레이어 ************************/

// 한번만 실행
if(typeof(is_aChimLayerShow) == 'undefined') {
	var is_aChimLayerShow = true;

	// 회원이름 클릭시 회원정보등을 보여주는 레이어
	function insertHead(name, text, evt) {
		var idx = this.heads.length;
		var row = new SideViewRow(-idx, name, text, evt);
		this.heads[idx] = row;
		return row;
	}

	function insertTail(name, evt) {
		var idx = this.tails.length;
		var row = new SideViewRow(idx, name, evt);
		this.tails[idx] = row;
		return row;
	}

	function SideViewRow(idx, name, onclickEvent) {
		this.idx = idx;
		this.name = name;
		this.onclickEvent = onclickEvent;
		this.renderRow = renderRow;
		this.isVisible = true;
		this.isDim = false;
	}

	function renderRow() {
		if(!this.isVisible)
			return "";
		var str = "<tr height=\"20\"><td id='sideViewRow_"+this.name+"' style=\"background: #fff;\" onmouseover=\"trColor(this, '#f1f1f1');\" onmouseout=\"trColor(this, '#fff');\">&nbsp;&middot;&nbsp;<font id='sideview'>"+this.onclickEvent+"</font></td></tr>";
		return str;
	}

	function aChimLayer(curObj, tMenu, mID, mName, mEmail, def) {
		var sideView = new SideView('nameContextMenu', curObj, tMenu, mID, mName, mEmail, def);
		sideView.showLayer();
	}

    function SideView(targetObj, curObj, tMenu, mID, mName, mEmail, def) {
        this.targetObj = targetObj;
        this.curObj = curObj;
        this.tMenu = tMenu;
        this.mID = mID;
        mName = mName.replace(/…/g,"");
        this.mName = mName;
        this.mEmail = mEmail;
        this.def = def;
        this.showLayer = showLayer;
        this.makeNameContextMenus = makeNameContextMenus;
        this.heads = new Array();
        this.insertHead = insertHead;
        this.tails = new Array();
        this.insertTail = insertTail;
        this.getRow = getRow;
        this.hideRow = hideRow;
        this.dimRow = dimRow;

		if(mID) {
			this.insertTail("myProfile",	"<font class=\"font11 hand\" onclick=\"myMentor('" + zDir_Member + "/mentor_add.php?tID=" + mID + "');\" title=\"Mentor registration\">Mentor regist</font>");
			//this.insertTail("myProfile",	"<font class=\"font11 hand\" onclick=\"myProfile('" + zDir_Board + "/_profile.php?myID=" + mID + "');\" title=\"Profiles\">Profiles</font>");
			this.insertTail("sendMemo",		"<font class=\"font11 hand\" onclick=\"sendMemo('" + zDir_Member + "/memo_send.php?takeID=" + mID + "');\" title=\"Send message\">Send message</font>");
		}
		if(mEmail) {
			this.insertTail("sendMail",		"<font class=\"font11 hand\" onclick=\"sendMail('" + zDir_Member + "/mail_send.php?takeID=" + mID + "');\" title=\"Send email\">Send email</font>");
		}
		/*
		if(!def) {
			if(mID) {
				this.insertTail("idSearch",		"<font class=\"font11 hand\" onClick=\"bbsSearch('userID', '" + mID + "');\">Search by ID</font>");
			}
			if(mName) {
				this.insertTail("nameSearch",	"<font class=\"font11 hand\" onClick=\"bbsSearch('userName', '" + mName + "');\">Search by name</font>");
			}
		}
		*/
    }

	function showLayer() {
		clickAreaCheck = true;
		var oSideViewLayer = document.getElementById(this.targetObj);
		var oBody = document.body;
		if(oSideViewLayer == null) {
			oSideViewLayer = document.createElement("DIV");
			oSideViewLayer.id = this.targetObj;
			oSideViewLayer.style.position = "absolute";
			oSideViewLayer.style.zIndex = "9999";
			oBody.appendChild(oSideViewLayer);
		}
		oSideViewLayer.innerHTML = this.makeNameContextMenus();
		if(getAbsoluteTop(this.curObj) + this.curObj.offsetHeight + oSideViewLayer.scrollHeight - 100 > oBody.scrollHeight)
			oSideViewLayer.style.top = getAbsoluteTop(this.curObj) - oSideViewLayer.scrollHeight + "px";
		else
			oSideViewLayer.style.top = getAbsoluteTop(this.curObj) + this.curObj.offsetHeight + "px";

		oSideViewLayer.style.left = getAbsoluteLeft(this.curObj) - this.curObj.offsetWidth + 15 + "px";

		divDisplay(this.targetObj, 'block');
		selectBoxHidden(this.targetObj);
    }

	function makeNameContextMenus() {
		var str = '<table align="left" border="0" cellpadding="0" cellspacing="0" width="110" style="border:1px solid #ccc; background:#fff;">';
		var i=0;
		for (i=this.heads.length - 1; i >= 0; i--)
			str += this.heads[i].renderRow();
		var j=0;
		for (j=0; j < this.tails.length; j++)
			str += this.tails[j].renderRow();
		str += "</table>";
		return str;
	}

	function getRow(name) {
		var i = 0;
		var row = null;
		for(i=0; i<this.heads.length; ++i) {
			row = this.heads[i];
			if(row.name == name) return row;
		}

		for(i=0; i<this.tails.length; ++i) {
			row = this.tails[i];
			if(row.name == name) return row;
		}
		return row;
    }

	function hideRow(name) {
		var row = this.getRow(name);
		if(row != null)
			row.isVisible = false;
	}

	function dimRow(name) {
		var row = this.getRow(name);
		if(row != null)
			row.isDim = true;
	}

	// <div id=LayerID style="display:none; position:absolute;" onpropertychange="selectBoxHidden('LayerID')">
	function selectBoxHidden(layer_id) {
		var ly = document.getElementById(layer_id);

		// 레이어 좌표
		var ly_left   = ly.offsetLeft;
		var ly_top    = ly.offsetTop;
		var ly_right  = ly.offsetLeft + ly.offsetWidth;
		var ly_bottom = ly.offsetTop + ly.offsetHeight;

		// 셀렉트박스의 좌표
		var el;

		for(i=0; i<document.forms.length; i++) {
			for(k=0; k<document.forms[i].length; k++) {
				el = document.forms[i].elements[k];
				if(el.type == "select-one") {
					var el_left = el_top = 0;
					var obj = el;
					if(obj.offsetParent) {
						while(obj.offsetParent) {
							el_left += obj.offsetLeft;
							el_top  += obj.offsetTop;
							obj = obj.offsetParent;
						}
					}
					el_left   += el.clientLeft;
					el_top    += el.clientTop;
					el_right  = el_left + el.clientWidth;
					el_bottom = el_top + el.clientHeight;
					// 좌표를 따져 레이어가 셀렉트 박스를 침범했으면 셀렉트 박스를 hidden 시킴
					if((el_left >= ly_left && el_top >= ly_top && el_left <= ly_right && el_top <= ly_bottom) ||
					(el_right >= ly_left && el_right <= ly_right && el_top >= ly_top && el_top <= ly_bottom) ||
					(el_left >= ly_left && el_bottom >= ly_top && el_right <= ly_right && el_bottom <= ly_bottom) ||
					(el_left >= ly_left && el_left <= ly_right && el_bottom >= ly_top && el_bottom <= ly_bottom) )
					el.style.visibility = 'hidden';
				}
			}
		}
	}

	// 감추어진 셀렉트 박스를 모두 보이게 함
	function selectBoxVisible() {
		for(i=0; i<document.forms.length; i++) {
			for(k=0; k<document.forms[i].length; k++) {
				el = document.forms[i].elements[k];
				if(el.type == "select-one" && el.style.visibility == 'hidden')
					el.style.visibility = 'visible';
			}
		}
	}

/*
    function getAbsoluteTop(oNode) {
		var oCurrentNode=oNode;
		var iTop=0;
		while(oCurrentNode.tagName!="BODY") {
			iTop+=oCurrentNode.offsetTop - oCurrentNode.scrollTop;
			oCurrentNode=oCurrentNode.offsetParent;
		}
		return iTop;
    }

	function getAbsoluteLeft(oNode) {
		var oCurrentNode=oNode;
		var iLeft=0;
		iLeft+=oCurrentNode.offsetWidth;
		while(oCurrentNode.tagName!="BODY") {
			iLeft+=oCurrentNode.offsetLeft;
			oCurrentNode=oCurrentNode.offsetParent;
		}
		return iLeft;
	}
*/

    function getAbsoluteTop(oNode) {
		return now_mouse_y;
    }

	function getAbsoluteLeft(oNode) {
		return now_mouse_x;
	}

	function divDisplay(id, act) {
		selectBoxVisible();
		document.getElementById(id).style.display = act;
	}

	function hideSideView() {
		if(document.getElementById("nameContextMenu"))
			divDisplay ("nameContextMenu", 'none');
	}

	var clickAreaCheck = false;
	document.onclick = function() {
		if(!clickAreaCheck)
			hideSideView();
		else
			clickAreaCheck = false;
	}
}
