tagged.namespace("util.lightbox");tagged.util.lightbox={maskId:"lbMask",lightboxId:"lbContent",elIDs:["ad_unit_0_div","ad_unit_1_div","ad_unit_2_div","comment_rte"],show:function(d,h){for(var g=0;g<this.elIDs.length;g++){if(D.get(this.elIDs[g])){D.get(this.elIDs[g]).style.visibility="hidden"}}if(!document.getElementById(this.maskId)){var l=document.createElement("div");l.id=this.maskId;l.style.width=parseInt(D.getViewportWidth())+"px";l.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";document.body.appendChild(l)}if(D.get(this.lightboxId)){document.body.removeChild(D.get(this.lightboxId))}else{if(D.get("captcha_div")){document.body.removeChild(D.get("captcha_div"))}}var a=document.createElement("div");a.id=this.lightboxId;var j=this.getScroll();a.style.top=(j+75)+"px";a.style.left=(parseInt(D.getViewportWidth())-500)/2+"px";var k=document.createElement("div");k.innerHTML='<img src="'+TAGGED.static_uri+'/images/loading_grey32.gif"/>';k.id="lbLoader";a.appendChild(k);document.body.appendChild(a);if(d.constructor==String){var c=document.createElement("div");c.innerHTML=d;c.style.visibility="hidden";c.style.position="absolute"}else{var c=d;c.style.visibility="hidden";c.style.position="absolute"}a.appendChild(c);var f=function(){var i=c.offsetWidth+1;var m=c.offsetHeight;if((i>50)||(m>50)){e(c,i,m)}else{setTimeout(f,250)}};var e=function(p,m,v){k.style.display="none";var q=parseInt(D.getStyle(p,"paddingLeft"));var o=parseInt(D.getStyle(p,"paddingRight"));var x=parseInt(D.getStyle(p,"paddingTop"));var n=parseInt(D.getStyle(p,"paddingBottom"));var u=parseInt(D.getViewportWidth());var t=((u-100)-(m+q+o))/2;var i=(v+n);if(YAHOO.util.Anim){var r={left:{to:t},width:{to:m},height:{to:i}};var w=new YAHOO.util.Anim("lbContent",r,0.4);var s=function(){p.style.position="";p.style.visibility="";p.style.display="block";window.setTimeout(function(){tagged.util.domMethods.set_bg_iframe(a)},0);if(h){var y=D.get(h);if(y){y.select()}}};w.onComplete.subscribe(s);w.animate()}else{p.style.left=t+"px";p.style.width=m+"px";p.style.height=v+"px";d.style.position="";d.style.visibility="";d.style.display="block";window.setTimeout(function(){tagged.util.domMethods.set_bg_iframe(a)},0)}};f();var b=new YAHOO.util.KeyListener(document,{keys:27},tagged.util.lightbox.hide);b.enable()},hide:function(){if(!this.maskId){this.maskId="lbMask"}if(!this.lightboxId){this.lightboxId="lbContent"}document.body.removeChild(D.get(this.maskId));document.body.removeChild(D.get(this.lightboxId));for(var a=0;a<this.elIDs.length;a++){if(D.get(this.elIDs[a])){D.get(this.elIDs[a]).style.visibility="visible"}}},getScroll:function(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}return a},setScroll:function(){window.scrollTo(0,this.getScroll())}};tagged.namespace("security.captcha");tagged.security.captcha={trigger:function(a,b){if(a.stat!="security"||!a.result){return}this.callObj=b;this.origCallObj=YAHOO.lang.JSON.stringify(a.result.origCallObj);tagged.util.lightbox.show(a.result.captchaHtml,"captcha_code")},submit:function(b){tagged.util.lightbox.hide();var a={method:"tagged.security.submitCaptcha",captchaData:b,origCallObj:this.origCallObj};if(this.callObj){a.callback=this.callObj.callback}TAGGED.api.call(a)}};tagged.namespace("photos.gallery");tagged.photos.gallery={perPage:20,user_id:tagged.data.userId,album_id:0,thumbDiv:'<a href="/photo_view.html?photoId=%1$s%3$s"><img class="pic" pid="%1$s" src="%2$s" /></a>',saveSpan:'<span pid="%1$s" class="save"><img pid="%1$s" class="submit" act="s" src="'+tagged.static_uri+'/images/check.gif" title="%2$s"  ><img pid="%1$s" class="cancel" act="r" src="'+tagged.static_uri+'/images/x-red.gif" title="%3$s" ></span>',ctrlDivs:'<div pid="%1$s" class="controls buttons"><img pid="%1$s" act="p" src="'+tagged.static_uri+'/images/icons/icon_set_primary_photo.png" alt="%2$s" title="%2$s" class="button make_profile"/><img pid="%1$s" act="d" src="'+tagged.static_uri+'/images/icons/icon_delete_photo.png" alt="%3$s" title="%3$s" class="button delete"/></div><div class="controls background"></div>',adminDivs:'<div pid="%1$s" class="controls buttons"><img pid="%1$s" act="d" src="'+tagged.static_uri+'/images/icons/icon_delete_photo.png" alt="%2$s" title="%2$s" class="button delete"/></div><div class="controls background admin"></div>',dsblDiv:'<div class="disable"></div>',commentCountSpan:'<span class="comments" id="comment_count_%s"></span>',newCommentSpan:'<span class="new">%s</span>',currentPage:0,total:-1,_editing:null,profilePic:null,_cache:[],_rendered:[],_added:[],init:function(){E.addListener("photos","mouseover",this.mouseOverFunct);E.addListener("photos","click",this.clickedFunct);var a=YAHOO.util.History.getBookmarkedState("pageNum")||"1";var b=""+tagged.modules.pagination.sanePageNum(a,this.perPage);this.user_id=tagged.data.userId;YAHOO.util.History.register("pageNum",b,function(c){tagged.photos.gallery.displayPage(c)});YAHOO.util.History.onReady(function(){tagged.photos.gallery.displayPage(b)});YAHOO.util.History.initialize("yui-history-field","yui-history-iframe")},displayPage:function(c){var b=tagged.photos.gallery;c=tagged.modules.pagination.sanePageNum(c,b.perPage,b.total);var a=tagged.modules.pagination.offset(c,b.perPage);var e=D.get("gallery_disable");e.style.height=e.parentNode.offsetHeight+"px";e.style.width=e.parentNode.offsetWidth+"px";D.removeClass(e,"hide_me");if(!b._cache[a]){b.fetchPage(a)}else{b.loadPage(a)}},fetchPage:function(a){TAGGED.api.call({limit:this.perPage,start:a,user_id:this.user_id,size:"t",method:"tagged.photo.get",callback:"tagged.photos.gallery.newPage"})},newPage:function(a){if(tagged.photos.gallery.savePage(a)){tagged.photos.gallery.loadPage(a.album.start)}},savePage:function(b){var a=tagged.photos.gallery;if(b.stat=="ok"){a.user_id=b.album.user_id;if(a.total!=b.album.total){a._cache=[];a._rendered=[]}a.total=b.album.total;a._cache[b.album.start]=b.album.photo;return true}else{a._cache=[];a._rendered=[];D.get("photos").innerHTML=a.strings.error;return false}},loadPage:function(d){var k=D.get("pg_"+d);if(k){k.parentNode.removeChild(k)}var h=document.createElement("div");var g=0;h.className="page hide_me";h.setAttribute("id","pg_"+d);var b=document.createElement("div");b.className="thumbs";for(var e=0;e<this._cache[d].length;e++){var a=this._cache[d][e];var j=document.createElement("div");j.setAttribute("id","photo_"+a.photo_id);j.setAttribute("pid",a.photo_id);j.className="photo";if(a.is_profile){j.className+=" profile";this.profilePic=a.photo_id}var c="";if(this.user_id!=tagged.data.loggedInUserId){c="&uid="+this.user_id}j.innerHTML=sprintf(this.thumbDiv,a.photo_id,a.url,c);j.appendChild(this.makeCaption(a.photo_id,a.name,e));j.innerHTML+=tagged.data.isAdmin&&this.user_id!=tagged.data.loggedInUserId?sprintf(this.adminDivs,a.photo_id,this.strings.deletePhoto):sprintf(this.ctrlDivs,a.photo_id,this.strings.makePrimary,this.strings.deletePhoto);j.innerHTML+=sprintf(this.commentCountSpan,a.photo_id)+this.dsblDiv;b.appendChild(j);g++;this._added.push(a.photo_id)}h.appendChild(b);D.get("photos").appendChild(h);tagged.photos.gallery._rendered[d]=true;this.getCommentCounts(this._added);this._added=[];this.pageLoaded(d);if(this.total>0){var f=sprintf(this.strings.displaying,d+1,d+g,this.total)}else{var f=this.strings.noPhotos}D.get("display_top").innerHTML=f;if(this.total>0){D.get("display_bottom").innerHTML=f}this.pagination(d)},pageLoaded:function(a){D.addClass("loading","hide_me");D.addClass("pg_"+this.currentPage,"hide_me");D.removeClass("pg_"+a,"hide_me");setTimeout("tagged.ads.reload()",1);D.addClass("gallery_disable","hide_me");this.currentPage=a;setTimeout("tagged.photos.gallery.prefetchPage("+(a+this.perPage)+")",10)},pagination:function(a){if(this.total>this.perPage){tagged.modules.pagination.renderDirectionLinks(this.total,this.perPage,a,null,"pagination_top");tagged.modules.pagination.renderDirectionLinks(this.total,this.perPage,a,null,"pagination_bottom")}},makeCaption:function(d,c,a){var f=document.createElement("div");f.className="caption";f.setAttribute("pid",d);var b=document.createElement("form");b.setAttribute("id","form_"+d);b.setAttribute("pid",d);b.setAttribute("onsubmit","tagged.photos.gallery.submitFunct(this); return false;");var e=document.createElement("textarea");e.setAttribute("tabindex",a+1);e.setAttribute("id","pcaption_"+d);e.setAttribute("pid",d);e.className="name";e.innerHTML=c;e.setAttribute("onfocus","tagged.photos.gallery.focusFunct(this)");b.appendChild(e);b.innerHTML+=sprintf(this.saveSpan,d,this.strings.submit,this.strings.undo);f.appendChild(b);return f},getCommentCounts:function(a){TAGGED.api.call({uid:tagged.data.userId,photo_ids:a.join(","),method:"tagged.photo.getCommentCounts",callback:"tagged.photos.gallery.addCommentCounts"})},addCommentCounts:function(d){if(d.stat=="ok"){for(var b=0;b<d.result.length;b++){var a=d.result[b];if(a.count>0){var c=tagged.photos.gallery.strings.comment;if(a.count>1){c=sprintf(tagged.photos.gallery.strings.comments,a.count)}if(a.unviewedCount>0){c+=sprintf(this.newCommentSpan,this.strings.newComment)}D.get("comment_count_"+a.id).innerHTML=c}}}},mouseOverFunct:function(c){if(tagged.photos.gallery.user_id!=tagged.data.loggedInUserId&&!tagged.data.isAdmin){return}var a=E.getTarget(c);var b=a.getAttribute("pid");if(b!=null){tagged.photos.gallery.editing(b)}},clickedFunct:function(d){if(tagged.photos.gallery.user_id!=tagged.data.loggedInUserId&&!tagged.data.isAdmin){return}var b=E.getTarget(d);var c=b.getAttribute("pid");var a=b.getAttribute("act");if(a){E.stopEvent(d)}switch(a){case"p":D.addClass("photo_"+c,"disabled");tagged.photos.setPrimary(c,"tagged.photos.gallery.changePrimary");break;case"d":D.addClass("photo_"+c,"disabled");if(window.confirm(tagged.photos.gallery.strings.deleteConf)){tagged.photos.remove(c,tagged.photos.gallery.user_id,"tagged.photos.gallery.removePhoto")}else{D.removeClass("photo_"+c,"disabled")}break;case"s":tagged.photos.gallery.submitCaption(c);break;case"r":D.get("form_"+c).reset();D.removeClass("photo_"+c,"focused");D.get("pcaption_"+c).blur()}},focusFunct:function(a){if(tagged.photos.gallery.user_id!=tagged.data.loggedInUserId){return}var b=a.getAttribute("pid");D.addClass("photo_"+b,"focused");tagged.photos.gallery.editing(b)},submitFunct:function(a){var b=a.getAttribute("pid");tagged.photos.gallery.submitCaption(b)},submitCaption:function(a){D.addClass("photo_"+a,"disabled");D.get("pcaption_"+a).blur();tagged.photos.setCaption(a,D.get("pcaption_"+a).value,"tagged.photos.gallery.changeCaption")},editing:function(a){if(a&&this._editing!=a){D.removeClass("photo_"+this._editing,"editing");D.addClass("photo_"+a,"editing");this._editing=a}},changePrimary:function(b){if(!b.result.ERROR_FLAG){var a=tagged.photos.gallery;if(a.profilePic!=null){D.removeClass("photo_"+a.profilePic,"profile")}a.profilePic=b.result.id;D.addClass("photo_"+a.profilePic,"profile");D.removeClass("photo_"+a.profilePic,"disabled");a._cache=[];a._rendered=[]}},removePhoto:function(c){if(c.stat=="ok"){var b=tagged.photos.gallery;var a=c.results.id;D.removeClass("photo_"+a,"disabled");D.addClass("photo_"+a,"deleted");b._cache=[];b._rendered=[]}},changeCaption:function(d){if(d.stat=="ok"&&!d.result.ERROR_FLAG){var c=tagged.photos.gallery;c._cache=[];var a=d.result.id;var b=D.get("pcaption_"+a);if(b){b.value=d.result.caption}D.removeClass("photo_"+a,"disabled");D.removeClass("photo_"+a,"focused")}else{if(d&&d.result&&d.result.error_code){alert(this.strings[d.result.error_code]);if(d.result.id){D.removeClass("photo_"+d.result.id,"disabled")}}}},prefetchPage:function(a){if(this._cache[a]){return}if(tagged.modules.pagination.boundsCheck(a,this.total)){TAGGED.api.call({limit:this.perPage,start:a,user_id:this.user_id,size:"t",method:"tagged.photo.get",callback:"tagged.photos.gallery.preloadPage"})}},preloadPage:function(b){if(tagged.photos.gallery.savePage(b)){for(var a=0;a<b.album.photo.length;a++){tagged.photos._preloadQueue.push(b.album.photo[a].url)}tagged.photos.preload()}}};E.onDOMReady(function(){tagged.photos.gallery.init()});tagged.loadStringsDirect({"tagged.modules.pagination.msgs":{first:"&lt;&lt; First",previous:"&lt; Previous",next:"Next &gt;",last:"Last &gt;&gt;",prev:"&lt; Previous"}});tagged.loadStringsDirect({"tagged.strings":{genericError:"Sorry, an error occurred. Please refresh the page and try again :(",locales:{en_US:"English",az_AZ:"Az\u0259rbaycan",ms_MY:"Bahasa Melayu",jv_ID:"Basa Jawa",su_ID:"Basa Sunda",my_MM:"Burmese",cs_CZ:"\u010ce\u0161tina",es_CO:"Espa\u00f1ol - Am\u00e9rica Latina",es_ES:"Espa\u00f1ol - Espa\u00f1a",es_MX:"Espa\u00f1ol - M\u00e9xico",el_GR:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",de_DE:"Deutsch",fr_FR:"Fran\u00e7ais",id_ID:"Indonesia",it_IT:"Italiano",hu_HU:"Magyar",nl_NL:"Nederlands",pl_PL:"Polska",pt_PT:"Portugu\u00eas",ru_RU:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",ro_RO:"Rom\u00e2n",tl_PH:"Tagalog",tr_TR:"T\u00fcrk\u00e7e",ur_PK:"Urdu",vi_VN:"Vi\u1ec7t",ar_SA:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",bn_IN:"\u09ac\u09be\u0982\u09b2\u09be",zh_CN:"\u4e2d\u6587 - \u7b80\u5355",zh_TW:"\u4e2d\u6587 - \u50b3\u7d71",hi_IN:"\u0939\u093f\u0928\u094d\u0926\u0940",he_IL:"\u05e2\u05d1\u05e8\u05d9\u05ea",ja_JP:"\u65e5\u672c\u8a9e",ko_KR:"\ud55c\uad6d\uc5b4",mr_IN:"\u092e\u0930\u093e\u0920\u0940",ne_NP:"\u0928\u0947\u092a\u093e\u0932\u0940",fa_IR:"\u0641\u0627\u0631\u0633\u06cc",pa_IN:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40",ta_IN:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te_IN:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",th_TH:"\u0e44\u0e17\u0e22",uk_UA:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ruf_US:"Fake \u0420\u0443\u0441\u0441\u043a\u0438\u0439",ebo_US:"Ebonics",zxx_XX:"XXX XXXX"}}});tagged.loadStringsDirect({"TAGGED.api.strings":{errorMethodMissing:"An error occurred. Please refresh the page and try again. Method is missing.",errorGeneral:"An error occurred. Please refresh the page and try again."}});tagged.loadStringsDirect({"tagged.photos.gallery.strings":{makePrimary:"Make this my Profile Picture",deletePhoto:"Delete this photo",submit:"Save caption",undo:"Undo",deleteConf:"Are you sure you want to delete this photo?",displaying:"Photos %s - %s of %s",noPhotos:"No photos",comment:"1 comment",newComment:"NEW",comments:"%s comments",error:"There was an error. Please reload the page and try again.",banned_caption:"Sorry, that caption contains HTML or banned content.",caption_error:"Sorry, an error occurred while setting the caption.  Please try again."}});tagged.loadStringsDirect({"tagged.header.alerts.strings":{newAlerts:"New Alerts"}});