MySpace.UI._QuickPostControl=function(A){MySpace.UI._QuickPostControl.initializeBase(this,[A])};MySpace.UI._QuickPostControl.prototype={textboxTip:"",webServiceUrl:"",webServiceParams:null,hideCB:null,resizeCB:null,isShowingCB:null,enableBlurBehavior:false,enableCancel:false,cancelButton:null,submitButton:null,previewButton:null,editButton:null,closeButton:null,mediaInPopup:true,_width:700,onShowEvt:null,onHideEvt:null,referrer:"",initialize:function(){this.onTextboxBlurHandler=Function.createDelegate(this,this._onTextboxBlur);this.id="msQuickPost"+Math.round(Math.random()*1000);this._addStyles();var D=this.get_element();Sys.UI.DomElement.addCssClass(D,"quickPostControl");D.style.width=this._width+"px";this._editDiv=document.createElement("div");this._editDiv.className="edit";D.appendChild(this._editDiv);var B=Function.createDelegate(this,function(F,E){this[F]=document.createElement("div");this[F].style.display="none";this[F].className=E;D.appendChild(this[F])});B("_previewDiv","preview");B("_captchaDiv","captcha");B("_alertDiv","alert");B("_errorDiv","error");this._captchaControl=$create(MySpace.UI.Captcha,null,{submit:Function.createDelegate(this,this._submit)},null,this._captchaDiv);var A=document.createElement("div");A.className="buttons";D.appendChild(A);var C=Function.createDelegate(this,function(F,E){if(!this[F]){this[F]=document.createElement("input");this[F].type="button";if(F=="cancelButton"){this[F].className="btnCancel"}A.appendChild(this[F])}if(F!="cancelButton"){$defBtn(this[F])}$addHandler(this[F],"click",Function.createDelegate(this,this[E]))});C("previewButton","_preview");C("editButton","_edit");C("submitButton","_submit");C("closeButton","_hide");C("cancelButton","_cancel");if(this.resizeCB){this.resizeCB(700)}},checkPostAllowed:function(A,B){this._call("IsQuickPostAllowed",null,Function.createPartial(this,this._onCheckComplete,A,B))},_onCheckComplete:function(B,E,A,C){this._addStrings(A.strings);this.editButton.value=MySpaceRes.UserPage?MySpaceRes.UserPage.Edit:"Edit";this.closeButton.value=MySpaceRes.ProfileEdit?MySpaceRes.ProfileEdit.Close:"Close";this.cancelButton.value=MySpaceRes.ProfileEdit?MySpaceRes.ProfileEdit.Cancel:"Cancel";if(A.success){this._under18Message=A.under18Message;this._blankBodyMessage=A.blankBodyMessage;this._lengthExceededMessage=A.lengthExceededMessage;this._allowHtml=A.allowHtml;this._initialTextboxHeight=A.initialTextboxHeight;this._rteEnabled=A.rteEnabled;if(window.punymce){punymce.photoSelectorEnabled=A.photoSelectorEnabled;punymce.videoSelectorEnabled=A.videoSelectorEnabled}this._clearError();this.previewButton.value=this.submitButton.value=this._submitLabel=A.submitLabel;var F=[this.submitButton];if(this.enableCancel){Array.add(F,this.cancelButton)}this._showButtons(this._allowHtml?[this.previewButton]:F);this._showDiv(this._editDiv);if(B){B()}this._createFields(A.fields,E,A.rteToolbarType);this._noHtmlDiv.innerHTML=A.message||"";this._noHtmlDiv.style.display=this._allowHtml?"none":"";this._checkContentInterval=window.setInterval(Function.createDelegate(this,this._checkContent),1000);this._focusContent();var D=MySpace.Utils.Selector.query(".mceToolbar",this._quickPostDiv)[0];if(D){setTimeout(function(){D.style.zoom=1},0)}if(this.onShowEvt!=null){Function.createDelegate(this,this.onShowEvt)()}}else{this._showAlert(A.message);if(B){B()}}},_createFields:function(L,I,E){L=(L&&L.length)?L:[{type:"body"}];this._extraFields={};this._editDiv.innerHTML="";var S=(L.length==1)&&(L[0].type=="body")&&!L[0].label;var K=false;for(var M=0;M<L.length;M++){if(L[M].label&&L[M].type!="checkbox"){K=true}}if(this._under18Message){var A=document.createElement("div");A.className="under18";A.innerHTML=this._under18Message;this._editDiv.appendChild(A)}if(!S){var N=document.createElement("table");this._editDiv.appendChild(N)}this._focusField=null;var R=(this._width-(K?18:12))+"px";for(var M=0;M<L.length;M++){var B;if(S){B=this._editDiv}else{var C=N.insertRow(-1);if(K){var P=C.insertCell(-1);P.className="labelCell";P.innerHTML=(L[M].type=="checkbox")?"":(L[M].label||"")}B=C.insertCell(-1)}switch(L[M].type){case"text":var J=document.createElement("input");J.className="textInput";J.style.width=R;J.value=L[M].value||"";if(L[M].maxLength){J.maxLength=L[M].maxLength}B.appendChild(J);this._extraFields[L[M].paramName]=J;if(!this._focusField&&!L[M].value){this._focusField=J}break;case"static":B.innerHTML=L[M].value;break;case"checkbox":var G=document.createElement("input");G.type="checkbox";G.id=this.id+"fld"+M;B.appendChild(G);G.checked=!!(L[M].value);var D=document.createElement("label");D.setAttribute("for",G.id);D.innerHTML=L[M].label;B.appendChild(D);this._extraFields[L[M].paramName]=G;break;case"body":this._maxBodyLength=L[M].maxLength;this._noHtmlDiv=document.createElement("div");this._noHtmlDiv.className="noHtml";B.appendChild(this._noHtmlDiv);this._plainTextDiv=document.createElement("div");B.appendChild(this._plainTextDiv);var H=document.createElement("textarea");H.className="textInput";H.style.width=R;H.style.height=this._initialTextboxHeight+"px";this._plainTextDiv.appendChild(H);var F=(this.textboxTip=="default")?MySpaceRes.Comment.WriteCommentHere:this.textboxTip;this._textbox=$create(MySpace.UI.DefaultTextboxBehavior,{defaultValue:F},{onBlur:this.onTextboxBlurHandler},null,H);this._textboxCopyNode=document.createElement("div");this._textboxCopyNode.className="copy textInput";this._textboxCopyNode.style.width=R;if(Sys.Browser.agent==Sys.Browser.InternetExplorer){this._textboxCopyNode.style.lineHeight=(Sys.Browser.version>=7)?"14px":"13px"}this._plainTextDiv.appendChild(this._textboxCopyNode);this._rteDiv=document.createElement("div");B.appendChild(this._rteDiv);this._rteTextarea=document.createElement("textarea");this._rteTextarea.id="msQuickPostBody"+Math.floor(Math.random()*1000);this._rteDiv.appendChild(this._rteTextarea);var O=this._rteEnabled&&this._allowHtml;this._plainTextDiv.style.display=O?"none":"";this._rteDiv.style.display=O?"":"none";if(O){this._editor=new punymce.Editor({id:this._rteTextarea.id,width:this._width-(K?8:2),height:this._initialTextboxHeight,toolbarType:E,mediaInPopup:this.mediaInPopup})}this._setContent(L[M].value||I||"");if(!this._focusField&&!L[M].value){this._focusField="body"}break}}var Q=P?P.offsetWidth:0;this.get_element().style.width=(this._width+5+Q)+"px";if(this.resizeCB){this.resizeCB(this._width+5+Q)}},_checkContent:function(){if(!this.isShowingCB()||this._editDiv.style.display=="none"){return true}var A=this._allowHtml?this.previewButton:this.submitButton;if(this._maxBodyLength&&this._getContent().length>this._maxBodyLength){this._showError(String.format(this._lengthExceededMessage,this._maxBodyLength));this._showingLengthError=true;A.disable();return false}else{if(this._showingLengthError){this._clearError();A.enable()}}if(this._allowHtml){A.value=this._containsHtml()?MySpaceRes.ProfileEdit.Preview1:this._submitLabel}else{if(this._containsHtml()){this._showError(MySpaceRes.ProfileEdit.HTMLNotAllowed);this._showingHtmlError=true;A.disable();return false}else{if(this._showingHtmlError){this._clearError();A.enable()}}}if(this._showingBlankError&&!this._isEmpty()){this._clearError()}return true},_containsHtml:function(){var A=this._getContent();if(this._plainTextDiv&&this._plainTextDiv.style.display=="none"){A=A.replace(this._brRegex,"")}return this._htmlRegex.test(A)},_htmlRegex:/(<|&lt).*(>|&gt)/i,_brRegex:/(<br[^>]*>)|(<html[^>]*>)/gi,_autoSizeTextbox:function(){if(!this.isShowingCB()){return}window.setTimeout(Function.createDelegate(this,function(){if(this._allowHtml&&this._rteEnabled){var D=this._editor.getIfr(),E=this._editor.getDoc().body,A=Sys.Browser.agent==Sys.Browser.InternetExplorer,M=(A?E.scrollHeight:E.offsetHeight)+30,B=this.get_element().offsetHeight-D.offsetHeight,L=this._initialTextboxHeight,J=(window.innerHeight||document.documentElement.offsetHeight)-B-175,C="hidden";if(M<L){M=L}else{if(M>J){M=Math.max(L,J);C="auto"}}this._editor.resizeTo(this._editor.width,M)}else{var K=this._textbox.get_value();if(Sys.Browser.agent==Sys.Browser.Safari){K=K.replace(/\n$/,"")}this._textboxCopyNode.innerHTML=K.replace(/</g,"&lt;").replace(/&/g,"&amp;").replace(/\n/g,"<br>")+"l";var I=this._textbox.get_element(),B=this.get_element().offsetHeight-I.offsetHeight,H=(document.compatMode=="BackCompat")?0:10,M=this._textboxCopyNode.offsetHeight-H,L=this._initialTextboxHeight,J=(window.innerHeight||document.documentElement.offsetHeight)-B-175,C="hidden";if(M<L){M=L}else{if(M>J){M=Math.max(L,J);C="auto"}}var G=(Sys.Browser.agent==Sys.Browser.Firefox)&&(C!=I.style.overflowY);var F=I.selectionStart;I.style.overflowY=C;if(G){I.focus();I.setSelectionRange(F,F);I.scrollTop=10000}I.style.height=M+"px"}}),0)},_preview:function(A){if(!this._containsHtml()){return this._submit(A)}if(this._checkIfEmpty()){return}A.preventDefault();this._call("PreviewQuickPost",{post:this._getContent()},this._onPreviewComplete)},_onPreviewComplete:function(A,C){if(A.success){this._clearError();this._previewDiv.innerHTML=A.previewHtml;MySpace.Util.applyWBRToElement(this._previewDiv,{frequency:50});this._showDiv(this._previewDiv);this._showButtons([this.submitButton,this.editButton]);MySpace.Utils.Media.loadStaticContent(this._previewDiv);var B=this._previewDiv.getElementsByTagName("a");for(var D=0;D<B.length;D++){B[D].target="_blank"}this._previewDiv.style.height="0";this._autoSizePreview()}else{this._showError(A.message)}},_autoSizePreview:function(){if(!this.isShowingCB()){return}var F=this._previewDiv,C=MySpace.UI.getComputedStyle(F),B=(document.compatMode=="BackCompat")?-2:10,A=F.scrollHeight-B,E=this._initialTextboxHeight,D=(window.innerHeight||document.documentElement.offsetHeight)-175;if(A<E){A=E}else{if(A>D){A=Math.max(E,D)}}if(document.compatMode=="BackCompat"&&Sys.Browser.agent!=Sys.Browser.InternetExplorer){A-=12}if(F.style.height!=A+"px"){F.style.height=A+"px";F.scrollTop=0}},_edit:function(A){A.preventDefault();this._clearError();this._showDiv(this._editDiv);this._showButtons([this.previewButton]);if(this._editor){this._editor.setContent(this._editor.getContent(),{format:"raw"})}},_submit:function(A){if(!this._checkContent()){return}if(A&&A.preventDefault){A.preventDefault()}if(this._checkIfEmpty()){return}this.submitButton.disable();var B=(this._captchaDiv.style.display=="none")?null:this._captchaControl.get_value();this._call("AddQuickPost",{post:this._getContent(),captcha:B},this._onSubmitComplete)},_onSubmitComplete:function(A,B){this.submitButton.enable();this._clearError();if(A.success){if(A.message.length>0){this._showAlert(A.message);this._hideTimeout=setTimeout(Function.createDelegate(this,this._hide),1500)}else{this._hide(B,true)}this._fire_success(A.data)}else{if(A.captchaParams){this._showDiv(this._captchaDiv);this._showButtons([]);A.captchaParams.submitLabel=this._submitLabel;this._captchaControl.show(A.captchaParams);if(A.message){this._showError(A.message)}}else{this._showError(A.message)}}},_cancel:function(A){var B=(this.textboxTip=="default")?MySpaceRes.Comment.WriteCommentHere:this.textboxTip;this._textbox.set_value(B);if(A&&A.preventDefault){A.preventDefault()}this._hide(A,true)},_hide:function(A,B){window.clearTimeout(this._hideTimeout);if(A&&A.preventDefault){A.preventDefault()}if(this.hideCB){this.hideCB(B)}window.clearInterval(this._checkContentInterval);window.clearInterval(this._autoSizePreviewInterval);window.clearInterval(this._autoSizeTextboxInterval);if(this.onHideEvt!=null){Function.createDelegate(this,this.onHideEvt)()}},_onError:function(A){this.submitButton.enable();this._isCallInProgress=false;alert(MySpaceRes.Header.ErrorMessage.replace(/<br[^>]*>/ig,"\n"))},_addStyles:function(){if(MySpace.UI._QuickPostControl.stylesAdded){return}MySpace.UI._QuickPostControl.stylesAdded=true;MySpace.UI.addStyles(".quickPostControl { text-align:left; }.quickPostControl .under18 { margin:10px 15px 10px; font-size:11px; line-height:1.0; }.quickPostControl .noHtml { margin:2px 15px 10px; }.quickPostControl .error { margin:10px 0; font-weight:bold; text-align:center; font-size:11px; }.quickPostControl .captcha { text-align:center; }.quickPostControl .captcha .container { width:350px; margin:0 auto; }.quickPostControl .captcha .recaptcha { float:left; }.quickPostControl .captcha #recaptcha_image { width:300px; height:57px; }.quickPostControl .captcha .recaptcha img { border:1px solid black; }.quickPostControl .captchaDirections { width:330px; margin:0 auto; text-align:left; }.quickPostControl .recaptchaDirections { width:210px; }.quickPostControl .captcha .copyright { color:gray; text-align:center; font-size:10px; }.quickPostControl .captcha input { border:1px solid #ccc; padding:3px; color:#000; margin-right:5px; }.quickPostControl .captcha button { margin-left:3px; padding:1px; }.quickPostControl .edit td { padding:3px 0; vertical-align:middle; }.quickPostControl .edit td.labelCell { text-align:right; font-weight:bold; padding:3px 6px 3px 3px; }.quickPostControl textarea { color:#000; }.quickPostControl .msDefaultTextbox { color:#898989; }.quickPostControl .edit .textInput,.quickPostControl .preview { padding:5px; border:1px solid #ccc; font:11px verdana,arial,helvetica,sans-serif; }.quickPostControl .edit textarea.textInput,.quickPostControl .edit .copy,.quickPostControl .preview { text-align:left; overflow:auto; }.quickPostControl .edit .copy { position:absolute; left:-10000px; top:-10000px; }.quickPostControl .preview { margin:1px 5px 1px 0; }.quickPostControl .alert { text-align:center; height:124px; font-size:14px; }.quickPostControl .alert a { text-decoration:none; font-size:14px; }.quickPostControl .alert td { vertical-align:middle; text-align:center; }.quickPostControl .buttons { text-align:right; padding:3px 5px; }.quickPostControl .buttons .msDefBtn, .quickPostControl .buttons .msDefBtnDisabled { margin-left:7px; }.qpNoInherit .under18 { color:#000; }.qpNoInherit .noHtml { color:red; }.qpNoInherit .error { color:red; }.qpNoInherit .captcha { color:#000; }.qpNoInherit .preview { color:#000; }.qpNoInherit .alert td { color:#000; }")},_addStrings:function(A){for(var B in A){if(!MySpaceRes[B]){MySpaceRes[B]={}}for(var C in A[B]){MySpaceRes[B][C]=A[B][C]}}},_checkIfEmpty:function(){if(this._isEmpty()){this._showError(this._blankBodyMessage);this._showingBlankError=true;return true}else{return false}},_isEmpty:function(){var A=this._getContent();A=A.replace(/<\/?(br|div|p)[^>]*>/gi,"");return !/\S/.test(A)},_getContent:function(){if(!this._plainTextDiv){return""}else{if(this._plainTextDiv.style.display==""){return this._textbox.get_value().replace(/(\r\n)|\r|\n/g,"\r\n")}else{return this._editor?this._editor.getContent():""}}},_setContent:function(A){if(this._plainTextDiv.style.display==""){this._textbox.set_value(A)}else{this._editor.setContent(A)}},_focusContent:function(){if(this._focusField=="body"){if(this._plainTextDiv.style.display==""){this._textbox.get_element().focus()}else{var A=this._editor.getWin();setTimeout(function(){A.focus()},0)}}else{if(this._focusField){this._focusField.focus()}}},_call:function(A,F,G){if(this._isCallInProgress){return}F=F||{};F.args=this.webServiceParams;F.hash=MySpace.UI._QuickPost.hashToken;if(this._extraFields){for(var D in this._extraFields){var C=this._extraFields[D],E;if(C.type=="checkbox"){E=C.checked}else{E=C.value}F.args[D]=E}}var B=this.webServiceUrl.replace(/https?:\/\/[^\/]*\//,"/");if(this.referrer){A=A+"?ref="+this.referrer}Sys.Net.WebServiceProxy.invoke(B,A,false,F,Function.createPartial(this,"_callComplete",G),Function.createDelegate(this,this._onError));this._isCallInProgress=true},_callComplete:function(C,A,B){this._isCallInProgress=false;if(!A.success&&A.redirectUrl){window.location=A.redirectUrl}else{C.call(this,A,B)}},_showButtons:function(B){this.cancelButton.style.display="none";this.submitButton.hide();this.previewButton.hide();this.editButton.hide();this.closeButton.hide();this.previewButton.value=this._containsHtml()?MySpaceRes.ProfileEdit.Preview1:this._submitLabel;for(var A=0;A<B.length;A++){if(B[A].show){B[A].show()}else{B[A].style.display=""}}},_showDiv:function(A){this._editDiv.style.display="none";this._previewDiv.style.display="none";this._captchaDiv.style.display="none";this._alertDiv.style.display="none";A.style.display="";if(A==this._captchaDiv){this._captchaControl.focus()}else{this._captchaControl.hide()}window.clearInterval(this._autoSizePreviewInterval);window.clearInterval(this._autoSizeTextboxInterval);if(A==this._editDiv){this._autoSizeTextboxInterval=window.setInterval(Function.createDelegate(this,this._autoSizeTextbox),300)}else{if(A==this._previewDiv){this._autoSizePreviewInterval=window.setInterval(Function.createDelegate(this,this._autoSizePreview),300)}}},_showError:function(B){var A=this._errorDiv;A.innerHTML=B;A.style.display="";this._showingHtmlError=false;this._showingLengthError=false;this._showingBlankError=false},_clearError:function(){this._errorDiv.style.display="none";this._showingHtmlError=false;this._showingLengthError=false;this._showingBlankError=false},_showAlert:function(A){this._clearError();this._showDiv(this._alertDiv);this._alertDiv.innerHTML="<table height='100%' width='100%'><tr><td>"+A+"</td></tr></table>";this._showButtons([this.closeButton])},get_width:function(){return this._width},set_width:function(A){this._width=A;if(!(this.isShowingCB&&this.isShowingCB())){return}this.get_element().style.width=A+"px";if(this._textbox){this._textbox.get_element().style.width=(A-12)+"px"}if(this._textboxCopyNode){this._textboxCopyNode.style.width=(A-12)+"px"}if(this._editor){this._editor.getIfr().style.width=(A-2)+"px"}},_onTextboxBlur:function(B,A){if(this.enableBlurBehavior&&this._textbox.get_value()==""){this._hide(A,true)}},get_cancelButton:function(){return this.cancelButton},set_cancelButton:function(A){this.cancelButton=A},get_enableBlurBehavior:function(){return this.enableBlurBehavior},set_enableBlurBehavior:function(A){this.enableBlurBehavior=A},get_enableCancel:function(){return this.enableCancel},set_enableCancel:function(A){this.enableCancel=A},get_submitButton:function(){return this.submitButton},set_submitButton:function(A){this.submitButton=A},get_previewButton:function(){return this.previewButton},set_previewButton:function(A){this.previewButton=A},get_editButton:function(){return this.editButton},set_editButton:function(A){this.editButton=A},get_closeButton:function(){return this.closeButton},set_closeButton:function(A){this.closeButton=A},get_webServiceParams:function(){return this.webServiceParams},set_webServiceParams:function(A){this.webServiceParams=A},add_success:function(A){this._get_events().addHandler("success",A)},remove_success:function(A){this._get_events().removeHandler("success",A)},_fire_success:function(B){var A=this._get_events().getHandler("success");if(A){A(this,{data:B})}},_get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events}};MySpace.UI._QuickPostControl.registerClass("MySpace.UI._QuickPostControl",Sys.UI.Control);MySpace.UI.QuickPostPopup=function(A){MySpace.UI.QuickPostPopup.initializeBase(this,[A])};MySpace.UI.QuickPostPopup.prototype={title:"",textboxTip:"default",webServiceUrl:"",webServiceParams:null,onShowEvt:null,onHideEvt:null,referrer:"",initialize:function(){var D=document.createElement("div");D.className="qpNoInherit";this._popup=MySpace.UI.Popup.create(D,this.title,this.onHideEvt,false,false);var B=this._popup.add_button("",false,function(){});var E=this._popup.add_button("",false,function(){});var C=this._popup.add_button("",false,function(){});var A=this._popup.add_button("",false,function(){});var F=this._popup.add_button("",false,function(){});this._quickPostControl=$create(MySpace.UI._QuickPostControl,{textboxTip:this.textboxTip,webServiceUrl:this.webServiceUrl,webServiceParams:this.webServiceParams,hideCB:Function.createDelegate(this,this.hide),resizeCB:Function.createDelegate(this,this.resize),isShowingCB:Function.createDelegate(this,this._isShowing),submitButton:C,previewButton:B,editButton:E,closeButton:A,mediaInPopup:false,onShowEvt:this.onShowEvt,onHideEvt:this.onHideEvt,cancelButton:F,referrer:this.referrer},{success:Function.createDelegate(this,this._fire_success)},null,D)},show:function(A){this._quickPostControl.checkPostAllowed(Function.createDelegate(this,this._show),A)},_show:function(){this._popup.set_title(this.title||MySpaceRes.Comment.AddComment);this._popup.set_top((document.documentElement.scrollTop||document.body.scrollTop||0)+60);this._popup.set_useFixedPos(false);this._popup.show()},hide:function(){this._popup._hide()},_isShowing:function(){return this._popup&&this._popup.get_showing()},resize:function(A){this._popup.set_width(A+18)},get_webServiceParams:function(){return this.webServiceParams},set_webServiceParams:function(A){this.webServiceParams=A;if(this._quickPostControl){this._quickPostControl.set_webServiceParams(A)}},add_success:function(A){this._get_events().addHandler("success",A)},remove_success:function(A){this._get_events().removeHandler("success",A)},_fire_success:function(B,A){var C=this._get_events().getHandler("success");if(C){C(this,A)}},_get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events}};MySpace.UI.QuickPostPopup.registerClass("MySpace.UI.QuickPostPopup",Sys.Component);MySpace.UI.QuickPostInline=function(A){MySpace.UI.QuickPostInline.initializeBase(this,[A])};MySpace.UI.QuickPostInline.prototype={textboxWrapClass:null,textboxTip:"default",enableCancel:false,enableBlurBehavior:false,webServiceUrl:"",webServiceParams:null,referrer:"",initialize:function(){this._textarea=this.get_element().getElementsByTagName("textarea")[0];this._fakeSubmitButton=MySpace.Utils.Selector.query(".msDefBtn",this.get_element(),true)||this.get_element().getElementsByTagName("button")[0]||this.get_element().getElementsByTagName("input")[0];$addHandler(window,"resize",Function.createDelegate(this,this._resize));if(this.textboxWrapClass){this._textboxWrap=MySpace.Utils.Selector.query("."+this.textboxWrapClass,this.get_element())[0]}},show:function(){this._width=MySpace.UI.getContentBox(this.get_element()).w;if(this._quickPostControl){this._quickPostControl.set_width(this._width)}else{this._quickPostDiv=document.createElement("div");this._quickPostDiv.style.display="none";this.get_element().appendChild(this._quickPostDiv);this._quickPostControl=$create(MySpace.UI._QuickPostControl,{textboxTip:this.textboxTip,width:this._width,webServiceUrl:this.webServiceUrl,webServiceParams:this.webServiceParams,enableCancel:this.enableCancel,enableBlurBehavior:this.enableBlurBehavior,referrer:this.referrer,hideCB:Function.createDelegate(this,this.hide),isShowingCB:Function.createDelegate(this,this._isShowing)},{success:Function.createDelegate(this,this._fire_success)},null,this._quickPostDiv)}this._quickPostControl.checkPostAllowed(Function.createDelegate(this,this._show))},_show:function(){this._textarea.style.position="absolute";this._textarea.style.left="-10000px";this._fakeSubmitButton.style.display="none";if(this._textboxWrap){this._textboxWrap.style.display="none"}this._quickPostDiv.style.display="";this._quickPostDiv.style.opacity="";this._quickPostDiv.style.visibility="";Sys.UI.DomElement.removeCssClass(this.get_element(),"qpiInitMode");MySpace.UI.Effects.Glitz.setElementOpacity(this._quickPostDiv,1)},hide:function(A){if(!A){($create(MySpace.UI.Effects.FadeAnimation,{target:this._quickPostDiv,effect:MySpace.UI.Effects.FadeEffect.FadeOut,duration:0.5},{ended:Function.createDelegate(this,this.reset)})).play()}else{this.reset()}},_isShowing:function(){return this._quickPostDiv&&this._quickPostDiv.style.display==""},_resize:function(){if(this._isShowing()){var C=(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version==6);var B=this._quickPostControl.get_element();if(C){B.style.position="absolute"}var A=MySpace.UI.getContentBox(this.get_element()).w;if(C){B.style.position=""}if(A!=this._width){this._quickPostControl.set_width(A)}}},reset:function(){Sys.UI.DomElement.addCssClass(this.get_element(),"qpiInitMode");this._textarea.style.position="";this._fakeSubmitButton.style.display="";if(this._textboxWrap){this._textboxWrap.style.display=""}if(this._quickPostDiv){this._quickPostDiv.style.display="none"}},get_enableBlurBehavior:function(){return this.enableBlurBehavior},set_enableBlurBehavior:function(A){this.enableBlurBehavior=A},get_enableCancel:function(){return this.enableCancel},set_enableCancel:function(A){this.enableCancel=A},get_textboxWrapClass:function(){return this.textboxWrapClass},set_textboxWrapClass:function(A){this.textboxWrapClass=A},get_webServiceParams:function(){return this.webServiceParams},set_webServiceParams:function(A){this.webServiceParams=A;if(this._quickPostControl){this._quickPostControl.set_webServiceParams(A)}},add_success:function(A){this._get_events().addHandler("success",A)},remove_success:function(A){this._get_events().removeHandler("success",A)},_fire_success:function(B,A){var C=this._get_events().getHandler("success");if(C){C(this,A)}},_get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events}};MySpace.UI.QuickPostInline.createAndOpen=function(C){var A=C.jsControlReference,B=C.successHandler;if(!C.ctrl){C.ctrl=$create(MySpace.UI.QuickPostInline,{textboxTip:C.textboxTip,width:C.width,webServiceUrl:C.webServiceUrl,webServiceParams:C.webServiceParams},null,null,C.el||$get(C.id));if(B){C.ctrl.add_success(window["eval"](B))}if(A){MySpace.Util.setJSValue(A,C.ctrl)}}C.ctrl.show();return C.ctrl};MySpace.UI.QuickPostInline.registerClass("MySpace.UI.QuickPostInline",Sys.UI.Control);MySpace.UI.ProfileCommentQuickPostPopup={popup:null,reload:false,friendId:-1,show:function(B,D,E,F){var C=MySpace.UI.ProfileCommentQuickPostPopup;if(B&&B.preventDefault){B.preventDefault()}if(!D&&B&&B.target&&B.target.href){var A=B.target.href.match(/friendid=(\d+)/i);if(A&&A[1]){D=parseInt(A[1])}}if(!D){D=MySpace.ClientContext.DisplayFriendId}if(!D||D==-1){return}C.reload=(D==MySpace.ClientContext.DisplayFriendId)&&(MySpace.ClientContext.FunctionalContext=="UserViewComments");C.friendId=D;if(!C.popup){C.popup=$create(MySpace.UI.QuickPostPopup,{webServiceUrl:"/Modules/Common/Services/QuickComment.asmx",webServiceParams:{FriendId:D},referrer:E});C.popup.add_success(Function.createPartial(C,C.onCommentPosted,F))}else{C.popup.set_webServiceParams({FriendId:D})}C.popup.show();return false},onCommentPosted:function(C,A,B){if(this.reload&&B.data!="pendingApproval"&&(window.location.search.indexOf("page")==-1||window.location.search.match(/page=1[^0-9]/i))){window.location.reload(true)}if(C&&typeof C=="function"){B.friendId=this.friendId;C(A,B)}}};MySpace.UI.MessagingQuickPostPopup={mailPopup:null,autocomplete:null,autocompleteEnabled:false,show:function(B,A,C,D){if(B&&B.preventDefault){B.preventDefault()}if(typeof(_MySpace)!=="undefined"&&typeof(_MySpace.AutocompleteV2)!=="undefined"){this.autocompleteEnabled=true}var E={recipients:A,autocompleteEnabled:(this.autocompleteEnabled&&C)};if(!this.mailPopup){var F=this;this.mailPopup=$create(MySpace.UI.QuickPostPopup,{title:MySpaceRes.Messaging.SendAMessage,textboxTip:"",webServiceUrl:"/Modules/Messaging/Services/MessagingQuickPost.asmx",webServiceParams:E,referrer:D,onShowEvt:function(){if(F.autocompleteEnabled==true){F.autocomplete=new _MySpace.AutocompleteV2("toAC","acList","toBox","acquickpost_rcptList",window["eval"]("("+document.getElementById("acquickpost_prepopdata").value+")"));this._extraFields.acquickpost_rcptList=document.getElementById("acquickpost_rcptList")}},onHideEvt:function(){if(F.autocompleteEnabled==true){F.autocomplete.cancelModifyInputEvent();document.getElementById("acquickpost_rcptList").value=""}}})}else{this.mailPopup.set_webServiceParams(E)}this.mailPopup.show()}};MySpace.UI.Captcha=function(A){MySpace.UI.Captcha.initializeBase(this,[A])};MySpace.UI.Captcha.prototype={_index:0,show:function(E){this._useRecaptcha=E.useRecaptcha;this.hide();var C=this.get_element();this._explanationDiv=document.createElement("div");C.appendChild(this._explanationDiv);this._explanationDiv.innerHTML=E.explanation;this._container=document.createElement("div");this._container.className="container clearfix";C.appendChild(this._container);if(this._useRecaptcha){this._reCaptcha=document.createElement("div");this._reCaptcha.className="recaptcha";this._reCaptcha.id="recaptcha_widget";this._container.appendChild(this._reCaptcha);this._reCaptchaImage=document.createElement("div");this._reCaptchaImage.id="recaptcha_image";this._reCaptcha.appendChild(this._reCaptchaImage);this._reCaptchaHidden=document.createElement("input");this._reCaptchaHidden.id="recaptcha_response_field";this._reCaptchaHidden.type="hidden";this._reCaptcha.appendChild(this._reCaptchaHidden);MySpace.UI.addScript("http://api.recaptcha.net/js/recaptcha_ajax.js","window.Recaptcha",function(){Recaptcha.should_focus=false;Recaptcha.create(E.reCaptchaPublicKey,"recaptcha_widget",{theme:"custom",lang:"en",custom_theme_widget:"recaptcha_widget"});Recaptcha.should_focus=false})}else{this._captcha=document.createElement("div");this._captcha.style.styleFloat=this._captcha.style.cssFloat="left";this._container.appendChild(this._captcha);this._img=document.createElement("img");this._captcha.appendChild(this._img);this._imageUrl=this._img.src=E.imageUrl}var B=document.createElement("a");B.href="#";var D=document.createElement("img");D.src="http://x.myspacecdn.com/images/icons/refreshicon2.jpg";B.appendChild(D);this._container.appendChild(B);$addHandler(B,"click",Function.createDelegate(this,this._refresh));this._copyright=document.createElement("div");this._copyright.className="copyright";this._copyright.innerHTML=E.copyright||"";C.appendChild(this._copyright);this._directionsDiv=document.createElement("div");this._directionsDiv.className="captchaDirections "+(E.useRecaptcha?"recaptchaDirections":"");this._directionsDiv.innerHTML=E.directions;C.appendChild(this._directionsDiv);this._textbox=document.createElement("input");this._textbox.id="captcha_text";C.appendChild(this._textbox);$addHandler(this._textbox,"keypress",Function.createDelegate(this,this._onKeyPress));var A=document.createElement("button");C.appendChild(A);$defBtn(A);$addHandler(A,"click",Function.createDelegate(this,this._onSubmitClick));A.style.display=E.submitLabel?"":"none";A.innerHTML=E.submitLabel||"";this._refreshDelay=E.timeout*1000;this._refreshTimeout=window.setTimeout(Function.createDelegate(this,this._refresh),this._refreshDelay)},hide:function(){window.clearTimeout(this._refreshTimeout);if(this._useRecaptcha&&window.Recaptcha){Recaptcha.destroy()}this.get_element().innerHTML=""},focus:function(){try{this._textbox.focus()}catch(A){}},get_value:function(){var A=$get("recaptcha_challenge_field");if(A&&A.value){return A.value+"|"+this._textbox.value}return this._textbox.value},_refresh:function(A){window.clearTimeout(this._refreshTimeout);if(A&&A.preventDefault){A.preventDefault()}this._textbox.value="";if(this._useRecaptcha){Recaptcha.reload("t")}else{this._img.src=this._imageUrl+"&r="+ ++this._index}this._refreshTimeout=window.setTimeout(Function.createDelegate(this,this._refresh),this._refreshDelay)},_onKeyPress:function(A){if(A.charCode==13){this.raiseSubmit();A.preventDefault()}},_onSubmitClick:function(A){this.raiseSubmit();A.preventDefault()},get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events},add_submit:function(A){this.get_events().addHandler("submit",A)},remove_submit:function(A){this.get_events().removeHandler("submit",A)},raiseSubmit:function(){var A=this.get_events().getHandler("submit");if(A){A(this,Sys.EventArgs.Empty)}}};MySpace.UI.Captcha.registerClass("MySpace.UI.Captcha",Sys.UI.Control);Type.registerNamespace("Friends.AddToFriendsPopOver");Friends.AddToFriendsPopOver=function(){Friends.AddToFriendsPopOver.initializeBase(this);this.iFrameSrc;this.cssSelector};Friends.AddToFriendsPopOver.prototype={_addToFrendsEls:[],_timerId:null,_atfoFrame:null,_atfoWaitDiv:null,addFriendPopup:null,add_complete:function(A){this.get_events().addHandler("complete",A)},remove_complete:function(A){this.get_events().removeHandler("complete",A)},raiseComplete:function(){var A=this.get_events().getHandler("complete");if(A){A(this)}},initialize:function(){Friends.AddToFriendsPopOver.callBaseMethod(this,"initialize");this.addStyles();this._bindToAddToFriendEls()},dispose:function(){if(this._addToFrendsEls&&this._addToFrendsEls.length){for(var A=0;A<this._addToFrendsEls.length;A++){this._addToFrendsEls[A]&&$clearHandlers(this._addToFrendsEls[A])}}this._atfoFrame=null;this._timerId&&clearTimeout(this._timerId)},_bindToAddToFriendEls:function(){if(this.cssSelector){this._timerId&&clearTimeout(this._timerId);this._addToFrendsEls=MySpace.Utils.Selector.query(this.cssSelector);if(this._addToFrendsEls&&this._addToFrendsEls.length){for(var A=0;A<this._addToFrendsEls.length;A++){$addHandler(this._addToFrendsEls[A],"click",Function.createDelegate(this,this._invokPopOver))}}else{if(!this._timerId){this._timerId=window.setTimeout(Function.createDelegate(this,this._bindToAddToFriendEls),500)}}}},_invokPopOver:function(A){var B=null;var E=null;if(!A){return false}if(A.friendId){B=A.friendId}if(A.acctType){E=A.acctType}var D=A.target||A.srcElement;if(D){if(B==null){if(D.friendId){B=D.friendId}else{if(D.attributes.getNamedItem("friendId")&&D.attributes.getNamedItem("friendId").value>0){B=D.attributes.getNamedItem("friendId").value}else{var C=D.toString().toLowerCase().split("&");for(i in C){if(C[i].toString().indexOf("friendid",0)!=-1){B=C[i].toString().substr(9,C[i].toString().length);break}}}}}if(E==null){if(D.acctType){E=D.acctType}else{if(D.attributes.getNamedItem("acctType")&&D.attributes.getNamedItem("acctType").value>0){E=D.attributes.getNamedItem("acctType").value}}}}if(B&&B<1300000000&&E!=8){if(!this.addFriendPopup){this.addFriendPopup=MySpace.UI.Popup.create("",MySpaceRes.ViewAllFriendsPage.AddToFriends,Function.createDelegate(this,this.afterPopupClosed),false,false);this.addFriendPopup.set_width(552);this.addFriendPopup.remove_buttons();this.addFriendPopup.set_content("<div id='ATFPopUpContentWait' class='ATFPopUpContentWait'><img src='"+MySpace.StaticContentBase+"/modules/friends/static/img/icon_loading.gif' /></div><iframe id='PWOIframeID' scrolling='no' frameborder='0' class='addfriendrequestpopup' src='about:blank' allowtransparency='true' ><img src='http://x.myspacecdn.com/modules/friends/static/img/icon_loading.gif' /></iframe>");this._atfoFrame=$get("PWOIframeID");this._atfoWaitDiv=$get("ATFPopUpContentWait")}if(this._atfoFrame){this._atfoFrame.src=String.format(this.iFrameSrc,B);this.addFriendPopup.show();if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}}else{this._atfoWaitDiv=$get("ATFPopUpContentWait")}this.setGlobalPopupPosition()}else{if(D&&D.href){location.href=D.href}}},_getWindowScrollY:function(){return(typeof(window.pageYOffset)!=="undefined")?window.pageYOffset:document.documentElement.scrollTop},bindAddToFriendPopOver:function(A){this.cssSelector=A||this.cssSelector;this._bindToAddToFriendEls()},afterPopupClosed:function(B,A){this.setGlobalPopupPosition();if(A&&A.rUrl){window.location.href=A.rUrl}this.raiseComplete()},setGlobalPopupPosition:function(){this._atfoFrame&&(this._atfoFrame.style.width=this._atfoFrame.style.height=1+"px");this._atfoWaitDiv&&Sys.UI.DomElement.removeCssClass(this._atfoWaitDiv,"hide");if(!this.addFriendPopup){return}var A=this.addFriendPopup.get_element();if(A){if(browser.isIE6x){A.style.top=(this._getWindowScrollY()+50)+"px";return}else{A.style.top="50px";A.style.position="fixed"}}},addStyles:function(){MySpace.UI.addStyles(".addfriendrequestpopup {width:1px;height:1px;}.ATFPopUpContentWait {text-align:center; margin-top:35px;}",false,"atfoPopover")}};Friends.AddToFriendsPopOver.registerClass("Friends.AddToFriendsPopOver",Sys.Component);Friends.AddToFriendsPopOver.getInstance=function(){return $find("globalAddToFriendsPopover")};MySpace.UI.DefaultTextboxBehavior=function(A){MySpace.UI.DefaultTextboxBehavior.initializeBase(this,[A]);this._defaultValue=""};MySpace.UI.DefaultTextboxBehavior.prototype={initialize:function(){MySpace.UI.DefaultTextboxBehavior.callBaseMethod(this,"initialize");var A=this.get_element();this.set_value(A.value);this._focusHandler=Function.createDelegate(this,this._onFocus);$addHandler(A,"focus",this._focusHandler);this._blurHandler=Function.createDelegate(this,this._onBlur);$addHandler(A,"blur",this._blurHandler)},dispose:function(){$removeHandler(this.get_element(),"focus",this._focusHandler);$removeHandler(this.get_element(),"blur",this._blurHandler);MySpace.UI.DefaultTextboxBehavior.callBaseMethod(this,"dispose")},_onFocus:function(A){if(this.get_element().value==this._defaultValue){this.get_element().value="";this._updateClass()}this._fire_onFocus(this,A)},_onBlur:function(A){if(!this.get_element().value){this.get_element().value=this._defaultValue;this._updateClass()}this._fire_onBlur(this,A)},_updateClass:function(){var A=this.get_element();if(this._defaultValue&&A.value==this._defaultValue){Sys.UI.DomElement.addCssClass(A,"msDefaultTextbox")}else{Sys.UI.DomElement.removeCssClass(A,"msDefaultTextbox")}},get_defaultValue:function(){return this._defaultValue},set_defaultValue:function(A){if(this.get_element().value==this._defaultValue){this.get_element().value=A}this._defaultValue=A},get_value:function(){if(this.get_element().value==this._defaultValue){return""}else{return this.get_element().value}},set_value:function(A){this.get_element().value=A||this._defaultValue;this._updateClass()},add_onFocus:function(A){this._get_events().addHandler("onfocus",A)},remove_onFocus:function(A){this._get_events().removeHandler("onfocus",A)},add_onBlur:function(A){this._get_events().addHandler("onblur",A)},remove_onBlur:function(A){this._get_events().removeHandler("onblur",A)},_fire_onFocus:function(B,A){var C=this._get_events().getHandler("onfocus");if(C){C(this,A)}},_fire_onBlur:function(B,A){var C=this._get_events().getHandler("onblur");if(C){C(this,A)}},_get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events}};MySpace.UI.DefaultTextboxBehavior.registerClass("MySpace.UI.DefaultTextboxBehavior",Sys.UI.Behavior);Type.registerNamespace("MySpace.UI.Effects");MySpace.UI.Effects.Glitz=function(){throw Error.invalidOperation()};MySpace.UI.Effects.Glitz.interpolate=function(C,B,A,D){if(D){A=100*D(A/100)}return C+(B-C)*(A/100)};MySpace.UI.Effects.Glitz.setElementOpacity=function(B,A){if(B.filters){if(A==1){B.style.cssText=B.style.cssText.replace(/FILTER:[^;]*;?/i,"")}else{B.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+A*100+")"}}else{B.style.opacity=A}};MySpace.UI.Effects.Easing={linear:function(A){return A},quadIn:function(A){return A*A},quadOut:function(A){return A*(A-2)*-1},quadInOut:function(A){A=A*2;if(A<1){return Math.pow(A,2)/2}return -1*((--A)*(A-2)-1)/2},quartIn:function(A){return Math.pow(A,4)},quartOut:function(A){return -1*(Math.pow(A-1,4)-1)},quartInOut:function(A){A=A*2;if(A<1){return Math.pow(A,4)/2}A-=2;return -1/2*(Math.pow(A,4)-2)},circIn:function(A){return -1*(Math.sqrt(1-Math.pow(A,2))-1)},circOut:function(A){A=A-1;return Math.sqrt(1-Math.pow(A,2))},circInOut:function(A){A=A*2;if(A<1){return -1/2*(Math.sqrt(1-Math.pow(A,2))-1)}A-=2;return 1/2*(Math.sqrt(1-Math.pow(A,2))+1)},backIn:function(B){var A=1.70158;return Math.pow(B,2)*((A+1)*B-A)},backOut:function(B){B=B-1;var A=1.70158;return Math.pow(B,2)*((A+1)*B+A)+1},backInOut:function(B){var A=1.70158*1.525;B=B*2;if(B<1){return(Math.pow(B,2)*((A+1)*B-A))/2}B-=2;return(Math.pow(B,2)*((A+1)*B+A)+2)/2},elasticIn:function(C){if(C==0){return 0}if(C==1){return 1}var B=0.3;var A=B/4;C=C-1;return -1*Math.pow(2,10*C)*Math.sin((C-A)*(2*Math.PI)/B)},elasticOut:function(C){if(C==0){return 0}if(C==1){return 1}var B=0.3;var A=B/4;return Math.pow(2,-10*C)*Math.sin((C-A)*(2*Math.PI)/B)+1},elasticInOut:function(C){if(C==0){return 0}C=C*2;if(C==2){return 1}var B=0.3*1.5;var A=B/4;if(C<1){C-=1;return -0.5*(Math.pow(2,10*C)*Math.sin((C-A)*(2*Math.PI)/B))}C-=1;return 0.5*(Math.pow(2,-10*C)*Math.sin((C-A)*(2*Math.PI)/B))+1},bounceIn:function(A){return(1-MySpace.UI.Effects.Easing.bounceOut(1-A))},bounceOut:function(D){var B=7.5625;var C=2.75;var A;if(D<(1/C)){A=B*Math.pow(D,2)}else{if(D<(2/C)){D-=(1.5/C);A=B*Math.pow(D,2)+0.75}else{if(D<(2.5/C)){D-=(2.25/C);A=B*Math.pow(D,2)+0.9375}else{D-=(2.625/C);A=B*Math.pow(D,2)+0.984375}}}return A},bounceInOut:function(A){if(A<0.5){return MySpace.UI.Effects.Easing.bounceIn(A*2)/2}return(MySpace.UI.Effects.Easing.bounceOut(A*2-1)/2)+0.5}};MySpace.UI.Effects.Animation=function(){MySpace.UI.Effects.Animation.initializeBase(this)};MySpace.UI.Effects.Animation.prototype={_duration:1,_fps:25,_target:null,_tickHandler:null,_timer:null,_percentComplete:0,_percentDelta:null,_parentAnimation:null,get_duration:function(){return this._duration},set_duration:function(A){this._duration=A},get_fps:function(){return this._fps},set_fps:function(A){this._fps=A},get_isActive:function(){return this._timer!==null},get_isPlaying:function(){return this._timer!==null&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},get_target:function(){return this._target},set_target:function(A){this._target=A},add_ended:function(A){this.get_events().addHandler("ended",A)},remove_ended:function(A){this.get_events().removeHandler("ended",A)},add_started:function(A){this.get_events().addHandler("started",A)},remove_started:function(A){this.get_events().removeHandler("started",A)},dispose:function(){if(this._timer){this._timer.dispose();this._timer=null}this._tickHandler=null;this._target=null;MySpace.UI.Effects.Animation.callBaseMethod(this,"dispose")},getAnimatedValue:function(){throw Error.notImplemented()},onEnd:function(){},onStart:function(){},onStep:function(A){this.setValue(this.getAnimatedValue(A))},pause:function(){if(!this._parentAnimation){if(this._timer){this._timer.set_enabled(false);this.raisePropertyChanged("isPlaying")}}},play:function(){if(!this._parentAnimation){var A=true;if(!this._timer){A=false;if(!this._tickHandler){this._tickHandler=Function.createDelegate(this,this._onTimerTick)}this._timer=new MySpace.Timer;this._timer.set_interval(1000/this._fps);this._timer.add_tick(this._tickHandler);this._percentDelta=100/(this._duration*this._fps);this.onStart();this._updatePercentComplete(0,true)}this._timer.set_enabled(true);this.raisePropertyChanged("isPlaying");if(!A){this.raisePropertyChanged("isActive")}}},setOwner:function(A){this._parentAnimation=A},setValue:function(){throw Error.notImplemented()},stop:function(){if(!this._parentAnimation){var A=this._timer;this._timer=null;if(A){A.dispose();this._updatePercentComplete(100);this.onEnd();var B=this.get_events().getHandler("ended");if(B){B(this,null)}this.raisePropertyChanged("isPlaying");this.raisePropertyChanged("isActive")}}},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,true)},_updatePercentComplete:function(B,A){if(B>100){B=100}this._percentComplete=B;this.raisePropertyChanged("percentComplete");if(A){this.onStep(B)}if(B===100){this.stop()}}};MySpace.UI.Effects.Animation.registerClass("MySpace.UI.Effects.Animation",Sys.Component);MySpace.UI.Effects.PropertyAnimation=function(){MySpace.UI.Effects.PropertyAnimation.initializeBase(this)};MySpace.UI.Effects.PropertyAnimation.prototype={_property:null,_propertyKey:null,get_property:function(){return this._property},set_property:function(A){this._property=A},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(A){this._propertyKey=A},add_ended:function(A){this.get_events().addHandler("ended",A)},remove_ended:function(A){this.get_events().removeHandler("ended",A)},add_started:function(A){this.get_events().addHandler("started",A)},remove_started:function(A){this.get_events().removeHandler("started",A)},setValue:function(A){if(this._propertyKey){this.get_target()[this._property][this._propertyKey]=A}else{this.get_target()[this._property]=A}}};MySpace.UI.Effects.PropertyAnimation.registerClass("MySpace.UI.Effects.PropertyAnimation",MySpace.UI.Effects.Animation);MySpace.UI.Effects.InterpolatedAnimation=function(){MySpace.UI.Effects.InterpolatedAnimation.initializeBase(this)};MySpace.UI.Effects.InterpolatedAnimation.prototype={_startValue:null,_endValue:null,_easingFunction:null,get_endValue:function(){return this._endValue},set_endValue:function(A){this._endValue=A},get_startValue:function(){return this._startValue},set_startValue:function(A){this._startValue=A},get_easingFunction:function(){return this._easingFunction},set_easingFunction:function(A){this._easingFunction=A}};MySpace.UI.Effects.InterpolatedAnimation.registerClass("MySpace.UI.Effects.InterpolatedAnimation",MySpace.UI.Effects.PropertyAnimation);MySpace.UI.Effects.DiscreteAnimation=function(){MySpace.UI.Effects.DiscreteAnimation.initializeBase(this);this._values=[]};MySpace.UI.Effects.DiscreteAnimation.prototype={get_values:function(){return this._values},set_values:function(A){this._values=A},getAnimatedValue:function(B){var A=Math.round(B/100*(this._values.length-1));return this._values[A]}};MySpace.UI.Effects.DiscreteAnimation.registerClass("MySpace.UI.Effects.DiscreteAnimation",MySpace.UI.Effects.PropertyAnimation);MySpace.UI.Effects.NumberAnimation=function(){MySpace.UI.Effects.NumberAnimation.initializeBase(this)};MySpace.UI.Effects.NumberAnimation.prototype={_integralValues:false,get_integralValues:function(){return this._integralValues},set_integralValues:function(A){this._integralValues=A},getAnimatedValue:function(B){var A=MySpace.UI.Effects.Glitz.interpolate(this.get_startValue(),this.get_endValue(),B,this.get_easingFunction());if(this._integralValues){A=Math.round(A)}return A}};MySpace.UI.Effects.NumberAnimation.registerClass("MySpace.UI.Effects.NumberAnimation",MySpace.UI.Effects.InterpolatedAnimation);MySpace.UI.Effects.LengthAnimation=function(){MySpace.UI.Effects.LengthAnimation.initializeBase(this)};MySpace.UI.Effects.LengthAnimation.prototype={_unit:"px",get_unit:function(){return this._unit},set_unit:function(A){this._unit=A},getAnimatedValue:function(B){var A=MySpace.UI.Effects.Glitz.interpolate(this.get_startValue(),this.get_endValue(),B,this.get_easingFunction());return Math.round(A)+this._unit}};MySpace.UI.Effects.LengthAnimation.registerClass("MySpace.UI.Effects.LengthAnimation",MySpace.UI.Effects.InterpolatedAnimation);MySpace.UI.Effects.CompositeAnimation=function(){MySpace.UI.Effects.CompositeAnimation.initializeBase(this);this._animations=[]};MySpace.UI.Effects.CompositeAnimation.prototype={get_animations:function(){return this._animations},add_animation:function(A){this._animations.push(A)},getAnimatedValue:function(){throw Error.invalidOperation()},dispose:function(){for(var A=0;A<this._animations.length;A++){this._animations[A].dispose()}this._animations=null;MySpace.UI.Effects.CompositeAnimation.callBaseMethod(this,"dispose")},onEnd:function(){for(var A=0;A<this._animations.length;A++){this._animations[A].onEnd()}},onStart:function(){for(var A=0;A<this._animations.length;A++){this._animations[A].onStart()}},onStep:function(A){for(var B=0;B<this._animations.length;B++){this._animations[B].onStep(A)}}};MySpace.UI.Effects.CompositeAnimation.registerClass("MySpace.UI.Effects.CompositeAnimation",MySpace.UI.Effects.Animation);MySpace.UI.Effects.ColorAnimation=function(G,F,E,D,C,B,A){MySpace.UI.Effects.ColorAnimation.initializeBase(this,[G,F,E,D,C,B,A]);this._start=null;this._end=null;this._interpolateRed=false;this._interpolateGreen=false;this._interpolateBlue=false};MySpace.UI.Effects.ColorAnimation.prototype={onStart:function(){MySpace.UI.Effects.ColorAnimation.callBaseMethod(this,"onStart");this._start=MySpace.UI.Effects.ColorAnimation.getRGB(this.get_startValue());this._end=MySpace.UI.Effects.ColorAnimation.getRGB(this.get_endValue());this._interpolateRed=(this._start.Red!=this._end.Red);this._interpolateGreen=(this._start.Green!=this._end.Green);this._interpolateBlue=(this._start.Blue!=this._end.Blue)},getAnimatedValue:function(B){var D=this._start.Red;var C=this._start.Green;var A=this._start.Blue;if(this._interpolateRed){D=Math.round(MySpace.UI.Effects.Glitz.interpolate(D,this._end.Red,B,this.get_easingFunction()))}if(this._interpolateGreen){C=Math.round(MySpace.UI.Effects.Glitz.interpolate(C,this._end.Green,B,this.get_easingFunction()))}if(this._interpolateBlue){A=Math.round(MySpace.UI.Effects.Glitz.interpolate(A,this._end.Blue,B,this.get_easingFunction()))}return MySpace.UI.Effects.ColorAnimation.toColor(D,C,A)},set_startValue:function(A){if(this._startValue!=A){this._startValue=A;this.raisePropertyChanged("startValue")}},set_endValue:function(A){if(this._endValue!=A){this._endValue=A;this.raisePropertyChanged("endValue")}}};MySpace.UI.Effects.ColorAnimation.getRGB=function(A){if(!A||A.length!=7){throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor,A)}return{Red:parseInt(A.substr(1,2),16),Green:parseInt(A.substr(3,2),16),Blue:parseInt(A.substr(5,2),16)}};MySpace.UI.Effects.ColorAnimation.toColor=function(F,E,B){var D=F.toString(16);var C=E.toString(16);var A=B.toString(16);if(D.length==1){D="0"+D}if(C.length==1){C="0"+C}if(A.length==1){A="0"+A}return"#"+D+C+A};MySpace.UI.Effects.ColorAnimation.registerClass("MySpace.UI.Effects.ColorAnimation",MySpace.UI.Effects.InterpolatedAnimation);MySpace.UI.Effects.FadeEffect=function(){throw Error.invalidOperation()};MySpace.UI.Effects.FadeEffect.prototype={FadeIn:0,FadeOut:1};MySpace.UI.Effects.FadeEffect.registerEnum("MySpace.UI.Effects.FadeEffect");MySpace.UI.Effects.FadeAnimation=function(){MySpace.UI.Effects.FadeAnimation.initializeBase(this)};MySpace.UI.Effects.FadeAnimation.prototype={_effect:MySpace.UI.Effects.FadeEffect.FadeIn,get_effect:function(){return this._effect},set_effect:function(A){this._effect=A},getAnimatedValue:function(C){var B=0,A=1;if(this._effect===MySpace.UI.Effects.FadeEffect.FadeOut){B=1;A=0}return MySpace.UI.Effects.Glitz.interpolate(B,A,C)},onStart:function(){var A=0;if(this._effect===MySpace.UI.Effects.FadeEffect.FadeOut){A=1}this.setValue(A);if(A==0){this.get_target().style.visibility="visible"}},onEnd:function(){var A=1;if(this._effect===MySpace.UI.Effects.FadeEffect.FadeOut){A=0}this.setValue(A);if(A==0){this.get_target().style.visibility="hidden"}},setValue:function(A){MySpace.UI.Effects.Glitz.setElementOpacity(this.get_target(),A)}};MySpace.UI.Effects.FadeAnimation.registerClass("MySpace.UI.Effects.FadeAnimation",MySpace.UI.Effects.Animation);MySpace.UI.Effects.SlideEffect=function(){throw Error.invalidOperation()};MySpace.UI.Effects.SlideEffect.prototype={SlideIn:0,SlideOut:1};MySpace.UI.Effects.SlideEffect.registerEnum("MySpace.UI.Effects.SlideEffect");MySpace.UI.Effects.SlidingAnimation=function(){MySpace.UI.Effects.SlidingAnimation.initializeBase(this)};MySpace.UI.Effects.SlidingAnimation.prototype={_effect:MySpace.UI.Effects.SlideEffect.SlideIn,get_effect:function(){return this._effect},set_effect:function(A){this._effect=A},initialize:function(){this.get_target().style.overflow="hidden";var A=this.get_target().style.display;this.get_target().style.display="block";this.set_property("style");this.set_propertyKey("height");if(this._effect===MySpace.UI.Effects.SlideEffect.SlideIn){this.set_startValue(MySpace.UI.getContentBox(this.get_target()).h);this.set_endValue(0)}else{this.set_startValue(0);this.set_endValue(MySpace.UI.getContentBox(this.get_target()).h)}this.get_target().style.display=A},onStart:function(){if(this._effect===MySpace.UI.Effects.SlideEffect.SlideOut){this.get_target().style.display="block"}},onEnd:function(){if(this._effect===MySpace.UI.Effects.SlideEffect.SlideIn){this.get_target().style.display="none"}}};MySpace.UI.Effects.SlidingAnimation.registerClass("MySpace.UI.Effects.SlidingAnimation",MySpace.UI.Effects.LengthAnimation);