var SocialWidget=(function(){var e={};var l=$$(".social_widget");var k="more";var f='<div><a href="#">요즘</a><a href="#">마이피플</a><a href="#">트위터</a><a href="#">싸이월드</a><a href="#">'+k+"</a></div>";var n='<div><a href="#">페이스북</a><a href="#">미투데이</a></div>';var a={};var g={};var c="http://profile.daum.net/api/popup/Share.daum";var o="http://mypeople.daum.net/mypeople/web/share.do";var j={prefix:"",prefix_yozm:"",prefix_mypeople:"",prefix_twitter:"",prefix_nate:"",prefix_facebook:"",prefix_me2day:"",link:"",source_id:"",meta_type:"",meta_key:"",image_path:"",caption:"",callback:"postdone"};var i=function(p,q){switch(q){case"요즘":daum.setStyle(p,"position:absolute; width:44px; height:22px; top:1px; left:5px; overflow:hidden;");break;case"마이피플":daum.setStyle(p,"position:absolute; width:67px; height:22px; top:1px; left:55px; overflow:hidden;");break;case"트위터":daum.setStyle(p,"position:absolute; width:56px; height:22px; top:1px; left:127px; overflow:hidden;");break;case"싸이월드":daum.setStyle(p,"position:absolute; width:66px; height:22px; top:1px; left:189px; overflow:hidden;");break;case"페이스북":daum.setStyle(p,"position:absolute; width:97px; height:21px;  top:3px;  left:3px; overflow:hidden;");break;case"미투데이":daum.setStyle(p,"position:absolute; width:97px; height:21px; top:25px; left:3px; overflow:hidden;");break;case k:daum.setStyle(p,"position:absolute; width:53px; height:22px; top:1px; left:261px;  overflow:hidden;");break;default:break}};var h=function(q,r,p){switch(r){case"요즘":daum.addEvent(q,"click",function(s){b(c+"?service_name=yozm&"+m("yozm"));daum.stopEvent(s)});break;case"마이피플":daum.addEvent(q,"click",function(s){b(o+"?"+m("mypeople"),"mypeople");daum.stopEvent(s)});break;case"트위터":daum.addEvent(q,"click",function(s){b(c+"?service_name=twitter&"+m("twitter"));daum.stopEvent(s)});break;case"싸이월드":daum.addEvent(q,"click",function(s){b(c+"?service_name=nate&"+m("nate"));daum.stopEvent(s)});break;case"페이스북":daum.addEvent(q,"click",function(s){b(c+"?service_name=facebook&"+m("facebook"));daum.stopEvent(s)});daum.addEvent(q,"mouseover",function(s){daum.setStyle(daum.getElement(s),"background:url(http://i1.daumcdn.net/img-section/common/sns_layer3.gif) no-repeat -106px -3px")});daum.addEvent(q,"mouseout",function(s){daum.setStyle(daum.getElement(s),"background:none;")});break;case"미투데이":daum.addEvent(q,"click",function(s){b(c+"?service_name=me2day&"+m("me2day"));daum.stopEvent(s)});daum.addEvent(q,"mouseover",function(s){daum.setStyle(daum.getElement(s),"background:url(http://i1.daumcdn.net/img-section/common/sns_layer3.gif) no-repeat -106px -25px")});daum.addEvent(q,"mouseout",function(s){daum.setStyle(daum.getElement(s),"background:none;")});break;case k:daum.addEvent(q,"click",function(s){daum.stopEvent(s)});daum.addEvent(q,"mouseover",function(s){daum.show(g[p]);daum.stopEvent(s);daum.Function.timeout(function(){d(p)},1)});break;default:break}};var b=function(p,q){switch(q){case"mypeople":daum.Browser.popup(p,680,560);break;default:daum.Browser.popup(p,400,350);break}};var d=function(p){var q=daum.addEvent(document,"mousemove",function(s){var r=daum.getElement(s);var t=false;while(r.tagName.toLowerCase()!="body"){if(r==g[p]||r.innerHTML==k){t=true;break}r=daum.getParent(r)}if(t===false){daum.hide(g[p]);daum.Event.stopObserving(q)}}.bind(this))};var m=function(p){var r=[];var q=p?"prefix_"+p:"prefix";if(j[q]){r.push("prefix="+encodeURIComponent(j[q]))}else{r.push("prefix="+encodeURIComponent(j.prefix))}for(idx in j){if(idx.indexOf("prefix")<0&&j[idx]){r.push(idx+"="+encodeURIComponent(j[idx]))}}return r.join("&")};e.load=function(){if(l.length<1){return}if(typeof(socialWidgetCfg)!=="object"){return}j=daum.extend(j,socialWidgetCfg);l.each(function(r,q){a[q]=daum.createElement(f);g[q]=daum.createElement(n);daum.setStyle(r,"position:relative;");daum.setStyle(a[q],"background:url(http://i1.daumcdn.net/img-section/common/sns_bg3.gif) no-repeat; width:315px; height:24px; position:absolute; text-indent:-9999em; top:0; left:0;");daum.setStyle(g[q],"background:url(http://i1.daumcdn.net/img-section/common/sns_layer3.gif) no-repeat 0 0; width:103px; height:49px; position:relative; text-indent:-9999em; position:absolute; text-indent:-9999em; top:23px; left:212px; display:none;");var p=daum.getChildElements(a[q]).concat(daum.getChildElements(g[q]));daum.Array.each(p,function(s){var t=s.innerHTML;i(s,t);h(s,t,q)});r.appendChild(a[q]);r.appendChild(g[q])})};return e})();SocialWidget.load();
