var pig_lib_youtubetools=function(h){try{function u(){var e=location.href.split("v=")[1];if(!e){return}var a=e.split("&")[0];if(!a){return}return a}function d(){chrome.extension.sendRequest({type:"go_youtube",value:1},function(a){})}function c(){chrome.extension.sendRequest({type:"go_youtube",value:2},function(a){})}function g(x,a,s){var e=_getid(x);if(e){var i=document.createElement("a");i.href="javascript:void(0)";i.onclick=s;i.innerHTML=a;e.appendChild(i)}}function r(){g("watch-pig-youtubetool-1",_i18n("menu_lyrics"),d);g("watch-pig-youtubetool-2",_i18n("menu_youtube_repeat"),c)}var n="#watch-pig-youtubetool div{ height:25px; background:#FFF!important; line-height:25px; font-size:12px; cursor:pointer; padding:0 8px!important; margin: 1px 0px 0px 0px!important; }";n+="#watch-pig-youtubetool div:hover{background:#EBEBEB!important;}";n+="#watch-pig-youtubetool div a{ color:#000!important; text-decoration:none!important; height:100%; width:100%;}";var l="";var m=location.href.split("v=")[1];l+="
";if(h){try{var v=JSON.parse(h);for(var p=0;p
'+b+"
"}}}catch(f){}}var q=document.createElement("style");q.innerText=n;document.documentElement.insertBefore(q,null);if(_getid("video-player")||_getid("movie_player")){var j="";var k=l+j;var o="watch-like-dislike-buttons";if(_getid(o)){var w=document.createElement("button");w.setAttribute("id","watch-pig-youtube");w.setAttribute("class","yt-uix-button yt-uix-button-text yt-uix-tooltip");w.setAttribute("data-tooltip",_i18n("menu_youtube"));w.setAttribute("title",_i18n("menu_youtube"));w.innerHTML="
"+_i18n("msg_tools")+"
'+k+"
";_getid(o).parentNode.insertBefore(w,_getid(o).nextSibling);r()}}}catch(t){}};chrome.extension.sendRequest({type:"get",key:"etc_youtubednmenu"},function(a){var b=new pig_lib_youtubetools(a)});
var pig_lib_navervideodownload=function(){var c=null;function a(l,k){if(!k){k=document}var j,g=[],h=document.evaluate(l,k,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(j=0;item=h.snapshotItem(j);j++){g.push(item)}return g}function d(){var g=this.data;var h=this;chrome.extension.sendRequest({type:"geturl",value:g},function(m){var k=get_value(m,"
");if(!k){alert(chrome.i18n.getMessage("msg_error"));return}try{if(c){c.parentNode.removeChild(c);c=null}}catch(l){}k=k.replace(/\"/gi,"%22");var i=document.createElement("span");c=i;var j="우클릭메뉴를 이용한 다른 이름으로 저장 기능을 이용해보세요. 링크를 클릭하면 브라우저 기본 플레이어로 재생될 수 있습니다.";i.innerHTML='
다운링크 (우클릭메뉴로 저장)
';h.parentNode.appendChild(i)})}function f(){chrome.extension.sendRequest({type:"open_tab",url:"http://chrome/lyrics/topsong.php",last:false},function(g){})}function b(){var g=this.parentNode;if(!g){return}if(g.data&&g.data.downloadresized){var i=g.data.offsetHeight;if(!i){i=g.data.clientHeight}g.data.height=i+25;g.data.downloadresized=false}g.parentNode.removeChild(g)}try{a("//embed").forEach(function(l){var j=l.src;if(!l.downloadresized&&j&&(j.indexOf("NFPlayer.swf")>0)){var k=document.createElement("span");k.data=l;l.parentNode.appendChild(k);j=j.replace("NFPlayer.swf","play.nhn");var g=document.createElement("button");g.onclick=d;g.data=j;g.title="이 비디오 다운로드 하기 (Pig Toolbox)";g.innerHTML=safegetlang2("msg_download","Download");g.style["font-size"]="12px";k.appendChild(g);var i=l.offsetHeight;if(!i){i=l.clientHeight}l.height=i-25;l.downloadresized=true;var g=document.createElement("button");g.onclick=f;g.innerHTML="최신 인기가요";g.style["font-size"]="12px";k.appendChild(g);var g=document.createElement("button");g.onclick=b;g.innerHTML="닫기";g.style["font-size"]="12px";k.appendChild(g)}})}catch(e){}};var g_pig_lib_navervideodownload=new pig_lib_navervideodownload;
var pig_lib_translate=function(){var c;var f;var i=false;var a=null;var j=null;var e="en";clearInterval(a);clearInterval(j);function b(n){var m=n;var o;var l=0;while(true){o=window[m];if(!o){return m}l++;m=n+l+"_"}}function h(){var m=dic_get_uniq_id("pig_translate_element");var l=b("pig_translateElementInit");var s=document;var k=s.body;var n=k.insertBefore(s.createElement("div"),k.firstChild);n.id=m;var q=s.createElement("script");q.text="function "+l+'(){ var t=new google.translate.TranslateElement({pageLanguage:"", multilanguagePage:true, layout:google.translate.TranslateElement.InlineLayout.HORIZONTAL},"'+m+'"); setTimeout(function(){t.showBanner(false);},10);}';q.setAttribute("type","text/javascript");k.appendChild(q);var r=s.createElement("script");r.setAttribute("src","//translate.google.com/translate_a/element.js?cb="+l+"&hl="+e);r.setAttribute("type","text/javascript");k.appendChild(r);j=(!f)?setInterval(d,200):null}this.start=function(m,l,k){e=m;c=l;f=k;h()};function g(){try{var k=_getid(":2.container");if(!k){k=_getid(":1.container")}if(i){var n=document.body.getElementsByClassName("goog-te-combo")[0];for(var l=0;l