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("modules.multi_selector");tagged.modules.multi_selector={initSelector:function(d){if(!this.apiCalls_init||!this.apiCalls_newPage||!this.apiCalls_send){alert("Error: API calls have not been set");return}var e={animate:true,selected:[],position:"top",itemsPerPage:18,thumbSize:"m"};this.options=YAHOO.lang.merge(e,d);this.thumbSize=this.options.thumbSize;this.itemsPerPage=this.options.itemsPerPage;this.totalSelected=0;this.selectedIDs=[];this.minListItems=3;this.maxListItems=40;this.itemsPerRow=6;var a=D.get("friend_selector");if(!a){var b=this.options.parentEl;var f=document.createElement("div");f.id="invite_wrapper";D.addClass(f,"loading");if(this.options.position=="top"){b.insertBefore(f,b.firstChild)}else{b.appendChild(f)}window.scrollTo(0,D.getXY(f)[1]);var c=this.apiCalls_init();TAGGED.api.call(c)}else{if(a&&D.hasClass(a,"hide_me")){tagged.groups.group.toggleInvitePanel()}}this.selectedIDs.indexOf=function(h){for(var g=0;g<this.length;g++){if(this[g]==h){return g}}return -1}},insertInvitePanel:function(b){if(b.stat=="ok"&&b.results.content){var c=D.get("invite_wrapper");if(D.hasClass(c,"loading")){var a=Math.ceil(b.results.friendCount/this.itemsPerRow);if(a==1){this.panelHeight=265}else{if(a==2){this.panelHeight=355}else{this.panelHeight=415}}this.toggleInvitePanel();c.innerHTML=b.results.content;D.get("friend_selector_title").innerHTML=this.strings.titleTxt;D.get("friend_selector_clear").innerHTML=this.strings.clearTxt;D.get("friend_selector_close").innerHTML=this.strings.closeTxt;document.forms.selection_overview.submit.value=this.strings.buttonTxt;document.forms.selection_overview.submit.setAttribute("alt_text",this.strings.buttonAltTxt);this.initInvitePanel()}else{c.innerHTML=b.results.content}}},toggleInvitePanel:function(c){if(c){E.preventDefault(c)}var g=D.get("invite_wrapper");window.scrollTo(0,D.getXY(g)[1]);if(D.hasClass(g,"loading")||D.hasClass(g,"hide_me")){D.removeClass(g,"loading");D.removeClass(g,"hide_me");var f=function(){if(D.get("friend_selector")){D.removeClass("friend_selector","hide_me")}};if(this.options.animate==true){var b=new YAHOO.util.Anim(g,{height:{to:this.panelHeight}},0.5,YAHOO.util.Easing.easeOut);b.onComplete.subscribe(f);b.animate()}else{f()}}else{var a=function(){D.addClass(g,"hide_me")};D.addClass("friend_selector","hide_me");if(this.options.animate==true){var d=new YAHOO.util.Anim(g,{height:{to:0}},0.5,YAHOO.util.Easing.easeOut);d.onComplete.subscribe(a);d.animate()}else{a()}}},toggleSelectionScroll:function(){var a=D.get("invite_list");if(this.totalSelected>10){D.addClass(a,"scroll");a.scrollTop=a.scrollHeight}else{D.removeClass(a,"scroll")}},initInvitePanel:function(){E.addListener("friend_selector_close","click",this.toggleInvitePanel,"",this);E.addListener("friend_selector_clear","click",this.clickClearList,"",this);E.addListener(document.forms.selection_overview,"submit",this.sendSelection,"",this);this.initPage();this.inviteList=D.get("invite_list");this.inviteListItems=this.inviteList.getElementsByTagName("li");for(var a=0;a<this.options.selected.length;a++){this.selectItem(this.options.selected[a]);var b=D.get(this.options.selected[a].id);if(b){D.addClass(b,"selected")}}for(var a=0;a<this.minListItems-this.options.selected.length;a++){this.addEmptyItem()}},clickAlphabet:function(c,a){E.preventDefault(c);var b=(a.id=="grid_alphabet_all")?"":a.innerHTML;this.getNewPage(b,"0","0")},clickNav:function(d,a){E.preventDefault(d);var b=D.get("grid_alphabet_selection").value;var c=a.getAttribute("p");var f=this.itemsPerPage*c;this.getNewPage(b,f,c)},getNewPage:function(a,g,e){var c=D.get("friends_grid_fs");if(c){var b=document.createElement("div");b.className="loadingmask";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight+"px";c.appendChild(b)}var f={startsWith:a,offset:g,pageNum:e};var d=this.apiCalls_newPage(f);TAGGED.api.call(d)},insertNewPage:function(a){if(a.stat=="ok"&&a.results.content){var b=D.get("friends_grid_fs");b.innerHTML=a.results.content;this.initPage()}},initPage:function(){var h=D.get("grid_alphabet");var b=D.get("gridnav_top_fs");var a=D.get("gridnav_btm_fs");var d=D.get("friends_grid_fs");if(h){var e=D.get("grid_alphabet").getElementsByTagName("a");for(var c=0;c<e.length;c++){E.addListener(e[c],"click",this.clickAlphabet,e[c],this)}}if(b){var f=b.getElementsByTagName("a");for(var c=0;c<f.length;c++){E.addListener(f[c],"click",this.clickNav,f[c],this)}}if(a){var g=a.getElementsByTagName("a");for(var c=0;c<g.length;c++){E.addListener(g[c],"click",this.clickNav,g[c],this)}}if(d){this.boxes=D.getElementsByClassName("box","div",d);for(var c=0;c<this.boxes.length;c++){YAHOO.lang.augmentObject(this.boxes[c],this.boxBehavior,true);E.addListener(this.boxes[c],"click",this.selectItem,this.boxes[c],this);if(this.selectedIDs.length>0&&this.selectedIDs.indexOf(this.boxes[c].id)!=-1){D.addClass(this.boxes[c],"selected")}}}this.notification=new tagged.util.notificationClass("multi_selector_notification",{container:"selection_overview",position:"bottom"});this.notification.onShow.subscribe(function(){D.addClass(document.forms.selection_overview.submit,"hide_me")});this.notification.onHide.subscribe(function(){D.removeClass(document.forms.selection_overview.submit,"hide_me")})},addEmptyItem:function(){var a=document.createElement("li");a.innerHTML="<div></div><span>&nbsp;</span>";D.addClass(a,"empty");this.inviteList.appendChild(a);this.updateNumbering();YAHOO.lang.augmentObject(a,this.liBehavior,true)},selectItem:function(g,f){if(D.hasClass(f,"selected")){D.removeClass(f,"selected");for(var d=0;d<this.inviteListItems.length;d++){if(this.inviteListItems[d].uid==f.id){this.inviteList.removeChild(this.inviteListItems[d]);this.selectedIDs.splice(this.selectedIDs.indexOf(f.id),1);this.totalSelected--}}if(this.inviteListItems.length<this.minListItems){this.addEmptyItem()}this.updateNumbering();this.toggleSelectionScroll()}else{D.addClass(f,"selected");if(this.totalSelected>=this.maxListItems){var h=sprintf(this.strings.maxSelected,this.maxListItems);TAGGED.util.notification.showNotification(h,"selection_overview","failure","top",5000);D.removeClass(f,"selected")}else{if(!this.inviteListItems[this.totalSelected]){var b=document.createElement("li");this.inviteList.appendChild(b);YAHOO.lang.augmentObject(b,this.liBehavior,true)}if(f){this.inviteListItems[this.totalSelected].title=f.title;this.inviteListItems[this.totalSelected].innerHTML="<div></div><span>"+f.title+"</span>";this.inviteListItems[this.totalSelected].uid=f.id}else{this.inviteListItems[this.totalSelected].title=g.title;this.inviteListItems[this.totalSelected].innerHTML="<div></div><span>"+g.title+"</span>";this.inviteListItems[this.totalSelected].uid=g.id}D.removeClass(this.inviteListItems[this.totalSelected],"empty");for(var d=0;d<this.inviteListItems.length;d++){D.removeClass(this.inviteListItems[d],"hover")}D.addClass(this.inviteListItems[this.totalSelected],"hover");var c=document.createElement("a");c.innerHTML="&nbsp";E.addListener(c,"click",this.removeItem,"",this);E.addListener(c,"mouseover",function(){c.style.backgroundPosition="0 -11px"});E.addListener(c,"mouseout",function(){c.style.backgroundPosition="0 0"});this.inviteListItems[this.totalSelected].appendChild(c);this.totalSelected++;if(f){this.selectedIDs.push(f.id)}else{this.selectedIDs.push(g.id)}this.updateNumbering();this.toggleSelectionScroll();D.removeClass("clear_invites","hide_me")}}},removeItem:function(d){E.preventDefault(d);var c=E.getTarget(d);var a=c.parentNode;this.inviteList.removeChild(a);for(var b=0;b<this.boxes.length;b++){if(this.boxes[b].id==a.uid){D.removeClass(this.boxes[b],"selected")}}this.selectedIDs.splice(this.selectedIDs.indexOf(a.uid),1);this.totalSelected--;if(this.inviteListItems.length<this.minListItems){this.addEmptyItem()}this.updateNumbering();if(this.selectedIDs.length==0){D.addClass("clear_invites","hide_me")}},updateNumbering:function(){for(i=0;i<this.inviteListItems.length;i++){if(this.inviteListItems[i].firstChild.nodeName.toLowerCase()=="div"){this.inviteListItems[i].firstChild.innerHTML=i+1+". "}}var b=D.getElementsByClassName("empty","li","invite_list");var a=document.forms.selection_overview.submit;if(b.length==this.minListItems){a.disabled="disabled";D.addClass(a,"btn_disabled");D.addClass("friend_selector_clear","hide_me")}else{a.disabled="";D.removeClass(a,"btn_disabled");D.removeClass("friend_selector_clear","hide_me")}},clickClearList:function(a){E.preventDefault(a);if(confirm(this.strings.clearSelection)){this.clearSelection()}},clearSelection:function(){this.selectedIDs.splice(0,this.selectedIDs.length);this.totalSelected=0;this.inviteList.innerHTML="";for(var a=0;a<this.minListItems;a++){this.addEmptyItem()}for(var a=0;a<this.boxes.length;a++){D.removeClass(this.boxes[a],"selected")}D.addClass("clear_invites","hide_me");this.updateNumbering();this.toggleSelectionScroll()},sendSelection:function(c,a){E.preventDefault(c);var a=document.forms.selection_overview.submit;a.setAttribute("default_value",a.value);a.value=a.getAttribute("alt_text");D.addClass(a,"btn_disabled");var b=this.apiCalls_send();TAGGED.api.call(b)},invitesSent:function(b){if(b.stat=="ok"){if(b.results.successMessage){TAGGED.util.notification.showNotification(b.results.successMessage,document.forms.selection_overview,"success","top",5000)}else{if(b.results.errorMessage){TAGGED.util.notification.showNotification(b.results.errorMessage,document.forms.selection_overview,"failure","top",5000)}}var a=document.forms.selection_overview.submit;a.value=a.getAttribute("default_value");D.removeClass(a,"btn_disabled");this.clearSelection()}}};tagged.modules.multi_selector.boxBehavior={onmouseover:function(){D.addClass(this,"hover")},onmouseout:function(){D.removeClass(this,"hover")}},tagged.modules.multi_selector.liBehavior={onmouseover:function(){D.addClass(this,"hover")},onmouseout:function(){D.removeClass(this,"hover")}};tagged.namespace("modules.group_selector");tagged.modules.group_selector={init:function(a){YAHOO.lang.augmentObject(tagged.modules.group_selector,tagged.modules.multi_selector);this.initSelector(a);this.minListItems=10;this.maxListItems=10},apiCalls_init:function(){var a={method:"render.groups.user.groupSelector",callback:"tagged.modules.group_selector.insertInvitePanel",tSize:this.thumbSize,offset:0,startsWith:"",numItems:tagged.modules.group_selector.itemsPerPage,pageNum:0,filter:"fs"};return a},apiCalls_newPage:function(c){var a=tagged.modules.group_selector;var b={method:"render.groups.user.groupSelector",callback:"tagged.modules.group_selector.insertNewPage",tSize:a.thumbSize,offset:c.offset,startsWith:c.startsWith,numItems:a.itemsPerPage,pageNum:c.pageNum,gridOnly:true,filter:"fs"};return b},apiCalls_send:function(){var a={method:"tagged.groups.invites.multiGroupInvite",callback:"tagged.modules.group_selector.invitesSent",uId:tagged.data.profile.uid,gIds:"["+tagged.modules.group_selector.selectedIDs+"]"};return a}};tagged.loadStringsDirect({"tagged.modules.group_selector.strings":{titleTxt:"Select Groups",buttonTxt:"Send Invites!",buttonAltTxt:"Sending...",clearTxt:"Clear list",closeTxt:'Done inviting? <a href="#" id="friend_selector_close">Close this box</a>',maxSelected:"You can only select up to %s Groups.",clearSelection:"Are you sure you want to clear this list?"}});tagged.namespace("util.captcha");tagged.util.captcha={successCallback:null,cbArgs:null,cbScope:null,verify:function(b){TUC.successCallback=b;var a={method:"tagged.util.verifyCaptcha",callback:"tagged.util.captcha._processRequest"};TAGGED.api.call(a);return false},submit:function(b){var a={method:"tagged.util.verifyCaptcha",callback:"tagged.util.captcha._processRequest",response:b};TAGGED.api.call(a);return false},_processRequest:function(a){if(a.stat=="ok"&&a.result){if(a.result.captchaPassed){if(D.get("lbContent")){tagged.util.lightbox.hide()}if(TUC.successCallback&&TUC.cbArgs){TUC.successCallback.call(TUC.cbScope?TUC.cbScope:TUC,TUC.cbArgs)}else{if(TUC.successCallback){TUC.successCallback.call(TUC.cbScope?TUC.cbScope:TUC)}}return true}else{if(a.result.captchaHTML){tagged.util.lightbox.show(a.result.captchaHTML,"captcha_code");return true}}}alert("An error has occured. Please refresh the page and try again.");return false}};var TUC=tagged.util.captcha;tagged.namespace("util.stringBuffer");tagged.util.stringBuffer=function(){this.buffer=[]};tagged.util.stringBuffer.prototype={add:function(c){var b=0;var a=arguments.length;for(;b<a;++b){if(typeof(arguments[b])!="undefined"){this.buffer[this.buffer.length]=arguments[b]}}},append:function(a){this.buffer[this.buffer.length]=a},toString:function(){return this.buffer.join("")}};tagged.namespace("util.dateHandler");tagged.util.dateHandler={dateObjects:[],findAndBind:function(b,c){if(b){var d=D.getElementsByClassName("tag_ts","span",b)}else{var d=D.getElementsByClassName("tag_ts","span")}for(var a in d){var e=d[a];if(e._inited){continue}YAHOO.lang.augmentObject(e,this.dateBinderClass,true);e.init(c);this.dateObjects.push(e)}},updateAll:function(){for(var a in this.dateObjects){this.dateObjects[a].update()}},getRelativeDate:function(b,c,e){var f=new Date();if(isNaN(c)){c=31557600}var a=(f.getTime()-b.getTime())/1000;if(c==0){return this.getLocalDate(b)}if(c<0){return this.computeRelative(a)}if(e&&a>e){a=e}if(c&&(a<c)){return this.computeRelative(a)}else{return this.getLocalDate(b)}},computeRelative:function(c){if(c<5){return this.stringMoments}else{if(c<30){return this.stringHalfMinute}else{if(c<60){return this.stringLessMinute}else{if(c<3600){var f=Math.round(c/60);if(f<=1){return this.stringMinute}else{return sprintf(this.stringMinutes,f)}}else{if(c<86400){var e=Math.round(c/3600);if(e<=1){return this.stringHour}else{return sprintf(this.stringHours,e)}}else{if(c<2629800){var b=Math.round(c/86400);if(b<=1){return this.stringDay}else{return sprintf(this.stringDays,b)}}else{if(c<31557600){var d=Math.round(c/2629800);if(d<=1){return this.stringMonth}else{return sprintf(this.stringMonths,d)}}else{var a=Math.round(c/3155760);if(a<=1){return this.stringYear}else{return sprintf(this.stringYears,a)}}}}}}}}},getLocalDate:function(a){return a.toLocaleString()},dateBinderClass:{init:function(a){if(this._inited){return}if(this.getAttribute("utc")){this._selfDate=new Date;this._selfDate.setTime(this.getAttribute("utc")*1000)}else{this._selfDate=new Date(this.innerHTML)}this.maxRelativeDate=0;if(this.getAttribute("max_relative_date")){this.maxRelativeDate=this.getAttribute("max_relative_date")}if(this.getAttribute("relative")){switch(this.getAttribute("relative")){case"true":case"1":case"on":case"relative":this._isRelative=true;break;default:this._isRelative=false}}else{this._isRelative=true}this._inited=false;if(a){this.update()}},update:function(){if(!this._inited){this.init()}var a=tagged.util.dateHandler.getLocalDate(this._selfDate);if(this._isRelative){this.innerHTML=tagged.util.dateHandler.getRelativeDate(this._selfDate,"relative",this.maxRelativeDate)}else{this.innerHTML=a}if(!this.getAttribute("no_title")){this.setAttribute("title",a)}D.removeClass(this,"hidden")}}};tagged.namespace("profile");tagged.profile={boxes:{},shims:[],skinId:0,headerId:0,documentTitle:"",handleSelfInfo:function(a){if(!a.result){return}tagged.selfInfo=a.result},newBoxes:{journals:"tagged.journal.getProfileBox",comments:"tagged.comments.getProfileBox",whatsnew:"tagged.newsfeed.getProfileBox",tags:"tagged.apps.tags.getProfileBox",gifts:"tagged.apps.gifts.getProfileBox",photos:"tagged.photo.getProfileBox",groups:"tagged.groups.user.getProfileBox",friends:"tagged.friends.getProfileBox"},initialize:function(){this.documentTitle=document.title;if(tagged.data.profile.view==1){var f=D.getElementsByClassName("column");for(var b in f){var c=f[b].firstChild;while(c.nodeName.toLowerCase()!="ul"){c=c.nextSibling}if(tagged.data.profile.view==1){new YAHOO.util.DDTarget(f[b].id,"boxxen");var e=document.createElement("li");e.id="shim_"+f[b].id;e.style.height="1px";e.style.width=c.offsetWidth+"px";c.appendChild(e);e.dnd=new tagged.profile.primary.dndClass(e.id,"boxxen",null,tagged.profile.primary.box.dragCallback);this.shims.push(e)}}}var a=D.getElementsByClassName("profile_box");for(var b in a){var d=a[b];this.initBox(d);if(d.load_order=="0"){d.activate()}}this.loadBoxes({result:1});if(tagged.profile.skin&&(tagged.data.profile.view==1)){tagged.profile.skin.init()}},initBox:function(a){this.boxes[a.id]=a;YAHOO.lang.augmentObject(a,this.boxClass,true);if(tagged.data.profile.view==1){YAHOO.lang.augmentObject(a,this.primary.boxClass,true)}a.setAttribute("page_uid",tagged.data.profile.uid);a.init()},loadBoxes:function(c){if(!c.result){return}var a=c.result;if(a>3){TAGGED.api.startDefer();return}var f=false;for(var d in this.boxes){var e=this.boxes[d];var b=e.getAttribute("load_order");if(!b){b=3}if(b==a){e.queueLoad();f=true}}++a;if(f){TAGGED.api.queue.push({method:"tagged.util.echoIt",data:a,callback:"tagged.profile.loadBoxes"});TAGGED.api.dequeue()}else{this.loadBoxes({result:a})}var g=this.documentTitle;window.setTimeout(function(){document.title=g},10)},boxClass:{chromeHtml:'<div id="%s_header" class="box_header"><h3>%s</h3></div><div class="box_body">%s</div>',init:function(){var d=tagged.profile.box.attributeNames;for(var b in d){var a=d[b];var c=this.getAttribute(a);if(c){this[a]=c}else{this[a]=null}}if(this.id=="photos"){this.js_namespace="tagged.profile.photos"}if(tagged.data.profile.view==1){this.dnd=new tagged.profile.primary.dndClass(this.id,"boxxen",null,tagged.profile.primary.box.dragCallback)}},queueLoad:function(){var c=this.getAttribute("api")+".getProfileBox";if(tagged.profile.newBoxes[this.id]){c=tagged.profile.newBoxes[this.id]}var d={method:c,callback:"tagged.profile.box.loaded"};var f=tagged.profile.box.attributeNames;for(var b in f){var a=f[b];var e=this[a];if(e){d[a]=e}}TAGGED.api.queue.push(d)},render:function(data){var boxBodyHtml="";if(this.js_namespace){var boxJsObj=eval(this.js_namespace);if(boxJsObj&&boxJsObj.render){boxBodyHtml=boxJsObj.render(data)}}if(boxBodyHtml==""){return}var title="";if(this.titles[this.id]){title=this.titles[this.id]}else{if(data.title){title=data.title}}this.innerHTML=sprintf(this.chromeHtml,this.id,title,boxBodyHtml);if(tagged.data.profile.view==1&&this.item_values&&this.renderDropDown){this.renderDropDown()}},activate:function(){if(tagged.data.profile.view==1){if(!this.dnd){this.dnd=new tagged.profile.primary.dndClass(this.id,"boxxen",null,tagged.profile.primary.box.dragCallback)}this.dnd.setHandleElId(this.id+"_header");if(this.is_locked){this.dnd.lock()}else{var header=D.get(this.id+"_header");if(header){header.style.cursor="move"}}}if(this.bindDeleteHandler){this.bindDeleteHandler()}if(this.bindDisplayDropdown){this.bindDisplayDropdown()}this.bindWidgetActions();if(this.js_namespace){var call=this.js_namespace+".init();";tagged.safeLoad(this.js_namespace,function(){eval(call)})}},bindWidgetActions:function(){if(!D.get(this.id+"-widgets")){return}var b=this;var a=D.getElementsByClassName("widget","li",b,function(c){b.bindWidgetCopy(b.id,c.id);if(b.bindWidgetDelete){b.bindWidgetDelete(b.id,c.id)}if(b.bindWidgetMove){b.bindWidgetMove(b.id,c.id)}});return},bindWidgetCopy:function(c,b){var a=D.get("widget_"+b+"_copy");if(!a){return}a.onclick=function(){tagged.profile.widget.makeMenu(b);return false}}},box:{attributeNames:["id","load_order","api","uid","page_uid","num_items","item_values","friends_view","is_locked","js_namespace","autoplay"],submenuHtml:'<ul class="box_submenu">%s</ul>',submenuLinkItemHtml:'<li%s><a href="%s">%s</a></li>',submenuTextItemHtml:"<li%s>%s</li>",loaded:function(response){if(response.stat!="ok"){return}if(!response.result){return}var box_data=response.result;var box_id=box_data.box_id;var profile_boxes=D.getElementsByClassName("profile_box","li");var box=null;for(var i=0,len=profile_boxes.length;i<len;i++){var potential_box=profile_boxes[i];if(potential_box.id==box_id){box=potential_box;break}}if(!box){return}if(!box_data.contents){box.render(box_data)}else{box.innerHTML=box_data.contents}if(!box.activate){tagged.profile.initBox(box)}box.activate();if(box.innerHTML){D.removeClass(box,"hide_me")}if(box_data.javascript){eval(box_data.javascript)}},renderSubmenu:function(a){var e=new tagged.util.stringBuffer();var f=true;for(var b in a){var d=a[b];var c="";if(f){c=' class="first"';f=false}if(d.id){c+=' id="'+d.id+'" '}if(d.href){e.append(sprintf(this.submenuLinkItemHtml,c,d.href,d.title))}else{e.append(sprintf(this.submenuTextItemHtml,c,d.title))}}return sprintf(this.submenuHtml,e.toString())}},widget:{getCustomBoxes:function(d,c,a){if(this.customBoxes){c({result:{echo:d,custom_boxes:this.customBoxes}});return false}var b={method:"tagged.profile.getCustomBoxesList",echo:d,callback:a};TAGGED.api.call(b)},clearCustomBoxes:function(){this.customBoxes=null},makeMenu:function(a){this.getCustomBoxes(a,this.addMenu,"tagged.profile.widget.addMenu");return false},addMenu:function(e){if(!e||!e.result){TAGGED.util.notification.showNotification("Could not get list of custom boxes.","profile","failure","top",3000);return}var b=e.result.echo;if(e.result.custom_boxes){this.customBoxes=e.result.custom_boxes}var h="copymenu_"+b;var c=D.get("widget_"+b+"_copy");var k=c.innerHTML;var a=D.get(b).parentNode.id.split("-")[0];if(D.get(h)){var j=YAHOO.widget.MenuManager.getMenu(h).destroy()}var d=new YAHOO.widget.Menu(h,{context:[c,"bl","bl"],zindex:1000,clicktohide:true,lazyload:true,shadow:false,classname:"copy_menu"});d.setItemGroupTitle(k,0);for(var f=0,g=this.customBoxes.length;f<g;++f){box_data=this.customBoxes[f];d.addItem({text:"to "+this.customBoxes[f].title,onclick:{fn:tagged.profile.widget.copy,obj:{destBoxId:this.customBoxes[f].id,widgetId:b,sourceBoxId:a}}},0)}d.addItem({text:tagged.profile.widget.strings.toComment,onclick:{fn:tagged.profile.widget.post,obj:{url:"/post_comment.html",widgetId:b,sourceBoxId:a}}},0);d.addItem({text:tagged.profile.widget.strings.toJournal,onclick:{fn:tagged.profile.widget.post,obj:{url:"/edit_journal.html",widgetId:b,sourceBoxId:a}}},0);d.render("profile");d.show()},post:function(d,a,c){var b=document.forms.post_widget;if(b){b.action=c.url;b.widget_id.value=c.widgetId;b.source_box_id.value=c.sourceBoxId;b.owner_id.value=tagged.data.profile.uid;b.submit()}},copy:function(f,a,d){var c={method:"tagged.widget.copy",from_user:tagged.data.profile.uid,from_box_id:d.sourceBoxId,to_box_id:d.destBoxId,widget_id:d.widgetId,callback:"tagged.profile.widget.copied"};TAGGED.api.queue.push(c);if(tagged.data.profile.view==1){var b=tagged.profile.boxes["custom_"+d.destBoxId];if(b){b.queueLoad()}}TAGGED.api.dequeue();return false},copied:function(a){tagged.ads.reload();if(!a||!a.result){if(a.stat=="fail"&&a.error.code==203){alert("You have exceeded the maximum number of 100 widgets allowed per user. Please delete some widgets in order to add more.")}else{TAGGED.util.notification.showNotification("Failed to copy widget.","profile","failure","top",3000)}return}var b=D.get("widget_"+a.result.old_widget_id+"_copy");b.innerHTML=b.getAttribute("conf_text");D.addClass(b,"disabled");window.setTimeout(function(){b.innerHTML=b.getAttribute("default_text");D.removeClass(b,"disabled")},3000)}}};E.onDOMReady(function(){TAGGED.api.stopDefer();tagged.profile.initialize();if(window.location.hash=="#change_skin"){tagged.safeLoad("tagged.profile.customize",function(){tagged.profile.customize.init()})}});tagged.loadStringsDirect({"tagged.util.dateHandler":{stringMoments:"moments ago",stringHalfMinute:"half a minute ago",stringLessMinute:"less than a minute ago",stringMinute:"a minute ago",stringMinutes:"%d minutes ago",stringHour:"an hour ago",stringHours:"%d hours ago",stringDay:"a day ago",stringDays:"%d days ago",stringMonth:"a month ago",stringMonths:"%d months ago",stringYear:"a year ago",stringYears:"%d years ago"}});tagged.loadStringsDirect({"tagged.profile.boxClass":{titles:{journals:"Journal",whatsnew:"What's New",comments:"Comments",tags:"Tags",gifts:"Gifts",photos:"Photos",groups:"Groups",friends:"Friends"}},"tagged.profile.widget.strings":{toComment:"to a new comment",toJournal:"to a new journal"},"tagged.profile.strings.customize":{yes:"Yes",no:"No",next:"Next",previous:"Previous",submit:"Submit",openSkinPrompt1:"Opening Change Skin will cancel this skin preview. Do you still want to continue?",clearChangesDefault:"Clear your changes and start over with the Default skin?",clearChangesMoveTo:"Do you want to clear your changes and move to %s?",selectSkin:"select a skin",makeSkin:"make a skin",skinHistory:"skin history",start:"Start",loading:"Loading...",sending:"Sending...",adds:"%s adds",tryAgain:"Try again",noChangesFound:"No changes were found.\n\nThere is no need to save your work at this time.",giveSkinName:"Please give your skin a name.",errorSaving:"Sorry, there was an error saving your skin. Please restart your browser and try again.",errorSubmitting:"Sorry, there was an error submitting your skin to the library. Please refresh the page and try again.",errorLoadingItems:"There was an error loading more items. Please refresh the page and try again.",errorCarousel:"Error: Carousel not defined",errorRemoveHistory:"There was an error removing that history entry. Please try again.",errorLoadingSubcategories:"There was an error loading subcategories... please refresh the page and try again",errorSubmit:"Error: %s.",skinnameSaved:"%s saved. Are you done?",confirmCancel:"Are you sure you want to cancel?\n\nAll your changes will be lost!\n\nPress OK to continue, or Cancel to stay.",cannotDeleteSkinViewing:"You cannot delete the skin you are currently previewing.",cannotDeleteSkinCurrent:"You cannot delete your current skin. Please change your skin and try again.",removeHistory:"Are you sure you want to remove this history entry?",allChangesLost:"All your changes will be lost!",clickPhotoWantSee:"Click on the photo you want to use",noPhotos:"You do not have any photos on Tagged.",failedAddImage:"Failed to add gallery image to skin. Please refresh the page and try again.",failedLoadPanel:"Failed to load panel... please refresh the page and try again",skinSubmittedReview:"Skin successfully submitted for review",enterName:"Please enter a name for your skin",name25Chars:"Your skin name can only be 25 characters",enter1Keyword:"Please enter at least 1 keyword",selectCategory:"Please select a category for your skin",selectSubcategory:"Please select a subcategory for your skin",uploadSkin:"Please upload a skin icon before submitting your skin",defaultSearchString:"funny, hot, red",api_errors:{"303":"Skin name is too long","304":"Skin name contains banned content","305":"Skin name is too short","500":"You must select a subcategory","501":"Another skin already has this name","502":"No keywords entered for this skin","503":"Keywords contain banned content","506":"Adding skin icon failed","508":"Failed to move skin images","509":"You cannot use non-ASCII characters","510":"Icon in use by another skin","511":"Your skin is identical to another submitted skin"}}});tagged.namespace("profile.basic");tagged.profile.basic={init:function(){tagged.util.dateHandler.findAndBind("basic_info",true);var a=document.forms.select_profile_url;if(a){TAGGED.util.hintinput.attach(a.profile_url,a,a.default_text.value);a.onsubmit=function(){var c=this.profile_url.value;if(c){if(c.length<6||c.length>50){alert("Sorry, your URL must be between 6 and 50 characters long.")}else{if(confirm("Make sure this is right:\nhttp://tagged.com/"+c+"\n\nOnce you save it you can't change it!")){tagged.profile.basic.loadURL(c)}}}else{alert("Sorry, your URL cannot be empty")}return false}}var b=D.get("add_friend_private");if(b){E.addListener(b,"click",tagged.profile.actions.addFriend,b)}},loadURL:function(a){var b={method:"tagged.aboutme.setUrl",requested_url:a,callback:"tagged.profile.basic.URLLoaded"};TAGGED.api.call(b)},URLLoaded:function(a){tagged.ads.reload();if(a.error){alert(a.error.message)}else{var b=D.get("profile_url_span");b.innerHTML=a.results.urlHTML}}};tagged.namespace("profile.actions");tagged.profile.actions={commInited:false,allowComm:false,notificationTimer:5000,intivePanel:null,commInit:function(){if(this.commInited){return}TAGGED.api.queue.push({method:"tagged.friends.status",user_id:tagged.data.profile.uid,callback:"tagged.profile.actions.handleComm"});TAGGED.api.queue.push({method:"tagged.util.echoIt",data:false,callback:"tagged.profile.actions.handleSelfInfo"});this.imLi=D.get("item_send_IM");if(this.imLi){TAGGED.api.queue.push({method:"tagged.status.isOnline",user_id:tagged.data.profile.uid,callback:"tagged.profile.actions.handleUserOnline"})}this.commInited=true},init:function(){if(tagged.lateBinding){this.commInit()}var a=D.get("page_displayname_text");if(a){tagged.profile.actions.displayName=a.innerHTML}var a=D.get("jumpto_menu");if(a){E.addListener(a,"change",tagged.profile.actions.jumpToURL,a)}if(tagged.data.profile.view==1){E.addListener(D.get("luv_help_icon"),"click",tagged.profile.actions.toggleLuvHelp);if(D.get("link_add_widget")){E.addListener("link_add_widget","click",function(g){E.preventDefault(g);tagged.profile.widget.getCustomBoxes("actions_widget_menu",tagged.profile.actions.addWidgetMenu,"tagged.profile.actions.addWidgetMenu");return false})}E.addListener("link_change_skin","click",tagged.profile.actions.initC11n)}else{var d=D.get("item_copy_skin");if(d&&!tagged.data.profile.usingLibrarySkin){D.addClass(d,"hide_me")}if(tagged.data.profile.view==3){var c=D.get("actions").getElementsByTagName("a");for(var e=0;e<c.length;e++){c[e].onclick=function(){return false}}var b={parentNode:YAHOO.util.Dom.get("quick_msg_container"),uid:tagged.data.profile.uid,type:"message",disabled:true};tagged.modules.quickPost.init(b)}else{var f=D.get("link_send_IM");if(f){E.addListener(f,"click",tagged.profile.actions.sendIM)}var f=D.get("link_add_friend");if(f){E.addListener(f,"click",tagged.profile.actions.addFriend,f)}var f=D.get("link_invite_to_groups");if(f){E.addListener(f,"click",tagged.profile.actions.inviteToGroups)}var f=D.get("link_remove_friend");if(f){E.addListener(f,"click",tagged.profile.actions.removeFriend)}var f=D.get("link_report_profile");if(f){E.addListener(f,"click",tagged.profile.actions.reportProfile)}var f=D.get("link_wink");if(f){E.addListener(f,"click",tagged.profile.wink.sendWink,f)}f=D.get("give_luv");if(f){E.addListener(f,"click",tagged.apps.luv.giveLuv)}if(d&&tagged.data.profile.usingLibrarySkin){d.onclick=function(){window.location="/profile.html?skin_id="+tagged.data.profile.skinId}}var b={parentNode:YAHOO.util.Dom.get("quick_msg_container"),uid:tagged.data.profile.uid,type:"message"};tagged.modules.quickPost.init(b)}}},jumpToURL:function(b,a){window.location=a.value},handleComm:function(d){if(d&&(d.stat=="ok")&&d.result){var b=d.result;this.allowComm=b.comm_allowed;var a=D.get("item_add_friend");var c=D.get("item_friend_requested");if(b.comm_allowed){if(b.already_friends){if(a){D.addClass(a,"hide_me")}if(c){D.addClass(c,"hide_me")}}else{if(b.friend_requested){if(a){D.addClass(a,"hide_me")}if(c){D.removeClass(c,"hide_me")}}else{if(a){D.removeClass(a,"hide_me")}if(c){D.addClass(c,"hide_me")}}}}else{if(a){D.addClass(a,"hide_me")}if(c){D.addClass(c,"hide_me")}}var a=D.get("item_view_photos");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("item_send_message");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("item_post_comment");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("item_give_gift");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("item_give_tags");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("item_wink");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("quick_msg_container");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}var a=D.get("luv_container");if(a){if(b.comm_allowed){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}}},handleSelfInfo:function(b){var a=D.get("item_view_pets");if(a){if(!this.allowComm||tagged.optOut.pets){D.addClass(a,"hide_me")}else{D.removeClass(a,"hide_me")}}},handleUserOnline:function(a){if(!a||(a.stat!="ok")){return}if(a.result&&this.imLi&&this.allowComm){D.removeClass(this.imLi,"hide_me")}},sendIM:function(a){tagged.im.mw.sendIM(tagged.data.profile.uid);E.stopEvent(a)},addFriend:function(c,d){if(c&&d){E.preventDefault(c);E.removeListener(d,"click");var a=d.parentNode;while(a.nodeName!="LI"){a=a.parentNode}a.innerHTML=sprintf('<span class="icon add_friend">%s</span>',tagged.profile.actions.strings.sending)}var b={method:"tagged.usermgmt.addFriend",uid_to_add:tagged.data.profile.uid,callback:"tagged.profile.actions.addFriendResponse"};TAGGED.api.call(b)},addFriendResponse:function(f){tagged.ads.reload();if(f.stat=="ok"){if(f.results.uid!=tagged.data.profile.uid){return}if(f.results.ERROR_FLAG==0){var d=D.get("item_add_friend");if(d){var e=tagged.profile.actions.strings.requestSent;if(f.results.NEW_TEXT){e=tagged.profile.actions.strings[f.results.NEW_TEXT]}d.innerHTML='<span class="icon add_friend">'+e+"</span>"}var c=D.get("item_add_friend_private");if(c){var e=sprintf(tagged.profile.actions.strings.requestSentTo,this.displayName);c.innerHTML='<span class="icon add_friend">'+e+"</span>"}if(f.results.REQUIRES_VALIDATION&&f.results.PASSED_VALIDATION){TAGGED.util.notification.hideNotification("actions_feedback")}}else{if(f.results.REQUIRES_VALIDATION){tagged.profile.actions.validationHTML=f.results.validation_html;this.validateFriend()}}}else{if(f.stat=="fail"){if(f.error.code&&f.error.code=="11"){var a=window.location+"";var b=a.substr(TAGGED.base_url.length,a.length);window.location=TAGGED.base_url+"/index.html?r="+escape(b);return}else{if(this.strings[f.error.code]){TAGGED.util.notification.showNotification(this.strings[f.error.code],"actions","failure","top")}else{TAGGED.util.notification.showNotification(this.strings[108],"actions","failure","top")}}setTimeout(function(){tagged.profile.actions.cancelFriendRequest()},3000)}}tagged.ads.reload()},inviteToGroups:function(d){if(tagged.data.profile.loginUid==0){var a=window.location+"";var b=a.substr(TAGGED.base_url.length,a.length);window.location=TAGGED.base_url+"/index.html?r="+escape(b);return}invitePanel=new YAHOO.widget.Panel("invite_to_groups_panel",{width:"960px",height:"450px",close:false,fixedcenter:true,draggable:false,modal:true});var c=document.createElement("div");c.setAttribute("id","friend_selector");tagged.modules.group_selector.init({parentEl:c,itemsPerPage:18,thumbSize:"m"});E.addListener("friend_selector_close","click",function(){invitePanel.destroy()});invitePanel.setBody(c);invitePanel.render(document.body)},validateFriend:function(){var a=this.validationHTML;TAGGED.util.notification.showNotification(a,"actions","neutral friend_validation","top")},submitFriendValidation:function(f){var f=f||document.forms.validate_friend;var b=f.last_name.value;var d=f.email.value;var c=D.get("validation_error");D.addClass(c,"hide_me");if(!tagged.util.string.isEmpty(b)){var a="last_name";var e=b}else{if(!tagged.util.string.isEmpty(d)){var a="email";var e=d}else{c.innerHTML=tagged.profile.actions.strings.enterNameOrEmail;D.removeClass(c,"hide_me");return}}var g={method:"tagged.usermgmt.addFriend",validation_type:a,validation_value:e,uid_to_add:tagged.data.profile.uid,callback:"tagged.profile.actions.addFriendResponse"};TAGGED.api.call(g)},cancelFriendRequest:function(){TAGGED.util.notification.hideNotification("actions_feedback");var f=D.get("item_add_friend");if(f){var e=D.get("link_add_friend");if(!e){var d=D.get("item_add_friend");var a=sprintf('<a href="#" id="link_add_friend" title="%s">%s</a>',tagged.profile.actions.strings.addToFriends,tagged.profile.actions.strings.addToFriends);d.innerHTML=a;var e=D.get("link_add_friend");E.addListener(e,"click",tagged.profile.actions.addFriend,e)}}var b=D.get("item_add_friend_private");if(b){var e=D.get("add_friend_private");if(!e){var c=sprintf(tagged.profile.actions.strings.addAsFriend,this.displayName);var a=sprintf('<a href="#" id="add_friend_private" title="%s">%s</a>',c,c);b.innerHTML=a;var e=D.get("add_friend_private");E.addListener(e,"click",tagged.profile.actions.addFriend,e)}}},removeFriend:function(b){E.preventDefault(b);if(confirm(sprintf(tagged.profile.actions.strings.removeFriendConfirm,this.firstName))){var a={method:"tagged.usermgmt.removeFriend",uid_to_remove:tagged.data.profile.uid,callback:"tagged.profile.actions.friendRemoved"};TAGGED.api.call(a)}},friendRemoved:function(f){tagged.ads.reload();if(f.results.ERROR_FLAG==0){var c=D.get("item_remove_friend");c.id="item_add_friend";c.className="icon_add_friend";var d=tagged.profile.actions.strings.addToFriends;var b=sprintf('<a href="#" id="link_add_friend" title="%s" onclick="tagged.profile.actions.addFriend(); return false;">%s</a>',d,d);c.innerHTML=b;var a=tagged.profile.actions.displayName;var e=sprintf(tagged.profile.actions.strings.removeFriend,a);TAGGED.util.notification.showNotification(e,"actions","success","bottom",tagged.profile.actions.notificationTimer)}},initC11n:function(c){E.preventDefault(c);var a=D.getStyle("customize","height");if(!a||a=="0px"){var b=document.createElement("img");b.src=tagged.static_uri+"/im/loading/circle_grey_16.gif";b.id="c11n_spinny_wheel";this.appendChild(b);tagged.safeLoad("tagged.profile.customize",function(){tagged.profile.customize.init()})}else{window.scrollTo(0,0)}},reportProfile:function(b){E.preventDefault(b);var a={method:"tagged.usermgmt.reportProfile",uid_to_report:tagged.data.profile.uid,callback:"tagged.profile.actions.profileReported"};TAGGED.api.call(a)},profileReported:function(b){tagged.ads.reload();if(b.stat=="ok"){var a=tagged.profile.actions.displayName;var c=new tagged.util.stringBuffer();c.add(sprintf('<img src="'+TAGGED.static_uri+'/im/icons/x_grey.gif" class="icon_close" alt="$s"',tagged.profile.actions.strings.close));c.add(" onclick=\"TAGGED.util.notification.hideNotification('actions_feedback');\"/>");c.add(tagged.profile.actions.strings.reportFiled);c.add(sprintf(' <a href="#" onclick="tagged.profile.actions.blockUser(); return false;">%s</a>',sprintf(tagged.profile.actions.strings.block,a)));TAGGED.util.notification.showNotification(c.toString(),"actions","success","top")}},blockUser:function(b){var a={method:"tagged.usermgmt.blockUser",uid_to_block:tagged.data.profile.uid,callback:"tagged.profile.actions.userBlocked"};TAGGED.api.call(a)},userBlocked:function(b){tagged.ads.reload();if(b.stat=="ok"){var a=sprintf(tagged.profile.actions.strings.userIsBlocked,this.displayName);TAGGED.util.notification.showNotification(a,"actions","success","top",tagged.profile.actions.notificationTimer)}},addWidgetMenu:function(d){var f=d.result.echo;var g=D.get("link_add_widget").firstChild;var j="actions";if(D.get(f)){YAHOO.widget.MenuManager.getMenu(f).destroy()}var b=new YAHOO.widget.Menu(f,{context:[g,"tl","tl"],zindex:1000,clicktohide:true,lazyload:true,shadow:false,classname:"copy_menu"});b.setItemGroupTitle(g.innerHTML,0);var a=d.result.custom_boxes;for(var e=0;e<a.length;e++){var h=(a[e].id<3)?0:1;var c=TAGGED.base_url+"/make_a_widget.html?tag_feature=userbox&boxId="+a[e].id;b.addItem({text:"to "+a[e].title,url:c},h)}b.render("profile");b.show()},toggleLuvHelp:function(){var a=D.get("luv_help");if(D.hasClass(a,"hide_me")){D.removeClass(a,"hide_me")}else{D.addClass(a,"hide_me")}}};E.onDOMReady(function(){if(!tagged.loadedSelfInfo){TAGGED.api.queue.push({method:"tagged.util.selfInfo",callback:"tagged.handleSelfInfo"})}});tagged.loadStringsDirect({"tagged.profile.actions.strings":{sending:"Sending...",requestSent:"Request Sent",requestSentTo:"Friend request sent to %s",enterNameOrEmail:"Please enter a last name OR email address.",addToFriends:"Add to Friends",addAsFriend:"Add %s as a friend",removeFriendConfirm:"Are you sure you want to remove %s as your friend?",removeFriend:"You have removed %s from your friend list.",userIsBlocked:"%s is blocked from contacting you.",close:"Close",reportFiled:"Report filed to Tagged Safety.",block:"Block %s",newText1:"Friend Added",newText2:"Reminder Sent",newText3:"Request Sent","101":"Invalid Spam Content Type","102":"Exception occurred reporting profile","103":"Cannot add self as a friend","104":"Cannot send friend request - already friends","105":"Cannot send friend request - already requested","106":"Cannot send friend request - invalid request","107":"Sorry, this user is blocking you.","108":"Error sending friend request."}});tagged.namespace("modules.pagination");tagged.modules.pagination={linkHtml:' <a href="#" class="%s" page="%2$d">%3$s</a> ',spanText:' <span class="%s">%s</span> ',renderDirectionLinks:function(f,g,a,i,d,h){h=(typeof h==="undefined")?"l":h;var e=Math.floor(a/g)+1;var c=Math.ceil(f/g);if(c<=1){return}var b="";if(h=="l"){b+=this.dirHelper(1,this.msgs.first,e!=1,"outer")}b+=this.dirHelper(e-1,this.msgs.previous,e>1,"inner")+" | "+this.dirHelper(e+1,this.msgs.next,e!=c,"inner");if(h=="l"){b+=this.dirHelper(c,this.msgs.last,e!=c,"outer")}d=D.get(d);if(d){d.innerHTML=b;if(!d.getAttribute("page_action")){d.setAttribute("page_action",true);YAHOO.util.Event.addListener(d,"click",this.getNavigationHandler(i))}}},dirHelper:function(c,d,b,a){if(b){return sprintf(this.linkHtml,a,c,d)}else{return sprintf(this.spanText,a,d)}},getNavigationHandler:function(b){var a=function(c){var e=E.getTarget(c);if(e.tagName.toUpperCase()!="A"){e=e.parentNode}if(e.tagName.toUpperCase()=="A"){var d=e.getAttribute("page");if(d){E.preventDefault(c);if(typeof(b)=="function"){b(d)}else{YAHOO.util.History.navigate("pageNum",d)}}}};return a},renderPageNumbers:function(g,i,c,j,e){var f=Math.floor(c/i)+1;var d=Math.ceil(g/i);var b='<a href="#%1$d" page="%1$d">%1$d</a> ';var h='<a href="#%1$d" page="%1$d">%2$s</a> ';var a=new tagged.util.stringBuffer();a.add(this.numberHelper(f-1,h,1,d,this.msgs.prev),this.numberHelper(f-2,b,1,d,""),this.numberHelper(f-1,b,1,d,""),sprintf(this.spanText,"page_current",f),this.numberHelper(f+1,b,1,d,""),this.numberHelper(f+2,b,1,d,""),this.numberHelper(f+1,h,1,d,this.msgs.next));e=D.get(e);if(e){e.innerHTML=a;if(!e.getAttribute("tag_action")){e.setAttribute("tag_action",true);YAHOO.util.Event.addListener(e,"click",this.getNavigationHandler(j))}}},numberHelper:function(c,d,b,a,e){if(c<b){return""}if(c>a){return""}return sprintf(d,c,e)},boundsCheck:function(b,a){if(b<0){return false}if(a>0&&b>=a){return false}return true},offset:function(b,a){return a*(b-1)},sanePageNum:function(c,b,a){c=parseInt(c);if(isNaN(c)){return 1}if(!this.boundsCheck(this.offset(c,b),a)){return 1}return c}};tagged.namespace("apps.luv");tagged.apps.luv={perPage:20,init:function(){if(!tagged.data.profile){var b=H.getBookmarkedState("p");var a=b||"1";H.register("pageNum",a,function(c){tagged.apps.luv.getLuvHistory(c)});H.onReady(function(){tagged.apps.luv.getLuvHistory(a)});H.initialize("yui-history-field","yui-history-iframe")}},getLuvHistory:function(b){tagged.util.domMethods.toggle("loading_mask","loading_img");var a={method:"tagged.apps.luv.history",page:b-1,callback:"tagged.apps.luv.receiveLuvHistory"};TAGGED.api.call(a)},receiveLuvHistory:function(b){var a=document.getElementById("page_container");if(b.results){a.innerHTML=b.results.html;tagged.apps.luv.attachHandlers();tagged.apps.luv.displayLuvMeter(b.results.luvPercentage);tagged.modules.pagination.renderDirectionLinks(b.results.total,this.perPage,b.results.offset,null,"luv_nav_top");tagged.modules.pagination.renderDirectionLinks(b.results.total,this.perPage,b.results.offset,null,"luv_nav_btm")}else{a.innerHTML='<div class="luvFeedback failure">'+sprintf(tagged.apps.luv.strings.errorReceive,' href="#" onclick="window.location.reload(); return false;"')+"</div>"}tagged.util.domMethods.toggle("loading_mask","loading_img");tagged.ads.reload()},attachHandlers:function(){var c=D.get("luv_history");if(c){var b=D.getElementsByClassName("give_luv","a","luv_history");for(var a=0;a<b.length;a++){E.addListener(b[a],"click",this.giveLuv)}}},enableLuv:function(a){var b=document.getElementById("mask_"+a);if(b){D.addClass(b,"hide_me")}},giveLuv:function(d){E.preventDefault(d);var c=this.getAttribute("uid");var b=this.getAttribute("row_id");D.removeClass("mask_"+b,"hide_me");var a={method:"tagged.apps.luv.give",target_id:c,row_id:b,callback:"tagged.apps.luv.luvSent"};TAGGED.api.call(a);tagged.ads.reload()},luvSent:function(g){if(g.results){var e=g.results;var c=e.row_id;tagged.apps.luv.enableLuv(c);var a=D.get("feedback_"+c);if(!a){return}switch(e.feedback){case"luvSent":var f=sprintf(this.strings[e.feedback],e.luvLimit,e.luvLeft);D.addClass(a,"success");this.displayLuvMeter(e.giverPercentage);break;case"luvSentVIP":var f=sprintf(this.strings[e.feedback],e.vipUrl,e.vipLuvLimit,e.luvLimit,e.luvLeft);D.addClass(a,"success");this.displayLuvMeter(e.giverPercentage);break;case"noLuvLeft":var f=sprintf(this.strings[e.feedback],e.luvLimit);D.addClass(a,"failure");break;case"noLuvLeftVIP":var f=sprintf(this.strings[e.feedback],e.luvLimit,e.vipUrl,e.vipLuvLimit);D.addClass(a,"failure");break;case"userBlocked":case"commForbidden":var f=this.strings[e.feedback];D.addClass(a,"failure");break}a.innerHTML=f;D.removeClass(a,"hide_me");D.setStyle(a,"opacity",1);var b=window.setTimeout(function(){tagged.apps.luv.fadeFeedback(c)},5000)}else{if(g.stat&&g.stat=="fail"&&g.error&&g.error.code&&g.error.code==11){var d=window.location;window.location="/index.html?r="+encodeURIComponent(d)}else{alert(tagged.apps.luv.strings.errorSend);tagged.util.domMethods.toggle("mask_luvbutton")}}},fadeFeedback:function(b){var a=document.getElementById("feedback_"+b);if(a){var d=function(){D.removeClass(a,"failure");D.removeClass(a,"success");D.addClass(a,"hide_me")};var c=new YAHOO.util.Anim(a,{opacity:{to:0}},0.5,YAHOO.util.Easing.easeOut);c.onComplete.subscribe(d);c.animate()}},displayLuvMeter:function(d){var b=d*2.2;D.get("hearts_filled").style.width=b+"px";D.get("luv_percentage").innerHTML=d+"%";var c="";var a=tagged.apps.luv.strings;var e=D.get("luv_description");if(e){if(d==0){c=a.noLuv}else{if(d<=20){c=a.almostEmpty}else{if(d<=45){c=a.almostHalfFull}else{if(d<=75){c=a.mostlyFull}else{if(d<=95){c=a.almostFull}else{c=a.fullOfLuv}}}}}e.innerHTML=c}}};E.onDOMReady(tagged.apps.luv.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.apps.luv.strings":{luvSent:"<p><strong>You gave Luv!</strong> It will last for a week.</p><p>You can give Luv %s times per day - <strong>%s left today!</strong></p>",luvSentVIP:'<p><strong>You gave Luv!</strong> It will last for a week. <a class="wantmore" href="%s">Want %s?</a></p><p>You can give Luv %s times per day - <strong>%s left today!</strong></p>',noLuvLeft:"<p>You can only give Luv %s times per day.</p><p>You are out of Luv today but come back tomorrow!</p>",noLuvLeftVIP:'<p>You can only give Luv %s times per day. <a class="wantmore" href="%s">Want %s?</a></p><p>You are out of Luv today but come back tomorrow!</p>',userBlocked:"<p><strong>Sorry, that user has blocked you.</strong></p><p>&nbsp;</p>",commForbidden:"<p><strong>Sorry, cannot communicate with this user.</strong></p><p>&nbsp;</p>",noLuv:"NO LUV :-(",almostEmpty:"Almost Empty",almostHalfFull:"Almost Half Full",mostlyFull:"Mostly Full",almostFull:"Almost Full",fullOfLuv:"FULL OF LUV! :-)",errorSend:"An error occured. Your Luv was not sent, please try again.",errorReceive:"An error occured while processing your request. Please try again, by <a %s>reloading</a> the page."}});tagged.namespace("cachedata");tagged.cachedata={_queued:false,findAndBind:function(b){if(b){var c=D.getElementsByClassName("tag_oced",null,b)}else{var c=D.getElementsByClassName("tag_oced",null)}for(var a in c){var d=c[a];if(d._inited){continue}YAHOO.lang.augmentObject(d,this.cacheUpdateClass,true);d.initCacheData();this.queue(d.getCacheData())}},queue:function(b){var a=(this._queued)?false:true;if(a){this._queued={method:"tagged.util.cacheUpdate",data:b,callback:"tagged.cachedata.handleUpdate"};TAGGED.api.defer.push(this._queued)}else{this._queued.data=this._queued.data+"\n"+b}},handleUpdate:function(c){if(c.stat!="ok"){returnl}if(!c.results){return}var e=c.results;for(var b in e){var a=e[b];var d=D.get(a.id);if(!d){continue}if(!d._inited){YAHOO.lang.augmentObject(d,this.cacheUpdateClass,true);d.initCacheData()}d.updateCacheData(a)}},cacheUpdateClass:{initCacheData:function(){if(this._inited){return}this.id=this.getAttribute("id");this.cacheKey=this.getAttribute("cachekey");this.uid=this.getAttribute("uid");this.type=this.getAttribute("octype");this.param="";switch(this.type){case"photo":this.param=sprintf("%d%s",this.getAttribute("dimension"),this.getAttribute("scale"));this.data=this.src;break;case"name":var a=this.getAttribute("trim");if(a){this.param=a}this.data=this.innerHTML;break}},getCacheData:function(){return sprintf("%s %s %s %d %s %s",this.type,this.id,this.cacheKey,this.uid,this.param,this.data)},updateCacheData:function(a){switch(this.type){case"photo":this.src=a.data;break;case"name":this.innerHTML=a.data;this.setAttribute("title",a.title);break}}}};tagged.loadStringsDirect({"tagged.header.alerts.strings":{newAlerts:"New Alerts"}});