urchinTrackerPrefix="/people";var IM_ACTION={OPEN_CONVERSATION:1,ADD_FRIEND:2,DELETE_FRIEND:3,BLOCK_USER:4,SEND_LOOKING_AT:5,DECLINE_FRIENDSHIP:6,ACCEPT_FRIENDSHIP:7};var FRIENDSHIP_ACTION={AUTH_IGNORED:0,AUTH_ACCEPTED:1,AUTH_DECLINED:2};var USER_LAYOUT={THEMES_PATH:"/images/people/themes",THEMES_COUNT:25,THEMES_NAMES:["Default","Picnic","Cats","Beach","Winter Wonderland","Roses","Heartbreak","Supernova","Birds","New York","Aurora","Greenery","RockStar","Poison Ivy","Stars","Underwater","Royal","Wood","Orange Swirls","Jungle","Flight","Sheep","Blurry Lense","Rebel","Graffiti"],TYPE:{BG_COLOR:1,BG_IMAGE:2,BG_USER_IMAGE:3,BG_STYLE:4}};var IE6=navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1;if(IE6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function gotoArtistCommunity(c,b,a){if(c!="35081"&&c!="184110"){doRedirect(LOCAL_PATH_CONSTANT+"/discovery/artist.html?id="+c+"&idType="+b+"&useGenre="+a)}}function gotoGenreCommunity(a){doRedirect(LOCAL_PATH_CONSTANT+"/discovery/genre.html?id="+a)}function returnArrayValue(b,c){for(var a=0;a<b.length;a++){if(b[a].id==c){return b[a].title}}}function retitleDataArr(c,b){c=DataCache.copyObject(c);for(var a=1;a<c.length;a++){for(var d in b){if(c[a].title==d){c[a].title=b[d];break}}}return c}function scrollToElementToView(c){var b=document.getElementById(c);if(b){try{b.scrollIntoView(true)}catch(a){}}}function getStatus(a){if(a!=""){a=parseInt(a,10);return(a%2==0||a==13)?"0":"1"}return"0"}function gotoPeopleProfile(a){location.href=addAuthParams("profile.php?UserId="+a)}function gotoGallery(a){location.href=addAuthParams("gallery.html?UserId="+a)}function gotoMessages(){location.href=addAuthParams("messages.html")}var picturesObject=null;var arrowObject;var doMove=false;var movingRightAmount=0;var movingLeftAmount=0;var picMoveAmount=0;var isMouseClicked=false;function moveLeft(b,f,d,c,a){picturesObject=document.getElementById(c);if(a!=null){arrowObject=a}else{arrowObject=""}if(d){if(!doMove){if(picturesObject.picMoveAmount==0){doMove=false}else{isMouseClicked=true;doMove=true;movingLeftAmount=0;picturesObject.picMoveAmount=parseInt(picturesObject.picMoveAmount,10)-1;if(picturesObject.picMoveAmount==0){disableLeftScrolling(arrowObject)}else{enableLeftScrolling(arrowObject)}if(picturesObject.picMoveAmount==f){disableRightScrolling(arrowObject)}else{enableRightScrolling(arrowObject)}}}else{return}}if(doMove){if(movingLeftAmount<b){picturesObject.scrollLeft=picturesObject.scrollLeft-3;movingLeftAmount=movingLeftAmount+3;setTimeout("moveLeft("+b+","+f+",false,'"+c+"','"+arrowObject+"')",1)}else{doMove=false;if(isMouseClicked){moveLeft(b,f,true,c,arrowObject)}}}}function moveRight(b,f,d,c,a){picturesObject=document.getElementById(c);if(a!=null){arrowObject=a}else{arrowObject=""}if(d){if(!doMove){if(picturesObject.picMoveAmount==f){doMove=false}else{isMouseClicked=true;doMove=true;movingRightAmount=0;picturesObject.picMoveAmount=parseInt(picturesObject.picMoveAmount,10)+1;if(picturesObject.picMoveAmount==0){disableLeftScrolling(arrowObject)}else{enableLeftScrolling(arrowObject)}if(picturesObject.picMoveAmount==f){disableRightScrolling(arrowObject)}else{enableRightScrolling(arrowObject)}}}else{return}}if(doMove){if(movingRightAmount<b){picturesObject.scrollLeft=picturesObject.scrollLeft+3;movingRightAmount=movingRightAmount+3;setTimeout("moveRight("+b+","+f+",false,'"+c+"','"+arrowObject+"')",1)}else{doMove=false;if(isMouseClicked){moveRight(b,f,true,c,arrowObject)}}}}function openClientImportFriends(){if(INVITE_TRIGGER_ON){try{iMesh6Discovery.SetAdvisoryLink("<AdvisoryLink> <LinkAttributes> <Caption>Your friends are on Shareaza too. Find out who!</Caption> <ColorNormal>16711680</ColorNormal> <ColorHighlighted>10767886</ColorHighlighted> <Font> <Size/><FaceName>Arial</FaceName> <Bold>1</Bold> <Italic>0</Italic> <Underline>1</Underline> </Font> </LinkAttributes> <FromLinkCommand> <OpenWebDialog> <URL> <![CDATA["+LOCAL_PATH_CONSTANT+"/importfriends/welcome.php?userId="+myUserId+"&myPasswordHash="+myPasswordHash+"]]></URL></OpenWebDialog> </FromLinkCommand> </AdvisoryLink>")}catch(a){}}}function reportAbuse(){if(myUserId!=userId){gotoLink("reportAbuse.html?UserId="+userId)}else{alert("You cannot report yourself!")}}function copyContent(){var a=document.selection.text;document.execCommand("Copy")}function pasteContent(a){document.getElementById(a).focus();document.execCommand("Paste")}function getGenreProfileName(b){var c=false;for(var a=0;a<genreArr.length;a++){if(genreArr[a].id==b){c=genreArr[a].title}}return c}function returnGender(a){return(parseInt(a,10))?"Female":"Male"}function showLoader(){document.getElementById("ajaxLoader").style.display="inline";document.getElementById("ajaxContent").style.display="none"}var hereToArr=createObjArray([[1,"Network, Make Friends"],[2,"Get music"],[3,"Date, hook up"]],"selectObj");var orientationArr=createObjArray([[1,"Straight"],[2,"Gay"],[3,"Bisexual"],[4,"Not sure"]],"selectObj");var bodyTypeArr=createObjArray([[1,"Slim"],[2,"Slim and athletic"],[3,"Average"],[4,"Few extra pounds"],[5,"Bit more"],[6,"Bodybuilder"]],"selectObj");var hairColorArr=createObjArray([[1,"Black"],[2,"Brown"],[3,"Auburn"],[4,"Blonde"],[5,"Pale Blonde"],[6,"Red"],[7,"Orange"],[8,"Salt 'n pepper"],[9,"Gray"]],"selectObj");var eyeColorArr=createObjArray([[1,"Brown"],[2,"Hazel"],[3,"Amber/yellow"],[4,"Green"],[5,"Gray"],[6,"Blue"]],"selectObj");var religionArr=createObjArray([[1,"Atheist, not religious"],[2,"Christian"],[3,"Islam"],[4,"Jewish"],[5,"Buddhist"],[6,"Other"]],"selectObj");var smokeArr=createObjArray([[1,"Yes"],[2,"No"],[3,"Trying to quit"],[4,"Used to"]],"selectObj");var drinkArr=createObjArray([[1,"Yes"],[2,"No"],[3,"Occasionally"]],"selectObj");var foodArr=createObjArray([[1,"Omnivore (eat everything)"],[2,"Semi vegetarian"],[3,"Lacto vegetarian"],[4,"Lacto-ovo vegetarian"],[5,"Vegan"]],"selectObj");function getProBadge(){var a=document.createElement("img");a.src="../images/people/pro_badge.gif";if(!isProUser()){a.style.cursor="pointer";a.alt="Learn more about Pro Users";a.onclick=proBadgeClick}return a}function proBadgeClick(){if(isGuestMode(myUserId)){try{iMesh6Discovery.ShowNeedRegistration()}catch(b){}return}var a=getClientVersion();if(!checkClientVersion(a,CLIENT_VERSION_SUPPORT_PRO)){if(PRO_CLIENT_AVAILABLE){displayModalDialog(DYNAMIC_PATH+"/purchase/upgradeClient.html",new Array(),"dialogWidth:490px;dialogHeight:226px;status:no; resizable:no;")}else{displayModalDialog(DYNAMIC_PATH+"/people/noProNotify.html",new Array(),"dialogWidth:490px;dialogHeight:210px;status:no; resizable:no;")}}else{try{iMesh6Discovery.ShowPurchaseDialog(PURCHASE_ACTION.PRO,PURCHASE_ORIGIN.PEOPLE,"")}catch(b){}}}function uploadMultiplePhotosAvailable(){return checkClientVersion(getClientVersion(),CLIENT_VERSION_SUPPORT_HTTPUPLOADER)}function formatDate(d,h){var g=Math.max(1,(new Date(h).getTime()-new Date(d).getTime())*0.001);var c={year:86400*365,month:86400*30,week:86400*7,day:86400,hour:3600,minute:60,second:1};for(var b in c){if(g>=c[b]){if(b=="year"){return"More than a year ago"}if(b=="second"){return"1 minute ago"}var f=Math.floor(g/c[b]);if(b=="day"&&f==1){return"Yesterday"}return""+f+" "+b+(f==1?"":"s")+" ago"}}}function genLinkClickHandler(){return gotoLink(this.href)}function ie6HoverIn(){$(this).addClass("isHover")}function ie6HoverOut(){$(this).removeClass("isHover")}function checkNeedRegistration(a){if(isGuestMode(a)){try{iMesh6Discovery.ShowNeedRegistration()}catch(b){}return true}else{return false}}function setWaitCursor(){$(document.body).addClass("CursorWait")}function setNormalCursor(){$(document.body).removeClass("CursorWait")}function scrollToView(b,d){d=(d!=undefined)?d:false;var c;if(b.scrollIntoView){c=b}else{if(b instanceof jQuery){c=b.get(0)}else{if(b instanceof SmartComponent){c=b.dom.get(0)}}}if(c){try{c.scrollIntoView(d)}catch(a){}}return b}var USER_PROFILE_MODE={WHATS_UP:0,DETAILS:1,PHOTOS:2,FRIENDS:3,PARTIAL:4,PHOTOVIEW:6};var REFERENCE_TYPE={PICTURE_COMMENT:1,COMMENT:2};var NOTIFICATION_TYPE={CUSTOM_STATUS:1,PICTURE_COMMENT:2,COMMENT:3,THREADED_COMMENT:4};var FixImgSize={imgs:{},calcImgSize:function(a,f,c){var b,g=this.imgs[a].img,d=this.imgs[a].imgs[f][c];if(!(d.nW&&d.nH)){var b,k,i,j=Math.min(f/(d.nW=k=g.width),c/(d.nH=i=g.height));if(j<1){d.nW=k*j;d.nH=i*j}}while(b=d.imgs.shift()){b.attr("width",d.nW).attr("height",d.nH).css("zoom",1)}},readyStateHandler:function(c){if(this.imgs[c].img.readyState=="complete"){for(var a in this.imgs[c].imgs){for(var b in this.imgs[c].imgs[a]){this.calcImgSize(c,a,b)}}}},fix:function(f,c,b,d){var a=this.imgs[f]?this.imgs[f]:(this.imgs[f]={imgs:{}});a.imgs[b]=a.imgs[b]?a.imgs[b]:{};a.imgs[b][d]=a.imgs[b][d]?a.imgs[b][d]:{imgs:[]};a.imgs[b][d].imgs.push(c);if(!a.img){a.img=new Image();a.img.onreadystatechange=delegate(this,this.readyStateHandler,[f]);a.img.src=f}else{if(a.img.readyState=="complete"){this.calcImgSize(f,b,d)}}}};function Class(){}Class.prototype.initialize=function(){};Class.extend=function(f){var a=function(){if(arguments[0]!==Class){this.initialize.apply(this,arguments)}};var d=new this(Class);var b=this.prototype;for(var g in f){var c=f[g];if(c instanceof Function){c.Parent=b}else{a[g]=c}d[g]=c}a.prototype=d;a.extend=this.extend;return a};var SmartComponent=Class.extend({initialize:function(a,c){this.children=[];this.mps=[];this.parent=null;this.contextName=null;this.context=null;this._domStrVectors=[];this.config=a||{};this.director=this.config.director||null;this.template=this.config.template||this.template;this.eParts=null;if($.isArray(this.config.children)){for(var b=0;b<this.config.children.length;b++){this.addChildComponent(this.config.children[b])}}if(c){c.addChildComponent(this)}},name:function(a,b){if(a===null){return this}b=b||window;if(a){if(b[a]){throw new Error("[SmartComponent] Object with the same name is already exists: '"+a+"'")}else{b[a]=this;this.context=b;this.contextName=a}}else{throw new Error("Object name should be defined.")}return this},processTemplate:function(){this.dom=(this.template)?(this.template.constructor.toString().indexOf("Array")==-1)?$(this.template):$(this.template.join("")):null;if(this.dom){return true}else{return false}},createDom:function(a){if(!this.processTemplate()){return false}var c=this;var b=this.dom.find("[dom]");if(this.dom.attr("dom")){b=b.add(this.dom)}b.each(function(){var f=$(this),d=f.attr("dom");c["dom"+d]=f;c._domStrVectors.push(d)});this.eParts=this.dom.find("[e]");if(this.dom.attr("e")){this.eParts=this.eParts.add(this.dom)}this.onDomCreated()},attachEvents:function(){var a=this;this.eParts.each(function(){var b=$($(this).attr("e").replace(/ +/g,"").split(","));var c=$(this);b.each(function(){var d=this.split(":");c.bind(d[0],delegate(a,a[d[1]]))})})},onDomCreated:function(){},getRenderDest:function(a){var b=a||document.body;if(b instanceof String||typeof(b)=="string"){if(b.charAt(0)=="$"){b=$(b.substr(1),this.dom)}else{b=this["dom"+b]||this.domMountPoint||this.dom}}else{b=$(b)}return b},renderTo:function(a,f,d){if(!this.dom){this.createDom()}if(this.dom&&this.dom.length>0){for(var c=0;c<this.children.length;c++){this.children[c].renderTo(this.getRenderDest(this.mps[c].mp),this.mps[c].insert,this.mps[c].sibling)}var b=["appendTo","prependTo","insertAfter","insertBefore"];this.dom[b[(d?1:0)*2+(f?1:0)]](a||$(document.body))}this.attachEvents();this.onRenderComplete();return this.dom},onRenderComplete:function(){},addChildComponent:function(f,c,d,b){if(!f){return false}this.children.push(f);f.parent=this;var a={mp:c||"MountPoint",insert:d||false,sibling:b||false};this.mps.push(a);if(this.dom){f.renderTo(this.getRenderDest(a.mp),a.insert,a.sibling)}return f},addChildrenComponents:function(b){if(b&&b.length){for(var a=0;a<b.length;a++){if(b[a].component){this.addChildComponent(b[a].component,b[a].mp||null,b[a].insert||null,b[a].insert||null)}else{if(b[a].length&&b[a][0]){this.addChildComponent(b[a][0],b[a][1]||null,b[a][2]||null,b[a][3]||null)}else{if(b[a]){this.addChildComponent(b[a])}}}}}},destroy:function(){$(this.children).each(function(){this.destroy()});if(this.parent){this.parent.removeChild(this);this.parent=null}if(this.dom){var a=this;$(this._domStrVectors).each(function(){a["dom"+this]=null});this.dom.remove();this.dom=null}if(this.context&&this.context[this.contextName]){this.context[this.contextName]=undefined}},removeChild:function(b){for(var a=0;a<this.children.length;a++){if(this.children[a]==b){this.children.splice(a,1);this.mps.splice(a,1);return}}},hitTest:function(a,h,c){var f=c||this.dom;if(!f){return{}}var g=this.getPos(f);var b=this.getSize(f);var d=((a>=g.left)&&(a<=(g.left+b.width))&&(h>=g.top)&&(h<=(g.top+b.height)));return d},getPos:function(a){var b=a||this.dom;if(!b){return{top:0,left:0}}var c=$(b).offset();return c},getSize:function(a){var b=a||this.dom;if(!b){return{width:0,height:0}}return{width:$(b).width(),height:$(b).height()}},template:null});var mvcEvent=Class.extend({initialize:function(a,c,f,g){var d=false;var b=(g!=undefined)?g:true;this.cancel=function(){if(b){d=true}};this.isCancelled=function(){return d};this.sender=a;this.type=c;this.data=f}});var mvcSmartView=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);if(this.config.controller){this.setController(this.config.controller)}this.mainLoad=null},setController:function(b,a){if(!(b instanceof mvcModelController)){throw {code:"-1",message:"Incompatible types. mvcModelController expected"}}this.controller=b;if(a){b.registerNamedView(a,this)}else{b.registerView(this)}return this},update:function(a){},destroy:function(){arguments.callee.Parent.destroy.apply(this,arguments);if(this.controller){this.controller.unRegisterView(this)}},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.controller){this.controller.viewEvent(new mvcEvent(this,"domCreated"))}}});var mvcViewBasic=Class.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.config=a||{};if(this.config.controller){this.setController(this.config.controller)}},setController:function(b,a){if(!(b instanceof mvcModelController)){throw {code:"-1",message:"Incompatible types. mvcModelController expected"}}this.controller=b;if(a){b.registerNamedView(a,this)}else{b.registerView(this)}this.controller.viewEvent(new mvcEvent(this,"domCreated"))},update:function(a){}});var SmartPreloadableMvcView=mvcSmartView.extend({getLoaderParent:function(){}});var mvcModelController=Class.extend({initialize:function(){this.views={};this.listeners=[];this.idCounter=0},registerView:function(c,d){for(var b in this.views){if(c==this.views[b]){return}}this.registerNamedView("instance"+(this.idCounter++),c,d)},registerNamedView:function(b,a,c){if(!(a instanceof mvcViewBasic||a instanceof mvcSmartView)){throw {code:"-1",message:"Incompatible types. mvcView expected"}}if(this.views[b]){unRegisterView(b)}this.views[b]=a;if(c||c==undefined){this.listeners.push(a)}},unRegisterView:function(a){if(typeof(a)=="string"){return this.unRegisterNamedView(a)}for(var b in this.views){if(a==this.views[b]){return this.unRegisterNamedView(b)}}},unRegisterNamedView:function(a){if(!this.views[a]){throw {code:"-2",message:"Object not found. No view with specified name found "+a}}for(var b=0;b<this.listeners.length;b++){if(this.listeners[b]==this.views[a]){this.listeners.splice(b,1);break}}delete this.views[a]},getNamedView:function(a){if(!this.views[a]){throw {code:"-2",message:"Object not found. No view with specified name found "+a}}return this.views[a]},updateListeners:function(c){if(!(c instanceof mvcEvent)){throw {code:"-1",message:"Incompatible types. mvcEvent expected"}}this.handleEvent(c);var b=this.listeners.slice(0);for(var a=0;a<b.length&&!c.isCancelled();a++){b[a].update(c)}},viewEvent:function(a){this.updateListeners(a)},getAuthRequestStr:function(b,a){b=b||((myUserId!=undefined)?myUserId:"");a=a||((myPasswordHash!=undefined)?myPasswordHash:"");return("<User><ID>"+b+"</ID><PasswordHash><![CDATA["+a+"]]></PasswordHash></User>")},getClientVerRequestStr:function(){return("<ClientVersion>"+getClientVersion()+"</ClientVersion>")},handleEvent:function(a){}});var WebRequest=Class.extend({initialize:function(g,a,b,d,f,c){this.id=g||"request"+(++WebRequest.idCounter);this.endPoint=a||null;this.func=b||null;this.xmlDoc=d||null;this.params=f||null;this.myState=WebRequest.State.NEW;this.response=null;this.error={code:0,message:null};this.timeout=c||null},complete:function(a,b,c){this.myState=WebRequest.State.READY;this.response=a;this.error.code=b;this.error.message=c},done:function(){this.myState=WebRequest.State.DONE}});WebRequest.idCounter=0;WebRequest.State={NEW:0,RUNNING:1,READY:2,DONE:3,ERROR:4};var WebRequestExec=Class.extend({executeRequest:function(d,b,f){var a=[];var l;var k;function c(j){if(!(j instanceof Array)){j=[j]}for(var p=0;p<j.length;p++){if(j[p] instanceof Array){c(j[p])}else{if(j[p] instanceof WebRequest){a.push(j[p])}else{throw {code:"-1",message:"Incompatible types. WebRequest expected"}}}}}function n(p){var j=[];for(var i in p){j.push(encodeURIComponent(i)+"="+encodeURIComponent(p[i]))}return j.join("&")}function m(i,j,p){i.complete(j,0,p);if($.isFunction(d)){d(i)}}function g(p,q,r,i){var j=-1;if(r=="timeout"){j=-2}else{if(r=="parsererror"){j=-3}else{if(r=="error"){j=-4}}}p.complete(null,j,r);if($.isFunction(b)){b(p)}}c(f);var h=0;for(l=0;l<a.length;l++){$.ajax({type:"POST",url:DYNAMIC_PATH+a[l].endPoint+"?function="+encodeURIComponent(a[l].func)+(a[l].params?"&"+$.param(a[l].params):""),data:"XMLDOC="+encodeURIComponent(a[l].xmlDoc),dataType:"xml",timeout:(a[l].timeout)?a[l].timeout:AJAX_TIMEOUT,success:delegate(this,m,[a[l]]),error:delegate(this,g,[a[l]])});a[l].myState=WebRequest.State.RUNNING;h++}return h}});var PageManager=mvcModelController.extend({initialize:function(){arguments.callee.Parent.initialize.apply(this,arguments);this.executor=new WebRequestExec();this.scheduledRequests={};this.requestsRunning=0;this.data={};this.unloadHandler=delegate(this,this.cleanup);window.attachEvent("onunload",this.unloadHandler)},controllerInitialize:function(){var c=new mvcEvent(this,"init",null,false);this.updateListeners(c);var d=[];for(var b in this.scheduledRequests){d.push(this.scheduledRequests[b])}this.executeRequest(d);this.scheduledRequests={}},scheduleRequest:function(a){if(!(a instanceof WebRequest)){throw {code:"-1",message:"Incompatible types. WebRequest expected"}}this.scheduledRequests[a.id]=a;this.data[a.id]=a},executeRequest:function(a){this.data[a.id]=a;this.requestsRunning+=this.executor.executeRequest(delegate(this,this.onRequestSuccess),delegate(this,this.onRequestFailure),a)},getRequest:function(a){if(this.data[a]){return this.data[a]}return null},requestFinished:function(){this.requestsRunning--;this.checkRequestsRunning()},onRequestSuccess:function(a){this.updateListeners(new mvcEvent(this,a.id+"Ready",a));a.done();this.requestFinished()},onRequestFailure:function(c){var b=c.error.code;var a={"-2":"requestTimeout","-3":"requestParserError","-4":"requestServerError"};if(b in a){this.updateListeners(new mvcEvent(this,a[b],c))}this.requestFinished()},checkRequestsRunning:function(){if(!this.requestsRunning){this.updateListeners(new mvcEvent(this,"ready",null,false));this.updateListeners(new mvcEvent(this,"updateComplete",null,false))}},cleanup:function(){window.detachEvent("onunload",this.unloadHandler)},handleEvent:function(a){arguments.callee.Parent.handleEvent.apply(this,arguments);if(a.type=="trackGA"){this.trackGA(a.data)}},trackGA:function(a){if(pageTracker){try{pageTracker._trackPageview(urchinTrackerPrefix+((a)?("/"+a):""))}catch(b){}}}});var SmartLoader=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);if(this.config.preloadable&&!(this.config.preloadable instanceof SmartPreloadableMvcView)){throw {code:-1,message:"Invalid type. Preloadable expected"}}this.preloadable=this.config.preloadable;this.loadingClassName=this.config.loadingClassName||"Loading"},__serveLoader:function(b,a){switch(b){case"show":this.serveShow(a);this.dom.show();if(this.preloadable){$(this.preloadable.getLoaderParent()).addClass(this.loadingClassName)}else{$(document.body).addClass(this.loadingClassName)}break;case"hide":this.dom.hide();if(this.preloadable){$(this.preloadable.getLoaderParent()).removeClass(this.loadingClassName)}else{$(document.body).removeClass(this.loadingClassName)}break}},show:function(a){this.__serveLoader("show",a)},hide:function(){this.__serveLoader("hide")},serveShow:function(){},update:function(a){if(a.type=="updateComplete"){this.hide();this.controller.viewEvent(new mvcEvent(this,"onRootLoaderUpdateCompleteHide"))}}});var RootLoader=SmartLoader.extend({initialize:function(a){arguments.callee.Parent.initialize.apply(this,arguments);this.pageCrashCached=false},update:function(a){if(((a.type=="requestTimeout"&&(a.data.id=="peopleHomeMain"||a.data.id=="userProfileRequest"||a.data.id=="userPersonalDetails"||a.data.id=="loadUserData"))||(a.type=="loadingCrash"))&&!this.pageCrashCached){this.pageCrashCached=true;$(document.body).addClass("Loading");this.dom.addClass("onPageLoadCrash");this.domDesc.html(((a.type=="requestTimeout")?"The page seems to be taking too much time to load":"An error occurred while trying to load the page")+". <br /> <a hideFocus=\"true\" href=\"javascript:location.href=location.href.replace(/#/g, '') + '';\">Reload this page</a>")}else{if(!this.pageCrashCached){arguments.callee.Parent.update.apply(this,arguments)}}},template:['<div class="ProcessingRootLoader Module" style="display: none;">','<div class="ProcessingRootLoaderData">','<div class="Message">','<h3 class="Message">Processing your request</h3>','<p class="Message" dom="Desc">Loading, Please wait...</p>',"</div>","</div>","</div>"]});var Slider=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.className=this.config.className||"";this.Item=this.config.Item||this.Item||null;this.EmptyItem=this.config.EmptyItem||this.EmptyItem||null;this.emptyItemConfig=this.config.emptyItemConfig||{};this.itemsData=this.config.itemsData||null;this.itemsGenerated=[];this.emptyItemsCount=0;this.emptyItemsGenerated=[];this.itemsPreparedToViewCount=0;this.itemsUnPreparedToView=[];this.frameMoveAmount=0;this.movingRightAmount=0;this.movingLeftAmount=0;this.isMouseClicked=false;this.doMove=false;this.runFlag=false;this.controlsHandled=false},drawItems:function(a){a=a||{};this.Item=a.Item||this.Item||null;this.EmptyItem=a.EmptyItem||this.EmptyItem||null;this.emptyItemConfig=a.emptyItemConfig||{};this.itemsData=this.itemsData||a.itemsData||null;this.itemsCount=(this.itemsData)?this.itemsData.length:0;this.itemsPerFrame=a.itemsPerFrame||6;this.frameItemShift=a.frameItemShift||75;this.frameScrollAmount=(this.itemsCount)?(this.itemsCount-this.itemsPerFrame):0;if(!this.dom){return}if(this.itemsData&&this.Item){if(!this.oSliderRow){this.addChildComponent(new SmartComponent({template:'<tr class="SliderFrameItemsList'+((this.className)?(" "+this.className):"")+'"/>'}).name("oSliderRow",this))}this.drawPlainItems();if(this.itemsCount<this.itemsPerFrame&&this.EmptyItem){this.emptyItemsCount=this.itemsPerFrame-this.itemsCount;this.drawEmptyItems(this.emptyItemsCount)}}this.checkControls();return this},drawPlainItems:function(){for(var a=0;a<this.itemsData.length;a++){var b=new this.Item(this.itemsData[a]);this.itemsGenerated.push(b);this.oSliderRow.addChildComponent(b)}},drawEmptyItems:function(b){for(var a=0;a<b;a++){var c=new this.EmptyItem(this.emptyItemConfig);this.emptyItemsGenerated.push(c);this.oSliderRow.addChildComponent(c)}},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.drawItems(this.config);this.domMountPoint=this.domSliderFrameItemsBody;this.domSliderFrameItemsHTMLNode=this.domSliderFrameItems[0];if(this.className){this.dom.addClass(this.className)}},initControlsHandle:function(){if(this.itemsGenerated.length>this.itemsPerFrame){this.controlsHandled=true;var a=delegate(this,this.onControlLeave);this.domMoveLeftLink.bind({mousedown:delegate(this,this.onLControlMouseDown),mouseup:a,mouseout:a});this.domMoveRightLink.bind({mousedown:delegate(this,this.onRControlMouseDown),mouseup:a,mouseout:a})}},checkControls:function(){if(this.itemsGenerated.length>this.itemsPerFrame){if(!this.controlsHandled){this.initControlsHandle()}this.enableRightScrolling()}else{this.disableRightScrolling()}},onLControlMouseDown:function(){this.doCancelBubble();this.moveLeft(true)},onRControlMouseDown:function(){this.doCancelBubble();this.moveRight(true);if(!this.runFlag){this.runFlag=true;this.prepareToView()}},onControlLeave:function(){this.doCancelBubble();this.isMouseClicked=false},doCancelBubble:function(){window.event.cancelBubble=true;return window.event},prepareToView:function(){$(this.itemsUnPreparedToView).each(function(){this.revealImage();this.itemsUnPreparedToView=null})},enableLeftScrolling:function(){this.domMoveLeftLink.removeClass("Disabled")},enableRightScrolling:function(){this.domMoveRightLink.removeClass("Disabled")},disableLeftScrolling:function(){this.domMoveLeftLink.addClass("Disabled")},disableRightScrolling:function(){this.domMoveRightLink.addClass("Disabled")},moveLeft:function(a){if(a){if(!this.doMove){if(this.frameMoveAmount==0){this.doMove=false}else{this.isMouseClicked=true;this.doMove=true;this.movingLeftAmount=0;this.frameMoveAmount--;if(this.frameMoveAmount==0){this.disableLeftScrolling()}else{this.enableLeftScrolling()}if(this.frameMoveAmount==this.frameScrollAmount){this.disableRightScrolling()}else{this.enableRightScrolling()}}}else{return}}if(this.doMove){if(this.movingLeftAmount<this.frameItemShift){this.domSliderFrameItemsHTMLNode.scrollLeft-=3;this.movingLeftAmount=this.movingLeftAmount+3;setTimeout(delegate(this,this.moveLeft,[false]),1)}else{this.doMove=false;if(this.isMouseClicked){this.moveLeft(true)}}}},moveRight:function(a){if(a){if(!this.doMove){if(this.frameMoveAmount==this.frameScrollAmount){this.doMove=false}else{this.isMouseClicked=true;this.doMove=true;this.movingLeftAmount=0;this.frameMoveAmount++;if(this.frameMoveAmount==0){this.disableLeftScrolling()}else{this.enableLeftScrolling()}if(this.frameMoveAmount==this.frameScrollAmount){this.disableRightScrolling()}else{this.enableRightScrolling()}}}else{return}}if(this.doMove){if(this.movingLeftAmount<this.frameItemShift){this.domSliderFrameItemsHTMLNode.scrollLeft+=3;this.movingLeftAmount=this.movingLeftAmount+3;setTimeout(delegate(this,this.moveRight,[false]),1)}else{this.doMove=false;if(this.isMouseClicked){this.moveRight(true)}}}},Item:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.parent.parent.itemsPreparedToViewCount<this.parent.parent.itemsPerFrame){this.revealImage();this.parent.parent.itemsPreparedToViewCount++}else{this.parent.parent.itemsUnPreparedToView.push(this)}this.domImageWrap.hover(delegate(this,this.mouseOver,[this.domImageWrap]),delegate(this,this.mouseOut,[this.domImageWrap]))},revealImage:function(){this.domImageCanvas.css({"background-image":"url("+IMAGE_PATH_CDN+getUserImagePath(myUserId,this.pictureId,this.pictureType,"d",this.gender).path+")"})},mouseOver:function(a){if(!this.parent.parent.doMove){a.addClass("hov")}},mouseOut:function(a){if(!this.parent.parent.doMove){a.removeClass("hov")}},template:["<td>","<dl>",'<dt dom="ImageWrap" class="ImageWrap">','<div class="ImageCanvas" dom="ImageCanvas" />',"</dt>","</dl>","</td>"]}),template:['<div class="Slider">','<div class="SliderControls">',"<ul>",'<li class="MoveLeft">','<span dom="MoveLeftLink" class="Disabled" />',"</li>",'<li class="MoveRight">','<span dom="MoveRightLink" class="Disabled" />',"</li>","</ul>","</div>",'<div class="SliderFrame">','<div dom="SliderFrameItems" class="SliderFrameItems">','<table class="SFIBase" cellpadding="0" cellspacing="0" border="0">','<tbody dom="SliderFrameItemsBody" />',"</table>","</div>","</div>","</div>"]});var PeopleSearchParams=Class.extend({initialize:function(a){this.cookie=a||"psPar";this.params={};this.load()},load:function(){var b=readCookie(this.cookie);if(b!=null){var a=b.split("|");for(var d=0;d<a.length;d++){var c=a[d].split("=");if((c[0]=="mrt")||(c[0]=="edu")){c[1]=c[1].split(",")}this.params[c[0]]=c[1]}}this.params.pic=this.params.pic!=undefined?this.params.pic:"";this.params.online=this.params.online!=undefined?this.params.online:""},save:function(){var c=[];for(var b in this.params){if(this.params[b]&&this.params[b].constructor.toString().indexOf("Array")!=-1){c.push(b+"="+this.params[b].join(","))}else{c.push(b+"="+this.params[b])}}saveCookie(this.cookie,c.join("|"))},setParam:function(b,c,a){if(a){if(this.params[b]&&this.params[b].constructor.toString().indexOf("Array")==-1){this.params[b]=[this.params[b]]}else{if(!this.params[b]){this.params[b]=[]}}this.params[b].push(c)}else{this.params[b]=c}return this},getParam:function(a){return this.params[a]},unsetParam:function(a){if(a&&a.constructor.toString().indexOf("Array")!=-1){for(var b=0;b<a.length;b++){delete this.params[a[b]]}}else{delete this.params[a]}return this}});var XML={isNumber:function(b){var a=Object.prototype.toString.call(b).match(/^\[object\s(.*)\]$/)[1];return(a=="String")?(b.match(/^[\+-]?[0-9]{1,9}(?:\.[0-9]*)?\b$/)?true:false):(a=="Number")},getTypedNodeValue:function(c,b){var a=getNodeValue(c,b);return XML.isNumber(a)&&c.firstChild.nodeType!=4?(a.indexOf(".")?parseFloat(a):parseInt(a)):a},xmlToObject:function(b,d){d=d||{};if(b.nodeType==9){return XML.xmlToObject(b.documentElement,d)}if(!b.firstChild){d[b.nodeName]=null}else{for(var a=b.firstChild;a!=null;a=a.nextSibling){if(a.nodeType==8){continue}var g=a.nodeName;var c=null;if(a.hasChildNodes){if($.inArray(a.firstChild.nodeType,[3,4])!=-1){c=XML.getTypedNodeValue(a,null)}else{if(a.nodeType==1){c=XML.xmlToObject(a,c)}}}if(d[g]!=undefined){if(!$.isArray(d[g])){var f=d[g];d[g]=[f]}d[g].push(c)}else{d[g]=c}}}return d}};function arrayUnique(b){var f=new Array();o:for(var d=0,c=b.length;d<c;d++){for(var a=0,g=f.length;a<g;a++){if(f[a]==b[d]){continue o}}f[f.length]=b[d]}return f}function smartJoin(b){for(var a=0;a<b.length;a++){if(b[a].constructor.toString().indexOf("Array")!=-1){b[a]=smartJoin(b[a])}}return b.join("")}var DataCache=Class.extend({initialize:function(){this.cache={};this.buffer=null;return this},get:function(a,b){b=b!=undefined?b:null;if(this.cache[a]==undefined){return b}else{return this.cache[a]}},set:function(a,b){this.cache[a]=this.buffer=b;return this},last:function(a){a=a!=undefined?a:null;if(this.buffer!=undefined){return this.buffer}else{return a}}});DataCache.copyObject=function(b){var c=(b instanceof Array)?[]:{};if(b instanceof Array){for(var a=0;a<b.length;a++){c[a]=(b[a]&&!$.isFunction(b[a])&&b[a] instanceof Object)?DataCache.copyObject(b[a]):b[a]}}else{for(var a in b){c[a]=(b[a]&&!$.isFunction(b[a])&&b[a] instanceof Object)?DataCache.copyObject(b[a]):b[a]}}return c};var Ellipsisor=Class.extend({initialize:function(a){this.config=a||{};this.relativeHolder=this.config.relativeHolder||document.body;this.maxH=this.config.maxH||null;this.titled=this.config.titled!=undefined?this.config.titled:true;this.titleLim=this.config.titleLim||false;this.controlledDom=this.config.controlledDom||null;this.dotextended=this.config.dotextended!=undefined?this.config.dotextended:true;this.charLim=this.config.charLim||false;this.charTrimAmount=this.config.charTrimAmount||20;this.independent=this.config.independent!=undefined?this.config.independent:true},ellipsis:function(a){var b=a||false;a=a||{},rH=a.relativeHolder||this.relativeHolder,cD=a.controlledDom||this.controlledDom,_maxH=a.maxH||this.maxH,_titled=(a.titled!=undefined)?a.titled:this.titled,_titleLim=a.titleLim||this.titleLim,_dotextended=(a.dotextended!=undefined)?a.dotextended:this.dotextended,_charLim=a.charLim||this.charLim,_charTrimAmount=a.charTrimAmount||this.charTrimAmount,_limited=false;this.uniServe=(typeof(this.uniServe)=="function"&&!b)?this.uniServe:function(h,i,d,c){if(h){if(!c){if((d>h)&&_charLim){cD.text(cD.text().substr(0,_charLim));if(cD.text().lastIndexOf(" ")!=-1){cD.text(cD.text().substr(0,cD.text().lastIndexOf(" ")))}if(_dotextended){cD.text(cD.text()+"...");_limited=true}}}i.attr("title",((d>h)&&_titled)?((_titleLim)?cD.text(cD.text(cD.text().substr(0,_titleLim)+((cD.text().length>_titleLim)?"...":""))):cD.text()):"");while(((c)?i.height():cD.text().length)>h){var g=cD.text().lastIndexOf(" ");var f=cD.text().length-_charTrimAmount;cD.text(cD.text().substr(0,Math.max(g,f)));if(_dotextended){cD.text(cD.text()+"...")}_limited=true}}return _limited};_limited=this.uniServe(_maxH,rH,rH.height(),true);_limited=this.uniServe(_charLim,rH,cD.text().length);if(_limited){return true}else{return false}}});Ellipsisor.setEndingDots=function(b,a,d){if(a){if(d){var c=d.lastIndexOf(".");if(c==(d.length-1)){d=d.substr(0,c)}b.append(document.createTextNode(d))}b.append("...");return true}else{if(d){b.append(document.createTextNode(d))}return false}};Ellipsisor.ellipsisFormatted=function(g){var g=g||{},m=g.$el,h=g.str,k=g.charLim||0,b=g.lineLim||0,l=false,j="";if(k&&h.length>k){h=h.substr(0,k);l=true}var a=$.trim(h).split("\n");if(!b){for(var f=0;f<a.length;f++){if(l){if(f!=a.length-1){m.append(document.createTextNode(a[f])).append("<br />")}else{j=a[f]}}else{m.append(document.createTextNode(a[f]));if(f!=a.length-1){m.append("<br />")}}}return Ellipsisor.setEndingDots(m,l,j)}else{var d=a;a=a.slice(0,b);if(d.length>a.length){l=true}for(var f=0;f<a.length;f++){if(f!=a.length-1){m.append(document.createTextNode(a[f])).append("<br />")}else{j=a[f]}}return Ellipsisor.setEndingDots(m,l,j)}};var RowBase=SmartComponent.extend({renderTo:function(a,d,c){a=a||$(document.body);this.dom=this.domMountPoint=a;for(var b=0;b<this.children.length;b++){this.children[b].renderTo(this.getRenderDest(this.mps[b].mp),this.mps[b].insert,this.mps[b].sibling)}return this.dom}});var ColBase=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);if(this.config.className){this.template=['<div class="ColBase ',this.config.className,'ColBase"><ul dom="ColBase" class="ColBase ',this.config.className,'ColBase"></ul></div>']}},renderTo:function(a,g,f){if(!this.dom){this.createDom()}if(this.dom&&this.dom.length>0){for(var d=0;d<this.children.length;d++){var h=$("<li "+((this.config.colProperties&&this.config.colProperties[d]&&typeof this.config.colProperties[d]=="string")?this.config.colProperties[d]:'class="Col"')+"></li>");if(typeof this.config.colProperties[d]!="string"){for(var c in this.config.colProperties[d]){h.attr(c,this.config.colProperties[d][c])}h.addClass("Col")}if(this.config.className){h.addClass(this.config.className)}if(this.config.addonClassName){h.removeClass("Col").addClass(addonClassName)}this.domColBase.append(h);if(this.children[d]){this.children[d].renderTo(h,this.mps[d].insert,this.mps[d].sibling)}}}var b=["appendTo","prependTo","insertAfter","insertBefore"];this.dom[b[(f?1:0)*2+(g?1:0)]](a||$(document.body));return this.dom},template:'<div class="ColBase"><ul dom="ColBase" class="ColBase"></ul></div>'});var SmartInnerModuleLoader=SmartLoader.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.rootClass=this.config.className||"";this.minHeight=this.config.minHeight||0;this.template=this.config.template||('<div class="InnerLoader '+((this.rootClass)?this.rootClass:"")+'ModuleLoader"></div>')},serveShow:function(a){a=a||$(this.preloadable?this.preloadable.getLoaderParent():document.body).height();a=(this.minHeight)?((this.minHeight>a)?this.minHeight:a):a;if(IE6){this.dom.height(a)}else{this.dom.css({"min-height":a})}}});var ItemsGrid=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.rowTemplateTag=this.config.rowTemplateTag||"ul";this.rowTplTagParams=this.config.rowTplTagParams||null;this.rowTemplate=[];this.rowTemplate.push("<",this.rowTemplateTag,((this.rowTplTagParams)?(" "+this.rowTplTagParams):""),"></",this.rowTemplateTag,">");this.rowTemplate=this.rowTemplate.join("");this.itemsPerRow=this.config.itemsPerRow||1;this.Item=this.config.Item||null;this.itemController=this.config.controller||null;this.items=a.items||[];this.lines=[]},renderTo:function(a){a=a||$(document.body);this.dom=this.domMountPoint=a;for(var b=0;b<this.children.length;b++){this.children[b].renderTo(this.getRenderDest(this.mps[b].mp),this.mps[b].insert,this.mps[b].sibling)}this.createRowGrigStructure();return this.dom},createRowGrigStructure:function(){var d=this;if(this.items.length){var b=[];var a=[];for(var c=0;c<this.items.length;c++){if(a.length==this.itemsPerRow){b.push(a);a=[]}a.push(this.items[c])}b.push(a);$(this.lines).each(function(){this.destroy()});this.lines=[];$(b).each(function(){d.addLine.call(d,this)});return this}},addLine:function(a){this.lines.push(this.addChildComponent(new this.ItemLine({items:a,template:this.rowTemplate,Item:this.Item,controller:this.itemController})))},ItemLine:SmartComponent.extend({initialize:function(b,c){arguments.callee.Parent.initialize.apply(this,arguments);this.Item=this.config.Item||null;this.itemController=this.config.controller||null;var a=b.items||[];this.items=[];var d=this;if(a.length&&this.Item){$(a).each(function(){d.addItem.call(d,this)})}},destroy:function(){$(this.items).each(function(){this.destroy()});this.items=[];arguments.callee.Parent.destroy.apply(this,arguments)},addItem:function(a){if(a){var b=new this.Item(a);if(this.parent&&this.parent.director){b.director=this.parent.director}try{b.setController(this.itemController)}catch(c){}this.items.push(this.addChildComponent(b))}}}),destroy:function(){$(this.lines).each(function(){this.destroy()});this.lines=[];if(this.parent){this.parent.removeChild(this);this.parent=null}this.dom=this.domMountPoint=null;if(this.context&&this.context[this.contextName]){this.context[this.contextName]=undefined}}});var Taber=SmartPreloadableMvcView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.tabComponents=[];this.tabs=[];this.activeTabId=null;this.previousTabId=null;this.loaderSize=0;this.customOptionsBuffer=[]},getLoaderParent:function(){return this.domTabsHolder},renderOnDemand:function(a){if(!$.isFunction(a)){throw {code:"-1",message:"Incompatible types. mvcSmartView prototype expected"}}var d=new a();try{d.setController(this.controller)}catch(c){}var b=this.tabs[this.activeTabId];if(!b.body.dom){b.body.renderTo(this.domTabsDeckList)}d.renderTo(b.body.dom);this.tabComponents.push({component:d,tabId:this.activeTabId,loadStatus:null});return d},setActiveTab:function(g,j){g=g||0;if(this.activeTabId!==null){var d=new mvcEvent(this,"onTabBeforeDeactivate",{readyToUse:true,receivers:this.tabs[this.activeTabId].body.children});this.controller.viewEvent(d);if(!d.data.readyToUse){return}this.hideActiveTab();this.previousTabId=this.activeTabId}else{this.previousTabId=this.tabId}this.activeTabId=g;this.tabs[this.activeTabId].head.domTabLink.addClass("Active");this.tabs[this.activeTabId].body.children=[];var c=this.config.tabs[this.activeTabId].children;var b=[];if(!this.tabs[this.activeTabId].rendered){for(var h=0,a=c.length;h<a;h++){var f=this.renderOnDemand(c[h]);this.tabs[this.activeTabId].body.children.push(f)}this.tabs[this.activeTabId].rendered=true}this.controller.viewEvent(new mvcEvent(this,"onTabActivate",{receivers:this.tabs[this.activeTabId].body.children,previousTabId:this.previousTabId,activeTabId:this.activeTabId,params:j||{}}));this.checkTabComplete();return this},hideActiveTab:function(){var b=this.tabs[this.activeTabId];this.loaderSize=this.domTabsHolder.height();b.head.domTabLink.removeClass("Active");this.domCustomOptionsList.children().removeClass("Active");var a=this.tabComponents.length;while(--a>=0&&this.tabComponents.length>0){if(this.tabComponents[a]&&this.tabComponents[a].tabId==this.activeTabId){this.tabComponents[a].component.destroy();this.tabComponents.splice(a,1)}}b.body.dom.remove();b.body.dom=null;b.body.children=null;b.rendered=false},showActiveTab:function(){this.tabs[this.activeTabId].body.dom.show()},checkTabComplete:function(){var b=true;for(var a=0;a<this.tabs.length;a++){if(this.tabComponents[a]&&this.activeTabId==this.tabComponents[a].tabId){if(this.tabComponents[a].loadStatus&&this.tabComponents[a].loadStatus!="complete"){b=false;break}}}if(b){this.showActiveTab();if(this.loader){this.loader.hide()}this.controller.viewEvent(new mvcEvent(this,"onTabComplete",{receivers:this.tabs[this.activeTabId].body.children}))}else{this.tabs[this.activeTabId].body.dom.hide();this.loader.show()}},getActiveTabComponentId:function(b){var c=-1;for(var a=0;a<this.tabs.length;a++){if(this.tabComponents[a]&&this.tabComponents[a].component==b.sender){c=a}}return c},update:function(l){var h=this;switch(l.type){case"setActiveTab":if(l.data){this.setActiveTab(l.data.tabId,l.data.params)}break;case"onPreloadComponent":var b=this.getActiveTabComponentId(l);if(b>-1){this.tabComponents[b].loadStatus="inprogress";if(!this.loader){new SmartInnerModuleLoader({preloadable:this,template:'<div class="TabLoader FillFix"><div class="TabLoaderData"></div></div>'}).name("loader",this).renderTo(this.domTabsHolder)}this.loader.show(this.loaderSize)}break;case"onTabRefresh":case"onTabContentChange":var b=this.getActiveTabComponentId(l);if(b>-1){if(l.type=="onTabRefresh"){this.tabComponents[b].loadStatus="refresh"}this.loader.show(this.domTabsHolder.height())}break;case"onLoadComponent":var b=this.getActiveTabComponentId(l);if(b>-1){this.tabComponents[b].loadStatus="complete";this.checkTabComplete()}break;case"onSetCustomOption":var b=this.getActiveTabComponentId(l);if(b>-1){for(var m=0;m<l.data.length;m++){var d=-1,n=l.data[m],c,j;if(n.event){j="event"}else{if(n.callback){j="callback"}}c=n[j];for(var k=0;k<this.customOptionsBuffer.length;k++){if(c&&this.customOptionsBuffer[k].config[j]==c){d=k;break}}this.domCustomOptionsList.children().removeClass("Active");if(d==-1){var g=$('<li class="Active"><a href="#" hidefocus="hidefocus">'+n.optName+"</a></li>");var a=[];if(j=="event"){a.push(this.controller,this.controller.viewEvent,[new mvcEvent(this,n.event,n.params)])}else{if(j=="callback"){a.push(l.sender,n.callback,n.params)}}$(g.children()[0]).click(delegate(a[0],a[1],a[2]));g.appendTo(this.domCustomOptionsList);this.customOptionsBuffer.push({config:n,optionDom:g})}else{this.customOptionsBuffer[d].optionDom.addClass("Active")}}}break;case"onEmptyCustomOption":for(var f=0;f<this.tabs.length;f++){if(this.tabComponents[f]&&this.tabComponents[f].component==l.sender){this.domCustomOptionsList.children().removeClass("Active")}}break;case"onGetActiveTabId":l.data=l.data||{};l.data.activeTabId=this.activeTabId;break}},tabLinkClick:function(a){var b;this.controller.viewEvent(b=new mvcEvent(this,"onTabClick",{TabId:a,ActiveTabId:this.activeTabId}));if(a!=this.activeTabId&&!b.isCancelled()){this.setActiveTab(a)}},renderTo:function(a){a=a||$(document.body);if(!this.dom){this.createDom()}if(this.dom&&this.dom.length>0){for(var c=0;c<this.config.tabs.length;c++){var d=new this.OptionItem({type:"head",name:this.config.tabs[c].name,isFirst:(!c)?true:false,isLast:(c==this.config.tabs.length-1)?true:false});d.renderTo(this.domTabsPanelList);var b=new this.OptionItem({type:"body",children:this.config.tabs[c].children});b.renderTo(this.domTabsDeckList);this.tabs.push({head:d,body:b});d.domTabLink.click(delegate(this,this.tabLinkClick,[this.tabs.length-1]))}this.dom.appendTo(a)}return this.dom},OptionItem:SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.type=this.config.type||null;switch(this.type){case"head":this.name=this.config.name||"";this.isFirst=this.config.isFirst||null;this.isLast=this.config.isLast||null;this.template="<li"+((this.isFirst)?' class="First"':(this.isLast)?' class="Last"':"")+'><a dom="TabLink" hidefocus="hidefocus" href="#"><span dom="TabName" class="TextData">'+this.name+"</span></a></li>";break;case"body":this.template='<li class="TabsDeck"></li>';break}},renderTo:function(a,d,c){if(!this.dom){this.createDom()}if(this.dom&&this.dom.length>0){var b=["appendTo","prependTo","insertAfter","insertBefore"];this.dom[b[(c?1:0)*2+(d?1:0)]](a||$(document.body))}return this.dom}}),template:'<div class="Taber"><div class="TaberSmartPanel"><div class="TaberSmartPanelGroup FlexFixV"><div dom="TabsPanel" class="TabsPanel"><ul dom="TabsPanelList" class="FlexFixV"></ul></div><div class="CustomOptions"><ul dom="CustomOptionsList"></ul></div></div></div><div dom="TabsHolder" class="TabsHolder"><div class="TabsDeckList"><ul dom="TabsDeckList" class="TabsDeckList"></ul></div></div></div>'});var Spacer=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.template=['<div class="Spacer ',this.config.className||"",'"><hr /></div>']}});var FormSet=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.captionName=this.config.captionName||"";this.className=this.config.className||"";this.template=['<div class="FormSet',(this.className?(" FormSet"+this.className):""),'">',(this.captionName?('<div dom="Caption" class="FormSetCaption'+(this.className?(" FormSetCaption"+this.className):"")+'"><span class="TextData">'+this.captionName+"</span></div>"):""),'<div dom="Body" class="FormSetBody',(this.className?(" FormSetBody"+this.className):""),'"></div>',"</div>"]},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint=this.domBody}});var FormRow=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.addonClassName=this.config.addonClassName||false;this.type=this.config.type||"line";this.label=this.config.label||"";this.value=((this.config.value!=undefined)?this.config.value.toString():null);this.defaultValue=((this.config.defaultValue!=undefined)?this.config.defaultValue.toString():null);this.defaultValueSmartBack=this.config.defaultValueSmartBack||false;this.onValChange=(this.config.onValChange!=undefined)?delegate(this,this.config.onValChange):this.onValChange;this.onValDefault=(this.config.onValDefault!=undefined)?delegate(this,this.config.onValDefault):this.onValDefault;this.disabled=this.config.disabled||false;this["for"]=this.config["for"]||false;this.postfixed=(this.config.postfixed!=undefined)?this.config.postfixed:true;this.postfix=this.config.postfix||":",this.attrs=this.config.attrs||null;this.dir=this.config.dir||"lt";this.divClass=this.config.divClass||"";this.dlClass=this.config.dlClass||"";this.dtClass=this.config.dtClass||"";this.ddClass=this.config.ddClass||"";this.labelClass=this.config.labelClass||"";this.fieldClass=this.config.fieldClass||"";this.ePool=this.config.ePool||{};this.groupName;this.defineFieldTemplate()},defineFieldTemplate:function(){var g='<input type="';var d="";switch(this.type){case"line":g+='text"';d="FieldLine";break;case"select":g="<select";d="FieldSelect";break;case"checkbox":g+='checkbox"';d="FieldCheckbox";this.dir=this.config.dir||"rt";break;case"radio":g+='radio"';d="FieldRadio";this.dir=this.config.dir||"rt";break;case"file":g+='file"';d="FieldFile";break;case"button":g+='button"';d="FieldButton";break;case"textarea":g="<textarea";d="FieldTextarea";break;case"complex":g=('<div class="FieldComplexData '+this.fieldClass+'"');d="FieldComplex";break}if(typeof this.attrs=="string"){g+=" "+this.attrs}if(this.groupName){g+=' name="'+this.groupName+'"'}if(this.value){g+=' value="'+this.value+'"'}if(this["for"]){g+=' id="'+this["for"]+'"'}g+=' dom="Field" />';var f="";if(this.label){var c=['<label class="FormLabel ',d,(this.labelClass)?(" ",this.labelClass):(""),'"',((this["for"])?(' for="'+this["for"]+'"'):""),'><span class="TextData">',this.label,((this.postfixed)?(" ",this.postfix):""),"</span></label>"].join("");f=['<dt class="FormLabel ',d," ",((this.dir=="lt")?"":"FormLabelDirR "),this.dtClass,'">',c,"</dt>"].join("")}var b=['<dd class="FormField ',d,((this.dir=="lt")?" ":" FormFieldDirR "),this.ddClass,'">',((this.type=="complex")?g:['<span class="Field ',d," ",this.fieldClass,'">',g,"</span>"].join("")),"</dd>"].join("");var a=(this.dir=="lt")?[f,b]:[b,f];this.template=['<div class="FormRow ',d," ",((this.addonClassName)?("FormRowVar"+this.addonClassName):"FormRowStd")," ",this.divClass,'">','<dl class="FormRow ',d," ",this.dlClass,'">',a.join(""),"</dl>","</div>"]},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.attrs&&typeof this.attrs!="string"){this.domField.attr(this.attrs)}for(var a in this.ePool){this.domField.bind(a,delegate(this,this.ePool[a]))}if(this.disabled){this.disable()}if(this.defaultValueSmartBack&&this.defaultValue){this.domField.val(this.defaultValue);this.domField.bind({focus:delegate(this,this.smartFocus,[true]),blur:delegate(this,this.smartFocus,[false])})}},val:function(b,a){if(b===undefined&&a===undefined){if(this.type!="complex"){b=this.domField.val()}else{b=this.domField.text()}if(b==this.defaultValue){b=""}return b}else{this.value=(b!==null)?b:(this.defaultValue||"")}if(this.type=="complex"){this.domField.html(b);return this}else{if(a){drawSelectArr(this.domField[0],a,b);return this}else{this.domField.val((b!==null)?b:(this.defaultValue||""))}}if(this.defaultValue&&this.defaultValue!=this.domField.val()){this.domField.addClass("onChange")}return this},disable:function(){this.disabled=true;this.domField.attr("disabled",true)},enable:function(){this.disabled=false;this.domField.attr("disabled",false)},onValChange:function(){this.domField.addClass("onChange")},onValDefault:function(){this.domField.removeClass("onChange")},focus:function(){this.domField.focus()},smartFocus:function(a){if(!this.defaultValue){return this}if(a){if(this.domField.val()==this.defaultValue){this.domField.val("");this.onValChange()}}else{if(this.domField.val().length==0){this.val(this.defaultValue)}if(this.domField.val()!=this.defaultValue){this.onValChange()}else{this.onValDefault()}}}});FormRow.setupFormDataRelatives=function(i,g,h){var c,d,b=h||[];for(var f in i){var j={};j.context=i[f].context||g;d=(i[f].rowName===undefined)?("oRow_"+f):(i[f].rowName||f);j.rowName=d;if(i[f].handler){j.data=i[f].handler(i[f].data)}else{j.data=i[f].data}b.push(j)}return b};FormRow.checkFormDataChanges=function(b){for(var d=0;d<b.length;d++){var g=b[d].data;var c=b[d].context[b[d].rowName];var h=(c.type=="checkbox")?c.isChecked():c.val();var f=((g===null&&h==="")||(h===""&&g===null));if(!f){if(g!=h){return false}}}return true};FormRow.revertFormDataChanges=function(b){for(var d=0;d<b.length;d++){var f=b[d].data,c=b[d].context[b[d].rowName];if(c.type=="radio"){c.check(f)}else{if(c.type=="checkbox"){c.doCheck(f)}else{c.val(f)}}}};var FieldLine=FormRow.extend({defineFieldTemplate:function(){this.type="line";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)}});var FieldSelect=FormRow.extend({defineFieldTemplate:function(){this.type="select";this.dataArr=(this.config.dataArr!=undefined)?this.config.dataArr:false;this.selectedVal=this.config.selectedVal||null;arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.dataArr!==false){(this.dataArr!==null)?drawSelectArr(this.domField[0],this.dataArr,(this.selectedVal)?this.selectedVal:undefined):this.addOption()}},addOption:function(c,a){var b=$("<option />").appendTo(this.domField);if(c){b.val(c)}if(a){b.text(a)}}});var FieldCheckbox=FormRow.extend({defineFieldTemplate:function(){this.type="checkbox";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)},isChecked:function(b,a){if(this.domField.is(":checked")){return((b!=undefined)?b:1)}else{return((a!=undefined)?a:0)}},doCheck:function(a){this.domField.attr("checked",a||false)}});var FieldRadio=FormRow.extend({defineFieldTemplate:function(){this.type="radio";this.groupName=this.config.groupName||null;arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments)},check:function(a){if(this.domField){if((a===0||a===-1||a)&&(this.value===0||this.value===-1||this.value)){$("input:radio[name="+this.groupName+"]").each(function(){if($(this).val()==a){$(this).attr("checked",true)}})}else{this.domField.attr("checked",true)}}return this},val:function(a){if(a==undefined&&this.groupName){return $("input:radio[name="+this.groupName+"]:checked").val()}arguments.callee.Parent.val.apply(this,arguments)}});var FieldFile=FormRow.extend({defineFieldTemplate:function(){this.type="file";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)}});var FieldTextarea=FormRow.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.rightClick=(this.config.rightClick!=undefined)?this.config.rightClick:true},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.rightClick){this.domField.attr("rightClick",true)}},defineFieldTemplate:function(){this.type="textarea";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)}});var FieldTextareaMaxLength=FieldTextarea.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.maxLength=this.config.maxLength||null},onPropertychange:function(){var a=this.domField.val();if(event.propertyName=="value"){if(a.length>this.maxLength){this.domField.val(a.substring(0,this.maxLength))}}},onPaste:function(){var a=window.document.selection.createRange(),b=this.maxLength-this.domField.val().length+a.text.length;try{a.text=window.clipboardData.getData("Text").substr(0,b)}catch(c){}window.event.returnValue=null},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.maxLength){this.domField.bind({propertychange:delegate(this,this.onPropertychange),paste:delegate(this,this.onPaste)})}}});var FieldComplex=FormRow.extend({defineFieldTemplate:function(){this.type="complex";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint=this.domField}});var InputButton=FormRow.extend({defineFieldTemplate:function(){this.type="button";arguments.callee.Parent.defineFieldTemplate.apply(this,arguments)}});var LinkButton=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.disabled=this.config.disabled||false;this.primary=this.config.primary||false;this.fixed=this.config.fixed||false;if(typeof this.fixed!="boolean"){this.width=this.fixed||0}this.className=(this.config.className)?("LinkButtonView"+this.config.className):"";this.addonClassName=this.config.addonClassName||"";this.label=this.config.label||"";this.action=this.config.action||null;this.configureTemplate()},configureTemplate:function(){this.template=['<span class="LinkButton ',this.className," ",this.addonClassName,((this.primary)?" LinkButtonDefault":""),((this.fixed)?" LinkButtonFixed":""),((this.width)?' style="width:'+this.width+'px;"':""),'">','<a dom="ButtonLink" href="#" hidefocus="hidefocus">','<span class="LinkButtonBody">','<span class="TextData"',((this.width)?' style="width:'+this.width+'px;"':""),">",this.label,"</span>","</span>","</a>",'<span class="CoverSave" style="display: none;"></span>',"</span>"]},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.disabled){this.disable()}if(this.action){this.domButtonLink.bind("click",(this.director)?delegate(this.director,this.action):this.action)}},disable:function(){this.dom.addClass("ButtonDisabled Disabled");this.disabled=true},enable:function(){this.dom.removeClass("ButtonDisabled Disabled");this.disabled=false}});var Link=LinkButton.extend({configureTemplate:function(){this.template=['<a dom="ButtonLink" hidefocus="hidefocus" href="#" class="Link ',this.className," ",this.addonClassName,'">',this.label,"</a>"]},onDomCreated:function(){this.domButtonLink=this.dom;arguments.callee.Parent.onDomCreated.apply(this,arguments)}});var AreaFormControl=SmartComponent.extend({initialize:function(b,j){arguments.callee.Parent.initialize.apply(this,arguments);this.boxType=this.config.boxType||"simple";this.numOfSides=this.config.numOfSides||0;this.addonClassName=this.config.addonClassName||"";this.dir=this.config.dir||"lt";this.controls=[];this.items=[];var k=this.config.controls||[];if(k&&k.length){for(var d=0;d<k.length;d++){if(k[d].control){this.addControl(k[d].control,k[d].side||"UnSided",k[d].name||null)}else{if(k[d].length&&k[d][0]){this.addControl(k[d][0],k[d][1]||"UnSided",k[d][2]||null)}else{if(k[d]&&k[d] instanceof SmartComponent){this.addControl(k[d],"UnSided",null)}}}}}if(this.numOfSides){var l=[];var f=["A","B","C","D","E","F"];for(var d=0;d<this.numOfSides;d++){l.push(['<li dom="Side'+f[d]+'" class="Side'+f[d]+'">','<div class="ControlOptions">','<ul dom="SideList'+f[d]+'" />',"</div>","</li>"])}var h=['<div class="ControlsSides">','<ul class="Sides">',l,"</ul>","</div>"]}var a=(this.numOfSides)?h:['<div class="ControlOptions"><ul dom="OptionsList" class="',(" "+((this.dir.toLowerCase()=="lt")?"L":"R")),'" /></div>'];var g;switch(this.boxType.toLowerCase()){case"simple":g=['<div class="FormControlData FlexFixV ',((this.addonClassName)?(" FormControlData"+this.addonClassName):""),'">',a,"</div>"];break;case this.boxType.toLowerCase():g=['<div class="FormControlBox',((this.boxType)?(" BoxView"+this.boxType+" FormControlBoxView"+this.boxType):""),' Box">','<span class="AzA"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span>','<div class="FormControlBoxData FlexFixV',((this.boxType)?(" FormControlBoxData BoxDataView"+this.boxType):""),'">',a,"</div>",'<span class="AzB"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span>',"</div>"];break}var c=['<div class="FormControl',((this.addonClassName)?(" "+this.addonClassName):""),'">',g,"</div>"];this.template=smartJoin(c)},addControl:function(b,d,a){if(b&&d.toString()){this.controls.push({id:this.controls.length,control:b,to:d,name:a});var c=new SmartComponent({template:"<li />"});c.addChildComponent(b.name(a,(a)?this:null));if(this.numOfSides){this.addChildComponent(c,"SideList"+d.toUpperCase())}else{this.addChildComponent(c,"OptionsList")}}}});var Notification=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.actionLinks=[];this.actions=this.config.actions||[]},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);for(var c=0;c<this.actions.length;c++){var b=this.actions[c].label;var a=this.actions[c].name||c;var d=this.actions[c].action;this.actionLinks.push(this.addChildComponent(new Link({label:b,action:d}).name("oActionLink"+a,this),this.domOptions))}},val:function(d,c,f){this.rowsNum=f||1;c=c||"default";var b=this.domIcon.attr("class",(f!=undefined)?("RowsNum"+f):"");switch(c.toLowerCase()){case"attention":b.addClass("Attention");break;case"ok":b.addClass("Ok");break;case"default":b.addClass("Default");break}this.domMessage.html(d);this.show();for(var a=0;a<this.actionLinks.length;a++){this.actionLinks[a].dom.hide()}return this},showAction:function(a){a="oActionLink"+a;if(this[a]){this[a].dom.show()}return this},close:function(){if(this.dom){this.dom.slideUp("fast")}return false},showError:function(a){if(this.dom){this.domMessage.html(a);this.dom.slideDown("fast")}},hide:function(){this.dom.hide()},show:function(){this.dom.show()},template:['<div class="SystemNotification">','<dl dom="Def" class="FlexFixV">','<dt dom="Icon" class="Attention"></dt>','<dd dom="Options" class="Options" />','<dd class="FlexFixH">','<p><span dom="Message" class="TextData"></span></p>',"</dd>","</dl>","</div>"]});var ProfileContainer=mvcSmartView.extend({template:'<div class="PageFrame"><div class="PageFrameInner"><div class="Container"><div class="SubContainer"><div class="SubContainerData" dom="MountPoint"></div></div></div></div></div>'});var SmartContainer=SmartComponent.extend({template:'<div class="Container"><div class="SubContainer" dom="MountPoint"></div></div>'});var Content=SmartComponent.extend({template:'<div class="Content"><div dom="MountPoint" class="ContentData"></div></div>'});var SingleImageUploader=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.isUploading=false;this.addChildComponent(new FieldComplex({label:"Upload a Single Photo",dtClass:"FieldComplexLabel",addonClassName:"SingleImageUploader",children:[new SmartComponent({template:'<div class="FieldFileDomHolder" />'}).name("oFieldFileDomHolder",this),new InputButton({value:"Upload",disabled:true,fieldClass:"InputButtonViewA",addonClassName:"ImageUploaderFieldButton",director:this,ePool:{click:function(){this.director.uploadImage()}}}).name("oRow_UploadButton",this)]}))},uploadImage:function(){if(this.oRow_ImageFile.val()==""){alert("Please choose a photo to upload.")}else{var a=this.oRow_ImageFile.val().split(".");a=a[a.length-1].toLowerCase();if(a=="gif"||a=="jpg"||a=="jpeg"){this.isUploading=true;this.onUpload();this.oRow_UploadButton.disable();setWaitCursor();this.domMountPoint.addClass("Submiting");var b=["<AddPictureRequest>",this.controller.getAuthRequestStr(),"<PictureDesc>",this.getPictureDescRequestStr(),"</PictureDesc>","</AddPictureRequest>"].join("");this.domXmlDataHolder.val(b);this.domPostForm.attr("action",DYNAMIC_PATH+"/people/peoplefuncs.php?function=AddPicture").submit()}else{alert("The file format you have selected to upload is not supported.\nPlease upload either GIF or JPG format photos only.");return}}},onBeforeReadyToUpload:function(){},onUpload:function(){},getPictureDescRequestStr:function(){return""},checkFileValue:function(){if(!this.isUploading){if(this.oRow_ImageFile.val()!=""){this.oRow_UploadButton.enable();this.onBeforeReadyToUpload();this.oRow_UploadButton.focus()}else{this.oRow_UploadButton.disable()}}},onCheckUploadedImageSuccess:function(a){},checkUploadedImage:function(){if(!this.oRow_ImageFile){this.initNewFile()}var c=this.domFrame.attr("contentWindow");if(c.location.toString().indexOf("about:blank")==-1&&c.location.toString().indexOf("#")==-1){var d=new ActiveXObject("MSxml.DOMDocument");d.async=false;d.loadXML(c.document.body.innerText.replace(/\<\?[^?]*\?\>/,"").replace(/\- \</g,"<"));setNormalCursor();this.domMountPoint.removeClass("Submiting");if(d.parseError.errorCode==0){var a=parseInt(getNodeValue(d.selectSingleNode("//AddPictureResponse/Status")));var b=getNodeValue(d.selectSingleNode("//AddPictureResponse/Message"));if(a==1){this.onCheckUploadedImageSuccess(d);this.initNewFile()}else{if(b.split(" ").join("")==""){alert("Failed uploading image. Please try again later.")}else{alert(b)}this.initNewFile()}}else{alert("Failed uploading image. Please try again later.");this.initNewFile()}c.location.replace("about:blank")}},initNewFile:function(){if(this.oRow_ImageFile){this.oRow_ImageFile.destroy();this.isUploading=false}this.oFieldFileDomHolder.addChildComponent(new FieldFile({attrs:'name="IMAGEFILE" accept="image/gif,image/jpeg,image/pjpeg,image/jpg"',addonClassName:"ImageUploaderFieldFile",director:this,ePool:{keydown:function(){return false},change:function(){this.director.checkFileValue()}}}).name("oRow_ImageFile",this))},template:['<div class="ImageUploaderSingle">','<form dom="PostForm" method="POST" target="imageReponseFrame" enctype="multipart/form-data">','<input dom="XmlDataHolder" type="hidden" name="XMLDOC" value="" />','<div class="ImageUploaderFieds" dom="MountPoint" />',"</form>",'<iframe dom="Frame" e="load: checkUploadedImage" name="imageReponseFrame" id="imageReponseFrame" src="about:blank" />',"</div>"]});var DebugConsole=SmartComponent.extend({trace:function(a){this.addChildComponent(new this.Item({text:this.children.length+": "+a}),null,true)},clear:function(){var a;while((a=this.children.shift())&&this.mps.shift()){a.destroy()}return false},startDrag:function(a){this.mx=a.offsetX;this.my=a.offsetY;this.mmh=this.mmh||delegate(this,this.onMouseMove);$(document).bind("mousemove",this.mmh)},stopDrag:function(){if(this.mmh){$(document).unbind("mousemove",this.mmh)}},onMouseMove:function(a){this.dom.offset({left:a.clientX-this.mx,top:a.clientY-this.my})},Item:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.dom.text(this.config.text)},template:'<p style="margin: 0; padding: 0; border-top: 1px dotted #f9f9f9;"></p>'}),template:['<div style="z-index: 10000; position: absolute; top: 0px; left: 0px; border: 1px solid silver; background: white; width: 320px; height: 240px; text-align: left; margin: 0; padding: 0;">','<div style="height: 16px; background: silver; cursor: hand;" e="mousedown:startDrag,mouseup:stopDrag"><p><strong>Debug Console</strong></p></div>','<div style="height: 12px; width: 40px; position: absolute; background: transparent;"><a href="#" e="click:clear">Clear</a></div>','<div dom="MountPoint" style="height: 220px;padding: 2px; overflow-y: scroll;"></div>',"</div>"]});(function(){var a=null;DebugConsole.getInstance=function(){if(!a){a=new DebugConsole();a.renderTo()}return a}})();var CommentInputBase=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.editing=false;this.setDirty(false);$(document).bind("focusin",delegate(this,this.windowActivate));this.tplClassPrefix="";this.defaultText="";this.timer=null;this.inputMaxLength=2000;this.submitProcessed=false},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domText.get(0).innerText=this.defaultText},windowActivate:function(){if(this.domText&&this.domText.get(0)==document.activeElement){this.enterEditing()}},enterEditing:function(){if(!this.dom||this.submitProcessed){return}if(this.timer){window.clearTimeout(this.timer);this.timer=null}this.domBase.addClass(this.tplClassPrefix+"IsInit");if(!this.editing){if(!this.dirty){this.domText.get(0).innerText=""}this.domText.focus();this.editing=true}},exitEditing:function(c,b){if(!this.dom){return false}if(!this.timer){this.timer=window.setTimeout(delegate(this,this.exitEditing,Array.prototype.slice.call(arguments)),150);return false}this.timer=null;if(c){var a=c.clientX;var f=c.clientY;if(c.type=="blur"&&this.hitTest(a,f,this.domRowBody)){if(!this.hitTest(a,f,this.domDoPost)){try{this.domText.focus()}catch(d){}}this.editing=false;return true}}this.editing=false;if(!b&&$.trim(this.domText.val())==""){this.setDirty(false);this.domText.get(0).innerText=this.defaultText;this.domBase.removeClass(this.tplClassPrefix+"IsInit");if(c){c.cancelBubble=true}}return true},reset:function(a){if(!this.dom||(!this.dirty&&!a)){return false}this.editing=false;this.setDirty(false);this.domText.attr("disabled",false).get(0).innerText=this.defaultText;this.domBase.removeClass(this.tplClassPrefix+"IsInit").removeClass(this.tplClassPrefix+"IsSubmit").removeClass(this.tplClassPrefix+"SizeX").removeClass(this.tplClassPrefix+"SizeXX").removeClass(this.tplClassPrefix+"SizeXXX");this.oldValue=null;return true},beforePostComment:function(){this.submitProcessed=true;var a=$.trim(this.domText.val());if(a==""){this.exitEditing();return false}this.domText.attr("disabled",true);this.domBase.removeClass(this.tplClassPrefix+"IsInit").addClass(this.tplClassPrefix+"IsSubmit")},afterPostComment:function(){this.submitProcessed=false;this.domText.attr("disabled",false).get(0).innerText=this.defaultText;this.setDirty(false);this.domBase.removeClass(this.tplClassPrefix+"IsSubmit").removeClass(this.tplClassPrefix+"SizeX").removeClass(this.tplClassPrefix+"SizeXX").removeClass(this.tplClassPrefix+"SizeXXX");this.oldValue=null},setDirty:function(a){this.dirty=a||false;if(!this.domBtn){return}if(this.dirty){this.domBtn.removeClass("ButtonDisabled")}else{this.domBtn.addClass("ButtonDisabled")}},checkFieldValue:function(){if(!this.editing){return}if($.trim(this.domText.val())!=""){this.setDirty(true)}else{this.setDirty(false)}this.checkValueVSize()},checkMaxLength:function(){var a=this.domText.val();if(event.propertyName=="value"){if(a.length>this.inputMaxLength){this.domText.val(a.substr(0,this.inputMaxLength))}}},pasteHandler:function(){var a=window.document.selection.createRange(),b=this.inputMaxLength-this.domText.val().length+a.text.length;try{a.text=window.clipboardData.getData("Text").substr(0,b)}catch(c){}window.event.returnValue=null},checkValueVSize:function(){this.checkMaxLength();var b=this.domText.val();this.oldValue=this.oldValue||"";if(b==this.oldValue){return}this.oldValue=b;var a=this.domText.get(0).scrollHeight;switch(true){case (a<=40):this.domBase.removeClass(this.tplClassPrefix+"SizeX").removeClass(this.tplClassPrefix+"SizeXX");break;case (a>40&&a<=56&&!this.domBase.hasClass(this.tplClassPrefix+"SizeX")):this.domBase.removeClass(this.tplClassPrefix+"SizeXX").addClass(this.tplClassPrefix+"SizeX");break;case (a>56&&!this.domBase.hasClass(this.tplClassPrefix+"SizeXX")):this.domBase.removeClass(this.tplClassPrefix+"SizeX").addClass(this.tplClassPrefix+"SizeXX");break}}});var PagesHeader=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.name=this.config.pageName||"";this.option=this.config.option||{};this.optionName=this.option.name||"";this.optionCallback=this.option.callback||"";this.template=smartJoin(['<div class="PageHeader FlexFixV">','<div class="Caption">','<h1 class="Caption"><span class="TextData">',this.name,"</span></h1>","</div>",((this.optionName)?(['<div class="PageHeaderOption">','<a hidefocus="hidefocus" href="#"',((this.optionCallback)?('onclick="'+this.optionCallback+'();"'):""),">",this.optionName,"</a>","</div>"]):""),"</div>"])}});var NFStory={};NFStory.StoryCaption=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);a.Removable=a.Removable||false;a.Tunable=a.Tunable||false;if(a.Removable){this.addChildComponent(new this.Remover(),"Author",false,true)}if(a.Tunable){this.addChildComponent(new this.Tuner(),"Author",false,true)}if(a.User){this.picSrc=IMAGE_PATH_CDN+getUserImagePath(a.User.ID,a.User.PictureID,a.User.PictureType,"d",a.User.Gender).path;this.userHref="profile.php?UserId="+a.User.ID;this.userName=a.User.Nickname;this.userGender=a.User.Gender}},onRenderComplete:function(){arguments.callee.Parent.onRenderComplete.apply(this,arguments);if(this.picSrc){FixImgSize.fix(this.picSrc,this.domThumb,31,28);this.domThumb.attr("src",this.picSrc)}this.domLink.attr({href:this.userHref,title:this.userName}).bind("click",genLinkClickHandler);this.parent.onCaptionDomCreated()},onRemoverClick:function(){this.parent.onRemoveStory()},Remover:SmartComponent.extend({onClick:function(){this.parent.onRemoverClick();return false},template:'<dd class="Remover"><a title="Delete this item" hidefocus="hidefocus" href="#" e="click:onClick">Remove</a></dd>'}),Tuner:SmartComponent.extend({onClick:function(){return gotoLink("editProfile.php?pageTab=2")},template:'<dd class="Tuner"><a title="Settings" hidefocus="hidefocus" href="#" e="click:onClick">Settings</a></dd>'}),onImageLoadingError:function(){if(this.errorTry){this.domThumb.unbind("error").hide();return}this.errorTry=true;var a=IMAGE_PATH_CDN+getUserImagePath(0,0,0,"d",this.userGender).path;FixImgSize.fix(a,this.domThumb,31,28);this.domThumb.attr("src",a)},template:'<div class="StoryCaption"><dl dom="MountPoint" class="FlexFixV"><dt class="Author" dom="Author"><a href="#" hidefocus="hidefocus" dom="Link"><span class="ClipWraper"><span class="Outer"><span class="Inner"><img dom="Thumb" e="error: onImageLoadingError"/></span></span></span></a></dt><dd class="Sketch"><span dom="Sketch" class="TextData" /></dd></dl></div>'});NFStory.StoryFooter=SmartComponent.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);if(a.Date){this.addChildComponent(new this.UpdatedItem(a))}if(a.Thread){this.addChildComponent(new this.CommentItem());this.addChildComponent(this.iLikeLink=new this.ILikeItItem())}},onCommentClick:function(){this.parent.onComment()},onILikeItClick:function(){if(this.config.Thread&&!this.config.Thread.commentable){this.iLikeLink.setLikeText()}this.parent.onILike()},meLike:function(a){if(this.iLikeLink){return this.iLikeLink.meLike(a)}return false},UpdatedItem:SmartComponent.extend({onDomCreated:function(){this.domTextData.text(((this.config.DatePrefix!=undefined)?this.config.DatePrefix:"")+this.config.Date)},template:'<li class="Date"><span dom="TextData" class="TextData" /></li>'}),CommentItem:SmartComponent.extend({onClick:function(){if(checkNeedRegistration(myUserId)){return false}this.parent.onCommentClick();return false},template:'<li class="FirstSeparated"><a title="Click here to leave a comment" href="#" hidefocus="hidefocus" e="click:onClick">Comment</a></li>'}),ILikeItItem:SmartComponent.extend({onClick:function(){if(checkNeedRegistration(myUserId)){this.setLikeText();return false}this.parent.onILikeItClick();return false},setLikeText:function(){if(this.domLink){this.domLink.text(this.meLikeState?"Unlike this":"I like this").attr("title","Click here here to "+(this.meLikeState?"stop liking":"like")+" this item").unbind("click").one("click",delegate(this,this.onClick))}},meLike:function(a){if(a!=undefined){this.meLikeState=a;this.setLikeText()}return this.meLikeState},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.meLikeState=this.meLikeState||false;this.setLikeText()},template:'<li><a href="#" hidefocus="hidefocus" dom="Link"></a></li>'}),template:'<div class="Review"><ul dom="MountPoint" class="FlexFixV"></ul></div>'});NFStory.StoryBody=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);if(a.contents){this.addChildComponent(a.contents)}this.footer=new NFStory.StoryFooter(a);this.addChildComponent(this.footer);if(a.Thread){this.addChildComponent(this.thread=new NFStory.Thread(a))}},setController:function(){arguments.callee.Parent.setController.apply(this,arguments);if(this.thread){this.thread.setController(this.controller)}},onComment:function(){this.thread.showCommentBox();return false},onILike:function(){this.thread.sendILike();return false},meLike:function(a){return this.footer.meLike(a)},template:'<div class="StoryBody" dom="MountPoint"></div>'});NFStory.setupFullComment=function(){this.$More=$('<a class="MoreToShowLink" href="#" hidefocus="hidefocus">Read More...</a>').bind("click",delegate(this,this.showFullComment));this.ellipsisConfig.$el.append(this.$More)};NFStory.showFullComment=function(){this.$More.hide();with(this.ellipsisConfig){charLim=lineLim=0;$el.empty()}Ellipsisor.ellipsisFormatted(this.ellipsisConfig)};NFStory.StoryBase=mvcSmartView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.caption=new NFStory.StoryCaption(a);this.addChildComponent(this.caption)},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.first(this.config.first);if(IE6){this.domSlidable.hover(ie6HoverIn,ie6HoverOut)}},onRenderComplete:function(){arguments.callee.Parent.onRenderComplete.apply(this,arguments);if(this.config.slide){this.slideDown()}},slideDown:function(){this.domMountPoint.css("position","static");this.domSlidable.addClass("SlidingOn").hide().slideDown(400,delegate(this,this.onSlideFinished))},onSlideFinished:function(){this.domSlidable.removeClass("SlidingOn");this.domMountPoint.css("position","relative")},removeMe:function(){this.domMountPoint.css("position","static");this.domSlidable.addClass("SlidingOn").slideUp(400,delegate(this,this.onRemoveComplete))},onRemoveComplete:function(){this.destroy()},setController:function(){arguments.callee.Parent.setController.apply(this,arguments);if(this.body){this.body.setController(this.controller)}},first:function(b){var a=this.config.first;if(b!=undefined){this.config.first=b;if(this.dom){if(this.config.first){this.dom.addClass("FirstStory")}else{this.dom.removeClass("FirstStory")}}}return a},onCaptionDomCreated:function(){},onRemoveStory:function(){this.parent.removeStory(this)},setupFullComment:NFStory.setupFullComment,showFullComment:NFStory.showFullComment,template:'<li class="Story"><div class="Story"><div class="Slidable" dom="Slidable"><div class="StoryData" dom="MountPoint" /></div></div></li>'});NFStory.ContentsBase=mvcSmartView.extend({setupFullComment:NFStory.setupFullComment,showFullComment:NFStory.showFullComment});NFStory.StatusStory=NFStory.StoryBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.addChildComponent(this.body=new NFStory.StoryBody(a))},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryILikeIt")},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);var a=this.config.User.Nickname||"";var b=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>');$("a",b).text(a).bind("click",genLinkClickHandler);this.caption.domSketch.empty().append(b).append(document.createTextNode(" ")).append(this.$StatusText=$('<span class="StatusText" />'));this.ellipsisConfig={$el:this.$StatusText,str:this.config.Text,charLim:300-a.length,lineLim:4};if(Ellipsisor.ellipsisFormatted(this.ellipsisConfig)){this.setupFullComment()}}});NFStory.AddUserStory=NFStory.StatusStory.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.config.Text="joined the community"}});NFStory.CommentStoryBase=NFStory.StoryBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);a.Trimable=(a.Trimable!=undefined)?a.Trimable:true;a.contents=new this.Contents(a);this.addChildComponent(this.body=new NFStory.StoryBody(a))},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryComment")},Contents:NFStory.ContentsBase.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.ellipsisConfig={$el:this.domComment,str:this.config.Comment,charLim:(this.config.Trimable)?300:0,lineLim:(this.config.Trimable)?4:0};if(Ellipsisor.ellipsisFormatted(this.ellipsisConfig)){this.setupFullComment()}},template:'<div class="Comment"><div class="CommentBox Box"><span class="AzA"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span><div class="BoxData"><div class="CommentData"><p class="Comment" dom="Comment" /></div></div><span class="AzB"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span></div>'})});NFStory.CommentStoryProfile=NFStory.CommentStoryBase.extend({onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);var a=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>');$("a",a).text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);this.caption.domSketch.empty().append(a).append(" wrote:")}});NFStory.CommentStoryHome=NFStory.CommentStoryBase.extend({onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);var a;(a=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>')).find("a").text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);var b=$('<a href="profile.php?UserId='+this.config.OnUser.ID+'" hidefocus="hidefocus"></a>').text(this.config.feedViewerId==this.config.OnUser.ID?"your profile":(this.config.OnUser.Nickname+"'s profile")).bind("click",genLinkClickHandler);this.caption.domSketch.empty().append(a).append(" wrote on ").append(b).append(".")}});NFStory.PhotoComment=NFStory.StoryBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);a.contents=new this.Contents(a);this.addChildComponent(this.body=new NFStory.StoryBody(a))},onPhotoLinkClick:function(a){this.controller.viewEvent(new mvcEvent(this,"StoryItemEvent",{type:"onStoryPhotoClick",item:this}));return false},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryCommentImage")},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);var a,b="";var f=(this.config.User.ID==this.config.OnUser.ID);var c=(this.config.OnUser.ID==this.parent.feedViewerId);var g=(this.config.ShowOwnerAsPron!=undefined)?this.config.ShowOwnerAsPron:true;var d=this.config.OnUser.Nickname;(a=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>')).find("a").text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);(b=$('<a href="#" hidefocus="hidefocus"></a>')).text(((!f&&!c)||(c&&!g))?(d?d+"'s photo":""):"photo").bind("click",delegate(this,this.onPhotoLinkClick));this.caption.domSketch.append(a).append(" commented on").append(f?(this.config.User.Gender?" her":" his")+" own":(c?((g)?" your":""):"")).append(" ").append(b).append(".")},Contents:NFStory.ContentsBase.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domImg.attr("src",IMAGE_PATH_CDN+getUserImagePath(this.config.OnUser.ID,this.config.PictureID,this.config.PictureType,"d",0).path);this.domImgLink.attr("href","#").bind("click",delegate(this.parent.parent,this.parent.parent.onPhotoLinkClick));this.ellipsisConfig={$el:this.domComment,str:this.config.Comment,charLim:180,lineLim:4};if(Ellipsisor.ellipsisFormatted(this.ellipsisConfig)){this.setupFullComment()}},onImageLoadingError:function(){this.domImg.unbind("error").hide()},template:['<div class="Comment">','<div class="CommentBox CommentImageBox Box">','<span class="AzA"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span>','<div class="BoxData">','<div class="CommentData">','<dl class="FlexFixV">','<dt><a href="#" dom="ImgLink"><span class="ClipWraper"><span class="Outer"><span class="Inner"><img dom="Img" e="error: onImageLoadingError" /></span></span></span></a></dt>',"<dd>",'<p class="Comment" dom="Comment"></p>',"</dd>","</dl>","</div>","</div>",'<span class="AzB"><span class="Az1"></span><span class="Az2"></span><span class="Az3"></span></span>',"</div>","</div>"]})});NFStory.ReferenceStory=NFStory.StoryBase.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryRunLine")},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);this.caption.domAuthor.removeClass("Author").addClass("StoryType").addClass("icoRunLine").html("RunLine");var b,c,a;(b=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>')).find("a").text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);switch(this.config.ReferenceType){case REFERENCE_TYPE.PICTURE_COMMENT:$uTLink=$('<a href="#" hidefocus="hidefocus"></a>').text((this.config.User.ID!=this.config.OnUser.ID)?this.config.OnUser.Nickname+"'s photo":"photo");$uTLink.bind("click",delegate(this,this.onPhotoLinkClick));this.caption.domSketch.append(b).append(" commented on ").append(this.config.User.ID==this.config.OnUser.ID?((this.config.User.Gender?"her":"his")+" own "):"").append($uTLink).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break;case REFERENCE_TYPE.COMMENT:a="profile.php?UserId="+this.config.OnUser.ID+"&pageTab="+USER_PROFILE_MODE.PARTIAL+"&thread="+this.config.CommentID;if(this.config.User.ID!=this.config.OnUser.ID){$uTLink=$('<a href="'+a+'" hidefocus="hidefocus"></a>').text(this.config.OnUser.Nickname+"'s profile")}else{$uTLink=$('<a href="'+a+'" hidefocus="hidefocus">'+(this.config.OnUser.Gender?"her":"his")+" own profile</a>")}$uTLink.bind("click",genLinkClickHandler);this.caption.domSketch.append(b).append(" wrote on ").append($uTLink).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break}},onPhotoLinkClick:function(a){this.controller.viewEvent(new mvcEvent(this,"StoryItemEvent",{type:"onReferencePhotoClick",item:this}));return false}});NFStory.PhotoStory=NFStory.StoryBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);a.contents=new this.Contents();this.addChildComponent(this.body=new NFStory.StoryBody(a))},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);$("div.Story",this.dom).addClass("StoryImagesUpload");var a=this;$(this.config.Pictures.Item).each(function(){a.addItem(this)});if(this.config.More){this.config.contents.addChildComponent(new this.MoreItem())}},onGalleryMoreClick:function(a){this.controller.viewEvent(new mvcEvent(this,"StoryItemEvent",{type:"onGalleryMoreClick",item:this}));return false},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);var c=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>');$("a",c).text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);var a=$('<a href="#" hidefocus="hidefocus">gallery</a>').bind("click",delegate(this,this.onGalleryMoreClick));var b=this.config.Pictures.Item.length>1;this.caption.domSketch.empty().append(c).append(document.createTextNode(" added"+(b?"":" a")+" new photo"+(b?"s":"")+(this.config.User.Gender?" to her ":" to his "))).append(a).append(document.createTextNode("."))},addItem:function(a){this.config.contents.addChildComponent(new this.Item(a))},Item:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domPhotoImg.attr("src",IMAGE_PATH_CDN+getUserImagePath(this.parent.parent.config.User.ID,this.config.PictureID,this.config.PictureType,"d",this.parent.parent.config.User.Gender).path).attr("alt",this.config.Desc||"").attr("title",this.config.Desc||"");this.domLink.bind("click",delegate(this,this.imageLinkClick))},imageLinkClick:function(a){this.parent.parent.controller.viewEvent(new mvcEvent(this,"StoryItemEvent",{type:"onGalleryPhotoClick",item:this}));return false},imageLoadingError:function(){this.domLink.removeAttr("href").unbind("click");this.domPhotoImg.unbind("error").hide()},template:'<li><a href="#" dom="Link" hidefocus="hidefocus"><span class="ClipWraper"><span class="Outer"><span class="Inner"><img dom="PhotoImg" alt="" e="error:imageLoadingError"/></span></span></span></a></li>'}),MoreItem:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domLink.bind("click",delegate(this.parent.parent.parent,this.parent.parent.parent.onGalleryMoreClick))},template:'<li class="More"><a href="#" dom="Link" hidefocus="hidefocus">More ...</a></li>'}),Contents:SmartComponent.extend({template:'<div class="ImagesUpload"><ul dom="MountPoint" class="FlexFixV"></ul></div>'})});NFStory.FriendshipStory=NFStory.StoryBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.addChildComponent(this.body=new NFStory.StoryBody(a))},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryFriendship")},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);this.caption.domAuthor.removeClass("Author").addClass("StoryType").addClass("icoFriendship").html("Friendship");var b=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User1.ID+'" hidefocus="hidefocus"></a></strong>');$("a",b).text(this.config.User1.Nickname||"").bind("click",genLinkClickHandler);var a=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User2.ID+'" hidefocus="hidefocus"></a></strong>');$("a",a).text(this.config.User2.Nickname||"").bind("click",genLinkClickHandler);this.caption.domSketch.append(b).append(document.createTextNode(" and ")).append(a).append(document.createTextNode(" are now friends."))}});NFStory.NotificationStory=NFStory.StoryBase.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domMountPoint.addClass("StoryRunLine")},onCaptionDomCreated:function(){arguments.callee.Parent.onCaptionDomCreated.apply(this,arguments);this.caption.domAuthor.removeClass("Author").addClass("StoryType").addClass("icoRunLine").html("RunLine");var c,f,b;(c=$('<strong class="Author"><a href="profile.php?UserId='+this.config.User.ID+'" hidefocus="hidefocus"></a></strong>')).find("a").text(this.config.User.Nickname||"").bind("click",genLinkClickHandler);switch(this.config.NotificationType){case NOTIFICATION_TYPE.CUSTOM_STATUS:b="profile.php?UserId="+this.config.OnUser.ID+"&pageTab="+USER_PROFILE_MODE.PARTIAL+"&thread="+this.config.OnCommentID;var f=$('<a href="'+b+'" hidefocus="hidefocus">status</a>').bind("click",genLinkClickHandler);this.caption.domSketch.append(c).append(" commented on your ").append(f).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break;case NOTIFICATION_TYPE.PICTURE_COMMENT:f=$('<a href="#" hidefocus="hidefocus"></a>').text((this.config.OnUser.ID==this.config.feedViewerId)?"photo":this.config.OnUser.Nickname+"'s photo");f.bind("click",delegate(this,this.onPhotoLinkClick));this.caption.domSketch.append(c).append(" also commented on ").append(this.config.User.ID==this.config.OnUser.ID?"your ":"").append(f).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break;case NOTIFICATION_TYPE.COMMENT:b="profile.php?UserId="+this.config.ContextUser.ID+"&pageTab="+USER_PROFILE_MODE.PARTIAL+"&thread="+this.config.OnCommentID;var d=((this.config.OnUser.ID==this.config.feedViewerId)?"your":(this.config.User.ID==this.config.OnUser.ID)?(this.config.User.Gender?"her":"his"):(this.config.OnUser.Nickname+"'s"))+" post";f=$('<a href="'+b+'" hidefocus="hidefocus">'+d+"</a>").bind("click",genLinkClickHandler);this.caption.domSketch.append(c).append(" commented on ").append(f).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break;case NOTIFICATION_TYPE.THREADED_COMMENT:b="profile.php?UserId="+this.config.ContextUser.ID+"&pageTab="+USER_PROFILE_MODE.PARTIAL+"&thread="+this.config.OnCommentID;var a=(this.config.OnUser.ID==this.config.feedViewerId);var d=((this.config.OnUser.ID==this.config.feedViewerId)?"your":(this.config.User.ID==this.config.OnUser.ID)?(this.config.User.Gender?"her":"his"):(this.config.OnUser.Nickname+"'s"))+" post";f=$('<a href="'+b+'" hidefocus="hidefocus">'+d+"</a>").bind("click",genLinkClickHandler);this.caption.domSketch.append(c).append((a?"":" also")+" commented on ").append(f).append(".").append($('<span class="Date">'+(this.config.Date||"")+"</span>"));break}},onPhotoLinkClick:function(a){this.controller.viewEvent(new mvcEvent(this,"StoryItemEvent",{type:"onReferencePhotoClick",item:this}));return false}});NFStory.Thread=mvcSmartView.extend({initialize:function(b,d){arguments.callee.Parent.initialize.apply(this,arguments);var a=!$.isArray(a=(b.Thread.Item||[]))?[a]:a;var f=[];var c=[];$(a).each(function(){switch(this.Command){case"AddILike":c.push(this);break;case"AddThreadedComment":this.serverDate=b.Thread.serverDate;this.feedOwnerId=b.Thread.feedOwnerId;this.feedViewerId=b.Thread.feedViewerId;this.ownerHasControl=b.Thread.ownerHasControl;f.push(this);break}});if(c.length){this.addChildComponent(this.iLikes=new NFStory.Threaded.WhoLikesItStory({likes:c}))}if(f.length){this.addChildComponent(this.comments=new NFStory.Threaded.CommentsStory({comments:f}))}this.addChildComponent(this.commentBox=new NFStory.Threaded.CommentInput({User:b.User,CommentID:b.CommentID,alwaysShown:b.Thread.commentable&&a.length}));if(b.controller){this.commentBox.setController(b.controller)}},updateView:function(){var a=this.iLikes?this.iLikes.config.likes.length:0;a+=this.comments?this.comments.config.comments.length:0;this.commentBox.config.alwaysShown=this.config.Thread.commentable&&a;this.commentBox.setVisibility(this.commentBox.editing||this.commentBox.config.alwaysShown||this.commentBox.dirty)},showCommentBox:function(){if(!this.config.Thread.commentable){this.controller.viewEvent(new mvcEvent(this,"onConfirmAddToFriends"));return false}var a=this.commentBox.editing;this.commentBox.editing=false;this.commentBox.enterEditing(null,a)},changeComment:function(b){if(!this.comments){this.addChildComponent(this.comments=new NFStory.Threaded.CommentsStory({comments:[]}),this.commentBox.dom,true,true)}if(b.action=="add"){b.item.serverDate=this.config.Thread.serverDate;b.item.feedOwnerId=this.config.Thread.feedOwnerId;b.item.feedViewerId=this.config.Thread.feedViewerId;b.item.ownerHasControl=this.config.Thread.ownerHasControl;this.comments.config.comments.push(b.item);this.comments.addChildComponent(new this.comments.Item(b.item));this.commentBox.setVisibility(false,undefined,true)}else{if(b.action=="remove"){for(var a=0;a<this.comments.config.comments.length;a++){if(this.comments.config.comments[a].ItemID==b.item.ItemID){this.comments.config.comments.splice(a,1);break}}for(var a=0;a<this.comments.children.length;a++){if(this.comments.children[a].config.ItemID==b.item.ItemID){this.comments.children[a].removeMe();break}}}}this.updateView()},sendILike:function(){if(!this.config.Thread.commentable){this.controller.viewEvent(new mvcEvent(this,"onConfirmAddToFriends"));return false}if(!this.meLike()){this.addILike()}else{for(var a=0;a<this.iLikes.config.likes.length;a++){if(this.iLikes.config.likes[a].User.ID==myUserId){this.removeILike(this.iLikes.config.likes[a]);break}}}return true},changeILike:function(b){if(!this.iLikes){this.addChildComponent(this.iLikes=new NFStory.Threaded.WhoLikesItStory({likes:[]}),null,true)}if(b.action=="add"){this.iLikes.config.likes.push(b.item)}else{if(b.action=="remove"){for(var a=0;a<this.iLikes.config.likes.length;a++){if(this.iLikes.config.likes[a].ItemID==b.item.ItemID){this.iLikes.config.likes.splice(a,1);break}}}}this.iLikes.updateView();this.updateView()},meLike:function(a){return this.parent.meLike(a)},setController:function(){arguments.callee.Parent.setController.apply(this,arguments);if(this.commentBox){this.commentBox.setController(this.controller)}},update:function(f){var a=null,b=null;switch(f.type){case"onTabBeforeDeactivate":this.commentBox.reset();this.updateView();break;case"addThreadedCommentDataReady":if(f.data.onCommentId==this.config.CommentID){b={action:"add",item:f.data.newItem}}break;case"removeThreadedCommentReady":if(this.removeTCReq&&f.data==this.removeTCReq.request&&f.data.myState==WebRequest.State.READY&&!f.data.error.code){var d=XML.xmlToObject(f.data.response.documentElement);if(d.Status!=1){alert("This comment could not be removed due to an error.\n Please try again.");break}b={action:"remove",item:this.removeTCReq.item};this.removeTCReq=null}break;case"addILikeReady":if(f.data==this.request&&f.data.myState==WebRequest.State.READY&&!f.data.error.code){var d=XML.xmlToObject(f.data.response.documentElement);if(d.Status!=1){alert("Your action could not be performed due to an error.\n Please try again.");break}var c=d.Item;a={action:"add",item:c};this.request=null}break;case"removeILikeReady":if(this.removeILReq&&f.data==this.removeILReq.request&&f.data.myState==WebRequest.State.READY&&!f.data.error.code){var d=XML.xmlToObject(f.data.response.documentElement);if(d.Status!=1){alert("Your action could not be performed due to an error.\n Please try again.");break}a={action:"remove",item:this.removeILReq.item};this.removeILReq=null}break}if(a){this.changeILike(a)}if(b){this.changeComment(b)}},addILike:function(){var a="<AddILikeRequest>"+this.controller.getAuthRequestStr()+"<OnUserID>"+this.config.Thread.feedOwnerId+"</OnUserID><OnCommentID>"+this.config.CommentID+"</OnCommentID></AddILikeRequest>";this.request=new WebRequest("addILike","/people/peoplefuncs.php","AddILike",a);this.controller.executeRequest(this.request);return false},removeILike:function(a){var b="<RemoveItemRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+this.config.Thread.contextUserId+"</ContextUserID><ItemCommand>"+a.Command+"</ItemCommand><ItemID>"+a.ItemID+"</ItemID></RemoveItemRequest>";this.removeILReq={request:new WebRequest("removeILike","/people/peoplefuncs.php","RemoveItem",b),item:a};this.controller.executeRequest(this.removeILReq.request);return false},removeComment:function(a){var b="<RemoveThreadedCommentRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+this.config.Thread.contextUserId+"</ContextUserID><CommentID>"+this.config.CommentID+"</CommentID><ThreadedCommentID>"+a.CommentID+"</ThreadedCommentID></RemoveThreadedCommentRequest>";this.removeTCReq={request:new WebRequest("removeThreadedComment","/people/peoplefuncs.php","RemoveThreadedComment",b),item:a};this.controller.executeRequest(this.removeTCReq.request)},template:'<div class="ILikeIt"><dl class="ILikeIt" dom="MountPoint"></dl></div>'});NFStory.Threaded={};NFStory.Threaded.CommentsStory=SmartComponent.extend({initialize:function(a,d){arguments.callee.Parent.initialize.apply(this,arguments);if(a.comments.length<=4){for(var b=0;b<this.config.comments.length;b++){this.addChildComponent(new this.Item(a.comments[b]))}}else{for(var b=0;b<this.config.comments.length;b++){if(b==0||b==this.config.comments.length-1){this.addChildComponent(new this.Item(a.comments[b]),null,b==0);if(b==0){this.addChildComponent(this.moreItem=new this.MoreItem({number:a.comments.length-2,clickHandler:delegate(this,this.onMoreCommentsClick)}))}}else{a.comments[b].hidden=true;var f=new this.Item(a.comments[b]);this.addChildComponent(f,"HiddenItems")}}}},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domSlidable.hide()},onMoreCommentsClick:function(){this.moreItem.destroy();delete this.moreItem;this.domSlidable.slideDown(400,delegate(this,this.onExpandComplete))},onExpandComplete:function(){this.domSlidable.addClass("AdvItemsExpanded")},onRemoveCommentClick:function(a){this.parent.removeComment(a)},Item:NFStory.ContentsBase.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domLink.attr({href:("profile.php?UserId="+this.config.User.ID)||"",title:this.config.User.Nickname}).bind("click",genLinkClickHandler);this.domNickname.text(this.config.User.Nickname||"").attr("href","profile.php?UserId="+this.config.User.ID).bind("click",genLinkClickHandler);this.ellipsisConfig={$el:this.domComment,str:this.config.Comment,charLim:300,lineLim:4};if(Ellipsisor.ellipsisFormatted(this.ellipsisConfig)){this.setupFullComment();this.dom.addClass("TrimmedContent")}this.domDate.text(formatDate(this.config.Date,this.config.serverDate));if(this.config.OnUser.ID!=this.config.feedViewerId&&this.config.User.ID!=this.config.feedViewerId&&(!this.config.ownerHasControl||this.config.feedOwnerId!=this.config.feedViewerId)){this.domRemover.remove()}if(IE6){this.dom.hover(ie6HoverIn,ie6HoverOut)}},showFullComment:function(){arguments.callee.Parent.showFullComment.apply(this,arguments);this.dom.addClass("TrimmedContentExpanded")},onRenderComplete:function(){arguments.callee.Parent.onRenderComplete.apply(this,arguments);var a=IMAGE_PATH_CDN+getUserImagePath(this.config.User.ID,this.config.User.PictureID,this.config.User.PictureType,"d",this.config.User.Gender).path;FixImgSize.fix(a,this.domImg,31,28);this.domImg.attr("src",a)},removeClick:function(){this.parent.onRemoveCommentClick(this.config);return false},removeMe:function(){this.dom.css("position","relative").slideUp(400,delegate(this,this.onRemoveComplete))},onRemoveComplete:function(){this.destroy()},onImageLoadingError:function(){if(this.errorTry){this.domImg.unbind("error").hide();return}this.errorTry=true;var a=IMAGE_PATH_CDN+getUserImagePath(0,0,0,"d",this.config.User.Gender).path;FixImgSize.fix(a,this.domImg,31,28);this.domImg.attr("src",a)},template:['<div class="ThreadStory">','<dl class="FlexFixV">',"<dt>",'<a href="#" hidefocus="hidefocus" dom="Link"><span class="ClipWraper"><span class="Outer"><span class="Inner">','<img e="error:onImageLoadingError" dom="Img"/>',"</span></span></span></a>","</dt>",'<dd class="Remover" dom="Remover"><a title="Delete this comment" hidefocus="hidefocus" href="#" e="click:removeClick">Remove</a></dd>','<dd class="Desc">','<h3><a href="#" dom="Nickname" hidefocus="hidefocus"></a></h3>','<p class="Comment" dom="Comment"></p>','<p class="Date" dom="Date"></p>',"</dd>","</dl>","</div>"]}),MoreItem:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.domLink.text("Show "+this.config.number+" more comments...")},onClick:function(a){a.stopPropagation();setTimeout(this.config.clickHandler,1);return false},template:'<dl class="Shortcut"><dt><a href="#" dom="Link" e="click:onClick" hidefocus="hidefocus"></a></dt></dl>'}),template:'<dd class="WhoLikes" dom="mountPoint"><div class="AdvItems" dom="Slidable"><div class="AdvItemsData" dom="HiddenItems"></div></div></dd>'});NFStory.Threaded.WhoLikesItStory=SmartComponent.extend({updateView:function(){if(!this.config.likes.length){this.dom.hide();this.parent.meLike(false);return}this.dom.show();this.icoBind();var h={},a=[],c=false,d=[];for(var b=0;b<this.config.likes.length;b++){var g=this.config.likes[b].User.ID;if(!(g in h)){var f=this.config.likes[b];h[g]=f;a.push(f);if(g==myUserId){c=true}else{d.push(f)}}}if(a.length==1){if(c){this.domSummary.empty().append("You like this.")}else{this.domSummary.empty().append($('<a href="#" hidefocus="hidefocus"></a>').append(d[0].User.Nickname||"").attr("href","profile.php?UserId="+d[0].User.ID).bind("click",genLinkClickHandler)).append(" likes this.")}}else{this.domSummary.empty().append(c?"You and ":"").append($('<a href="#" hidefocus="hidefocus"></a>').append(a.length>(c?2:1)?(a.length+(c?-1:0))+(c?" other":"")+" people":d[0].User.Nickname).attr("href",a.length>(c?2:1)?"#":"profile.php?UserId="+d[0].User.ID).bind("click",a.length>(c?2:1)?delegate(this,this.toggleExpandView):genLinkClickHandler)).append(" like this.")}this.config.likes=a;this.likesExceptMe=d;this.domIco.attr("title","Click here to "+(c?"stop liking":"like")+" this item");this.parent.meLike(c)},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.updateView()},icoBind:function(){this.domIco.unbind("click").one("click",delegate(this,this.onILikeItClick))},toggleExpandView:function(){if(!this.expanded){this.addChildComponent(this.expanded=new this.ExpandedView({likes:this.likesExceptMe}),this.dom,false,true)}this.expanded.toggle();return false},onILikeItClick:function(){if(checkNeedRegistration(myUserId)||!this.parent.sendILike()){this.icoBind()}return false},ExpandedView:SmartComponent.extend({initialize:function(a,d){arguments.callee.Parent.initialize.apply(this,arguments);this.moreItemsCreated=false;for(var b=0,f=0;b<a.likes.length;b++){if(f==11){this.addChildComponent(this.moreItem=new this.MoreItem({clickHandler:delegate(this,this.onMoreItemsClick)}));break}this.addChildComponent(new this.Item(a.likes[b]));f++}},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.dom.hide()},toggle:function(){this.dom.css("position","relative").slideToggle(400,delegate(this,this.onSlideFinished))},onSlideFinished:function(){this.dom.removeClass("LikesInMoreView").css("position","static")},onMoreItemsClick:function(){if(!this.moreItemsCreated){this.moreItemsCreated=true;for(var a=11;a<this.config.likes.length;a++){if(a==96){break}this.config.likes[a].ForMoreView=true;this.addChildComponent(new this.Item(this.config.likes[a]))}}this.dom.addClass("LikesInMoreView")},Item:SmartComponent.extend({onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);if(this.config.ForMoreView){this.dom.addClass("ForMoreView")}this.domLink.attr("href","profile.php?UserId="+this.config.User.ID).text(this.config.User.Nickname||"").attr("title",this.config.User.Nickname||"").bind("click",genLinkClickHandler)},onRenderComplete:function(){arguments.callee.Parent.onRenderComplete.apply(this,arguments);var a=IMAGE_PATH_CDN+getUserImagePath(this.config.User.ID,this.config.User.PictureID,this.config.User.PictureType,"d",this.config.User.Gender).path;FixImgSize.fix(a,this.domImg,31,28);this.domImg.attr("src",a).attr("title",this.config.User.Nickname||"").bind("click",delegate(this,this.onImgClick))},onImgClick:function(){return gotoLink("profile.php?UserId="+this.config.User.ID)},onImageLoadingError:function(){if(this.errorTry){this.domImg.unbind("error").hide();return}this.errorTry=true;var a=IMAGE_PATH_CDN+getUserImagePath(0,0,0,"d",this.config.User.Gender).path;FixImgSize.fix(a,this.domImg,31,28);this.domImg.attr("src",a)},template:'<dl><dt><span class="ClipWraper"><span class="Outer"><span class="Inner"><img alt="" dom="Img" e="error:onImageLoadingError"/></span></span></span></dt><dd class="Desc"><h3 class="Ellipsis"><a href="#" hidefocus="hidefocus" dom="Link"></a></h3></dd></dl>'}),MoreItem:SmartComponent.extend({onClick:function(a){a.stopPropagation();setTimeout(this.config.clickHandler,1);return false},template:'<div class="MoreLink"><a href="#" hidefocus="hidefocus" dom="Link" e="click:onClick">More...</a></div>'}),template:'<dd class="WhoLikesMinimal FlexFixV" style="position: relative;"><div class="WhoLikesMinimalList" dom="MountPoint"></div></dd>'}),template:'<dt class="Siblings"><span dom="Ico" class="Ico" /><span class="Summary" dom="Summary" /></dt>'});NFStory.Threaded.CommentInput=CommentInputBase.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.tplClassPrefix="PostCommentator";this.defaultText="Add comment..."},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.setVisibility(this.config.alwaysShown,undefined,true)},setVisibility:function(b,c,a){if(this.dom){if(b){if(a){this.dom.show();if(c){c()}}else{this.dom.css("position","relative").slideDown(400,delegate(this,this.onShowComplete,[c]))}}else{if(a){this.dom.hide();this.reset(true)}else{this.dom.css("position","relative").slideUp(400,delegate(this,this.onHideComplete))}}}},onShowComplete:function(a){this.dom.css("position","static");if(a){a()}},onHideComplete:function(){this.dom.css("position","static");this.reset(true)},exitEditing:function(b,a){if(!arguments.callee.Parent.exitEditing.apply(this,[b,!this.config.alwaysShown])){return false}if(!this.dirty){this.setVisibility(this.config.alwaysShown||false)}},enterEditing:function(b,a){if(!this.dom||this.submitProcessed){return}this.domBase.addClass(this.tplClassPrefix+"IsInit");if(!(this.editing||this.dirty)){this.domText.get(0).innerText=""}this.setVisibility(true,delegate(this,arguments.callee.Parent.enterEditing,Array.prototype.slice.apply(arguments,[0,arguments.length-1])),a)},update:function(c){switch(c.type){case"addThreadedCommentReady":this.afterPostComment();if(c.data==this.request&&c.data.myState==WebRequest.State.READY&&!c.data.error.code){this.request=null;var b=XML.xmlToObject(c.data.response);if(b.Status!=1){if(b.Status==3){var a=dataCache.get("UserData",{Nickname:"user"}).Nickname;alert("You cannot post anything else to "+a+"'s profile today as you have reached the daily limit.\nPlease try again later.")}else{alert("An error has occurred and your comment could not be posted.\n Please try again.")}break}this.controller.viewEvent(new mvcEvent(this,"addThreadedCommentDataReady",{onCommentId:this.config.CommentID,newItem:b.Item}))}break}},postComment:function(){this.beforePostComment();var a="<AddThreadedCommentRequest>"+this.controller.getAuthRequestStr()+"<OnUserID>"+this.config.User.ID+"</OnUserID><OnCommentID>"+this.config.CommentID+"</OnCommentID><ContextUserID>"+this.parent.config.Thread.contextUserId+"</ContextUserID><CommentID>0</CommentID><Comment><![CDATA["+$.trim(this.domText.val())+"]]></Comment></AddThreadedCommentRequest>";this.request=new WebRequest("addThreadedComment","/people/peoplefuncs.php","AddThreadedComment",a);this.controller.executeRequest(this.request);return false},template:['<dd class="WhatToAdd">','<div class="PostCommentator" dom="Base">','<div class="Protector" />','<div class="Fill">','<span class="FormField FieldTextArea" e="click:enterEditing" dom="RowBody">','<span class="Field">','<textarea name="" cols="" rows="" rightClick="true" dom="Text" e="blur:exitEditing,propertychange:checkFieldValue,paste:pasteHandler"></textarea>',"</span>","</span>","</div>",'<div class="Controls">','<div class="ControlsGroup">','<ul class="FlexFixV">','<li class="PostStatus">','<span class="LinkButton LinkButtonFixed LinkButtonDefault LinkButtonViewB ButtonDisabled" dom="Btn">','<a href="#" hidefocus="hidefocus" e="click:postComment" dom="DoPost"><span class="LinkButtonBody"><span class="TextData">Post</span></span></a>','<span class="CoverSave"></span>',"</span>","</li>",'<li class="SubmitStatus"><span class="TextData">Posting...</span></li>',"</ul>","</div>","</div>","</div>","</dd>"]});var NewsfeedBase=SmartPreloadableMvcView.extend({initialize:function(a,b){arguments.callee.Parent.initialize.apply(this,arguments);this.storyCounter=0;this.removeRequests=[];this.start=0;this.count=0;this.bulkIncrement=0;this.items=[];this.maxLength=0;this.feedOwnerId=0;this.feedViewerId=0;this.viewerIsFriend=false;this.serverDate=new Date().toUTCString();this.showNoMore=false;this.more=false;this.itemIdsArray={}},prepareRequest:function(){return null},showMore:function(){this.showNoMore=true;if(this.count>=this.maxLength){this.more=0;this.updateMoreStoriesLink();return false}this.count+=this.bulkIncrement;this.controller.executeRequest(this.request=this.prepareRequest());$(this.domMoreLinkDiv).addClass("MoreFeedsLinkLoading");return false},updateMoreStoriesLink:function(){var a;if(this.domDivFooter){a=this.domDivFooter;a.height(a.height())}if(this.more){this.domMoreLink.show();this.domNoMore.hide()}else{this.domMoreLink.hide();this.domNoMore[this.showNoMore?"show":"hide"]()}if(a){a.height("auto")}},updateMyState:function(){if(this.dom){if(this.items.length){this.dom.show()}this.updateMoreStoriesLink()}},onDomCreated:function(){arguments.callee.Parent.onDomCreated.apply(this,arguments);this.updateMyState()},collectItems:function(a){if(this.itemIdsArray[a]==true){return false}this.itemIdsArray[a]=true;return true},removeStory:function(b){if(b.config.Command!="AddNotification"&&!confirm("Are you sure you wish to delete this item?")){return}var c,a;switch(b.config.Command){case"AddComment":case"AddComment2":c="<RemoveCommentRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+b.config.contextUserId+"</ContextUserID><CommentID>"+b.config.CommentID+"</CommentID></RemoveCommentRequest>";a={request:new WebRequest("removeFeedItem","/people/peoplefuncs.php","RemoveComment",c),story:b};break;case"AddPictureComment":case"AddPictureComment2":c="<RemoveCommentRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+b.config.contextUserId+"</ContextUserID><CommentID>"+b.config.CommentID+"</CommentID></RemoveCommentRequest>";a={request:new WebRequest("removeFeedItem","/people/peoplefuncs.php","RemoveComment",c),story:b};break;case"AddCustomState2":c="<RemoveStatusRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+b.config.contextUserId+"</ContextUserID><ItemID>"+b.config.ItemID+"</ItemID></RemoveStatusRequest>";a={request:new WebRequest("removeFeedItem","/people/peoplefuncs.php","RemoveStatus",c),story:b};break;default:c="<RemoveItemRequest>"+this.controller.getAuthRequestStr()+"<ContextUserID>"+b.config.contextUserId+"</ContextUserID><ItemCommand>"+b.config.Command+"</ItemCommand><ItemID>"+b.config.ItemID+"</ItemID></RemoveItemRequest>";a={request:new WebRequest("removeFeedItem","/people/peoplefuncs.php","RemoveItem",c),story:b};break}this.controller.executeRequest(a.request);this.removeRequests.push(a)},onRemoveReady:function(b){if(b&&b.myState==WebRequest.State.READY&&!b.error.code){var f,d;for(f=0;f<this.removeRequests.length;f++){if(b==this.removeRequests[f].request){break}}if(f>=this.removeRequests.length){return}var a=this.removeRequests[f].story;this.removeRequests.splice(f,1);var c=XML.xmlToObject(b.response);if(c.Status!=1){alert("This story could not be removed due to an error.\n Please try again.");return}if((d=$.inArray(a,this.items))>=0){this.items.splice(d,1);if(this.firstModule==a){this.firstModule=d<this.items.length?this.items[d]:null;if(this.firstModule){this.firstModule.first(true)}}a.removeMe()}else{alert("We just cannot be here! hmm... Something very odd happened.")}this.controller.viewEvent(new mvcEvent(this,"removeNFItem",{story:a.config}))}},update:function(a){switch(a.type){case"removeFeedItemReady":this.onRemoveReady(a.data);break}},addItem:function(a,b){},addStory:function(a,b){if(a){if(!a.controller){a.setController(this.controller)}if(b){this.items.unshift(a)}else{this.items.push(a)}this.addChildComponent(a,null,b||false);if(b&&this.firstModule){this.firstModule.first(false);this.firstModule=a}if(!this.firstDone){this.firstModule=a}this.firstDone=true}},deleteAllItems:function(){$(this.items).each(function(){this.destroy()});this.items=[];this.firstDone=false;this.storyCounter=0;this.itemIdsArray={}},template:['<div class="NewsFeed Module" dom="FeedTop">','<div class="Feed">','<div class="Stories">','<div class="HeightSaver" dom="HeightSaver" style="display: none;"></div>','<ul class="Stories" dom="MountPoint"></ul>',"</div>",'<div class="MoreFeedsLink" dom="MoreLinkDiv">','<p class="GoMore" dom="MoreLink"><a href="#" e="click:showMore" hidefocus="hidefocus">Show more news...</a></p>','<p class="NoMore" dom="NoMore"><span class="TextData CursorText">There no more stories to display</span></p>',"</div>","</div>","</div>"]});var AskUserPhotoModalDialog=function(b,a){if(b&&a){b[a]=this}this.opened=false;this.submitAsk=function(){b.submitAsk()};this.getWin=function(){if(this.opened&&this.dialog){return this.dialog}this.dialog=showModelessDialog("addPhoto.html",this,"dialogWidth:"+((IE6)?300:294)+"px; dialogHeight:"+((IE6)?176:145)+"px; status:no;");return this.dialog};this.setStatus=function(c,d){if(this.opened){this.dialog.setStatus(c,d)}else{setTimeout(delegate(this,this.setStatus,[c,d]),300)}return this}};function createGASet(c,b){c=c||{};for(var a in c){c[a]=((b)?(b+"/"):"")+c[a]}return c};
