if(typeof SIDEVIEW_JS=="undefined"){typeof g4_is_member=="undefined"&&alert("g4_is_member 변수가 선언되지 않았습니다. js/sideview.js");typeof g4_path=="undefined"&&alert("g4_path 변수가 선언되지 않았습니다. js/sideview.js");var SIDEVIEW_JS=true;function insertHead(c,d,e){var a=this.heads.length,b=new SideViewRow(-a,c,d,e);this.heads[a]=b;return b}function insertTail(c,d){var a=this.tails.length,b=new SideViewRow(a,c,d);this.tails[a]=b;return b}function SideViewRow(d,c,b){var a=this;a.idx=d;a.name=c;a.onclickEvent=b;a.renderRow=renderRow;a.isVisible=true;a.isDim=false}function renderRow(){if(!this.isVisible)return"";var a="<tr height='19'><td id='sideViewRow_"+this.name+"'>&nbsp;<font color=gray>&middot;</font>&nbsp;<span style='color: #A0A0A0;  font-family: 돋움; font-size: 11px;'>"+this.onclickEvent+"</span></td></tr>";return a}function showSideView(c,e,f,d,a){var b=new SideView("nameContextMenu",c,e,f,d,a);b.showLayer()}function SideView(i,j,b,e,g,f){var h="/board.php?bo_table=",d="<a href='",c="/",a=this;a.targetObj=i;a.curObj=j;a.mb_id=b;e=e.replace(/…/g,"");a.name=e;a.email=g;a.homepage=f;a.showLayer=showLayer;a.makeNameContextMenus=makeNameContextMenus;a.heads=[];a.insertHead=insertHead;a.tails=[];a.insertTail=insertTail;a.getRow=getRow;a.hideRow=hideRow;a.dimRow=dimRow;b&&a.insertTail("memo","<a href=\"javascript:win_memo('"+g4_path+c+g4_bbs+"/memo_form.php?me_recv_mb_id="+b+"');\">쪽지보내기</a>");g&&a.insertTail("mail",'<a href="javascript:;" onclick="win_formmail(\''+b+"','"+e+"','"+g+"');\">메일보내기</a>");f&&a.insertTail("homepage",'<a href="javascript:;" onclick="window.open(\''+f+"');\">홈페이지</a>");b&&a.insertTail("info",'<a href="javascript:;" onclick="win_profile(\''+b+"');\">자기소개</a>");if(g4_bo_table)if(b)a.insertTail("mb_id",d+g4_path+c+g4_bbs+h+g4_bo_table+"&sca="+g4_sca+"&sfl=mb_id,1&stx="+b+"'>아이디로 검색</a>");else a.insertTail("name",d+g4_path+c+g4_bbs+h+g4_bo_table+"&sca="+g4_sca+"&sfl=wr_name,1&stx="+e+"'>이름으로 검색</a>");if(g4_is_admin=="super"){b&&a.insertTail("new",d+g4_path+c+g4_bbs+"/new.php?mb_id="+b+"'>전체게시물</a>");b&&a.insertTail("modify",d+g4_path+c+g4_admin+"/member_form.php?w=u&mb_id="+b+"' target='_blank'>회원정보변경</a>");b&&a.insertTail("point",d+g4_path+c+g4_admin+"/point_list.php?sfl=mb_id&stx="+b+"' target='_blank'>포인트내역</a>")}}function showLayer(){var a=this;clickAreaCheck=true;var b=document.getElementById(a.targetObj),d=document.body;if(b==null){b=document.createElement("DIV");b.id=a.targetObj;b.style.position="absolute";d.appendChild(b)}b.innerHTML=a.makeNameContextMenus();var e=navigator.userAgent,c=$(a.curObj).offset();$("#"+a.targetObj).offset({left:c.left,top:c.top+15});divDisplay(a.targetObj,"block");selectBoxHidden(a.targetObj)}function getAbsoluteTop(c){var a=c,b=0;while(a.tagName!="BODY"){b+=a.offsetTop-a.scrollTop;a=a.offsetParent}return b}function getAbsoluteLeft(c){var a=c,b=0;b+=a.offsetWidth;while(a.tagName!="BODY"){b+=a.offsetLeft;a=a.offsetParent}return b}function makeNameContextMenus(){var a=this;for(var b="<table border='0' cellpadding='0' cellspacing='0' width='90' style='border:1px solid #E0E0E0;' bgcolor='#F9FBFB'>",c=0,c=a.heads.length-1;c>=0;c--)b+=a.heads[c].renderRow();for(var d=0,d=0;d<a.tails.length;d++)b+=a.tails[d].renderRow();b+="</table>";return b}function getRow(d){var c=this;for(var b=0,a=null,b=0;b<c.heads.length;++b){a=c.heads[b];if(a.name==d)return a}for(b=0;b<c.tails.length;++b){a=c.tails[b];if(a.name==d)return a}return a}function hideRow(b){var a=this.getRow(b);if(a!=null)a.isVisible=false}function dimRow(b){var a=this.getRow(b);if(a!=null)a.isDim=true}function selectBoxHidden(j){var d=document.getElementById(j),g=d.offsetLeft,h=d.offsetTop,f=d.offsetLeft+d.offsetWidth,e=d.offsetTop+d.offsetHeight,b;for(i=0;i<document.forms.length;i++)for(k=0;k<document.forms[i].length;k++){b=document.forms[i].elements[k];if(b.type=="select-one"){var a=el_top=0,c=b;if(c.offsetParent)while(c.offsetParent){a+=c.offsetLeft;el_top+=c.offsetTop;c=c.offsetParent}a+=b.clientLeft;el_top+=b.clientTop;el_right=a+b.clientWidth;el_bottom=el_top+b.clientHeight;if(a>=g&&el_top>=h&&a<=f&&el_top<=e||el_right>=g&&el_right<=f&&el_top>=h&&el_top<=e||a>=g&&el_bottom>=h&&el_right<=f&&el_bottom<=e||a>=g&&a<=f&&el_bottom>=h&&el_bottom<=e||el_top<=e&&a<=g&&el_right>=f)b.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(c){var a=c,b=0;while(a.tagName!="BODY"){b+=a.offsetTop-a.scrollTop;a=a.offsetParent;if(!a)break}return b}function getAbsoluteLeft(c){var a=c,b=0;b+=a.offsetWidth;while(a.tagName!="BODY"){b+=a.offsetLeft;a=a.offsetParent;if(!a)break}return b}function divDisplay(b,a){selectBoxVisible();document.getElementById(b).style.display=a}function hideSideView(){var a="nameContextMenu";document.getElementById(a)&&divDisplay(a,"none")}var clickAreaCheck=false;document.onclick=function(){if(!clickAreaCheck)hideSideView();else clickAreaCheck=false}};
