YAHOO.util.Attribute=function(D,C){if(C){this.owner=C;this.configure(D,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(H,L){var I;var G=this.owner;var K=this.name;var J={type:K,prevValue:this.getValue(),newValue:H};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(G,H)){return false;}if(!L){I=G.fireBeforeChangeEvent(J);if(I===false){return false;}}if(this.method){this.method.call(G,H);}this.value=H;this._written=true;J.type=K;if(!L){this.owner.fireChangeEvent(J);}return true;},configure:function(F,E){F=F||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var D in F){if(D&&YAHOO.lang.hasOwnProperty(F,D)){this[D]=F[D];if(E){this._initialConfig[D]=F[D];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(B){this.setValue(this.value,B);}};(function(){var B=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(A){this._configs=this._configs||{};var D=this._configs[A];if(!D){return undefined;}return D.value;},set:function(F,A,H){this._configs=this._configs||{};var G=this._configs[F];if(!G){return false;}return G.setValue(A,H);},getAttributeKeys:function(){this._configs=this._configs;var A=[];var F;for(var E in this._configs){F=this._configs[E];if(B.hasOwnProperty(this._configs,E)&&!B.isUndefined(F)){A[A.length]=E;}}return A;},setAttributes:function(A,F){for(var E in A){if(B.hasOwnProperty(A,E)){this.set(E,A[E],F);}}},resetValue:function(A,D){this._configs=this._configs||{};if(this._configs[A]){this.set(A,this._configs[A]._initialConfig.value,D);return true;}return false;},refresh:function(A,G){this._configs=this._configs;A=((B.isString(A))?[A]:A)||this.getAttributeKeys();for(var F=0,H=A.length;F<H;++F){if(this._configs[A[F]]&&!B.isUndefined(this._configs[A[F]].value)&&!B.isNull(this._configs[A[F]].value)){this._configs[A[F]].refresh(G);}}},register:function(D,A){this.setAttributeConfig(D,A);},getAttributeConfig:function(E){this._configs=this._configs||{};var F=this._configs[E]||{};var A={};for(E in F){if(B.hasOwnProperty(F,E)){A[E]=F[E];}}return A;},setAttributeConfig:function(F,E,A){this._configs=this._configs||{};E=E||{};if(!this._configs[F]){E.name=F;this._configs[F]=this.createAttribute(E);}else{this._configs[F].configure(E,A);}},configureAttribute:function(F,E,A){this.setAttributeConfig(F,E,A);},resetAttributeConfig:function(A){this._configs=this._configs||{};this._configs[A].resetConfig();},subscribe:function(D,A){this._events=this._events||{};if(!(D in this._events)){this._events[D]=this.createEvent(D);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(A){var D="before";D+=A.type.charAt(0).toUpperCase()+A.type.substr(1)+"Change";A.type=D;return this.fireEvent(A.type,A);},fireChangeEvent:function(A){A.type+="Change";return this.fireEvent(A.type,A);},createAttribute:function(A){return new YAHOO.util.Attribute(A,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var J=YAHOO.util.Dom,H=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(B,A){if(arguments.length){this.init(B,A);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(A){A=A.get?A.get("element"):A;this.get("element").appendChild(A);},getElementsByTagName:function(A){return this.get("element").getElementsByTagName(A);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(B,A){B=B.get?B.get("element"):B;A=(A&&A.get)?A.get("element"):A;this.get("element").insertBefore(B,A);},removeChild:function(A){A=A.get?A.get("element"):A;this.get("element").removeChild(A);return true;},replaceChild:function(B,A){B=B.get?B.get("element"):B;A=A.get?A.get("element"):A;return this.get("element").replaceChild(B,A);},initAttributes:function(A){},addListener:function(B,C,A,D){var E=this.get("element");D=D||this;E=this.get("id")||E;var F=this;if(!this._events[B]){if(this.DOM_EVENTS[B]){YAHOO.util.Event.addListener(E,B,function(N){if(N.srcElement&&!N.target){N.target=N.srcElement;}F.fireEvent(B,N);},A,D);}this.createEvent(B,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(A,B){this.unsubscribe.apply(this,arguments);},addClass:function(A){J.addClass(this.get("element"),A);},getElementsByClassName:function(A,B){return J.getElementsByClassName(A,B,this.get("element"));},hasClass:function(A){return J.hasClass(this.get("element"),A);},removeClass:function(A){return J.removeClass(this.get("element"),A);},replaceClass:function(A,B){return J.replaceClass(this.get("element"),A,B);},setStyle:function(A,B){var C=this.get("element");if(!C){return this._queue[this._queue.length]=["setStyle",arguments];}return J.setStyle(C,A,B);},getStyle:function(A){return J.getStyle(this.get("element"),A);},fireQueue:function(){var B=this._queue;for(var A=0,C=B.length;A<C;++A){this[B[A][0]].apply(this,B[A][1]);}},appendTo:function(B,A){B=(B.get)?B.get("element"):J.get(B);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:B});A=(A&&A.get)?A.get("element"):J.get(A);var C=this.get("element");if(!C){return false;}if(!B){return false;}if(C.parent!=B){if(A){B.insertBefore(C,A);}else{B.appendChild(C);}}this.fireEvent("appendTo",{type:"appendTo",target:B});},get:function(C){var A=this._configs||{};var B=A.element;if(B&&!A[C]&&!YAHOO.lang.isUndefined(B.value[C])){return B.value[C];}return H.prototype.get.call(this,C);},setAttributes:function(A,E){var B=this.get("element");for(var C in A){if(!this._configs[C]&&!YAHOO.lang.isUndefined(B[C])){this.setAttributeConfig(C);}}for(var D=0,F=this._configOrder.length;D<F;++D){if(A[this._configOrder[D]]!==undefined){this.set(this._configOrder[D],A[this._configOrder[D]],E);}}},set:function(C,A,D){var B=this.get("element");if(!B){this._queue[this._queue.length]=["set",arguments];if(this._configs[C]){this._configs[C].value=A;}return;}if(!this._configs[C]&&!YAHOO.lang.isUndefined(B[C])){K.call(this,C);}return H.prototype.set.apply(this,arguments);},setAttributeConfig:function(D,B,A){var C=this.get("element");if(C&&!this._configs[D]&&!YAHOO.lang.isUndefined(C[D])){K.call(this,D,B);}else{H.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(D);},getAttributeKeys:function(){var B=this.get("element");var A=H.prototype.getAttributeKeys.call(this);for(var C in B){if(!this._configs[C]){A[C]=A[C]||B[C];}}return A;},createEvent:function(A,B){this._events[A]=true;H.prototype.createEvent.apply(this,arguments);},init:function(A,B){G.apply(this,arguments);}};var G=function(B,C){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];C=C||{};C.element=C.element||B||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var A=false;if(YAHOO.lang.isString(B)){K.call(this,"id",{value:C.element});}if(J.get(B)){A=true;I.call(this,C);L.call(this,C);}YAHOO.util.Event.onAvailable(C.element,function(){if(!A){I.call(this,C);}this.fireEvent("available",{type:"available",target:C.element});},this,true);YAHOO.util.Event.onContentReady(C.element,function(){if(!A){L.call(this,C);}this.fireEvent("contentReady",{type:"contentReady",target:C.element});},this,true);};var I=function(A){this.setAttributeConfig("element",{value:J.get(A.element),readOnly:true});};var L=function(A){this.initAttributes(A);this.setAttributes(A,true);this.fireQueue();};var K=function(C,A){var B=this.get("element");A=A||{};A.name=C;A.method=A.method||function(D){B[C]=D;};A.value=A.value||B[C];this._configs[C]=new YAHOO.util.Attribute(A,this);};YAHOO.augment(YAHOO.util.Element,H);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.2",build:"1076"});(function(){var X=YAHOO.util.Dom,R=YAHOO.util.Event,V=YAHOO.lang,S=YAHOO.env.ua,P=YAHOO.widget.Overlay,U=YAHOO.widget.Menu,N={},T=null,Z=null,O=null;function Y(E,F,B,D){var A,C;if(V.isString(E)&&V.isString(F)){if(S.ie){C='<input type="'+E+'" name="'+F+'"';if(D){C+=" checked";}C+=">";A=document.createElement(C);}else{A=document.createElement("input");A.name=F;A.type=E;if(D){A.checked=true;}}A.value=B;return A;}}function W(H,B){var I=H.nodeName.toUpperCase(),D=this,C,G,F;function A(J){if(!(J in B)){C=H.getAttributeNode(J);if(C&&("value" in C)){B[J]=C.value;}}}function E(){A("type");if(B.type=="button"){B.type="push";}if(!("disabled" in B)){B.disabled=H.disabled;}A("name");A("value");A("title");}switch(I){case"A":B.type="link";A("href");A("target");break;case"INPUT":E();if(!("checked" in B)){B.checked=H.checked;}break;case"BUTTON":E();G=H.parentNode.parentNode;if(X.hasClass(G,this.CSS_CLASS_NAME+"-checked")){B.checked=true;}if(X.hasClass(G,this.CSS_CLASS_NAME+"-disabled")){B.disabled=true;}H.removeAttribute("value");H.setAttribute("type","button");break;}H.removeAttribute("id");H.removeAttribute("name");if(!("tabindex" in B)){B.tabindex=H.tabIndex;}if(!("label" in B)){F=I=="INPUT"?H.value:H.innerHTML;if(F&&F.length>0){B.label=F;}}}function Q(C){var D=C.attributes,E=D.srcelement,A=E.nodeName.toUpperCase(),B=this;if(A==this.NODE_NAME){C.element=E;C.id=E.id;X.getElementsBy(function(F){switch(F.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":W.call(B,F,D);break;}},"*",E);}else{switch(A){case"BUTTON":case"A":case"INPUT":W.call(this,E,D);break;}}}YAHOO.widget.Button=function(A,D){if(!P&&YAHOO.widget.Overlay){P=YAHOO.widget.Overlay;}if(!U&&YAHOO.widget.Menu){U=YAHOO.widget.Menu;}var B=YAHOO.widget.Button.superclass.constructor,C,E;if(arguments.length==1&&!V.isString(A)&&!A.nodeName){if(!A.id){A.id=X.generateId();}B.call(this,(this.createButtonElement(A.type)),A);}else{C={element:null,attributes:(D||{})};if(V.isString(A)){E=X.get(A);if(E){if(!C.attributes.id){C.attributes.id=A;}C.attributes.srcelement=E;Q.call(this,C);if(!C.element){C.element=this.createButtonElement(C.attributes.type);}B.call(this,C.element,C.attributes);}}else{if(A.nodeName){if(!C.attributes.id){if(A.id){C.attributes.id=A.id;}else{C.attributes.id=X.generateId();}}C.attributes.srcelement=A;Q.call(this,C);if(!C.element){C.element=this.createButtonElement(C.attributes.type);}B.call(this,C.element,C.attributes);}}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"yui-button",RADIO_DEFAULT_TITLE:"Unchecked.  Click to check.",RADIO_CHECKED_TITLE:"Checked.  Click another button to uncheck",CHECKBOX_DEFAULT_TITLE:"Unchecked.  Click to check.",CHECKBOX_CHECKED_TITLE:"Checked.  Click to uncheck.",MENUBUTTON_DEFAULT_TITLE:"Menu collapsed.  Click to expand.",MENUBUTTON_MENU_VISIBLE_TITLE:"Menu expanded.  Click or press Esc to collapse.",SPLITBUTTON_DEFAULT_TITLE:("Menu collapsed.  Click inside option region or press Ctrl + Shift + M to show the menu."),SPLITBUTTON_OPTION_VISIBLE_TITLE:"Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",SUBMIT_TITLE:"Click to submit form.",_setType:function(A){if(A=="split"){this.on("option",this._onOption);}},_setLabel:function(B){this._button.innerHTML=B;var A,C=S.gecko;if(C&&C<1.9&&X.inDocument(this.get("element"))){A=this.CSS_CLASS_NAME;this.removeClass(A);V.later(0,this,this.addClass,A);}},_setTabIndex:function(A){this._button.tabIndex=A;},_setTitle:function(A){var B=A;if(this.get("type")!="link"){if(!B){switch(this.get("type")){case"radio":B=this.RADIO_DEFAULT_TITLE;break;case"checkbox":B=this.CHECKBOX_DEFAULT_TITLE;break;case"menu":B=this.MENUBUTTON_DEFAULT_TITLE;break;case"split":B=this.SPLITBUTTON_DEFAULT_TITLE;break;case"submit":B=this.SUBMIT_TITLE;break;}}this._button.title=B;}},_setDisabled:function(A){if(this.get("type")!="link"){if(A){if(this._menu){this._menu.hide();}if(this.hasFocus()){this.blur();}this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");this.removeStateCSSClasses("hover");this.removeStateCSSClasses("active");this.removeStateCSSClasses("focus");}else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(A){if(this.get("type")=="link"){this._button.href=A;}},_setTarget:function(A){if(this.get("type")=="link"){this._button.setAttribute("target",A);}},_setChecked:function(B){var A=this.get("type"),C;if(A=="checkbox"||A=="radio"){if(B){this.addStateCSSClasses("checked");C=(A=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{this.removeStateCSSClasses("checked");C=(A=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",C);}},_setMenu:function(C){var I=this.get("lazyloadmenu"),F=this.get("element"),M,A=false,b,J,G,K,L,D,H;if(!P){return false;}if(U){M=U.prototype.CSS_CLASS_NAME;}function B(){b.render(F.parentNode);this.removeListener("appendTo",B);}function E(){if(b){X.addClass(b.element,this.get("menuclassname"));X.addClass(b.element,"yui-"+this.get("type")+"-button-menu");b.showEvent.subscribe(this._onMenuShow,null,this);b.hideEvent.subscribe(this._onMenuHide,null,this);b.renderEvent.subscribe(this._onMenuRender,null,this);if(U&&b instanceof U){b.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);b.subscribe("click",this._onMenuClick,this,true);b.itemAddedEvent.subscribe(this._onMenuItemAdded,this,true);G=b.srcElement;if(G&&G.nodeName.toUpperCase()=="SELECT"){G.style.display="none";G.parentNode.removeChild(G);}}else{if(P&&b instanceof P){if(!T){T=new YAHOO.widget.OverlayManager();}T.register(b);}}this._menu=b;if(!A){if(I&&U&&!(b instanceof U)){b.beforeShowEvent.subscribe(this._onOverlayBeforeShow,null,this);}else{if(!I){if(X.inDocument(F)){b.render(F.parentNode);}else{this.on("appendTo",B);}}}}}}if(C&&U&&(C instanceof U)){b=C;K=b.getItems();L=K.length;A=true;if(L>0){H=L-1;do{D=K[H];if(D){D.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,D,this);}}while(H--);}E.call(this);}else{if(P&&C&&(C instanceof P)){b=C;A=true;b.cfg.setProperty("visible",false);b.cfg.setProperty("context",[F,"tl","bl"]);E.call(this);}else{if(U&&V.isArray(C)){this.on("appendTo",function(){b=new U(X.generateId(),{lazyload:I,itemdata:C});E.call(this);});}else{if(V.isString(C)){J=X.get(C);if(J){if(U&&X.hasClass(J,M)||J.nodeName.toUpperCase()=="SELECT"){b=new U(C,{lazyload:I});E.call(this);}else{if(P){b=new P(C,{visible:false,context:[F,"tl","bl"]});E.call(this);}}}}else{if(C&&C.nodeName){if(U&&X.hasClass(C,M)||C.nodeName.toUpperCase()=="SELECT"){b=new U(C,{lazyload:I});E.call(this);}else{if(P){if(!C.id){X.generateId(C);}b=new P(C,{visible:false,context:[F,"tl","bl"]});E.call(this);}}}}}}}},_setOnClick:function(A){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=A)){this.removeListener("click",this._onclickAttributeValue.fn);this._onclickAttributeValue=null;}if(!this._onclickAttributeValue&&V.isObject(A)&&V.isFunction(A.fn)){this.on("click",A.fn,A.obj,A.scope);this._onclickAttributeValue=A;}},_setSelectedMenuItem:function(B){var C=this._menu,A;if(U&&C&&C instanceof U){A=C.getItem(B);if(A&&!A.cfg.getProperty("selected")){A.cfg.setProperty("selected",true);}}},_isActivationKey:function(E){var A=this.get("type"),D=(A=="checkbox"||A=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,B=D.length,C;if(B>0){C=B-1;do{if(E==D[C]){return true;}}while(C--);}},_isSplitButtonOptionKey:function(A){var B=(A.ctrlKey&&A.shiftKey&&R.getCharCode(A)==77);function C(D){R.preventDefault(D);this.removeListener("keypress",C);}if(B&&S.opera){this.on("keypress",C);}return B;},_addListenersToForm:function(){var A=this.getForm(),B=YAHOO.widget.Button.onFormKeyPress,C,G,D,E,F;if(A){R.on(A,"reset",this._onFormReset,null,this);R.on(A,"submit",this.createHiddenFields,null,this);G=this.get("srcelement");if(this.get("type")=="submit"||(G&&G.type=="submit")){D=R.getListeners(A,"keypress");C=false;if(D){E=D.length;if(E>0){F=E-1;do{if(D[F].fn==B){C=true;break;}}while(F--);}}if(!C){R.on(A,"keypress",B);}}}},_showMenu:function(H){if(YAHOO.widget.MenuManager){YAHOO.widget.MenuManager.hideVisible();}if(T){T.hideAll();}var J=P.VIEWPORT_OFFSET,A=this._menu,C=this,f=C.get("element"),F=false,D=X.getY(f),E=X.getDocumentScrollTop(),M,I,d;if(E){D=D-E;}var K=D,L=(X.getViewportHeight()-(D+f.offsetHeight));function G(){if(F){return(K-J);}else{return(L-J);}}function e(){var a=G();if(I>a){M=A.cfg.getProperty("minscrollheight");if(a>M){A.cfg.setProperty("maxheight",a);if(F){A.align("bl","tl");}else{A.align("tl","bl");}}if(a<M){if(F){A.cfg.setProperty("context",[f,"tl","bl"],true);A.align("tl","bl");}else{A.cfg.setProperty("context",[f,"bl","tl"],true);A.align("bl","tl");F=true;return e();}}}}if(U&&A&&(A instanceof U)){A.cfg.applyConfig({context:[f,"tl","bl"],clicktohide:false});A.cfg.fireQueue();A.show();A.cfg.setProperty("maxheight",0);A.align("tl","bl");if(H.type=="mousedown"){R.stopPropagation(H);}I=A.element.offsetHeight;d=A.element.lastChild;e();if(this.get("focusmenu")){this._menu.focus();}}else{if(P&&A&&(A instanceof P)){A.show();A.align("tl","bl");var B=G();I=A.element.offsetHeight;if(B<I){A.align("bl","tl");F=true;B=G();if(B<I){A.align("tl","bl");}}}}},_hideMenu:function(){var A=this._menu;if(A){A.hide();}},_onMouseOver:function(A){if(!this._hasMouseEventHandlers){this.on("mouseout",this._onMouseOut);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this._hasMouseEventHandlers=true;}this.addStateCSSClasses("hover");if(this._activationButtonPressed){this.addStateCSSClasses("active");}if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}if(this._activationButtonPressed||this._bOptionPressed){R.removeListener(document,"mouseup",this._onDocumentMouseUp);}},_onMouseOut:function(A){this.removeStateCSSClasses("hover");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationButtonPressed||this._bOptionPressed){R.on(document,"mouseup",this._onDocumentMouseUp,null,this);}},_onDocumentMouseUp:function(B){this._activationButtonPressed=false;this._bOptionPressed=false;var A=this.get("type"),D,C;if(A=="menu"||A=="split"){D=R.getTarget(B);C=this._menu.element;if(D!=C&&!X.isAncestor(C,D)){this.removeStateCSSClasses((A=="menu"?"active":"activeoption"));this._hideMenu();}}R.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(C){var A,E,B,D;function F(){this._hideMenu();this.removeListener("mouseup",F);}if((C.which||C.button)==1){if(!this.hasFocus()){this.focus();}A=this.get("type");if(A=="split"){E=this.get("element");B=R.getPageX(C)-X.getX(E);if((E.offsetWidth-this.OPTION_AREA_WIDTH)<B){this.fireEvent("option",C);}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}else{if(A=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}else{this._showMenu(C);this._activationButtonPressed=true;}}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}if(A=="split"||A=="menu"){D=this;this._hideMenuTimerId=window.setTimeout(function(){D.on("mouseup",F);},250);}}},_onMouseUp:function(B){var A=this.get("type");if(this._hideMenuTimerId){window.clearTimeout(this._hideMenuTimerId);}if(A=="checkbox"||A=="radio"){this.set("checked",!(this.get("checked")));}this._activationButtonPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}},_onFocus:function(A){var B;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}O=this;if(!this._hasKeyEventHandlers){B=this._button;R.on(B,"blur",this._onBlur,null,this);R.on(B,"keydown",this._onKeyDown,null,this);R.on(B,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}this.fireEvent("focus",A);},_onBlur:function(A){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationKeyPressed){R.on(document,"keyup",this._onDocumentKeyUp,null,this);}O=null;this.fireEvent("blur",A);},_onDocumentKeyUp:function(A){if(this._isActivationKey(R.getCharCode(A))){this._activationKeyPressed=false;R.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(A){var B=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(A)){this.fireEvent("option",A);}else{if(this._isActivationKey(R.getCharCode(A))){if(this.get("type")=="menu"){this._showMenu(A);}else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}}if(B&&B.cfg.getProperty("visible")&&R.getCharCode(A)==27){B.hide();this.focus();}},_onKeyUp:function(B){var A;if(this._isActivationKey(R.getCharCode(B))){A=this.get("type");if(A=="checkbox"||A=="radio"){this.set("checked",!(this.get("checked")));}this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(D){var A=this.get("type"),G,C,F,E,B;switch(A){case"radio":case"checkbox":if(this.get("checked")){G=(A=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{G=(A=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",G);break;case"submit":this.submitForm();break;case"reset":C=this.getForm();if(C){C.reset();}break;case"menu":G=this._menu.cfg.getProperty("visible")?this.MENUBUTTON_MENU_VISIBLE_TITLE:this.MENUBUTTON_DEFAULT_TITLE;this.set("title",G);break;case"split":E=this.get("element");B=R.getPageX(D)-X.getX(E);if((E.offsetWidth-this.OPTION_AREA_WIDTH)<B){return false;}else{this._hideMenu();F=this.get("srcelement");if(F&&F.type=="submit"){this.submitForm();}}G=this._menu.cfg.getProperty("visible")?this.SPLITBUTTON_OPTION_VISIBLE_TITLE:this.SPLITBUTTON_DEFAULT_TITLE;this.set("title",G);break;}},_onAppendTo:function(A){var B=this;window.setTimeout(function(){B._addListenersToForm();},0);},_onFormReset:function(B){var A=this.get("type"),C=this._menu;if(A=="checkbox"||A=="radio"){this.resetValue("checked");}if(U&&C&&(C instanceof U)){this.resetValue("selectedMenuItem");}},_onDocumentMouseDown:function(A){var D=R.getTarget(A),B=this.get("element"),C=this._menu.element;if(D!=B&&!X.isAncestor(B,D)&&D!=C&&!X.isAncestor(C,D)){this._hideMenu();R.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(A){if(this.hasClass("yui-split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}else{this._showMenu(A);this._bOptionPressed=true;}},_onOverlayBeforeShow:function(A){var B=this._menu;B.render(this.get("element").parentNode);B.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);},_onMenuShow:function(B){R.on(document,"mousedown",this._onDocumentMouseDown,null,this);var C,A;if(this.get("type")=="split"){C=this.SPLITBUTTON_OPTION_VISIBLE_TITLE;A="activeoption";}else{C=this.MENUBUTTON_MENU_VISIBLE_TITLE;A="active";}this.addStateCSSClasses(A);this.set("title",C);},_onMenuHide:function(B){var C=this._menu,D,A;if(this.get("type")=="split"){D=this.SPLITBUTTON_DEFAULT_TITLE;A="activeoption";}else{D=this.MENUBUTTON_DEFAULT_TITLE;A="active";}this.removeStateCSSClasses(A);this.set("title",D);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(A,B){var C=B[0];if(R.getCharCode(C)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(C){var A=this.get("element"),D=A.parentNode,B=this._menu.element;if(D!=B.parentNode){D.appendChild(B);}this.set("selectedMenuItem",this.get("selectedMenuItem"));},_onMenuItemSelected:function(B,C,D){var A=C[0];if(A){this.set("selectedMenuItem",D);}},_onMenuItemAdded:function(B,C,D){var A=C[0];A.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,A,this);},_onMenuClick:function(C,D){var A=D[1],B;if(A){B=this.get("srcelement");if(B&&B.type=="submit"){this.submitForm();}this._hideMenu();}},createButtonElement:function(C){var A=this.NODE_NAME,B=document.createElement(A);B.innerHTML="<"+A+' class="first-child">'+(C=="link"?"<a></a>":'<button type="button"></button>')+"</"+A+">";return B;},addStateCSSClasses:function(B){var A=this.get("type");if(V.isString(B)){if(B!="activeoption"){this.addClass(this.CSS_CLASS_NAME+("-"+B));}this.addClass("yui-"+A+("-button-"+B));}},removeStateCSSClasses:function(B){var A=this.get("type");if(V.isString(B)){this.removeClass(this.CSS_CLASS_NAME+("-"+B));this.removeClass("yui-"+A+("-button-"+B));}},createHiddenFields:function(){this.removeHiddenFields();var D=this.getForm(),A,H,F,C,B,G,E,I;if(D&&!this.get("disabled")){H=this.get("type");F=(H=="checkbox"||H=="radio");if(F||(Z==this)){A=Y((F?H:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(A){if(F){A.style.display="none";}D.appendChild(A);}}C=this._menu;if(U&&C&&(C instanceof U)){I=C.srcElement;B=this.get("selectedMenuItem");if(B){if(I&&I.nodeName.toUpperCase()=="SELECT"){D.appendChild(I);I.selectedIndex=B.index;}else{E=(B.value===null||B.value==="")?B.cfg.getProperty("text"):B.value;G=this.get("name");if(E&&G){I=Y("hidden",(G+"_options"),E);D.appendChild(I);}}}}if(A&&I){this._hiddenFields=[A,I];}else{if(!A&&I){this._hiddenFields=I;}else{if(A&&!I){this._hiddenFields=A;}}}return this._hiddenFields;}},removeHiddenFields:function(){var A=this._hiddenFields,C,B;function D(E){if(X.inDocument(E)){E.parentNode.removeChild(E);}}if(A){if(V.isArray(A)){C=A.length;if(C>0){B=C-1;do{D(A[B]);}while(B--);}}else{D(A);}this._hiddenFields=null;}},submitForm:function(){var A=this.getForm(),B=this.get("srcelement"),C=false,D;if(A){if(this.get("type")=="submit"||(B&&B.type=="submit")){Z=this;}if(S.ie){C=A.fireEvent("onsubmit");}else{D=document.createEvent("HTMLEvents");D.initEvent("submit",true,true);C=A.dispatchEvent(D);}if((S.ie||S.webkit)&&C){A.submit();}}return C;},init:function(J,C){var H=C.type=="link"?"a":"button",F=C.srcelement,D=J.getElementsByTagName(H)[0],E;if(!D){E=J.getElementsByTagName("input")[0];if(E){D=document.createElement("button");D.setAttribute("type","button");E.parentNode.replaceChild(D,E);}}this._button=D;YAHOO.widget.Button.superclass.init.call(this,J,C);N[this.get("id")]=this;this.addClass(this.CSS_CLASS_NAME);this.addClass("yui-"+this.get("type")+"-button");R.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("click",this._onClick);this.on("appendTo",this._onAppendTo);var A=this.get("container"),I=this.get("element"),B=X.inDocument(I),G;if(A){if(F&&F!=I){G=F.parentNode;if(G){G.removeChild(F);}}if(V.isString(A)){R.onContentReady(A,function(){this.appendTo(A);},null,this);}else{this.appendTo(A);}}else{if(!B&&F&&F!=I){G=F.parentNode;if(G){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:G});G.replaceChild(I,F);this.fireEvent("appendTo",{type:"appendTo",target:G});}}else{if(this.get("type")!="link"&&B&&F&&F==I){this._addListenersToForm();}}}},initAttributes:function(A){var B=A||{};YAHOO.widget.Button.superclass.initAttributes.call(this,B);this.setAttributeConfig("type",{value:(B.type||"push"),validator:V.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:B.label,validator:V.isString,method:this._setLabel});this.setAttributeConfig("value",{value:B.value});this.setAttributeConfig("name",{value:B.name,validator:V.isString});this.setAttributeConfig("tabindex",{value:B.tabindex,validator:V.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:B.title,validator:V.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(B.disabled||false),validator:V.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:B.href,validator:V.isString,method:this._setHref});this.setAttributeConfig("target",{value:B.target,validator:V.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(B.checked||false),validator:V.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:B.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:B.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(B.lazyloadmenu===false?false:true),validator:V.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(B.menuclassname||"yui-button-menu"),validator:V.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("selectedMenuItem",{value:null,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:B.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(B.focusmenu===false?false:true),validator:V.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(O==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){return this._button.form;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var C=this.get("element"),D=C.parentNode,E=this._menu,A;if(E){if(T&&T.find(E)){T.remove(E);}E.destroy();}R.purgeElement(C);R.purgeElement(this._button);R.removeListener(document,"mouseup",this._onDocumentMouseUp);R.removeListener(document,"keyup",this._onDocumentKeyUp);R.removeListener(document,"mousedown",this._onDocumentMouseDown);var B=this.getForm();if(B){R.removeListener(B,"reset",this._onFormReset);R.removeListener(B,"submit",this.createHiddenFields);}this.unsubscribeAll();if(D){D.removeChild(C);}delete N[this.get("id")];A=X.getElementsByClassName(this.CSS_CLASS_NAME,this.NODE_NAME,B);if(V.isArray(A)&&A.length===0){R.removeListener(B,"keypress",YAHOO.widget.Button.onFormKeyPress);}},fireEvent:function(B,C){var A=arguments[0];if(this.DOM_EVENTS[A]&&this.get("disabled")){return;}return YAHOO.widget.Button.superclass.fireEvent.apply(this,arguments);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(G){var I=R.getTarget(G),F=R.getCharCode(G),H=I.nodeName&&I.nodeName.toUpperCase(),K=I.type,E=false,C,B,J,A;function D(L){var M,b;switch(L.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(L.type=="submit"&&!L.disabled){if(!E&&!J){J=L;}if(B&&!A){A=L;}}break;default:M=L.id;if(M){C=N[M];if(C){E=true;if(!C.get("disabled")){b=C.get("srcelement");if(!B&&(C.get("type")=="submit"||(b&&b.type=="submit"))){B=C;}}}}break;}}if(F==13&&((H=="INPUT"&&(K=="text"||K=="password"||K=="checkbox"||K=="radio"||K=="file"))||H=="SELECT")){X.getElementsBy(D,"*",this);if(J){J.focus();}else{if(!J&&B){if(A){R.preventDefault(G);}B.submitForm();}}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(F){var A=X.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",F),C=A.length,B,E,D;if(C>0){for(D=0;D<C;D++){E=A[D].id;if(E){B=N[E];if(B){B.createHiddenFields();}}}}};YAHOO.widget.Button.getButton=function(B){var A=N[B];if(A){return A;}};})();(function(){var I=YAHOO.util.Dom,J=YAHOO.util.Event,H=YAHOO.lang,F=YAHOO.widget.Button,G={};YAHOO.widget.ButtonGroup=function(B,D){var C=YAHOO.widget.ButtonGroup.superclass.constructor,A,E,L;if(arguments.length==1&&!H.isString(B)&&!B.nodeName){if(!B.id){L=I.generateId();B.id=L;}C.call(this,(this._createGroupElement()),B);}else{if(H.isString(B)){E=I.get(B);if(E){if(E.nodeName.toUpperCase()==this.NODE_NAME){C.call(this,E,D);}}}else{A=B.nodeName.toUpperCase();if(A&&A==this.NODE_NAME){if(!B.id){B.id=I.generateId();}C.call(this,B,D);}}}};YAHOO.extend(YAHOO.widget.ButtonGroup,YAHOO.util.Element,{_buttons:null,NODE_NAME:"DIV",CSS_CLASS_NAME:"yui-buttongroup",_createGroupElement:function(){var A=document.createElement(this.NODE_NAME);return A;},_setDisabled:function(B){var A=this.getCount(),C;if(A>0){C=A-1;do{this._buttons[C].set("disabled",B);}while(C--);}},_onKeyDown:function(A){var E=J.getTarget(A),C=J.getCharCode(A),D=E.parentNode.parentNode.id,B=G[D],L=-1;if(C==37||C==38){L=(B.index===0)?(this._buttons.length-1):(B.index-1);}else{if(C==39||C==40){L=(B.index===(this._buttons.length-1))?0:(B.index+1);}}if(L>-1){this.check(L);this.getButton(L).focus();}},_onAppendTo:function(B){var A=this._buttons,C=A.length,D;for(D=0;D<C;D++){A[D].appendTo(this.get("element"));}},_onButtonCheckedChange:function(C,D){var A=C.newValue,B=this.get("checkedButton");if(A&&B!=D){if(B){B.set("checked",false,true);}this.set("checkedButton",D);this.set("value",D.get("value"));}else{if(B&&!B.set("checked")){B.set("checked",true,true);}}},init:function(B,C){this._buttons=[];YAHOO.widget.ButtonGroup.superclass.init.call(this,B,C);this.addClass(this.CSS_CLASS_NAME);var A=this.getElementsByClassName("yui-radio-button");if(A.length>0){this.addButtons(A);}function E(L){return(L.type=="radio");}A=I.getElementsBy(E,"input",this.get("element"));if(A.length>0){this.addButtons(A);}this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var D=this.get("container");if(D){if(H.isString(D)){J.onContentReady(D,function(){this.appendTo(D);},null,this);}else{this.appendTo(D);}}},initAttributes:function(A){var B=A||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,B);this.setAttributeConfig("name",{value:B.name,validator:H.isString});this.setAttributeConfig("disabled",{value:(B.disabled||false),validator:H.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:B.value});this.setAttributeConfig("container",{value:B.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(C){var A,B,M,N,E,D;if(C instanceof F&&C.get("type")=="radio"){A=C;}else{if(!H.isString(C)&&!C.nodeName){C.type="radio";A=new F(C);}else{A=new F(C,{type:"radio"});}}if(A){N=this._buttons.length;E=A.get("name");D=this.get("name");A.index=N;this._buttons[N]=A;G[A.get("id")]=A;if(E!=D){A.set("name",D);}if(this.get("disabled")){A.set("disabled",true);}if(A.get("checked")){this.set("checkedButton",A);}B=A.get("element");M=this.get("element");if(B.parentNode!=M){M.appendChild(B);}A.on("checkedChange",this._onButtonCheckedChange,A,this);return A;}},addButtons:function(D){var C,B,A,E;if(H.isArray(D)){C=D.length;A=[];if(C>0){for(E=0;E<C;E++){B=this.addButton(D[E]);if(B){A[A.length]=B;}}if(A.length>0){return A;}}}},removeButton:function(B){var A=this.getButton(B),C,D;if(A){this._buttons.splice(B,1);delete G[A.get("id")];A.removeListener("checkedChange",this._onButtonCheckedChange);A.destroy();C=this._buttons.length;if(C>0){D=this._buttons.length-1;do{this._buttons[D].index=D;}while(D--);}}},getButton:function(A){if(H.isNumber(A)){return this._buttons[A];}},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(B){var A,C,D;if(H.isNumber(B)){A=this._buttons[B];if(A){A.focus();}}else{C=this.getCount();for(D=0;D<C;D++){A=this._buttons[D];if(!A.get("disabled")){A.focus();break;}}}},check:function(B){var A=this.getButton(B);if(A){A.set("checked",true);}},destroy:function(){var A=this._buttons.length,B=this.get("element"),D=B.parentNode,C;if(A>0){C=this._buttons.length-1;do{this._buttons[C].destroy();}while(C--);}J.purgeElement(B);D.removeChild(B);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.5.2",build:"1076"});perfUI.widgets.languages=function(){var B=this;var A=function(D,E,C){this.id=E||"";this.name=C||"";this.init=function(){if(D){this.id=PERF.parseNodeNumeric(D,"id");this.name=PERF.parseNode(D,"name");}};this.init();};this.loadLanguagesDropDown=function(E,D){D=D||"0";var C=function(I){for(var H=0;H<I.length;H++){var F=I[H];var G=addNode(E,"option");G.value=String(F.id);G.innerHTML="&nbsp;"+F.name;}if(String(D).trim().length>0){E.value=String(D).trim();}};this.getLanguagesCollection(C);};this.getLanguagesCollection=function(H){var E=[];var F={url:"/api/callna.asp",params:"?Function=GetLanguages"};var D=function(I){H(E);};var C=function(I){var J=I.responseXML;var L=J.getElementsByTagName("languages")[0];if(L!=null){var M=L.getElementsByTagName("language");for(var K=0;K<M.length;K++){E.push(new A(M[K]));}}H(E);};var G={success:C,failure:D,scope:B};YAHOO.util.Connect.asyncRequest("GET",F.url+F.params,G,null);};};perfUI.widgets.splitButton=function(B){var E=YAHOO.util.Dom;var F=perfUI.util.addEl;var C;var A=new perfUI.widgets.menu(B);var D="";this.containerCss="yui-skin-sam";this.getMenu=function(){return A;};this.getType=function(){return D;};this.destroy=function(){C=null;A=null;};this.setType=function(H,G){D=H;switch(H){case"delete":C=F(B,"DIV",{"class":"deleteImg"});break;case"link":C=F(B,"a",{"innerHTML":G,"class":"splitButtonLink"});break;case"dropDownList":C=F(B,"div",{"class":"pullDown left"});break;default:C=B;break;}};this.setEl=function(G){C=G;};this.addMenuItem=function(G){A.addItems([G]);};this.addMenuItems=function(G){A.addItems(G);};this.toggleMenu=function(G){YAHOO.util.Event.purgeElement(C,false,"click");if(A.menuClosed){A.show(G);}else{A.closeMenu(G);}YAHOO.util.Event.addListener(C,"click",this.toggleMenu,this,true);};this.render=function(){if(!E.hasClass(B,this.containerCss)){}E.addClass(B,this.containerCss);A.render(B);switch(D){case"dropDownList":YAHOO.util.Event.addListener(C,"click",this.toggleMenu,this,true);break;default:YAHOO.util.Event.addListener(C,"click",A.show,A,true);break;}};};perfUI.widgets.showHideContainer=function(I,A,C,K){var L=this;this.autoEvents=K==undefined?true:K;this.isCollapsed=C==undefined?false:C;this.onExpandClick=new YAHOO.util.CustomEvent("onExpandClick",this);this.onCollapseClick=new YAHOO.util.CustomEvent("onCollapseClick",this);this.onExpand=new YAHOO.util.CustomEvent("onExpand",this);this.onCollapse=new YAHOO.util.CustomEvent("onCollapse",this);var E="showHideIcon";var H=I.className+" "+E+" "+E+"Collapse";var D=I.className+" "+E+" "+E+"Expand";var B="Hover";var G=I.className+" showHideIconLoading";this.setLoadingIconCss=function(){I.className=G;};this.doCollapse=function(){A.style.display="none";this.isCollapsed=true;I.className=D;I.title="Click to Expand";this.onCollapse.fire();};this.doExpand=function(M){A.style.display="block";this.isCollapsed=false;I.className=H;I.title="Click to Collapse";this.onExpand.fire();};this.toggle=function(){if(I.className.indexOf(H.trim())>=0){this.onCollapseClick.fire();if(this.autoEvents){this.doCollapse();}}else{this.onExpandClick.fire();if(this.autoEvents){this.doExpand();}}};var J=function(){I.className+=B;};var F=function(){I.className=I.className.replace(B,"");};I.className=E;if(this.isCollapsed){this.doCollapse();}else{this.doExpand();}YAHOO.util.Event.addListener(I,"click",this.toggle,this,true);YAHOO.util.Event.addListener(I,"mouseover",J,this,true);YAHOO.util.Event.addListener(I,"mouseout",F,this,true);};perfUI.widgets.ToolTip=function(B,A){if(typeof(tipobj)=="undefined"){tipobj=document.createElement("DIV");tipobj.id="dhtmltooltip";}if(typeof(pointerobj)=="undefined"){pointerobj=document.createElement("DIV");pointerobj.id="dhtmlpointer";pointerobj.appendChild(document.createElement("DIV"));}this.tipobj=tipobj;tipobj.style.width="auto";B.txt=A;B.onmouseover=perfUI.widgets.ToolTip.mouseover;this.setBackgroundColor=function(C){pointerobj.firstChild.style.borderTopColor=C;pointerobj.firstChild.style.borderBottomColor=C;tipobj.style.backgroundColor=C;};this.setBackgroundColor("lightyellow");};perfUI.widgets.ToolTip.mouseout=function(){this.onmousemove=null;this.onmouseout=null;tipobj.parentNode.removeChild(tipobj);pointerobj.parentNode.removeChild(pointerobj);};perfUI.widgets.ToolTip.mouseover=function(){if(document.all&&document.readyState!="complete"){return;}tipobj.style.visibility="hidden";tipobj.style.top="0px";tipobj.style.left="0px";document.body.appendChild(tipobj);if(typeof this.txt=="object"){while(tipobj.childNodes.length){tipobj.removeChild(tipobj.firstChild);}tipobj.appendChild(this.txt);}else{tipobj.innerHTML=this.txt;}document.body.appendChild(pointerobj);this.onmousemove=perfUI.widgets.ToolTip.mousemove;this.onmouseout=perfUI.widgets.ToolTip.mouseout;};perfUI.widgets.ToolTip.mousemove=function(G){var G=YAHOO.util.Event.getEvent(G);var C=YAHOO.util.Event.getPageX(G);var A=YAHOO.util.Event.getPageY(G);var D=12;var B=10;var K=10;var J=14;var F=YAHOO.util.Dom.getViewportWidth()-G.clientX-D;var E=YAHOO.util.Dom.getViewportHeight()-G.clientY-B;var I=F>=tipobj.offsetWidth;var H=E>=tipobj.offsetHeight;tipobj.style.left=C+(!I?0-tipobj.offsetWidth:D-K)+"px";tipobj.style.top=A+(!H?0-tipobj.offsetHeight-B:B+J)+"px";tipobj.style.visibility="visible";pointerobj.style.top=A+B+(H?0:-21)+"px";pointerobj.style.left=C+(I?D:0-D-15)+"px";pointerobj.className="pointerobj"+(H?"Up":"Bottom")+(I?"Right":"Left");};perfUI.widgets.activityIndicator=function(B){B=B||document.body;var A=null;var C=function(){A=new YAHOO.widget.Panel("pageActivityIndicator",{width:"200px",fixedcenter:false,close:false,draggable:false,zindex:4,modal:true,visible:false});A.setBody('<div class="activityLoadingDialog"><p>loading, please wait...</p></div>');A.render(B);};C();this.show=function(){A.show();};this.hide=function(){A.hide();};this.center=function(){A.center();};};perfUI.widgets.reportAbuse=function(B){var F=this;var G=perfUI.util.addEl;var E=YAHOO.util.Dom;var A=[{"value":"1","text":perfTranslator.getValue(1191),"control":null},{"value":"2","text":perfTranslator.getValue(1192),"control":null},{"value":"3","text":perfTranslator.getValue(1193),"control":null},{"value":"4","text":perfTranslator.getValue(1194),"control":null},{"value":"5","text":perfTranslator.getValue(1195),"control":null},{"value":"6","text":perfTranslator.getValue(1196),"control":null},{"value":"7","text":perfTranslator.getValue(1197),"control":null},{"value":"8","text":perfTranslator.getValue(413),"control":null}];var C=A;var D="";this.onRender=new YAHOO.util.CustomEvent("onRender",this);this.getContainer=function(){return B;};this.getSelectedValue=function(){return D;};this.clearSelectedValue=function(){var J=this.getOptions();for(var I=0;I<J.length;I++){var H=J[I].control;if(H){H.checked=false;}}this.setSelectedValue("");};this.setSelectedValue=function(H){D=H;};this.setOptions=function(H){C=H;};this.getOptions=function(){return C;};this.isHidden=function(){if(B.style.display=="none"){return true;}else{return false;}};this.toggle=function(){if(this.isHidden()){this.show();}else{this.hide();}};this.hide=function(){B.style.display="none";};this.show=function(){B.style.display="block";};this.render=function(){var M=G(B,"div",{"class":"optionlist"});var K=this.getOptions();for(var J=0;J<K.length;J++){var L=G(M,"div",{"class":"radio"});var I=G(L,"radio",{"value":K[J].value,"name":"reason"});var H=function(O,N){N.checked=true;F.setSelectedValue(N.value);};G(L,"label",{"innerHTML":K[J].text});YAHOO.util.Event.addListener(L,"click",H,I);K[J].control=I;}this.onRender.fire();};this.renderButtons=function(){var I=G(B,"center",{"class":"buttonbox clear"});var H=G(I,"span",{"class":"submit"});this.buttonSubmit=new YAHOO.widget.Button({label:perfTranslator.getValue(320),container:H});var J=G(I,"span",{"class":"cancel"});this.buttonCancel=new YAHOO.widget.Button({label:perfTranslator.getValue(701),onclick:{fn:this.hide,obj:null,scope:this},container:J});};};perfUI.widgets.reportAbuse.prototype.send=function(B,G,F,A){F=F||this.getSelectedValue();var D="/report.asp?s="+G+"&b="+B+"&r="+F;if(A){D+="&e="+A;}try{var C=getHttpRequestObj();C.open("GET",D,true);C.send(null);}catch(E){alert("Unable to Report Abuse at this time");}};perfUI.widgets.reportAbuseMenu=function(container){var addEl=perfUI.util.addEl;var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;perfUI.widgets.reportAbuseMenu.superclass.constructor.call(this,container);var container=this.getContainer();Dom.addClass(container,"report_abuse");addEl(container,"strong",{"class":"txtdblue","innerHTML":perfTranslator.getValue(1189)});this.orientation=this.hide=function(){container.style.display="none";Event.removeListener(window,"resize",this.hide,this,true);};this.show=function(e,context){context=context||"tl";var xy=YAHOO.util.Event.getXY(e);var x=xy[0];var y=xy[1];with(container.style){position="absolute";zIndex="2";top=y+"px";left=x+"px";display="block";}var reg=YAHOO.util.Region.getRegion(container);var w=reg.right-reg.left;var view=Dom.getViewportWidth();if(x+w>view||context=="tr"){container.style.left=(x-w)+"px";}Event.addListener(window,"resize",this.hide,this,true);};};YAHOO.extend(perfUI.widgets.reportAbuseMenu,perfUI.widgets.reportAbuse);perfUI.widgets.reportAbuseMenu.prototype.send=function(B,A){if(this.buttonSubmit&&this.buttonSubmit.set){this.buttonSubmit.set("disabled",true);}perfUI.widgets.reportAbuseMenu.superclass.send.call(this,A.userId,A.section,null,A.optional);this.buttonSubmit.set("disabled",false);this.hide();};perfUI.widgets.panel=function(A,K,F,L){var D=YAHOO.util.Dom;var H=perfUI.util.addEl;var M=YAHOO.util.Event;var Q=null;var C=null;var E=null;var G=null;var J=null;var N=null;var I=null;var O=null;var P=false;var B=false;this.container=A||null;this.width=K||"auto";this.height=F||"auto";this.panelCss="";this.elementCss="yui-panel";this.headerCss="hd";this.bodyCss="bd";this.footerCss="ft";this.modal=L==undefined?true:L;this.alertDialog=null;this.afterRenderComplete=new YAHOO.util.CustomEvent("afterRenderComplete",this);this.onShowEvent=new YAHOO.util.CustomEvent("onShowEvent",this);this.onHideEvent=new YAHOO.util.CustomEvent("onHideEvent",this);this.afterRenderComplete.subscribe(function(){B=true;},this);this.isRendered=function(){return B;};this.setMask=function(R){Q=R;};this.getMask=function(){return Q;};this.setElement=function(R){C=R;};this.getElement=function(){return C;};this.setHeader=function(R){if(!R||(typeof R=="string"&&R.trim().length==0)){N="";}else{E=R;}};this.setDraggable=function(R){R=(R==null?true:R);if(!this.isRendered()){P=R;}else{if(R){if(this.getHeader()){if(!this.dragDrop){this.dragDrop=new YAHOO.util.DD(this.container);}this.dragDrop.setHandleElId(this.getHeader());}}else{if(this.dragDrop&&this.getHeader()){this.dragDrop.unreg();}}}};this.getHeader=function(){return E;};this.setHeaderTemplate=function(R){N=R;};this.getHeaderTemplate=function(){return N;};this.setBodyTemplate=function(R){I=R;};this.getBodyTemplate=function(){return I;};this.setFooterTemplate=function(R){O=R;};this.getFooterTemplate=function(){return O;};this.setBody=function(R){if(!R||(typeof R=="string"&&R.trim().length==0)){I="";}else{G=R;}};this.getBody=function(){return G;};this.setFooter=function(R){if(!R||(typeof R=="string"&&R.trim().length==0)){O="";}else{J=R;}};this.getFooter=function(){return J;};this.isDraggable=function(){return P;};this.makeModal=function(){var R=this.getMask();var S=this.getElement();D.setStyle(this.container,"position","absolute");if(!R){var R=new perfUI.widgets.panelMask();this.setMask(R);R.stack(this.container);}var T=function(){var U=this.getMask();if(U){U.destroy();}U=null;};};};perfUI.widgets.panel.prototype.center=function(){var C=YAHOO.util.Dom;var I=10;var A=this.container;var G=A.offsetWidth,D=A.offsetHeight,F=C.getViewportWidth(),B=C.getViewportHeight(),H,E;if(G<F){H=(F/2)-(G/2)+C.getDocumentScrollLeft();}else{H=I+C.getDocumentScrollLeft();}if(D<B){E=(B/2)-(D/2)+C.getDocumentScrollTop();}else{E=I+C.getDocumentScrollTop();}C.setXY(A,[parseInt(H,10),parseInt(E,10)]);};perfUI.widgets.panel.prototype.render=function(){var H=perfUI.util.addEl;if(typeof this.container=="string"){this.container=document.getElementById(this.container);}var G=this.getHeaderTemplate();var F=this.getBodyTemplate();var B=this.getFooterTemplate();var E=this.getElement();if(!E){E=H(this.container,"div",{"class":this.elementCss});E.style.display="none";E.style.width=this.width;E.style.height=this.height;this.setElement(E);if(this.getHeader()){E.appendChild(this.getHeader());}else{if(G!=null){var C=H(E,"div",{"class":this.headerCss,"innerHTML":G});this.setHeader(C);}}if(this.getHeader()==null&&this.isDraggable()){var C=H(E,"div",{"class":this.headerCss,"innerHTML":"&nbsp;","style":"background-color:#023F8F;width:100%"});this.setHeader(C);}if(this.isDraggable()){this.dragDrop=new YAHOO.util.DD(this.container);this.dragDrop.setHandleElId(this.getHeader());}if(this.getBody()){E.appendChild(this.getBody());}else{if(F!=null){var A=H(E,"div",{"class":this.bodyCss,"innerHTML":F});this.setBody(A);}}if(this.getFooter()){E.appendChild(this.getFooter());}else{if(B!=null){var D=H(E,"div",{"class":this.footerCss,"innerHTML":B});this.setFooter(D);}}if(this.modal){this.makeModal();}this.afterRenderComplete.fire();}};perfUI.widgets.panel.prototype.hide=function(){var A=this.getMask();if(A){A.hide();}var B=this.getElement();B.style.display="none";try{YAHOO.util.Event.removeListener(window,"resize",this.center);}catch(C){}this.onHideEvent.fire();};perfUI.widgets.panel.prototype.show=function(){if(this.modal){this.center();YAHOO.util.Event.addListener(window,"resize",this.center,this,true);}var A=this.getMask();if(A){A.show();}var B=this.getElement();B.style.display="block";B.style.visibility="inherit";this.onShowEvent.fire();};perfUI.widgets.panelMask=function(){var B=YAHOO.util.Dom;var E=perfUI.util.addEl;var A=null;var D="mask";var C="masked";this.useOpaqueEmbed=true;this.getElement=function(){return A;};this.setOpaqueEmbed=function(G){if(!G){G=document.body;}var H=G.getElementsByTagName("embed");for(var F=0;F<H.length;F++){H[F].setAttribute("wmode","opaque");}var I=G.getElementsByTagName("object");for(var F=0;F<I.length;F++){if(!B.hasClass(I[F],"hide-object-tag")){B.addClass(I[F],"hide-object-tag");}}};this.showObjectTags=function(G){if(!G){G=document.body;}var H=G.getElementsByTagName("object");for(var F=0;F<H.length;F++){B.removeClass(H[F],"hide-object-tag");}};this.hide=function(){A.style.display="none";B.removeClass(document.body,C);this.showObjectTags();};this.show=function(){if(this.useOpaqueEmbed){this.setOpaqueEmbed();}B.addClass(document.body,C);this.size();A.style.display="block";};this.size=function(){A.style.height=B.getDocumentHeight()+"px";A.style.width=B.getDocumentWidth()+"px";A.innerHTML="";this.divToMask(A);};this.stack=function(G){var H=B.getStyle(G,"zIndex");var F=B.getStyle(A,"zIndex");if(YAHOO.lang.isUndefined(H)||isNaN(H)||H<=0){H=999;B.setStyle(G,"zIndex",String(H));}if(YAHOO.lang.isUndefined(F)||isNaN(F)){F=998;B.setStyle(A,"zIndex",String(F));}if(H<F){B.setStyle(G,"zIndex",String(F+1));}else{B.setStyle(A,"zIndex",String(H-1));}};this.destroy=function(){document.body.removeChild(A);};this.init=function(){var F=null;F=document.createElement("div");F.innerHTML="&#160;";A=F.cloneNode(true);this.divToMask(A);A.style.display="none";document.body.insertBefore(A,document.body.firstChild);if(YAHOO.env.ua.gecko&&this.platform=="mac"){B.addClass(A,"block-scrollbars");}YAHOO.util.Event.addListener(window,"resize",this.size,this,true);};this.divToMask=function(K){var J,I,H;var F=document.body.scrollWidth;F=F>2000?2000:F;var G=document.body.scrollHeight;K.style.position="absolute";K.style.top="0";K.style.left="0";if(YAHOO.env.ua.ie==0){K.style.opacity="0.7";K.style.backgroundColor="black";}else{K.style.overflow="hidden";for(I=0;I<F;I+=500){for(H=0;H<G;H+=500){if(YAHOO.env.ua.ie>=7){J=K.appendChild(document.createElement("IMG"));J.src="/images/v3/dov.png";}if(YAHOO.env.ua.ie==6){J=K.appendChild(document.createElement("DIV"));J.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/v3/dov.png',sizingMethod='scale')";}J.style.position="absolute";J.style.top=H+"px";J.style.left=I+"px";J.style.height="500px";J.style.width="500px";}}}};this.init();};perfUI.widgets.modalEditor=function(A,G,D,H){this.editorClass=perfUI.widgets.perfEditor;perfUI.widgets.modalEditor.superclass.constructor.call(this,A,G,D,H);var I=this;var E=perfUI.util.addEl;var C=YAHOO.util.Dom;var F=null;var B=function(){I.buildEditorFooter();I.afterRenderComplete.fire();};this.modal=H==undefined?true:H;this.editorPreviewContainer=null;this.buttonSubmit=null;this.buttonCancel=null;this.buttonPreview=null;this.editorWidth=G;this.editorHeight=D;this.onSubmitContent=new YAHOO.util.CustomEvent("onSubmitContent",this);this.onSubmitError=new YAHOO.util.CustomEvent("onSubmitError",this);this.getEditor=function(){return F;};this.setEditor=function(J){F=J;};this.hideEditor=function(){var J=this.getEditor();if(J!=null){J.setContent("");J.hideAll();}};this.showEditor=function(){var J=this.getEditor();if(J!=null){J.show();}};this.getContent=function(){var J=this.getEditor();if(J){return J.getContent({format:"raw"});}};this.setContent=function(J){var K=this.getEditor();if(K){K.setContent(J,{format:"raw"});}};this.render=function(){var J=this.getEditor();if(J!=null){J.render();}};this.init=function(){if(!C.hasClass(this.container,"postCommentEditor")){C.addClass(this.container,"postCommentEditor");}if(!C.hasClass(document.body,"yui-skin-sam")){C.addClass(document.body,"yui-skin-sam");}this.setBody();this.setFooter();perfUI.widgets.modalEditor.superclass.render.call(this);this.initPerfEditor();};this.initPerfEditor=function(){var M=this.getBody();var L=E(M,"textarea",{"id":"perfEditor_"+(new Date().getTime())});var J=String(this.width).indexOf("px")>0?this.width.substr(0,this.width.indexOf("px")):this.width;if(!this.editorClass){this.editorClass=perfUI.widgets.perfEditor;}var K=new this.editorClass(L.id,null,this.editorWidth,this.editorHeight);this.setEditor(K);K.onInit.add(B);this.editorPreviewContainer=E(M,"div");this.editorPreviewContainer.style.display="none";this.editorPreviewContainer.className="previewPost";};this.init();};YAHOO.extend(perfUI.widgets.modalEditor,perfUI.widgets.panel);perfUI.widgets.modalEditor.prototype.show=function(){perfUI.widgets.modalEditor.superclass.show.call(this);this.showEditor();if(this.modal){this.center();}};perfUI.widgets.modalEditor.prototype.hide=function(){this.hideEditor();perfUI.widgets.modalEditor.superclass.hide.call(this);};perfUI.widgets.modalEditor.prototype.previewContent=function(){var C=this;var B=this.getContent();var E=this.getEditor().getContainer();var F={url:"/api/callna.asp",params:"?function=CustomEncode"};var D=function(H){};var A=function(H){var I=H.responseXML;var M="";try{M=I.getElementsByTagName("response")[0].childNodes[0].nodeValue;}catch(L){}this.editorPreviewContainer.innerHTML=M;if(this.buttonCancel.get&&this.buttonCancel.get("container")&&this.buttonCancel.get("container").style.display=="none"){this.buttonCancel.get("container").style.display="inline";}this.setFooterButtonText(this.buttonCancel,this.getEditButtonText());this.setFooterButtonEvent(this.buttonCancel,"click",null);this.setFooterButtonEvent(this.buttonCancel,"click","cancelPreview");this.buttonPreview.style.display="none";E.style.display="none";var K=E.getElementsByTagName("table")[0];var J=Number(K.style.height.replace("px",""))-12;this.editorPreviewContainer.style.height=J+"px";this.editorPreviewContainer.style.display="block";};var G={success:A,failure:D,scope:C};B="html="+Url.encode(B);YAHOO.util.Connect.asyncRequest("POST",F.url+F.params,G,B);};perfUI.widgets.modalEditor.prototype.setFooterButtonText=function(A,B){switch(A.tagName){case"INPUT":A.value=B;break;case"A":A.innerHTML=B;break;default:if(typeof A=="object"&&A.set){A.set("label",B);}}};perfUI.widgets.modalEditor.prototype.setFooterButtonEvent=function(D,C,A){var B=YAHOO.util.Event;switch(D.tagName){case"INPUT":case"A":if(A){B.addListener(D,"click",this[A],this,true);}else{B.removeListener(D,"click");}break;default:if(typeof D=="object"&&D.set){if(A){D.addListener(C,this[A],null,this,true);}else{D.removeListener(C);}}}};perfUI.widgets.modalEditor.prototype.cancelPreview=function(){this.setFooterButtonText(this.buttonCancel,this.getCancelButtonText());this.setFooterButtonEvent(this.buttonCancel,"click","hide");this.buttonPreview.style.display="inline";this.editorPreviewContainer.style.display="none";var A=this.getEditor().getContainer();A.style.display="block";};perfUI.widgets.modalEditor.prototype.getCancelButtonText=function(){var A=perfTranslator.getValue(701);return A.trim().length>0?A:"Cancel";};perfUI.widgets.modalEditor.prototype.getEditButtonText=function(){var A=perfTranslator.getValue(784);return A.trim().length>0?A:"Edit";};perfUI.widgets.modalEditor.prototype.buildEditorFooter=function(){var I=perfUI.util.addEl;var Q=this;var J=this.getBody();var H=this.getFooter();H.innerHTML="";var O=this.getEditor();var K=O.getContainer();K.style.display="block";var F=this.editorPreviewContainer;F.style.display="none";var M=I(H,"center");var B=perfTranslator.getValue(320);var D=I(M,"span",{"class":"submit"});var C=I(D,"button",{"id":"modalEditor_submit","class":"buttonnew","value":(B.trim().length>0?B:"Submit")});this.buttonSubmit=C;var A=function(){this.cancelPreview();this.submitContent();};YAHOO.util.Event.addListener(C,"click",A,this,true);var L=this.getCancelButtonText();var N=I(M,"span",{"class":"cancel"});var G=I(N,"button",{"id":"modalEditor_cancel","class":"buttonnew","value":L});this.buttonCancel=G;YAHOO.util.Event.addListener(G,"click",this.hide,this,true);var E=perfTranslator.getValue(434);var P=I(M,"a",{"innerHTML":(E.trim().length>0?E:"Preview")});this.buttonPreview=P;PERF.makeLink(P);YAHOO.util.Event.addListener(P,"click",this.previewContent,this,true);};perfUI.widgets.modalEditor.prototype.submitContent=function(){this.onSubmitContent.fire();};perfUI.widgets.modalEditor.prototype.center=function(){var C=YAHOO.util.Dom;var A=this.getEditor().getContainer().getElementsByTagName("table")[0];var G=Number(A.style.width.replace("px","")),D=Number(A.style.height.replace("px",""))+130,I=10,F=C.getViewportWidth(),B=C.getViewportHeight(),H,E;if(G<F){H=(F/2)-(G/2)+C.getDocumentScrollLeft();}else{H=I+C.getDocumentScrollLeft();}var J=C.getDocumentScrollTop()+80;if(D<B&&((D+J)<B)){E=J;}else{E=I+C.getDocumentScrollTop();}C.setXY(this.container,[parseInt(H,10),parseInt(E,10)]);};perfUI.widgets.modalEditor.prototype.showEditorSubmitDialog=function(E){var H=perfUI.util.addEl;var C=YAHOO.util.Event;var G=YAHOO.util.Dom;if(!this.alertDialog){this.renderAlertDialog(E);}var D=perfTranslator.getValue(2625);var A=perfTranslator.getValue(2792);if(E){D=(E.caption&&E.caption.trim().length>0)?E.caption:D;A=(E.body&&E.body.trim().length>0)?E.body:A;}this.alertDialog.caption.innerHTML=D;var F=this.alertDialog.bodyMessage;F.innerHTML="";H(F,"p",{"style":"text-align:center","innerHTML":A});this.alertDialog.buttonSubmit.set("label","ok");this.alertDialog.buttonSubmit.set("onclick",{fn:this.alertDialog.hide,obj:null,scope:this.alertDialog});this.alertDialog.buttonCancel.get("container").style.display="none";var B=new YAHOO.util.Anim(this.alertDialog.getElement(),{opacity:{to:0}},5,YAHOO.util.Easing.easeIn);B.onComplete.subscribe(this.onFadeEditorSubmitDialog,this,true);this.alertDialog.show();this.alertDialog.center();B.animate();};perfUI.widgets.modalEditor.prototype.renderAlertDialog=function(H){var D=perfUI.util.addEl;var L=YAHOO.util.Event;var C=YAHOO.util.Dom;var A=this.container;if(H&&H.container){A=H.container;}var J=D(A,"div",{"class":"denybox"});this.alertDialog=new perfUI.widgets.panel(J,"345px");this.alertDialog.setHeader();this.alertDialog.setBody();this.alertDialog.render();C.setStyle(this.alertDialog.container,"zIndex","2000");C.setStyle(this.alertDialog.getMask().getElement(),"zIndex","1000");var M=function(){if(this.getMask()&&this.getMask().getElement()){this.getMask().getElement().style.display="none";}};this.alertDialog.onHideEvent.subscribe(this.onHideAlertDialog,this,true);this.alertDialog.onShowEvent.subscribe(M,this,true);var E=this.alertDialog.getHeader();C.addClass(E,"bgblue3");D(E,"div",{"class":"icon_deny left"});this.alertDialog.caption=D(E,"div",{"class":"txtdkblue left"});var I=D(E,"div",{"class":"txtdkblue right close","innerHTML":"x"});L.addListener(I,"click",this.alertDialog.hide,this.alertDialog,true);var G=this.alertDialog.getBody();this.alertDialog.bodyMessage=D(G,"div");var B=D(G,"center",{"class":"buttonbox clear"});var K=D(B,"span",{"class":"submit"});this.alertDialog.buttonSubmit=new YAHOO.widget.Button({container:K});var F=D(B,"span",{"class":"cancel"});this.alertDialog.buttonCancel=new YAHOO.widget.Button({label:perfTranslator.getValue(701),onclick:{fn:this.alertDialog.hide,obj:null,scope:this.alertDialog},container:F});};perfUI.widgets.modalEditor.prototype.onHideAlertDialog=function(){var C=YAHOO.util.Dom;if(this.getElement().style.display=="block"){if(this.modal){var A=this.getMask();if(A){var B=A.getElement();if(B.style.display=="none"){B.style.display="block";}}}}var D=this.alertDialog.getElement();var E=C.getStyle(D,"opacity");if(E!=1){C.setStyle(D,"opacity",1);}};perfUI.widgets.modalEditor.prototype.onFadeEditorSubmitDialog=function(B,A){this.alertDialog.hide();};perfUI.content.userContentType={Album:0,Picture:1,Video:2,User:3,Blog:4};perfUI.content.userContentTag=function(B,C,A){this.tagId=C||0;this.tagName=A||"";this.dataSource=B||null;this.init=function(){if(!this.dataSource){return;}this.tagId=PERF.parseNodeNumeric(this.dataSource,"tagId");this.tagName=PERF.parseNode(this.dataSource,"tagName");};this.init();};perfUI.content.userContent=function(B,C){var A=this;this.UserId=B;this.DataSource=C||null;this.Container=null;this.AlbumId=0;this.Subject="";this.Description="";this.AccessId=0;this.AccessDescr="";this.DateCreated="";this.DateModified="";this.IsOwner=false;this.CategoryId=0;this.CategoryDescr="";this.ThumbUrl="";this.ThumbLinkUrl="";this.AllowComments=0;this.AllowCommentsDescr="";this.Comments=[];this.Tags=[];this.TotalComments=0;this.TotalCommentsNew=0;this.TotalFavored=0;this.IsFavorite=false;this.PercentApproval=0;this.PerfCount=0;this.AllowApproval=0;this.AllowApprovalDescr="";this.TotalViews=0;this.TotalViewCurrent=0;this.SubmittedBy="";this.SubmittedByGUID="";this.DateSubmitted="";this.DateDiffSubmitted="";this.getTagsLinks=function(G){var F="";for(var E=0;E<this.Tags.length;E++){var D=this.Tags[E];perfUI.util.addEl(G,"a",{"href":this.getTagUrl(D),"text":D.tagName+" "});}};this.getTagsString=function(){var E="";for(var D=0;D<this.Tags.length;D++){E+=(this.Tags[D].tagName+" ");}return E.trim();};this.loadTags=function(G){G=G||this.DataSource;if(!G){return;}var H=G.getElementsByTagName("tags");if(H.length>0){H=H[0].getElementsByTagName("tag");if(H.length==0){var D=new perfUI.content.userContentTag(null,0,PERF.parseNode(G,"tags"));this.Tags.push(D);return;}for(var F=0;F<H.length;F++){var E=H[F];var D=new perfUI.content.userContentTag(E);this.Tags.push(D);}}};this.loadComments=function(F){if(!perfUI.content.userComment){return;}F=F||this.DataSource;if(!F){return;}var H=F.getElementsByTagName("comment");if(H.length>0){for(var E=0;E<H.length;E++){var D=H[E];var G=new perfUI.content.userComment(D);G.ContentTypeId=this.getContentId();this.Comments.push(G);}}};this.loadRating=function(D){this.AllowApproval=PERF.parseNodeNumeric(D,"allowApproval");this.AllowApprovalDescr=PERF.parseNode(D,"allowApprovalReason");this.PercentApproval=PERF.parseNode(D,"approvalPercent");this.PerfsCount=PERF.parseNode(D,"perfs");};this.loadIsFavorite=function(D){this.IsFavorite=PERF.parseNodeBool(D,"myFavorite");};this.loadFavoredBy=function(D){this.TotalFavored=PERF.parseNodeNumeric(D,"favoredBy");};};perfUI.content.userContent.prototype.loadProperties=function(A){A=A||this.DataSource;if(A==null||A==undefined){return;}this.DataSource=A;this.AlbumId=PERF.parseNodeNumeric(A,"albumId");this.ThumbUrl=PERF.parseNode(A,"thumbUrl");this.ThumbLinkUrl=PERF.parseNode(A,"link");this.Subject=PERF.parseNode(A,"subject");this.Description=PERF.parseNode(A,"description");this.AccessId=PERF.parseNodeNumeric(A,"access");this.AccessDescr=PERF.parseNode(A,"accessName");this.DateCreated=PERF.parseNode(A,"dateCreated");this.DateModified=PERF.parseNode(A,"dateLastUpdated");this.TotalComments=PERF.parseNodeNumeric(A,"totalComments");this.TotalCommentsNew=PERF.parseNodeNumeric(A,"newComments");this.IsOwner=PERF.parseNodeBool(A,"isOwner");this.CategoryId=PERF.parseNodeNumeric(A,"categoryId");this.CategoryDescr=PERF.parseNode(A,"categoryName");this.loadRating(A);this.TotalViews=PERF.parseNodeNumeric(A,"views");this.TotalViewsCurrent=PERF.parseNodeNumeric(A,"viewsToday");this.SubmittedBy=PERF.parseNode(A,"submitterName");this.SubmittedByGUID=PERF.parseNode(A,"submitterId");this.DateSubmitted=PERF.parseNode(A,"dateSubmitted");this.DateDiffSubmitted=PERF.parseNode(A,"dateSubmitted2");this.loadFavoredBy(A);this.loadIsFavorite(A);this.loadTags(A);this.AllowComments=PERF.parseNodeNumeric(A,"allowComments");this.AllowCommentsDescr=PERF.parseNode(A,"allowCommentsReason");this.loadComments(this.DataSource.getElementsByTagName("comments")[0]);};perfUI.content.userContent.prototype.buildSocialBookmark=function(C,H,B){var F=perfUI.util.addEl;var E=this;H=H||"Perfspot.com - "+E.Subject;B=B||E.getViewDetailsUrl();var I=F(C,"a",{"href":"http://www.addthis.com/bookmark.php"});var D=function(){addthis_url=B;addthis_title=H;return addthis_open(this,"",B,H);};var A=function(){return addthis_close();};var G=function(){return addthis_sendto();};YAHOO.util.Event.addListener(I,"click",G);YAHOO.util.Event.addListener(I,"mouseover",D);YAHOO.util.Event.addListener(I,"mouseout",A);var J=addNode(I,"img");J.src="http://s9.addthis.com/button1-bm.gif";J.alt="AddThis Social Bookmark Button";J.style.width="125px";J.style.height="16px";J.style.border="0";return J;};perfUI.content.user=function(B,C){var A=this;this.userId=B;this.userGUID="";this.isPerson=false;this.dataSource=C;this.displayName="";this.status="";this.thumbUrl="";this.pictureUrl="";this.gender="";this.age=0;this.online=false;this.dateLastLogin="";this.location1="";this.location2="";this.location3="";this.mutualFriendsCount=0;this.AllowComments=0;this.AllowCommentsDescr="";this.Comments=[];this.getContentType=function(){return perfUI.content.userContentType.User;};this.getContentId=function(){return this.userId;};this.attachToolTip=function(E){var D=perfUI.widgets.ToolTip;if(!D){return;}var G=new Image();G.src=this.thumbUrl;var F='<div class="tooltip"><img src="'+G.src+'" border=0></div>';var H=new D(E,F);};this.getMutualFriendsUrl=function(){return"http://www.perfspot.com/mutualfriends.asp?id="+this.userGUID;};this.getAllFriendsUrl=function(){return"http://www.perfspot.com/allfriends.asp?id="+this.userGUID;};this.getSuggestFriendsUrl=function(){return"http://www.perfspot.com/suggest.asp?id="+this.userGUID;};this.getSendMessageUrl=function(){return"http://www.perfspot.com/messagepost.asp?id="+this.userGUID;};this.getProfileUrl=function(){return"http://www.perfspot.com/profile.asp?uid="+this.userGUID;};this.getPostMessageUrl=function(){return"http://www.perfspot.com/profile.asp?uid="+this.userGUID+"&post=1";};this.getGiveGiftUrl=function(){return"http://www.perfspot.com/gifts/give.asp?id="+this.userId;};this.loadComments=function(F){if(!perfUI.content.userComment){return;}F=F||this.dataSource;if(F==null||F==undefined){return;}var H=F.getElementsByTagName("comment");if(H.length>0){for(var E=0;E<H.length;E++){var D=H[E];var G=new perfUI.content.userComment(D);G.ContentTypeId=G.user.userId;this.Comments.push(G);}}};this.initUser=function(){if(this.dataSource!=null){this.loadProperties();}};this.initUser();};perfUI.content.user.prototype.loadProperties=function(B){B=B||this.dataSource;if(B==null||B==undefined){return;}this.dataSource=B;var A=PERF.parseNodeNumeric(B,"userId");this.userId=A>0?A:this.userId;this.displayName=PERF.parseNode(B,"displayName");this.status=PERF.parseNode(B,"status");this.thumbUrl=PERF.parseNode(B,"thumbUrl");if(this.thumbUrl.trim().length==0){this.thumbUrl=PERF.parseNode(B,"thumbnailUrl");}this.pictureUrl=PERF.parseNode(B,"pictureUrl");this.gender=PERF.parseNode(B,"gender");this.age=PERF.parseNodeNumeric(B,"age");this.online=PERF.parseNodeBool(B,"online");this.dateLastLogin=PERF.parseNode(B,"lastlogin");this.location1=PERF.parseNode(B,"location1");this.location2=PERF.parseNode(B,"location2");this.location3=PERF.parseNode(B,"location3");this.userGUID=PERF.parseNode(B,"userCode");this.isPerson=PERF.parseNodeBool(B,"person");this.AllowComments=PERF.parseNodeNumeric(B,"allowComments");this.AllowCommentsDescr=PERF.parseNode(B,"allowCommentsReason");this.mutualFriendsCount=PERF.parseNodeNumeric(B,"mutualFriends");this.loadComments();};function PagerSimple(A,B){var D=this;var C=perfUI.util.addEl;this.pagerContainer=null;this.pagerDescrContainer=null;this.headerContainer=null;this.pagesContainer=null;this.footerContainer=null;this.Container=A||null;this.CurrentPage=1;this.TotalRecords=0;this.PageSize=1;this.Step=1;this.PagerCss="";this.DataSourceDescription="";this.DataSource=B||null;this.NoRecordDescription="There are 0 "+this.DataSourceDescription;this.Page=function(E,G,F){this.DataSource=E||null;this.DataFrom=G||0;this.DataTo=F||0;};this.Pages=[];this.AlwaysShow=false;this.AlwaysCycle=false;this.ShowDescription=false;this.onPageLoad=new YAHOO.util.CustomEvent("onPageLoad",this);this.ParseXmlProperties=function(E){if(!E){return;}var F=E.getElementsByTagName("paging")[0];if(F==null){return;}this.PageSize=PERF.parseNodeNumeric(F,"pageSize");this.CurrentPage=PERF.parseNodeNumeric(F,"pageNumber");this.TotalRecords=PERF.parseNodeNumeric(F,"totalRecords");};this.pageDisableCss="pageDisable";this.pageHoverCss="pageHover";this.pageCss="page";this.addPageRollOver=function(E){YAHOO.util.Event.addListener(E,"mouseover",this.pageHoverOn);YAHOO.util.Event.addListener(E,"mouseout",this.pageHoverOff);};this.pageHoverOff=function(E){this.className=this.className.replace(D.pageHoverCss,"");};this.pageHoverOn=function(E){if(this.className.indexOf("selectedPage")<0&&this.className.indexOf(D.pageDisableCss)<0){this.className+=" "+D.pageHoverCss;}};this.buildTotalsDescription=function(){if(this.DataSourceDescription.trim().length>0){var E=addNode(this.pagercontainer,"span","","totals");addNode(E,"strong","","",String(this.TotalRecords));addNode(E,"label","","","&nbsp;"+this.DataSourceDescription);}};this.buildPagerFiringObjectsBase=function(){this.Container.innerHTML="";this.pagercontainer=C(this.Container,"ul",{"class":"pager"});if(this.Pages.length>1||this.AlwaysShow){this.headerContainer=C(this.pagercontainer,"li");this.pagesContainer=C(this.pagercontainer,"li");this.footerContainer=addNode(this.pagercontainer,"li");}};this.buildPagerFiringObjects=function(){var F="Previous";var H=perfTranslator.getValue(1784);if(H.trim().length>0){F=H;}this.buildPagerFiringObjectsBase();if(this.Pages.length>1||this.AlwaysShow){var G=addNode(this.headerContainer,"div");var F="Previous";var H=perfTranslator.getValue(1784);if(H.trim().length>0){F=H;}this.buildGoToPreviousPage(G,F);var F="Next";var H=perfTranslator.getValue(1783);if(H.trim().length>0){F=H;}var E=this.buildGoToNextPage(F);this.buildGoToLastPage(E);}};this.buildPagerPages=function(J){if(J!=null){this.DataSource=J;}this.TotalRecords=(this.TotalRecords<=0&&this.DataSource!=null)?this.DataSource.length:this.TotalRecords;var I=this.TotalRecords;if(this.DataSource==null&&I<=0){return;}var G=1;var E=0;var L=0;for(var F=0;F<I;){G=this.Pages.length>0?(this.Pages[this.Pages.length-1].DataTo+1):1;L=G+(this.PageSize-1);E=L<I?L:I;var H=this.DataSource!=null?this.DataSource.slice(F,E):[];var K=new this.Page(H,G,E);this.Pages.push(K);F=E;}};this.buildGoToFirstPage=function(){};this.buildGoToLastPage=function(E){};this.buildPageLinks=function(E){if(E==undefined){E=false;}if(this.pagesContainer!=null){if(this.CurrentPage>this.Pages.length){this.CurrentPage=this.Pages.length;}this.pagesContainer.innerHTML="";var F=addNode(this.pagesContainer,"strong","","",String(this.CurrentPage)+" of "+this.Pages.length);}if(!E){this.onPageLoad.fire(this);}};this.loadPreviousPage=function(E){D.loadPage(E,D.CurrentPage-1);};this.loadNextPage=function(E){D.loadPage(E,D.CurrentPage+1);};this.loadPage=function(G,E){var F=Number(E);if(F==D.CurrentPage){return;}if(D.AlwaysCycle){if(F<=0){D.CurrentPage=D.Pages.length;}else{if(F>D.Pages.length){D.CurrentPage=1;}else{D.CurrentPage=Number(E);}}}else{if(F<=0||F>D.Pages.length){return;}else{D.CurrentPage=Number(E);}}D.buildPageLinks();};}PagerSimple.prototype.Render=function(C,B,A){this.Container.innerHTML="";this.Pages=[];if(C){this.TotalRecords=C.length;}else{this.TotalRecords=B||this.TotalRecords;}this.buildPagerPages(C);this.buildPagerFiringObjects();this.buildTotalsDescription();this.buildPageLinks(A);};PagerSimple.prototype.buildGoToPreviousPage=function(B,C){var F="Go to Previous Page";var A=perfTranslator.getValue(1785);if(A.trim().length>0){F=A;}var E=addNode(B,"div","","pagePrevious");E.title=F;YAHOO.util.Event.addListener(E,"click",this.loadPreviousPage);if(C!=undefined){var D=addNode(B,"a","","pagePrevious",C);D.title=F;PERF.makeLink(D);YAHOO.util.Event.addListener(D,"click",this.loadPreviousPage);}};PagerSimple.prototype.buildGoToNextPage=function(C){var F="Go to Next Page";var B=perfTranslator.getValue(1786);if(B.trim().length>0){F=B;}var A=addNode(this.footerContainer,"div");if(C!=undefined){var E=addNode(A,"a","","pageNext",C);var F=F;var B=perfTranslator.getValue(1786);if(B.trim().length>0){F=B;}E.title=F;PERF.makeLink(E);YAHOO.util.Event.addListener(E,"click",this.loadNextPage);}var D=addNode(A,"div","","pageNext");D.title=F;YAHOO.util.Event.addListener(D,"click",this.loadNextPage);return A;};function PagerControl(B,C,A,D){var E=this;PagerControl.superclass.constructor.call(this,A,D);this.PageSize=B;this.Step=C;this.Render=function(H,G,F){if(this.Container.className.indexOf("pagerAdvanced")<0){this.Container.className+=" pagerAdvanced";}PagerControl.superclass.Render.call(this,H,G,F);};this.buildPagerFiringObjects=function(){this.buildPagerFiringObjectsBase();if(this.Pages.length>1||this.AlwaysShow){var F=addNode(this.headerContainer,"div","","left");this.buildGoToPreviousPage(F);var G=this.buildGoToNextPage();this.buildGoToLastPage(G);}};this.buildGoToFirstPage=function(){var F=addNode(this.headerContainer,"div");var G=addNode(F,"a","","left","First");G.title="Go to First Page";PERF.makeLink(G);YAHOO.util.Event.addListener(G,"click",this.loadPage,1);return F;};this.buildGoToLastPage=function(F){var G=addNode(F,"a","","","Last");G.title="Go to Last Page";PERF.makeLink(G);YAHOO.util.Event.addListener(G,"click",this.loadPage,this.Pages.length);};this.buildGoToNextPage=function(){return PagerControl.superclass.buildGoToNextPage.call(this);};this.buildPageLinks=function(F){if(F==undefined){F=false;}if(this.pagesContainer!=null){if(this.CurrentPage>this.Pages.length){this.CurrentPage=this.Pages.length;}this.pagesContainer.innerHTML="";var H=Math.floor((this.CurrentPage/this.Step))*this.Step;if((this.CurrentPage%this.Step)==0){H-=this.Step;}for(var J=H+1;J<=this.Pages.length&&J<=(H+this.Step);J++){var G=J==this.CurrentPage?"selectedPage":"";var I=addNode(this.pagesContainer,"a","",G,String(J));PERF.makeLink(I);YAHOO.util.Event.addListener(I,"click",this.loadPage,J);}}if(!F){this.onPageLoad.fire(this);}};}YAHOO.extend(PagerControl,PagerSimple);function CommentsPagerControl(B,A){var C=this;CommentsPagerControl.superclass.constructor.call(this,A,null);this.DataSourceDescription="discussions";this.buildTotalsDescription=function(){};this.buildPageLinks=function(F){if(F==undefined){F=false;}if(this.pagesContainer!=null){if(this.CurrentPage>this.Pages.length){this.CurrentPage=this.Pages.length;}this.pagesContainer.innerHTML="";var E=perfTranslator.getValue(765);var D="";if(E.trim().length>0){D=new String(perfTranslator.parseValue(E,[String(this.Pages[this.CurrentPage-1].DataFrom),String(this.Pages[this.CurrentPage-1].DataTo),String(this.TotalRecords)]));}else{D="Showing "+String(this.Pages[this.CurrentPage-1].DataFrom)+" - "+String(this.Pages[this.CurrentPage-1].DataTo)+' of <span class="peachDarkText">'+String(this.TotalRecords)+" "+this.DataSourceDescription+"</span>";}var G=addNode(this.pagesContainer,"strong","","",D);this.pagercontainer.style.width="auto";}if(!F){this.onPageLoad.fire(this);}};}YAHOO.extend(CommentsPagerControl,PagerSimple);function MediaPagerControl(B,C,A,D){var E=this;MediaPagerControl.superclass.constructor.call(this,A,D);this.PageSize=B;this.Step=C;this.Render=function(H,G,F){if(this.Container.className.indexOf("pagerMedia")<0){this.Container.className+=" pagerMedia";}MediaPagerControl.superclass.Render.call(this,H,G,F);};this.containerPrevious=null;this.containerNext=null;this.buildPagerFiringObjects=function(){this.buildPagerFiringObjectsBase();if(this.Pages.length>1||this.AlwaysShow){var G="Previous";var H=perfTranslator.getValue(1784);if(H.trim().length>0){G=H;}this.buildGoToPreviousPage(this.headerContainer,G);this.pagesContainer=addNode(this.pagesContainer,"span");var G="Next";var H=perfTranslator.getValue(1783);if(H.trim().length>0){G=H;}var F=this.buildGoToNextPage(G);}};this.buildGoToPreviousPage=function(G,H){var I="Go to Previous Page";var F=perfTranslator.getValue(1785);if(F.trim().length>0){I=F;}this.containerPrevious=addNode(G,"span","",this.pageCss,"&lt;&nbsp;"+(H?H:""));this.containerPrevious.title=I;YAHOO.util.Event.addListener(this.containerPrevious,"click",this.loadPreviousPage);this.addPageRollOver(this.containerPrevious);};this.buildGoToNextPage=function(G){var H="Go to Next Page";var F=perfTranslator.getValue(1786);if(F.trim().length>0){H=F;}this.containerNext=addNode(this.footerContainer,"span","",this.pageCss,(G?G:"")+"&nbsp;&gt;");this.containerNext.title=H;YAHOO.util.Event.addListener(this.containerNext,"click",this.loadNextPage);this.addPageRollOver(this.containerNext);};this.buildPage=function(F){var G=this.pageCss;G+=F==this.CurrentPage?" selectedPage":"";var H=addNode(this.pagesContainer,"span","",G,String(F));YAHOO.util.Event.addListener(H,"click",this.loadPage,F);this.addPageRollOver(H);};this.buildTotalsDescription=function(){if(this.ShowDescription){var G="pagerDescription";if(this.pagerDescrContainer!=null){this.pagerDescrContainer.innerHTML="";if(!YAHOO.util.Dom.hasClass(this.pagerDescrContainer,G)){YAHOO.util.Dom.addClass(this.pagerDescrContainer,G);}}else{this.pagerDescrContainer=addNode(this.pagercontainer,"div","",G);}var H="";if(this.Pages.length>0){var F=perfTranslator.getValue(765);if(F.trim().length>0){H=new String(perfTranslator.parseValue(F,[String(this.Pages[this.CurrentPage-1].DataFrom),String(this.Pages[this.CurrentPage-1].DataTo),String(this.TotalRecords)]));}else{H=new String("Displaying&nbsp;<strong>"+this.Pages[this.CurrentPage-1].DataFrom)+"-"+String(this.Pages[this.CurrentPage-1].DataTo)+"</strong>&nbsp;of&nbsp;"+String(this.TotalRecords)+"&nbsp;"+this.DataSourceDescription;}}else{H=this.NoRecordDescription;}this.pagerDescrContainer.innerHTML=H;}};this.buildPageLinks=function(F){if(F==undefined){F=false;}if(this.pagesContainer!=null){if(this.CurrentPage>this.Pages.length){this.CurrentPage=this.Pages.length;}this.pagesContainer.innerHTML="";var H=Math.floor((this.CurrentPage/this.Step))*this.Step;if((this.CurrentPage%this.Step)==0){H-=this.Step;}var G=H+this.Step;if(this.Pages.length<G){G=this.Pages.length;}this.buildPage(1);if(this.CurrentPage>this.Step){addNode(this.pagesContainer,"span","","ellipse","...");}for(var I=H+1;I<=G;I++){if(I>1){this.buildPage(I);if(I==G&&I<this.Pages.length){addNode(this.pagesContainer,"span","","ellipse","...");this.buildPage(this.Pages.length);}}}if(this.CurrentPage==1){this.containerPrevious.className+=" "+this.pageDisableCss;}else{this.containerPrevious.className=this.containerPrevious.className.replace(this.pageDisableCss,"");}if(this.CurrentPage==this.Pages.length){this.containerNext.className+=" "+this.pageDisableCss;}else{this.containerNext.className=this.containerNext.className.replace(this.pageDisableCss,"");}}if(!F){this.onPageLoad.fire(this);}};}YAHOO.extend(MediaPagerControl,PagerSimple);perfUI.content.userComment=function(B){var A=this;this.DataSource=B;this.CommentId=0;this.user=null;this.DateCreated="";this.Body="";this.TotalReplies=0;this.LanguageId=0;this.ParentId=0;this.ContentType=null;this.ContentTypeId=0;this.AllowDelete=0;this.AllowReportAbuse=0;this.AllowReplyMessage=0;this.AllowReplyComment=1;this.loadProperties=function(D){D=D||this.DataSource;if(D==null||D==undefined){return;}this.DataSource=D;this.DateCreated=PERF.parseNode(D,"date");this.Body=PERF.parseNode(D,"message");this.CommentId=PERF.parseNode(D,"commentId");this.UserId=PERF.parseNodeNumeric(D,"userId");this.TotalReplies=PERF.parseNodeNumeric(D,"replies");this.LanguageId=PERF.parseNodeNumeric(D,"languageId");this.ParentId=PERF.parseNodeNumeric(D,"parentId");this.UserGUID=PERF.parseNode(D,"userCode");this.AllowDelete=PERF.parseNodeNumeric(D,"allowDelete");this.AllowReportAbuse=PERF.parseNodeNumeric(D,"allowAbuse");var C=D.getElementsByTagName("allowReply");if(C!=null&&C.length==1){this.AllowReplyComment=PERF.parseNodeNumeric(D,"allowReply");}this.AllowReplyMessage=PERF.parseNodeNumeric(D,"allowMessage");this.user=new perfUI.content.user(0,D);};this.init=function(){if(this.DataSource!=null){this.loadProperties();}};this.init();};perfUI.widgets.userCommentsWidget=function(B,C,A,E){scopeWidget=this;var D=perfUI.util.addEl;this.UserId=B||0;this.ContentType=C||0;this.ContentObject=null;this.Container=A||null;this.CurrentLanguageId=0;this.Caption=perfTranslator.getValue(285).trim().length==0?"Comments":perfTranslator.getValue(285);this.Languages=null;this.Tree=null;this.LoginRedirectUrl="";this.AllowComments=0;this.languageFilter=null;this.commentEditor=null;this.commentEditorPanelContainer=A||null;this.commentEditorPanel=null;this.commentEditorPreviewContainer=null;this.headerContainer=null;this.totalCommentsLabel=null;this.commentEditorSubmitMethod=E||null;this.afterRenderComplete=new YAHOO.util.CustomEvent("afterRenderComplete",this);this.treeObject=!this.treeObject?perfUI.widgets.userCommentsWidgetCommentTree:this.treeObject;this.reportAbuseWidget=null;this.loadNodeComments=function(J){J.children=new Array();for(var H=0;H<this.ContentObject.Comments.length;H++){var M=this.ContentObject.Comments[H];var G=new this.Tree.nodeObject(M,J);var F=function(P,N){var P=N[0].event;var O=N[0].node;scopeWidget.showReportAbuseWidget(P,O);};G.onReportAbuse.subscribe(F);if(M.TotalReplies>0){var L=new perfUI.widgets.userCommentsWidgetCommentReplyNode(G,false);}}if(J.pagers==undefined){J.pager.ParseXmlProperties(this.ContentObject.DataSource);}else{for(var H=0;H<J.pagers.length;H++){var I=J.pagers[H];var K=this.ContentObject.DataSource?this.ContentObject.DataSource:this.ContentObject.dataSource;I.ParseXmlProperties(K);}}J.loadComplete();};this.loadLanguageFilter=function(){if(!this.Languages){return;}var G=this.headerContainer;this.languageFilter=addNode(G,"select","","textbox right");var L=this.Languages.getElementsByTagName("language");for(var N=0;N<L.length;N++){var J=L[N];var H=J.getElementsByTagName("id")[0].childNodes[0].nodeValue;var F=J.getElementsByTagName("name")[0].childNodes[0].nodeValue;var I=addNode(this.languageFilter,"option");I.innerHTML=F;I.value=H;}this.languageFilter.value=this.CurrentLanguageId;var K=perfTranslator.getValue(2490);addNode(G,"label","","right",(K.trim().length>0?K:"Select Language")+":");var M=function(O){this.CurrentLanguageId=Number(this.languageFilter.value);this.loadRootComments();};YAHOO.util.Event.addListener(this.languageFilter,"change",M,this,true);};this.getCommentEditorBodyContainer=function(){return this.commentEditor.get("textarea");};this.getCommentEditorBodyHtml=function(){return this.commentEditor.getContent();};this.buildCommentEditorFooter=function(L,J){var O="toggleSelected";var S=this.commentEditor;var N=this.commentEditorPanel.getFooter();N.innerHTML="";var P=S.getContainer();P.style.display="block";var K=this.commentEditorPreviewContainer;K.style.display="none";var R=addNode(N,"center");var F=perfTranslator.getValue(808);var G=addNode(R,"button","","buttonnew",F.trim().length>0?F:"Post Comment");YAHOO.util.Event.addListener(G,"click",L,J);var Q=perfTranslator.getValue(701);var M=addNode(R,"button","","buttonnew",Q.trim().length>0?Q:"Cancel");YAHOO.util.Event.addListener(M,"click",this.HideCommentEditor,this,true);var H=perfTranslator.getValue(809);var U=addNode(R,"a","","",H.trim().length>0?H:"Preview Comment");PERF.makeLink(U);var T=function(){var W=scopeWidget.getCommentEditorBodyHtml();var Y={url:"/api/callna.asp",params:"?function=CustomEncode"};var X=function(a){};var V=function(a){var b=a.responseXML;var f="";try{f=b.getElementsByTagName("response")[0].childNodes[0].nodeValue;}catch(d){}K.innerHTML=f;var c=perfTranslator.getValue(784);M.value=c.trim().length>0?c:"Edit";YAHOO.util.Event.removeListener(M,"click");YAHOO.util.Event.addListener(M,"click",I);U.style.display="none";P.style.display="none";K.style.display="block";};var Z={success:V,failure:X,scope:scopeWidget};W="html="+Url.encode(W);YAHOO.util.Connect.asyncRequest("POST",Y.url+Y.params,Z,W);};var I=function(){M.value=Q.trim().length>0?Q:"Cancel";YAHOO.util.Event.addListener(M,"click",scopeWidget.HideCommentEditor,scopeWidget,true);U.style.display="inline";K.style.display="none";P.style.display="block";};YAHOO.util.Event.addListener(U,"click",T,this,true);};this.buildCommentEditorPanel=function(H){this.commentEditorPanelContainer=addNode(this.commentEditorPanelContainer,"div","","postCommentEditor");this.commentEditorPanel=new perfUI.widgets.panel(this.commentEditorPanelContainer,"540px");this.commentEditorPanel.setBody();this.commentEditorPanel.setFooter();this.commentEditorPanel.render();var K=this.commentEditorPanel.getBody();this.commentEditorPanel.activityIndicator=D(K,"div",{"class":"activityIndicatorLoadModule","innerHTML":"<p>"+perfTranslator.getValue(1864).toLowerCase()+"...</p>"});this.commentEditorPanel.show();this.commentEditorPanel.center();if(!perfUI.widgets.perfEditor){var G=this;var J="";perfUI.util.insertClientScript('var tinyMCE_GZ = {loaded:true}; var tinyMCEPreInit = {suffix:"",base : "'+J+'/includes/js/tinymce/jscripts/tiny_mce"};');var I=function(){tinymce.dom.Event._pageInit();var L=function(){G.buildCommentEditor(H);};var M=perfUI.util.loadClientResource("/includes/js/perfUI/build/perfEditor.js","js",{"fn":L,"obj":G,"scope":true});};var F=perfUI.util.loadClientResource("/includes/js/tinymce/jscripts/tiny_mce/tiny_mce.js","js",{"fn":I,"obj":this,"scope":true});}};this.buildCommentEditor=function(F){if(this.commentEditor){return;}if(document.body.className.indexOf("yui-skin-sam")<0){document.body.className+=" yui-skin-sam";}var H=this.commentEditorPanel.getBody();var G=D(H,"textarea",{"id":"postCommentEditor"+this.UserId,"style":"display:none"});this.commentEditor=new perfUI.widgets.perfEditor(G.id);this.commentEditor.onPostRender.add(F);this.commentEditorPreviewContainer=addNode(H,"div");this.commentEditorPreviewContainer.style.display="none";this.commentEditorPreviewContainer.className="previewPost";this.commentEditor.render();};this.onSuccessDeleteComment=function(F){var G=F.responseXML;var H=this.Tree.hasErrors(F);if(!H){this.loadResponseContentObject(G);this.Render();this.HideCommentEditor();}};this.onSuccessAddNewComment=function(I,G,M,K){M=M||null;var H=G.responseXML;var J=this.Tree.hasErrors(G);if(!J){var L=this.Tree.getResponseResult(G,this.addCommentsParam);if(L.trim().length>0){alert(L);}if(K){this.loadResponseContentObject(H);if(M!=null){this.buildHeaderContents();var F=null;if(M.children.length>0){M.removeChildren();}M.appendCommentReplyBoxContainer();F=new perfUI.widgets.userCommentsWidgetCommentReplyNode(M,true);F.comment.TotalReplies=this.ContentObject.Comments.length;M.renderChildren();this.loadNodeComments(F);}else{this.Render();}}this.HideCommentEditor();}I.value="Post Comment";I.disabled=false;};this.attachShowCommentEditorEvent=function(F){scopeWidget.ShowCommentEditor(F);};this.getContentIdParam=function(){return this.ContentObject.getContentId();};};perfUI.widgets.userCommentsWidget.prototype.showReportAbuseWidget=function(B,A){this.reportAbuseWidget.buttonSubmit.set("onclick",{fn:this.reportAbuseWidget.send,obj:{"userId":A.comment.user.userId,"section":"3","optional":A.comment.CommentId},scope:this.reportAbuseWidget});this.reportAbuseWidget.show(B,"tr");};perfUI.widgets.userCommentsWidget.prototype.ShowCommentEditor=function(B){switch(this.AllowComments){case 0:location.href=this.LoginRedirectUrl;return;case 1:break;case 2:if(this.ContentObject.AllowCommentsDescr.trim().length>0){alert(this.ContentObject.AllowCommentsDescr);}else{var C=perfTranslator.getValue(2492);alert(C.trim().length==0?"You do not have the necessary permission to post comments.":C);}return;}var A=function(){scopeWidget.buildCommentEditorFooter(scopeWidget.commentEditorSubmitMethod,B);scopeWidget.commentEditorPanel.show();if(scopeWidget.commentEditorPanel.activityIndicator){scopeWidget.commentEditorPanel.activityIndicator.style.display="none";}scopeWidget.commentEditor.show();scopeWidget.commentEditorPanel.center();scopeWidget.commentEditor.focus();};if(this.commentEditorPanel==null){this.buildCommentEditorPanel(A);}else{A();}};perfUI.widgets.userCommentsWidget.prototype.HideCommentEditor=function(){if(this.commentEditor!=null){this.commentEditor.setContent("");this.commentEditor.hideAll();}if(this.commentEditorPanel!=null){this.commentEditorPanel.hide();}};perfUI.widgets.userCommentsWidget.prototype.LoadLanguagesXml=function(A){var C=null;if(typeof(A)=="string"){if(YAHOO.env.ua.ie>0){C=new ActiveXObject("Microsoft.XMLDOM");}else{if(document.implementation&&document.implementation.createDocument){C=document.implementation.createDocument("","",null);if(DOMParser){Document.prototype.loadXML=function(H){var F=new DOMParser();var D=F.parseFromString(H,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild);}for(var E=0;E<D.childNodes.length;E++){var G=this.importNode(D.childNodes[E],true);this.appendChild(G);}};}}}C.loadXML(A);}else{var B=A.getElementsByTagName("languages");if(B!=null&&B.length==1){C=B[0];}}this.Languages=C;};perfUI.widgets.userCommentsWidget.prototype.buildHeaderContents=function(A){this.headerContainer.innerHTML="";var F=addNode(this.headerContainer,"div","","left");addNode(F,"strong","","left peachDarkText",this.Caption);var C=addNode(F,"div","","left");addNode(C,"div","","postComment");var E=perfTranslator.getValue(808);var B=addNode(C,"a","","left",E.trim().length>0?E:"Post Comment");PERF.makeLink(B);var D=function(){scopeWidget.ShowCommentEditor();};YAHOO.util.Event.addListener(C,"click",D);this.loadLanguageFilter();};perfUI.widgets.userCommentsWidget.prototype.renderTree=function(C,F,D,A){var H=perfUI.util.addEl;this.Container=C||this.Container;if(this.Container==null){return;}this.Container.innerHTML="";var G=H(this.Container,"div",{"class":"borderorange bgwht","style":"display:none"});this.reportAbuseWidget=new perfUI.widgets.reportAbuseMenu(G);this.reportAbuseWidget.render();this.reportAbuseWidget.renderButtons();var E=addNode(this.Container,"div","","separator");this.headerContainer=addNode(this.Container,"div","","caption bgSection left");this.buildHeaderContents();var C=addNode(this.Container,"div","","bgContainer bglb clear");this.Tree=new this.treeObject(C);this.Tree.loadNodeDataMethod=F;this.Tree.postCommentMethod=D;this.Tree.deleteCommentMethod=A;var B=this.Tree.getRoot();this.loadNodeComments(B);};perfUI.widgets.userCommentsWidget.prototype.addNewComment=function(H,D,K,J){J=J==undefined?true:J;var B=YAHOO.util.Event.getTarget(H);var E=this.getCommentEditorBodyHtml();var I=D?D.comment.ContentTypeId:this.getContentIdParam();var G=(D?D.pager:(this.Tree?this.Tree.getRoot().pager:null));if(E.trim().length==0){var A=perfTranslator.getValue(2488);alert(A.trim().length>0?A:"You have not entered any text.");return;}E=E.replace(new RegExp("&lt;embed ","g"),"&lt;embed wmode=opaque ");var N={url:"/api/call.asp",params:"?Function="+this.addCommentsParam+"&UserID="+this.UserId+"&"+this.contentIdParam+"="+I+"&page="+(G?G.CurrentPage:"1")+"&numrecords="+(G?G.PageSize:"10")+"&lid="+this.CurrentLanguageId+"&ParentID="+(D?D.comment.CommentId:"0")+"&refresh="+(J?"1":"0")+"&sid="+Math.random()};var F=function(Q){this.handleFailure(Q);};var C=function(Q){this.onSuccessAddNewComment(B,Q,D,J);};var P={success:C,failure:F,scope:scopeWidget};B.disabled=true;var M=perfTranslator.getValue(2487);B.value=M.trim().length>0?M:"Submitting ...";var O=this.AlbumType==1?"perfnights":"";var L=this.ContentObject.CategoryId>0?this.ContentObject.CategoryId:"";LOTCC.bcpw("act","posting comments","int",K,"med",K,"int",L,"med",O);E="m="+Url.encode(E);YAHOO.util.Connect.asyncRequest("POST",N.url+N.params,P,E);};perfUI.widgets.userCommentsWidget.prototype.loadRootComments=function(B){var C=this;var G=this.ContentObject.getContentId();var E={url:"/api/call.asp",params:"?Function="+this.loadRootCommentsParam+"&UserID="+this.UserId+"&"+this.contentIdParam+"="+G+"&page="+(this.Tree?this.Tree.getRoot().pager.CurrentPage:"1")+"&lid="+this.CurrentLanguageId+"&ParentID=0&sid="+Math.random()};var D=function(H){this.handleFailure(H);};var A=function(H){var I=H.responseXML;this.loadResponseContentObject(I);if(B){B();}else{this.Render();}this.Tree.root.containerActivity.style.display="none";};var F={success:A,failure:D,scope:C};YAHOO.util.Connect.asyncRequest("GET",E.url+E.params,F,null);};perfUI.widgets.userCommentsWidget.prototype.loadNodeData=function(A,E){var J=this;var D=this.ContentObject.getContentId();var G={url:"/api/call.asp",params:"?Function="+this.loadRootCommentsParam+"&UserID="+scopeWidget.UserId+"&"+this.contentIdParam+"="+D+"&page="+A.pager.CurrentPage+"&lid="+scopeWidget.CurrentLanguageId+"&ParentID="+(A.comment?A.comment.CommentId:"0")+"&sid="+Math.random()};var C=function(K){this.handleFailure(K);};var B=function(K){var L=K.responseXML;this.loadResponseContentObject(L);this.loadNodeComments(A);};var I={success:B,failure:C,scope:J};var H=this.AlbumType==1?"perfnights":"";var F=this.ContentObject.CategoryId>0?this.ContentObject.CategoryId:"";LOTCC.bcpw("act","checking comments","int",E,"med",E,"int",F,"med",H);YAHOO.util.Connect.asyncRequest("GET",G.url+G.params,I,null);};perfUI.widgets.userCommentsWidget.prototype.deleteNodeData=function(A){var I=this;var F=this.getContentIdParam();var E=this.Tree?this.Tree.getRoot().pager:null;var C=perfTranslator.getValue(482);if(!confirm(C.trim().length==0?"Are you sure you want to delete this comment?":C)){return;}var G={url:"/api/call.asp",params:"?Function="+this.deleteCommentsParam+"&UserID="+this.UserId+"&"+this.contentIdParam+"="+F+"&lid="+this.CurrentLanguageId+"&ParentID="+A.comment.CommentId+"&page="+(E?E.CurrentPage:"1")+"&numrecords="+(E?E.PageSize:"10")+"&sid="+Math.random()};var D=function(J){this.handleFailure(J);};var B=function(J){this.onSuccessDeleteComment(J);};var H={success:B,failure:D,scope:I};YAHOO.util.Connect.asyncRequest("GET",G.url+G.params,H,null);};perfUI.widgets.blogCommentsWidget=function(B,A){var D=this;var C=function(F,E){D.addNewComment(F,E);};perfUI.widgets.blogCommentsWidget.superclass.constructor.call(this,B,perfUI.content.userContentType.Blog,A,C);this.AlbumType=0;this.contentIdParam="blogid";this.loadRootCommentsParam="Media.Blogs.GetBlogComments";this.deleteCommentsParam="Media.Blogs.DeleteBlogComment";this.addCommentsParam="Media.Blogs.InsertBlogComment";this.loadResponseContentObject=function(F){this.LoadLanguagesXml(F);var E=new perfUI.content.userAlbum(this.UserId,F.getElementsByTagName("album")[0]);this.ContentObject=E.Blogs[0];};this.addNewComment=function(F,E){perfUI.widgets.blogCommentsWidget.superclass.addNewComment.call(D,F,E,"blogs");};this.loadRootComments=function(){perfUI.widgets.blogCommentsWidget.superclass.loadRootComments.call(D);};this.loadNodeData=function(E){perfUI.widgets.blogCommentsWidget.superclass.loadNodeData.call(D,E,"blogs");};this.deleteNodeData=function(E){perfUI.widgets.blogCommentsWidget.superclass.deleteNodeData.call(D,E);};this.Render=function(F){var G=this.loadNodeData;var E=this.attachShowCommentEditorEvent;var H=this.deleteNodeData;perfUI.widgets.blogCommentsWidget.superclass.renderTree.call(this,F,G,E,H);D.afterRenderComplete.fire();};};YAHOO.extend(perfUI.widgets.blogCommentsWidget,perfUI.widgets.userCommentsWidget);perfUI.widgets.pictureCommentsWidget=function(B,A){var D=this;var C=function(F,E){D.addNewComment(F,E);};perfUI.widgets.pictureCommentsWidget.superclass.constructor.call(this,B,perfUI.content.userContentType.Picture,A,C);this.AlbumType=0;this.contentIdParam="pictureid";this.loadRootCommentsParam="Media.Pictures.GetPictureComments";this.deleteCommentsParam="Media.Pictures.DeletePictureComment";this.addCommentsParam="Media.Pictures.InsertPictureComment";this.loadResponseContentObject=function(F){this.LoadLanguagesXml(F);var E=new perfUI.content.userAlbum(this.UserId,F.getElementsByTagName("album")[0]);this.ContentObject=E.Pictures[0];};this.addNewComment=function(F,E){perfUI.widgets.pictureCommentsWidget.superclass.addNewComment.call(D,F,E,"pictures");};this.loadRootComments=function(){perfUI.widgets.pictureCommentsWidget.superclass.loadRootComments.call(D);};this.loadNodeData=function(E){perfUI.widgets.pictureCommentsWidget.superclass.loadNodeData.call(D,E,"pictures");};this.deleteNodeData=function(E){perfUI.widgets.pictureCommentsWidget.superclass.deleteNodeData.call(D,E);};this.Render=function(F){var G=this.loadNodeData;var E=this.attachShowCommentEditorEvent;var H=this.deleteNodeData;perfUI.widgets.pictureCommentsWidget.superclass.renderTree.call(this,F,G,E,H);D.afterRenderComplete.fire();};};YAHOO.extend(perfUI.widgets.pictureCommentsWidget,perfUI.widgets.userCommentsWidget);perfUI.widgets.videoCommentsWidget=function(B,A){var D=this;var C=function(F,E){D.addNewComment(F,E);};perfUI.widgets.videoCommentsWidget.superclass.constructor.call(this,B,perfUI.content.userContentType.Video,A,C);this.contentIdParam="videoid";this.loadRootCommentsParam="Media.Videos.GetVideoComments";this.deleteCommentsParam="Media.Videos.DeleteVideoComment";this.addCommentsParam="Media.Videos.InsertVideoComment";this.loadResponseContentObject=function(F){this.LoadLanguagesXml(F);var E=new perfUI.content.userAlbum(this.UserId,F.getElementsByTagName("album")[0]);this.ContentObject=E.Videos[0];};this.addNewComment=function(F,E){perfUI.widgets.pictureCommentsWidget.superclass.addNewComment.call(D,F,E,"videos");};this.loadRootComments=function(E){perfUI.widgets.pictureCommentsWidget.superclass.loadRootComments.call(D,E);};this.loadNodeData=function(E){perfUI.widgets.pictureCommentsWidget.superclass.loadNodeData.call(D,E,"videos");};this.deleteNodeData=function(E){perfUI.widgets.pictureCommentsWidget.superclass.deleteNodeData.call(D,E);};this.Render=function(F){var E=function(){var H=D.loadNodeData;var G=D.attachShowCommentEditorEvent;var I=D.deleteNodeData;perfUI.widgets.videoCommentsWidget.superclass.renderTree.call(D,F,H,G,I);D.afterRenderComplete.fire();};if(this.Tree==null){this.loadRootComments(E);}else{E();}};};YAHOO.extend(perfUI.widgets.videoCommentsWidget,perfUI.widgets.userCommentsWidget);perfUI.widgets.userCommentsWidgetCommentTree=function(A){this.container=A;this.loadNodeDataMethod=null;this.postCommentMethod=null;this.deleteCommentMethod=null;this.root=null;this.nodeCount=0;this.nodeObject=!this.nodeObject?perfUI.widgets.userCommentsWidgetCommentNode:this.nodeObject;this.hasErrors=function(B){var C=B.responseXML;var D=C.getElementsByTagName("errors");if(D.length==1){var E=PERF.parseNode(D[0],"error");alert(E);return true;}return false;};this.getResponseResult=function(B,F){var C=B.responseXML;var E=C.getElementsByTagName("function");for(var D=0;D<E.length;D++){if(E[D].getAttribute("id")==F){return result=PERF.parseNode(E[D],"result");}}return"";};this.getRoot=function(){return this.root;};this.init=function(){this.root=new this.nodeObject();this.root.tree=this;this.root.depth=-1;this.root.container=this.container;this.root.containerBody=this.container;var B=perfTranslator.getValue(1864);this.root.containerActivity=perfUI.util.addEl(this.container,"div",{"class":"activityIndicator","innerHTML":"<p>"+(B.trim().length==0?"loading":B)+"...</p>"});this.root.containerActivity.style.display="none";this.root.childNodesContainer=addNode(this.container,"div");};this.init();};perfUI.widgets.userCommentsWidgetCommentNode=function(C,A,B){this.container=null;this.containerBody=null;this.comment=C;this.isExpanded=B==undefined?true:B;this.showThumbnail=this.showThumbnail?this.showThumbnail:false;this.pager=new CommentsPagerControl();this.toggle=null;this.toggleLabel=null;this.parent=A;this.children=new Array();this.childNodesContainer=null;this.containerActivity=null;this.tree=null;this.depth=-1;this.commentEditorSubmitMethod=null;this.onReportAbuse=new YAHOO.util.CustomEvent("onReportAbuse",this);this.renderChildren=function(){for(var E=0;E<this.children.length;E++){var D=this.children[E];D.buildContainer();if(D.children.length>0){D.children[0].buildContainer();}}};this.removeChildren=function(){this.childNodesContainer.parentNode.removeChild(this.childNodesContainer);this.childNodesContainer=null;this.children=new Array();};this.appendCommentBoxContainer=function(D){return addNode(D,"div","","commentBox");};this.appendCommentReplyBoxContainer=function(){this.childNodesContainer=this.appendCommentBoxContainer(this.containerBody);this.childNodesContainer.className+=" rpl";};this.appendHeader=function(D){return addNode(D,"div","","hdr");};this.appendShowHideIcon=function(D){return addNode(D,"div");};this.postCommentMethodEvent=function(D){this.tree.postCommentMethod(this);};this.deleteCommentMethodEvent=function(D){this.tree.deleteCommentMethod(this);};this.renderPager=function(D){if(this.pager.Container==null){var F=D||this.containerBody;var E=addNode(F,"div");this.pager.Container=E;this.pager.Render(null,this.pager.TotalRecords,true);this.pager.onPageLoad.subscribe(this.pagerFireEvent,this,true);addNode(this.containerBody,"br");}};this.buildContainer=function(){var T=C.TotalReplies>0?true:false;var K=this.appendCommentBoxContainer(this.parent.childNodesContainer);var E=this.appendHeader(K);if(this.comment.AllowReportAbuse==1){var O=addNode(E,"span","r"+this.comment.CommentId,"reportIcon");var J=perfTranslator.getValue(1189);O.title=J.trim().length==0?"Report Abuse":J;var M=function(V){this.onReportAbuse.fire({"event":V,"node":this});};YAHOO.util.Event.addListener(O,"click",M,this,true);}if(this.comment.AllowDelete==1){var P=addNode(E,"span","","deleteCommentIcon");var R=perfTranslator.getValue(316);P.title=R.trim().length==0?"Delete Comment":R;YAHOO.util.Event.addListener(P,"click",this.deleteCommentMethodEvent,this,true);}if(this.comment.AllowReplyMessage==1){var D=addNode(E,"span","","replyMessage");var Q=perfTranslator.getValue(2485);D.title=Q.trim().length==0?"Reply with Message":Q;var N=function(){location.href="http://www.perfspot.com/messagepost.asp?id="+this.comment.user.userGUID+"&cid="+this.comment.CommentId;};YAHOO.util.Event.addListener(D,"click",N,this,true);}if(this.comment.AllowReplyComment==1){var F=addNode(E,"span","","replyComment");var S=perfTranslator.getValue(2484);F.title=S.trim().length==0?"Reply with Comment":S;YAHOO.util.Event.addListener(F,"click",this.postCommentMethodEvent,this,true);}if(this.showThumbnail){var I=function(){location.href=this.comment.user.getProfileUrl();};var H=addNode(E,"img","","thumbnailSmall");H.src=this.comment.user.thumbUrl;YAHOO.util.Event.addListener(H,"click",I,this,true);}var G=addNode(E,"a","","displayName",this.comment.user.displayName);G.href=this.comment.user.getProfileUrl();this.comment.user.attachToolTip(G);if(this.showThumbnail){addNode(E,"br");}var U=perfTranslator.getValue(217).trim().length==0?"Date":perfTranslator.getValue(217);addNode(E,"span","","datePosted",U+":&nbsp;"+C.DateCreated);var L=this.appendBody(K);addNode(L,"div","","commentBody",this.comment.Body);if(T){this.appendCommentReplyBoxContainer();}this.container=K;};this.init=function(){if(this.parent!=null){this.tree=this.parent.tree;this.parent.children.push(this);this.depth=this.parent.depth+1;}this.commentEditorSubmitMethod=this.addNewComment;};this.init();};perfUI.widgets.userCommentsWidgetCommentNode.prototype.pagerFireEvent=function(A){if(this.containerActivity){this.containerActivity.style.display="block";}this.containerActivity.style.display="block";this.tree.loadNodeDataMethod(this);};perfUI.widgets.userCommentsWidgetCommentNode.prototype.loadComplete=function(){if(this.childNodesContainer!=null){this.childNodesContainer.innerHTML="";}this.renderChildren();if(this.pager.TotalRecords>this.pager.PageSize){this.renderPager();}if(this.toggle!=null){this.buildHideRepliesLabel();this.toggle.doExpand();}if(this.containerActivity){this.containerActivity.style.display="none";}};perfUI.widgets.userCommentsWidgetCommentNode.prototype.appendBody=function(B){var A=addNode(B,"div","","bdy");this.containerBody=A;return A;};perfUI.widgets.userCommentsWidgetCommentReplyNode=function(A,B){perfUI.widgets.userCommentsWidgetCommentReplyNode.superclass.constructor.call(this,A.comment,A,B);this.pager.DataSourceDescription="replies";this.buildHeaderContents=function(){};this.buildContainer=function(){this.container=this.parent.childNodesContainer;this.container.innerHTML="";var E=this.appendHeader(this.container);E.className+=" rplhdr";var D=this.appendShowHideIcon(E);this.toggleLabel=addNode(E,"a");PERF.makeLink(this.toggleLabel);if(this.isExpanded){this.buildHideRepliesLabel();}else{this.buildShowRepliesLabel();}var C=this.appendBody(this.container);this.toggle=new perfUI.widgets.showHideContainer(D,C,!this.isExpanded);this.toggle.autoEvents=false;YAHOO.util.Event.addListener(this.toggleLabel,"click",this.toggle.toggle,this.toggle,true);this.toggle.onExpandClick.subscribe(this.expand,this,true);this.toggle.onCollapseClick.subscribe(this.collapse,this,true);this.childNodesContainer=addNode(C,"div");};this.expand=function(){if(this.children.length==0){this.buildLoadingRepliesLabel();this.toggle.setLoadingIconCss();this.tree.loadNodeDataMethod(this);}else{this.buildHideRepliesLabel();this.toggle.doExpand();}};this.collapse=function(){this.buildShowRepliesLabel();this.toggle.doCollapse();};this.buildHideRepliesLabel=function(){var C=perfTranslator.getValue(2494);if(C.trim().length==0){this.toggleLabel.innerHTML="Hide "+String(this.comment.TotalReplies)+" Replies to this Comment";}else{this.toggleLabel.innerHTML=perfTranslator.parseValue(C,[String(this.comment.TotalReplies)]);}};this.buildShowRepliesLabel=function(){var C=perfTranslator.getValue(2493);if(C.trim().length==0){this.toggleLabel.innerHTML="View "+String(this.comment.TotalReplies)+" Replies to this Comment";}else{this.toggleLabel.innerHTML=perfTranslator.parseValue(C,[String(this.comment.TotalReplies)]);}};this.buildLoadingRepliesLabel=function(){var C=perfTranslator.getValue(1864);this.toggleLabel.innerHTML=(C.trim().length==0?"Loading":C)+"...";};};YAHOO.extend(perfUI.widgets.userCommentsWidgetCommentReplyNode,perfUI.widgets.userCommentsWidgetCommentNode);perfUI.widgets.perfboardCommentsWidgetCommentTree=function(A){this.nodeObject=perfUI.widgets.perfboardCommentsWidgetCommentNode;perfUI.widgets.perfboardCommentsWidgetCommentTree.superclass.constructor.call(this,A);};YAHOO.extend(perfUI.widgets.perfboardCommentsWidgetCommentTree,perfUI.widgets.userCommentsWidgetCommentTree);perfUI.widgets.perfboardCommentsWidgetCommentNode=function(D,A,C){var B=this;this.showThumbnail=true;perfUI.widgets.perfboardCommentsWidgetCommentNode.superclass.constructor.call(this,D,A,C);this.pager=new MediaPagerControl(10,5);this.pagers=[];this.pagerFireEvent=function(E){this.containerActivity.style.display="block";perfUI.widgets.perfboardCommentsWidgetCommentNode.superclass.pagerFireEvent.call(this,E);this.containerActivity.style.display="none";};this.loadPagers=function(){for(var E=0;E<2;E++){var F=this.pager;if(E>0){F=new MediaPagerControl(this.pager.PageSize,this.pager.Step);}F.NoRecordDescription=perfTranslator.getValue(2486);F.ShowDescription=true;this.pagers.push(F);}};this.syncPagers=function(E){if(this!=B.pager){B.pager.CurrentPage=this.CurrentPage;B.pager.Render();this.Render(null,null,true);}};this.appendBody=function(F){var E=perfUI.widgets.perfboardCommentsWidgetCommentNode.superclass.appendBody.call(this,F);return E;};this.loadPagers();};YAHOO.extend(perfUI.widgets.perfboardCommentsWidgetCommentNode,perfUI.widgets.userCommentsWidgetCommentNode);perfUI.widgets.perfboardCommentsWidgetCommentNode.prototype.loadComplete=function(){if(this.pager.Container==null){var E=document.createElement("div");this.container.insertBefore(E,this.containerActivity);E.className="pagerSection";var D=addNode(E,"div","","right");this.pager.pagerDescrContainer=addNode(E,"div");this.pager.Container=D;this.pager.Render(null,null,true);this.pager.onPageLoad.subscribe(this.pagerFireEvent,this,true);var B=addNode(this.container,"div","","pagerSection");B.style.borderBottom="none";var C=addNode(B,"div","","right");var A=this.pagers[1];A.pagerDescrContainer=addNode(B,"div");A.Container=C;A.Render(null,null,true);A.onPageLoad.subscribe(this.syncPagers,A,true);}else{this.pagers[0].Render(null,null,true);this.pagers[1].Render(null,null,true);}perfUI.widgets.perfboardCommentsWidgetCommentNode.superclass.loadComplete.call(this);};perfUI.widgets.perfboardCommentsWidget=function(C,B,A){var G=this;var F=perfUI.util.addEl;var D=YAHOO.util.Dom;var E=function(J,I){var H=I?false:true;G.addNewComment(J,I,H);};perfUI.widgets.perfboardCommentsWidget.superclass.constructor.call(this,C,perfUI.content.userContentType.Users,A,E);this.watchedUserId=B||0;this.Caption="";this.treeObject=perfUI.widgets.perfboardCommentsWidgetCommentTree;this.contentIdParam="watchedid";this.loadRootCommentsParam="Members.GetPerfBoard";this.deleteCommentsParam="Members.DeletePerfBoard";this.addCommentsParam="Members.InsertPerfBoard";this.buildHeaderContents=function(){this.headerContainer.style.display="none";};this.loadResponseContentObject=function(H){this.ContentObject=new perfUI.content.user(this.UserId);this.ContentObject.dataSource=H;this.ContentObject.loadComments();this.AllowComments=PERF.parseNodeNumeric(H,"allowComments");};this.addNewComment=function(J,I,H){H=H==undefined?true:H;perfUI.widgets.perfboardCommentsWidget.superclass.addNewComment.call(G,J,I,"users",H);};this.deleteNodeData=function(H){perfUI.widgets.perfboardCommentsWidget.superclass.deleteNodeData.call(G,H);};this.loadNodeData=function(){G.loadRootComments();};this.loadRootComments=function(I){var J=this;var L=(this.Tree?this.Tree.getRoot().pager:null);var M={url:"/api/call.asp",params:"?Function="+this.loadRootCommentsParam+"&userid="+this.UserId+"&watchedid="+this.watchedUserId+"&page="+(L?L.CurrentPage:"1")+"&numrecords="+(L?L.PageSize:"10")+"&sid="+Math.random()};var K=function(O){this.handleFailure(O);};var H=function(O){var P=O.responseXML;this.loadResponseContentObject(P);if(I){I();}else{this.Render(this.container);}this.Tree.root.containerActivity.style.display="none";};var N={success:H,failure:K,scope:J};LOTCC.bcpw("act","checking perfboard");YAHOO.util.Connect.asyncRequest("GET",M.url+M.params,N,null);};this.Render=function(I){I=I||this.container;if(!D.hasClass(I,"applicationBox")){this.container=F(I,"div",{"class":"applicationBox"});I=this.container;}if(!D.hasClass(this.container,"comments")){D.addClass(this.container,"comments");}var H=function(){var K=G.loadNodeData;var J=G.attachShowCommentEditorEvent;var L=G.deleteNodeData;perfUI.widgets.perfboardCommentsWidget.superclass.renderTree.call(G,I,K,J,L);G.afterRenderComplete.fire();};if(this.Tree==null){this.loadRootComments(H);}else{H();}};this.getContentIdParam=function(){return this.watchedUserId;};this.getContentIdParam=function(){return this.watchedUserId;};};YAHOO.extend(perfUI.widgets.perfboardCommentsWidget,perfUI.widgets.userCommentsWidget);perfUI.skin.UI=function(){var A=perfUI.skin.control;this.baseCss=".perfSkin";this.controls={boxes:new A(this.baseCss+" .applicationBox","#605E5F","#FFFFFF","solid 1px #BFC8CF"),buttons:new A(this.baseCss+" .applicationBtn"),dashboard:new A(this.baseCss+" .dashboardMgr"),window:new A(this.baseCss+" .winskin"),links:new A(this.baseCss+" a","#4183B5"),alternatingRow:new A(this.baseCss+" .alternatingRow","#605E5F","#FAFAFA","dotted 1px #D0E2EE")};};perfUI.skin.control=function(D,B,A,C){this.controlCss=D||"";this.color=B||"";this.backgroundColor=A||"";this.border=C||"";};perfUI.skin.styleSheetManager=function(E){var C="rules";var D=null;var G=null;var A=function(I){for(var H=0;H<G.length;H++){var J=G[H];if(J.selectorText.toLowerCase()==I.toLowerCase()){return J;}}return null;};var B=function(K){K=K||E;if(K.trim().length==0){return null;}var J=document.styleSheets;for(var I=0;I<J.length;I++){var H=J[I];if(H.title==K){return H;}}return null;};this.getSheet=function(){return D;};this.setStyleSheetRuleProperty=function(J,I){if(D==null){return;}var L=A(J);if(L==null){return;}for(var H in I){if(I[H].trim().length>0){try{L.style[H]=I[H];}catch(K){}}}};var F=function(){if(document.styleSheets[0].cssRules){C="cssRules";}D=B(E);G=D[C];};F();};perfUI.dashboard.exception={dataError:{"id":1,"msg":""},timeout:{"id":2,"msg":""},custom:{"id":3,"msg":""}};perfUI.dashboard.manager=function(C,A){var B=this;this.userId=C||0;this.dataSource=null;this.container=A||null;this.sections=[];this.loadProperties=function(D){D=D||this.dataSource;if(D==null||D==undefined){return;}this.dataSource=D;};this.loadSections=function(){var D=this.dataSource.getElementsByTagName("sections");var F=D.getElementsByTagName("section");for(var E=0;E<F.length;E++){var G=new perfUI.dashboard.section(F[E]);this.sections.push(G);G.loadApplications();}};this.init=function(){this.loadProperties(this.dataSource);};this.init();};perfUI.dashboard.manager.prototype.load=function(){if(this.dataSource==null){return;}};perfUI.dashboard.section=function(C,A){var B=this;var D=perfUI.util.addEl;this.dataSource=C||null;this.container=A||null;this.containerApps=null;this.applications=[];this.buildApplicationContainer=function(E){var F=D(this.containerApps,"div");return F;};this.loadApplications=function(){if(this.dataSource==null){return;}var E=this.dataSource.getElementsByTagName("applications");var J=E.getElementsByTagName("application");for(var F=0;F<J.length;F++){var H=J[F];var G=PERF.parseNode(H,"type");var I=perfUI.dashboard[G];var K=new I(J[F]);K.container=this.buildApplicationContainer(K);this.applications.push(K);K.load();}};};perfUI.dashboard.application=function(B,D,A,E){var C=this;this.dataSource=D||null;this.applicationCss="";this.container=A||null;this.containerActivity=null;this.containerContent=null;this.isExpanded=true;this.showHideContainer=null;this.allowSkin=false;this.skin=perfUI.skin.UI?new perfUI.skin.UI:null;this.applicationId=0;this.title="Application";this.caption="";this.orderIndex=0;this.type="";this.dataSourceNodeName="application";this.applicationCss="app";this.containerCss="container";this.breadcrumb=E||"";this.isRendered=false;this.afterRenderComplete=new YAHOO.util.CustomEvent("afterRenderComplete",this);this.loadProperties=function(){this.applicationId=PERF.parseNodeNumeric(this.dataSource,"applicationId");this.caption=PERF.parseNode(this.dataSource,"caption");this.type=PERF.parseNode(this.dataSource,"objectType");};this.init=function(){if(this.dataSource){this.loadProperties();}};this.init();};perfUI.dashboard.application.prototype.load=function(){var C=YAHOO.util.Dom;if(this.allowSkin&&this.skin){C.addClass(this.container,"perfSkin");var B=new perfUI.skin.styleSheetManager("dashboard");if(B.getSheet()!=null){B.setStyleSheetRuleProperty(this.skin.controls.boxes.controlCss,{"color":this.skin.controls.boxes.color,"backgroundColor":this.skin.controls.boxes.backgroundColor,"border":this.skin.controls.boxes.border});B.setStyleSheetRuleProperty(this.skin.controls.alternatingRow.controlCss,{"backgroundColor":this.skin.controls.alternatingRow.backgroundColor,"border":this.skin.controls.alternatingRow.border});B.setStyleSheetRuleProperty(this.skin.controls.links.controlCss,{"color":this.skin.controls.links.color});var D=this.skin.controls.links.controlCss+":hover";var A=new perfUI.skin.control(D,this.skin.controls.links.color);B.setStyleSheetRuleProperty(A.controlCss,{"color":A.color});}}if(!C.hasClass(this.container,this.applicationCss)){C.addClass(this.container,this.applicationCss);}};perfUI.dashboard.application.prototype.render=function(){var A=YAHOO.util.Dom;if(!A.hasClass(this.container.parentNode,"dashboard")){A.addClass(this.container.parentNode,"dashboard");}if(!A.hasClass(this.container,"app")){A.addClass(this.container,"app");}};perfUI.dashboard.application.prototype.loadDataSource=function(A){if(!A){return;}this.dataSource=A;this.loadProperties();};perfUI.dashboard.application.prototype.loadRequestedResponse=function(A){var B=A.responseXML;if(!B||B.getElementsByTagName("parsererror").length>0){return perfUI.dashboard.exception.dataError;}var C=perfUI.util.getNode(B.documentElement,"errors");if(C!=null&&C.length==1){var D=perfUI.dashboard.exception.custom;D.msg=PERF.parseNode(C[0],"error");return D;}var E=perfUI.util.getNode(B,this.dataSourceNodeName);if(E==null||E.length==0){return perfUI.dashboard.exception.dataError;}this.loadDataSource(E[0]);};perfUI.dashboard.application.prototype.handleXmlParsingError=function(A){A=A||"This page can not be displayed due to invalid data.";alert(A);};perfUI.dashboard.application.prototype.handleFailure=function(C){var A=this.title+" is currently unavailable.";C=C||A;var B="";if(typeof C=="string"){if(B.trim().length>0){B=C;}else{B=A;}}else{if(typeof C=="object"){if(!this.hasErrors(C)){return;}}}alert(B);};perfUI.dashboard.application.prototype.hasErrors=function(A){var B=null;try{B=A.responseXML;}catch(D){return false;}var C=B.getElementsByTagName("errors");if(C.length==1){var E=PERF.parseNode(C[0],"error");alert(E);return true;}return false;};perfUI.dashboard.peopleList=function(C,A,B){this.container=A;this.userID=C;this.numPeopleToShow=5;this.preload=B||false;this.peopleObjects=[];this.element=null;this.xmlParsed=false;this.onBeforeRequestXML=new YAHOO.util.CustomEvent("onBeforeRequestXML");this.onXMLParsed=new YAHOO.util.CustomEvent("onXMLParsed");this.rendered=false;this.onRendered=new YAHOO.util.CustomEvent("onRendered");this.onBeforeRendered=new YAHOO.util.CustomEvent("onBeforeRendered");this.error=false;this.elementClassName="peopleList";this.xmlURL=null;this.userXMLFormat=[];this.showIfZeroResults=false;this.resetXMLParsedEvent();this.resetRenderedEvent();if(this.preload){this.loadXML();}};perfUI.dashboard.peopleList.prototype.resetXMLParsedEvent=function(){this.xmlParsed=false;this.onXMLParsed.unsubscribe();this.onXMLParsed.subscribe(function(){this.xmlParsed=true;},this,true);};perfUI.dashboard.peopleList.prototype.resetRenderedEvent=function(){this.rendered=false;this.onRendered.unsubscribe();this.onRendered.subscribe(function(){this.rendered=true;},this,true);};perfUI.dashboard.peopleList.prototype.setElement=function(A){this.element=A;};perfUI.dashboard.peopleList.prototype.getElement=function(){return this.element;};perfUI.dashboard.peopleList.prototype.getURL=function(){return this.xmlURL;};perfUI.dashboard.peopleList.prototype.loadXML=function(){this.onBeforeRequestXML.fire();var A={success:this.loadXMLSuccess,failure:this.loadXMLFailure,scope:this,cache:false};YAHOO.util.Connect.asyncRequest("GET",this.getURL(),A,null);};perfUI.dashboard.peopleList.prototype.loadXMLSuccess=function(A){this.dataSource=A.responseXML;this.parseXML();this.onXMLParsed.fire();};perfUI.dashboard.peopleList.prototype.loadXMLFailure=function(A){this.error="Error retrieving people list";this.onXMLParsed.fire();};perfUI.dashboard.peopleList.prototype.parseXML=function(){var E=perfUI.util.getNode;var C=this.dataSource;var A;if(A=E(C,"error")[0]){this.error=A.childNodes[0].nodeValue;return;}var D=E(C,"user");for(var B=0;B<D.length;B++){this.parseUser(D[B]);}};perfUI.dashboard.peopleList.prototype.parseUser=function(D){var E=perfUI.util.getNode;var B={};for(var A=0;A<this.userXMLFormat.length;A++){var C;if(C=E(D,this.userXMLFormat[A])[0]){if(C.childNodes.length==1){if(C.childNodes[0].childNodes.length>0){B[this.userXMLFormat[A]]=C;}else{B[this.userXMLFormat[A]]=C.childNodes[0].nodeValue;}}}}if(!this.userExists(B)){this.peopleObjects.push(B);}};perfUI.dashboard.peopleList.prototype.userExists=function(B){for(var A=0;A<this.peopleObjects.length;A++){if(B["userId"]==this.peopleObjects[A]["userId"]){return true;}}return false;};perfUI.dashboard.peopleList.prototype.render=function(){if(!this.preload){this.onXMLParsed.subscribe(this.renderPeople,this,true);this.loadXML();}else{if(!this.xmlParsed){this.onXMLParsed.subscribe(this.renderPeople,this,true);}else{this.renderPeople();}}};perfUI.dashboard.peopleList.prototype.renderPeople=function(){this.element=perfUI.util.addEl(this.container,"DIV",{"class":this.elementClassName,"style":"display:none;padding:5px;overflow:hidden;"});this.onBeforeRendered.fire();if(this.error){this.element.addChild("DIV",{"innerHTML":"ERROR: "+this.error});}else{for(var A=0;A<Math.min(this.numPeopleToShow,this.peopleObjects.length);A++){this.renderPerson(this.peopleObjects[A]);}}this.onRendered.fire();};perfUI.dashboard.peopleList.prototype.renderPerson=function(A){};perfUI.dashboard.peopleList.prototype.show=function(){if(this.rendered){this.showPeople();}else{this.onRendered.subscribe(this.showPeople,this,true);}};perfUI.dashboard.peopleList.prototype.showPeople=function(){var A=this.getElement();if(A&&(this.peopleObjects.length>0||this.showIfZeroResults)){A.style.display=(document.all?"inline-block":"block");}};perfUI.dashboard.peopleList.prototype.hide=function(){var A=this.getElement();if(A){A.style.display="none";}};perfUI.dashboard.peopleList.prototype.destroy=function(){var A=this.getElement();if(A){this.container.removeChild(A);this.element=null;}this.rendered=false;this.xmlParsed=false;this.peopleObjects=[];this.resetXMLParsedEvent();this.resetRenderedEvent();};perfUI.dashboard.perfboard=function(F,H,B,A,G){var I=this;var C=perfUI.util.getNode;var E=perfUI.util.addEl;var D=YAHOO.util.Dom;perfUI.dashboard.perfboard.superclass.constructor.call(this,F,B,A,G);this.userId=F||0;this.watchedUserId=H||0;this.perfboardDS=null;this.allowCaption=false;this.allowPager=false;this.pager=null;this.grapevineEvent=perfUI.dashboard.grapevineEventCore;this.board=new perfUI.widgets.perfboardCommentsWidget(this.userId,this.watchedUserId,this.container);this.dataSourceNodeName="perfboard";this.applicationCss="perfboard";this.loadPage=function(){};this.buildMainContainer=function(){return E(this.container,"div",{"class":this.containerCss+" left applicationBox"});};this.buildCaptionContainer=function(J){};this.buildContentContainer=function(J){this.containerContent=E(J,"div",{"class":"content clear"});};this.buildContainer=function(){var J=this.buildMainContainer();this.buildCaptionContainer(J);this.buildContentContainer(J);this.loadPage();};this.getPagerCurrentPage=function(){return(this.pager!=null?this.pager.CurrentPage:"1");};this.getPagerPageSize=function(){return(this.pager!=null?this.pager.PageSize:"5");};this.buildNoDataContainer=function(){if(!this.allowPager){var J=E(this.containerContent,"div",{"class":"nodata","innerHTML":"There are 0 comments."});}};this.showContentActivity=function(){var J=this.containerContent;if(!J){return;}J.innerHTML="";perfUI.util.addEl(J,"div",{"class":"activityIndicator","innerHTML":"<p>loading...</p>"});};this.hideLoadingActivity=function(){if(this.containerActivity!=null){this.containerActivity.style.display="none";}};this.onAfterRenderComplete=function(){this.afterRenderComplete.fire();};this.render=function(){perfUI.dashboard.perfboard.superclass.render.call(this);this.board.afterRenderComplete.subscribe(this.onAfterRenderComplete,this,true);this.board.Render(this.container);};this.postComment=function(){this.board.ShowCommentEditor();};this.load=function(){perfUI.dashboard.perfboard.superclass.load.call(this);this.board.ContentObject=new perfUI.content.user(this.watchedUserId);this.render();};};YAHOO.extend(perfUI.dashboard.perfboard,perfUI.dashboard.application);perfUI.messages.thread=function(B){var A=this;this.dataSource=B||null;this.container=null;this.sender=null;this.threadId=-1;this.subject="";this.hasHiddenMessages=false;this.recipients=[];this.messages=[];this.loadProperties();};perfUI.messages.thread.prototype.loadProperties=function(A){A=A||this.dataSource;if(A==null||A==undefined){return;}this.dataSource=A;if(perfUI.content.user){this.sender=new perfUI.content.user(-1,A);}this.threadId=PERF.parseNodeNumeric(A,"threadId");this.subject=PERF.parseNode(A,"subject");this.hasHiddenMessages=PERF.parseNodeBool(A,"hiddenMessages");this.loadSender();this.loadRecipients();this.loadMessages();};perfUI.messages.thread.prototype.loadSender=function(){this.sender=null;var A=this.dataSource.getElementsByTagName("sender");if(A.length!=1){return;}var A=A[0];var B=A.getElementsByTagName("user")[0];this.sender=new perfUI.content.user(-1,B);};perfUI.messages.thread.prototype.loadRecipients=function(){this.recipients=[];var C=this.dataSource.getElementsByTagName("recipients");if(C.length!=1){return;}var C=C[0];var D=C.getElementsByTagName("user");for(var B=0;B<D.length;B++){var A=new perfUI.content.user(-1,D[B]);this.recipients.push(A);}};perfUI.messages.thread.prototype.loadMessages=function(){this.messages=[];var C=this.dataSource.getElementsByTagName("messages");if(C.length!=1){return;}var C=C[0];var D=C.getElementsByTagName("message");for(var B=0;B<D.length;B++){var A=new perfUI.messages.message(D[B]);A.threadId=this.threadId;if(A.messageId<=0){A.messageId=A.threadId;}A.subject=this.subject;this.messages.push(A);}};perfUI.messages.message=function(C,A){var B=this;this.dataSource=C||null;this.container=null;this.user=null;this.messageId=-1;this.threadId=-1;this.subject="";this.body="";this.totalCount=1;this.otherCount=0;this.isRead=false;this.isReplied=false;this.dateSubmitted="";this.dateDiffSubmitted="";this.loadProperties();};perfUI.messages.message.prototype.loadProperties=function(A){A=A||this.dataSource;if(perfUI.content.user){this.user=new perfUI.content.user(-1,A);}if(A==null||A==undefined){return;}this.dataSource=A;this.messageId=PERF.parseNodeNumeric(A,"messageId");this.threadId=PERF.parseNodeNumeric(A,"threadId");if(this.messageId<=0){this.messageId=this.threadId;}this.subject=PERF.parseNode(A,"subject");this.body=PERF.parseNode(A,"body");this.totalCount=PERF.parseNodeNumeric(A,"counts");this.otherCount=PERF.parseNodeNumeric(A,"otherCount");this.totalRecipients=PERF.parseNodeNumeric(A,"recipients");this.isRead=PERF.parseNodeBool(A,"read");this.isReplied=PERF.parseNodeBool(A,"replied");this.dateSubmitted=PERF.parseNode(A,"dateSubmitted");this.dateDiffSubmitted=PERF.parseNode(A,"dateSubmitted2");};perfUI.messages.exception={dataError:{"id":1,"msg":""},timeout:{"id":2,"msg":""},custom:{"id":3,"msg":""}};perfUI.messages.exceptionHandler={parseDataSource:function(A,F){var D={"hasErrors":false,"error":null,"dataSource":A};var E=null;if(!A||A.getElementsByTagName("parsererror").length>0){D={"hasErrors":true,"error":perfUI.messages.exception.dataError,"dataSource":A};}if(!D.hasErrors){var C=A.getElementsByTagName("errors");if(C.length==1){var B=perfUI.messages.exception.custom;B.msg=PERF.parseNode(C[0],"error");D={"hasErrors":true,"error":B,"dataSource":E};}}if(!D.hasErrors){E=perfUI.util.getNode(A,F);if(E==null||E.length==0){D={"hasErrors":true,"error":perfUI.messages.exception.dataError,"dataSource":A};}}switch(D.error){case perfUI.messages.exception.dataError:this.handleXmlParsingError();break;case perfUI.messages.exception.timeout:this.handleFailure();break;}return D;},handleXmlParsingError:function(A){A=A||"This page can not be displayed due to invalid data.";alert(A);},handleFailure:function(A){A=A||"This page is currently unavailable.";alert(A);}};perfUI.messages.config={"INBOX":{"url":"inbox.asp","viewUrl":"view.asp","cfgParam":"INBOX","viewThreadParam":"","removeMethod":"HideInbox","removeProperty":"","optionsMenu":{"markUnread":0,"markRead":1,"delete":2,"block":3}},"SENTBOX":{"url":"outbox.asp","viewUrl":"view.asp","cfgParam":"SENTBOX","viewThreadParam":"o=1","removeMethod":"HideOutbox","removeProperty":"messages","optionsMenu":{"markUnread":-1,"markRead":-1,"delete":0,"block":-1}}};perfUI.messages.manager=function(D,B){var C=this;var G=perfUI.util.addEl;var F=YAHOO.util.Dom;var A=YAHOO.util.Event;var E="messages";this.userId=D||0;this.dataSource=null;this.container=B||null;this.containerCss=E;this.applications=[];this.sections=[];this.buildLayout=function(){this.sections["panels"]=G(this.container,"div",{"class":"alertbox"});this.sections["main"]=G(this.container,"div",{"class":this.containerCss});this.sections["activity"]=G(this.sections["main"],"div",{"class":"activityIndicatorLoadModule","innerHTML":"<p>"+perfTranslator.getValue(1864).toLowerCase()+"...</p>"});this.hideContentActivity();if(!F.hasClass(this.container,E)){F.addClass(this.container,E);}};this.render=function(){this.buildLayout();this.loadApplications();};this.load=function(){this.render();};this.loadApplications=function(){var H=this.sections["main"];var I=this.sections["panels"];for(var J=0;J<this.applications.length;J++){var K=this.applications[J];var L=G(H,"div",{"class":"msg_app clear"});K.dataSource=this.dataSource;K.container=L;K.sections["panels"]=I;K.load();}};this.showContentActivity=function(){var H=this.sections["activity"];if(!H){return;}H.style.display="block";};this.hideContentActivity=function(){var H=this.sections["activity"];if(!H){return;}H.style.display="none";};};perfUI.messages.application=function(D,F,B){var C=this;var G=perfUI.util.addEl;var E=YAHOO.util.Dom;var A=YAHOO.util.Event;this.moduleName="";this.initialState=this.getCurrentState();this.breadcrumb="";this.config=perfUI.messages.config.INBOX;this.userId=D||-1;this.dataSource=F||null;this.container=B||null;this.containerActivity=null;this.pager=typeof(MediaPagerControl)=="undefined"?null:new MediaPagerControl(5,5);this.results=[];this.pagers=[];this.sections=[];this.checkBoxSelector=null;this.persistedSelections=[];this.dataSourceNodeName="messages";this.applicationCss="";this.containerCss="";this.caption="";this.allowCaption=true;this.allowPager=true;this.messageEditorSrcUrl="";this.alertDialog=null;this.messageEditor=null;this.afterRenderComplete=new YAHOO.util.CustomEvent("afterRenderComplete",this);this.syncPagers=function(H){if(this!=C.pager){C.pager.CurrentPage=this.CurrentPage;C.pager.Render();this.Render(null,null,true);}};};perfUI.messages.application.prototype.getCurrentState=function(){var A=10;var B=1;if(this.pager){A=this.pager.PageSize;B=this.pager.CurrentPage;}return"numrecords="+A+"&page="+B;};perfUI.messages.application.prototype.showContentActivity=function(){var A=this.sections["content"];if(!A){return;}A.innerHTML="";perfUI.util.addEl(A,"div",{"class":"activity","innerHTML":'<div class="activityIndicatorLoadModule"><p>'+perfTranslator.getValue(1864).toLowerCase()+"...</p></div>"});};perfUI.messages.application.prototype.buildComposeLink=function(A){var E=perfUI.util.addEl;var D=E(A,"span",{"class":"submit right"});var C=function(F){this.showMessageEditor(true);};var B=new YAHOO.widget.Button({label:perfTranslator.getValue(2781),onclick:{fn:C,obj:null,scope:this},container:D});return B;};perfUI.messages.application.prototype.buildSectionCaption=function(){if(!this.allowCaption){return null;}var C=null;var B=perfUI.util.addEl;var A=YAHOO.util.Dom;var C=this.sections["caption"];A.addClass(C,"bggr caption bordergray");if(!C){return null;}C.innerHTML="";if(this.caption.trim().length>0){B(C,"h2",{"class":"txtdkblue left","innerHTML":this.caption});}return C;};perfUI.messages.application.prototype.buildSectionOptionsContainer=function(A){this.sections["options"]=perfUI.util.addEl(A,"div",{"class":"options bordergray"});};perfUI.messages.application.prototype.buildSectionOptions=function(C){var M=perfUI.util.addEl;var O=YAHOO.util.Event;var K=YAHOO.util.Dom;this.buildSectionOptionsContainer(C);C=this.sections["options"];if(!C){return;}var E=M(C,"checkbox",{"class":"left checkbox","title":perfTranslator.getValue(824)});this.checkBoxSelector=E;var B=function(){if(E.checked){E.title=perfTranslator.getValue(1641);this.selectAllRows();}else{E.title=perfTranslator.getValue(824);this.selectNoRows();}};O.addListener(E,"click",B,this,true);var N=function(R){if(K.hasClass(R,"disabled")){return false;}return true;};var D=M(C,"ul",{"class":"options_menu"});this.sections["options_menu"]=D;if(this.config.optionsMenu["markUnread"]>=0){var Q=M(D,"li");var J=M(Q,"a",{"innerHTML":perfTranslator.getValue(2788)});var A=function(R){if(N(Q)){this.setIsReadStatusPersistedSelections(false);}};O.addListener(J,"click",A,this,true);}if(this.config.optionsMenu["markRead"]>=0){var I=M(D,"li");var L=M(I,"a",{"innerHTML":perfTranslator.getValue(2787)});var H=function(R){if(N(I)){this.setIsReadStatusPersistedSelections(true);}};O.addListener(L,"click",H,this,true);}if(this.config.optionsMenu["delete"]>=0){var P=M(D,"li");var G=M(P,"a",{"innerHTML":perfTranslator.getValue(316)});var F=function(R){if(N(P)){this.showDeleteDialog();}};O.addListener(G,"click",F,this,true);}this.setAvailableOptionsMenuItems();};perfUI.messages.application.prototype.buildLayout=function(){var G=perfUI.util.addEl;var B=YAHOO.util.Dom;var A=this.container;if(this.containerCss.trim().length>0){YAHOO.util.Dom.addClass(A,this.containerCss);}this.sections["main"]=A;this.sections["caption"]=G(A,"div");var F=this.buildSectionCaption();this.buildComposeLink(F);this.loadPagers();if(this.allowPager){this.sections["pager_top"]=G(A,"div",{"class":"pagerSection bordergray"});var E=this.sections["pager_top"];this.pager.Container=G(E,"div",{"class":"right"});this.pager.pagerDescrContainer=G(E,"div");this.pager.onPageLoad.subscribe(this.navigateHistory,this,true);}this.buildSectionOptions(A);this.sections["content"]=G(A,"div",{"class":"content bordergray"});if(this.allowPager){this.sections["pager_bottom"]=G(A,"div",{"class":"pagerSection pagerBottom bordergray"});var D=this.sections["pager_bottom"];var C=this.pagers[1];C.Container=G(D,"div",{"class":"right"});C.pagerDescrContainer=G(D,"div");C.onPageLoad.subscribe(this.syncPagers,C,true);}};perfUI.messages.application.prototype.navigateHistory=function(){YAHOO.util.History.navigate(this.moduleName,this.getCurrentState());};perfUI.messages.application.prototype.load=function(){var A=YAHOO.util.Dom;if(this.allowPager){YAHOO.util.History.register(this.moduleName,this.initialState,this.getMessages,this,true);try{YAHOO.util.History.initialize("yui-history-field","yui-history-iframe");}catch(B){}}if(this.applicationCss.trim().length>0){A.addClass(this.container,this.applicationCss);}this.render();};perfUI.messages.application.prototype.render=function(){this.buildLayout();};perfUI.messages.application.prototype.loadDataSource=function(A){if(!A){return;}this.dataSource=A;};perfUI.messages.application.prototype.loadRequestedResponse=function(A){var B=A.responseXML;var C=perfUI.messages.exceptionHandler.parseDataSource(B,this.dataSourceNodeName);switch(C.error){case perfUI.messages.exception.dataError:this.loadDataSource(this.dataSource);break;case perfUI.messages.exception.timeout:break;default:this.loadDataSource(C.dataSource);break;}this.loadMessages();this.loadPage();};perfUI.messages.application.prototype.loadPagers=function(){if(!this.pager){return;}for(var A=0;A<2;A++){var B=this.pager;if(A>0){B=new MediaPagerControl(this.pager.PageSize,this.pager.Step);}B.NoRecordDescription=this.pager.NoRecordDescription;B.ShowDescription=true;this.pagers.push(B);}};perfUI.messages.application.prototype.loadMessages=function(F,C){F=F||"message";C=C||perfUI.messages.message;var A=this.dataSource.getElementsByTagName(F);this.results=[];for(var B=0;B<A.length;B++){var E=A[B];var D=new C(E);this.results.push(D);}};perfUI.messages.application.prototype.loadPage=function(){for(var A=0;A<this.pagers.length;A++){var B=this.pagers[A];B.ParseXmlProperties(this.dataSource);if(this.allowPager){B.Render(null,null,true);if((A>0&&B.Pages.length<=0)||(!B.ShowDescription&&B.Pages.length<=0)){B.Container.parentNode.style.display="none";}else{B.Container.parentNode.style.display="block";}}}this.loadCurrentView();};perfUI.messages.application.prototype.buildNoResultsView=function(A){};perfUI.messages.application.prototype.buildContentTable=function(A){A=A||this.sections["content"];var B=perfUI.util.addEl(A,"table",{"class":"msg_rows","cellSpacing":"0"});this.sections["contentTable"]=B;return B;};perfUI.messages.application.prototype.buildContentTableRow=function(A){A=A||this.sections["contentTable"];return perfUI.util.addEl(A,"tr",{"class":"row"});};perfUI.messages.application.prototype.loadCurrentView=function(B){B=B||this.results;var F=perfUI.util.addEl;var C=YAHOO.util.Dom;this.sections["content"].innerHTML="";if(B.length>0){if(this.checkBoxSelector){this.checkBoxSelector.checked=true;this.checkBoxSelector.title=perfTranslator.getValue(1641);}C.removeClass(this.container,"nodata");var E=this.buildContentTable();for(var A=0;A<B.length;A++){var D=this.buildContentTableRow();this.buildListItem(B[A],D,A);}}else{C.addClass(this.container,"nodata");this.buildNoResultsView();}};perfUI.messages.application.prototype.setReadStatusIndication=function(A){};perfUI.messages.application.prototype.buildListItem=function(K,H,I){var F=perfUI.util.addEl;var B=YAHOO.util.Dom;var U=YAHOO.util.Event;K.rowElement=H;var A=F(H,"td",{"class":"msg_status_icon"});K.iconElement=F(A,"div");this.setReadStatusIndication(K);var T=F(H,"td",{"class":"msg_select"});var N=F(T,"checkbox",{"class":"checkbox"});var G=function(V){if(N.checked){this.selectRow(K);}else{this.deSelectRow(K);}};U.addListener(N,"click",G,this,true);K.selectItemElement=N;if(this.getPersistedSelectionIndex(K)>=0){this.selectRow(K);}else{if(this.checkBoxSelector){this.checkBoxSelector.checked=false;this.checkBoxSelector.title=perfTranslator.getValue(824);}}var D=F(H,"td",{"class":"msg_profile"});var E=K.user.getProfileUrl();this.buildUserThumbnail(K,D,E);var J=F(H,"td",{"class":"msg_who_when"});this.buildUserLink(K,J);F(J,"span",{"innerHTML":K.dateSubmitted,"class":"when"});F(J,"span",{"innerHTML":K.dateDiffSubmitted,"class":"when"});var S=this.config.viewUrl+"?t="+K.threadId+"&cfg="+this.config.cfgParam;var J=F(H,"td",{"class":"msg_subject"});var Q=F(J,"div",{"class":"msg_subject_txt"});var P=F(Q,"a",{"href":S,"innerHTML":perfTranslator.getValue(749)+":&nbsp; "+K.subject});if(K.totalRecipients>1){var L=F(J,"div",{"class":"msg_subject_to"});var R=F(L,"a",{"href":S,"innerHTML":perfTranslator.getValue(2778)+":&nbsp;"+perfTranslator.parseValue(perfTranslator.getValue(2794),[String(Number(K.totalRecipients))])});}var O=F(J,"div",{"class":"msg_subject_body"});var C=F(O,"a",{"href":S,"innerHTML":K.body});PERF.makeLink(C);var M=F(H,"td",{"class":"msg_delete"});this.buildRowDeleteOptions(K,M);};perfUI.messages.application.prototype.buildUserLink=function(E,A,B){B=B||"";var H=perfUI.util.addEl;var D=E.user.getProfileUrl();var F=this.config.viewUrl+"?t="+E.threadId+"&cfg="+this.config.cfgParam;var C=H(A,"span",{"class":"who"});if(E.otherCount>0){var G=H(C,"a",{"innerHTML":perfTranslator.getValue(2778)+":&nbsp;"+perfTranslator.parseValue(perfTranslator.getValue(2794),[String(Number(E.otherCount+1))]),"href":F});}else{if(B.trim().length>0){C.innerHTML=B;}var G=H(C,"a",{"innerHTML":E.user.displayName,"href":D,"target":"_blank"});}return C;};perfUI.messages.application.prototype.buildRowDeleteOptions=function(G,C){var H=perfUI.util.addEl;var I=YAHOO.util.Event;var J=this;var E=this.config.optionsMenu["delete"];var A=this.config.optionsMenu["block"];if(E<0&&A<0){return;}var B=function(L,K){J.showDeleteDialog([K]);};var F=H(C,"div",{"title":perfTranslator.getValue(316),"class":"iconRemove"});var D=H(F,"div",{"class":"deleteImg"});I.addListener(D,"click",B,G,true);};perfUI.messages.application.prototype.buildUserThumbnail=function(E,B,A){var J=YAHOO.util.Event;var G=perfUI.util.addEl;A=A||E.user.getProfileUrl();var D=G(B,"a",{"href":A,"target":"_blank"});var H=G(D,"img",{"class":"thumbnail"});var I=function(){if(this.height>100){this.style.height="100px";}};J.addListener(H,"load",I,H,true);H.src=E.user.thumbUrl;if(E.user.online){var C=G(B,"div",{"class":"online left"});var F=G(C,"span",{"class":"onlineIcon left"});G(C,"span",{"class":"txtorange left","innerHTML":"&nbsp;"+perfTranslator.getValue(1882)});}};perfUI.messages.application.prototype.selectRow=function(B){var A=this.getPersistedSelectionIndex(B);if(A<0){this.persistedSelections.push(B);}else{this.persistedSelections[A]=B;}if(B.selectItemElement){B.selectItemElement.checked=true;}this.setAvailableOptionsMenuItems();};perfUI.messages.application.prototype.deSelectRow=function(B){this.checkBoxSelector.checked=false;this.checkBoxSelector.title=perfTranslator.getValue(824);var A=this.getPersistedSelectionIndex(B);if(A>=0){this.persistedSelections.splice(A,1);}if(B.selectItemElement){B.selectItemElement.checked=false;}this.setAvailableOptionsMenuItems();};perfUI.messages.application.prototype.selectAllRows=function(){for(var A=0;A<this.results.length;A++){var B=this.results[A];this.selectRow(B);}};perfUI.messages.application.prototype.selectNoRows=function(){for(var A=0;A<this.results.length;A++){var B=this.results[A];this.deSelectRow(B);}};perfUI.messages.application.prototype.getPersistedSelectionIndex=function(C){for(var B=0;B<this.persistedSelections.length;B++){var A=this.persistedSelections[B];if(C.messageId==A.messageId){return B;}}return -1;};perfUI.messages.application.prototype.hasUnreadPersistedSelections=function(){for(var A=0;A<this.persistedSelections.length;A++){var B=this.persistedSelections[A];if(!B.isRead){return true;}}return false;};perfUI.messages.application.prototype.hasReadPersistedSelections=function(){for(var A=0;A<this.persistedSelections.length;A++){var B=this.persistedSelections[A];if(B.isRead){return true;}}return false;};perfUI.messages.application.prototype.enableOptionsMenuItem=function(D,C){var B=YAHOO.util.Dom;var A="disabled";if(C){B.removeClass(D,A);}else{B.addClass(D,A);}};perfUI.messages.application.prototype.setAvailableOptionsMenuItems=function(){var B=this.sections["options_menu"];if(!B){return;}var G=B.getElementsByTagName("li");if(G.length<=0){return;}if(this.persistedSelections.length==0){for(var D=0;D<G.length;D++){this.enableOptionsMenuItem(G[D],false);}return;}var H=this.config.optionsMenu["markUnread"];var F=this.config.optionsMenu["markRead"];var C=this.config.optionsMenu["delete"];var A=this.config.optionsMenu["block"];var I=this.hasReadPersistedSelections();var E=this.hasUnreadPersistedSelections();if(H>=0){if(I){this.enableOptionsMenuItem(G[H],true);}else{this.enableOptionsMenuItem(G[H],false);}}if(F>=0){if(E){this.enableOptionsMenuItem(G[F],true);}else{this.enableOptionsMenuItem(G[F],false);}}if(C>=0){this.enableOptionsMenuItem(G[C],true);}if(A>=0){this.enableOptionsMenuItem(G[A],true);}};perfUI.messages.application.prototype.getRequestIdQueryString=function(C,F){var B="";var E="&ids=";for(var A=0;A<C.length;A++){var D=C[A];if(!F){B+=E+D.messageId;}else{B+=E+D.threadId;}}return B;};perfUI.messages.application.prototype.removeMessageOnSuccess=function(){perfUI.util.presenceTimer.sendRequest();if(this.alertDialog){this.alertDialog.buttonSubmit.set("disabled",false);this.alertDialog.hide();}this.getMessages(this.getCurrentState());};perfUI.messages.application.prototype.removeMessage=function(F,D,H){var J=this;var C=false;F=F||this.persistedSelections;if(F.length<=0){return;}if(typeof(F[0].messageId)=="undefined"){C=true;}var A=this.getRequestIdQueryString(F,C);var G={url:"/api/call.asp",params:"?Function=Messages."+H+"&userid="+this.userId+A+"&block="+(D?"1":"0")};var E=function(K){perfUI.messages.exceptionHandler.handleFailure();};var I={success:J.removeMessageOnSuccess,failure:E,scope:J};var B=G.url+G.params;YAHOO.util.Connect.asyncRequest("POST",B,I,null);};perfUI.messages.application.prototype.getMessages=function(){};perfUI.messages.application.prototype.showMessageEditor=function(E,B){var C=this;if(!this.messageEditor){var A=function(){tinymce.dom.Event._pageInit();var F=E?perfUI.messages.modalEditor:perfUI.messages.inlineEditor;C.renderMessageEditor(F,B);};if(typeof(perfUI.messages.composer)=="undefined"){var C=this;perfUI.util.insertClientScript('var tinyMCE_GZ = {loaded:true}; var tinyMCEPreInit = {suffix:"",base : "/includes/js/tinymce/jscripts/tiny_mce"};');var D=perfUI.util.loadClientResource(this.messageEditorSrcUrl,"js",{"fn":A,"obj":C,"scope":true});}else{A();}}else{this.messageEditor.show();this.messageEditor.focus();}};perfUI.messages.application.prototype.onHideAlertDialog=function(){var C=YAHOO.util.Dom;if(this.messageEditor&&this.messageEditor.getElement().style.display=="block"){if(this.messageEditor.modal){var A=this.messageEditor.getMask();if(A){var B=A.getElement();if(B.style.display=="none"){B.style.display="block";}}}}var D=this.alertDialog.getElement();var E=C.getStyle(D,"opacity");if(E!=1){C.setStyle(D,"opacity",1);}};perfUI.messages.application.prototype.renderAlertDialog=function(){var C=perfUI.util.addEl;var J=YAHOO.util.Event;var B=YAHOO.util.Dom;var G=C(this.sections["panels"].parentNode,"div",{"class":"denybox"});this.alertDialog=new perfUI.widgets.panel(G,"345px");this.alertDialog.setHeader();this.alertDialog.setBody();this.alertDialog.render();B.setStyle(this.alertDialog.container,"zIndex","2000");B.setStyle(this.alertDialog.getMask().getElement(),"zIndex","1000");var K=function(){if(this.messageEditor&&this.messageEditor.getMask()&&this.messageEditor.getMask().getElement()){this.messageEditor.getMask().getElement().style.display="none";}};this.alertDialog.onHideEvent.subscribe(this.onHideAlertDialog,this,true);this.alertDialog.onShowEvent.subscribe(K,this,true);var D=this.alertDialog.getHeader();B.addClass(D,"bgblue3");C(D,"div",{"class":"icon_deny left"});this.alertDialog.caption=C(D,"div",{"class":"txtdkblue left"});var H=C(D,"div",{"class":"txtdkblue right close","innerHTML":"x"});J.addListener(H,"click",this.alertDialog.hide,this.alertDialog,true);var F=this.alertDialog.getBody();this.alertDialog.bodyMessage=C(F,"div");var A=C(F,"center",{"class":"buttonbox clear"});var I=C(A,"span",{"class":"submit"});this.alertDialog.buttonSubmit=new YAHOO.widget.Button({container:I});var E=C(A,"span",{"class":"cancel"});this.alertDialog.buttonCancel=new YAHOO.widget.Button({label:perfTranslator.getValue(701),onclick:{fn:this.alertDialog.hide,obj:null,scope:this.alertDialog},container:E});};perfUI.messages.application.prototype.showDeleteDialog=function(F){var H=perfUI.util.addEl;var J=YAHOO.util.Event;var G=YAHOO.util.Dom;F=F||this.persistedSelections;if(!this.alertDialog){this.renderAlertDialog();}this.alertDialog.caption.innerHTML=perfTranslator.getValue(316);var B=this.alertDialog.bodyMessage;B.innerHTML="";var K=perfTranslator.getValue(2784);if(F.length>1){K=perfTranslator.parseValue(perfTranslator.getValue(2785),[String(F.length)]);}H(B,"p",{"innerHTML":K});if(this.config.optionsMenu["block"]>=0&&F.length==1&&F[0].totalRecipients>1){var C=H(B,"div",{"class":"options"});var I=H(C,"div",{"class":"checkbox"});var D=H(I,"checkbox");this.alertDialog.checkBlockUser=D;var A=H(I,"label",{"class":"txtdkblue","innerHTML":perfTranslator.getValue(2786)});J.addListener(A,"click",function(){D.checked=true;});}if(this.alertDialog.checkBlockUser){this.alertDialog.checkBlockUser.checked=false;}var E=function(N,M){this.alertDialog.buttonSubmit.set("disabled",true);var L=false;if(this.alertDialog.checkBlockUser&&this.alertDialog.checkBlockUser.checked){L=true;}this.removeMessage(M,L);};this.alertDialog.buttonSubmit.set("label",perfTranslator.getValue(316));this.alertDialog.buttonSubmit.set("onclick",{fn:E,obj:F,scope:this});this.alertDialog.buttonCancel.get("container").style.display="inline";this.alertDialog.show();this.alertDialog.center();};perfUI.messages.application.prototype.showErrorDialog=function(F,B){var G=perfUI.util.addEl;var A=YAHOO.util.Event;var D=YAHOO.util.Dom;var E=B[0];if(!this.alertDialog){this.renderAlertDialog();}this.alertDialog.caption.innerHTML=perfTranslator.getValue(1868);var C=this.alertDialog.bodyMessage;C.innerHTML="";G(C,"p",{"style":"text-align:center","innerHTML":E.error.msg});this.alertDialog.buttonSubmit.set("label","ok");this.alertDialog.buttonSubmit.set("onclick",{fn:this.alertDialog.hide,obj:null,scope:this.alertDialog});this.alertDialog.buttonCancel.get("container").style.display="none";this.alertDialog.show();this.alertDialog.center();};perfUI.messages.application.prototype.onFadeMessageEditorSubmitDialog=function(B,A){this.alertDialog.hide();};perfUI.messages.application.prototype.showMessageEditorSubmitDialog=function(F,C){var G=perfUI.util.addEl;var B=YAHOO.util.Event;var E=YAHOO.util.Dom;if(!this.alertDialog){this.renderAlertDialog();}this.alertDialog.caption.innerHTML=perfTranslator.getValue(2625);var D=this.alertDialog.bodyMessage;D.innerHTML="";G(D,"p",{"style":"text-align:center","innerHTML":perfTranslator.getValue(2792)});this.alertDialog.buttonSubmit.set("label","ok");this.alertDialog.buttonSubmit.set("onclick",{fn:this.alertDialog.hide,obj:null,scope:this.alertDialog});this.alertDialog.buttonCancel.get("container").style.display="none";var A=new YAHOO.util.Anim(this.alertDialog.getElement(),{opacity:{to:0}},5,YAHOO.util.Easing.easeIn);A.onComplete.subscribe(this.onFadeMessageEditorSubmitDialog,this,true);this.alertDialog.show();this.alertDialog.center();A.animate();};perfUI.messages.application.prototype.renderMessageEditor=function(D,B,A,C){B=B||this.sections["panels"];this.messageEditor=new D(this.userId,B,A,C);this.messageEditor.afterRenderComplete.subscribe(this.onAfterRenderMessageEditor,this,true);this.messageEditor.onSubmitContent.subscribe(this.onAfterSubmitContent,this,true);this.messageEditor.onSubmitError.subscribe(this.showErrorDialog,this,true);this.messageEditor.render();};perfUI.messages.application.prototype.onAfterRenderMessageEditor=function(){};perfUI.messages.application.prototype.onAfterSubmitContent=function(){this.messageEditor.hide();this.showMessageEditorSubmitDialog();};perfUI.messages.standalone=function(B,C,A){perfUI.messages.standalone.superclass.constructor.call(this,B,C,A);this.allowPager=false;this.applicationCss="msg_standalone";};YAHOO.extend(perfUI.messages.standalone,perfUI.messages.application);perfUI.messages.standalone.prototype.buildSectionOptions=function(A){};perfUI.messages.standalone.prototype.buildSectionCaption=function(){};perfUI.messages.standalone.prototype.buildComposeLink=function(A){};perfUI.messages.standalone.prototype.buildListItem=function(B,C,A){};perfUI.messages.standalone.prototype.loadCurrentView=function(A){};perfUI.messages.standalone.prototype.getMessages=function(){};perfUI.messages.standalone.prototype.load=function(){var A=YAHOO.util.Dom;if(this.applicationCss.trim().length>0){A.addClass(this.container,this.applicationCss);}};perfUI.messages.standalone.prototype.setMessage=function(A){this.results=[];this.results.push(A);};perfUI.messages.standalone.prototype.showMessageEditor=function(E,B,F){var C=this;E=E==undefined?true:E;if(F){this.setMessage(F);}if(!this.messageEditor){var A=function(){tinymce.dom.Event._pageInit();var G=E?perfUI.messages.modalEditor:perfUI.messages.inlineEditor;C.renderMessageEditor(G,B);};if(typeof(perfUI.messages.composer)=="undefined"){var C=this;perfUI.util.insertClientScript('var tinyMCE_GZ = {loaded:true}; var tinyMCEPreInit = {suffix:"",base : "/includes/js/tinymce/jscripts/tiny_mce"};');var D=perfUI.util.loadClientResource(this.messageEditorSrcUrl,"js",{"fn":A,"obj":C,"scope":true});}else{A();}}else{this.messageEditor.show();}};perfUI.messages.standalone.prototype.preloadMessageEditor=function(){var C=YAHOO.util.Dom;var A=this.messageEditor;if(this.results.length>0){for(var B=0;B<this.results.length;B++){var D=this.results[B];A.recipientWidget.addRecipient(D.user);if(A.txtSubject.tagName.toLowerCase()=="input"){A.txtSubject.value=D.subject;}else{A.txtSubject.innerHTML=D.subject;}}if(!A.lockedRecipients&&A.recipientWidget.collapseContainer){A.recipientWidget.collapseContainer();}}};perfUI.messages.standalone.prototype.renderMessageEditor=function(D,B,A,C){perfUI.messages.standalone.superclass.renderMessageEditor.call(this,D,B,A,C);this.messageEditor.onShowEvent.subscribers=[];this.messageEditor.onShowEvent.subscribe(this.preloadMessageEditor,this,true);};perfUI.UI.shape=function(C){var F=perfUI.util.addEl;var E=YAHOO.util.Dom;var I=YAHOO.env.ua;var A=null;var G=null;var B=C["container"];this.getContainer=function(){return B;};this.getWrapper=function(){return A;};this.getBody=function(){return G;};var L=function(){A=F(B,"div",{"class":"perfshape shape_arrow_down"});};var P=function(){A=F(B,"div",{"class":"perfshape shape_arrow_up"});if(I.ie>0&&I.ie<=6){E.addClass(A,"shape_arrow_up_iefix");}};var K=function(){F(A,"b",{"class":"b1"});F(A,"b",{"class":"b2"});F(A,"b",{"class":"b3"});F(A,"b",{"class":"b4"});};var H=function(){F(A,"b",{"class":"b4b"});F(A,"b",{"class":"b3b"});F(A,"b",{"class":"b2b"});F(A,"b",{"class":"b1b"});};var J=function(){G=F(A,"div",{"class":"body_content"});};var M=function(){A=F(B,"div",{"class":"perfshape shape_tab"});K();J();};var D=function(){M();E.addClass(A,"shape_bubble");H();};var O=function(){A=F(B,"div",{"class":"perfshape shape_tub"});J();H();};var N=function(){switch(C["shape"]){case"tab":M();break;case"bubble":D();break;case"tub":O();break;case"arrowDown":L();break;case"arrowUp":P();break;}var Q=C["innerHTML"];if(Q){G.innerHTML=Q;}};N();};perfUI.UI.tabstrip=function(B){var L=this;var E=perfUI.util.addEl;var D=YAHOO.util.Dom;var J=YAHOO.util.Event;var C="tab-on";var F="tab-off";var G="tabPage left";var A=null;var H=[];var I=null;this.getTabs=function(){return H;};this.getSelectedTab=function(){return I;};this.addTab=function(V,Q,M){var U=E(A,"li");if(Q){D.addClass(U,Q);}var N=new perfUI.UI.shape({"shape":"tab","container":U,"innerHTML":V});var R=N.getBody();D.addClass(R,"cursorHand");var T=E(B,"div",{"class":G});var P=H.push({"container":U,"body":R,"page":T,"shape":N});var O=H[P-1];if(M){this.selectTab(O);}else{this.deSelectTab(O);}var S=function(X,W){L.selectTab(W);};J.addListener(R,"click",S,O);return O;};this.clearTabs=function(){for(var M=0;M<H.length;M++){var N=H[M];this.clearTabPage(N);}};this.clearTabPage=function(M){M.page.innerHTML="";};this.deSelectTab=function(M){D.replaceClass(M.container,C,F);D.addClass(M.body,"cursorHand");M.page.style.display="none";};this.selectTab=function(O){for(var M=0;M<H.length;M++){var N=H[M];this.deSelectTab(N);}D.replaceClass(O.container,F,C);D.removeClass(O.body,"cursorHand");O.page.style.display="block";I=O;};var K=function(){A=E(B,"ul",{"class":"tabstrip"});};K();};perfUI.util.purgeInnerHtml=function(A){YAHOO.util.Event.purgeElement(A,true);A.innerHTML="";};perfUI.dashboard.grapevineComment=function(B){var A=this;this.dataSource=B||null;this.container=null;this.user=null;this.commentId=0;this.dateCreated="";this.allowDelete=false;this.body="";this.loadProperties();};perfUI.dashboard.grapevineComment.prototype.loadProperties=function(B){B=B||this.dataSource;if(B==null||B==undefined){return;}this.dataSource=B;this.commentId=PERF.parseNodeNumeric(B,"commentId");this.dateCreated=PERF.parseNode(B,"date");var A=PERF.parseNodeNumeric(B,"allowDelete");this.allowDelete=A==0?false:true;this.body=PERF.parseNode(B,"message");if(perfUI.content.user){this.user=new perfUI.content.user(-1,B);}};perfUI.dashboard.grapevineEventType=function(B,E,A,D,C){this.eventTypeId=B||0;this.eventTypeName=E||"";this.orderIndex=A||0;this.allowFilter=D==undefined?true:D;this.allowComment=C==undefined?false:C;this.getIconCss=function(G){G=G||this.eventTypeId;var F="left broadcastEventIcon broadcastEventType";if(G>=0){return F+G;}else{return F+"All";}};this.getIconOnCss=function(F){return(this.getIconCss(F)+"_on");};this.getIconOffCss=function(F){return(this.getIconCss(F)+"_off");};};perfUI.dashboard.grapevineEventTypes={length:23,ALL:new perfUI.dashboard.grapevineEventType(-1,perfTranslator.getValue(2),0),0:new perfUI.dashboard.grapevineEventType(0,perfTranslator.getValue(363),6,true,true),1:new perfUI.dashboard.grapevineEventType(1,perfTranslator.getValue(375),2,true,true),2:new perfUI.dashboard.grapevineEventType(2,perfTranslator.getValue(182),5,true,true),3:new perfUI.dashboard.grapevineEventType(3,perfTranslator.getValue(336),14,true,true),4:new perfUI.dashboard.grapevineEventType(4,perfTranslator.getValue(2463),7),5:new perfUI.dashboard.grapevineEventType(5,perfTranslator.getValue(289),8,true,true),6:new perfUI.dashboard.grapevineEventType(6,perfTranslator.getValue(2464),9),7:new perfUI.dashboard.grapevineEventType(7,perfTranslator.getValue(2465),10),8:null,9:new perfUI.dashboard.grapevineEventType(9,perfTranslator.getValue(365),3),10:new perfUI.dashboard.grapevineEventType(10,perfTranslator.getValue(2466),11),11:new perfUI.dashboard.grapevineEventType(11,perfTranslator.getValue(437),1),12:new perfUI.dashboard.grapevineEventType(12,perfTranslator.getValue(2467),18,true,true),13:new perfUI.dashboard.grapevineEventType(13,perfTranslator.getValue(2468),12,true,true),14:new perfUI.dashboard.grapevineEventType(14,perfTranslator.getValue(2469),4,true,true),15:new perfUI.dashboard.grapevineEventType(15,perfTranslator.getValue(2470),17,true,true),16:new perfUI.dashboard.grapevineEventType(16,perfTranslator.getValue(1722),15),17:new perfUI.dashboard.grapevineEventType(17,perfTranslator.getValue(2471),16,true,true),18:new perfUI.dashboard.grapevineEventType(18,perfTranslator.getValue(2554),20,true,true),19:new perfUI.dashboard.grapevineEventType(19,perfTranslator.getValue(2542),19),21:new perfUI.dashboard.grapevineEventType(21,perfTranslator.getValue(524),21,true,true),22:new perfUI.dashboard.grapevineEventType(22,perfTranslator.getValue(2831),22,true,true)};perfUI.dashboard.grapevineEventCore=function(C,D,F,A,E){var B=this;var H=perfUI.util.addEl;var G=perfUI.util.getNode;this.userId=C||0;this.dataSource=D||null;this.container=A||null;this.containerItems=null;this.containerDescr=null;this.containerSubmitDate=null;this.commentsWidget={"container":null,"showMax":3,"charMax":499,"comments":[],"commentsTotal":10,"submit":null,"textbox":null,"cloakbox":null};this.mode=F;this.eventMode=perfUI.dashboard.grapevineMode.myGrapevine;this.eventId=0;this.tableId=0;this.eventType=null;this.eventUser=null;this.description="";this.date="";this.allowFilter=E==undefined?false:E;this.loadEventUser=function(){var I=perfUI.util.getNode(this.dataSource,"user");if((I.length>0)&&(I[0].parentNode==this.dataSource)){this.eventUser=new perfUI.content.user(0,I[0]);}this.setMode();};this.attachToolTip=function(J,I){J.attachToolTip(I);};this.buildIcon=function(){var I=null;if(this.iconUrl.trim().length==0){I=H(this.container,"div",{"class":this.eventType.getIconCss()});}else{I=H(this.container,"img",{"class":"broadcastEventIcon left","src":this.iconUrl});}};this.buildUserLink=function(K,J,L){L=L==undefined?true:L;if(!K){return;}var I=H(J,"a",{"href":K.getProfileUrl(),"innerHTML":K.displayName});if(K.thumbUrl.length>0){this.attachToolTip(K,I);}if(L){H(J,"span",{"innerHTML":"&nbsp;"});}};this.loadItems=function(){this.items=[];var J=G(this.dataSource,"eventItems");if(!J||J.length==0){return;}var L=G(J[0],"eventItem");for(var I=0;I<L.length;I++){var K=new this.grapevineEventItem(this.userId,L[I]);this.items.push(K);}};this.renderItems=function(){if(this.eventType.eventTypeId==4){var P=this.containerItems;for(var J=0;J<this.items.length;J++){var M=this.items[J];var N=M.dataSource;for(var I=0;I<N.childNodes.length;I++){var L=N.childNodes[I];var K=L.nodeName;switch(K){case"user":var O=new perfUI.content.user(C,L);this.buildUserLink(O,P);break;}}}}};this.init=function(){this.loadProperties();};this.init();};perfUI.dashboard.grapevineEventCore.prototype.hasErrors=function(A){var B=A.responseXML;var C=B.getElementsByTagName("errors");if(C.length==1){var D=PERF.parseNode(C[0],"error");alert(D);return true;}return false;};perfUI.dashboard.grapevineEventCore.prototype.getComments=function(){var B=this;var E={url:"/api/call.asp",params:"?Function=Members.GetGrapevineComments&userid="+this.userId+"&eventId="+this.eventId+"&gtr=1&sid="+Math.random()};var D=function(G){this.handleFailure(G);};var A=function(G){var H=G.responseXML;if(!H){this.handleFailure(G);return;}this.loadComments(H);this.buildComments();};var F={success:A,failure:D,scope:B};var C=E.url+E.params;YAHOO.util.Connect.asyncRequest("GET",C,F,null);};perfUI.dashboard.grapevineEventCore.prototype.deleteComment=function(H){var B=this;var F=perfTranslator.getValue(482);if(confirm(F)==false){return;}var E={url:"/api/call.asp",params:"?Function=Members.DeleteGrapevineComment&userid="+this.userId+"&commentId="+H+"&sid="+Math.random()};var D=function(I){this.handleFailure(I);};var A=function(I){var J=this.hasErrors(I);if(!J){this.getComments();}};var G={success:A,failure:D,scope:B};var C=E.url+E.params;YAHOO.util.Connect.asyncRequest("GET",C,G,null);};perfUI.dashboard.grapevineEventCore.prototype.postComment=function(){var C=this;var B=this.commentsWidget.textbox.value.trim();if(B.length==0){return;}var F={url:"/api/call.asp",params:"?Function=Members.InsertGrapevineComment&userid="+this.userId+"&eventid="+this.eventId+"&m="+Url.encode(B)+"&sid="+Math.random()};var E=function(H){this.handleFailure(H);};var A=function(H){var I=this.hasErrors(H);if(!I){this.getComments();}};var G={success:A,failure:E,scope:C};var D=F.url+F.params;YAHOO.util.Connect.asyncRequest("GET",D,G,null);};perfUI.dashboard.grapevineEventCore.prototype.toggleCommentsOpen=function(A){if(this.commentsWidget.container.style.display=="none"){this.commentsWidget.container.style.display="block";}this.commentsWidget.cloakbox.style.display="none";this.commentsWidget.textbox.style.display="inline";this.commentsWidget.textbox.focus();this.commentsWidget.submit.get("container").style.display="block";YAHOO.util.Event.stopPropagation(A);YAHOO.util.Event.addListener(document.body,"click",this.toggleCommentsClose,this,true);};perfUI.dashboard.grapevineEventCore.prototype.toggleCommentsClose=function(A){YAHOO.util.Event.removeListener(document.body,"click",this.toggleCommentsClose,this,true);if(this.commentsWidget.textbox.value.trim().length==0){if(this.commentsWidget.comments.length==0){this.commentsWidget.container.style.display="none";}else{this.commentsWidget.textbox.style.display="none";this.commentsWidget.cloakbox.style.display="block";this.commentsWidget.submit.get("container").style.display="none";}}};perfUI.dashboard.grapevineEventCore.prototype.buildEventDescription=function(E){var F=perfUI.util.addEl;var I=F(this.container,"div",{"class":"itemcontent"});var G=F(I,"span");this.buildUserLink(E,G);this.containerDescr=F(G,"span",{"innerHTML":this.description+" "});this.containerSubmitDate=F(G,"div",{"class":"event_when","innerHTML":this.date});this.containerItems=G;if(this.eventType.eventTypeId==22){var C=this.items[0].dataSource;var J=C.getElementsByTagName("sender");if(J.length==1){var B=new perfUI.content.user(-1,J[0].childNodes[0]);var A="gift_broadcast_"+this.eventId;this.containerDescr.innerHTML=this.containerDescr.innerHTML.replace("%x1%",'<span id="'+A+'"></span>');this.buildUserLink(B,document.getElementById(A),false);}}if(this.allowComment){var H=F(this.containerSubmitDate,"a",{"innerHTML":perfTranslator.getValue(808),"class":"comment"});PERF.makeLink(H);YAHOO.util.Event.addListener(H,"click",this.toggleCommentsOpen,this,true);var D=F(this.containerSubmitDate,"div",{"class":"post_comments","style":"display:none"});this.commentsWidget.container=D;this.buildComments();}};perfUI.dashboard.grapevineEventCore.prototype.buildComments=function(){var K=perfUI.util.addEl;var f=YAHOO.util.Event;var F=YAHOO.util.Dom;var T=this;var I=this.commentsWidget;var O=I.container;O.innerHTML="";var b=K(O,"div",{"class":"comment_add"});for(var V=0;V<=I.comments.length;V++){var C=I.comments[V];if(V==0){var H=new perfUI.UI.shape({"shape":"arrowUp","container":b});}var Y=K(b,"div",{"class":"comment_add_box"});var R=new perfUI.UI.shape({"shape":"bubble","container":Y});var P=R.getBody();if(I.comments.length>0){if(V<I.comments.length){var Q=P;F.addClass(Q,"clearfix");var J=C.user.getProfileUrl();var S=K(Q,"div",{"class":"comment_thumbnail"});var d=K(S,"img",{"class":"thumbnailSmall","src":C.user.thumbUrl});var X=K(Q,"div",{"class":"comment_detail"});var L=K(X,"a",{"class":"comment_who","href":J,"innerHTML":C.user.displayName});C.user.attachToolTip(L);var E=K(X,"span",{"class":"comment_when","innerHTML":C.dateCreated});if(C&&C.allowDelete){var a=K(X,"div",{"class":"deleteIcon","title":perfTranslator.getValue(316)});var A=function(g,c){T.deleteComment(c.commentId);};f.addListener(a,"click",A,C);f.addListener(a,"mouseover",function(g,c){F.addClass(c,"deleteIcon_hover");},a);f.addListener(a,"mouseout",function(g,c){F.removeClass(c,"deleteIcon_hover");},a);}var U=K(X,"div",{"class":"comment_body","innerHTML":C.body});}}if(I.commentsTotal>I.comments.length&&V==0){var B=K(b,"div",{"class":"comment_show_all"});var Z="";var G=I.commentsTotal-I.comments.length;if(G==1){Z=perfTranslator.getValue(2775);}else{Z=perfTranslator.parseValue(perfTranslator.getValue(2776),[G]);}var D=K(B,"a",{"innerHTML":Z});PERF.makeLink(D);f.addListener(D,"click",this.getComments,this,true);}if(V==I.comments.length){I.cloakbox=K(P,"div",{"style":"display:none","class":"textbox","innerHTML":perfTranslator.getValue(568)+"..."});f.addListener(I.cloakbox,"click",this.toggleCommentsOpen,this,true);I.textbox=K(P,"textarea",{"style":"display:none","class":"textbox","rows":"1","cols":"30"});f.addListener(I.textbox,"click",function(c){f.stopPropagation(c);});var N=function(c){if(I.textbox.value.length>I.charMax){I.textbox.value=I.textbox.value.substring(0,I.charMax);}};f.addListener(I.textbox,"keypress",N);if(I.comments.length>0){I.cloakbox.style.display="block";}}}var W=K(b,"span",{"class":"submit","style":"display:none"});var e=function(c){YAHOO.util.Event.stopPropagation(c);this.postComment();};var M=new YAHOO.widget.Button({label:perfTranslator.getValue(320),onclick:{fn:e,obj:null,scope:this},container:W});I.submit=M;if(I.comments.length>0){O.style.display="block";}else{O.style.display="none";}};perfUI.dashboard.grapevineEventCore.prototype.render=function(A){this.buildIcon();this.buildEventDescription(A);this.renderItems();};perfUI.dashboard.grapevineEventCore.prototype.loadComments=function(C){C=C||this.dataSource;var B=this.commentsWidget;B.comments=[];B.commentsTotal=PERF.parseNodeNumeric(C,"totalComments");if(B.commentsTotal==0){return;}var D=C.getElementsByTagName("comment");for(var A=0;A<D.length;A++){B.comments.push(new perfUI.dashboard.grapevineComment(D[A]));}};perfUI.dashboard.grapevineEventCore.prototype.loadProperties=function(){this.eventId=PERF.parseNodeNumeric(this.dataSource,"eventId");this.tableId=PERF.parseNodeNumeric(this.dataSource,"tableId");this.eventType=perfUI.dashboard.grapevineEventTypes[PERF.parseNode(this.dataSource,"eventType")];this.applicationId=PERF.parseNodeNumeric(this.dataSource,"appId");this.applicationName=PERF.parseNode(this.dataSource,"appName");this.allowComment=this.eventType.allowComment;this.description=PERF.parseNode(this.dataSource,"description");this.date=PERF.parseNode(this.dataSource,"date");this.iconUrl=PERF.parseNode(this.dataSource,"iconUrl");this.loadEventUser();this.loadItems();this.loadComments();};perfUI.dashboard.grapevineEventCore.prototype.setMode=function(){if(this.userId==this.eventUser.userId){this.eventMode=perfUI.dashboard.grapevineMode.myBuzz;}else{this.eventMode=perfUI.dashboard.grapevineMode.myGrapevine;}};perfUI.dashboard.grapevineEventCore.prototype.grapevineEventItem=function(B,C){var A=this;this.userId=B||0;this.dataSource=C||null;};perfUI.dashboard.grapevineMode={myGrapevine:0,myBuzz:1,userBuzz:2};perfUI.dashboard.grapevineCore=function(F,H,B,A,G){var I=this;var C=perfUI.util.getNode;var E=perfUI.util.addEl;var D=YAHOO.util.Dom;perfUI.dashboard.grapevineCore.superclass.constructor.call(this,F,B,A,G);this.userId=F||0;this.watchedUserId=H||0;this.mode=perfUI.dashboard.grapevineMode.userBuzz;this.grapevineDS=null;this.allowCaption=false;this.allowFilter=false;this.allowPager=false;this.filter=null;this.pager=null;this.grapevineEvent=perfUI.dashboard.grapevineEventCore;this.events=[];this.dataSourceNodeName="grapevine";this.applicationCss="grapevine";this.moduleName="perfUI.dashboard.grapevine";this.paramEventType="etype";this.getInitialState=function(){return YAHOO.util.History.getBookmarkedState(this.moduleName)||this.getCurrentState();};this.loadPage=function(){this.loadEvents();};this.buildMainContainer=function(){return E(this.container,"div",{"class":this.containerCss+" left applicationBox"});};this.buildCaptionContainer=function(J){};this.buildContentContainer=function(J){this.containerContent=E(J,"div",{"class":"content clear"});};this.buildContainer=function(){var J=this.buildMainContainer();this.buildCaptionContainer(J);this.buildContentContainer(J);this.loadPage();};this.getFilterSelectedValue=function(K){var J="-1";if(this.filter!=null){J=this.filter.defaultValue;if(K==undefined){K=this.filter.selectedValue;}var L=K=="ALL"?J:K;return L;}return J;};this.getPagerCurrentPage=function(){return(this.pager!=null?this.pager.CurrentPage:"1");};this.getPagerPageSize=function(){return(this.pager!=null?this.pager.PageSize:"5");};this.updateFilterSelectedValue=function(J){if(this.filter){var K=J.split("&");for(i=0;i<K.length;i++){tokens=K[i].split("=");if(tokens.length>=2){if(tokens[0]===this.paramEventType){this.filter.selectedValue=tokens[1];if(this.filter.filterItems.length>0){this.filter.deSelectFilterItems();this.filter.setCurrentEventType();}}}}}};this.getGrapevine=function(M){M=M||YAHOO.util.History.getBookmarkedState(this.moduleName)||this.getCurrentState();this.showContentActivity();this.updateFilterSelectedValue(M);var N={url:"/api/call.asp",params:"?Function=Members.GetGrapevine&userid="+F+"&watchedid="+H+"&"+M+"&gTr=1&sid="+Math.random()};var L=function(P){this.handleFailure(P);};var J=function(P){perfUI.dashboard.grapevineCore.superclass.loadRequestedResponse.call(this,P);if(this.dataSource==null){return;}this.grapevineDS=C(this.dataSource,this.dataSourceNodeName);if(this.dataSource.nodeName!=this.dataSourceNodeName){if(this.grapevineDS==null){return;}this.grapevineDS=this.grapevineDS[0];}if(this.containerContent==null){this.buildContainer();}else{this.loadPage();}this.render();};var O={success:J,failure:L,scope:I};var K=N.url+N.params;YAHOO.util.Connect.asyncRequest("GET",K,O,null);};this.buildNoDataContainer=function(){if(!this.allowPager){var J=E(this.containerContent,"div",{"class":"nodata","innerHTML":perfTranslator.getValue(2483)});}};this.hideLoadingActivity=function(){if(this.containerActivity!=null){this.containerActivity.style.display="none";}};this.render=function(){perfUI.util.purgeInnerHtml(this.containerContent);if(this.events.length==0){this.buildNoDataContainer();this.hideLoadingActivity();return;}for(var K=0;K<this.events.length;K++){var J=this.events[K];J.container=E(this.containerContent,"div",{"class":"evt"});if((YAHOO.env.ua.ie>0&&YAHOO.env.ua.ie<=7)||(YAHOO.env.ua.gecko>0&&YAHOO.env.ua.gecko<=1.8)){D.addClass(J.container,"clearfix");}else{D.addClass(J.container,"clearfix");J.container.style.display="block";}if(this.allowPager){if(K%2!=0){D.addClass(J.container,"alternatingRow");}}else{if(K%2==0){D.addClass(J.container,"alternatingRow");}}J.render();}this.hideLoadingActivity();};this.setMode=function(){if(this.userId==this.watchedUserId){this.mode=perfUI.dashboard.grapevineMode.myBuzz;}else{if(this.watchedUserId==0){this.mode=perfUI.dashboard.grapevineMode.myGrapevine;}else{if(this.watchedUserId>0){this.mode=perfUI.dashboard.grapevineMode.userBuzz;}}}};this.load=function(){perfUI.dashboard.grapevineCore.superclass.load.call(this);this.setMode();if(this.allowPager){YAHOO.util.History.register(this.moduleName,this.getInitialState(),this.getGrapevine,this,true);try{YAHOO.util.History.initialize("yui-history-field","yui-history-iframe");}catch(J){}}if(this.dataSource==null){this.getGrapevine();}};};YAHOO.extend(perfUI.dashboard.grapevineCore,perfUI.dashboard.application);perfUI.dashboard.grapevineCore.prototype.navigateHistory=function(){if(this.allowPager){YAHOO.util.History.navigate(this.moduleName,this.getCurrentState());}else{this.getGrapevine();}};perfUI.dashboard.grapevineCore.prototype.getCurrentState=function(){var C=this.getFilterSelectedValue();var B=this.getPagerCurrentPage();var A=this.getPagerPageSize();return this.paramEventType+"="+C+"&page="+B+"&numrecords="+A;};perfUI.dashboard.grapevineCore.prototype.showContentActivity=function(){var A=this.containerContent;if(!A){return;}perfUI.util.purgeInnerHtml(A);perfUI.util.addEl(A,"div",{"class":"activityIndicator","innerHTML":"<p>"+perfTranslator.getValue(1864).toLowerCase()+"...</p>"});};perfUI.dashboard.grapevineCore.prototype.loadEvents=function(){var C=perfUI.util.getNode(this.grapevineDS,"events");if(!C){return;}var A=perfUI.util.getNode(C[0],"event");for(var B=0;B<A.length;B++){var D=new this.grapevineEvent(this.userId,A[B],this.mode,null,this.allowFilter);this.events.push(D);}};var gadgets={};var gadgets=gadgets||{};gadgets.config=function(){var A={};return{register:function(D,C,B){if(A[D]){throw new Error('Component "'+D+'" is already registered.');}A[D]={validators:C||{},callback:B};},get:function(B){if(B){if(!A[B]){throw new Error('Component "'+B+'" not registered.');}return configuration[B]||{};}return configuration;},init:function(H,G){configuration=H;for(var F in A){if(A.hasOwnProperty(F)){var E=A[F],D=H[F],B=E.validators;if(!G){for(var C in B){if(B.hasOwnProperty(C)){if(!B[C](D[C])){throw new Error('Invalid config value "'+D[C]+'" for parameter "'+C+'" in component "'+F+'"');}}}}if(E.callback){E.callback(H);}}}},EnumValidator:function(E){var D=[];if(arguments.length>1){for(var C=0,B;B=arguments[C];++C){D.push(B);}}else{D=E;}return function(G){for(var F=0,H;H=D[F];++F){if(G===D[F]){return true;}}};},RegExValidator:function(B){return function(C){return B.test(C);};},ExistsValidator:function(B){return typeof B!=="undefined";},NonEmptyStringValidator:function(B){return typeof B==="string"&&B.length>0;},BooleanValidator:function(B){return typeof B==="boolean";},LikeValidator:function(B){return function(D){for(var E in B){if(B.hasOwnProperty(E)){var C=B[E];if(!C(D[E])){return false;}}}return true;};}};}();var gadgets=gadgets||{};gadgets.util=function(){function F(){var K;var J=document.location.href;var H=J.indexOf("?");var I=J.indexOf("#");if(I===-1){K=J.substr(H+1);}else{K=[J.substr(H+1,I-H-1),"&",J.substr(I+1)].join("");}return K.split("&");}var D=null;var C={};var E=[];var A={0:false,10:true,13:true,34:true,39:true,60:true,62:true,92:true,8232:true,8233:true};function B(H,I){return String.fromCharCode(I);}function G(H){C=H["core.util"]||{};}if(gadgets.config){gadgets.config.register("core.util",null,G);}return{getUrlParameters:function(){if(D!==null){return D;}D={};var K=F();var N=window.decodeURIComponent?decodeURIComponent:unescape;for(var I=0,H=K.length;I<H;++I){var M=K[I].indexOf("=");if(M===-1){continue;}var L=K[I].substring(0,M);var J=K[I].substring(M+1);J=J.replace(/\+/g," ");D[L]=N(J);}return D;},makeClosure:function(K,M,L){var J=[];for(var I=2,H=arguments.length;I<H;++I){J.push(arguments[I]);}return function(){var N=J.slice();for(var P=0,O=arguments.length;P<O;++P){N.push(arguments[P]);}return M.apply(K,N);};},makeEnum:function(I){var K={};for(var J=0,H;H=I[J];++J){K[H]=H;}return K;},getFeatureParameters:function(H){return typeof C[H]==="undefined"?null:C[H];},hasFeature:function(H){return typeof C[H]!=="undefined";},registerOnLoadHandler:function(H){E.push(H);},runOnLoadHandlers:function(){for(var I=0,H=E.length;I<H;++I){E[I]();}},escape:function(H,L){if(!H){return H;}else{if(typeof H==="string"){return gadgets.util.escapeString(H);}else{if(typeof H==="array"){for(var K=0,I=H.length;K<I;++K){H[K]=gadgets.util.escape(H[K]);}}else{if(typeof H==="object"&&L){var J={};for(var M in H){if(H.hasOwnProperty(M)){J[gadgets.util.escapeString(M)]=gadgets.util.escape(H[M],true);}}return J;}}}}return H;},escapeString:function(L){var I=[],K,M;for(var J=0,H=L.length;J<H;++J){K=L.charCodeAt(J);M=A[K];if(M===true){I.push("&#",K,";");}else{if(M!==false){I.push(L.charAt(J));}}}return I.join("");},unescapeString:function(H){return H.replace(/&#([0-9]+);/g,B);}};}();gadgets.util.getUrlParameters();var shindig=shindig||{};shindig.Auth=function(){var authToken=null;var trusted=null;function init(configuration){var urlParams=gadgets.util.getUrlParameters();var config=configuration["shindig.auth"]||{};if(config.authToken){authToken=config.authToken;}else{if(urlParams.st){authToken=urlParams.st;}}if(authToken!=null){addParamsToToken(urlParams);}if(config.trustedJson){trusted=eval("("+config.trustedJson+")");}}function addParamsToToken(urlParams){var args=authToken.split("&");for(var i=0;i<args.length;i++){var nameAndValue=args[i].split("=");if(nameAndValue.length==2){var name=nameAndValue[0];var value=nameAndValue[1];if(value==="$"){value=encodeURIComponent(urlParams[name]);args[i]=name+"="+value;}}}authToken=args.join("&");}gadgets.config.register("shindig.auth",null,init);return{getSecurityToken:function(){return authToken;},updateSecurityToken:function(newToken){authToken=newToken;},getTrustedData:function(){return trusted;}};};var shindig=shindig||{};shindig.auth=new shindig.Auth();var gadgets=gadgets||{};(function(){var B=null;var C={};var E={};var G="en";var F="US";var D=0;function A(){var I=gadgets.util.getUrlParameters();for(var H in I){if(I.hasOwnProperty(H)){if(H.indexOf("up_")===0&&H.length>3){C[H.substr(3)]=String(I[H]);}else{if(H==="country"){F=I[H];}else{if(H==="lang"){G=I[H];}else{if(H==="mid"){D=I[H];}}}}}}}gadgets.Prefs=function(){if(!B){A();B=this;}return B;};gadgets.Prefs.setInternal_=function(I,J){if(typeof I==="string"){C[I]=J;}else{for(var H in I){if(I.hasOwnProperty(H)){C[H]=I[H];}}}};gadgets.Prefs.setMessages_=function(H){msgs=H;};gadgets.Prefs.prototype.getString=function(H){return C[H]?gadgets.util.escapeString(C[H]):"";};gadgets.Prefs.prototype.getInt=function(H){var I=parseInt(C[H],10);return isNaN(I)?0:I;};gadgets.Prefs.prototype.getFloat=function(H){var I=parseFloat(C[H]);return isNaN(I)?0:I;};gadgets.Prefs.prototype.getBool=function(H){var I=C[H];if(I){return I==="true"||I===true||!!parseInt(I,10);}return false;};gadgets.Prefs.prototype.set=function(H,I){throw new Error("setprefs feature required to make this call.");};gadgets.Prefs.prototype.getArray=function(L){var M=C[L];if(M){var H=M.split("|");var I=gadgets.util.escapeString;for(var K=0,J=H.length;K<J;++K){H[K]=I(H[K].replace(/%7C/g,"|"));}return H;}return[];};gadgets.Prefs.prototype.setArray=function(H,I){throw new Error("setprefs feature required to make this call.");};gadgets.Prefs.prototype.getMsg=function(H){return msgs[H]||"";};gadgets.Prefs.prototype.getCountry=function(){return F;};gadgets.Prefs.prototype.getLang=function(){return G;};gadgets.Prefs.prototype.getModuleId=function(){return D;};})();var gadgets=gadgets||{};gadgets.json=function(){function f(n){return n<10?"0"+n:n;}Date.prototype.toJSON=function(){return[this.getUTCFullYear(),"-",f(this.getUTCMonth()+1),"-",f(this.getUTCDate()),"T",f(this.getUTCHours()),":",f(this.getUTCMinutes()),":",f(this.getUTCSeconds()),"Z"].join("");};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i])||"null");}return"["+a.join(",")+"]";}for(k in value){if(value.hasOwnProperty(k)){if(typeof k==="string"){v=stringify(value[k]);if(v){a.push(stringify(k)+":"+v);}}}}return"{"+a.join(",")+"}";}}return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/b-u]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return eval("("+text+")");}return false;}};}();var JSON=gadgets.json;var _IG_Prefs=gadgets.Prefs;_IG_Prefs._parseURL=gadgets.Prefs.parseUrl;function _IG_Fetch_wrapper(B,A){B(A.data);}function _IG_FetchContent(B,E,C){var D=C||{};if(D.refreshInterval){D["REFRESH_INTERVAL"]=D.refreshInterval;}else{D["REFRESH_INTERVAL"]=3600;}var A=gadgets.util.makeClosure(null,_IG_Fetch_wrapper,E);gadgets.io.makeRequest(B,A,D);}function _IG_FetchXmlContent(B,E,C){var D=C||{};if(D.refreshInterval){D["REFRESH_INTERVAL"]=D.refreshInterval;}else{D["REFRESH_INTERVAL"]=3600;}D.CONTENT_TYPE="DOM";var A=gadgets.util.makeClosure(null,_IG_Fetch_wrapper,E);gadgets.io.makeRequest(B,A,D);}function _IG_FetchFeedAsJSON(B,F,C,A,D){var E=D||{};E.CONTENT_TYPE="FEED";E.NUM_ENTRIES=C;E.GET_SUMMARIES=A;gadgets.io.makeRequest(B,function(G){if(G.errors){G.data=G.data||{};if(G.errors&&G.errors.length>0){G.data.ErrorMsg=G.errors[0];}}F(G.data);},E);}function _IG_GetCachedUrl(A){return gadgets.io.getProxyUrl(A);}function _IG_GetImageUrl(A){return gadgets.io.getProxyUrl(A);}function _IG_RegisterOnloadHandler(A){gadgets.util.registerOnLoadHandler(A);}function _IG_Callback(B,C){var A=arguments;return function(){var D=Array.prototype.slice.call(arguments);B.apply(null,D.concat(Array.prototype.slice.call(A,1)));};}var _args=gadgets.util.getUrlParameters;function _gel(A){return document.getElementById?document.getElementById(A):null;}function _gelstn(A){if(A==="*"&&document.all){return document.all;}return document.getElementsByTagName?document.getElementsByTagName(A):[];}function _gelsbyregex(D,F){var C=_gelstn(D);var E=[];for(var B=0,A=C.length;B<A;++B){if(F.test(C[B].id)){E.push(C[B]);}}return E;}function _esc(A){return window.encodeURIComponent?encodeURIComponent(A):escape(A);}function _unesc(A){return window.decodeURIComponent?decodeURIComponent(A):unescape(A);}function _hesc(A){return gadgets.util.escapeString(A);}function _striptags(A){return A.replace(/<\/?[^>]+>/g,"");}function _trim(A){return A.replace(/^\s+|\s+$/g,"");}function _toggle(A){A=_gel(A);if(A!==null){if(A.style.display.length===0||A.style.display==="block"){A.style.display="none";}else{if(A.style.display==="none"){A.style.display="block";}}}}var _global_legacy_uidCounter=0;function _uid(){return _global_legacy_uidCounter++;}function _min(B,A){return(B<A?B:A);}function _max(B,A){return(B>A?B:A);}function _exportSymbols(A,B){var H={};for(var I=0,F=B.length;I<F;I+=2){H[B[I]]=B[I+1];}var E=A.split(".");var J=window;for(var D=0,C=E.length-1;D<C;++D){var G={};J[E[D]]=G;J=G;}J[E[E.length-1]]=H;}var gadgets=gadgets||{};gadgets.io=function(){var config={};var oauthState;function makeXhr(){if(window.XMLHttpRequest){return new window.XMLHttpRequest();}else{if(window.ActiveXObject){var x=new ActiveXObject("Msxml2.XMLHTTP");if(!x){x=new ActiveXObject("Microsoft.XMLHTTP");}return x;}}}function hadError(xobj,callback){if(xobj.readyState!==4){return true;}if(xobj.status!==200){callback({errors:["Error "+xobj.status]});return true;}return false;}function processNonProxiedResponse(url,callback,params,xobj){if(hadError(xobj,callback)){return;}var data={body:xobj.responseText};callback(transformResponseData(params,data));}var UNPARSEABLE_CRUFT="throw 1; < don't be evil' >";function processResponse(url,callback,params,xobj){if(hadError(xobj,callback)){return;}var txt=xobj.responseText;txt=txt.substr(UNPARSEABLE_CRUFT.length);var data=eval("("+txt+")");data=data[url];if(data.oauthState){oauthState=data.oauthState;}if(data.st){shindig.auth.updateSecurityToken(data.st);}callback(transformResponseData(params,data));}function transformResponseData(params,data){var resp={text:data.body,oauthApprovalUrl:data.oauthApprovalUrl,oauthError:data.oauthError,oauthErrorText:data.oauthErrorText,errors:[]};if(resp.text){switch(params.CONTENT_TYPE){case"JSON":case"FEED":resp.data=gadgets.json.parse(resp.text);if(!resp.data){resp.errors.push("failed to parse JSON");resp.data=null;}break;case"DOM":var dom;if(window.ActiveXObject){dom=new ActiveXObject("Microsoft.XMLDOM");dom.async=false;dom.validateOnParse=false;dom.resolveExternals=false;if(!dom.loadXML(resp.text)){resp.errors.push("failed to parse XML");}else{resp.data=dom;}}else{var parser=new DOMParser();dom=parser.parseFromString(resp.text,"text/xml");if("parsererror"===dom.documentElement.nodeName){resp.errors.push("failed to parse XML");}else{resp.data=dom;}}break;default:resp.data=resp.text;break;}}return resp;}function makeXhrRequest(realUrl,proxyUrl,callback,paramData,method,params,processResponseFunction,opt_contentType){var xhr=makeXhr();xhr.open(method,proxyUrl,true);if(callback){xhr.onreadystatechange=gadgets.util.makeClosure(null,processResponseFunction,realUrl,callback,params,xhr);}if(paramData!=null){xhr.setRequestHeader("Content-Type",opt_contentType||"application/x-www-form-urlencoded");xhr.send(paramData);}else{xhr.send(null);}}function respondWithPreload(postData,params,callback){if(gadgets.io.preloaded_&&gadgets.io.preloaded_[postData.url]){var preload=gadgets.io.preloaded_[postData.url];if(postData.httpMethod=="GET"){delete gadgets.io.preloaded_[postData.url];if(preload.rc!==200){callback({errors:["Error "+preload.rc]});}else{callback(transformResponseData(params,{body:preload.body}));}return true;}}return false;}function init(configuration){config=configuration["core.io"];}var requiredConfig={proxyUrl:new gadgets.config.RegExValidator(/.*%(raw)?url%.*/),jsonProxyUrl:gadgets.config.NonEmptyStringValidator};gadgets.config.register("core.io",requiredConfig,init);return{makeRequest:function(url,callback,opt_params){var params=opt_params||{};var httpMethod=params.METHOD||"GET";var refreshInterval=params.REFRESH_INTERVAL;var auth,st;if(params.AUTHORIZATION&&params.AUTHORIZATION!=="NONE"){auth=params.AUTHORIZATION.toLowerCase();st=shindig.auth.getSecurityToken();}else{if(httpMethod==="GET"&&refreshInterval===undefined){refreshInterval=3600;}}var signOwner=params.OWNER_SIGNED;var signViewer=params.VIEWER_SIGNED;var headers=params.HEADERS||{};if(httpMethod==="POST"&&!headers["Content-Type"]){headers["Content-Type"]="application/x-www-form-urlencoded";}var paramData={url:url,httpMethod:httpMethod,headers:gadgets.io.encodeValues(headers,false),postData:params.POST_DATA||"",authz:auth||"",st:st||"",contentType:params.CONTENT_TYPE||"TEXT",numEntries:params.NUM_ENTRIES||"3",getSummaries:!!params.GET_SUMMARIES,signOwner:signOwner||"true",signViewer:signViewer||"true",gadget:gadgets.util.getUrlParameters().url,bypassSpecCache:gadgets.util.getUrlParameters().nocache||""};if(params.AUTHORIZATION==="OAUTH"){paramData.oauthState=oauthState||"";for(opt in params){if(params.hasOwnProperty(opt)){if(opt.indexOf("OAUTH_")===0){paramData[opt]=params[opt];}}}}if(!respondWithPreload(paramData,params,callback,processResponse)){if(httpMethod==="GET"&&refreshInterval>0){var extraparams="?refresh="+refreshInterval+"&"+gadgets.io.encodeValues(paramData);makeXhrRequest(url,config.jsonProxyUrl+extraparams,callback,null,"GET",params,processResponse);}else{makeXhrRequest(url,config.jsonProxyUrl,callback,gadgets.io.encodeValues(paramData),"POST",params,processResponse);}}},makeNonProxiedRequest:function(relativeUrl,callback,opt_params,opt_contentType){var params=opt_params||{};makeXhrRequest(relativeUrl,relativeUrl,callback,params.POST_DATA,params.METHOD,params,processNonProxiedResponse,opt_contentType);},clearOAuthState:function(){oauthState=undefined;},encodeValues:function(fields,opt_noEscaping){var escape=!opt_noEscaping;var buf=[];var first=false;for(var i in fields){if(fields.hasOwnProperty(i)){if(!first){first=true;}else{buf.push("&");}buf.push(escape?encodeURIComponent(i):i);buf.push("=");buf.push(escape?encodeURIComponent(fields[i]):fields[i]);}}return buf.join("");},getProxyUrl:function(url,opt_params){var params=opt_params||{};var refresh=params.REFRESH_INTERVAL;if(refresh===undefined){refresh="3600";}return config.proxyUrl.replace("%url%",encodeURIComponent(url)).replace("%rawurl%",url).replace("%refresh%",encodeURIComponent(refresh));}};}();gadgets.io.RequestParameters=gadgets.util.makeEnum(["METHOD","CONTENT_TYPE","POST_DATA","HEADERS","AUTHORIZATION","NUM_ENTRIES","GET_SUMMARIES","REFRESH_INTERVAL","OAUTH_SERVICE_NAME","OAUTH_TOKEN_NAME","OAUTH_REQUEST_TOKEN","OAUTH_REQUEST_TOKEN_SECRET"]);gadgets.io.MethodType=gadgets.util.makeEnum(["GET","POST","PUT","DELETE","HEAD"]);gadgets.io.ContentType=gadgets.util.makeEnum(["TEXT","DOM","JSON","FEED"]);gadgets.io.AuthorizationType=gadgets.util.makeEnum(["NONE","SIGNED","OAUTH"]);var gadgets=gadgets||{};gadgets.rpc=function(){var N="__cb";var L="";var Y="__g2c_rpc";var E="__c2g_rpc";var B={};var S=[];var C={};var Q={};var H={};var J=0;var Z={};var P={};var D={};var X={};if(gadgets.util){X=gadgets.util.getUrlParameters();}H[".."]=X.rpctoken||X.ifpctok||0;function U(){return typeof window.postMessage==="function"?"wpm":typeof document.postMessage==="function"?"dpm":navigator.product==="Gecko"?"fe":"ifpc";}function W(){if(G==="dpm"||G==="wpm"){window.addEventListener("message",function(a){O(gadgets.json.parse(a.data));},false);}}var G=U();W();B[L]=function(){throw new Error("Unknown RPC service: "+this.s);};B[N]=function(b,a){var c=Z[b];if(c){delete Z[b];c(a);}};function K(a){if(P[a]){return;}if(G==="fe"){try{var c=document.getElementById(a);c[Y]=function(d){O(gadgets.json.parse(d));};}catch(b){}}P[a]=true;}function R(c){var e=gadgets.json.stringify;var a=[];for(var d=0,b=c.length;d<b;++d){a.push(encodeURIComponent(e(c[d])));}return a.join("&");}function O(b){if(b&&typeof b.s==="string"&&typeof b.f==="string"&&b.a instanceof Array){if(H[b.f]){if(H[b.f]!=b.t){throw new Error("Invalid auth token.");}}if(b.c){b.callback=function(c){gadgets.rpc.call(b.f,N,null,b.c,c);};}var a=(B[b.s]||B[L]).apply(b,b.a);if(b.c&&typeof a!="undefined"){gadgets.rpc.call(b.f,N,null,b.c,a);}}}function A(b,c,i,d,g){try{if(i!=".."){var a=window.frameElement;if(typeof a[Y]==="function"){if(typeof a[Y][E]!=="function"){a[Y][E]=function(e){O(gadgets.json.parse(e));};}a[Y](d);return;}}else{var h=document.getElementById(b);if(typeof h[Y]==="function"&&typeof h[Y][E]==="function"){h[Y][E](d);return;}}}catch(f){}V(b,c,i,d,g);}function V(a,b,g,c,d){var f=gadgets.rpc.getRelayUrl(a);if(!f){throw new Error("No relay file assigned for IFPC");}var e=null;if(Q[a]){e=[f,"#",R([g,J,1,0,R([g,b,"","",g].concat(d))])].join("");}else{e=[f,"#",a,"&",g,"@",J,"&1&0&",encodeURIComponent(c)].join("");}I(e);}function I(d){var b;for(var a=S.length-1;a>=0;--a){var f=S[a];try{if(f&&(f.recyclable||f.readyState==="complete")){f.parentNode.removeChild(f);if(window.ActiveXObject){S[a]=f=null;S.splice(a,1);}else{f.recyclable=false;b=f;break;}}}catch(c){}}if(!b){b=document.createElement("iframe");b.style.border=b.style.width=b.style.height="0px";b.style.visibility="hidden";b.style.position="absolute";b.onload=function(){this.recyclable=true;};S.push(b);}b.src=d;setTimeout(function(){document.body.appendChild(b);},0);}function F(b,d){if(typeof D[b]==="undefined"){D[b]=false;var c=null;if(b===".."){c=parent;}else{c=frames[b];}try{D[b]=c.gadgets.rpc.receiveSameDomain;}catch(a){}}if(typeof D[b]==="function"){D[b](d);return true;}return false;}if(gadgets.config){function T(a){if(a.rpc.parentRelayUrl.substring(0,7)==="http://"){C[".."]=a.rpc.parentRelayUrl;}else{var e=document.location.search.substring(0).split("&");var d="";for(var b=0,c;c=e[b];++b){if(c.indexOf("parent=")===0){d=decodeURIComponent(c.substring(7));break;}}C[".."]=d+a.rpc.parentRelayUrl;}Q[".."]=!!a.rpc.useLegacyProtocol;}var M={parentRelayUrl:gadgets.config.NonEmptyStringValidator};gadgets.config.register("rpc",M,T);}return{register:function(b,a){if(b==N){throw new Error("Cannot overwrite callback service");}if(b==L){throw new Error("Cannot overwrite default service: use registerDefault");}B[b]=a;},unregister:function(a){if(a==N){throw new Error("Cannot delete callback service");}if(a==L){throw new Error("Cannot delete default service: use unregisterDefault");}delete B[a];},registerDefault:function(a){B[""]=a;},unregisterDefault:function(){delete B[""];},call:function(h,d,i,g){++J;h=h||"..";if(i){Z[J]=i;}var f="..";if(h===".."){f=window.name;}var c={s:d,f:f,c:i?J:0,a:Array.prototype.slice.call(arguments,3),t:H[h]};if(F(h,c)){return;}var a=gadgets.json.stringify(c);var b=G;if(Q[h]){b="ifpc";}switch(b){case"dpm":var j=h===".."?parent.document:frames[h].document;j.postMessage(a);break;case"wpm":var e=h===".."?parent:frames[h];e.postMessage(a,"*");break;case"fe":A(h,d,f,a,c.a);break;default:V(h,d,f,a,c.a);break;}},getRelayUrl:function(a){return C[a];},setRelayUrl:function(b,a,c){C[b]=a;Q[b]=!!c;},setAuthToken:function(a,b){H[a]=b;K(a);},getRelayChannel:function(){return G;},receive:function(a){if(a.length>4){O(gadgets.json.parse(decodeURIComponent(a[a.length-1])));}},receiveSameDomain:function(a){a.a=Array.prototype.slice.call(a.a);window.setTimeout(function(){O(a);},0);}};}();var maxAppHeight=1000;function setMaxHeight(A){maxAppHeight=A;}function rpc_requestSendMessage(F,C,H,B){C=(typeof C=="array"?C.join(","):C);var D=perfUI.gadgets.installedApps[this.f].token;var G=encodeURIComponent(C);var E=encodeURIComponent(H);var A=encodeURIComponent(B);YAHOO.util.Connect.asyncRequest("POST","/opensocial/rpc.asp",{success:function(N){var J,M,L=N.responseXML;try{var I=L.getElementsByTagName("errorCode")[0].childNodes;J=(I[0]?I[0].nodeValue:null);var I=L.getElementsByTagName("errorMessage")[0].childNodes;M=(I[0]?I[0].nodeValue:null);}catch(K){J="internalError";M="Server returned invalid XML response";}window.gadgets.rpc.call(this.f,"requestSendMessage_callback",null,J,M);},failure:function(){window.gadgets.rpc.call(this.f,"requestSendMessage_callback",null,"internalError","XHR Request Failed to send Message");},scope:this},"action=rsm&type="+F+"&r="+G+"&t="+E+"&b="+A+"&st="+D);}gadgets.rpc.register("sendMessage",rpc_requestSendMessage);function rpc_requestNavigateTo(E,D){var A;if(E=="canvas"){var C=perfUI.gadgets.installedApps[this.f];A="/apps/canvas.asp?i="+C.owner+"&id="+C.id+"&";}else{if(E=="profile"){A="/home.asp?";}else{return;}}if(D){var B=gadgets.json.stringify(D);if(B){A+="view-params="+encodeURIComponent(B);}}window.location=A;}gadgets.rpc.register("requestNavigateTo",rpc_requestNavigateTo);function rpc_requestShareApp(recipients,message,opt_params){var settings=perfUI.gadgets.installedApps[this.f];var titleObj=document.getElementById(this.f+"_title");if(titleObj){var holder=document.createElement("DIV");with(holder.style){position="absolute";}titleObj.parentNode.parentNode.appendChild(holder);var popup=new perfUI.widgets.requestShareApp(settings.viewer,holder,settings.token,this.f,message);popup.render();popup.setCaption("Tell your friends about "+titleObj.innerHTML);popup.load();popup.show();}else{window.gadgets.rpc.call(this.f,"requestShareApp_callback",null,"internalError","Could not draw the requestShareApp popup");}}gadgets.rpc.register("requestShareApp",rpc_requestShareApp);function rpc_resizeIframe(A){if(++A>maxAppHeight){A=maxAppHeight;}var B=document.getElementById(this.f);if(B){B.style.height=A+"px";}}gadgets.rpc.register("resize_iframe",rpc_resizeIframe);function rpc_setTitle(B){var A=document.getElementById(this.f+"_title");if(A){A.innerHTML=B.replace(/&/g,"&amp;").replace(/</g,"&lt;");}}gadgets.rpc.register("set_title",rpc_setTitle);function _rpcSetPref(){var B=perfUI.gadgets.installedApps[this.f].token;var A=[];for(var C=1;C<arguments.length;C+=2){A.push('"'+cleanText(arguments[C])+'":"'+cleanText(arguments[C+1])+'"');}YAHOO.util.Connect.asyncRequest("POST","/opensocial/setprefs.asp",{},"st="+B+"&up={"+A.join(",")+"}");}gadgets.rpc.register("set_pref",_rpcSetPref);function _rpcRequestPermission(){window.gadgets.rpc.call(this.f,"requestPermissionCallback");}gadgets.rpc.register("requestPermission",_rpcRequestPermission);function cleanTextObject(){var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.*()!~'";function A(I){var H,G,F="",E=0;while(E<I.length){H=I.charCodeAt(E++);if(H>=56320&&H<57344){continue;}if(H>=55296&&H<56320){if(E>=I[ta_]){continue;}G=I.charCodeAt(E++);if(G<56320||H>=56832){continue;}H=(H-55296<<10)+(G-56320)+65536;}F+=H<128?String.fromCharCode(H):(H<2048?String.fromCharCode(192+(H>>6),128+(H&63)):(H<65536?String.fromCharCode(224+(H>>12),128+(H>>6&63),128+(H&63)):String.fromCharCode(240+(H>>18),128+(H>>12&63),128+(H>>6&63),128+(H&63))));}return F;}var D="0123456789ABCDEF";function C(E){return D.charAt(E>>4)+D.charAt(E&15);}return function(I){if(!I||I==""){return I;}try{return ta_ba(I);}catch(H){var G=A(I),F="";for(var E=0;E<G.length;E++){F+=B.indexOf(G.charAt(E))==-1?"%"+C(G.charCodeAt(E)):G.charAt(E);}return F;}};}var cleanText=cleanTextObject();perfUI.gadgets.installedApps={};perfUI.gadgets.gadget=function(){this.parent=null;this.id=null;this.title=null;this.url=null;this.view=null;this.viewer=null;this.owner=null;this.token=null;this.nocache=false;this.width=300;this.height=300;this.language="en";this.country="US";this.headerBackgroundColor="#80929F";this.headerFontColor="#FFFFFF";this.contentBackgroundColor="#FFFFFF";this.redLink="http://www.perfspot.com";this.privatePage=-1;this.dropdown=new perfUI.gadgets.gadgetDropDown(this);};perfUI.gadgets.gadget.prototype.loadSettings=function(E,H,G,C,B,F,A,D){this.parent=E;this.id=H;this.title=G;this.url=C;this.view=B;this.viewer=F;this.owner=A;this.token=D;};perfUI.gadgets.gadget.prototype.loadSkin=function(){};perfUI.gadgets.gadget.prototype.render=function(){var name="remote_iframe_"+this.id;var thisApp={url:this.url,id:this.id,name:this.name,viewer:this.viewer,owner:this.owner,token:this.token,title:this.title};perfUI.gadgets.installedApps[name]=thisApp;gadgets.rpc.setRelayUrl(name,(window.location.host=="www.perfspot.com"?"http://api.perfspot.com":"")+"/opensocial/rpc_relay.html");if(this.width>150){this.width=this.width+"px";}else{this.width="150px";}var mainDIV=document.createElement("DIV");with(mainDIV.style){border="1px solid #BFC8CF";}mainDIV.style.width=this.width;var domain=window.location.protocol+"//"+window.location.host;var iframe;try{iframe=document.createElement("<IFRAME name='"+name+"'>");}catch(err){iframe=document.createElement("IFRAME");}iframe.src=(window.location.host=="www.perfspot.com"?"http://api.perfspot.com":"")+"/opensocial/opensocial.asp?url="+this.url;iframe.src+="&view="+this.view;iframe.src+=(this.nocache?"&nocache=1":"");iframe.src+="&parent="+domain;iframe.src+="&appId="+this.id;iframe.src+="&synd=perfspot";iframe.src+="&lang="+this.language;iframe.src+="&country="+this.country;iframe.src+="&mid=0";iframe.src+="&st="+this.token;iframe.src+="&b=1";iframe.src+="#";iframe.src+="&gadgetViewer="+this.viewer;iframe.src+="&gadgetOwner="+this.owner;iframe.src+="&gadgetId="+this.id;var viewParams=(new String(window.location)).split("&view-params=");if(viewParams[1]){iframe.src+="&view-params="+viewParams[1].split("&",1)[0].split("?",1)[0].split("#",1)[0];}iframe.id=name=iframe.name=name;iframe.frameBorder="0";with(iframe.style){height=this.height+"px";width="100%";display="block";backgroundColor=this.contentBackgroundColor;}var topDIV=document.createElement("DIV");with(topDIV.style){backgroundColor=this.headerBackgroundColor;}topDIV.className="gadgetTopBar";var leftSpan=document.createElement("SPAN");with(leftSpan.style){textIndent="10px";cssFloat="left";styleFloat="left";}var a=document.createElement("A");a.href="/apps/canvas.asp?i="+this.owner+"&id="+this.id;a.id=name+"_title";a.innerHTML=this.title;with(a.style){fontSize="10pt";color=this.headerFontColor;}leftSpan.appendChild(a);topDIV.appendChild(leftSpan);var rightDIV=document.createElement("DIV");with(rightDIV.style){cssFloat="right";styleFloat="right";paddingRight="10px";}topDIV.appendChild(rightDIV);this.dropdown.render(rightDIV);mainDIV.appendChild(topDIV);mainDIV.appendChild(iframe);if(typeof(this.parent)=="string"){this.parent=document.getElementById(this.parent);}else{if(this.parent==null){var time=new Date().getTime();document.write("<DIV id='"+time+"'></DIV>");this.parent=document.getElementById(time);}}this.parent.appendChild(mainDIV);};perfUI.gadgets.gadgetDropDown=function(A){this.parentGadget=A;};perfUI.gadgets.gadgetDropDown.onmouseout=function(B,A,D){var C=D||this.appID;perfUI.gadgets.gadgetDropDown.stopTimer=false;setTimeout("perfUI.gadgets.gadgetDropDown.timer('"+C+"')",1500);};perfUI.gadgets.gadgetDropDown.stopTimer=false;perfUI.gadgets.gadgetDropDown.DOM=[];perfUI.gadgets.gadgetDropDown.timer=function(B){if(!perfUI.gadgets.gadgetDropDown.stopTimer){var A=perfUI.gadgets.gadgetDropDown.DOM[B];if(A.parentNode){if(A.nextSibling){A.parentNode.removeChild(A.nextSibling);}A.parentNode.removeChild(A);delete A;}}};perfUI.gadgets.gadgetDropDown.prototype.render=function(parent){var parentGadget=this.parentGadget;var s=new perfUI.widgets.splitButton(parent);var div=document.createElement("DIV");div.style.cursor="pointer";div.style.position="relative";div.style.color=this.parentGadget.headerFontColor;div.className="";div.innerHTML=perfTranslator.getValue(1239)+"...";div.onmouseout=perfUI.gadgets.gadgetDropDown.onmouseout;div.appID=this.parentGadget.id;parent.appendChild(div);s.setEl(div);var oMenu=s.getMenu();var menuItems=[];var editInstallText=(this.parentGadget.owner==this.parentGadget.viewer?perfTranslator.getValue(784):perfTranslator.getValue(2606));menuItems.push({text:editInstallText,className:"gadgetDropDownRow gadgetDropDownRow_EditInstall",onclick:{fn:function(){window.location.href="/apps/app.asp?id="+this.data.appID;},obj:null,scope:false}});menuItems.push({text:perfTranslator.getValue(2609),className:"gadgetDropDownRow gadgetDropDownRow_Rating",onclick:{fn:perfUI.gadgets.gadgetRaterLauncher,obj:null,scope:false}});if(this.parentGadget.owner==this.parentGadget.viewer&&this.parentGadget.privatePage!=-1){menuItems.push({text:perfTranslator.getValue(307),className:"gadgetDropDownRow gadgetDropDownRow_Uninstall",onclick:{fn:perfUI.gadgets.removeGadget,obj:this.parentGadget,scope:false}});}var Element=oMenu.getElement();perfUI.gadgets.gadgetDropDown.DOM[this.parentGadget.id]=Element;Element.appID=this.parentGadget.id;Element.onmouseover=function(){perfUI.gadgets.gadgetDropDown.stopTimer=true;};Element.onmouseout=perfUI.gadgets.gadgetDropDown.onmouseout;oMenu.onDocumentClick=null;oMenu.drawMenu=function(){var hold=this.getElement();hold.className="gadgetDropDown";for(var i=0;i<menuItems.length;i++){var obj=perfUI.util.addEl(hold,"DIV",{"noWrap":true,"style":"white-space:nowrap","onmouseover":this.itemMouseOver,"onmouseout":this.itemMouseOut,"className":menuItems[i].className||"","innerHTML":menuItems[i].text,"data":{"appID":parentGadget.id,"viewerID":parentGadget.viewer,"redLink":parentGadget.redLink}});if(menuItems[i].onclick){YAHOO.util.Event.addListener(obj,"click",menuItems[i].onclick.fn,menuItems[i].onclick.obj,menuItems[i].onclick.scope);}}document.body.appendChild(this.getElement());};oMenu.itemMouseOver=function(){this.style.color="#222222";};oMenu.itemMouseOut=function(){this.style.color="#666666";};oMenu.adjustCoordinates=function(){var Dom=YAHOO.util.Dom;var e=this.getElement();var cont=this.getContainer();var region=Dom.getRegion(cont);var topV=(region.top+(document.all?18:20));var leftV=(region.right-e.offsetWidth-(document.all?3:1));with(e.style){top=topV+"px";left=leftV+"px";width=e.offsetWidth+"px";}var iframe=perfUI.util.addEl(e.parentNode,"IFRAME",{"frameborder":"0","style":"position:absolute;border-width:0px;z-index:1;height:"+e.offsetHeight+"px;width:"+e.offsetWidth+"px;left:"+leftV+"px;top:"+topV+"px"});};s.render();YAHOO.util.Event.removeListener(div,"click");YAHOO.util.Event.addListener(div,"mouseover",function(a,b){if(!b.getElement().parentNode||!b.getElement().parentNode.parentNode){b.show(a);}YAHOO.util.Event.removeListener(document,"click",this.closeMenu);},oMenu,true);YAHOO.util.Event.addListener(div,"mouseover",function(){perfUI.gadgets.gadgetDropDown.stopTimer=true;},null,true);};perfUI.gadgets.removeGadget=function(B,A){if(A.parent){A.parent.parentNode.removeChild(A.parent);}YAHOO.util.Connect.asyncRequest("GET","/api/call.asp?function=Apps.RemoveApp&userid="+A.viewer+"&private="+A.privatePage+"&appid="+A.id,{cache:false});};perfUI.gadgets.gadgetRaterLauncher=function(){if(this.data.viewerID==0){window.location.href=this.data.redLink;return;}var B=document.createElement("DIV");B.className="gadgetDropDownRow_sel";B.onmouseover=function(){this.className="gadgetDropDownRow_sel";};B.onmouseout=function(){this.className="gadgetDropDownRow";};this.parentNode.style.width=(this.parentNode.clientWidth+(document.all?2:0))+"px";var A=new perfUI.gadgets.gadgetRater(B,this.data.appID,this.data.viewerID);A.render();this.style.display="none";this.parentNode.insertBefore(B,this.nextSibling);};perfUI.gadgets.gadgetRater=function(B,C,A){this.parent=B;this.appID=C;this.userID=A;this.numStars=5;this.currentRating=0;};perfUI.gadgets.gadgetRater.prototype.render=function(){for(var A=0;A<this.numStars;A++){var B=document.createElement("SPAN");B.number=A+1;B.data={"appID":this.appID,"userID":this.userID};B.defaultSel=((A+1)>this.currentRating?false:true);B.className="gadgetRatingStar"+(B.defaultSel?"_sel":"");B.onmouseover=perfUI.gadgets.gadgetRater.onmouseover;B.onmouseout=perfUI.gadgets.gadgetRater.onmouseout;B.onclick=perfUI.gadgets.gadgetRater.onclick;this.parent.appendChild(B);}};perfUI.gadgets.gadgetRater.onmouseover=function(){var A=this.parentNode.childNodes;var C=false;for(var B=0;B<A.length;B++){A[B].className="gadgetRatingStar"+(C?"":"_sel");if(!C&&A[B]==this){C=true;}}};perfUI.gadgets.gadgetRater.onmouseout=function(){var A=this.parentNode.childNodes;for(var B=0;B<A.length;B++){A[B].className="gadgetRatingStar"+(A[B].defaultSel?"_sel":"");}};perfUI.gadgets.gadgetRater.onclick=function(){var parent=this.parentNode;with(parent.previousSibling){innerHTML=perfTranslator.getValue(2625);style.display="block";}YAHOO.util.Event.removeListener(parent.previousSibling,"click");YAHOO.util.Connect.asyncRequest("GET","/api/call.asp?function=Apps.RateApp&userid="+this.data.userID+"&appid="+this.data.appID+"&rate="+this.number,{cache:false});parent.parentNode.removeChild(parent);};perfUI.widgets.requestShareApp=function(A,B,C,E,D){perfUI.widgets.requestShareApp.superclass.constructor.call(this,A,A,B);this.message=D;this.rsa_token=C;this.rsa_iframeID=E;this.submitted=false;this.onHideEvent.subscribe(function(){if(!this.submitted){window.gadgets.rpc.call(this.rsa_iframeID,"requestShareApp_callback",null,"cancelled","User cancelled requestShareApp");}},this);};if(perfUI.widgets.suggestFriends){YAHOO.extend(perfUI.widgets.requestShareApp,perfUI.widgets.suggestFriends);}perfUI.widgets.requestShareApp.prototype.submitSend=function(){var E=this.getSuggestIdQueryString();if(E.trim().length==0){alert("Please select at least one friend from the list to share this application with.");return;}var C=function(G){alert("Error occured while sending request, please try again.");};var A=function(L){var H,K,J=L.responseXML;try{var G=J.getElementsByTagName("errorCode")[0].childNodes;H=(G[0]?G[0].nodeValue:null);var G=J.getElementsByTagName("errorMessage")[0].childNodes;K=(G[0]?G[0].nodeValue:null);}catch(I){H="internalError";K="Server returned invalid XML response";}window.gadgets.rpc.call(this.rsa_iframeID,"requestShareApp_callback",null,H,K,this.getSelectedUsers());this.submitted=true;this.hide();};var F={success:A,failure:C,scope:this,cache:false};var B="/opensocial/rpc.asp";var D="action=rsa&st="+this.rsa_token+E+"&message="+escape(this.message);YAHOO.util.Connect.asyncRequest("POST",B,F,D);};perfUI.widgets.requestShareApp.prototype.getSelectedUsers=function(){var C=[];var B=this.selectedUsers;for(var A=0;A<B.length;A++){C.push({"userId":B[A].user.userId,"displayName":B[A].user.displayName});}return C;};perfUI.widgets.requestFriend=function(B,D,A,E,F,C){if(typeof A=="string"){A=document.getElementById(A);}else{if(A==null){A=perfUI.util.addEl(document.body,"DIV",{"class":"yui-skin-sam"});}}A=perfUI.util.addEl(A,"DIV",{"class":"RFpopup"});perfUI.widgets.requestFriend.superclass.constructor.call(this,A,475);this.userId=D||0;this.watchedId=B||0;this.dontPreload=F||0;this.re=E||0;this.showMutual=C||0;this.textarea=null;this.leftButton=null;this.rightButton=null;this.rightDIV=null;this.onFailEvent=new YAHOO.util.CustomEvent("onFailEvent",this);this.onSuccessEvent=new YAHOO.util.CustomEvent("onSuccessEvent",this);this.xmlData={redLink:null,autoFriends:null,status:null,statusDesc:null,statusHtml1:"",statusHtml2:"",statusHtml3:"",user:{userId:null,userCode:null,thumbUrl:null,displayName:null,online:null}};this.xmlParsed=false;this.onXMLParsed=new YAHOO.util.CustomEvent("onXMLParsed");this.onXMLParsed.subscribe(function(){this.xmlParsed=true;},this,true);this.rendered=false;this.onRendered=new YAHOO.util.CustomEvent("onRendered");this.onRendered.subscribe(function(){this.rendered=true;},this,true);if(!this.dontPreload){this.getRequestXML();}};YAHOO.extend(perfUI.widgets.requestFriend,perfUI.widgets.panel);perfUI.widgets.requestFriend.quickPopup=function(A,C,D){var B=new perfUI.widgets.requestFriend(A,C,null,D);B.render();B.show();};perfUI.widgets.requestFriend.prototype.getRequestXML=function(){var A={success:this.getRequestXMLSuccess,failure:this.getRequestXMLFailure,scope:this,cache:false};YAHOO.util.Connect.asyncRequest("GET","/api/call.asp?function=Members.FriendRequest&WatchedID="+this.watchedId+"&userId="+this.userId+(this.showMutual?"&m=1":""),A,null);};perfUI.widgets.requestFriend.prototype.getRequestXMLSuccess=function(B){var A=perfUI.util.getNode;var J=B.responseXML;try{var I;if(I=A(J,"error")[0]){this.xmlData.status="101";this.xmlData.statusHtml1="<b>ERROR</b>: "+I.childNodes[0].nodeValue;}else{var K,H,G,F;if(K=A(J,"redLink")[0].childNodes[0]){this.xmlData.redLink=K.nodeValue;}if(this.xmlData.redLink!=null){document.location.href=this.xmlData.redLink;return;}this.xmlData.autoFriends=A(J,"autoFriends")[0].childNodes[0].nodeValue;this.xmlData.status=A(J,"status")[0].childNodes[0].nodeValue;this.xmlData.statusDesc=A(J,"statusDesc")[0].childNodes[0].nodeValue;if(H=A(J,"statusHtml1")[0].childNodes[0]){this.xmlData.statusHtml1=H.nodeValue;}if(H=A(J,"statusHtml2")[0].childNodes[0]){this.xmlData.statusHtml2=H.nodeValue;}if(H=A(J,"statusHtml3")[0].childNodes[0]){this.xmlData.statusHtml3=H.nodeValue;}var C=A(J,"user")[0];this.xmlData.user.userId=A(C,"userId")[0].childNodes[0].nodeValue;this.xmlData.user.userCode=A(C,"userCode")[0].childNodes[0].nodeValue;this.xmlData.user.thumbUrl=A(C,"thumbUrl")[0].childNodes[0].nodeValue;this.xmlData.user.displayName=A(C,"displayName")[0].childNodes[0].nodeValue;this.xmlData.user.online=A(C,"online")[0].childNodes[0].nodeValue;var E;if(E=A(C,"mutualFriends")[0]){this.xmlData.user.mutualFriends=parseInt(E.childNodes[0].nodeValue);}}}catch(D){this.xmlData.status="102";this.xmlData.statusHtml1="<b>ERROR</b>: Unable to process request";}this.onXMLParsed.fire();};perfUI.widgets.requestFriend.prototype.getRequestXMLFailure=function(){this.xmlData.status="103";this.xmlData.statusHtml1="<b>ERROR</b>: Unable to process request";this.onXMLParsed.fire();};perfUI.widgets.requestFriend.prototype.render=function(){if(this.dontPreload){this.getRequestXML();this.onXMLParsed.subscribe(this.renderPopup,this,true);}else{if(!this.xmlParsed){this.onXMLParsed.subscribe(this.renderPopup,this,true);}else{this.renderPeople();}}};perfUI.widgets.requestFriend.prototype.renderPopup=function(){var F=document.createElement("DIV");F.className="hd bgltblue";var G=perfUI.util.addEl(F,"DIV");var B=G.c("DIV",{"class":"PH_headerMenu_img PH_headerMenu_img_inviteFriends"});var M=G.c("H2",{"class":"txtdkblue left","innerHTML":perfTranslator.getValue(569)});this.setHeader(F);var C=this.destroyFailure;var H=document.createElement("DIV");H.className="bd";if(parseInt(this.xmlData.status)<100){var D=perfUI.util.addEl(H,"DIV",{"class":"left rfProfile"});var A=D.addChild("A",{"href":"/profile.asp?uid="+this.xmlData.user.userCode,"target":"_BLANK"});A.addChild("DIV",{"class":"rfProfileName","innerHTML":this.xmlData.user.displayName});A.addChild("IMG",{"class":"rfProfileImage","src":this.xmlData.user.thumbUrl});if(this.xmlData.user.online=="true"){var E=D.addChild("DIV",{"class":"onlineNow"});E.addChild("IMG",{"src":"/images/v2/online.gif","height":"8","width":"9"});E.addChild("SPAN",{"class":"txtorange","innerHTML":perfTranslator.getValue(1882)});}}this.rightDIV=perfUI.util.addEl(H,"DIV",{"class":"left rfMessage"});if(parseInt(this.xmlData.status)!=0){if(parseInt(this.xmlData.status)==2||parseInt(this.xmlData.status)==3){C=this.destroySuccess;}this.rightDIV.addChild("DIV",{"class":"statusHtml1","innerHTML":this.xmlData.statusHtml1});this.rightDIV.addChild("DIV",{"class":"statusHtml2","innerHTML":this.xmlData.statusHtml2});this.rightDIV.addChild("DIV",{"class":"statusHtml3","innerHTML":this.xmlData.statusHtml3});}if(parseInt(this.xmlData.status)==0||parseInt(this.xmlData.status)==4){this.rightDIV.addChild("DIV",{"class":"rfMessageTitle","innerHTML":perfTranslator.parseValue(perfTranslator.getValue(702),["<b>"+this.xmlData.user.displayName+"</b>"])+"<br><br><b>"+perfTranslator.getValue(699)+":</b>"});this.textarea=this.rightDIV.addChild("TEXTAREA",{"class":"rfMessageTA","src":this.xmlData.user.thumbUrl});this.mutualFriends=this.rightDIV.addChild("DIV",{"class":"rfMutualFriends"});if(this.showMutual&&this.xmlData.user.mutualFriends){this.drawMutualFriends();}if(this.xmlData.autoFriends=="True"){this.onRendered.subscribe(this.sendRequest,this,true);}}this.setBody(H);var J=document.createElement("DIV");J.className="ft buttonStyle1";var L=perfUI.util.addEl(J,"DIV",{"class":"buttonbox right"});var K=L.c("SPAN",{"class":"submit"});if(parseInt(this.xmlData.status)==0||parseInt(this.xmlData.status)==4){this.leftButton=new YAHOO.widget.Button({label:perfTranslator.getValue(759),onclick:{fn:this.sendRequest,obj:null,scope:this},container:K});}var I=L.c("SPAN",{"class":"cancel"});this.rightButton=new YAHOO.widget.Button({label:perfTranslator.getValue(701),onclick:{fn:C,obj:null,scope:this},container:I});this.setFooter(J);perfUI.widgets.requestFriend.superclass.render.call(this);this.onRendered.fire();};perfUI.widgets.requestFriend.prototype.drawMutualFriends=function(){var A=this.mutualFriends.addChild("A",{"class":"rfMutualFriendsTXT","innerHTML":perfTranslator.getValue(1661)+": "+this.xmlData.user.mutualFriends,"href":"javascript:void(0)"});var B=this.mutualFriends.addChild("DIV");B.setAttribute("drawn",0);B.setAttribute("showing",0);YAHOO.util.Event.addListener(A,"click",function(){var C=this.mutualFriends.childNodes[1];if(C.getAttribute("drawn")=="0"){var D=new perfUI.dashboard.mutualFriendList(this.userId,this.xmlData.user.userId,null,B);D.pager.PageSize=4;D.allowCaption=false;D.load();C.setAttribute("drawn",1);C.setAttribute("showing",1);}else{if(C.getAttribute("showing")=="0"){C.style.display="block";C.setAttribute("showing",1);}else{C.style.display="none";C.setAttribute("showing",0);}}},this,true);};perfUI.widgets.requestFriend.prototype.show=function(){if(this.rendered){this.showPopup();}else{this.onRendered.subscribe(this.showPopup,this,true);}};perfUI.widgets.requestFriend.prototype.showPopup=function(){perfUI.widgets.requestFriend.superclass.show.call(this);this.center();};perfUI.widgets.requestFriend.prototype.showLoading=function(){this.cleanRightDIV();this.textarea.disabled=true;this.textarea.className="rfloading";this.hideButtons();};perfUI.widgets.requestFriend.prototype.hideLoading=function(A){this.cleanRightDIV();this.textarea.disabled=false;this.textarea.className="rfMessageTA";this.showButtons();};perfUI.widgets.requestFriend.prototype.hideButtons=function(){this.getFooter().childNodes[0].style.visibility="hidden";};perfUI.widgets.requestFriend.prototype.showButtons=function(){this.getFooter().childNodes[0].style.visibility="visible";};perfUI.widgets.requestFriend.prototype.sendRequest=function(){this.showLoading();this.sendRequestXML(escape(this.textarea.value));};perfUI.widgets.requestFriend.prototype.sendRequestXML=function(A){A=A||"";var B={success:this.submitRequestXMLSuccess,failure:this.submitRequestXMLFailure,scope:this,cache:false};YAHOO.util.Connect.asyncRequest("GET","/api/call.asp?function=Members.FriendRequestSend&WatchedID="+this.watchedId+"&UserID="+this.userId+"&m="+A+"&re="+this.re,B,null);};perfUI.widgets.requestFriend.prototype.submitRequestXMLSuccess=function(A){var E=A.responseXML;try{var B;if(B=perfUI.util.getNode(E,"error")[0]){this.submitError("Error, "+B.childNodes[0].nodeValue);return;}var D=perfUI.util.getNode(E,"success")[0].childNodes[0].nodeValue;}catch(C){this.submitError("Error submitting friend request, please try again");return;}if(D=="true"){this.drawSuccessMessage();}else{this.submitError("Error submitting friend request, please try again");return;}};perfUI.widgets.requestFriend.prototype.drawSuccessMessage=function(){this.rightDIV.innerHTML="";if(this.xmlData.autoFriends=="True"){var B=this.rightDIV.addChild("DIV",{"class":"successAutoFriend"});B.addChild("DIV",{"class":"PH_headerMenu_img PH_headerMenu_img_incomingFriendRequest"});B.addChild("DIV",{"class":"RFsuccessline1","innerHTML":perfTranslator.getValue(2632)});B.addChild("DIV",{"class":"RFsuccessline2 txtorange","innerHTML":"<b>"+perfTranslator.getValue(1856)+"</b>: "+perfTranslator.parseValue(perfTranslator.getValue(2685),[this.xmlData.user.displayName])});if(this.showMutual&&this.xmlData.user.mutualFriends){this.mutualFriends=B.addChild("DIV",{"class":"rfMutualFriends"});this.drawMutualFriends();}}else{var B=this.rightDIV.addChild("DIV",{"class":"successRequestFriend"});B.addChild("DIV",{"class":"PH_headerMenu_img PH_headerMenu_img_friends"});B.addChild("DIV",{"class":"RFsuccessline1","innerHTML":perfTranslator.getValue(1647)});}this.rightButton.destroy();var A={fn:this.destroySuccess,obj:null,scope:this};this.leftButton.setAttributes({"onclick":A,"label":perfTranslator.getValue(1729)});this.showButtons();};perfUI.widgets.requestFriend.prototype.submitRequestXMLFailure=function(){this.submitError("Error submitting friend request, please try again");};perfUI.widgets.requestFriend.prototype.cleanRightDIV=function(){if(this.rightDIV.childNodes.length>=5){for(var A=0;A<3;A++){this.rightDIV.removeChild(this.rightDIV.childNodes[0]);}}for(var A=0;A<this.rightDIV.childNodes.length-3;A++){this.rightDIV.removeChild(this.rightDIV.childNodes[3]);}};perfUI.widgets.requestFriend.prototype.submitError=function(A){this.hideLoading();this.rightDIV.addChild("DIV",{"class":"submitError","innerHTML":A});};perfUI.widgets.requestFriend.prototype.destroySuccess=function(){this.onSuccessEvent.fire();this.destroy();};perfUI.widgets.requestFriend.prototype.destroyFailure=function(){this.onFailEvent.fire();this.destroy();};perfUI.widgets.requestFriend.prototype.destroy=function(){perfUI.widgets.requestFriend.superclass.hide.call(this);var B;if(B=this.getMask()){B.destroy();}var A=this.container;if(A&&A.parentNode&&A.parentNode.parentNode){A.parentNode.parentNode.removeChild(A.parentNode);}for(i in this){if(typeof this[i]=="function"){this[i]=null;delete this[i];}else{delete this[i];}}YAHOO.util.Event.removeListener(window,"resize",this.center);};if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var B=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(H,I){for(var G in this.ids){for(var J in this.ids[G]){var A=this.ids[G][J];if(!this.isTypeOfDD(A)){continue;}A[H].apply(A,I);}}},_onLoad:function(){this.init();B.on(document,"mouseup",this.handleMouseUp,this,true);B.on(document,"mousemove",this.handleMouseMove,this,true);B.on(window,"unload",this._onUnload,this,true);B.on(window,"resize",this._onResize,this,true);},_onResize:function(A){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(A,D){if(!this.initialized){this.init();}if(!this.ids[D]){this.ids[D]={};}this.ids[D][A.id]=A;},removeDDFromGroup:function(A,F){if(!this.ids[F]){this.ids[F]={};}var E=this.ids[F];if(E&&E[A.id]){delete E[A.id];}},_remove:function(A){for(var D in A.groups){if(D&&this.ids[D][A.id]){delete this.ids[D][A.id];}}delete this.handleIds[A.id];},regHandle:function(A,D){if(!this.handleIds[A]){this.handleIds[A]={};}this.handleIds[A][D]=D;},isDragDrop:function(A){return(this.getDDById(A))?true:false;},getRelated:function(A,K){var H=[];for(var I in A.groups){for(var J in this.ids[I]){var L=this.ids[I][J];if(!this.isTypeOfDD(L)){continue;}if(!K||L.isTarget){H[H.length]=L;}}}return H;},isLegalTarget:function(A,G){var I=this.getRelated(A,true);for(var H=0,J=I.length;H<J;++H){if(I[H].id==G.id){return true;}}return false;},isTypeOfDD:function(A){return(A&&A.__ygDragDrop);},isHandle:function(A,D){return(this.handleIds[A]&&this.handleIds[A][D]);},getDDById:function(A){for(var D in this.ids){if(this.ids[D][A]){return this.ids[D][A];}}return null;},handleMouseDown:function(A,E){this.currentTarget=YAHOO.util.Event.getTarget(A);this.dragCurrent=E;var F=E.getEl();this.startX=YAHOO.util.Event.getPageX(A);this.startY=YAHOO.util.Event.getPageY(A);this.deltaX=this.startX-F.offsetLeft;this.deltaY=this.startY-F.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var C=YAHOO.util.DDM;C.startDrag(C.startX,C.startY);C.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(F,A){clearTimeout(this.clickTimeout);var E=this.dragCurrent;if(E&&E.events.b4StartDrag){E.b4StartDrag(F,A);E.fireEvent("b4StartDragEvent",{x:F,y:A});}if(E&&E.events.startDrag){E.startDrag(F,A);E.fireEvent("startDragEvent",{x:F,y:A});}this.dragThreshMet=true;},handleMouseUp:function(A){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(A);}this.fromTimeout=false;this.fireEvents(A,true);}else{}this.stopDrag(A);this.stopEvent(A);}},stopEvent:function(A){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(A);}if(this.preventDefault){YAHOO.util.Event.preventDefault(A);}},stopDrag:function(A,E){var F=this.dragCurrent;if(F&&!E){if(this.dragThreshMet){if(F.events.b4EndDrag){F.b4EndDrag(A);F.fireEvent("b4EndDragEvent",{e:A});}if(F.events.endDrag){F.endDrag(A);F.fireEvent("endDragEvent",{e:A});}}if(F.events.mouseUp){F.onMouseUp(A);F.fireEvent("mouseUpEvent",{e:A});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(A){var H=this.dragCurrent;if(H){if(YAHOO.util.Event.isIE&&!A.button){this.stopEvent(A);return this.handleMouseUp(A);}else{if(A.clientX<0||A.clientY<0){}}if(!this.dragThreshMet){var F=Math.abs(this.startX-YAHOO.util.Event.getPageX(A));var G=Math.abs(this.startY-YAHOO.util.Event.getPageY(A));if(F>this.clickPixelThresh||G>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(H&&H.events.b4Drag){H.b4Drag(A);H.fireEvent("b4DragEvent",{e:A});}if(H&&H.events.drag){H.onDrag(A);H.fireEvent("dragEvent",{e:A});}if(H){this.fireEvents(A,false);}}this.stopEvent(A);}},fireEvents:function(g,q){var A=this.dragCurrent;if(!A||A.isLocked()||A.dragOnly){return;}var o=YAHOO.util.Event.getPageX(g),p=YAHOO.util.Event.getPageY(g),m=new YAHOO.util.Point(o,p),r=A.getTargetCoord(m.x,m.y),w=A.getDragEl(),x=["out","over","drop","enter"],h=new YAHOO.util.Region(r.y,r.x+w.offsetWidth,r.y+w.offsetHeight,r.x),t=[],y={},l=[],AB={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var j in this.dragOvers){var AA=this.dragOvers[j];if(!this.isTypeOfDD(AA)){continue;}if(!this.isOverTarget(m,AA,this.mode,h)){AB.outEvts.push(AA);}t[j]=true;delete this.dragOvers[j];}for(var k in A.groups){if("string"!=typeof k){continue;}for(j in this.ids[k]){var v=this.ids[k][j];if(!this.isTypeOfDD(v)){continue;}if(v.isTarget&&!v.isLocked()&&v!=A){if(this.isOverTarget(m,v,this.mode,h)){y[k]=true;if(q){AB.dropEvts.push(v);}else{if(!t[v.id]){AB.enterEvts.push(v);}else{AB.overEvts.push(v);}this.dragOvers[v.id]=v;}}}}}this.interactionInfo={out:AB.outEvts,enter:AB.enterEvts,over:AB.overEvts,drop:AB.dropEvts,point:m,draggedRegion:h,sourceRegion:this.locationCache[A.id],validDrop:q};for(var z in y){l.push(z);}if(q&&!AB.dropEvts.length){this.interactionInfo.validDrop=false;if(A.events.invalidDrop){A.onInvalidDrop(g);A.fireEvent("invalidDropEvent",{e:g});}}for(j=0;j<x.length;j++){var d=null;if(AB[x[j]+"Evts"]){d=AB[x[j]+"Evts"];}if(d&&d.length){var u=x[j].charAt(0).toUpperCase()+x[j].substr(1),e="onDrag"+u,s="b4Drag"+u,n="drag"+u+"Event",f="drag"+u;if(this.mode){if(A.events[s]){A[s](g,d,l);A.fireEvent(s+"Event",{event:g,info:d,group:l});}if(A.events[f]){A[e](g,d,l);A.fireEvent(n,{event:g,info:d,group:l});}}else{for(var b=0,i=d.length;b<i;++b){if(A.events[s]){A[s](g,d[b].id,l[0]);A.fireEvent(s+"Event",{event:g,info:d[b].id,group:l[0]});}if(A.events[f]){A[e](g,d[b].id,l[0]);A.fireEvent(n,{event:g,info:d[b].id,group:l[0]});}}}}}},getBestMatch:function(H){var A=null;var I=H.length;if(I==1){A=H[0];}else{for(var G=0;G<I;++G){var J=H[G];if(this.mode==this.INTERSECT&&J.cursorIsOver){A=J;break;}else{if(!A||!A.overlap||(J.overlap&&A.overlap.getArea()<J.overlap.getArea())){A=J;}}}}return A;},refreshCache:function(K){var I=K||this.ids;for(var L in I){if("string"!=typeof L){continue;}for(var J in this.ids[L]){var H=this.ids[L][J];if(this.isTypeOfDD(H)){var A=this.getLocation(H);if(A){this.locationCache[H.id]=A;}else{delete this.locationCache[H.id];}}}}},verifyEl:function(E){try{if(E){var F=E.offsetParent;if(F){return true;}}}catch(A){}return false;},getLocation:function(V){if(!this.isTypeOfDD(V)){return null;}var X=V.getEl(),S,A,N,Q,R,P,O,T,W;try{S=YAHOO.util.Dom.getXY(X);}catch(U){}if(!S){return null;}A=S[0];N=A+X.offsetWidth;Q=S[1];R=Q+X.offsetHeight;P=Q-V.padding[0];O=N+V.padding[1];T=R+V.padding[2];W=A-V.padding[3];return new YAHOO.util.Region(P,O,T,W);},isOverTarget:function(M,L,A,R){var Q=this.locationCache[L.id];if(!Q||!this.useCache){Q=this.getLocation(L);this.locationCache[L.id]=Q;}if(!Q){return false;}L.cursorIsOver=Q.contains(M);var N=this.dragCurrent;if(!N||(!A&&!N.constrainX&&!N.constrainY)){return L.cursorIsOver;}L.overlap=null;if(!R){var P=N.getTargetCoord(M.x,M.y);var K=N.getDragEl();R=new YAHOO.util.Region(P.y,P.x+K.offsetWidth,P.y+K.offsetHeight,P.x);}var O=R.intersect(Q);if(O){L.overlap=O;return(A)?true:L.cursorIsOver;}else{return false;}},_onUnload:function(A,D){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(A){var D=this.elementCache[A];if(!D||!D.el){D=this.elementCache[A]=new this.ElementWrapper(YAHOO.util.Dom.get(A));}return D;},getElement:function(A){return YAHOO.util.Dom.get(A);},getCss:function(A){var D=YAHOO.util.Dom.get(A);return(D)?D.style:null;},ElementWrapper:function(A){this.el=A||null;this.id=this.el&&A.id;this.css=this.el&&A.style;},getPosX:function(A){return YAHOO.util.Dom.getX(A);},getPosY:function(A){return YAHOO.util.Dom.getY(A);},swapNode:function(F,H){if(F.swapNode){F.swapNode(H);}else{var A=H.parentNode;var G=H.nextSibling;if(G==F){A.insertBefore(F,H);}else{if(H==F.nextSibling){A.insertBefore(H,F);}else{F.parentNode.replaceChild(H,F);A.insertBefore(F,G);}}}},getScroll:function(){var F,H,A=document.documentElement,G=document.body;if(A&&(A.scrollTop||A.scrollLeft)){F=A.scrollTop;H=A.scrollLeft;}else{if(G){F=G.scrollTop;H=G.scrollLeft;}else{}}return{top:F,left:H};},getStyle:function(A,D){return YAHOO.util.Dom.getStyle(A,D);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(F,A){var E=YAHOO.util.Dom.getXY(A);YAHOO.util.Dom.setXY(F,E);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(A,D){return(A-D);},_timeoutCount:0,_addListeners:function(){var A=YAHOO.util.DDM;if(YAHOO.util.Event&&document){A._onLoad();}else{if(A._timeoutCount>2000){}else{setTimeout(A._addListeners,10);if(document&&document.body){A._timeoutCount+=1;}}}},handleWasClicked:function(F,A){if(this.isHandle(A,F.id)){return true;}else{var E=F.parentNode;while(E){if(this.isHandle(A,E.id)){return true;}else{E=E.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var C=YAHOO.util.Event;var D=YAHOO.util.Dom;YAHOO.util.DragDrop=function(A,F,B){if(A){this.init(A,F,B);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(B,A){},startDrag:function(B,A){},b4Drag:function(A){},onDrag:function(A){},onDragEnter:function(B,A){},b4DragOver:function(A){},onDragOver:function(B,A){},b4DragOut:function(A){},onDragOut:function(B,A){},b4DragDrop:function(A){},onDragDrop:function(B,A){},onInvalidDrop:function(A){},b4EndDrag:function(A){},endDrag:function(A){},b4MouseDown:function(A){},onMouseDown:function(A){},onMouseUp:function(A){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=D.get(this.id);}return this._domRef;},getDragEl:function(){return D.get(this.dragElId);},init:function(A,H,G){this.initTarget(A,H,G);C.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var B in this.events){this.createEvent(B+"Event");}},initTarget:function(A,F,B){this.config=B||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof A!=="string"){this._domRef=A;A=D.generateId(A);}this.id=A;this.addToGroup((F)?F:"default");this.handleElId=A;C.onAvailable(A,this.handleOnAvailable,this,true);this.setDragElId(A);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var A in this.config.events){if(this.config.events[A]===false){this.events[A]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(B,H,A,G){if(!H&&0!==H){this.padding=[B,B,B,B];}else{if(!A&&0!==A){this.padding=[B,H,B,H];}else{this.padding=[B,H,A,G];}}},setInitPosition:function(I,J){var B=this.getEl();if(!this.DDM.verifyEl(B)){if(B&&B.style&&(B.style.display=="none")){}else{}return;}var K=I||0;var L=J||0;var A=D.getXY(B);this.initPageX=A[0]-K;this.initPageY=A[1]-L;this.lastPageX=A[0];this.lastPageY=A[1];this.setStartPosition(A);},setStartPosition:function(A){var B=A||D.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=B[0];this.startPageY=B[1];},addToGroup:function(A){this.groups[A]=true;this.DDM.regDragDrop(this,A);},removeFromGroup:function(A){if(this.groups[A]){delete this.groups[A];}this.DDM.removeDDFromGroup(this,A);},setDragElId:function(A){this.dragElId=A;},setHandleElId:function(A){if(typeof A!=="string"){A=D.generateId(A);}this.handleElId=A;this.DDM.regHandle(this.id,A);},setOuterHandleElId:function(A){if(typeof A!=="string"){A=D.generateId(A);}C.on(A,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(A);this.hasOuterHandles=true;},unreg:function(){C.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(A,B){var K=A.which||A.button;if(this.primaryButtonOnly&&K>1){return;}if(this.isLocked()){return;}var L=this.b4MouseDown(A);if(this.events.b4MouseDown){L=this.fireEvent("b4MouseDownEvent",A);}var J=this.onMouseDown(A);if(this.events.mouseDown){J=this.fireEvent("mouseDownEvent",A);}if((L===false)||(J===false)){return;}this.DDM.refreshCache(this.groups);var I=new YAHOO.util.Point(C.getPageX(A),C.getPageY(A));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(I,this)){}else{if(this.clickValidator(A)){this.setStartPosition();this.DDM.handleMouseDown(A,this);this.DDM.stopEvent(A);}else{}}},clickValidator:function(A){var B=YAHOO.util.Event.getTarget(A);return(this.isValidHandleChild(B)&&(this.id==this.handleElId||this.DDM.handleWasClicked(B,this.id)));},getTargetCoord:function(B,G){var H=B-this.deltaX;var A=G-this.deltaY;if(this.constrainX){if(H<this.minX){H=this.minX;}if(H>this.maxX){H=this.maxX;}}if(this.constrainY){if(A<this.minY){A=this.minY;}if(A>this.maxY){A=this.maxY;}}H=this.getTick(H,this.xTicks);A=this.getTick(A,this.yTicks);return{x:H,y:A};},addInvalidHandleType:function(B){var A=B.toUpperCase();this.invalidHandleTypes[A]=A;},addInvalidHandleId:function(A){if(typeof A!=="string"){A=D.generateId(A);}this.invalidHandleIds[A]=A;},addInvalidHandleClass:function(A){this.invalidHandleClasses.push(A);},removeInvalidHandleType:function(B){var A=B.toUpperCase();delete this.invalidHandleTypes[A];},removeInvalidHandleId:function(A){if(typeof A!=="string"){A=D.generateId(A);}delete this.invalidHandleIds[A];},removeInvalidHandleClass:function(B){for(var A=0,F=this.invalidHandleClasses.length;A<F;++A){if(this.invalidHandleClasses[A]==B){delete this.invalidHandleClasses[A];}}},isValidHandleChild:function(I){var J=true;var A;try{A=I.nodeName.toUpperCase();}catch(B){A=I.nodeName;}J=J&&!this.invalidHandleTypes[A];J=J&&!this.invalidHandleIds[I.id];for(var K=0,L=this.invalidHandleClasses.length;J&&K<L;++K){J=!D.hasClass(I,this.invalidHandleClasses[K]);}return J;},setXTicks:function(A,H){this.xTicks=[];this.xTickSize=H;var B={};for(var G=this.initPageX;G>=this.minX;G=G-H){if(!B[G]){this.xTicks[this.xTicks.length]=G;B[G]=true;}}for(G=this.initPageX;G<=this.maxX;G=G+H){if(!B[G]){this.xTicks[this.xTicks.length]=G;B[G]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(A,H){this.yTicks=[];this.yTickSize=H;var B={};for(var G=this.initPageY;G>=this.minY;G=G-H){if(!B[G]){this.yTicks[this.yTicks.length]=G;B[G]=true;}}for(G=this.initPageY;G<=this.maxY;G=G+H){if(!B[G]){this.yTicks[this.yTicks.length]=G;B[G]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(A,B,F){this.leftConstraint=parseInt(A,10);this.rightConstraint=parseInt(B,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(F){this.setXTicks(this.initPageX,F);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(F,A,B){this.topConstraint=parseInt(F,10);this.bottomConstraint=parseInt(A,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(B){this.setYTicks(this.initPageY,B);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var A=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var B=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(A,B);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(A,K){if(!K){return A;}else{if(K[0]>=A){return K[0];}else{for(var M=0,N=K.length;M<N;++M){var L=M+1;if(K[L]&&K[L]>=A){var B=A-K[M];var J=K[L]-A;return(J>B)?K[M]:K[L];}}return K[K.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(E,D,F){if(E){this.init(E,D,F);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(G,H){var E=G-this.startPageX;var F=H-this.startPageY;this.setDelta(E,F);},setDelta:function(D,C){this.deltaX=D;this.deltaY=C;},setDragElPos:function(E,F){var D=this.getDragEl();this.alignElWithMouse(D,E,F);},alignElWithMouse:function(O,K,L){var M=this.getTargetCoord(K,L);if(!this.deltaSetXY){var J=[M.x,M.y];YAHOO.util.Dom.setXY(O,J);var N=parseInt(YAHOO.util.Dom.getStyle(O,"left"),10);var P=parseInt(YAHOO.util.Dom.getStyle(O,"top"),10);this.deltaSetXY=[N-M.x,P-M.y];}else{YAHOO.util.Dom.setStyle(O,"left",(M.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(O,"top",(M.y+this.deltaSetXY[1])+"px");}this.cachePosition(M.x,M.y);var I=this;setTimeout(function(){I.autoScroll.call(I,M.x,M.y,O.offsetHeight,O.offsetWidth);},0);},cachePosition:function(F,D){if(F){this.lastPageX=F;this.lastPageY=D;}else{var E=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=E[0];this.lastPageY=E[1];}},autoScroll:function(W,X,b,V){if(this.scroll){var U=this.DDM.getClientHeight();var Q=this.DDM.getClientWidth();var S=this.DDM.getScrollTop();var O=this.DDM.getScrollLeft();var Y=b+X;var T=V+W;var Z=(U+S-X-this.deltaY);var a=(Q+O-W-this.deltaX);var P=40;var R=(document.all)?80:30;if(Y>U&&Z<P){window.scrollTo(O,S+R);}if(X<S&&S>0&&X-S<P){window.scrollTo(O,S-R);}if(T>Q&&a<P){window.scrollTo(O+R,S);}if(W<O&&O>0&&W-O<P){window.scrollTo(O-R,S);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(B){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(B),YAHOO.util.Event.getPageY(B));},b4Drag:function(B){this.setDragElPos(YAHOO.util.Event.getPageX(B),YAHOO.util.Event.getPageY(B));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(E,D,F){if(E){this.init(E,D,F);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var N=this,H=document.body;if(!H||!H.firstChild){setTimeout(function(){N.createFrame();},50);return;}var I=this.getDragEl(),K=YAHOO.util.Dom;if(!I){I=document.createElement("div");I.id=this.dragElId;var L=I.style;L.position="absolute";L.visibility="hidden";L.cursor="move";L.border="2px solid #aaa";L.zIndex=999;L.height="25px";L.width="25px";var M=document.createElement("div");K.setStyle(M,"height","100%");K.setStyle(M,"width","100%");K.setStyle(M,"background-color","#ccc");K.setStyle(M,"opacity","0");I.appendChild(M);if(YAHOO.env.ua.ie){var J=document.createElement("iframe");J.setAttribute("src","javascript:");J.setAttribute("scrolling","no");J.setAttribute("frameborder","0");I.insertBefore(J,I.firstChild);K.setStyle(J,"height","100%");K.setStyle(J,"width","100%");K.setStyle(J,"position","absolute");K.setStyle(J,"top","0");K.setStyle(J,"left","0");K.setStyle(J,"opacity","0");K.setStyle(J,"zIndex","-1");K.setStyle(J.nextSibling,"zIndex","2");}H.insertBefore(I,H.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(G,H){var I=this.getEl();var F=this.getDragEl();var J=F.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(J.width,10)/2),Math.round(parseInt(J.height,10)/2));}this.setDragElPos(G,H);YAHOO.util.Dom.setStyle(F,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var O=YAHOO.util.Dom;var L=this.getEl();var K=this.getDragEl();var P=parseInt(O.getStyle(K,"borderTopWidth"),10);var N=parseInt(O.getStyle(K,"borderRightWidth"),10);var Q=parseInt(O.getStyle(K,"borderBottomWidth"),10);var J=parseInt(O.getStyle(K,"borderLeftWidth"),10);if(isNaN(P)){P=0;}if(isNaN(N)){N=0;}if(isNaN(Q)){Q=0;}if(isNaN(J)){J=0;}var R=Math.max(0,L.offsetWidth-N-J);var M=Math.max(0,L.offsetHeight-P-Q);O.setStyle(K,"width",R+"px");O.setStyle(K,"height",M+"px");}},b4MouseDown:function(F){this.setStartPosition();var D=YAHOO.util.Event.getPageX(F);var E=YAHOO.util.Event.getPageY(F);this.autoOffset(D,E);},b4StartDrag:function(C,D){this.showFrame(C,D);},b4EndDrag:function(B){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(F){var G=YAHOO.util.Dom;var H=this.getEl();var E=this.getDragEl();G.setStyle(E,"visibility","");G.setStyle(H,"visibility","hidden");YAHOO.util.DDM.moveToEl(H,E);G.setStyle(E,"visibility","hidden");G.setStyle(H,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(E,D,F){if(E){this.initTarget(E,D,F);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.2",build:"1076"});perfUI.widgets.musicPlayerMode={"dashboard":1,"standalone":2};perfUI.content.song=function(A){this.dataSource=A||null;this.container=null;this.trackId="";this.trackOrder=1;this.init=function(){if(!this.dataSource){return;}this.trackId=PERF.parseNode(this.dataSource,"trackId");this.trackOrder=PERF.parseNodeNumeric(this.dataSource,"order");};this.init();};perfUI.dashboard.musicPlaylist=function(G,K,C,B,I){var O=this;var D=perfUI.util.getNode;var F=perfUI.util.addEl;var E=YAHOO.util.Dom;var N=YAHOO.util.Event;var L=YAHOO.util.DragDropMgr;var A=false;var M=null;var H=null;var J=null;perfUI.dashboard.musicPlaylist.superclass.constructor.call(this,G,C,B,I);this.userId=G||0;this.watchedUserId=K||0;this.maximumTracks=20;this.redirectLoginUrl="";this.isDirty=false;this.containerEdit=null;this.containerEmptyPlaylist=null;this.results=[];this.mode=perfUI.widgets.musicPlayerMode.dashboard;this.allowCaption=false;this.allowPager=false;this.user=null;this.dataSourceNodeName="playlist";this.applicationCss="playlist";this.editCss="playlist_edit";this.trackCss="playlist_track";this.getAddTrackButton=function(){return M;};this.setAddTrackButton=function(P){M=P;};this.getEditPlaylistButton=function(){return H;};this.setEditPlaylistButton=function(P){H=P;};this.getSavePlaylistButton=function(){return J;};this.setSavePlaylistButton=function(P){J=P;};this.enableAddTrackButton=function(){var P=this.getAddTrackButton();if(P){if(this.results.length>=this.maximumTracks){P.set("disabled",true);}else{P.set("disabled",false);}}};this.buildContentContainer=function(P){this.containerContent=F(P,"div",{"class":"content"});};this.buildContainer=function(){this.container.innerHTML="";var P=this.buildMainContainer();if((this.userId!=this.watchedUserId)&&!(this.userId<=0&&this.mode!=perfUI.widgets.musicPlayerMode.dashboard)){E.addClass(P,"playlist_share");}this.buildContentContainer(P);F(P,"br",{"clear":"all"});};this.hideLoadingActivity=function(){if(this.containerActivity!=null){this.containerActivity.style.display="none";}};this.getPlaylist=function(){this.showContentActivity();var S={url:"/api/call.asp",params:"?Function=Media.Music.GetPlayList&userid="+this.watchedUserId+"&sid="+Math.random()};var R=function(U){this.handleFailure();};var P=function(U){this.isDirty=false;this.loadRequestedResponse(U);};var T={success:P,failure:R,scope:O};var Q=S.url+S.params;YAHOO.util.Connect.asyncRequest("GET",Q,T,null);};perfUI.dashboard.musicPlaylist.prototype.hideContentActivity=function(){var P=this.containerContent;if(!P){return;}P.innerHTML="";};this.render=function(){E.addClass(document.body,"perfspot");this.getPlaylist();};this.setSortButtonUpMouseover=function(Q,P){E.addClass(P,"track_sort_up_hover");};this.setSortButtonUpMouseout=function(Q,P){E.removeClass(P,"track_sort_up_hover");};this.setSortButtonDownMouseover=function(Q,P){E.addClass(P,"track_sort_dn_hover");};this.setSortButtonDownMouseout=function(Q,P){E.removeClass(P,"track_sort_dn_hover");};this.setSortButtonRollover=function(P,Q){N.addListener(P,"mouseover",this.setSortButtonUpMouseover,P);N.addListener(P,"mouseout",this.setSortButtonUpMouseout,P);N.addListener(Q,"mouseover",this.setSortButtonDownMouseover,Q);N.addListener(Q,"mouseout",this.setSortButtonDownMouseout,Q);};if(YAHOO.util.Anim){this.fadeInTrack=new YAHOO.util.Anim(null,{opacity:{to:1}},0.2);this.fadeOutTrack=new YAHOO.util.Anim(null,{opacity:{to:0}},0.2);this.fadeOutTrack.onComplete.subscribe(function(){L.unlock();});this.shrinkTrack=new YAHOO.util.Anim(null,{height:{to:(0)}},0.25);this.shrinkTrack.onComplete.subscribe(function(){this.getEl().parentNode.removeChild(this.getEl());});this.unshrinkTrack=new YAHOO.util.Anim(null,{height:{to:(28)}},0.25);this.unshrinkTrackCB=function(){this.unshrinkTrack.getEl().style.height="28px";this.fadeInTrack.animate();};this.unshrinkTrack.onComplete.subscribe(this.unshrinkTrackCB,this,true);}this.movePlayer=function(U,W,Q){var T=YAHOO.util.Dom;var X=T.getElementsByClassName(this.trackCss,"li",this.containerPlaylist);var S=W.song.trackOrder-1;var R=Q?(S-1):(S+1);if(R<0||R>=X.length){return;}this.isDirty=true;var V=T.getXY(W.getEl());W.goingUp=Q;W.lastY=V[1];W.onDragOver(null,X[R].id);W.endDrag(null,true,true);var P=N.getTarget(U);if(Q){this.setSortButtonUpMouseout(U,P);}else{this.setSortButtonDownMouseout(U,P);}};this.movePlayerUp=function(Q,P){O.movePlayer(Q,P,true);};this.movePlayerDown=function(Q,P){O.movePlayer(Q,P,false);};this.resetPlaylistTrackOrder=function(R){var Q=E.getElementsByClassName(this.trackCss,"li",this.containerPlaylist);if(Q.length==0){return;}this.results=[];for(var T=0;T<Q.length;T++){var P=Q[T];var S=L.getDDById(P.id);var U=E.getElementsByClassName(S.handleCss,"div",P)[0];S.song.trackOrder=T+1;U.innerHTML=S.song.trackOrder;this.results.push(S.song);}};this.buildListItem=function(b,U){var P="plist_track_sort_"+b.trackOrder+"_"+b.trackId;var W="plist_ilike_track_"+b.trackOrder+"_"+b.trackId;var X=this.trackCss;var Z=F(this.containerPlaylist,"li",{"class":X});b.container=Z;if(perfUI.dashboard.musicPlaylist.ddList){var g=new perfUI.dashboard.musicPlaylist.ddList(Z,X+" "+this.editCss+" playlist_track_proxy");g.onEndDragEvent.subscribe(function(i,h){this.resetPlaylistTrackOrder(h[0]);this.isDirty=true;},this,true);var e=F(Z,"div",{"class":"track_sort"});F(e,"div",{"class":g.handleCss,"innerHTML":b.trackOrder,"id":P});g.setHandleElId(P);g.song=b;var a=F(e,"div",{"class":"right"});var d=F(a,"div",{"class":"track_sort_up"});N.addListener(d,"click",this.movePlayerUp,g);var Q=F(a,"div",{"class":"track_sort_dn"});N.addListener(Q,"click",this.movePlayerDown,g);this.setSortButtonRollover(d,Q);}var c=F(Z,"div",{"class":"iLike_track","id":W});F(c,"img",{"style":"margin-left:5px","class":"left","src":"/images/v2/indicator_remembermilk_orange.gif"});var R=F(c,"span",{"class":"activity_msg","innerHTML":perfTranslator.getValue(1864)+"..."});var Y=F(R,"a",{"innerHTML":perfTranslator.getValue(1870)});PERF.makeLink(Y);N.addListener(Y,"click",function(){iLikeDisplaySong({elId:W,trackIds:b.trackId});});iLikeDisplaySong({elId:W,trackIds:b.trackId});if((this.userId!=this.watchedUserId)&&!(this.userId<=0&&this.mode!=perfUI.widgets.musicPlayerMode.dashboard)){var V=F(Z,"div",{"title":perfTranslator.getValue(1263),"class":"addToPlaylistIcon PH_headerMenu_img PH_headerMenu_img_uploadMusic"});var f=function(h){if(this.userId<=0){if(this.redirectLoginUrl.trim().length>0){location.href=this.redirectLoginUrl;}}else{this.addTrackToPlaylist(b.trackId);}};N.addListener(V,"click",f,this,true);}var S=F(Z,"div",{"title":perfTranslator.getValue(307),"class":"deleteIcon"});var T=function(){this.deleteTrack(b.trackId);};N.addListener(S,"click",T,this,true);};this.loadSongs=function(){if(this.results.length==0){return;}if(YAHOO.util.DDTarget){new YAHOO.util.DDTarget(this.containerPlaylist.id);}for(var P=0;P<this.results.length;P++){this.buildListItem(this.results[P],P);}};this.load=function(){perfUI.dashboard.musicPlaylist.superclass.load.call(this);this.render();};};YAHOO.extend(perfUI.dashboard.musicPlaylist,perfUI.dashboard.application);perfUI.dashboard.musicPlaylist.prototype.showEmptyPlaylist=function(){YAHOO.util.Dom.addClass(this.container,"playlist_empty");};perfUI.dashboard.musicPlaylist.prototype.hideEmptyPlaylist=function(){YAHOO.util.Dom.removeClass(this.container,"playlist_empty");};perfUI.dashboard.musicPlaylist.prototype.loadPage=function(){var E=perfUI.util.addEl;this.hideContentActivity();this.containerPlaylist=E(this.containerContent,"ul",{"class":"playlist_tracks","id":"playlist_tracks_"+this.watchedUserId});var A=this.dataSource.getElementsByTagName("track");this.results=[];for(var B=0;B<this.maximumTracks&&B<A.length;B++){var D=A[B];var C=new perfUI.content.song(D);this.results.push(C);}this.enableAddTrackButton();if(this.results.length==0){this.showEmptyPlaylist();}else{this.hideEmptyPlaylist();this.loadSongs();}};perfUI.dashboard.musicPlaylist.prototype.loadRequestedResponse=function(A){var B=perfUI.dashboard.musicPlaylist.superclass.loadRequestedResponse.call(this,A);switch(B){case perfUI.dashboard.exception.dataError:this.handleXmlParsingError();this.loadDataSource(this.dataSource);break;case perfUI.dashboard.exception.timeout:this.handleFailure();break;}if(!this.containerContent){this.buildContainer();}this.loadPage();};perfUI.dashboard.musicPlaylist.prototype.showContentActivity=function(){var A=this.containerContent;if(!A){return;}YAHOO.util.Event.purgeElement(A);A.innerHTML="";perfUI.util.addEl(A,"div",{"class":"activityIndicatorLoadModule","innerHTML":"<p>"+perfTranslator.getValue(1864).toLowerCase()+"...</p>"});};perfUI.dashboard.musicPlaylist.prototype.showEditPlaylist=function(A){if(!A){A=this.getEditPlaylistButton();}var B=YAHOO.util.Dom;if(this.userId!=this.watchedUserId){return;}var C=B.hasClass(this.container,this.editCss);var D=A.get("container");if(C){B.removeClass(this.container,this.editCss);B.replaceClass(D,"cancel","submit");A.set("label",perfTranslator.getValue(784));if(this.isDirty==true){this.getPlaylist();}}else{B.addClass(this.container,this.editCss);B.replaceClass(D,"submit","cancel");A.set("label",perfTranslator.getValue(701));}};perfUI.dashboard.musicPlaylist.prototype.getSortedResults=function(){var A=function(C,B){return C.trackOrder-B.trackOrder;};this.results.sort(A);return this.results;};perfUI.dashboard.musicPlaylist.prototype.getTracksQueryString=function(D){var C="";var A=this.getSortedResults();for(var B=0;B<A.length;B++){C+="&tracks="+A[B].trackId;}if(C.trim().length==0){C="&tracks=-1";}return C;};perfUI.dashboard.musicPlaylist.prototype.getTrackByTrackId=function(B){for(var A=0;A<this.results.length;A++){var C=this.results[A];if(C.trackId==B){return{"song":C,"index":A};}}return null;};perfUI.dashboard.musicPlaylist.prototype.deleteTrack=function(D){var B=YAHOO.util.DragDropMgr;var C=this.getTrackByTrackId(D);if(!C){return;}this.isDirty=true;var E=C.song;var A=B.getDDById(E.container.id);A.unreg();A=null;this.shrinkTrack.setEl(E.container);this.fadeOutTrack.setEl(E.container);this.results.splice(C.index,1);this.fadeOutTrack.animate();this.shrinkTrack.animate();this.enableAddTrackButton();};perfUI.dashboard.musicPlaylist.prototype.savePlaylist=function(){var B=this;var D=this.getSavePlaylistButton();if(D){D.set("disabled",true);}var F=this.getTracksQueryString();var G={url:"/api/call.asp",params:"?Function=Media.Music.SavePlayList&userid="+this.userId+F};var E=function(I){this.handleFailure();};var A=function(I){var J=this.getSavePlaylistButton();if(J){J.set("disabled",false);}var K=this.hasErrors(I);if(!K){this.loadRequestedResponse(I);}this.showEditPlaylist();};var H={success:A,failure:E,scope:B};var C=G.url+G.params;YAHOO.util.Connect.asyncRequest("GET",C,H,null);};perfUI.dashboard.musicPlaylist.prototype.addTrackToPlaylist=function(E){var B=this;var F={url:"/api/call.asp",params:"?Function=Media.Music.AddToPlaylist&userid="+this.userId+"&trackid="+E};var D=function(H){this.handleFailure();};var A=function(H){var I=this.hasErrors(H);if(I){return;}if(this.userId!=this.watchedUserId){alert(perfTranslator.getValue(2772));return;}this.isDirty=false;this.loadRequestedResponse(H);};var G={success:A,failure:D,scope:B};var C=F.url+F.params;YAHOO.util.Connect.asyncRequest("GET",C,G,null);};perfUI.dashboard.musicPlaylist.prototype.showSongChooser=function(){var B=this;var A=function(D,E,C){B.addTrackToPlaylist(D);};iLikeSongChooser({onSelected:A});};perfUI.dashboard.musicPlaylist.prototype.buildMainContainer=function(){var K=perfUI.util.addEl;var P=YAHOO.util.Event;var M=perfUI.util.addEl(this.container,"div",{"class":this.containerCss+" applicationBox"});if(this.userId==this.watchedUserId&&this.mode==perfUI.widgets.musicPlayerMode.dashboard){var O=K(M,"div",{"class":"buttonbox"});var F=K(O,"span",{"class":"addTrack submit"});var N=function(Q){this.showSongChooser();};var E=new YAHOO.widget.Button({label:"+&nbsp;&nbsp;"+perfTranslator.getValue(2771),onclick:{fn:N,obj:null,scope:this},container:F});this.setAddTrackButton(E);var H=K(O,"span",{"class":"submit"});var I=new YAHOO.widget.Button({label:perfTranslator.getValue(784),container:H});var G=function(Q){this.showEditPlaylist(I);};I.set("onclick",{fn:G,obj:null,scope:this});this.setEditPlaylistButton(I);var A=K(O,"span",{"class":"save"});var D=function(Q){this.savePlaylist();};var C=new YAHOO.widget.Button({label:perfTranslator.getValue(1862),onclick:{fn:D,obj:null,scope:this},container:A});this.setSavePlaylistButton(C);}this.containerEmptyPlaylist=K(M,"div",{"class":"playlist_empty_msg"});var L=K(this.containerEmptyPlaylist,"span",{"class":"submit"});var J=function(Q){this.showSongChooser();};var B=new YAHOO.widget.Button({label:perfTranslator.getValue(2771),onclick:{fn:J,obj:null,scope:this},container:L});return M;};if(YAHOO.util.DDProxy){perfUI.dashboard.musicPlaylist.ddList=function(H,C,G,B){perfUI.dashboard.musicPlaylist.ddList.superclass.constructor.call(this,H,G,B);var E=YAHOO.util.Dom;var A=YAHOO.util.Event;var F=YAHOO.util.DragDropMgr;var D=this.getDragEl();E.setStyle(D,"opacity",0.67);this.handleCss="track_sort_rank";this.css=C;this.song=null;this.goingUp=false;this.lastY=0;this.onEndDragEvent=new YAHOO.util.CustomEvent("endDragEvent",this);};YAHOO.extend(perfUI.dashboard.musicPlaylist.ddList,YAHOO.util.DDProxy,{startDrag:function(B,E){var C=YAHOO.util.Dom;var A=this.getDragEl();var D=this.getEl();C.setStyle(D,"visibility","hidden");C.addClass(A,this.css);A.innerHTML=D.innerHTML;C.setStyle(A,"border","1px solid gray");},endDrag:function(G,A){var F=YAHOO.util.Dom;var B=this.getEl();var H=this.getDragEl();var K=this.onEndDragEvent;if(A){F.setStyle(H,"visibility","hidden");}else{F.setStyle(H,"visibility","");}var I=new YAHOO.util.Motion(H,{points:{to:F.getXY(B)}},0.2,YAHOO.util.Easing.easeOut);var C=H.id;var L=this;var D=this.id;var E=this.song;var J=this.handleCss;I.onComplete.subscribe(function(){F.setStyle(C,"visibility","hidden");H.innerHTML="";F.setStyle(D,"visibility","");var M=F.getElementsByClassName(J,"div",B)[0];M.innerHTML=E.trackOrder;K.fire(L);});I.animate();},onDrag:function(B){var A=YAHOO.util.Event;var C=A.getPageY(B);if(C<this.lastY){this.goingUp=true;}else{if(C>this.lastY){this.goingUp=false;}}this.lastY=C;},onDragOver:function(J,D){var L=YAHOO.util.DragDropMgr;var F=YAHOO.util.Dom;var A=this.getEl();var G=F.get(D);var I=L.getDDById(D);if((G.nodeName.toLowerCase()=="li")&&(A!=G)){var E=A.parentNode;var C=G.parentNode;var K=F.get(this.handleElId);var M=F.get(I.handleElId);var B=Number(M.innerHTML);var H=0;if(this.goingUp){H=B+1;C.insertBefore(A,G);}else{H=B-1;C.insertBefore(A,G.nextSibling);}K.innerHTML=B;M.innerHTML=H;L.refreshCache();}}});}