(function(C){registerNamespace("MySpace.Utils.Media");MySpace.Utils.Media.loadStaticContent=function(K){K=K||document;C("img",K).each(function(){if(!this.getAttribute("MaxWidth")&&!this.getAttribute("MaxHeight")&&this.getAttribute("source")){this.src=this.getAttribute("source")}});C("object",K).each(function(){var L=C(this),N=L.attr("movie");if(!N){return}try{this.LoadMovie(0,N);var T=L.attr("disableAutoPlay");if(T==undefined||T==""){this.Play()}return}catch(Q){}var S=L.attr("height"),O=L.attr("width"),R="";C("param",this).each(function(){try{if(this.getAttribute("name").toLowerCase()=="flashvars"){R=this.getAttribute("value");return false}}catch(U){}});var P=new SWFObject(N,"obj"+Math.random(),O,S,"8","#FFFFFF");if(R){C.each(R.split(/\&/),function(U,W){var V=W.split("=");if(V.length==2){P.addVariable(V[0],V[1])}})}var M=C("<div />");L.before(M);P.write(M);L.remove()})};try{MySpace.Utils.Media.loadStaticContent()}catch(E){}Date.prototype.addDays=function(K){this.setDate(this.getDate()+K);return this};MySpace.CMS={track:function(L,K){C.get("/Modules/Common/HttpHandlers/CMSClick.ashx?_i="+L+"&_l="+K)},trackV2:function(O,Q,P){var K=O.href,N=(O.target&&O.target!=""),M="/Modules/Common/HttpHandlers/CMSClick.ashx?_i="+Q+"&_l="+P+"&t="+new Date().getTime();function L(){if(!N){location.href=K}}C.ajax({url:M,timeout:2000,success:L,error:L});if(!N){return false}}};if(MySpace.Cookies.MSCulture){var F=new Date();MySpace.Cookies.MSCulture.get_values().timeZone=(F.getTimezoneOffset()/-60);MySpace.Cookies.save(MySpace.Cookies.MSCulture,".myspace.com",new Date().addDays(7))}MySpace.Util.Base64KeyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";MySpace.Util.Base64Encode=function(O,N){var L="",V,T,R,U,S,Q,P,M=0,K=MySpace.Util.Base64KeyStr;do{V=O.charCodeAt(M++);T=O.charCodeAt(M++);R=O.charCodeAt(M++);U=V>>2;S=((V&3)<<4)|(T>>4);Q=((T&15)<<2)|(R>>6);P=R&63;if(isNaN(T)){Q=P=64}else{if(isNaN(R)){P=64}}L=L+K.charAt(U)+K.charAt(S)+K.charAt(Q)+K.charAt(P)}while(M<O.length);if(N){L=L.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}return L};MySpace.Util.Base64Decode=function(N){var L="",U,S,Q,T,R,P,O,M=0,K=MySpace.Util.Base64KeyStr;N=N.replace(/-/g,"+").replace(/_/g,"/");if(N.length%4){N+=(N.length%4==2)?"==":"="}N=N.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{T=K.indexOf(N.charAt(M++));R=K.indexOf(N.charAt(M++));P=K.indexOf(N.charAt(M++));O=K.indexOf(N.charAt(M++));U=(T<<2)|(R>>4);S=((R&15)<<4)|(P>>2);Q=((P&3)<<6)|O;L=L+String.fromCharCode(U);if(P!=64){L=L+String.fromCharCode(S)}if(O!=64){L=L+String.fromCharCode(Q)}}while(M<N.length);return L};MySpace.UI.addStyles=function(N,K,M){if(M){if(A[M]){return}A[M]=true}var L=C("<style type='text/css'>"+N+"</style>");if(K){L.prependTo("head")}else{L.appendTo("head")}};var A={};MySpace.UI.addScript=function(N,M,O){function K(S){var R=S.split(".");for(var Q=window,P=0;P<R.length;P++){if(!(Q=Q[R[P]])){return false}}return true}if(M&&K(M)){if(typeof O=="function"){O()}return}if(!J[N]){C("head")[0].appendChild(C("<script />").attr("src",N)[0]);J[N]=true}if(M){var L=window.setInterval(function(){if(K(M)){window.clearInterval(L);delete J[N];if(typeof O=="function"){O()}}},200)}};var J={};MySpace.UI.addDeferredScript=function(K,M){var L=MySpace.deferredScripts[K.toLowerCase()];MySpace.UI.addScript(L.url,L.test,M)};if(MySpace.deferredScripts&&!queryString.noautoload){C(window).load(function(){var K=0;for(var L in MySpace.deferredScripts){K+=1000;window.setTimeout(Function.createPartial(window,MySpace.UI.addDeferredScript,L),K)}})}MySpace.Util.setJSValue=function(L,N){var O=L.split("."),K=window;for(var M=0;M<O.length-1;M++){K=K[O[M]]=K[O[M]]||{}}K[O[M]]=N};(function(){var M=$q("form.msSearchBox");if(M&&M.length>=1){var K=M[0];var N=$q(".mssbText input",K,true);var L=$q(".mssbSubmit input",K,true)}if(N&&K&&L){$addHandler(N,"focus",function(){if(!msglobalnav.autosuggestscriptloaded){MySpace.UI.addDeferredScript("AutoSuggestSearch.js",function(){$create(MySpace.UI.SearchBox,{searchBtn:L,searchTxtBx:N},null,null,K);msglobalnav.autosuggestscriptloaded=true})}})}})();var B=$get("intlLink");if(B){$addHandler(B,"click",msglobalnav.toggleInternationalLinks)}if(MySpace!=null&&MySpace.ClientContext!=null&&MySpace.ClientContext.DisplayFriendId!=null&&MySpace.ClientContext.DisplayFriendId>0){var D=$q(".disabled",$get("footer"));if(D&&(D.length>0)&&(D[0].nodeName==="SPAN")){var I=D[0].getElementsByTagName("A");if(I&&(I.length>0)){I[0].href+=MySpace.ClientContext.DisplayFriendId}Sys.UI.DomElement.removeCssClass(D[0],"disabled")}}Array.find=function H(P,O,K){for(var N=0,L=P.length;N<L;N++){var M=P[N];if(typeof(M)!=="undefined"&&O.call(K,M)===true){return M}}return null};if(!MySpace.Application.keyDisabled("FrameBuster")&&!window.suppressFrameBuster&&(window!=top)){var G=true;try{G=!top.location.href}catch(E){}G=G&&!(document.referrer.match(/^https?:\/\/[-a-z0-9.]*\.google\.(co\.|com\.)?[a-z]+\/imgres/i))&&!(document.referrer.match(/^https?:\/\/([^\/]*\.)?(myspace\.com|myspace\.cn|simsidekick\.com|levisawards\.com|digg\.com|myspaceespana\.com|eurodemosantander2016\.es)\//i));if(G){top.location.replace(window.location.href)}}registerNamespace("MySpace.Net");MySpace.Net.asmx=function(K){var L=K.useGet?K.params:JSON.stringify(K.params);if(L=="{}"){L=""}C.ajax({url:K.servicePath+"/"+K.methodName,contentType:"application/json; charset=utf-8",data:L,type:K.useGet?"GET":"POST",timeout:K.timeout,context:K.context,success:function(M,O,N){if(K.onSuccess){K.onSuccess.call(K.context,M)}},error:K.onFailure})}})(jQuery);MySpace.UI.hideElements=function(B,A){for(var C=0;C<B.length;C++){var E=document.getElementsByTagName(B[C]);for(var D=0;D<E.length;D++){if(A){E[D].setAttribute("origvis",E[D].style.visibility)}E[D].style.visibility=A?"hidden":(E[D].getAttribute("origvis")?E[D].getAttribute("origvis"):"")}}};MySpace.WebRequest=function(){throw"Cannot instantiate static class."};MySpace.WebRequest.invoke=function(J,I,C,G,A,F,H){if(!C){C={}}var D=new Sys.Net.WebRequest();if(!I){if(typeof C==="string"){var E=(typeof C!=="string")?Sys.Serialization.JavaScriptSerializer.serialize(C):C}if(E==="{}"){E=""}D.set_body(E)}D.set_url(Sys.Net.WebRequest._createUrl(J,(I)?C:{}));D.add_completed(B);if(H&&H>0){D.set_timeout(H)}D.invoke();function B(M,L){if(M.get_responseAvailable()){var P=M.get_statusCode();var K=null;try{var R=M.getResponseHeader("Content-Type");if(R.startsWith("application/json")){K=M.get_object()}else{if(R.startsWith("text/xml")){K=M.get_xml()}else{K=M.get_responseData()}}}catch(O){}if((P<200)||(P>=300)){if(A){if(!K){K=new Sys.Net.WebServiceError(false,"WebRequest failed for an unknown reason.","","")}K._statusCode=P;A(K,F)}else{var N;if(K){N=K.get_exceptionType()+"-- "+K.get_message()}else{N=M.get_responseData()}window.alert("WebRequest Failed: "+N)}}else{if(G){G(K,F)}}}else{var Q;if(M.get_timedOut()){Q="WebRequest timed out."}else{Q="WebRequest failed for an unknown reason."}if(A){A(new Sys.Net.WebServiceError(M.get_timedOut(),Q,"",""),F)}else{alert(Q)}}}return D};MySpace.WebRequest.registerClass("MySpace.WebRequest");MySpace.CMS.cache={};MySpace.CMS.getContent=function(D,E,C){var A=MySpace.CMS.cache[D];if(A&&new Date()<A.expire){E(A.response);return null}MySpace.WebRequest.invoke("/Modules/Common/HttpHandlers/CMS.ashx",false,"placementId="+D,B,null,C,0);function B(H,G){var F=new Date();F.setTime(F.getTime()+120000);MySpace.CMS.cache[D]={response:H,expire:F};if(E){E(H,G)}}return null};MySpace.UI.getElementsByClassName=function(F,E){E=E||document;F=" "+F+" ";var A=E.all||E.getElementsByTagName("*");var B=A.length,D=[],C;for(C=0;C<B;C++){if((" "+A[C].className+" ").indexOf(F)!==-1){D[D.length]=A[C]}}return D};MySpace.UI.getComputedStyle=function(C){switch(Sys.Browser.agent){case Sys.Browser.Safari:var B;if(C instanceof HTMLElement){var A=C.ownerDocument.defaultView;B=A.getComputedStyle(C,null);if(!B&&C.style){C.style.display="";B=A.getComputedStyle(C,null)}}return B||{};case Sys.Browser.InternetExplorer:return C.nodeType==1?C.currentStyle:{};default:return C instanceof HTMLElement?C.ownerDocument.defaultView.getComputedStyle(C,null):{}}};MySpace.UI.getContentBox=function(D){var B=MySpace.UI.getComputedStyle(D);var A={h:parseFloat(B.paddingTop)+parseFloat(B.paddingBottom),w:parseFloat(B.paddingLeft)+parseFloat(B.paddingRight)};var C={h:(B.borderTopStyle!="none"?parseFloat(B.borderTopWidth):0)+(B.borderBottomStyle!="none"?parseFloat(B.borderBottomWidth):0),w:(B.borderLeftStyle!="none"?parseFloat(B.borderLeftWidth):0)+(B.borderRightStyle!="none"?parseFloat(B.borderRightWidth):0)};return{h:D.clientHeight-A.h-C.h,w:D.clientWidth-A.w-C.w}};Sys.UI.Control.overlaps=function(D,B){var H=(D.x>=B.x&&D.x<=(B.x+B.width));var C=((D.x+D.width)>=B.x&&(D.x+D.width)<=B.x+B.width);var G=((D.x<B.x)&&((D.x+D.height)>(B.x+B.height)));var E=(D.y>=B.y&&D.y<=(B.y+B.height));var A=((D.y+D.height)>=B.y&&(D.y+D.height)<=B.y+B.height);var F=((D.y<B.y)&&((D.y+D.height)>(B.y+B.height)));if((H||C||G)&&(E||A||F)){return true}return false};Type.registerNamespace("MySpace.FlashDetection");MySpace.FlashDetection=function(){return this};MySpace.FlashDetection.prototype={getFlashVersion:function(B){var A=B.match(/[\d]+/g);A.length=3;return A.join(".")},removeFlashVersionPrefix:function(B){var A=B.split(" ");if(A.length==1){return A}else{if(A.length>1){return A[1]}else{return B}}},hasRequiredFlashVersion:function(C){var D=(C.toString()+".0.0");var E=C;var F=0;var M="0.0.0";var H=(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;if(H){var J=navigator.plugins["Shockwave Flash"].description.split(" ");for(var G=0;G<J.length;++G){if(isNaN(parseInt(J[G]))){continue}M=J[G]}F=M>=E}else{if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(navigator.appVersion.indexOf("Win")!=-1)){try{var K=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");var A=this.removeFlashVersionPrefix(K.GetVariable("$version"));var M=this.getFlashVersion(A)}catch(I){try{var K=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");A=K.GetVariable("$version");M=this.getFlashVersion(A)}catch(I){try{var K=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");A=K.GetVariable("$version");M="6.0.21"}catch(I){try{var K=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");A=K.GetVariable("$version");M=this.getFlashVersion(A)}catch(I){}}}}var L=M.split(".");var B=D.split(".");B[0]=parseInt(B[0],10);B[1]=parseInt(B[1],10);B[2]=parseInt(B[2],10);L[0]=parseInt(L[0],10);L[1]=parseInt(L[1],10);L[2]=parseInt(L[2],10);F=(L[0]>B[0]||(L[0]==B[0]&&L[1]>B[1])||(L[0]==B[0]&&L[1]==B[1]&&L[2]>=B[2]))?true:false}}return F}};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);MySpace.UI.AutoCompleteBehavior=function(A){MySpace.UI.AutoCompleteBehavior.initializeBase(this,[A]);this._servicePath=null;this._serviceMethod=null;this._serviceParams=null;this._isJsonpService=false;this._contextKey=null;this._useContextKey=false;this._minimumPrefixLength=3;this._triggerPrefix="";this._completionItems=null;this._completionInterval=1000;this._completionListWrapperID=null;this._completionListElementID=null;this._completionListAlwaysVisible=false;this._closeObsoleteResults=true;this._currentPrefix=null;this._selectIndex=-1;this._enableCaching=true;this._enableCacheSubstrings=false;this._flyoutHasFocus=false;this._textBoxHasFocus=false;this._completionListCssClass=null;this._completionListItemCssClass=null;this._completionListFixedHeight=null;this._completionListMaxHeight=200;this._completionListWidth=null;this._lazyLoadPlaceholderHeight=null;this._groupHeaderCssClass=null;this._highlightedItemCssClass=null;this._delimiterCharacters=null;this._firstRowSelected=false;this._showOnlyCurrentWordInCompletionListItem=false;this._webRequest=null;this._postParameterName="prefixText"};MySpace.UI.AutoCompleteBehavior.prototype={initialize:function(){MySpace.UI.AutoCompleteBehavior.callBaseMethod(this,"initialize");this._popupBehaviorHiddenHandler=Function.createDelegate(this,this._popupHidden);this._tickHandler=Function.createDelegate(this,this._onTimerTick);this._focusHandler=Function.createDelegate(this,this._onGotFocus);this._blurHandler=Function.createDelegate(this,this._onLostFocus);this._keyDownHandler=Function.createDelegate(this,this._onKeyDown);this._mouseDownHandler=Function.createDelegate(this,this._onListMouseDown);this._mouseUpHandler=Function.createDelegate(this,this._onListMouseUp);this._mouseOverHandler=Function.createDelegate(this,this._onListMouseOver);this._mouseOutHandler=Function.createDelegate(this,this._onListMouseOut);this._completionListBlurHandler=Function.createDelegate(this,this._onCompletionListBlur);this._completionListScrollHandler=Function.createDelegate(this,this._drawMissingItems);this._bodyClickHandler=Function.createDelegate(this,this._onBodyClick);this.initializeTextBox();if(this._completionListElementID!==null){this._completionListElement=$get(this._completionListElementID)}if(this._completionListElement==null){this._completionListElement=document.createElement("div");this._completionListElement.id=this.get_id()+"_completionListElem";this._getOuterEl().parentNode.insertBefore(this._completionListElement,this._getOuterEl().nextSibling)}if(this._completionListWrapperID){this._completionListWrapper=$get(this._completionListWrapperID)}else{this._completionListWrapper=this._completionListElement}this.initializeCompletionList();if(this._completionListAlwaysVisible){this._onTimerTick()}else{this._popupBehavior=$create(MySpace.UI.PopupBehavior,{id:this.get_id()+"PopupBehavior",parentElement:this._getOuterEl(),positioningMode:MySpace.UI.PositioningMode.BottomLeft},null,null,this._completionListWrapper);this._popupBehavior.add_hidden(this._popupBehaviorHiddenHandler);if(this._onShow){this._popupBehavior.set_onShow(this._onShow)}if(this._onHide){this._popupBehavior.set_onHide(this._onHide)}}},dispose:function(){if(this._popupBehavior){if(this._popupBehaviorHiddenHandler){this._popupBehavior.remove_hidden(this._popupBehaviorHiddenHandler)}this._popupBehavior.dispose();this._popupBehavior=null}this._stopTimer();if(this._completionListElement){$removeHandler(this._completionListElement,"blur",this._completionListBlurHandler);$removeHandler(this._completionListElement,"scroll",this._completionListScrollHandler);$removeHandler(this._completionListElement,"mousedown",this._mouseDownHandler);$removeHandler(this._completionListElement,"mouseup",this._mouseUpHandler);$removeHandler(this._completionListElement,"mouseover",this._mouseOverHandler);$removeHandler(this._completionListElement,"mouseout",this._mouseOutHandler)}if(this._bodyClickHandler){$removeHandler(document.body,"click",this._bodyClickHandler);this._bodyClickHandler=null}this._popupBehaviorHiddenHandler=null;this._tickHandler=null;this._focusHandler=null;this._blurHandler=null;this._keyDownHandler=null;this._completionListBlurHandler=null;this._mouseDownHandler=null;this._mouseUpHandler=null;this._mouseOverHandler=null;this._mouseOutHandler=null;MySpace.UI.AutoCompleteBehavior.callBaseMethod(this,"dispose")},_startTimer:function(){this._intervalId=window.setInterval(this._tickHandler,this._completionInterval)},_stopTimer:function(){window.clearInterval(this._intervalId)},initializeTextBox:function(){var A=this._getInnerEl();A.autocomplete="off";A.setAttribute("autocomplete","off");$addHandler(A,"focus",this._focusHandler);$addHandler(A,"blur",this._blurHandler);$addHandler(A,"keydown",this._keyDownHandler)},initializeCompletionList:function(){var B=this._completionListElement;var D=this._completionListWrapper;var C=B.style;if(this._completionListCssClass){Sys.UI.DomElement.addCssClass(B,this._completionListCssClass)}else{C.textAlign="left";C.overflow="auto";C.overflowX="hidden";C.cursor="default";C.padding="0px";C.margin="0px! important";if(Sys.Browser.agent===Sys.Browser.Safari){C.border="solid 1px gray";C.backgroundColor="white";C.color="black"}else{C.border="solid 1px buttonshadow";C.backgroundColor="window";C.color="windowtext"}if(this._completionListAlwaysVisible){if(this.get_servicePath()){C.background='url("'+MySpace.StaticContentBase+'/modules/common/static/img/loadercircles.gif") center center no-repeat'}}else{D.style.visibility="hidden"}var A=Sys.UI.DomElement.getBounds(this._getOuterEl());this._completionListElement.style.width=(this.get_completionListWidth()||Math.max(1,A.width-2))+"px"}if(this._completionListFixedHeight){C.height=this._completionListFixedHeight+"px"}$addHandler(B,"mousedown",this._mouseDownHandler);$addHandler(B,"mouseup",this._mouseUpHandler);$addHandler(B,"mouseover",this._mouseOverHandler);$addHandler(B,"mouseout",this._mouseOutHandler);$addHandler(B,"blur",this._completionListBlurHandler);$addHandler(B,"scroll",this._completionListScrollHandler);$addHandler(document.body,"click",this._bodyClickHandler)},_currentCompletionWord:function(){var E=this.get_value();var C=E;if(this.get_isMultiWord()){var D=this._getCurrentWordStartIndex();var B=this._getCurrentWordEndIndex(D);if(B<=D){C=E.substring(D)}else{C=E.substring(D,B)}}var A=this.get_triggerPrefix().toLowerCase();if(A){if(!C.toLowerCase().startsWith(A)){return""}else{return C.substring(A.length)}}else{return C}},_getCursorIndex:function(){return this.get_element().selectionStart},_getCurrentWordStartIndex:function(){var D=this.get_value().substring(0,this._getCursorIndex());var A=0;var E=-1;for(var C=0;C<this._delimiterCharacters.length;++C){var B=D.lastIndexOf(this._delimiterCharacters.charAt(C));if(B>E){E=B}}A=E;if(A>=this._getCursorIndex()){A=0}return A<0?0:A+1},_getCurrentWordEndIndex:function(A){var F=this.get_value();var E=F.substring(A);var B=0;for(var D=0;D<this._delimiterCharacters.length;++D){var C=E.indexOf(this._delimiterCharacters.charAt(D));if(C>0&&(C<B||B==0)){B=C}}return B<=0?F.length:B+A},get_isMultiWord:function(){return(this._delimiterCharacters!=null)&&(this._delimiterCharacters!="")},_getTextWithInsertedWord:function(A){var H=A;var G=0;var F=this.get_value();if(this.get_isMultiWord()){var E=this._getCurrentWordStartIndex();var C=this._getCurrentWordEndIndex(E);var B="";var D="";if(E>0){B=F.substring(0,E)}if(C>E){D=F.substring(C)}H=B+A+D}return H},_hideCompletionList:function(){if(!(this._popupBehavior&&this._popupBehavior.get_visible())){return}var A=new Sys.CancelEventArgs();this.raiseHiding(A);if(A.get_cancel()){return}this.hidePopup()},showPopup:function(){if(this._popupBehavior){this._popupBehavior.show();this.raiseShown(Sys.EventArgs.Empty)}},hidePopup:function(){if(this._popupBehavior){this._popupBehavior.hide()}else{this._popupHidden()}},_popupHidden:function(){this._completionListElement.innerHTML="";this._selectIndex=-1;this._flyoutHasFocus=false;this.raiseHidden(Sys.EventArgs.Empty)},_highlightItem:function(C){var B=this._completionListElement.childNodes;for(var A=0;A<B.length;A++){var D=B[A];if(D._highlighted){D._highlighted=false;if(this._completionListItemCssClass){Sys.UI.DomElement.removeCssClass(D,this._highlightedItemCssClass);Sys.UI.DomElement.addCssClass(D,this._completionListItemCssClass)}else{if(Sys.Browser.agent===Sys.Browser.Safari){D.style.backgroundColor="white";D.style.color="black"}else{D.style.backgroundColor="window";D.style.color="windowtext"}}this.raiseItemOut(new MySpace.UI.AutoCompleteItemEventArgs(D,D.firstChild.nodeValue,D._value))}}if(C){if(this._highlightedItemCssClass){Sys.UI.DomElement.removeCssClass(C,this._completionListItemCssClass);Sys.UI.DomElement.addCssClass(C,this._highlightedItemCssClass)}else{if(Sys.Browser.agent===Sys.Browser.Safari){C.style.backgroundColor="lemonchiffon"}else{C.style.backgroundColor="highlight";C.style.color="highlighttext"}}C._highlighted=true;if(!C._isPlaceholder){this.raiseItemOver(new MySpace.UI.AutoCompleteItemEventArgs(C,C.firstChild.nodeValue,C._value))}}},_onBodyClick:function(A){var B=A.target;while(B){if(B==this._completionListWrapper){return}B=B.parentNode}this._onCompletionListBlur(A)},_onCompletionListBlur:function(A){this._hideCompletionList()},_getCompletionItem:function(A){while(A){if(A.parentNode==this._completionListElement&&!A._isGroupHeader){return A}A=A.parentNode}},_onListMouseDown:function(B){var A=this._getCompletionItem(B.target);if(A){this._setText(A);this._flyoutHasFocus=false;B.stopPropagation()}else{this._flyoutHasFocus=true}},_onListMouseUp:function(A){if(!this._flyoutHasFocus){try{this._getInnerEl().focus()}catch(B){}}},_onListMouseOver:function(B){var A=B.target;if(A!==this._completionListElement){A=this._getCompletionItem(A);if(A){this._highlightItem(A);this._selectIndex=Array.indexOf(A.parentNode.childNodes,A)}}},_onListMouseOut:function(B){if(B.target==this._completionListElement){this._highlightItem(null)}else{var A=this._getCompletionItem(B.target);if(A&&A._highlighted){this._highlightItem(null)}}},_onGotFocus:function(A){this._textBoxHasFocus=true;if(this._flyoutHasFocus){this._hideCompletionList()}if((this._minimumPrefixLength==0)&&(!this.get_value())){this._startTimer()}},_onKeyDown:function(C){this._stopTimer();var A=C.keyCode?C.keyCode:C.rawEvent.keyCode;if(A===Sys.UI.Key.esc){if(this._popupBehavior&&this._popupBehavior.get_visible()){this._hideCompletionList();C.preventDefault();C.stopPropagation()}}else{if(A===Sys.UI.Key.up){var B=this._getAdjacentItemIndex(this._selectIndex,-1);if(B>=0){this._selectIndex=B;this._handleScroll(this._completionListElement.childNodes[B],B);this._highlightItem(this._completionListElement.childNodes[B]);C.stopPropagation();C.preventDefault()}}else{if(A===Sys.UI.Key.down){var B=this._getAdjacentItemIndex(this._selectIndex,1);if(B<this._completionListElement.childNodes.length){this._selectIndex=B;this._handleScroll(this._completionListElement.childNodes[B],B);this._highlightItem(this._completionListElement.childNodes[B]);C.stopPropagation();C.preventDefault()}}else{if(A===Sys.UI.Key.enter){if(this._selectIndex!==-1){this._setText(this._completionListElement.childNodes[this._selectIndex]);C.preventDefault();C.stopPropagation()}else{this.hidePopup()}}else{if(A===Sys.UI.Key.tab){if(this._selectIndex!==-1){this._setText(this._completionListElement.childNodes[this._selectIndex]);if(this.get_isMultiWord()){C.preventDefault();C.stopPropagation()}}}else{this._startTimer()}}}}}},_getAdjacentItemIndex:function(A,C){var B=this._completionListElement.childNodes;do{A+=C}while(A>=0&&A<B.length&&B[A]._isGroupHeader);return A},_handleScroll:function(F,E){var C=this._completionListElement,B=F.offsetHeight||0,G=F.offsetParent==C,H=G?0:C.offsetTop;var A=F.offsetTop-H+B-C.scrollTop-C.offsetHeight;if(A>0){C.scrollTop+=A}var D=C.scrollTop-F.offsetTop+H;if(D>0){C.scrollTop-=D}},_handleFlyoutFocus:function(){if(!this._textBoxHasFocus){if(!this._flyoutHasFocus){if(this._webRequest){this._webRequest.get_executor().abort();this._webRequest=null}this._hideCompletionList()}else{}}},_onLostFocus:function(){this._textBoxHasFocus=false;this._stopTimer();window.setTimeout(Function.createDelegate(this,this._handleFlyoutFocus),500)},_onMethodComplete:function(A,B){this._webRequest=null;if(this._completionListElement){this._completionListElement.style.backgroundImage=""}this._update(B,A,true)},_onMethodFailed:function(C,A,B){this._webRequest=null},_onTimerTick:function(D,C){this._stopTimer();var E=this._currentCompletionWord();if(E.trim().length<this._minimumPrefixLength){this._currentPrefix=null;this._update("",null,false);return}var A=(!this._popupBehavior||this._popupBehavior.get_visible());if((this._currentPrefix!==E||!A)||((E=="")&&(this._minimumPrefixLength==0)&&!this._webRequest)){this._currentPrefix=E;if(this._cache){var B=this._getCachedItems(E);if(B){this._update(E,B,false);return}}var C=new Sys.CancelEventArgs();this.raisePopulating(C);if(C.get_cancel()){return}this._fetchCompletionItems(E)}},_getCachedItems:function(B){if(!this._cache){return null}if(this._cache[B]){return this._cache[B]}if(this.get_enableCacheSubstrings()){for(var A in this._cache){if(B.startsWith(A)){this._completionItems=this._cache[A];return this.getCompletionItems(B)}}}return null},_fetchCompletionItems:function(C){if(this._servicePath&&(this._isJsonpService||this._serviceMethod)){var D={};D[this._postParameterName]=this._currentPrefix;if(this._serviceParams){for(var A in this._serviceParams){D[A]=this._serviceParams[A]}}if(this._useContextKey){D.contextKey=this._contextKey}if(this._isJsonpService){MySpace.Net.JsonpWebServiceProxy.invoke(this.get_servicePath(),D,Function.createDelegate(this,this._onMethodComplete),Function.createDelegate(this,this._onMethodFailed),null,C)}else{if(this._webRequest){this._webRequest.get_executor().abort();this._webRequest=null}this._webRequest=Sys.Net.WebServiceProxy.invoke(this.get_servicePath(),this.get_serviceMethod(),false,D,Function.createDelegate(this,this._onMethodComplete),Function.createDelegate(this,this._onMethodFailed),C)}}else{var B=this.getCompletionItems(C);if(B){this._update(C,B)}}},getCompletionItems:function(D){D=D.toLowerCase();var C=[];for(var A=0;A<this._completionItems.length;A++){var B=this._completionItems[A];if((B.text||B).toLowerCase().startsWith(D)){C.push(this._completionItems[A])}}return C},_setText:function(A){var C=null;if(A){C=A._text||(A.firstChild?A.firstChild.nodeValue:null)}this._stopTimer();var B=this._showOnlyCurrentWordInCompletionListItem?this._getTextWithInsertedWord(C):C;this.set_value(B,true);this.raiseItemSelected(new MySpace.UI.AutoCompleteItemEventArgs(A,C,A?A._value:null));this._currentPrefix=this._currentCompletionWord();this._hideCompletionList()},_update:function(E,H,J){if(J&&this.get_enableCaching()){if(!this._cache){this._cache={}}this._cache[E]=H}this._currentCompletionItems=H;if((!this._completionListAlwaysVisible&&!this._textBoxHasFocus)||(this._closeObsoleteResults&&E!=this._currentCompletionWord())){this._hideCompletionList();return}if(this._completionListAlwaysVisible||(H&&H.length)){this._completionListElement.innerHTML="";this._selectIndex=-1;var L=null,K=null,I=null,C=null,B=this._lazyLoadPlaceholderHeight;for(var D=0;D<H.length;D++){if(H[D]&&H[D].groupHeader){C=this.createGroupHeader(H[D])}else{if(B){C=document.createElement("div");C.style.height=B+"px";C._isPlaceholder=true}else{C=this.createCompletionItem(H[D]);if(L==null){L=C}}}this._completionListElement.appendChild(C)}var G=Sys.UI.DomElement.getBounds(this._getOuterEl());this._completionListElement.style.width=(this.get_completionListWidth()||Math.max(1,G.width-2))+"px";var F=new Sys.EventArgs();F.completionItems=H;F.completionListElement=this._completionListElement;this.raisePopulated(F);var A=new Sys.CancelEventArgs();this.raiseShowing(A);if(!A.get_cancel()){if(!this._completionListFixedHeight){this._completionListElement.style.height="1px"}this.showPopup();if(!this._completionListFixedHeight){this._completionListElement.style.height="";if(this._completionListElement.offsetHeight>this._completionListMaxHeight){this._completionListElement.style.height=this._completionListMaxHeight+"px"}}this._completionListElement.scrollTop=0;if(this._firstRowSelected&&(L!=null)){this._highlightItem(L);this._selectIndex=0}this._drawMissingItems()}}else{this._hideCompletionList()}},_drawMissingItems:function(){var F=this._completionListElement,D=F.childNodes[0]&&(F.childNodes[0].offsetParent==F),E=D?0:F.offsetTop,I=E+F.scrollTop-4*this._lazyLoadPlaceholderHeight,G=I+F.offsetHeight+8*this._lazyLoadPlaceholderHeight,H=F.childNodes.length,A=null;for(var C=0;C<H;C++){A=F.childNodes[C];if(A.offsetTop<I){continue}if(A.offsetTop>G){break}if(A._isPlaceholder){var B=this.createCompletionItem(this._currentCompletionItems[C]);F.replaceChild(B,A);if(this._selectIndex==-1&&this._firstRowSelected){this._highlightItem(B);this._selectIndex=C}}}},createCompletionItem:function(C){var B=document.createElement("div");var E,D;if(C&&C.text){E=C.text;D=C.value}else{E=C;D=C}var F=this._showOnlyCurrentWordInCompletionListItem?E:this._getTextWithInsertedWord(E);B.innerHTML=F;B._value=D;if(this._completionListItemCssClass){Sys.UI.DomElement.addCssClass(B,this._completionListItemCssClass)}else{var A=B.style;A.padding="0px";A.textAlign="left";A.textOverflow="ellipsis";A.cursor="pointer";if(Sys.Browser.agent===Sys.Browser.Safari){A.backgroundColor="white";A.color="black"}else{A.backgroundColor="window";A.color="windowtext"}}return B},createGroupHeader:function(C){var B=document.createElement("div");B.appendChild(document.createTextNode(C.groupHeader));B._isGroupHeader=true;if(this._groupHeaderCssClass){Sys.UI.DomElement.addCssClass(B,this._groupHeaderCssClass)}else{var A=B.style;A.fontWeight="bold";A.fontStyle="italic"}return B},_getInnerEl:function(){return this.get_element()},_getOuterEl:function(){return this.get_element()},get_value:function(){var B=this.get_element();var A=Sys.UI.Behavior.getBehaviorByName(B,"DefaultTextboxBehavior");return A?A.get_value():B.value},set_value:function(D,C){var B=this.get_element();var A=Sys.UI.Behavior.getBehaviorByName(B,"DefaultTextboxBehavior");if(A){A.set_value(D)}else{B.value=D||""}if(!C){this._onTimerTick()}},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShow},set_onShow:function(A){if(this._popupBehavior){this._popupBehavior.set_onShow(A)}else{this._onShow=A}},onShow:function(){if(this._popupBehavior){this._popupBehavior.onShow()}},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHide},set_onHide:function(A){if(this._popupBehavior){this._popupBehavior.set_onHide(A)}else{this._onHide=A}},onHide:function(){if(this._popupBehavior){this._popupBehavior.onHide()}},get_visible:function(){return this._popupBehavior&&this._popupBehavior.get_visible()},get_completionItems:function(){return this._completionItems},set_completionItems:function(A){this._completionItems=A},get_completionInterval:function(){return this._completionInterval},set_completionInterval:function(A){this._completionInterval=A},get_completionList:function(){return this._completionListElement},set_completionList:function(A){this._completionListElement=A},get_minimumPrefixLength:function(){return this._minimumPrefixLength},set_minimumPrefixLength:function(A){this._minimumPrefixLength=A},get_triggerPrefix:function(){return this._triggerPrefix},set_triggerPrefix:function(A){this._triggerPrefix=A},get_serviceMethod:function(){return this._serviceMethod},set_serviceMethod:function(A){this._serviceMethod=A},get_servicePath:function(){return this._servicePath},set_servicePath:function(A){this._servicePath=A},get_serviceParams:function(){return this._serviceParams},set_serviceParams:function(A){this._serviceParams=A},get_isJsonpService:function(){return this._isJsonpService},set_isJsonpService:function(A){this._isJsonpService=A},get_contextKey:function(){return this._contextKey},set_contextKey:function(A){this._contextKey=A;this.set_useContextKey(true)},get_useContextKey:function(){return this._useContextKey},set_useContextKey:function(A){this._useContextKey=A},get_enableCaching:function(){return this._enableCaching},set_enableCaching:function(A){this._enableCaching=A},get_enableCacheSubstrings:function(){return this._enableCacheSubstrings},set_enableCacheSubstrings:function(A){this._enableCacheSubstrings=A},get_completionListWrapperID:function(){return this._completionListWrapperID},set_completionListWrapperID:function(A){this._completionListWrapperID=A},get_completionListElementID:function(){return this._completionListElementID},set_completionListElementID:function(A){this._completionListElementID=A},get_completionListAlwaysVisible:function(){return this._completionListAlwaysVisible},set_completionListAlwaysVisible:function(A){this._completionListAlwaysVisible=A},get_completionListCssClass:function(){return this._completionListCssClass},set_completionListCssClass:function(A){this._completionListCssClass=A},get_completionListItemCssClass:function(){return this._completionListItemCssClass},set_completionListItemCssClass:function(A){this._completionListItemCssClass=A},get_completionListFixedHeight:function(){return this._completionListFixedHeight},set_completionListFixedHeight:function(A){this._completionListFixedHeight=A},get_completionListMaxHeight:function(){return this._completionListMaxHeight},set_completionListMaxHeight:function(A){this._completionListMaxHeight=A},get_completionListWidth:function(){return this._completionListWidth},set_completionListWidth:function(A){this._completionListWidth=A},get_lazyLoadPlaceholderHeight:function(){return this._lazyLoadPlaceholderHeight},set_lazyLoadPlaceholderHeight:function(A){this._lazyLoadPlaceholderHeight=A},get_groupHeaderCssClass:function(){return this._groupHeaderCssClass},set_groupHeaderCssClass:function(A){this._groupHeaderCssClass=A},get_highlightedItemCssClass:function(){return this._highlightedItemCssClass},set_highlightedItemCssClass:function(A){this._highlightedItemCssClass=A},get_delimiterCharacters:function(){return this._delimiterCharacters},set_delimiterCharacters:function(A){this._delimiterCharacters=A},get_firstRowSelected:function(){return this._firstRowSelected},set_firstRowSelected:function(A){this._firstRowSelected=A},get_showOnlyCurrentWordInCompletionListItem:function(){return this._showOnlyCurrentWordInCompletionListItem},set_showOnlyCurrentWordInCompletionListItem:function(A){this._showOnlyCurrentWordInCompletionListItem=A},get_closeObsoleteResults:function(){return this._closeObsoleteResults},set_closeObsoleteResults:function(A){this._closeObsoleteResults=A},get_postParameterName:function(){return this._postParameterName},set_postParameterName:function(A){this._postParameterName=A},add_populating:function(A){this.get_events().addHandler("populating",A)},remove_populating:function(A){this.get_events().removeHandler("populating",A)},raisePopulating:function(A){var B=this.get_events().getHandler("populating");if(B){B(this,A)}},add_populated:function(A){this.get_events().addHandler("populated",A)},remove_populated:function(A){this.get_events().removeHandler("populated",A)},raisePopulated:function(A){var B=this.get_events().getHandler("populated");if(B){B(this,A)}},add_showing:function(A){this.get_events().addHandler("showing",A)},remove_showing:function(A){this.get_events().removeHandler("showing",A)},raiseShowing:function(A){var B=this.get_events().getHandler("showing");if(B){B(this,A)}},add_shown:function(A){this.get_events().addHandler("shown",A)},remove_shown:function(A){this.get_events().removeHandler("shown",A)},raiseShown:function(A){var B=this.get_events().getHandler("shown");if(B){B(this,A)}},add_hiding:function(A){this.get_events().addHandler("hiding",A)},remove_hiding:function(A){this.get_events().removeHandler("hiding",A)},raiseHiding:function(A){var B=this.get_events().getHandler("hiding");if(B){B(this,A)}},add_hidden:function(A){this.get_events().addHandler("hidden",A)},remove_hidden:function(A){this.get_events().removeHandler("hidden",A)},raiseHidden:function(A){var B=this.get_events().getHandler("hidden");if(B){B(this,A)}},add_itemSelected:function(A){this.get_events().addHandler("itemSelected",A)},remove_itemSelected:function(A){this.get_events().removeHandler("itemSelected",A)},raiseItemSelected:function(A){var B=this.get_events().getHandler("itemSelected");if(B){B(this,A)}},add_itemOver:function(A){this.get_events().addHandler("itemOver",A)},remove_itemOver:function(A){this.get_events().removeHandler("itemOver",A)},raiseItemOver:function(A){var B=this.get_events().getHandler("itemOver");if(B){B(this,A)}},add_itemOut:function(A){this.get_events().addHandler("itemOut",A)},remove_itemOut:function(A){this.get_events().removeHandler("itemOut",A)},raiseItemOut:function(A){var B=this.get_events().getHandler("itemOut");if(B){B(this,A)}}};MySpace.UI.AutoCompleteBehavior.registerClass("MySpace.UI.AutoCompleteBehavior",Sys.UI.Behavior);MySpace.UI.AutoCompleteItemEventArgs=function(A,C,B){MySpace.UI.AutoCompleteItemEventArgs.initializeBase(this);this._item=A;this._text=C;this._value=(B!==undefined)?B:null};MySpace.UI.AutoCompleteItemEventArgs.prototype={get_item:function(){return this._item},set_item:function(A){this._item=A},get_text:function(){return this._text},set_text:function(A){this._text=A},get_value:function(){return this._value},set_value:function(A){this._value=A}};MySpace.UI.AutoCompleteItemEventArgs.registerClass("MySpace.UI.AutoCompleteItemEventArgs",Sys.EventArgs);MySpace.Beacon=new (function(H){var G=0;this.SendPageBeacon=function(X){if(MySpace.ManualPageBeacon){return}if(MySpace.BeaconData){var V=swfobject.getFlashPlayerVersion();MySpace.BeaconData.cef=(document.cookie?1:0);MySpace.BeaconData.cfv=V.major+":"+V.minor+":"+V.release;var W=document.URL.split("#");for(var S=1;S<W.length;S++){if(W[S].indexOf("pm_cmp=")===0||W[S].indexOf("mssrc=")===0){if(MySpace.BeaconData.qs===""||MySpace.BeaconData.qs.substr(-1)==="&"){MySpace.BeaconData.qs+=W[S]}else{MySpace.BeaconData.qs+="&"+W[S]}}}if(MySpace.BeaconData.pggd===""||X===true){MySpace.BeaconData.pggd=M()}if(MySpace.IsBeaconHeatMapEnabled){var Q=C();MySpace.BeaconData.kvp+="screenw="+screen.width+"&screenh="+screen.height+"&vieww="+Q.width+"&viewh="+Q.height+"&"}if(MySpace.AdditionalPageBeaconKVPs){var U=MySpace.AdditionalPageBeaconKVPs;for(var R in U){MySpace.BeaconData.kvp+=R+"="+encodeURIComponent(U[R])+"&"}}D();var T=L(MySpace.BeaconData);J(T,false,null,false)}P()};this.Request=function(Q){if(MySpace.BeaconData&&MySpace.BeaconData.pggd){beaconData=B(Q);var R=L(beaconData);J(R,false,null,true)}};function J(T,U,Q,S){var R=H("<img>").css({height:0,width:0,display:"none",position:"absolute",left:-1,top:-1}).prependTo(document.body);if(S){R.load(function(){try{R.remove()}catch(V){}})}else{G=1;R.attr("id","msbeacon").bind({load:function(){G=2},error:function(){G=3},abort:function(){G=4}})}R.attr("src",T);if(Q&&Q.length>0){document.location=Q}}function O(){var R=new Date();var Q=(R.getTime()/1000)*1000;return Q}function M(){return E()+E()+"-"+E()+"-"+E()+"-"+E()+"-"+E()+E()+E()}function E(){return(((1+Math.random())*65536)|0).toString(16).substring(1)}function P(){if(MySpace.Beacon.ClickTrack&&MySpace.BeaconData){for(var R in MySpace.Beacon.ClickTrack){var Q=H("a."+R+":first");if(!Q.attr("onclick")){Q.click(Function.createPartial(this,F,R,Q))}}}}function D(){if(MySpace.Beacon.DisplayTrack&&MySpace.BeaconData){var Q={};H.each(MySpace.Beacon.DisplayTrack,function(S,T){H(T).each(function(U,Y){var W=H(Y).attr("bdata");if(W){var Z="eval",V=window[Z](W);for(var X in V){if(Q[X]){Q[X]+=","+V[X]}else{Q[X]=V[X]}}}})});for(var R in Q){MySpace.BeaconData.kvp+=R+"="+encodeURIComponent(Q[R])+"&"}}}function F(Q,T,R){if(MySpace.Beacon.ClickTrack[Q]){var W=MySpace.Beacon.ClickTrack[Q],S=T.attr("href"),V=B(W),U=L(V);R.preventDefault();J(U,true,S,true)}}var K=0;function B(Q){if(MySpace.BeaconData&&MySpace.BeaconData.pggd){K++;var R={dsid:"3",dsv:"1",pggd:MySpace.BeaconData.pggd,pid:MySpace.BeaconData.pid,t:MySpace.BeaconData.t,ct:O(),kvp:"pf="+MySpace.ClientContext.FunctionalContext+"&seq="+K+"&pvs="+G+"&userid="+MySpace.BeaconData.uid+"&"};if(Q){for(var S in Q){R.kvp+=S+"="+encodeURIComponent(Q[S])+"&"}}return R}}function L(T){var S=document.location.protocol+"//b.myspace.com/~myspace/beacon/b.ashx?";if(MySpace.BeaconAddress&&MySpace.BeaconAddress.length>0){S=MySpace.BeaconAddress}T.ct=O();if(!MySpace.Application.keyDisabled("DWBeaconBase64")){var Q="";for(var R in T){if(R=="dsid"||R=="dsv"){S+=R+"="+encodeURIComponent(T[R])+"&"}else{Q+=R+"="+encodeURIComponent(T[R])+"&"}}S+="b="+encodeURIComponent(MySpace.Util.Base64Encode(Q,true))}else{for(var R in T){S+=R+"="+encodeURIComponent(T[R])+"&"}}return S}function C(){var Q=document.body.clientWidth;var R=document.body.clientHeight;if(document.compatMode=="CSS1Compat"){R=document.documentElement.clientWidth;Q=document.documentElement.clientHeight}return{height:Q,width:R}}function A(V){var T=V.srcElement||V.target;var U="";while(T.nodeName!="BODY"&&(!T.id||T.id==="undefined")){var R=T.parentNode;var W=R.childNodes;var S=0;for(var Q=0;Q<W.length;Q++){if(W[Q].nodeName==T.nodeName){if(W[Q]==T){break}S++}}if(S===W.length){S="UNKNOWN"}U=T.nodeName+"_"+S+"|"+U;T=T.parentNode}if(!T.id){U="|"+T.nodeName+"_0|"+U}else{U=T.id+"|"+U}return U}var I=-1;function N(Q){try{if(Q.button!==0){return}var S=C();if(Q.clientX<S.width&&Q.clientY<S.height){var R=new Date();if(R-I>=1000){I=R;MySpace.Beacon.Request({dompath:A(Q)})}}}catch(T){}}if(MySpace.IsBeaconHeatMapEnabled){H(document).mousedown(N)}})(jQuery);MySpace.UI.ComboBoxBehavior=function(A){MySpace.UI.ComboBoxBehavior.initializeBase(this,[A]);this._lazyLoadPlaceholderHeight=13};MySpace.UI.ComboBoxBehavior.prototype={initialize:function(){MySpace.UI.ComboBoxBehavior.callBaseMethod(this,"initialize");var A=this.get_element();var B=A.nextSibling;Sys.UI.DomElement.addCssClass(A,"msComboBox");if(B&&Sys.UI.DomElement.containsCssClass(B,"msComboBoxArrow")){this._arrowNode=B}else{B=this._arrowNode=document.createElement("img");B.src="http://x.myspacecdn.com/modules/common/static/img/spacer.gif";B.className="msComboBoxArrow";B.style.height=(A.offsetHeight-2)+"px";if(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1){Sys.UI.DomElement.addCssClass(B,"msComboBoxArrowSafari")}if(A.nextSibling){A.parentNode.insertBefore(B,A.nextSibling)}else{A.parentNode.appendChild(B)}}$addHandler(B,"click",Function.createDelegate(this,this._toggleComboBoxList))},_toggleComboBoxList:function(A){if(this._popupBehavior&&this._popupBehavior.get_visible()){this.hidePopup()}else{this._textBoxHasFocus=true;this._showingFullList=true;this._fetchCompletionItems("");this._showingFullList=false}A.stopPropagation()},_onKeyDown:function(B){var A=B.keyCode?B.keyCode:B.rawEvent.keyCode;if(A==Sys.UI.Key.down&&this._popupBehavior&&!this._popupBehavior.get_visible()){this._toggleComboBoxList(B)}else{MySpace.UI.ComboBoxBehavior.callBaseMethod(this,"_onKeyDown",arguments)}},_currentCompletionWord:function(){if(this._showingFullList){return""}else{return MySpace.UI.ComboBoxBehavior.callBaseMethod(this,"_currentCompletionWord")}},get_completionListWidth:function(){var A=Sys.UI.DomElement.getBounds(this.get_element());return A.width+(this._arrowNode?this._arrowNode.offsetWidth:0)-2}};MySpace.UI.ComboBoxBehavior.registerClass("MySpace.UI.ComboBoxBehavior",MySpace.UI.AutoCompleteBehavior);MySpace.UI._DragDropManager=function(){};MySpace.UI._DragDropManager.prototype={_instance:null,_events:null,add_dragStart:function(A){this.get_events().addHandler("dragStart",A)},remove_dragStart:function(A){this.get_events().removeHandler("dragStart",A)},get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList}return this._events},add_dragStop:function(A){this.get_events().addHandler("dragStop",A)},remove_dragStop:function(A){this.get_events().removeHandler("dragStop",A)},add_afterDragStart:function(A){this.get_events().addHandler("afterDragStart",A)},remove_afterDragStart:function(A){this.get_events().removeHandler("afterDragStart",A)},_getInstance:function(){if(!this._instance){this._instance=new MySpace.UI.GenericDragDropManager;this._instance.initialize();this._instance.add_dragStart(Function.createDelegate(this,this._raiseDragStart));this._instance.add_dragStop(Function.createDelegate(this,this._raiseDragStop))}return this._instance},afterDragStart:function(){this._getInstance().afterDragStart()},startDragDrop:function(A,C,B){this._getInstance().startDragDrop(A,C,B)},registerDropTarget:function(A){this._getInstance().registerDropTarget(A)},unregisterDropTarget:function(A){this._getInstance().unregisterDropTarget(A)},dispose:function(){delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},_raiseDragStart:function(B,A){var C=this.get_events().getHandler("dragStart");if(C){C(this,A)}},_raiseDragStop:function(B,A){var C=this.get_events().getHandler("dragStop");if(C){C(this,A)}}};MySpace.UI._DragDropManager.registerClass("MySpace.UI._DragDropManager");MySpace.UI.DragDropManager=new MySpace.UI._DragDropManager;MySpace.UI.DragDropEventArgs=function(C,A,B){this._dragMode=C;this._dataType=A;this._data=B};MySpace.UI.DragDropEventArgs.prototype={get_dragMode:function(){return this._dragMode||null},get_dragDataType:function(){return this._dataType||null},get_dragData:function(){return this._data||null}};MySpace.UI.DragDropEventArgs.registerClass("MySpace.UI.DragDropEventArgs");MySpace.UI.IDragSource=function(){};MySpace.UI.IDragSource.prototype={get_dragDataType:function(){throw Error.notImplemented()},getDragData:function(){throw Error.notImplemented()},get_dragMode:function(){throw Error.notImplemented()},onDragStart:function(){throw Error.notImplemented()},onDrag:function(){throw Error.notImplemented()},onDragEnd:function(){throw Error.notImplemented()}};MySpace.UI.IDragSource.registerInterface("MySpace.UI.IDragSource");MySpace.UI.IDropTarget=function(){};MySpace.UI.IDropTarget.prototype={get_dropTargetElement:function(){throw Error.notImplemented()},canDrop:function(){throw Error.notImplemented()},drop:function(){throw Error.notImplemented()},onDragEnterTarget:function(){throw Error.notImplemented()},onDragLeaveTarget:function(){throw Error.notImplemented()},onDragInTarget:function(){throw Error.notImplemented()}};MySpace.UI.IDropTarget.registerInterface("MySpace.UI.IDropTarget");MySpace.UI.DragMode=function(){throw Error.invalidOperation()};MySpace.UI.DragMode.prototype={Copy:0,Move:1};MySpace.UI.DragMode.registerEnum("MySpace.UI.DragMode");MySpace.UI.GenericDragDropManager=function(){MySpace.UI.GenericDragDropManager.initializeBase(this)};MySpace.UI.GenericDragDropManager.prototype={_dropTargets:null,_radius:10,_activeDragVisual:null,_activeContext:null,_activeDragSource:null,_underlyingTarget:null,_oldOffset:null,_potentialTarget:null,_isDragging:false,_mouseUpHandler:null,_mouseMoveHandler:null,_scrollEdgeConst:40,_scrollByConst:10,_scroller:null,_scrollDeltaX:null,_scrollDeltaY:null,_keyPressHandler:null,add_dragStart:function(A){this.get_events().addHandler("dragStart",A)},remove_dragStart:function(A){this.get_events().removeHandler("dragStart",A)},add_dragStop:function(A){this.get_events().addHandler("dragStop",A)},remove_dragStop:function(A){this.get_events().removeHandler("dragStop",A)},add_afterDragStart:function(A){this.get_events().addHandler("afterDragStart",A)},remove_afterDragStart:function(A){this.get_events().removeHandler("afterDragStart",A)},initialize:function(){MySpace.UI.GenericDragDropManager.callBaseMethod(this,"initialize");this._mouseUpHandler=Function.createDelegate(this,this.mouseUpHandler);this._mouseMoveHandler=Function.createDelegate(this,this.mouseMoveHandler);this._keyPressHandler=Function.createDelegate(this,this.keyPressHandler);this._scroller=new MySpace.Timer;this._scroller.set_interval(10);this._scroller.add_tick(Function.createDelegate(this,this.scrollerTickHandler))},dispose:function(){if(this._dropTargets){for(var A=0;A<this._dropTargets;A++){this.unregisterDropTarget(this._dropTargets[A])}this._dropTargets=null}MySpace.UI.GenericDragDropManager.callBaseMethod(this,"dispose")},afterDragStart:function(){},startDragDrop:function(C,A,B){this._activeDragSource=C;this._activeDragVisual=A;this._activeContext=B;var F=window._event;if(this._isDragging){return}this._underlyingTarget=null;var H={x:F.clientX,y:F.clientY};A.originalPosition=A.style.position;A.style.position="absolute";document._lastPosition=H;A.startingPoint=H;var E=this.getScrollOffset(A,true);A.startingPoint=this.addPoints(A.startingPoint,E);if(A.style.position=="absolute"){A.startingPoint=this.subtractPoints(A.startingPoint,Sys.UI.DomElement.getLocation(A))}else{var J=parseInt(A.style.left),I=parseInt(A.style.top);if(isNaN(J)){J="0"}if(isNaN(I)){I="0"}A.startingPoint=this.subtractPoints(A.startingPoint,{x:J,y:I})}this._prepareForDomChanges();C.onDragStart();var D=new MySpace.UI.DragDropEventArgs(C.get_dragMode(),C.get_dragDataType(),C.getDragData(B)),G=this.get_events().getHandler("dragStart");if(G){G(this,D)}this._recoverFromDomChanges();this._wireEvents();this._drag(true);var K=this.get_events().getHandler("afterDragStart");if(K){K(this)}},_stopDragDrop:function(B){this._scroller.set_enabled(false);var C=window._event;if(this._activeDragSource){this._unwireEvents();if(!B){B=this._underlyingTarget==null}if(!B&&this._underlyingTarget){this._underlyingTarget.drop(this._activeDragSource.get_dragMode(),this._activeDragSource.get_dragDataType(),this._activeDragSource.getDragData(this._activeContext))}this._activeDragSource.onDragEnd(B);var A=this.get_events().getHandler("dragStop");if(A){A(this,Sys.EventArgs.Empty)}this._activeDragVisual.style.position=this._activeDragVisual.originalPosition;this._activeDragSource=null;this._activeContext=null;this._activeDragVisual=null;this._isDragging=false;this._potentialTarget=null;C.preventDefault()}},_drag:function(C){var F=window._event,G={x:F.clientX,y:F.clientY};document._lastPosition=G;var E=this.getScrollOffset(this._activeDragVisual,true),B=this.addPoints(this.subtractPoints(G,this._activeDragVisual.startingPoint),E);var D=Sys.UI.DomElement.getBounds(this._activeDragVisual);if(B.x<0){B.x=0}else{if(B.x+D.width>document.body.offsetWidth){B.x=document.body.offsetWidth-D.width}}if(B.y<0){B.y=0}if(!C&&parseInt(this._activeDragVisual.style.left)==B.x&&parseInt(this._activeDragVisual.style.top)==B.y){return}Sys.UI.DomElement.setLocation(this._activeDragVisual,B.x,B.y);this._prepareForDomChanges();this._activeDragSource.onDrag();this._recoverFromDomChanges();this._potentialTarget=this._findPotentialTarget(this._activeDragSource,this._activeDragVisual);var A=this._potentialTarget!=this._underlyingTarget||this._potentialTarget==null;if(A&&this._underlyingTarget!=null){this._leaveTarget(this._activeDragSource,this._underlyingTarget)}if(this._potentialTarget!=null){if(A){this._underlyingTarget=this._potentialTarget;this._enterTarget(this._activeDragSource,this._underlyingTarget)}else{this._moveInTarget(this._activeDragSource,this._underlyingTarget)}}else{this._underlyingTarget=null}this._autoScroll()},_wireEvents:function(){Sys.UI.DomEvent.addHandler(document,"mouseup",this._mouseUpHandler);Sys.UI.DomEvent.addHandler(document,"mousemove",this._mouseMoveHandler);Sys.UI.DomEvent.addHandler(document,"keypress",this._keyPressHandler)},_unwireEvents:function(){Sys.UI.DomEvent.removeHandler(document,"keypress",this._keyPressHandler);Sys.UI.DomEvent.removeHandler(document,"mousemove",this._mouseMoveHandler);Sys.UI.DomEvent.removeHandler(document,"mouseup",this._mouseUpHandler)},registerDropTarget:function(A){if(!this._dropTargets){this._dropTargets=[]}Array.add(this._dropTargets,A)},unregisterDropTarget:function(A){if(this._dropTargets){Array.remove(this._dropTargets,A)}},mouseUpHandler:function(A){window._event=A;this._stopDragDrop(false)},mouseMoveHandler:function(A){window._event=A;this._drag()},keyPressHandler:function(B){window._event=B;var A=B.keyCode?B.keyCode:B.rawEvent.keyCode;if(A==27){this._stopDragDrop(true)}},_autoScroll:function(){var A=window._event,B=this.getBrowserRectangle();if(B.width>0){this._scrollDeltaX=this._scrollDeltaY=0;if(A.clientX<B.x+this._scrollEdgeConst){this._scrollDeltaX=-this._scrollByConst}else{if(A.clientX>B.width-this._scrollEdgeConst){this._scrollDeltaX=this._scrollByConst}}if(A.clientY<B.y+this._scrollEdgeConst){this._scrollDeltaY=-this._scrollByConst}else{if(A.clientY>B.height-this._scrollEdgeConst){this._scrollDeltaY=this._scrollByConst}}if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){this._scroller.set_enabled(true)}else{this._scroller.set_enabled(false)}}},scrollerTickHandler:function(){var D=document.body.scrollLeft,B=document.body.scrollTop;var A=this.getBrowserRectangle();var H=(document.documentElement.scrollTop+A.height+this._scrollEdgeConst)<document.body.offsetHeight;var I=(document.documentElement.scrollLeft+A.width+this._scrollEdgeConst)<document.body.offsetWidth;window.scrollBy(I?this._scrollDeltaX:0,H?this._scrollDeltaY:0);var E=document.body.scrollLeft,C=document.body.scrollTop,G=this._activeDragVisual,F={x:parseInt(G.style.left)+(E-D),y:parseInt(G.style.top)+(C-B)};Sys.UI.DomElement.setLocation(G,F.x,F.y)},_getDropTarget:function(A){while(A){if(A._dropTarget!=null){return A._dropTarget}A=A.parentNode}return null},_dragDrop:function(){if(this._isDragging){return}this._isDragging=true;this._activeDragVisual.dragDrop();document.selection.empty()},_moveInTarget:function(A,B){this._prepareForDomChanges();B.onDragInTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));this._recoverFromDomChanges()},_enterTarget:function(A,B){this._prepareForDomChanges();B.onDragEnterTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));this._recoverFromDomChanges()},_leaveTarget:function(A,B){this._prepareForDomChanges();B.onDragLeaveTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));this._recoverFromDomChanges()},_findPotentialTarget:function(A){var K=window._event;if(!this._dropTargets){return null}var D=A.get_dragDataType(),E=A.get_dragMode(),F=A.getDragData(this._activeContext),M=this.getScrollOffset(document.body,true),C=K.clientX+M.x,B=K.clientY+M.y,J={x:C-this._radius,y:B-this._radius,width:this._radius*2,height:this._radius*2};for(var N=0;N<this._dropTargets.length;N++){var O=this._dropTargets[N],G=O.canDrop(E,D,F);if(!G){continue}var L=O.get_dropTargetElement(),I=Sys.UI.DomElement.getBounds(L),H=Sys.UI.Control.overlaps(J,I);if(H||L===document.body){return O}}return null},_prepareForDomChanges:function(){this._oldOffset=Sys.UI.DomElement.getLocation(this._activeDragVisual)},_recoverFromDomChanges:function(){var B=Sys.UI.DomElement.getLocation(this._activeDragVisual);if(this._oldOffset.x!=B.x||this._oldOffset.y!=B.y){this._activeDragVisual.startingPoint=this.subtractPoints(this._activeDragVisual.startingPoint,this.subtractPoints(this._oldOffset,B));scrollOffset=this.getScrollOffset(this._activeDragVisual,true);var A=this.addPoints(this.subtractPoints(document._lastPosition,this._activeDragVisual.startingPoint),scrollOffset);Sys.UI.DomElement.setLocation(this._activeDragVisual,A.x,A.y)}},addPoints:function(B,A){return{x:B.x+A.x,y:B.y+A.y}},subtractPoints:function(B,A){return{x:B.x-A.x,y:B.y-A.y}},getScrollOffset:function(C,B){var E=C.scrollLeft,D=C.scrollTop;if(B){var A=C.parentNode;while(A!=null&&A.scrollLeft!=null){E+=A.scrollLeft;D+=A.scrollTop;if(A==document.body&&(E!=0&&D!=0)){break}A=A.parentNode}}return{x:E,y:D}},getBrowserRectangle:function(){return{x:0,y:0,width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}},getNextSibling:function(A){for(A=A.nextSibling;A!=null;A=A.nextSibling){if(A.innerHTML!=null){return A}}return null},hasParent:function(A){return A.parentNode!=null&&A.parentNode.tagName!=null}};MySpace.UI.GenericDragDropManager.registerClass("MySpace.UI.GenericDragDropManager",Sys.Component);MySpace.UI.FriendSelector=function(A){MySpace.UI.FriendSelector.initializeBase(this,[A]);this._userId=null;this._minimumPrefixLength=1;this._lazyLoadPlaceholderHeight=25;this._firstRowSelected=true;this._completionInterval=300;this._completionListItemCssClass="friendSelectItem";this._highlightedItemCssClass="friendSelectItem friendSelectHighlighted";this._groupHeaderCssClass="friendSelectHeader";this._showUserImg=true;this._showUserName=true;this._showRealName=true;this._showSelectedUserImg=true;this._selectedFriend=null;this._enableCaching=true;this._enableCacheSubstrings=true};MySpace.UI.FriendSelector.prototype={initialize:function(){MySpace.UI.FriendSelector.callBaseMethod(this,"initialize");this.addStyles();this._createSelectedFriendNode()},_createSelectedFriendNode:function(){var C=this.get_element();var E=this.wrapperDiv=document.createElement("div");var B=C.offsetWidth;E.style.width=B+"px";E.className="friendSelect";this._selectedNode=document.createElement("div");this._selectedNode.className="selected";E.appendChild(this._selectedNode);if(this.get_showSelectedUserImg()){this._selectedImage=document.createElement("img");this._selectedNode.appendChild(this._selectedImage)}this._selectedDisplayNameNode=document.createElement("div");this._selectedDisplayNameNode.className="displayName";this._selectedNode.appendChild(this._selectedDisplayNameNode);var A=document.createElement("div");A.className="close";$addHandler(A,"click",Function.createDelegate(this,this._clearSelection));this._selectedNode.appendChild(A);var D=document.createElement("div");D.style.clear="both";this._selectedNode.appendChild(D);C.parentNode.replaceChild(E,this.get_element());C.style.width=(B-2)+"px";E.appendChild(C);if(this._popupBehavior){this._popupBehavior.set_parentElement(E)}},addStyles:function(){MySpace.UI.addStyles(".friendSelect { padding:1px; background:#fff; border:1px solid #A5ACB2; width:200px; }.friendSelect input { border:none; width:100%; margin:-1px 0 0; padding-top:1px; }.friendSelect .selected { display:none; background:#BCD2E9; font-weight:bold; width:80% }.friendSelect .selected img { float:left; margin:4px 8px 0 4px; height:30px; }.friendSelect .selected .displayName { float:left; height:28px; padding:12px 0 0 4px; }.friendSelect .selected .close { float:right; height:38px; width:32px; cursor:pointer; background:url('http://x.myspacecdn.com/modules/common/static/img/friendSelectorClose.gif') center no-repeat; }.friendSelectHeader { background:#608BC1; color:#FFF; font-weight:bold; padding:2px }.friendSelectItem { padding:2px !important; border-bottom:1px solid #CCC; cursor:pointer; line-height:1.2em; }.friendSelectItem td { vertical-align:middle; }.friendSelectItem img { width:28px; height:28px; vertical-align:middle; margin-right:3px; }.friendSelectItem .prefix { background-color:#E8F1FA; font-weight:bold; }.friendSelectItem .userName { color:#999; }.friendSelectItem .realName { display:block; }.friendSelectHighlighted { background:#E8F1FA }",true,"FriendSelector")},createCompletionItem:function(D){var C=document.createElement("div");C._value=D;C._text=D.UserId;C.className="friendSelectItem";var A=D.DisplayName?this._highlightPrefix(D.DisplayName):"",E=(this._showUserName&&D.UserName&&D.UserName!=D.UserId)?("("+this._highlightPrefix(D.UserName)+")"):"",B=(this._showRealName&&D.RealName)?this._highlightPrefix(D.RealName):"";var F=this._showUserImg?String.format("<td><img src='{0}'></td>",D.ImageUri):"";C.innerHTML=String.format("<table><tr>{0}<td>{1} <span class='userName'>{2}</span> <span class='realName'>{3}</span></td></tr></table>",F,A,E,B);return C},getCompletionItems:function(E){if(!E){if(this._recentFriends&&this._recentFriends.length){return[].concat([{groupHeader:this._recentFriendsLabel}],this._recentFriends,[{groupHeader:this._allFriendsLabel}],this._completionItems)}else{return this._completionItems}}var D=E.toLowerCase().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");var C=[],B=null;for(var A=0;A<this._completionItems.length;A++){B=this._completionItems[A];if((B.DisplayName&&B.DisplayName.toLowerCase().startsWith(D))||(this._showUserName&&B.UserName&&(B.UserName!=B.UserId)&&B.UserName.toLowerCase().startsWith(D))||(this._showRealName&&B.RealName&&B.RealName.toLowerCase().startsWith(D))){C.push(B)}}return C},addRecentFriend:function(C,A){for(var B=0;B<this._recentFriends.length;B++){if(this._recentFriends[B].UserId==C.UserId){this._recentFriends.splice(B,1);break}}this._recentFriends.unshift(C);this._recentFriends.splice(A||5)},_highlightPrefix:function(A){if(this._currentPrefix&&A.toLowerCase().startsWith(this._currentPrefix.toLowerCase())){return"<span class='prefix'>"+A.substring(0,this._currentPrefix.length)+"</span>"+A.substring(this._currentPrefix.length)}else{return A}},_setText:function(B){var A=B?B._value:null;this._selectedFriend=A;if(A){this.get_element().style.display="none";this.get_element().value=A.UserId;this._selectedNode.style.display="block";if(this.get_showSelectedUserImg()){this._selectedImage.onload=this._onImageLoad;this._selectedImage.style.visibility="hidden";this._selectedImage.src=A.ImageUri}this._selectedDisplayNameNode.innerHTML=A.DisplayName}else{this.set_value("")}this._stopTimer();this.raiseItemSelected(new MySpace.UI.AutoCompleteItemEventArgs(B,B?B._text:null,A));this._currentPrefix=this._currentCompletionWord();this._hideCompletionList()},_clearSelection:function(A){this._setText(null);this.get_element().focus()},_onImageLoad:function(A){this.style.height="";if(this.offsetWidth>30){this.style.height=Math.round(30*30/this.offsetWidth)+"px"}this.style.marginTop=(4+(30-this.offsetHeight)/2)+"px";this.style.marginRight=(8+(30-this.offsetWidth))+"px";this.style.visibility="";this.onload=null},selectFriendById:function(B){if(B){for(var A=0;A<this._completionItems.length;A++){if(this._completionItems[A].UserId==B){this._setText({_value:this._completionItems[A]});return}}}this._setText()},set_value:function(A){this.get_element().style.display="";this._selectedNode.style.display="none";this._selectedFriend=null;MySpace.UI.FriendSelector.callBaseMethod(this,"set_value")},get_showUserImg:function(){return this._showUserImg},set_showUserImg:function(A){this._showUserImg=A},get_showUserName:function(){return this._showUserName},set_showUserName:function(A){this._showUserName=A},get_showRealName:function(){return this._showRealName},set_showRealName:function(A){this._showRealName=A},get_showSelectedUserImg:function(){return this._showSelectedUserImg},set_showSelectedUserImg:function(A){this._showSelectedUserImg=A},get_selectedFriend:function(){return this._selectedFriend},get_recentFriends:function(){return this._recentFriends},set_recentFriends:function(A){this._recentFriends=A},get_recentFriendsLabel:function(){return this._recentFriendsLabel},set_recentFriendsLabel:function(A){this._recentFriendsLabel=A},get_allFriendsLabel:function(){return this._allFriendsLabel},set_allFriendsLabel:function(A){this._allFriendsLabel=A},get_userId:function(){return this._userId},set_userId:function(A){this._userId=A},get_useWebService:function(A){return !!this.get_servicePath()},set_useWebService:function(A){this.set_servicePath(A?"/Modules/Common/Services/FriendAutocomplete.asmx":null);this.set_serviceMethod(A?"GetFriends":null);this.set_serviceParams(A?{userId:this._userId}:null)},get_completionListWidth:function(){return this._completionListWidth||(this.wrapperDiv&&Math.max(1,this.wrapperDiv.offsetWidth-2))}};MySpace.UI.FriendSelector.registerClass("MySpace.UI.FriendSelector",MySpace.UI.AutoCompleteBehavior);MySpace.UI.FriendSelector.showPopup=(function(){var B,A,D,E,C;return function(F){E=F;if(B){B.show();A.set_value("");C.focus();return}var G=document.createElement("div");C=document.createElement("input");C.style.width="375px";G.appendChild(C);B=MySpace.UI.Popup.create(G,"");B.set_width(400);B.set_top(50);B.show();A=$create(MySpace.UI.FriendSelector,{useWebService:true,completionListAlwaysVisible:true,completionListFixedHeight:300,minimumPrefixLength:0},{itemSelected:function(I,H){B._hide();if(E){E(H.get_value())}}},null,C);C.focus()}})();MySpace.UI.HistoryEventArgs=function(A){MySpace.UI.HistoryEventArgs.initializeBase(this);this._state=A};MySpace.UI.HistoryEventArgs.prototype={get_state:function(){return this._state}};MySpace.UI.HistoryEventArgs.registerClass("MySpace.UI.HistoryEventArgs",Sys.EventArgs);MySpace.UI._History=function(){MySpace.UI._History.initializeBase(this);this._appLoadHandler=null;this._clientId=null;this._currentEntry="";this._emptyPageUrl=null;this._historyFrame=null;this._historyInitialLength=0;this._historyLength=0;this._iframeLoadHandler=null;this._ignoreIFrame=false;this._ignoreTimer=false;this._historyPointIsNew=false;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null};MySpace.UI._History.prototype={get_stateString:function(){var A=decodeURIComponent(window.location.hash||"");if((A.length>0)&&(A.charAt(0)==="#")){A=A.substring(1)}return A},add_navigate:function(A){this.get_events().addHandler("navigate",A)},remove_navigate:function(A){this.get_events().removeHandler("navigate",A)},addHistoryPoint:function(E,F){var A=this._state;for(var B in E){var D=E[B];if(D===null){if(typeof(A[B])!=="undefined"){delete A[B]}}else{A[B]=D}}var C=Sys.Serialization.JavaScriptSerializer.serialize(A);this._ignoreIFrame=true;this._historyPointIsNew=true;this._setState(C,F)},dispose:function(){if(this._appLoadHandler){Sys.Application.remove_load(this._appLoadHandler);delete this._appLoadHandler}if(this._historyFrame){Sys.UI.DomEvent.removeHandler(this._historyFrame,"load",this._iframeLoadHandler);delete this._iframeLoadHandler;delete this._historyFrame}if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}MySpace.UI._History.callBaseMethod(this,"dispose")},initialize:function(){MySpace.UI._History.callBaseMethod(this,"initialize");this._appLoadHandler=Function.createDelegate(this,this._onApplicationLoaded);Sys.Application.add_load(this._appLoadHandler)},setServerId:function(A,B){this._clientId=A;this._uniqueId=B},setServerState:function(A){this._state.__s=A},_navigate:function(B){var C={};if(B){try{if(/^[\],:{}\s]*$/.test(B.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){C=Sys.Serialization.JavaScriptSerializer.deserialize(B,true)}}catch(D){}}if(this._uniqueId){var A=this._state.__s||"";var E=C.__s||"";if(E!==A){__doPostBack(this._uniqueId,E);this._state=C;return}}this._setState(B);this._state=C;this._raiseNavigate()},_onApplicationLoaded:function(B,A){Sys.Application.remove_load(this._appLoadHandler);delete this._appLoadHandler;if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var C="__historyFrame";var F=$get(C);if(!F){throw Error.invalidOperation("For the history feature to work in IE, the page must have an iframe with id '__historyFrame' and src set to point to a page that sets its title to the 'title' querystring parameter when loaded.")}var E=F.src;this._emptyPageUrl=E+(E.indexOf("?")===-1?"?":"&")+"_state=";this._historyFrame=F;if(F.readyState==="loading"){this._ignoreIFrame=true}this._iframeLoadHandler=Function.createDelegate(this,this._onIFrameLoad);Sys.UI.DomEvent.addHandler(this._historyFrame,"load",this._iframeLoadHandler)}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);var D=this.get_stateString();if(D!==this._currentEntry){this._navigate(D)}},_onIdle:function(){delete this._timerCookie;var A=this.get_stateString();if(A!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(A);this._historyLength=window.history.length}}else{this._ignoreTimer=false}this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(){if(!this._ignoreIFrame){var C=this._historyFrame.contentWindow.location.search;var B=C.indexOf("_state=");if((B!==-1)&&(B+7<C.length)){C=C.substring(B+7);var A=C.indexOf("&");if(A!==-1){C=C.substring(0,A)}}else{C=""}this._historyPointIsNew=false;this._navigate(C)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(B,A){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(C,B){var A=B.get_dataItems()[this._clientId],F;if(typeof(A)!=="undefined"){var E=A[0];F=A[1];this.setServerState(E);this._historyPointIsNew=true}else{this._ignoreTimer=false}var D=Sys.Serialization.JavaScriptSerializer.serialize(this._state);if(D==="{}"){D=""}if(D!=this._currentEntry){this._ignoreTimer=true;this._setState(D,F);this._raiseNavigate()}},_raiseNavigate:function(){var B=this.get_events().getHandler("navigate");var A=new MySpace.UI.HistoryEventArgs(this._state);if(B){B(this,A)}if(window.pageNavigate){window.pageNavigate(this,A)}},_setState:function(C,D){if(C!==this._currentEntry){if(this._historyFrame&&this._historyPointIsNew){var A=this._emptyPageUrl+C+"&title="+encodeURIComponent(D||document.title);if(this._historyFrame.src!=A){this._ignoreIFrame=true;this._historyFrame.src=A}this._historyPointIsNew=false}this._ignoreTimer=false;this._currentEntry=C;var B=this.get_stateString();if(B==="{}"){B="";this._currentEntry=null}if(C!==B){window.location.hash=C?encodeURIComponent(C):""}if(D){document.title=D}}}};MySpace.UI._History.registerClass("MySpace.UI._History",Sys.Component);MySpace.Application.get_history=function(){var A=this._history;if(!A){A=this._history=new MySpace.UI._History();Sys.Application.registerDisposableObject(A);A.initialize()}return A};if(MySpace.UI._initHistory){Sys.Application.add_init(function(){MySpace.Application.get_history()})}MySpace.UI.PopupBehavior=function(A){MySpace.UI.PopupBehavior.initializeBase(this,[A]);this._x=0;this._y=0;this._positioningMode=MySpace.UI.PositioningMode.Absolute;this._parentElement=null;this._parentElementID=null;this._moveHandler=null;this._firstPopup=true;this._originalParent=null;this._visible=false;this._hideOnDocumentClick=false;this._onShow=null;this._onShowEndedHandler=null;this._onHide=null;this._onHideEndedHandler=null};MySpace.UI.PopupBehavior.prototype={initialize:function(){MySpace.UI.PopupBehavior.callBaseMethod(this,"initialize");this._hidePopup();this.get_element().style.position="absolute";this._onShowEndedHandler=Function.createDelegate(this,this._onShowEnded);this._onHideEndedHandler=Function.createDelegate(this,this._onHideEnded);$addHandler(document.body,"mousedown",Function.createDelegate(this,this._onDocumentClick))},dispose:function(){var A=this.get_element();if(A){if(this._visible){this.hide()}if(this._originalParent){A.parentNode.removeChild(A);this._originalParent.appendChild(A);this._originalParent=null}A._hideWindowedElementsIFrame=null}this._parentElement=null;if(this._onShow&&this._onShowEndedHandler){this._onShow.remove_ended(this._onShowEndedHandler)}this._onShowEndedHandler=null;this._onShow=null;if(this._onHide&&this._onHideEndedHandler){this._onHide.remove_ended(this._onHideEndedHandler)}this._onHideEndedHandler=null;this._onHide=null;MySpace.UI.PopupBehavior.callBaseMethod(this,"dispose")},show:function(){if(this._visible){return}var A=new Sys.CancelEventArgs();this.raiseShowing(A);if(A.get_cancel()){return}this._visible=true;var B=this.get_element();B.style.visibility="visible";this.setupPopup();if(this._onShow){B.style.visibility="hidden";this.onShow()}else{this.raiseShown(Sys.EventArgs.Empty)}},hide:function(){if(!this._visible){return}var A=new Sys.CancelEventArgs();this.raiseHiding(A);if(A.get_cancel()){return}this._visible=false;if(this._onHide){this.onHide()}else{this._hidePopup();this._hideCleanup()}},getBounds:function(){var D=this.get_element();var F=D.offsetParent;if(!F||(F==document.documentElement)){F=document.body}var G;var H;if(this._parentElement){H=Sys.UI.DomElement.getBounds(this._parentElement);var C=Sys.UI.DomElement.getLocation(F);G={x:H.x-C.x,y:H.y-C.y}}else{H=Sys.UI.DomElement.getBounds(F);G={x:0,y:0}}var E=D.offsetWidth-(D.clientLeft?D.clientLeft*2:0);var B=D.offsetHeight-(D.clientTop?D.clientTop*2:0);if(this._firstpopup){D.style.width=E+"px";this._firstpopup=false}var A;switch(this._positioningMode){case MySpace.UI.PositioningMode.Center:A={x:Math.round(H.width/2-E/2),y:Math.round(H.height/2-B/2)};break;case MySpace.UI.PositioningMode.BottomLeft:A={x:0,y:H.height};break;case MySpace.UI.PositioningMode.BottomRight:A={x:H.width-E,y:H.height};break;case MySpace.UI.PositioningMode.TopLeft:A={x:0,y:-D.offsetHeight};break;case MySpace.UI.PositioningMode.TopRight:A={x:H.width-E,y:-D.offsetHeight};break;case MySpace.UI.PositioningMode.Right:A={x:H.width,y:0};break;case MySpace.UI.PositioningMode.Left:A={x:-D.offsetWidth,y:0};break;default:A={x:0,y:0}}A.x+=this._x+G.x;A.y+=this._y+G.y;return new Sys.UI.Bounds(A.x,A.y,E,B)},adjustPopupPosition:function(D){var B=this.get_element();if(!D){D=this.getBounds()}var A=Sys.UI.DomElement.getBounds(B);var C=false;if(A.x<0){D.x-=A.x;C=true}if(A.y<0){D.y-=A.y;C=true}if(C){Sys.UI.DomElement.setLocation(B,D.x,D.y)}},addBackgroundIFrame:function(){var A=this.get_element();if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){var B=A._hideWindowedElementsIFrame;if(!B){B=document.createElement("iframe");B.src="javascript:'<html></html>';";B.style.position="absolute";B.style.display="none";B.scrolling="no";B.frameBorder="0";B.tabIndex="-1";B.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";A.parentNode.insertBefore(B,A);A._hideWindowedElementsIFrame=B;this._moveHandler=Function.createDelegate(this,this._onMove);Sys.UI.DomEvent.addHandler(A,"move",this._moveHandler)}B.style.width=A.offsetWidth+"px";B.style.height=A.offsetHeight+"px";B.style.display=A.style.display;if(A.currentStyle&&A.currentStyle.zIndex){B.style.zIndex=A.currentStyle.zIndex}else{if(A.style.zIndex){B.style.zIndex=A.style.zIndex}}}},setupPopup:function(){var A=this.get_element();var B=this.getBounds();Sys.UI.DomElement.setLocation(A,B.x,B.y);this.adjustPopupPosition(B);A.style.zIndex=1000;this.addBackgroundIFrame()},_hidePopup:function(){var A=this.get_element();A.style.visibility="hidden";if(A.originalWidth){A.style.width=A.originalWidth+"px";A.originalWidth=null}},_hideCleanup:function(){var A=this.get_element();if(this._moveHandler){Sys.UI.DomEvent.removeHandler(A,"move",this._moveHandler);this._moveHandler=null}if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var B=A._hideWindowedElementsIFrame;if(B){B.style.display="none"}}this.raiseHidden(Sys.EventArgs.Empty)},_onDocumentClick:function(B){if(!this._hideOnDocumentClick||!this._visible){return}for(var A=B.target;A;A=A.parentNode){if(A==this.get_element()){return}}this.hide()},_onMove:function(){var A=this.get_element();if(A._hideWindowedElementsIFrame){A.parentNode.insertBefore(A._hideWindowedElementsIFrame,A);A._hideWindowedElementsIFrame.style.top=A.style.top;A._hideWindowedElementsIFrame.style.left=A.style.left}},get_onShow:function(){return this._onShow},set_onShow:function(A){this._onShow=A;if(A){A.set_target(this.get_element());A.add_ended(this._onShowEndedHandler)}},onShow:function(){if(this._onShow){if(this._onHide){this._onHide.stop()}this._onShow.play()}},_onShowEnded:function(){this.adjustPopupPosition();this.addBackgroundIFrame();this.raiseShown(Sys.EventArgs.Empty)},get_onHide:function(){return this._onHide},set_onHide:function(A){this._onHide=A;if(A){A.set_target(this.get_element());A.add_ended(this._onHideEndedHandler)}},onHide:function(){if(this._onHide){if(this._onShow){this._onShow.stop()}this._onHide.play()}},_onHideEnded:function(){this._hideCleanup()},get_parentElement:function(){if(!this._parentElement&&this._parentElementID){this.set_parentElement($get(this._parentElementID))}return this._parentElement},set_parentElement:function(A){this._parentElement=A},get_parentElementID:function(){if(this._parentElement){return this._parentElement.id}return this._parentElementID},set_parentElementID:function(A){this._parentElementID=A;if(this.get_isInitialized()){this.set_parentElement($get(A))}},get_positioningMode:function(){return this._positioningMode},set_positioningMode:function(A){this._positioningMode=A},get_x:function(){return this._x},set_x:function(A){if(A!=this._x){this._x=A;if(this._visible){this.setupPopup()}}},get_y:function(){return this._y},set_y:function(A){if(A!=this._y){this._y=A;if(this._visible){this.setupPopup()}}},get_visible:function(){return this._visible},get_hideOnDocumentClick:function(){return this._hideOnDocumentClick},set_hideOnDocumentClick:function(A){this._hideOnDocumentClick=A},add_showing:function(A){this.get_events().addHandler("showing",A)},remove_showing:function(A){this.get_events().removeHandler("showing",A)},raiseShowing:function(A){var B=this.get_events().getHandler("showing");if(B){B(this,A)}},add_shown:function(A){this.get_events().addHandler("shown",A)},remove_shown:function(A){this.get_events().removeHandler("shown",A)},raiseShown:function(A){var B=this.get_events().getHandler("shown");if(B){B(this,A)}},add_hiding:function(A){this.get_events().addHandler("hiding",A)},remove_hiding:function(A){this.get_events().removeHandler("hiding",A)},raiseHiding:function(A){var B=this.get_events().getHandler("hiding");if(B){B(this,A)}},add_hidden:function(A){this.get_events().addHandler("hidden",A)},remove_hidden:function(A){this.get_events().removeHandler("hidden",A)},raiseHidden:function(A){var B=this.get_events().getHandler("hidden");if(B){B(this,A)}}};MySpace.UI.PopupBehavior.registerClass("MySpace.UI.PopupBehavior",Sys.UI.Behavior);MySpace.UI.PositioningMode=function(){throw Error.invalidOperation()};MySpace.UI.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5,Right:6,Left:7};MySpace.UI.PositioningMode.registerEnum("MySpace.UI.PositioningMode");MySpace.UI._Overlay=function(A){document.body.appendChild(A);MySpace.UI._Overlay.initializeBase(this,[A])};MySpace.UI._Overlay.prototype={_interval:null,_fadeIn:false,_opacity:0,_max:60,_fadeDelegate:null,_resizeHandler:null,_step:20,show:function(){MySpace.UI.hideElements(["iframe","object","embed","select"],true);this._fade(true)},hide:function(){MySpace.UI.hideElements(["iframe","object","embed","select"],false);this._fade(false)},add_fadeComplete:function(A){this.get_events().addHandler("fadeComplete",A)},remove_fadeComplete:function(A){this.get_events().removeHandler("fadeComplete",A)},initialize:function(){var A=this.get_element();A.id="window_overlay";A.style.zIndex="1000200";A.style.width="100%";this.set_opacity(0);Sys.UI.DomElement.setLocation(A,0,0);this._setHeight();this._resizeHandler=Function.createDelegate(this,this._setHeight);$addHandler(window,"resize",this._resizeHandler)},_setHeight:function(){var B=document.body.scrollHeight;var A=document.documentElement.clientHeight;var C=document.documentElement.scrollHeight;B=((B>C)?B:C);this.get_element().style.height=((B>A)?B:A)+"px"},_fade:function(A){this._fadeIn=A;if(A){this._element.style.visibility="visible";this._element.style.display=""}if(!this._fadeDelegate){this._fadeDelegate=Function.createDelegate(this,this._tick)}this._interval=window.setInterval(this._fadeDelegate,100)},_tick:function(){if(!this._interval){return}var C=this._step;if(!this._fadeIn){C*=-1}var A=this._opacity+C;if(A<0){A=0}else{if(A>this._max){A=this._max}}this.set_opacity(A);if(A<=0||A>=this._max){window.clearInterval(this._interval);var B=this.get_events().getHandler("fadeComplete");if(!this._fadeIn){this._element.style.visibility="hidden";this._element.style.display="none"}if(B){B(this,Sys.EventArgs.Empty)}}},get_opacity:function(){return this._opacity},set_opacity:function(B){this._opacity=B;var A=this.get_element().style;A.opacity=B*0.01;A.filter="alpha(opacity="+B+")";if(B===0){this.set_visible(false)}},dispose:function(){$removeHandler(window,"resize",this._resizeHandler);this._fadeDelegate=null;MySpace.UI._Overlay.callBaseMethod(this,"dispose")}};MySpace.UI._Overlay.registerClass("MySpace.UI._Overlay",Sys.UI.Control);window.get_overlay=function(){if(!window._overlay){window._overlay=$create(MySpace.UI._Overlay,null,null,null,document.createElement("div"))}return window._overlay};MySpace.UI._Popup=function(A){this._box=A.firstChild;MySpace.UI._Popup.initializeBase(this,[A])};MySpace.UI._Popup.prototype={_autoSize:true,_useFixedPos:true,_box:null,_state:null,_defaultButton:null,_callback:null,_globalCss:null,_multiple:false,_prevHeight:0,_checkHeightHandler:null,_resizeHandler:null,_ruleCnt:0,_timerId:null,_top:null,_left:null,_width:null,_ruleAdded:false,get_autoSize:function(){return this._autoSize},set_autoSize:function(A){this._autoSize=A},get_useFixedPos:function(){return this._useFixedPos},set_useFixedPos:function(A){this._useFixedPos=A;this.get_element().style.position=A?"":"absolute"},get_multiple:function(){return this._multiple},set_multiple:function(A){this._multiple=A},get_top:function(){return this._top},set_top:function(A){this._top=A},get_left:function(){return this._left},set_left:function(A){this._left=A},get_width:function(){return this._width},set_width:function(A){this._width=A;this._box.style.width=A+"px"},get_state:function(){return this._state},set_state:function(A){this._state=A},get_title:function(){return this._box.childNodes[1].innerHTML},set_title:function(A){this._box.childNodes[1].innerHTML=A},get_content:function(){return this._box.childNodes[2].innerHTML},set_content:function(A){this.clear_contents();if(typeof(A)==="object"){this._box.childNodes[2].appendChild(A)}else{this._box.childNodes[2].innerHTML=A}},get_callback:function(){return this._callback},set_callback:function(A){this._callback=A},get_showing:function(){return this._element.style.display!="none"},clear_contents:function(){var B=this._box.childNodes[2];for(var A=B.childNodes.length-1;A>=0;A--){B.removeChild(B.childNodes[A])}},add_button:function(E,C,D,B){var A=document.createElement("input");A.type="button";A.value=E;if(B){A.className=B}if(C){this._defaultButton=A}$addHandlers(A,{click:(D||this._buttonClick)},this);this._box.lastChild.appendChild(A);return A},remove_buttons:function(){var B=this._box.lastChild.childNodes;for(var A=B.length-1;A>=0;A--){$clearHandlers(B[A]);this._box.lastChild.removeChild(B[A])}},show:function(C){if(MySpace.UI._Popup._activePopup&&!this._multiple){throw"A Popup is already active."}if(C){this._callback=C}if(!this._multiple){window.get_overlay().show()}if((!this._globalCss||!this._useFixedPos)&&this._top!==null){this._element.style.top=this._top+"px"}if(this._left!==null){this._element.style.left=this._left+"px"}if(this._width!==null){this._box.style.width=this._width+"px"}this._element.style.display="";this._element.style.visibility="visible";var A=MySpace.Utils.Selector.query("iframe,object,embed,select",this._element);for(var B=0;B<A.length;B++){A[B].style.visibility=""}if(this._defaultButton){this._defaultButton.focus()}MySpace.UI._Popup._activePopup=this;this._addFixPosRule();this._elDim=this._getAdjBounds(this._element);this._checkBoxHeight()},_addFixPosRule:function(){if(this._globalCss!==null&&!this._ruleAdded&&this._useFixedPos){this._globalCss.addRule(".popup_wrapper","top:"+this._top+"px");this._top=(this._top==null?this._element.offsetTop:this._top);this._globalCss.addRule(".popup_wrapper","top:expression( (ignoreMe = (document.body.scrollTop || document.documentElement.scrollTop) + "+this._top+') + "px" )');this._ruleCnt+=2;this._ruleAdded=true}},_removeFixPosRule:function(){if(this._globalCss!==null&&this._ruleCnt&&!this._multiple){while(this._ruleCnt){this._globalCss.removeRule(this._globalCss.rules.length-1);this._ruleCnt--}this._ruleAdded=false}},_heightCheck:function(){var A=this._getBox("popup_box");var B=Sys.UI.DomElement.getBounds(A);if(parseInt(B.height)!=parseInt(this._prevHeight)||parseInt(this.get_element().scrollHeight)<parseInt(B.height)){this._checkBoxHeight()}else{clearTimeout(this._timerId);this._timerId=setTimeout(this._checkHeightHandler,2000)}},hide:function(){this._hide()},_hide:function(){clearTimeout(this._timerId);if(!this._multiple){window.get_overlay().hide()}this._element.style.display="none";MySpace.UI._Popup._activePopup=null;this._removeFixPosRule();this.get_element().style.top=(this._top?this._top+"px":"auto")},_buttonClick:function(B){this._hide();var A=this._callback;if(A){A(this,B)}},initialize:function(){this._checkHeightHandler=Function.createDelegate(this,this._heightCheck);this._resizeHandler=Function.createDelegate(this,this._checkBoxHeight);var D=this.get_element();D.parentNode.removeChild(D);document.body.appendChild(D);this._box.firstChild.isCancel=true;$addHandlers(this._box.firstChild,{click:this._buttonClick},this);MySpace.UI._Popup.callBaseMethod(this,"initialize");var C=(Sys.Browser.agent==Sys.Browser.InternetExplorer)?Sys.Browser.version:0;var A=(document.compatMode=="BackCompat");if((C==6)||(A&&C>=7)){for(var B=0;B<document.styleSheets.length;B++){if(/global.*(\.debug)*\.css/i.test(document.styleSheets[B].href)){this._globalCss=document.styleSheets[B]}}}if(this._autoSize){$addHandler(window,"resize",this._resizeHandler)}},_getAdjBounds:function(B){var C=Sys.UI.DomElement.getBounds(B);var A=(document.compatMode=="BackCompat")?document.body.scrollTop:document.documentElement.scrollTop;C.sHeight=A;if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&(document.compatMode!="BackCompat")){C.y-=A}return C},_getBox:function(B){var A=this._element.getElementsByTagName("div");var C=0;while(element=A[C++]){if(element.className.indexOf(B)>-1){return element}}},_checkBoxHeight:function(A){if(!this._autoSize||!this._useFixedPos){return}var B=this._getBox("popup_box");var E=document.compatMode;var C=(window.innerHeight?window.innerHeight:E=="BackCompat"?document.documentElement.offsetHeight:document.documentElement.clientHeight);if(B){var D=this._getAdjBounds(B);if(!this._globalCss&&D.height<=C&&this._elDim.y+D.height>C){this.get_element().style.position="fixed";this.get_element().style.top=parseInt((C-D.height)/2)+"px"}else{if(this._elDim.y+D.height>C){this._removeFixPosRule();if(this._globalCss){this._globalCss.addRule(".popup_wrapper","top:"+(D.y+D.sHeight)+"px !important");this._ruleCnt++}else{this.get_element().style.position="absolute";this.get_element().style.top=(D.y+D.sHeight)+"px"}}else{if(this._globalCss){this._removeFixPosRule();this._addFixPosRule()}else{this.get_element().style.position="fixed";this.get_element().style.top=(this._top?this._top+"px":"")}}}if(!A||D.height<this._prevHeight){this._prevHeight=D.height}clearTimeout(this._timerId);this._timerId=setTimeout(this._checkHeightHandler,2000)}},dispose:function(){var B=this._box.lastChild.childNodes;for(var A=0;A<B.length;A++){$clearHandlers(B[A])}MySpace.UI._Popup.callBaseMethod(this,"dispose")},_getIsFixed:function(){var A;var C=this._box.parentNode;while(C!==null){var B=MySpace.UI.getComputedStyle(C);if(B){A=B.position;if(A==="fixed"){return true}}C=C.parentNode}return false}};MySpace.UI._Popup.registerClass("MySpace.UI._Popup",Sys.UI.Control);MySpace.UI._Popup._activePopup=null;MySpace.UI.Popup=function(){throw"Cannot instantiate static class."};MySpace.UI.Popup.create=function(D,E,F,B,A){var C=document.createElement("div");C.innerHTML="<div class='popup_wrapper' style='z-index:1000201;left:0px;width:100%;display:none;visibility:hidden;'><div class='popup_box'><a class='popup_x'></a><div class='popup_title'></div><div class='popup_content'></div><div class='popup_buttons'></div></div></div>";return $create(MySpace.UI._Popup,{title:E,content:D,callback:F,multiple:B||false,autoSize:A===undefined?true:A},null,null,C.firstChild)};MySpace.UI.Popup.generic=function(C,B,E){var A=document.createElement("div");var D=MySpace.UI.Popup.create(C,MySpaceRes.Common.Attention);D.add_button(B);A.innerHTML=C;D.show(E);return D};MySpace.UI.Popup.alert=function(A,B){new MySpace.UI.Popup.generic(A,MySpaceRes.Common.Ok,B)};MySpace.UI.Popup.confirm=function(A,C){var B=new MySpace.UI.Popup.generic(A,MySpaceRes.Common.Yes,C);B.add_button(MySpaceRes.Common.No)};MySpace.UI.Popup.registerClass("MySpace.UI.Popup");MySpace.UI.Popup.IFrameContent=function(B,D,C,A,F){var E="<div class='popwithiframeloader' style='width:100%;text-align:center;position:absolute;top:50%;z-index:10;'><img src='"+MySpace.StaticContentBase+"/modules/common/static/img/loadercircles.gif'></div><iframe noresize='noresize' frameborder='0' scrolling='no' class='"+A+"' style='visibility:hidden;'></iframe>";this._frameSrc=C;this._popup=MySpace.UI.Popup.create(E,B,F);this._popup.set_width(D);this._loader=$q(".popwithiframeloader",this._popup.get_element(),true);this._frameElem=$q("."+A,this._popup.get_element(),true);$addHandler(this._frameElem,"load",Function.createDelegate(this,this.hideLoader));this._frameElem.src=C};MySpace.UI.Popup.IFrameContent.prototype={get_popup:function(){return this._popup},show:function(){this._frameElem.style.visibility="hidden";this._frameElem.style.width=this._frameElem.style.border="0px";this._loader.style.display="block";this._frameElem.src=this._frameSrc;this._popup.show()},hideLoader:function(){this._loader.style.display="none";this._frameElem.style.width=this._frameElem.style.border="";this._frameElem.style.visibility="visible"}};MySpace.UI.Popup.IFrameContent.registerClass("MySpace.UI.Popup.IFrameContent");MySpace.UI.DefaultButton=function(){throw"Cannot instantiate static class."};var $defBtn=MySpace.UI.DefaultButton.render=function(C,A){if(C.parentNode&&Sys.UI.DomElement.containsCssClass(C.parentNode,"msDefBtn")){return}var B=document.createElement("span");B.className="msDefBtn";if(A){Sys.UI.DomElement.addCssClass(B,A)}C.parentNode.insertBefore(B,C);MySpace.UI.DefaultButton.attach(C);B.appendChild(C);return B};MySpace.UI.DefaultButton.attach=function(A){A.hide=function(){this.parentNode.style.display="none"};A.show=function(){this.parentNode.style.display=""};A.disable=function(){this.disabled=true;Sys.UI.DomElement.removeCssClass(this.parentNode,"msDefBtn");Sys.UI.DomElement.addCssClass(this.parentNode,"msDefBtnDisabled")};A.enable=function(){this.removeAttribute("disabled");Sys.UI.DomElement.removeCssClass(this.parentNode,"msDefBtnDisabled");Sys.UI.DomElement.addCssClass(this.parentNode,"msDefBtn")}};MySpace.UI.DefaultButton.attachAll=function(){var B=MySpace.Utils.Selector.query(".msDefBtn input");for(var A=0;A<B.length;A++){MySpace.UI.DefaultButton.attach(B[A]);if(B[A].disabled){B[A].disable()}}};MySpace.UI.DefaultButton.renderAll=function(A){var C=MySpace.Utils.Selector.query("input.msDefBtn, button.msDefBtn");for(var B=0;B<C.length;B++){$defBtn(C[B],A)}};MySpace.UI.Tooltip=function(A){MySpace.UI.Tooltip.initializeBase(this,[A]);this._initUI()};MySpace.UI.Tooltip.prototype={_arrowDiv:null,_arrowOffsetX:0,_arrowOffsetY:0,_arrowPos:null,_autoPos:true,_bottomBorder:null,_container:null,_contentDiv:null,_cssClass:"",_hideDelay:500,_hideHandler:null,_hover:true,_left:null,_leftBorder:null,_margin:10,_reflect:false,_rightBorder:null,_showDelay:0,_showHandler:null,_theme:"helper",_timerID:0,_tipDiv:null,_tipOffsetX:0,_tipOffsetY:0,_tipPos:"bottomright",_top:null,_topBorder:null,_width:0,get_arrowOffsetX:function(){return this._arrowOffsetX},set_arrowOffsetX:function(A){this._arrowOffsetX=A},get_arrowOffsetY:function(){return this._arrowOffsetY},set_arrowOffsetY:function(A){this._arrowOffsetY=A},get_arrowPos:function(){return this._arrowPos},set_arrowPos:function(A){this._arrowPos=A},get_autoPos:function(){return this._autoPos},set_autoPos:function(A){this._autoPos=A},get_container:function(){return this._container},set_container:function(A){this._container=A},get_content:function(){return this._contentDiv.innerHTML},set_content:function(A){this._clearContents();if(typeof(A)==="object"){this._contentDiv.appendChild(A)}else{this._contentDiv.innerHTML=A}},get_cssClass:function(){return this._cssClass||""},set_cssClass:function(A){this._cssClass=A},get_hideDelay:function(){return this._hideDelay},set_hideDelay:function(A){this._hideDelay=A},get_hover:function(){return this._hover},set_hover:function(A){this._hover=A},get_left:function(){return this._left},set_left:function(A){this._left=A},get_margin:function(){return this._margin},set_margin:function(A){this._margin=A},get_reflect:function(){return this._reflect},set_reflect:function(A){this._reflect=A},get_showDelay:function(){return this._showDelay},set_showDelay:function(A){this._showDelay=A},get_theme:function(){return this._theme},set_theme:function(A){this._theme=A},get_tipDiv:function(){return this._tipDiv},set_tipDiv:function(A){this._tipDiv=A},get_tipOffsetX:function(){return this._tipOffsetX},set_tipOffsetX:function(A){this._tipOffsetX=A},get_tipOffsetY:function(){return this._tipOffsetY},set_tipOffsetY:function(A){this._tipOffsetY=A},get_tipPos:function(){return this._tipPos},set_tipPos:function(A){this._tipPos=A},get_top:function(){return this._top},set_top:function(A){this._top=A},get_width:function(){return this._width},set_width:function(A){this._width=A},_initUI:function(){this._tipDiv=document.createElement("div");this._tipDiv.innerHTML='<div style="position:absolute"></div><div class="t"><div><div></div></div></div><div class="m"><div id="fhLeftContentBorder" class="fhlborder"></div><div id="fhContent"></div><div id="fhRightContentBorder" class="fhrborder"></div><div class="clear"></div></div><div class="b"><div><div></div></div></div><iframe src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;z-index:1;"></iframe>';this._tipDiv.id="tooltipdiv";this._tipDiv.className="tooltipdiv "+this.get_cssClass();this._contentDiv=this._tipDiv.childNodes[2].childNodes[1];this._leftBorder=this._tipDiv.childNodes[2].firstChild;this._rightBorder=this._tipDiv.childNodes[2].childNodes[2];this._topBorder=this._tipDiv.childNodes[1];this._bottomBorder=this._tipDiv.childNodes[3]},initialize:function(){this._hideHandler=Function.createDelegate(this,this._delayedHide);this._showHandler=Function.createDelegate(this,this._delayedShow);if(this._hover){$addHandler(this._element,"mouseover",this._showHandler);$addHandler(this._element,"mouseout",this._hideHandler);$addHandler(this._tipDiv,"mouseover",Function.createDelegate(this,this._clearTimerID));$addHandler(this._tipDiv,"mouseout",this._hideHandler)}if(this._getIsFixed()){this._tipDiv.style.position="fixed"}this._contentDiv.className=this._theme;this._tipDiv.firstChild.className=this._theme+"arrow";if(this._container){this._container.appendChild(this._tipDiv)}else{document.body.appendChild(this._tipDiv)}this._arrowDiv=this._tipDiv.firstChild;if(this._width){this._tipDiv.style.width=this._width+"px"}},_clearContents:function(){var B=this._contentDiv;for(var A=B.childNodes.length-1;A>=0;A--){B.removeChild(B.childNodes[A])}},dispose:function(){$clearHandlers(this._element);if(this._container){this._container.removeChild(this._tipDiv)}else{document.body.removeChild(this._tipDiv)}MySpace.UI.Tooltip.callBaseMethod(this,"dispose")},show:function(){this._setPos();this._tipDiv.style.display="block";this._raiseEvent("visibilityChanged")},hide:function(){this._tipDiv.style.display="none";this._raiseEvent("tooltipClosed")},_clearTimerID:function(){if(this._timerID){clearTimeout(this._timerID);this._timerID=0}},_delayedHide:function(A){this._clearTimerID();this._timerID=window.setTimeout(Function.createDelegate(this,this.hide),this._hideDelay)},_delayedShow:function(A){this._clearTimerID();this._timerID=window.setTimeout(Function.createDelegate(this,this.show),this._showDelay)},_raiseEvent:function(A){var C=this.get_events().getHandler(A);if(C){var B=new Sys.EventArgs();C(this,B)}},_setTipDivClass:function(){this._tipDiv.className="tooltipdiv "+this.get_cssClass()},_setPos:function(){var P=tipY=0;var D;this._setTipDivClass();this._arrowDiv.className=this._theme+"arrow";this._arrowPos=null;if(this._rightBorder){this._rightBorder.className="fhrborder"}if(this._leftBorder){this._leftBorder.className="fhlborder"}if(this._topBorder){this._topBorder.className="t"}if(this._bottomBorder){this._bottomBorder.className="b"}var L=Sys.UI.DomElement.getBounds(this._element);var M=this._getTipDims();var K=document.compatMode;var C=(K=="BackCompat")?document.body.scrollLeft:document.documentElement.scrollLeft;var B=(K=="BackCompat")?document.body.scrollTop:document.documentElement.scrollTop;if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&K!="BackCompat"){L.x-=C;L.y-=B}if(!this._getIsFixed()&&Sys.Browser.agent===Sys.Browser.InternetExplorer){L.x+=C;L.y+=B}if(this._autoPos){this._setAutoPos(L,M)}var H=MySpace.UI.getComputedStyle(this._tipDiv);var F=MySpace.UI.getComputedStyle(this._arrowDiv);var J=(this._tipPos.indexOf("right")>-1?1:this._tipPos.indexOf("left")>-1?3:this._tipPos.indexOf("top")>-1?4:2);var I=M.width;if(this._width){I=this._width}P=L.x+L.width;switch(J){case 2:Sys.UI.DomElement.addCssClass(this._arrowDiv,"top");Sys.UI.DomElement.addCssClass(this._tipDiv,"tooltipbottom");break;case 3:Sys.UI.DomElement.addCssClass(this._arrowDiv,"right");Sys.UI.DomElement.addCssClass(this._tipDiv,"tooltipleft");P=L.x-I;if(this._rightBorder){this._rightBorder.className="fhrborderns"}if(this._leftBorder){this._leftBorder.className="fhlborderws"}if(this._bottomBorder){this._bottomBorder.className="blc"}if(this._topBorder){this._topBorder.className="tlc"}break;case 4:if(this._bottomBorder){this._bottomBorder.className="bc"}if(this._topBorder){this._topBorder.className="tc"}Sys.UI.DomElement.addCssClass(this._arrowDiv,"bottom");Sys.UI.DomElement.addCssClass(this._tipDiv,"tooltiptop");break;default:Sys.UI.DomElement.addCssClass(this._arrowDiv,"left");Sys.UI.DomElement.addCssClass(this._tipDiv,"tooltipright")}var E=F.height.replace("px","")-0;var G=F.width.replace("px","")-0;if(this._tipPos.indexOf("bottom")>-1){tipY=(this._tipPos!="bottom"?this._reflect?L.y:L.y+L.height-E-this._margin:L.y+L.height);P=(this._tipPos=="bottom"?L.x-(I/2)+(L.width/2):P);this._arrowPos=this._arrowPos||"top"}else{if(this._tipPos.indexOf("top")>-1){tipY=L.y-M.height+(this._tipPos!="top"?E+this._margin:0);P=(this._tipPos=="top"?L.x-(I/2)+(L.width/2):P);this._arrowPos=this._arrowPos||"bottom"}else{tipY=L.y-(M.height/2)+(L.height/2)-(E/2);this._arrowPos=this._arrowPos||"middle"}}this._tipDiv.style.left=(P+this._tipOffsetX)+"px";this._tipDiv.style.top=(tipY+this._tipOffsetY)+"px";var Q,A="";switch(this._arrowPos){case"bottom":Q=(this._tipPos=="top"?M.height:M.height-this._margin-E);if(this._tipPos=="top"){A=(this._arrowOffsetX+(I/2)-(G/2))+"px"}break;case"middle":Q=((M.height/2)-(E/2));break;default:Q=(this._tipPos=="bottom"?-E:this._margin);if(this._tipPos=="bottom"){A=(this._arrowOffsetX+(I/2)-(G/2))+"px"}}this._arrowDiv.style.left=A;this._arrowDiv.style.top=(Q+this._arrowOffsetY)+"px";var N=this._tipDiv.lastChild;N.width=I+"px";N.height=M.height+"px";N.style.zIndex=-1;N.style.display="block";this._tipDiv.style.height=M.height+"px";var O=MySpace.UI.getContentBox(this._contentDiv);if(browser.isIE6x&&document.compatMode!="BackCompat"){O.w+=15;I+=11}if(O.w==0||O.w>=I-10){O.w=I-11}this._contentDiv.style.width=O.w+"px";this._tipDiv.style.width=I+"px";if(this._left){this._tipDiv.style.left=this._left+"px"}if(this._top){this._tipDiv.style.top=this._top+"px"}},_setAutoPos:function(D,F){this._clearTimerID();var A=(typeof(window.pageXOffset)!=="undefined")?window.pageXOffset:document.documentElement.scrollLeft;var H=(typeof(window.pageYOffset)!=="undefined")?window.pageYOffset:document.documentElement.scrollTop;var G=(window.innerWidth?window.innerWidth:document.documentElement.clientWidth);var E=(window.innerHeight?window.innerHeight:document.documentElement.clientHeight);var C=["topleft","topright","bottomleft","bottomright"];var B=3;B=(D.x-F.width>A?(D.y-H+F.height>E&&D.y-F.height>H?(D.x+D.width+F.width<G?2:1):D.x+D.width+F.width<G?4:3):(D.y-H+F.height>E?2:4));this._tipPos=C[B-1]},_getTipDims:function(){var A=this._tipDiv.lastChild;A.style.display="none";this._contentDiv.style.width="";this._tipDiv.style.height="";this._tipDiv.style.width="";this._tipDiv.style.width=(this._width?this._width+"px":"");this._tipDiv.style.display="block";var B=Sys.UI.DomElement.getBounds(this._tipDiv);if(B.width<1){B.width=250}this._tipDiv.style.display="none";return{height:B.height,width:B.width}},_getIsFixed:function(){var A;var C=this._element.parentNode;while(C!==null){var B=MySpace.UI.getComputedStyle(C);if(B){A=B.position;if(A==="fixed"){return true}}C=C.parentNode}return false},add_tooltipClosed:function(A){this.get_events().addHandler("tooltipClosed",A)},remove_tooltipClosed:function(A){this.get_events().removeHandler("tooltipClosed",A)},add_visibilityChanged:function(A){this.get_events().addHandler("visibilityChanged",A)},remove_visibilityChanged:function(A){this.get_events().removeHandler("visibilityChanged",A)}};MySpace.UI.Tooltip.registerClass("MySpace.UI.Tooltip",Sys.UI.Control);MySpace.UI.addQuickPostScript=function(A){MySpace.UI.addDeferredScript("QuickPost.js",function(){if(MySpace.UI._QuickPost.rte){MySpace.UI.addDeferredScript("RichTextEditor.js",function(){if(typeof A=="function"){A()}})}else{if(typeof A=="function"){A()}}})};MySpace.UI.initQuickPostInline=function(){function A(C,B){if(B&&B.preventDefault){B.preventDefault()}MySpace.UI.addQuickPostScript(function(){MySpace.UI.QuickPostInline.createAndOpen(C)})}Array.forEach(MySpace.UI._QuickPost.inlines,function(D){var F=Function.createPartial(window,A,D),C=$get(D.id),E=D.jsControlReference;if(!C){return}var B=C.getElementsByTagName("textarea")[0];B.value=D.textboxTip;$addHandler(B,"focus",F);$addHandler($q(".msDefBtn",C,true),"click",F);if(E){MySpace.Util.setJSValue(E,{set_webServiceParams:function(G){D.webServiceParams=G},set_textboxTip:function(G){D.textboxTip=G},set_width:function(G){D.width=G},set_webServiceUrl:function(G){D.webServiceUrl=G},reset:function(){}})}});MySpace.UI._QuickPost.inlines=null};MySpace.UI.ProfileCommentQuickPostPopup={show:function(B,C,D){if(B&&B.preventDefault){B.preventDefault()}if(!C&&B&&B.target&&B.target.href){var A=B.target.href.match(/friendid=(\d+)/i);if(A&&A[1]){C=parseInt(A[1])}}MySpace.UI.addQuickPostScript(function(){MySpace.UI.ProfileCommentQuickPostPopup.show(null,C,D)})}};MySpace.UI.MessagingQuickPostPopup={show:function(B,A,C,D){if(B&&B.preventDefault){B.preventDefault()}MySpace.UI.addQuickPostScript(function(){MySpace.UI.MessagingQuickPostPopup.show(null,A,C,D)})}};MySpace.UI.AddFriendPopup={show:function(A){if(A.preventDefault){A.preventDefault()}A={friendId:A.friendId,acctType:A.acctType,target:A.target||A.srcElement};MySpace.UI.addQuickPostScript(function(){if(!Friends.AddToFriendsPopOver.getInstance()){$create(Friends.AddToFriendsPopOver,{iFrameSrc:MySpace.UI._addFriendPopupUrl,id:"globalAddToFriendsPopover"},null,null)}Friends.AddToFriendsPopOver.getInstance()._invokPopOver(A)})},bind:function(A){var C=MySpace.Utils.Selector.query(A);for(var B=0;B<C.length;B++){$addHandler(C[B],"click",MySpace.UI.AddFriendPopup.show)}}};if(MySpace.UI._addFriendPopupSelectors){Array.forEach(MySpace.UI._addFriendPopupSelectors,MySpace.UI.AddFriendPopup.bind)}Type.registerNamespace("MySpace.Header.Search");(function(){var A=$get("search_q_Header");if(A){MySpace.Header.Search.ORANGESearchBox=$create(MySpace.UI.DefaultTextboxBehavior,null,null,null,A)}})();MySpace.Tracker=(function(A){var C={};function B(E){if(typeof _gat==="undefined"){var D=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");MySpace.UI.addScript(D+"google-analytics.com/ga.js","_gat",E)}else{E()}}return{initAccount:function(D){B(function(){var E=_gat._getTracker(D);C[D]=E})},setSampleRate:function(E,D){B(function(){if(typeof C[E]==="undefined"){MySpace.Tracker.initAccount(E)}var F=C[E];if(typeof F!=="undefined"&&typeof F._setSampleRate==="function"){F._setSampleRate(D)}})},track:function(D,E){B(function(){if(typeof C[E]==="undefined"){MySpace.Tracker.initAccount(E)}var F=C[E];if(typeof F!=="undefined"&&typeof F._trackPageview==="function"){if(D==""){F._trackPageview()}else{F._trackPageview(D)}}})},trackClassName:function(E,D,F){B(function(){if(typeof C[F]==="undefined"){MySpace.Tracker.initAccount(F)}A("a."+E).click(function(){MySpace.Tracker.track(D,F)})})},trackByAttribute:function(D,E){B(function(){if(typeof C[E]==="undefined"){MySpace.Tracker.initAccount(E)}A("a["+D+"]").click(function(){MySpace.Tracker.track(this.getAttribute(D),E)})})}}})(jQuery);