function textarea_autogrow(t){var e=$(t);if(e&&!e._controlled)return e._controlled=!0,new SEMods.TextAreaControl(e).setAutoGrow(!0),e.getStyle("height").toInt()}Function.prototype.bind=function(t){var e=this;return function(){return e.apply(t,arguments)}},SEMods=function(){},SEMods.TextAreaControl=function(t){this.obj=t,this.obj.style.overflow="hidden",this.originalHeight=this.obj.getStyle("height").toInt();this.update.bind(this);t.addEvent("focus",this.onFocus.bind(this)),t.addEvent("blur",this.onBlur.bind(this)),this.update()},SEMods.TextAreaControl.prototype={obj:null,updating:!1,autoGrow:!1,originalHeight:null,shadowElement:null,increment:0,timer:null,lastLength:0,setAutoGrow:function(t){this.autoGrow=t,this.createShadowElement(),this.update()},onUpdate:function(){this.autoGrow&&this.lastLength!=this.obj.value.length&&(this.lastLength=this.obj.value.length,this.updateShadowElement(),this.obj.style.height=Math.max(this.originalHeight,this.shadowElement.offsetHeight+this.increment)+"px")},beginUpdate:function(){return!this.updating&&(this.updating=!0)},endUpdate:function(){this.updating=!1},update:function(){this.beginUpdate()&&(this.onUpdate(),this.endUpdate())},createShadowElement:function(){this.shadowElement||(this.shadowElement=document.createElement("DIV"),this.shadowElement.style.position="absolute",this.shadowElement.style.top="-99999px",this.shadowElement.style.left="-99999px",document.body.appendChild(this.shadowElement))},updateShadowElement:function(){var t,e;this.shadowElement&&(text=this.obj.value+"
",this.shadowElement.innerHTML=text.toString().replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\n/g,"
"),t=this.getPXMetrics(this.obj.getStyle("font-size"),10),e=this.obj.getStyle("line-height"),/Opera/i.test(navigator.userAgent)&&(e=this.getPXMetrics(e,0)+3+"px"),this.increment=t+10,this.shadowElement.style.width=this.obj.offsetWidth+"px",this.shadowElement.style.lineHeight=e,this.shadowElement.style.fontSize=this.obj.getStyle("font-size"),this.shadowElement.style.fontFamily=this.obj.getStyle("font-family"),this.shadowElement.style.paddingLeft=this.obj.getStyle("padding-left"),this.shadowElement.style.paddingRight=this.obj.getStyle("padding-right"))},onFocus:function(){this.timer=setInterval(this.update.bind(this),500)},onBlur:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},getPXMetrics:function(t,e){var i=parseFloat(t);return isNaN(i)?null!=e?e:i:!/px/i.test(t)&&/pt/i.test(t)?1.3333*i:i}},"undefined"==typeof bsn&&(_b=bsn={}),void 0===_b.Autosuggest&&(_b.Autosuggest={}),_b.AutoSuggest=function(t,e){if(!document.getElementById)return 0;if(this.fld=_b.DOM.gE(t),!this.fld)return 0;this.sInp="",this.nInpC=0,this.aSug=[],this.iHigh=0,this.oP=e||{};var i,s={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:0,offsety:-5,shownoresults:!0,noresults:"No results!",maxheight:250,cache:!0,maxentries:25,blurtrigger:!1,multisuggest:!0};for(i in s)typeof this.oP[i]!=typeof s[i]&&(this.oP[i]=s[i]);var n=this;this.fld.onkeypress=function(t){return n.onKeyPress(t)},this.fld.onkeyup=function(t){return n.onKeyUp(t)},"function"==typeof this.oP.callback&&this.oP.blurtrigger&&(this.fld.onblur=function(t){if(document.activeElement&&void 0===t)var e=document.activeElement;else{for(e=t.explicitOriginalTarget;e.parentNode&&("A"!=e.tagName||"string"!=typeof e.id||"bsnsuggest"!=e.id.substring(0,10));)e=e.parentNode;"string"!=typeof e.id&&(e.id="")}"bsnsuggest"!=e.id.substring(0,10)&&(n.oP.callback({id:n.fld.value,value:n.fld.value}),n.clearSuggestions())}),this.fld.setAttribute("autocomplete","off")},_b.AutoSuggest.prototype.onKeyPress=function(t){var e=1;switch(window.event?window.event.keyCode:t.keyCode){case 13:e=(0!=this.aSug.length&&this.iHigh?this.setHighlightedValue():0e&&i&&i"+l.substring(p,p+this.sInp.length)+""+l.substring(p+this.sInp.length),u):(h=l,u.substring(0,m)+""+u.substring(p,m+this.sInp.length)+""+u.substring(m+this.sInp.length)),l!=u&&(h=d+" ("+h+")");var c=_b.DOM.cE("span",{},h,!0),g=_b.DOM.cE("img",{src:t[r].photo,width:t[r].photo_width,border:"0"});g.removeAttribute("height"),c.insertBefore(g,c.childNodes[0]);var _=_b.DOM.cE("a",{href:"javascript:void(0);"}),f=_b.DOM.cE("span",{className:"tl"}," "),y=_b.DOM.cE("span",{className:"tr"}," ");_.appendChild(f),_.appendChild(y),_.appendChild(c),_.name=r+1,_.id="bsnsuggest_"+(r+1),_.onclick=function(){return e.setHighlightedValue(),!1},_.onmouseover=function(){e.setHighlight(this.name)};var v=_b.DOM.cE("li",{},_);a.appendChild(v)}0==t.length&&this.oP.shownoresults&&(v=_b.DOM.cE("li",{className:"as_warning"},this.oP.noresults),a.appendChild(v)),i.appendChild(a);var b=_b.DOM.cE("div",{className:"as_corner"}),w=_b.DOM.cE("div",{className:"as_bar"}),x=_b.DOM.cE("div",{className:"as_footer"});x.appendChild(b),x.appendChild(w),i.appendChild(x);var E=_b.DOM.getPos(this.fld);i.style.left=E.x+"px",i.style.top=E.y+this.fld.offsetHeight+this.oP.offsety+"px",i.style.width=this.fld.offsetWidth+"px",i.onmouseover=function(){e.killTimeout()},i.onmouseout=function(){e.resetTimeout()},document.getElementsByTagName("body")[0].appendChild(i),this.iHigh=0;e=this;this.toID=setTimeout(function(){e.clearSuggestions()},this.oP.timeout)},_b.AutoSuggest.prototype.changeHighlight=function(t){var e,i=_b.DOM.gE("as_ul");if(!i)return!1;40==t?e=this.iHigh+1:38==t&&(e=this.iHigh-1),e>i.childNodes.length&&(e=i.childNodes.length),e<1&&(e=1),this.setHighlight(e)},_b.AutoSuggest.prototype.setHighlight=function(t){var e=_b.DOM.gE("as_ul");if(!e)return!1;0"+this.total+")",this.options.canComment&&(t+="
",this.options.commentHTML&&(t+="
"+this.Base.Language.TranslateFormatted(1034,[this.options.commentHTML])+"
"),this.options.commentCode&&(t+="
"),t+="
",this.options.object_owner&&this.options.object_owner_id?t+='':t+='',this.options.typeTab&&(t+=""),this.options.typeCol&&(t+=""),this.options.typeTabParent&&(t+=''),this.options.typeColParent&&(t+=''),this.options.typeChild&&(t+=''),t+="
"),t+='";var e=$(this.options.type+"_"+this.options.typeID+"_postcomment");e.innerHTML=t;var i=this;this.options.canComment&&(e.getElement("form").addEvent("submit",function(t){i.checkText(t)}),e.getElement("textarea").addEvent("focus",function(){i.removeText(this)}),e.getElement("textarea").addEvent("blur",function(){i.addText(this)}),e.getElement("form").addEvent("submit",function(t){i.doCommentPost(t)}))},doCommentPost:function(t){var e=new Event(t),i={task:"comment_post",type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,tab:this.options.typeTab,col:this.options.typeCol};this.options.typeTabParent&&(i.tab_parent=this.options.typeTabParent),this.options.typeColParent&&(i.col_parent=this.options.typeColParent),this.options.typeChild&&(i.child=this.options.typeChild),this.options.object_owner&&this.options.object_owner_id?(i.object_owner=this.options.object_owner,i.object_owner_id=this.options.object_owner_id):i.user=this.Base.Owner.user_info.user_username,$type(document.comment_post_form.comment_body)&&(i.comment_body=document.comment_post_form.comment_body.value),$type(document.comment_post_form.comment_secure)&&(i.comment_secure=document.comment_post_form.comment_secure.value);var s=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:i,onComplete:function(t,e){s.addComment(t.is_error,t.comment_body,t.comment_date)}}).send();e.stop()},doCommentEdit:function(){var t={task:"comment_edit",type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,user:this.Base.Owner.user_info.user_username};$type(document.editCommentForm.comment_id)&&(t.comment_id=document.editCommentForm.comment_id.value),$type(document.editCommentForm.comment_edit)&&(t.comment_edit=document.editCommentForm.comment_edit.value);var i=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:t,onComplete:function(t,e){i.getComments()}}).send()},doCommentDelete:function(t,e){var i=new Event(t),s={task:"comment_delete",comment_id:e,type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,tab:this.options.typeTab,col:this.options.typeCol,user:this.Base.Owner.user_info.user_username};this.options.typeTabParent&&(s.tab_parent=this.options.typeTabParent),this.options.typeColParent&&(s.col_parent=this.options.typeColParent),this.options.typeChild&&(s.child=this.options.typeChild),this.options.object_owner&&(s.object_owner=this.options.object_owner),this.options.object_owner_id&&(s.object_owner_id=this.options.object_owner_id),$type(document.commentDeleteForm.comment_body)&&(s.comment_body=document.commentDeleteForm.comment_body.value),$type(document.commentDeleteForm.comment_secure)&&(s.comment_secure=document.commentDeleteForm.comment_secure.value);var n=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:s,onComplete:function(t,e){n.getComments()}}).send();i.stop()},getComments:function(t){var e,i,s;"next"==t?this.page++:"previous"==t?this.page--:$type(t)&&(this.page=t),this.options.paginate?window.scroll(0,0):this.options.cpp=this.total,s=this.options.object_owner&&this.options.object_owner_id?(e=this.options.object_owner,i=this.options.object_owner_id,""):(i=e="",this.Base.Owner.user_info.user_username);var n=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"comment_get",user:s,object_owner:e,object_owner_id:i,type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,cpp:this.options.cpp,p:this.page},onComplete:function(t,e){n.updateComments(t)}}).send()},updateComments:function(t){if("object"!=$type(t))return alert,!1;this.total=parseInt(t.total_comments)||0,this.page=t.p;var e=t.maxpage,i=t.p_start,s=t.p_end,n=$(this.options.type+"_"+this.options.typeID+"_totalcomments"),o=$(this.options.type+"_"+this.options.typeID+"_comments"),a=$H(t.comments);n.innerHTML=this.total;document.createElement("div");o.empty();var r,h,d,l,u=this;u.Base.Core.settings.setting_url,a.each(function(t,e){var i=new Element("div",{id:"comment_"+e}),s="
";t.comment_authoruser_id&&t.comment_authoruser_exists?s+="
":s+="
",s+="
",t.comment_authoruser_id?t.comment_authoruser_exists?s+="":s+="
"+u.Base.Language.Translate(1071)+"
":s+="
"+u.Base.Language.Translate(835)+"
",s+="
"+t.comment_date+"
",i.setProperty("html",t.comment_body),s+="
"+t.comment_body+" 
",s+="
",i.setProperty("html",s),i.inject(o),i.getElement(".commentEditLink")&&i.getElement(".commentEditLink").addEvent("click",function(){u.editComment(e)}),i.getElement(".commentDeleteLink")&&i.getElement(".commentDeleteLink").addEvent("click",function(){u.confirmDelete(e)})}),this.options.paginate&&this.total>this.options.cpp&&(r=new Element("div",{styles:{"text-align":"center"}}),h=new Element("div",{styles:{"text-align":"center"}}),l=1« "+u.Base.Language.Translate(182)+"","« "+u.Base.Language.Translate(182)+""):(d="« "+u.Base.Language.Translate(182)+"","« "+u.Base.Language.Translate(182)+""),i==s?(d+=" |  "+this.Base.Language.TranslateFormatted(184,[i,this.total])+" | ",l+=" |  "+this.Base.Language.TranslateFormatted(184,[i,this.total])+" | "):(d+=" |  "+this.Base.Language.TranslateFormatted(185,[i,s,this.total])+" | ",l+=" |  "+this.Base.Language.TranslateFormatted(185,[i,s,this.total])+" | "),this.page!=e?(d+=""+u.Base.Language.Translate(183)+" »",l+=""+u.Base.Language.Translate(183)+" »"):(d+=""+u.Base.Language.Translate(183)+" »",l+=""+u.Base.Language.Translate(183)+" »"),r.setProperty("html",d),h.setProperty("html",l),r.inject(o,"top"),h.inject(o),r.getElement("a[id=comment_last_page_top]")&&r.getElement("a[id=comment_last_page_top]").addEvent("click",function(){u.getComments("previous")}),h.getElement("a[id=comment_last_page_bottom]")&&h.getElement("a[id=comment_last_page_bottom]").addEvent("click",function(){u.getComments("previous")}),r.getElement("a[id=comment_next_page_top]")&&r.getElement("a[id=comment_next_page_top]").addEvent("click",function(){u.getComments("next")}),h.getElement("a[id=comment_next_page_bottom]")&&h.getElement("a[id=comment_next_page_bottom]").addEvent("click",function(){u.getComments("next")}))},addComment:function(t,e,i){if(!this.options.canComment)return!1;t?($("comment_error").style.display="block",e.trim()?$("comment_error").innerHTML=this.Base.Language.Translate(832):(this.addText($("comment_body")),$("comment_error").innerHTML=this.Base.Language.Translate(831)),$("comment_submit").value=this.Base.Language.Translate(833),$("comment_submit").disabled=!1):($("comment_error").style.display="none",$("comment_error").innerHTML="",$("comment_body").value="",$("comment_body").style.height=this.options.originalHeight+"px",this.addText($("comment_body")),$("comment_submit").value=this.Base.Language.Translate(833),$("comment_submit").disabled=!1,$("comment_secure")&&($("comment_secure").value="",$("secure_image").src=$("secure_image").src+"?"+(new Date).getTime()),this.page=1,this.total++,this.getComments())},editComment:function(t){var e=this;if(this.isEditing)return!1;this.isEditing=!0;var i=$("profile_comment_body_"+t),s="";s+="
",s+="",s+="",s+="",s+="",s+="",s+="",this.options.typeTab&&(s+=''),this.options.typeCol&&(s+=''),this.options.typeTabParent&&(s+=''),this.options.typeColParent&&(s+=''),this.options.typeChild&&(s+=''),s+="
",i.innerHTML=s,textarea_autogrow("comment_edit_"+t),$("comment_edit_"+t).focus(),$("comment_edit_"+t).addEvent("blur",function(){e.doCommentEdit(),e.isEditing=!1})},confirmDelete:function(e){$("del_comment_id").value=e,opendivmodal("confirmcommentdelete");var i=this;$("confirmcommentdelete").getElement("form").name="commentDeleteForm",$("confirmcommentdelete").getElement("form").addEvent("submit",function(t){i.doCommentDelete(t,e)})},removeText:function(t){this.changed||(t.value="",t.style.color="#000000",this.changed=!0)},addText:function(t){t.value.trim()||(t.value=this.Base.Language.Translate(829),t.style.color="#888888",this.changed=!1)},checkText:function(t){this.changed||($("comment_body").value=""),$("comment_submit").value=this.Base.Language.Translate(830),$("comment_submit").disabled=!0}}),SocialEngineAPI.Tags=new Class({Implements:[Options],Base:{},isTagging:!1,newtag:!1,tags:[],options:{ajaxURL:"misc_js.php",ajaxMethod:"post",ajaxSecure:!1,canTag:!1,type:!1,media_id:!1,media_dir:!1,object_owner:!1,object_owner_id:!1},initialize:function(t){this.setOptions(t),this.options.initialTotal&&(this.total=this.options.initialTotal);var e=this;window.addEvent("domready",function(){e.showTagForm()})},showTagForm:function(){var t,e,i="",s=this;this.options.canTag&&(i+="
"+this.Base.Language.Translate(1212)+"
"+this.Base.Language.Translate(1213)+"
  
",t=new Element("div",{id:"media_photo_tagform",class:"media_photo_tagform",html:i}),e=$("media_photo_div"),t.inject(e),t.getElement("input[id=tag_cancel]")&&t.getElement("input[id=tag_cancel]").addEvent("click",function(){s.cancelTag()}),t.getElement("input[id=tag_save]")&&t.getElement("input[id=tag_save]").addEvent("click",function(){s.saveTag(0)}),t.getElement("a[id=tag_me]")&&t.getElement("a[id=tag_me]").addEvent("click",function(){s.saveTag(s.Base.Viewer.user_info.user_id)}),new Request.JSON({url:"misc_js.php?task=friends_all",secure:this.options.ajaxSecure,onComplete:function(t){s.addFriendToList(t.friends)}}).send())},addFriendToList:function(t){var s=this;t.each(function(t){for(var e in t){var i=new Element("div",{id:"friend_div_"+e});new Element("a",{href:"javascript:void(0)",id:"friend_link_"+e,html:t[e]}).inject(i);i.inject($("media_photo_friendlist")),$("friend_link_"+e).addEvent("click",function(){s.saveTag(e)})}})},insertTag:function(t,e,i,s,n,o,a,r){var h="",d=this;"none"==$("media_tags").style.display?$("media_tags").style.display="block":0!=d.tags.length&&(h=', ');var l,u=new Element("span",{id:"full_tag_"+t,html:h});""!=e?new Element("a",{href:e,id:"tag_link_"+t,html:i}).inject(u):new Element("span",{id:"tag_link_"+t,html:i,styles:{cursor:"pointer"}}).inject(u),!d.Base.Viewer.user_exists||d.Base.Viewer.user_info.user_username!=r&&d.Base.Viewer.user_info.user_username!=d.Base.Owner.user_info.user_username||(l=$(u).get("html"),$(u).set("html",l," ("+d.Base.Language.Translate(1228)+")")),u.inject($("media_tags")),d.createTag(t,i,s,n,o,a),$("tag_link_"+t).addEvent("mouseover",function(){d.showTag(t)}),$("tag_link_"+t).addEvent("mouseout",function(){d.hideTag(t)}),$("new_removetag_link")&&($("new_removetag_link").addEvent("click",function(){d.removeTag(t)}),$("new_removetag_link").set("id","removetag_link_"+t)),d.tags.push(t)},createTag:function(t,e,i,s,n,o){var a=this;new Element("div",{id:"tag_"+t,html:'',class:"tag_div_hidden",styles:{width:parseInt(n)-4+"px",height:parseInt(o)-4+"px",top:i+"px",left:s+"px"}}).inject($("media_photo_div")),new Element("div",{id:"tag_label_"+t,html:e,class:"tag_label",styles:{display:"none",top:parseInt(i)+parseInt(o)+10+"px",left:s+"px"}}).inject($("media_photo_div")),$("tag_"+t).addEvent("mouseover",function(){a.showTag(t)}),$("tag_"+t).addEvent("mouseout",function(){a.hideTag(t)})},showTag:function(t){$("tag_"+t).className="tag_div",$("tag_label_"+t).style.display="block"},hideTag:function(t){$("tag_"+t).className="tag_div_hidden",$("tag_label_"+t).style.display="none"},addTag:function(){var n;this.isTagging||(this.isTagging=!0,this.newtag=new MooCrop("media_photo"),(n=$("media_photo_tagform").inject(this.newtag.wrapper)).setStyles({top:this.newtag.crop.bottom+10,left:this.newtag.crop.right+10,display:"block"}),this.newtag.addEvent("onBegin",function(t,e,i,s){n.setStyle("display","none")}),this.newtag.addEvent("onCrop",function(t,e,i,s){n.setStyles({top:e.bottom+10,left:e.right+10,display:"none"})}),this.newtag.addEvent("onComplete",function(t,e,i,s){n.setStyle("display","block")}))},cancelTag:function(){this.isTagging&&($("media_photo_tag").value="",$("media_photo_tagform").inject("media_photo_div").setStyle("display","none"),this.newtag.removeOverlay.bind(this.newtag)(),this.isTagging=!1)},saveTag:function(t){var e,i,s,n;this.isTagging&&(s=this.options.object_owner&&this.options.object_owner_id?(e=this.options.object_owner,i=this.options.object_owner_id,""):(i=e="",this.Base.Owner.user_info.user_username),n=this,new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"tag_do",ajax:!0,mediatag_user_id:t,mediatag_text:$("media_photo_tag").value,mediatag_x:this.newtag.crop.top,mediatag_y:this.newtag.crop.left,mediatag_height:this.newtag.crop.height,mediatag_width:this.newtag.crop.width,user:s,object_owner:e,object_owner_id:i,type:this.options.type,media_id:this.options.media_id,media_dir:this.options.media_dir},onComplete:function(t){$type(t.mediatag_id)&&n.insertTag(t.mediatag_id,t.mediatag_link,t.mediatag_text,t.mediatag_x,t.mediatag_y,t.mediatag_width,t.mediatag_height,t.mediatag_user_username)}}).send(),$("media_photo_tag").value="",$("media_photo_tagform").inject("media_photo_div").setStyle("display","none"),this.newtag.removeOverlay.bind(this.newtag)(),this.isTagging=!1)},removeTag:function(t){var e,i,s;s=this.options.object_owner&&this.options.object_owner_id?(e=this.options.object_owner,i=this.options.object_owner_id,""):(i=e="",this.Base.Owner.user_info.user_username);new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"tag_remove",ajax:!0,mediatag_id:t,user:s,object_owner:e,object_owner_id:i,type:this.options.type,media_id:this.options.media_id}}).send();$("tag_"+t).destroy(),$("tag_label_"+t).destroy(),$("full_tag_"+t).destroy(),0==this.tags.indexOf(t)&&$("tag_comma_"+this.tags[1])&&$("tag_comma_"+this.tags[1]).destroy(),this.tags.splice(this.tags.indexOf(t),1),0==this.tags.length&&($("media_tags").style.display="none")}});var MooCrop=new Class({calculateHandles:!0,current:{},options:{maskColor:"black",maskOpacity:".3",handleColor:"#FFFFFF",handleWidth:"5px",handleHeight:"5px",cropBorder:"1px dashed #FFFFFF",min:{width:50,height:50},showMask:!0,showHandles:!1},initialize:function(t,e){if(this.setOptions(e),this.img=$(t),"img"!=this.img.get("tag"))return!1;this.resizeFunc=this.refresh.bindWithEvent(this),this.removeFunc=this.removeListener.bind(this),this.buildOverlay(),this.setup()},setup:function(){$(this.cropArea).setStyles({width:this.options.min.width,height:this.options.min.height,top:(this.img.height-this.options.min.height)/2,left:(this.img.width-this.options.min.width)/2}),this.current.crop=this.crop=this.getCropArea(),this.handleWidthOffset=this.options.handleWidth.toInt()/2,this.handleHeightOffset=this.options.handleHeight.toInt()/2,this.fixBoxModel(),this.drawMasks(),this.positionHandles()},getCropArea:function(){var t=this.cropArea.getCoordinates();return t.left-=this.offsets.x,t.right-=this.offsets.x,t.top-=this.offsets.y,t.bottom-=this.offsets.y,t},fixBoxModel:function(){var t=this.boxDiff=(this.crop.width-this.options.min.width)/2,e=this.bounds={top:t,left:t,right:this.img.width+2*t,bottom:this.img.height+2*t,width:this.options.min.width+2*t,height:this.options.min.height+2*t};this.wrapper.setStyles({width:e.right,height:e.bottom,background:"url("+this.img.src+") no-repeat "+t+"px "+t+"px"}),this.north.setStyle("width",e.right),this.south.setStyle("width",e.right)},activate:function(t,e){t.stop(),this.current={x:t.page.x,y:t.page.y,handle:e,crop:this.current.crop},"NESW"!=this.current.handle||this.options.showHandles||this.hideHandles(),this.fireEvent("onBegin",[this.img.src,this.getCropInfo(),this.bounds,e]),document.addEvent("mousemove",this.resizeFunc),document.addEvent("mouseup",this.removeFunc)},removeListener:function(){"NESW"!=this.current.handle||this.options.showHandles||this.showHandles(),document.removeEvent("mousemove",this.resizeFunc),document.removeEvent("mouseup",this.removeFunc),this.crop=this.current.crop,this.fireEvent("onComplete",[this.img.src,this.getCropInfo(),this.bounds,this.current.handle])},refresh:function(t){var e=this.current.x-t.page.x,i=this.current.y-t.page.y,s=this.bounds,n=this.crop,o=this.current.handle,a={},r=2s.bottom&&(i=n.bottom-s.bottom),r||(n.height-is.right&&(e=n.right-s.right),r||(n.width-e/g,"").replace(/­/g,""),e=this.user_displayname_short+"
"+this.Base.Language.Translate(746)+" | "+this.Base.Language.Translate(747)+"",$("ajax_status").innerHTML=e,$("status_new").focus(),$("status_new").select()},userStatusChangeReturn:function(){if(!$("ajax_status"))return!1;""==this.user_status?$("ajax_status").innerHTML=""+this.Base.Language.Translate(743)+"":$("ajax_status").innerHTML="
"+this.user_displayname_short+" "+this.user_status+"
"+this.Base.Language.Translate(1113)+" "+this.Base.Language.TranslateFormatted(773,[1])+"
"},userStatusChangeSubmit:function(){if(!$("ajax_status"))return!1;var i=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"status_change",status:$("status_new").value},onComplete:function(t,e){i.user_status=t.status,i.userStatusChangeReturn()}}).send()},userDelete:function(){opendivmodal("confirmdelete")},userDeleteConfirm:function(t){new Request.JSON({url:"user_account_delete.php",method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"dodelete",token:t},onComplete:function(t,e){window.location="home.php"}}).send()},userActionDelete:function(i){new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"action_delete",action_id:i},onComplete:function(t,e){$("action_"+i)&&($("action_"+i).style.display="none",total_actions--,0==total_actions&&($("actions").style.display="none"))}}).send()},userNotifyShow:function(){this.user_notify_cookie=new Hash.Cookie("se_show_newupdates",{duration:3600});var t=parseInt(this.user_notify_cookie.get("total"));$type(t)||(t=0),t"+t.total_grouped+""])+"";t.notifys.each(function(t){e+=""}),$("newupdates_popup").innerHTML=e},userNotifyDelete:function(i,s){var n=this;new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"notify_delete",notifytype_id:i,notify_grouped:s},onComplete:function(t,e){$("newupdates_popup").getElements("div[id=notify_"+i+"_"+s+"]").each(function(t){t.id=="notify_"+i+"_"+s&&(t.style.display="none",n.user_notify_count--)}),$("newupdates_popup").getElements("div[id=notify_"+i+"_"+s+"]").each(function(t){t.id=="notify_"+i+"_"+s&&(t.style.display="none")}),$("notify_total").innerHTML=n.user_notify_count,$("notify_total1").innerHTML=n.user_notify_count,$("newupdates_popup").getElements("span[id=notifyscount]").each(function(t){"notifyscount"==t.id&&(t.innerHTML=n.user_notify_count)}),0==n.user_notify_count&&(closemodal(),$("newupdates").style.display="none",$("newupdatesmobile").style.display="none")}}).send()},userNotifyHide:function(){$("newupdates").fade("out"),this.user_notify_cookie.set("total",this.user_notify_count)},userPhotoRemove:function(){new Request.JSON({url:"user_editprofile_photo.php",method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"remove"}}).send();$("userEditRemovePhotoLink")&&$("userEditPhotoImg")?($("userEditRemovePhotoLink").destroy(),$("userEditPhotoImg").src="images/nophoto.png"):window.location.reload(!1)},ImportUserInfo:function(t){t&&"object"==$type(t)&&t.user_exists?(this.user_exists=!0,t.user_id=parseInt(t.user_id),delete t.user_exists,this.user_info=t,this.user_info.user_fname=this.user_info.user_fname.trim(),this.user_info.user_lname=this.user_info.user_lname.trim(),this.user_info.user_fname&&this.user_info.user_lname?"asian"==this.options.displayname_order?(this.user_displayname_short=this.user_info.user_lname,this.user_displayname=this.user_info.user_lname+" "+this.user_info.user_fname):(this.user_displayname_short=this.user_info.user_fname,this.user_displayname=this.user_info.user_fname+" "+this.user_info.user_lname):this.user_info.user_fname?this.user_displayname=this.user_displayname_short=this.user_info.user_fname:this.user_info.user_lname?this.user_displayname=this.user_displayname_short=this.user_info.user_lname:this.user_info.user_username&&(this.user_displayname=this.user_displayname_short=this.user_info.user_username)):this.user_exists=!1}});