Splash={cur_slide:1,_setImg:function(){var b=Splash.cur_slide;var a=$("slide_img");setClass(a,"slide_"+b);setClass($("beta-headline"),"title_"+b);$("beta-plurkform").style.display="none";if(b==5){a.useMap="#back";$("beta-plurkform").style.display="block";$("input_nick_name").focus()}else{if(b==1){a.useMap="#next"}else{a.useMap="#next_back"}}},nextSlide:function(){Splash.cur_slide++;Splash._setImg();return false},showSlide:function(a){Splash.cur_slide=a;Splash._setImg();return false},prevSlide:function(){Splash.cur_slide--;Splash._setImg();return false},attachLastPlurks:function(b){var a=$bytc("img","pc_img");map(a,function(c){onEvent(c,"mouseout",AmiTooltip.hide);onEvent(c,"mouseover",$p(b?b:Splash._showLatestRandomPlurk,c.id))})},_showLatestRandomPlurk:function(b,a){Splash._showLatestUserPlurk($(b),RANDOM_USERS[b],a)},_showLatestUserPlurk:function(e,c,h){var f;var a=evalTxt(c.last_plurk);var b=SPAN();if(a){var i=Qualifiers.format(c,a.qualifier,a.content);var d=$gc(i[0],"span","qualifier");ACN(b,d);ACN(b,setHTML(SPAN(),a.content));Media.attach(b,a.id);b.obj=a;b.div_cnt=b}var g=DIV({c:"tool_extra_info"});ACN(g,Utils.getYears(c.date_of_birth));ACN(g,Splash._getGender(c,false));if(c.location){ACN(g,BR(),format(_("from %s"),c.location)," ")}f=DIV({c:"tooltip_cnt"},B(c.nick_name),b,g);AmiTooltip.show(e,f,h)},_getGender:function(a,b){if(a.gender==2){return"-"}return a.gender==1&&(b&&"m"||_("male"))||(b&&"f"||_("female"))},renderForm:function(){var a=$bytc("form","register_form")[0];a.method="post";a.action="/Users/registerUser";onEvent(a,"submit",$p(Register.validForm,a,null));ACN(a,TABLE(TBODY(TR(TH("Nickname:"),setHTML(TD(),'<input style="width: 200px;" name="nick_name" id="input_nick_name" onblur="Register.checkNickname()" value="" type="text"> <div class="nick-check"><span class="help"> http://plurk.com/<span id="nick_name_span"></span></span> <span class="user_error" id="is_name_valid"></span></div>')),TR(TH("First name:"),setHTML(TD(),'<input style="width: 200px;" name="first_name" value="" type="text">')),TR(TH("Last name:"),setHTML(TD(),'<input style="width: 200px;" name="last_name" value="" type="text">')),TR(TH("Email:"),setHTML(TD(),'<input style="width: 200px;" name="email" id="input_email" onblur="Register.checkEmail()" value="" type="text"> <span id="is_email_valid"></span>')),TR(TH("Password:"),setHTML(TD(),'<input style="width: 200px;" name="password" type="password">')),TR({s:"height: 25px"},TH("Password:"),setHTML(TD(),'<div style="margin-left: -160px; margin-top: 10px;"><input style="margin: 0;" type="radio" name="gender" value="1" /> Male &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input style="margin: 0;" type="radio" name="gender" value="0" checked="checked" /> Female</div>')),TR(TH(),setHTML(TD({c:"terms"}),'<input class="nonclassic" name="accept" type="checkbox"> I have read and agree to the <a href="/terms" target="_blank">Terms of Use</a> and <a href="/privacy" target="_blank">Privacy Policy</a>.')),TR(TH(),setHTML(TD({c:"submit_splash"}),'<input class="nonclassic" id="register_submit" src="/static/splash/splash-signup.gif" name="submit" type="image">')))))},init:function(a){Plurks.visit_timeline=false;TimeLine.init($("content"));TimeLine.showLoading();Plurks.init();Emoticons.init();KeyManager.init();InfoOverlay.init();Tracks.init();TimeLine.excludeUser=function(b){return false};TimeLine.getPlurks=function(e){var c=TimeLine;if(c.getting_plurks||c.offset==null){return false}c.getting_plurks=true;TimeLine.removeEmpty();if(c.plurks.length>0){c.showLoadingBlock()}var b=loadJSON("/TimeLine/getGlobalPlurks");if(c.plurks.length>0){b.addCallback(c.removeLoadingBlock)}b.addCallback(function(f){return TimeLine._plurksFetched(f,e)});var d=FILTER?FILTER:{};if(c.offset){d.offset=serializeJSON(c.offset)}b.sendReq(d)};TimeLine.getPlurks();$("dashboard_holder").style.display="block";if(!a){Splash.attachLastPlurks()}}};Media={big_size:false,max_width:48,max_height:40,showThumb:function(e,b,h,d){preventDefault(d);GB_showImage("",e);var g=getLast(GB_CURRENT);var a=b;if(a.length>40){a=a.substring(0,40)+"..."}var f=null;if(hasClass(h,"comic")){f=DIV({s:"padding-top: 3px;"},_("more comics at")," ",A({href:"/plurkcomics"},"plurkcomics"))}var c=DIV({c:"direct-l"},"URL: ",A({href:b,target:"_blank"},a),f);insertAfter(c,g.iframe);if(window.Plurks){Plurks.noExapndOnAction()}return false},attach:function(b,a){setTimeout(function(){map($bytc("a","youtube",b),Media._attachVideo);map($bytc("a","vimeo",b),Media._attachVideo);map($bytc("a","yahoo",b),Media._attachVideo);map($bytc("a","facebook",b),Media._attachVideo);map($bytc("a","oembed",b),Media._attachOEmbed);map($bytc("a","gmap",b),Media._attachGMap);map($bytc("a","pictureservices",b),function(c){Media._attachPictures(c)});map($bytc("a","plurkalbum",b),Media._attachAlbum);map($bytc("a","ex_link",b),Media._attachExternal)},1)},_attachExternal:function(d){var c=window.location.host;c=c.replace(/www\./,"");var b=d.href.replace(/www\./,"");if(b.indexOf("http://"+c)==-1){d.target="_blank"}if(window.SiteState){if(b.indexOf(c+"/")!=-1){var e=b.match(/[^\/]\/([A-Za-z0-9_]{3,})/i);if(e){var a=SiteState.getUserByNick(e[1]);if(a&&a.display_name){setHTML(d,a.display_name)}}}}if(!$gc(d,"img")){if(d.innerHTML.match(/\s/)==null&&d.innerHTML.length>30){d.innerHTML=d.innerHTML.substring(0,35)+"..."}}if(!hasClass(d,"pictureservices")&&!hasClass(d,"youtube")){if(window.Plurks){AEV(d,"click",Plurks.noExapndOnAction)}}Media._attachPaste(d);if(d.innerHTML.indexOf("::Plurk Frontpage Promotion::")!=-1){addClass(d,"plurk_top_link");d.target="_blank";RCN(d,SPAN(_("Promoted this plurk to Plurk Frontpage")))}},_attachAlbum:function(d){var a=d.href.replace("http://www.plurk.com/","/");var b=a.split("/");var c=parseInt(b[6]);if(c>1&&!AJS.$bytc("span","photo_count",d).length){ACN(d,SPAN({c:"photo_count"},c))}d.onclick=function(e){preventDefault(e||event);if(window.Plurks){Plurks.noExapndOnAction()}return GB_showCenter("&nbsp;",a,700,985)}},_attachPaste:function(b){var a=b.href.match(/^(http:\/\/)?paste.plurk.com\/show\/(.+)/);if(!a){return}onEvent(b,"click",function(c){if(window.Plurks){Plurks.noExapndOnAction()}return GB_showCenter("Plurk paste",b.href,500,650)})},_attachOEmbed:function(l){var i={slideshare:{regex:/slideshare.net/,url:"http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=%s",pattern:[]},scribd:{regex:/scribd.com\/doc\/(\d+)/,url:"http://www.scribd.com/embeds/%s/content?start_page=1",pattern:[1]},vimeo:{regex:/vimeo.com\/(\d+)/,url:"http://player.vimeo.com/video/%s",pattern:[1]},instagram:{regex:/instagr.am\/p/,url:"",pattern:[]},yfrog:{regex:/yfrog.com/,url:"",pattern:[]},xfuture:{regex:/xfuture.org\/contract_groups/,url:"",pattern:[]},xuite:{regex:/vlog.xuite.net\/play\/([^&]+)/,url:"",pattern:[]},mlb:{regex:/mlb.com\/video\/play.jsp\?.*content_id=([^&]+)/,url:"",pattern:[]}};var d=$gc(l,"img"),e;if(!d){return false}addClass(l,"oembed");var m=d.alt;Media._attachBigSize(d);for(var k in i){var g=l.href.match(i[k].regex);if(!g){continue}if(k=="vimeo"||k=="xuite"||k=="mlb"){ACN(l,IMG({c:"media_play_icon",src:"http://statics.plurk.com/003e5e225479d6b82e8ffb93c26b6a01.png"}))}var h=i[k].url;map(i[k].pattern,function(o){h=h.replace(/%s/,g[o])});if(h==""&&k=="instagram"){h=d.src.replace("_5.jpg","_7.jpg");e=Media._generateFlashHolder('<div align="center"><img src="'+h+'" height="450px"/></div>',l.href);break}if(k=="yfrog"){h=d.src;if(d.alt.indexOf("embed")>-1){e=Media._generateFlashHolder('<iframe src="'+d.alt+'" data-auto-height="true" scrolling="yes" width="640" height="368" frameborder="0"></iframe>',l.href)}else{e=Media._generateFlashHolder('<div align="center"><img src="'+h+'" width="640" /></div>',l.href)}break}if(k=="mlb"){var f=g[1];var c='<object width="640" height="385"><param name="movie" value="http://mlb.mlb.com/shared/flash/video/share/ObjectEmbedFrame.swf?content_id='+f+'&topic_id=&width=640&height=385&property=mlb" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="scale" value="noscale" /><param name="salign" value="tl" /><embed src="http://mlb.mlb.com/shared/flash/video/share/ObjectEmbedFrame.swf?content_id='+f+'&topic_id=&width=640&height=385&property=mlb" type="application/x-shockwave-flash" allowscriptaccess="never"  allowfullscreen="true"  width="640" height="385" scale="noscale" salign ="tl" /></object>';e=Media._generateFlashHolder(c,l.href);break}var n=l.href.match(/vlog.xuite.net\/play\/([\w-]+)/);if(n){var g=Base64.decode(n[1]).match(/\w+-(\d+)\./);if(g){var a="http://vlog.xuite.net/_v001/"+Base64.encode(g[1])+"&ar=0&as=0&volume=50";var c='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="385" style="z-index: 50000; border:0; padding: 0;" id="video_holder_obj"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="'+a+'"></param><embed src="'+a+'" type="application/x-shockwave-flash" width="640" height="385" autostart="true" allowScriptAccess="always" id="video_holder" allowfullscreen="true"></embed></object>';e=Media._generateFlashHolder(c,l.href);break}}var j=d.src.match(/cdn.slidesharecdn.com\/([^&]+)-thumbnail/);if(j){h=h.replace(/%s/,j[1])}var b=l.href.match(/xfuture.org\/contract_groups\/([\w-]+)/);if(b){h="http://xfuture.org/Content/FusionCharts/CandleStick.swf?debugMode=0&chartWidth=785&chartHeight=400&DOMId=ChartId&registerWithJS=0&scaleMode=noScale&lang=EN&dataURL=http://xfuture.org/ContractGroups/ChartDataXml/"+b[1]+"?ctype=lifetime&amp;Scheme=http"}e=Media._generateFlashHolder('<iframe src="'+h+'" data-auto-height="true" scrolling="yes" width="640" height="368" frameborder="0"></iframe>',l.href)}onEvent(l,"click",function(p){preventDefault(p||event);Media._showGreyBox(m,l.href,"",345,665);var o=$gc($bytc("div","iframe_holder")[0],"div");setHTML(o,e);return false});if(m!=""){AEV(l,"mouseover",$p(AmiTooltip.show,l.firstChild,DIV({c:"tooltip_cnt"},m)));AEV(l,"mouseout",AmiTooltip.hide)}},_attachVideo:function(f){var a={vimeo:{regex:/vimeo.com\/(\d+)/,url:"http://player.vimeo.com/video/%s",pattern:[1]},yahoo:{regex:/video.yahoo.com\/watch\/([^&]+)\/([^&]+)/,url:"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?vid=%s&id=%s",pattern:[1,2]},facebook:{regex:/facebook.com\/(video\/video.php\?v=|v\/)([^&]+)/,url:"http://www.facebook.com/v/%s",pattern:[2]}};var c=$gc(f,"img"),i;if(!c){return false}addClass(f,"video");ACN(f,IMG({c:"media_play_icon",src:"http://statics.plurk.com/003e5e225479d6b82e8ffb93c26b6a01.png"}));var g=c.alt;if(g.length>45){g=g.substr(0,45)+"..."}Media._attachBigSize(c);var b=f.className.indexOf("youtube")>0;if(b){i=Media._generateYoutubeHolder(f.href,true)}else{for(var d in a){var e=f.href.match(a[d].regex);if(!e){continue}var h=a[d].url;map(a[d].pattern,function(j){h=h.replace(/%s/,e[j])});i=Media._generateFlashHolder('<iframe src="'+h+'" data-auto-height="true" scrolling="no" width="640" height="368" frameborder="0"></iframe>',f.href)}}onEvent(f,"click",function(k){preventDefault(k||event);Media._showGreyBox(g,f.href,"",345,665);var j=$gc($bytc("div","iframe_holder")[0],"div");setHTML(j,i);if(b&&f.href.indexOf("#music")!=-1){YouTubeControl.activate();YouTubeControl.showIndicator()}return false})},_attachBigSize:function(a){if(a.width&&a.height){if(window.SiteState&&!SiteState.canEdit()||Media.big_size&&!a.big_size){a.width+=a.width*0.35;a.height+=a.height*0.35;a.big_size=true}}},_generateYoutubeHolder:function(d,g){var b=d.match("v=([A-Za-z0-9-_]+)");if(b==null){b=d.match("youtu.be/([A-Za-z0-9-_]+)")}if(b==null){return}var c=b[1];var a="";var f=d.match(/#t=((\d+)h)?((\d+)m)?((\d+)s)?/i);if(f){a+=f[0]}var e='<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/'+c+"?autoplay=1&playerapiid=ytplayer&enablejsapi=1&color1=0xffffff&color2=0xffffff&border=0&fs=1&rel=0"+a+'" frameborder="0"></iframe>';return Media._generateFlashHolder(e,d,g)},_generateFlashHolder:function(a,d,e){var c=['<div class="video_holder" style="padding: 5px 10px 0 0;">'];var b="";if(e){b='<div class="hide_window"><a href="#" onclick="setTimeout(YouTubeControl.activate, 100); return false;">'+_("Hide video and play in background")+"</a></div>"}c.push('<div class="object_holder" style="margin-left: 10px;">'+a+"</div>"+b+'<div class="direct-l yt">'+_("Direct link")+': <a href="'+d+'" target="_blank">'+d+"</a></div>");return c.join("")},_showGreyBox:function(e,c,b,a,d){if(YouTubeControl.isShown()){YouTubeControl.stop()}if(window.Plurks){Plurks.noExapndOnAction()}return GB_showHTML(e,b,a,d)},_attachGMap:function(a){var c=$gc(a,"img");if(!c){return false}var b=c.alt;onEvent(a,"click",function(f){preventDefault(f||event);Media._showGreyBox(b,a.href,"",345,665);var e=$gc($bytc("div","iframe_holder")[0],"div");if(a.href.indexOf("layer=c")!=-1){output="svembed"}else{output="embed"}var d='<div class="gmap_holder" style="padding: 5px 10px 0 0;"><div class="object_holder" style="margin-left: 10px;"><iframe width="640" height="385" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+a+"&amp;output="+output+'"></iframe></div><div class="direct-l yt">'+_("Direct link")+': <a href="'+a+'" target="_blank">'+a+"</a></div>";setHTML(e,d);return false})},_attachFlickr:function(b){var a=$gc(b,"img");if(a){onEvent(b,"click",$p(Media.showThumb,a.alt,b.href,b))}},_attachPlurk:function(b){var a=$gc(b,"img");if(a){onEvent(a,"load",$p(Media._attachBigSize,a));onEvent(b,"click",$p(Media.showThumb,a.alt,b.href,b))}},_attachPictures:function(c){var b=$gc(c,"img");var a=c.href;if(b){b.style.maxWidth=Media.max_width+"px"}if(a.indexOf("flickr.com/photos/")!=-1||a.indexOf("flic.kr/p/")!=-1){return Media._attachFlickr(c)}else{if(a.indexOf("23hq.com/")!=-1&&a.indexOf("/photo/")!=-1){return Media._attachFlickr(c)}else{if(b&&b.src.indexOf("images.plurk.com")!=-1){return Media._attachPlurk(c)}else{if(a.indexOf("photobucket.com/albums/")!=-1){return Media._genericImageLoad(GenericImages.photoBucket,c)}else{if(a.indexOf("tinypic.com/")!=-1){return Media._genericImageLoad(GenericImages.tinyPic,c)}else{if(a.indexOf("imageshack.us/img")!=-1){return Media._genericImageLoad(GenericImages.imageShack,c)}else{if(a.indexOf("imgur.com")!=-1){return Media._genericImageLoad(GenericImages.imgGur,c)}else{if(a.indexOf("statics.plurk.com")!=-1){c.href="http://statics.plurk.com/261c0fe4a88417146ae0292d697a5f52.gif"}return Media._genericImageLoad(GenericImages.justImage,c)}}}}}}}return false},_genericImageLoad:function(c,b){var d=b.href.match(/[^\/]+?\.(jpg|jpeg|gif|png)/i);if(d){d=d[0];var a=GenericImages.loadImage(b.href,d,c,b);setHTML(b,a);onEvent(b,"click",$p(Media.showThumb,b.href,b.href,b))}return false}};GenericImages={loaded_images:{},big_images:{},replaceDivs:function(a,f){GenericImages.loaded_images[a.src]=true;if(a.width<50&&a.height<50){GenericImages.big_images[a.src]=false}var d=GenericImages.getImgClass(a.src);var b;try{b=$bytc("div",d)[0].parentNode}catch(g){}var c=GenericImages.getImagePreview(a.src,b);map($bytc("div",d),function(e){setHTML(e.parentNode,c)});if(f){setTimeout($p(GenericImages.replaceDivs,a,false),200)}},img_ids:{},img_counter:1,getImgClass:function(a){var b=GenericImages.img_ids[a];if(!b){b=GenericImages.img_ids[a]=GenericImages.img_counter++}return"big_image_"+b},loaded:function(a){if(window.TimeLine&&TimeLine.big_media_hidden&&hasClass(a,"big_image")){addClass(a.parentNode,"big_image_border")}},getImagePreview:function(f,d){var a=Media.max_width,e=Media.max_height;if(hasClass(d,"bigimg")){a=96;e=80}var b="max-height: "+e+"px; max-width: "+a+"px;";if(isIe()&&!isIe8()){b="width: expression(this.width > "+a+" ? "+a+": true); height: expression(this.height > "+e+" ? "+e+": true);"}var c="";if(GenericImages.big_images[f]){if(window.TimeLine&&TimeLine.big_media_hidden){b+="visibility:hidden;"}c="big_image"}return'<img src="'+f+'" style="'+b+'" class="'+c+'" onload="GenericImages.loaded(this)" />'},getImageThumb:function(b,e,d){if(b==e&&!GenericImages.loaded_images[e]){if(!GenericImages.big_images[e]){var a=new Image();a.onload=$p(GenericImages.replaceDivs,a,true);a.src=e;GenericImages.big_images[e]=true}var c=GenericImages.getImgClass(e);return'<div class="'+c+'"><img src="http://statics.plurk.com/7f5c4282d2e9accfdae99cc6abb6c9bb.gif" /></div>'}else{return GenericImages.getImagePreview(e,d)}},photoBucket:function(c,a){var b=a.replace(c,"th_"+c);return b},tinyPic:function(c,a){var b=c.split(".");return a.replace(c,b[0]+"_th."+b[1])},imageShack:function(c,a){if(c.indexOf(".gif")!=-1){return a}var b=c.split(".");b.splice(1,0,"th");return a.replace(c,b.join("."))},imgGur:function(c,a){var b=c.split(".");if(b[0].indexOf("s")!=b[0].length-1){b[0]+="s"}return a.replace(c,b.join("."))},justImage:function(b,a){return a},loadImage:function(b,f,e,c){var a=b;var d=e(f,b);return GenericImages.getImageThumb(a,d,c)}};YouTubeControl={inited:false,div_player:null,indicator:null,title:"",flash_player:null,initIfNeeded:function(){if(this.inited){return}var b,a;ACN(getBody(),DIV({id:"music_player"},this.indicator=SPAN({s:"margin-right: 5px;"}),this.title=SPAN(),a=A({href:"#",s:"margin: 0 8px 0 8px"},_("Stop")),b=A({href:"#"},_("Show video"))));AEV(a,"click",$b(YouTubeControl.stop,this));AEV(b,"click",$b(YouTubeControl.deactivate,this));this.inited=true},isShown:function(){var a=$("music_player");if(!a){return false}return a.style.display!="none"},activate:function(){map($bytc("div","GB_window"),function(b){YouTubeControl.left_pos=b.style.left;b.style.left="-1500px";setVisibility(b,false)});map($bytc("div","GB_overlay"),function(b){hideElement(b)});setVisibility(getYCPlayer(),false);var a=$bytc("td","caption")[0].innerHTML;if(a.length>30){a=a.substr(0,30)+"..."}YouTubeControl.initIfNeeded();setHTML(YouTubeControl.title,a);showElement($("music_player"));window.scroll(0,0);return false},deactivate:function(){map($bytc("div","GB_overlay"),function(a){showElement(a)});map($bytc("div","GB_window"),function(a){a.style.left=YouTubeControl.left_pos;setVisibility(a,true)});setVisibility(getYCPlayer(),true);hideElement($("music_player"));return false},stop:function(){hideElement($("music_player"));GB_hide();return false},showIndicator:function(){RCN(YouTubeControl.indicator,IMG({src:"http://statics.plurk.com/7f5c4282d2e9accfdae99cc6abb6c9bb.gif"}))},hideIndicator:function(){if(YouTubeControl.indicator){RCN(YouTubeControl.indicator,null)}}};function getYCPlayer(){if(isIe()){return $("youtube_holder_obj")}else{return $("youtube_holder")}}function youtubeChecker(){var a=getYCPlayer();if(!a){return clearTimeout(YOUTUBE_CHECKER)}if(!a.getPlayerState){return}var b=a.getPlayerState();if(b==1){YouTubeControl.hideIndicator()}else{if(b==0){YouTubeControl.stop()}}}var YOUTUBE_CHECKER=null;function onYouTubePlayerReady(a){YOUTUBE_CHECKER=setInterval(youtubeChecker,500)}var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="";var k,h,f,j,g,e,d;var b=0;c=Base64._utf8_encode(c);while(b<c.length){k=c.charCodeAt(b++);h=c.charCodeAt(b++);f=c.charCodeAt(b++);j=k>>2;g=((k&3)<<4)|(h>>4);e=((h&15)<<2)|(f>>6);d=f&63;if(isNaN(h)){e=d=64}else{if(isNaN(f)){d=64}}a=a+this._keyStr.charAt(j)+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(d)}return a},decode:function(c){var a="";var k,h,f;var j,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b<c.length){j=this._keyStr.indexOf(c.charAt(b++));g=this._keyStr.indexOf(c.charAt(b++));e=this._keyStr.indexOf(c.charAt(b++));d=this._keyStr.indexOf(c.charAt(b++));k=(j<<2)|(g>>4);h=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a=a+String.fromCharCode(k);if(e!=64){a=a+String.fromCharCode(h)}if(d!=64){a=a+String.fromCharCode(f)}}a=Base64._utf8_decode(a);return a},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};AlbumViewer={init:function(b,c){this.holder=b;this.photos=c;var a=DIV({id:"paging"});ACN(b,a);this.picture_holder=DIV({id:"picture_holder"});ACN(b,this.picture_holder);new Paging({ul:a,page_count:1,item_count:c.length,renderLi:function(){return null},renderPageDisplay:this.renderPageDisplay,get:this.getItem,holders:[a]})},getItem:function(d,e){var b=AlbumViewer;var c=b.photos[d];var a=IMG({src:"http://images.plurk.com/"+c});a.onload=function(){updateHeight()};RCN(b.picture_holder,a);updateHeight(600)},renderPageDisplay:function(d){var b=AlbumViewer;var c=b.photos[d-1];var e="http://images.plurk.com/tn_"+c.split(".")[0]+".gif";var a=IMG({src:e,style:"max-width: 30px; max-height: 30px;"});return a}};Emoticons={basic:[[/(?:(\s+|^)):-?\)\)/,"http://statics.plurk.com/ff124032f8cc3a9d43b99e661f8fcb4d.gif",":-))"],[/(?:(\s+|^)):-?\)/,"http://statics.plurk.com/99ef3957ef779718546752b749bdeabd.gif",":-)"],[/(?:(\s+|^)):-?D/i,"http://statics.plurk.com/3385896779bf1c13188bf92ca516878e.gif",":-D"],[/(LOL)/,"http://statics.plurk.com/615f18f7ea8abc608c4c20eaa667883b.gif","(LOL)"],[/:-?P/i,"http://statics.plurk.com/2d5e21929e752498e36d74096b1965e1.gif",":-P"],[/\(woot\)/i,"http://statics.plurk.com/13b15aa49358be8f47b58552401d7725.gif","(woot)"],[/;-?\)/i,"http://statics.plurk.com/57c69f50e40a283dcd2e7b56fc191abe.gif",";-)"],[/:-?o/i,"http://statics.plurk.com/8eb05ca7a32301ba16c9496bcad893c4.gif",":-o"],[/X-?\(/,"http://statics.plurk.com/261c0fe4a88417146ae0292d697a5f52.gif","X-("],[/:-?\(/,"http://statics.plurk.com/11eed61b41a3e935773476ac33bc00d9.gif",":-("],[/:'-?\(/,"http://statics.plurk.com/72ddf2c585fe77dd0be731b19624d8cb.gif",":'-("],[/:-?&amp;/,"http://statics.plurk.com/2884b8d0e496c06136c86e9c9599edae.gif",":-&"]],silver:[[/(?:(\s+|^))\(K\)/,"http://statics.plurk.com/9454d15bcaf411b159dcc147ebc3f0eb.gif","(K)"],["(angry)","http://statics.plurk.com/a5ae31c4185bc60cd006650dc10f8147.gif","(angry)"],["(annoyed)","http://statics.plurk.com/35b16fc25623670e41c2be6bf8ac38c7.gif","(annoyed)"],[/\(bye\)|\(wave\)/,"http://statics.plurk.com/4afd784c0df9f7a3ceacb92beca543f6.gif","(wave)"],[/(?:(\s+|^))B-?\)/,"http://statics.plurk.com/c1c9870cf653fa3cd103d2eb0f519ccb.gif","B-)"],["(cozy)","http://statics.plurk.com/d1a6f08507b126ec6a215e6a2372e8bb.gif","(cozy)"],["(sick)","http://statics.plurk.com/5495d64ccb898ca596b061168fa0374a.gif","(sick)"],["(:","http://statics.plurk.com/b82e3225c92a764d225429a6487d9f04.gif","(:"],["(goodluck)","http://statics.plurk.com/65271ac2126706bc09d31ff67c525d67.gif","(goodluck)"],["(griltongue)","http://statics.plurk.com/a709dab8ddd26bd222466d31bd549579.png","(griltongue)"],[/(mmm)/,"http://statics.plurk.com/e3baa9d0d78c35e955a6b07c39f530fa.gif","(mmm)"],["(hungry)","http://statics.plurk.com/0f96595ed7733393b93a3d67aa4f2f4f.gif","(hungry)"],["(music)","http://statics.plurk.com/919b87048fdf7bd59dae457f4284b20b.gif","(music)"],["(tears)","http://statics.plurk.com/96872d481bbfe87aad5aed976c7de4ee.gif","(tears)"],["(tongue)","http://statics.plurk.com/56336bb821c4766001816639e55e5811.gif","(tongue)"],["(unsure)","http://statics.plurk.com/6cb1dc388b9259565efedef8f336d27d.gif","(unsure)"],["(highfive)","http://statics.plurk.com/a9560787e93f4f8890e4bd38696ba537.gif","(highfive)"],["(dance)","http://statics.plurk.com/a55bdb344892676b0fea545354654a49.gif","(dance)"],["(blush)","http://statics.plurk.com/9939dd585cf0e8d39e7912a98a9ce727.gif","(blush)"]],gold:[["(doh)","http://statics.plurk.com/e8ed6c7eed76d2acd9dbf469f29fbec2.gif","(doh)"],["(brokenheart)","http://statics.plurk.com/2b3593aea68efa7a00b4ef2850f98b8a.gif","(brokenheart)"],["(drinking)","http://statics.plurk.com/ed3620ff28a02e3dc9ac4ffa8e6ae2e6.gif","(drinking)"],["(girlkiss)","http://statics.plurk.com/08a43d50691a1ed22706fc92f568fa07.gif","(girlkiss)"],["(rofl)","http://statics.plurk.com/8600839dc03e6275b53fd03a0eba09cf.gif","(rofl)"],["(money)","http://statics.plurk.com/e6bb16b6ef386c5f23900b103dbdba31.gif","(money)"],["(rock)","http://statics.plurk.com/1c890273544559b17f090d09238fa763.gif","(rock)"],["(nottalking)","http://statics.plurk.com/f053074bcce500fbd1e2327d49748a6d.gif","(nottalking)"],["(party)","http://statics.plurk.com/1f44d3984a094fceae1f1a016a730fc9.gif","(party)"],["(sleeping)","http://statics.plurk.com/2f7c90ce56fb4a70e34c04d8d7692dd0.gif","(sleeping)"],["(thinking)","http://statics.plurk.com/900f3dd0adaad9142d567caf6bfb1311.gif","(thinking)"],["(bringit)","http://statics.plurk.com/95ace5ba1097301b5206a9e0fb431624.gif","(bringit)"],["(worship)","http://statics.plurk.com/95e69aa508d4bb435706b9db0a610dad.gif","(worship)"],["(applause)","http://statics.plurk.com/a08ed27ec14b48d4703f53f7eb94834b.gif","(applause)"],[/8-?\)/,"http://statics.plurk.com/85ef5fa01a6a67a525429f8bf4279fe7.gif","8-)"],[/(gym)/,"http://statics.plurk.com/986ecf2b1ae69072e0195b0a58545900.gif","(gym)"],[/(heart)/,"http://statics.plurk.com/150e3f367a063d3baf9720719d78d778.gif","(heart)"],[/(devil)/,"http://statics.plurk.com/3fabe74e992888be701de2a9d80c180a.gif","(devil)"],[/(lmao)/,"http://statics.plurk.com/92b595a573d25dd5e39a57b5d56d4d03.gif","(lmao)"]],platinum:[["(bigeyes)","http://statics.plurk.com/8073c1716e75d32eb79f97a9f521fa01.gif","(bigeyes)"],["(funkydance)","http://statics.plurk.com/373cd2f23dab7528d4875170d13d64f7.gif","(funkydance)"],["(idiot)","http://statics.plurk.com/8863234ebea13f109c9b15ba19a4531c.gif","(idiot)"],["(lonely)","http://statics.plurk.com/8738c7a1c402f41b5319abe504ce9687.gif","(lonely)"],["(scenic)","http://statics.plurk.com/db4c4a7d141fdcaca4d4b11f8fb360db.gif","(scenic)"],["(hassle)","http://statics.plurk.com/ced6d40bebe2d424b59322b311fc04bb.gif","(hassle)"],["(panic)","http://statics.plurk.com/b62d1e55e8311af5bc7526c595ac1dbb.gif","(panic)"],["(okok)","http://statics.plurk.com/9b6f4864c822e1a97c98507c2b41a74f.gif","(okok)"],["(yahoo)","http://statics.plurk.com/e49c8ae965452550c98fc7f99741ae0d.gif","(yahoo)"],["(cry)","http://statics.plurk.com/318416eab5a856bddb1e106a21ff557a.gif","(cry)"]],platinum_2:[["(banana_cool)","http://statics.plurk.com/4f01bac8a707e5450307f97065ec0fa7.gif","(banana_cool)"],["(banana_rock)","http://statics.plurk.com/48515125401120316abb97666458d05b.gif","(banana_rock)"],["(evil_grin)","http://statics.plurk.com/aabbc82c2b0dc72bfbce2f82c97a95e8.gif","(evil_grin)"],["(headspin)","http://statics.plurk.com/b0b0596acce9ffc1f2a27548aa642eaf.gif","(headspin)"],["(heart_beat)","http://statics.plurk.com/52991d7ff65a05526454bd1170a0f14c.gif","(heart_beat)"],["(ninja)","http://statics.plurk.com/846277f0a154dc95a08594b7d32a5ccd.gif","(ninja)"],["(haha)","http://statics.plurk.com/843739a95294fd0bf4c958840b46408f.gif","(haha)"],["(evilsmirk)","http://statics.plurk.com/22416dced8b59446db8cd366cc925d09.gif","(evilsmirk)"],["(eyeroll)","http://statics.plurk.com/e3f0f67ca3af62e34f13abf1d036a010.gif","(eyeroll)"]],karma100:[["(muhaha)","http://statics.plurk.com/84f94a47fcaf1df0a5f17a1cfa52fa64.gif","(muhaha)"],[/\(rammi\)|\(taser\)/,"http://statics.plurk.com/44117848701cd748460921cfea5c3781.gif","(taser)"],["(banana_ninja)","http://statics.plurk.com/88f6dda8d290f66a923c1116a2a2b4ab.gif","(banana_ninja)"],["(beer)","http://statics.plurk.com/eeaf87c619a0221ec9fa06413fd2d5dc.gif","(beer)"],["(coffee)","http://statics.plurk.com/48ec47723cb34be3fcbc914e591e69cd.gif","(coffee)"],["(fish_hit)","http://statics.plurk.com/259a728a690204148037fbee7e2ca2d3.gif","(fish_hit)"],["(muscle)","http://statics.plurk.com/4383af0e055bce112176c5104deeaadf.gif","(muscle)"],["(smileydance)","http://statics.plurk.com/70722ab5756c3b89c86d85feab91725d.gif","(smileydance)"],["(morning)","http://statics.plurk.com/91cf07e3aa16738943fa1147940b48ea.gif","(morning)"]],all_paths:{},isEmoticon:function(c){var b=Emoticons.all_paths;if(!Emoticons.inited_paths){var a=Emoticons.generateEmoticons("all",{karma:100,recruited:50});map(a,function(d){b[d[1]]=true});Emoticons.inited_paths=true}return b[c]},is_inited:false,init:function(){},_init:function(){if(this.is_inited){return false}var h=DIV({id:"emoticon_selecter"},DIV({"class":"upper_arrow"}));var f,b,a,g,d;var e;ACN(h,DIV({id:"emoticons_tabs"},e=A({href:"#","class":"bn_close"}),g=UL(f=LI({id:"emo_basic",c:"emoticon_selecter"},A({href:"#"},_("Basic set"))),b=LI({c:"emoticon_selecter"},A({href:"#"},_("Extra set"))))));AEV(e,"click",function(){Emoticons.forceHide();return false});var c=Emoticons.selectEmoTab;AEV(f,"click",$p(c,f,"basic"));AEV(b,"click",$p(c,b,"extra"));ACN(g,a=LI({id:"emo_my",c:"emoticon_selecter"},A({href:"#"},_("My Emoticons"))));AEV(a,"click",$p(c,a,"my_emoticons"));if(SiteState.getSessionUser()&&SiteState.getSessionUser().karma>=100){ACN(g,d=LI({c:"emoticon_selecter"},A({href:"#"},_("Karma 100"))));AEV(d,"click",$p(c,d,"karma_100"))}ACN(h,DIV({id:"emoticons_show"}));hideElement(h);ACN(getBody(),h);AEV(document,"click",function(j){var k=getEventElm(j);var i=$gp(k,"div");if(i&&i.id=="emoticons_tabs"||i&&hasClass(i,"manage_btn")||i&&hasClass(i,"GB_overlay")){return true}if(Emoticons.shown&&!hasClass(k,"emoticon_selecter_img_on")){Emoticons.forceHide()}});this.is_inited=true;Emoticons.selectEmoTab($("emo_basic"),"basic")},selectEmoTab:function(c,a,b){if(b){preventDefault(b)}removeClass($bytc("li",null,$("emoticons_tabs")),"current");addClass(c,"current");if(a=="my_emoticons"){EmoticonsMy.showEmoticons()}else{Emoticons.showEmoticons(a)}return false},generateEmoticons:function(d,b){if(!b){b=SiteState.getSessionUser()}var e=b&&b.recruited||0;var c=b&&b.karma||0;var a=[];if(d=="basic"||d=="all"){a=a.concat(Emoticons.basic);if(c>=25){a=a.concat(Emoticons.silver)}}if(d=="extra"||d=="all"){if(e>=10){a=a.concat(Emoticons.platinum)}if(c>=50){a=a.concat(Emoticons.gold)}if(c>=81){a=a.concat(Emoticons.platinum_2)}}if(d=="karma_100"||d=="all"){if(c>=100){a=a.concat(Emoticons.karma100)}}return a},showEmoticons:function(e){var b=SiteState.getSessionUser();var c=b&&b.karma||0;var d=Emoticons.generateEmoticons(e);var g=Emoticons._renderEmoticonHolder(d);var a=null;if(c<50){var f=A({href:"#",c:"red_link"},_("Want extra exclusive emoticons?"));AEV(f,"click",function(){return GB_showCenter(_("Exclusive emoticons"),"/Help/extraSmilies",300,440)});a=DIV({s:"padding: 5px 0 5px 10px"},f)}RCN($("emoticons_show"),DIV(g,a))},_renderEmoticonHolder:function(e){var a,c;var g=TABLE(c=TBODY());for(var d=0;d<e.length;d++){if(d%8==0){ACN(c,a=TR())}var f=e[d];var h=IMG({src:f[1],s:"max-width: 50px; max-height: 50px;"});var b=A({href:"#",c:"a_emoticon"},h);b.emo_type=f[2];AEV(b,"click",$p(Emoticons.select,b));ACN(a,TD(b));if(f.length>3){EmoticonsMy.attachHint(h,f[3])}}return g},select:function(d){var c=d.emo_type;var a=$("input_big_private")?$("input_big_private"):$(Emoticons.cur_input);var b="";if(strip(a.value)!=""){b=" ";if(getLast(a.value)==" "){b=""}}InputUtil.insertAtCursor(a,b+c);PlurkBoxExpand.init(a);return false},forceHide:function(){hideElement($("emoticon_selecter"));Emoticons.shown=false},insertPack:function(a,b){map(a,function(c){b(IMG({src:c[1],c:"emoticon"}))})},shown:false,cur_input:null,toggle:function(d,g){Emoticons._init();Emoticons.cur_input=d;var b=(d=="input_small")?$bytc("div","mini_form")[0]:$("plurk_form");var e=(g)?getEventElm(g):$bytc("div","cmp_emoticon_off",b)[0];var a=$("emoticon_selecter");setVisibility(a,false);showElement(a);var c={w:430,to:300};var f=absolutePosition(e);if(d=="input_small"){f.y=f.y+28;f.x=f.x-8}else{f.y=f.y+37;f.x=f.x-a.offsetWidth+c.w}setStyle(a,{top:f.y,left:f.x});if(Emoticons.shown){hideElement(a)}else{showElement(a)}setVisibility(a,true);Emoticons.shown=!Emoticons.shown;var j=getWindowSize().h;if(a.offsetHeight+f.y>j+getScrollTop()){if(Emoticons.shown){if(d=="input_big"){window.scrollTo(0,c.to)}else{var i=getWindowSize().h;var h=f.y+30+c.to;if((i+getScrollTop())<h){window.scrollTo(0,f.y-300)}}}else{window.scrollTo(0,0)}}}};
