
var NSUserLayer={};NSUserLayer.selector='#user_layer';NSUserLayer.over=true;NSUserLayer.inited=false;NSUserLayer.pos={};NSUserLayer.openBlog=function(URL,lu){return true;};NSUserLayer.openProfile=function(URL,UserIdx,lu){return true;};NSUserLayer.openUserComment=function(URL,UserIdx,lu){return true;};NSUserLayer.openUserMemo=function(URL,UserIdx,lu){return true;};NSUserLayer.makeHTML=function(data){var sb=[];var sc='';sb.push();if(data.lu&&typeof data.lu!='undefined'){p_lu='?lu='+data.lu;pa_lu='&lu='+data.lu;a_lu=",'"+data.lu+"'";}else{p_lu='';pa_lu='';a_lu='';}
if(data.UserIdx){if(!sc)sc=' class="line"';sb.push(['<li',sc,'><a href="http://www.helizet.com/?UserIdx=',data.UserIdx,pa_lu,'" target="_blank" onclick="return NSUserLayer.openProfile(this.href,\'',data.UserIdx,'\'',a_lu,');">라운지 보기</a></li>'].join(''));sb.push(['<li',sc,'><a href="http://www.helizet.com/user/',data.UserIdx,'/comment',p_lu,'" target="_blank" onclick="return NSUserLayer.openUserComment(this.href,\'',data.UserIdx,'\'',a_lu,');">투데이 보기</a></li>'].join(''));}
if(sb.length>0)return['<div class="inner"><ul>',sb.join(''),'</ul></div>'].join('');return'';};NSUserLayer.makeHTML2=function(data){var sb=[];var sc='';sb.push();if(data.lu&&typeof data.lu!='undefined'){p_lu='?lu='+data.lu;pa_lu='&lu='+data.lu;a_lu=",'"+data.lu+"'";}else{p_lu='';pa_lu='';a_lu='';}
if(data.UserIdx){if(!sc)sc=' class="line"';sb.push(['<li',sc,'><a href="http://www.helizet.com/?UserIdx=',data.UserIdx,pa_lu,'" target="_blank" onclick="return NSUserLayer.openProfile(this.href,\'',data.UserIdx,'\'',a_lu,');">라운지 보기</a></li>'].join(''));sb.push(['<li',sc,'><a href="http://www.helizet.com/',data.URL,'" target="_blank" onclick="return NSUserLayer.openUserComment(this.href,\'',data.UserIdx,'\'',a_lu,');">투데이 보기</a></li>'].join(''));}
if(sb.length>0)return['<div class="inner"><ul>',sb.join(''),'</ul></div>'].join('');return'';};NSUserLayer.close=function(force){if(force==true)NSUserLayer.over=false;if(NSUserLayer.over==true)return;jQuery(NSUserLayer.selector).fadeOut();jQuery(document).unbind('click',NSUserLayer.close);};NSUserLayer.open=function(evt,e,data){var s=jQuery(NSUserLayer.selector);NSUserLayer.init(s);s.css({'left':(NSUserLayer.pos.x-5)+'px','top':(NSUserLayer.pos.y-5)+'px'});s.html(NSUserLayer.makeHTML(data));if(s.html()=='')return false;s.fadeIn('fast');s.show();jQuery(document).bind('click',NSUserLayer.close);return false;};NSUserLayer.init=function(s){NSUserLayer.over=true;if(NSUserLayer.inited==true)return;s.mouseout(function(){NSUserLayer.over=false;});s.mouseover(function(){NSUserLayer.over=true;});NSUserLayer.inited=true;};NSUserLayer.memo=function(targetIdx){NSUser._sEvent='memo';if(NSUser.isLogin()||NSUser._oLoginInfo!=null)
{var query='',win_popup='';if(arguments.length>=2)
{if(arguments[2])
query='mode=r&type=v&gk='+arguments[2];else
query='mode=r&type=l&ti='+targetIdx;}else
{query='mode=s&type=s&ti='+targetIdx;}
if(!/iphone os/.test(navigator.userAgent.toLowerCase()))
{win_popup=window.open('http://www.helizet.com/memo/?mode=loading','pwz_memo','left=300px,top=200px,width=540px,height=360px,scrollbars=no,resizable=no,status=0');}else
{win_popup=window.open('http://www.helizet.com/memo/?'+query,'pwz_memo','left=300px,top=200px,width=540px,height=360px,scrollbars=no,resizable=no,status=0');}
jQuery.getJSON('http://www.helizet.com/memo/asyncs/user_verify.async.php?ti='+targetIdx,function(result){if(result.islogin)
{if(!result.target)
{alert('프로필 위젯을 생성하지 않은 사용자입니다.');return false;}
win_popup.location.href='http://www.helizet.com/memo/?'+query;}else
{win_popup.close();if(typeof heliprofile=='undefined')
NSUser.login();else
heliprofile.openLogin();}});NSUser._sEvent==false;}else
{if(document.location.toString().search('up_UserIdx')!=-1)
{heliprofile.openLogin();}else
{NSUser.login();alert('쪽지 보내기는 로그인이 필요한 서비스입니다.');}}
jQuery(NSUserLayer.selector).fadeOut();return false;};jQuery(document).ready(function(){jQuery(document).mousemove(function(e){NSUserLayer.pos={'x':e.pageX,'y':e.pageY};});});