function MaskedEditSetMessage(n,t,i){n.errormessage=t;n.text=""==i?t:i;n.innerHTML=n.text}function MaskedEditMessageShow(n,t){if("string"==typeof n.display){if("None"==n.display)return;if("Dynamic"==n.display)return void(n.style.display=t?"none":"inline")}n.style.visibility=t?"hidden":"visible"}function MaskedEditSetCssClass(n,t){var i=$get(n.TargetValidator);Sys.UI.DomElement.removeCssClass(i,n.InvalidValueCssClass);Sys.UI.DomElement.removeCssClass(i,n.CssBlurNegative);Sys.UI.DomElement.removeCssClass(i,n.CssFocus);Sys.UI.DomElement.removeCssClass(i,n.CssFocusNegative);""!=t&&Sys.UI.DomElement.addCssClass(i,t)}function MaskedEditValidatorDateTime(value){var target,ret,mask,rx,matches,MaxVlDt,MaxVlTm,args;if(MaskedEditSetMessage(value,"",""),MaskedEditSetCssClass(value,""),MaskedEditMessageShow(value,!0),"false"==value.IsMaskedEdit)return!0;if(target=$get(value.TargetValidator),"false"==value.ValidEmpty&&Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value()==value.InitialValue)return MaskedEditSetMessage(value,value.EmptyValueMessage,value.EmptyValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass),MaskedEditMessageShow(value,!1),!1;if(""==Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value())return!0;if(ret=!0,mask=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(target).get_Value(),""!=value.ValidationExpression&&(rx=new RegExp(value.ValidationExpression),matches=rx.exec(mask),ret=null!=matches&&mask==matches[0],!ret))return MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass),MaskedEditMessageShow(value,!1),!1;var PartDate=target.MaskedEditBehavior.AutoFormatDate(),PartTime=target.MaskedEditBehavior.AutoFormatTime(),MinVlDt="",MinVlTm="";return""!=value.MinimumValue&&(MinVlDt=value.MinimumValue.split(" ")[0],MinVlTm=value.MinimumValue.split(" ")[1]),MaxVlDt="",MaxVlTm="",(""!=value.MaximumValue&&(MaxVlDt=value.MaximumValue.split(" ")[0],MaxVlTm=value.MaximumValue.split(" ")[1]),ret=MaskedEditValidatorPartDate(value,PartDate,MinVlDt,MaxVlDt),ret&&(ret=MaskedEditValidatorPartTime(value,PartTime,MinVlTm,MaxVlTm)),ret&&""!=value.ClientValidationFunction)&&(args={Value:mask,IsValid:!0},eval(value.ClientValidationFunction+"(value, args);"),ret=args.IsValid,ret||(MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass))),ret||MaskedEditMessageShow(value,ret),ret}function MaskedEditValidatorPartTime(n,t,i,r){var s=!0,h=n.TimeSeparator,g=n.AmPmSymbol,b=g.split(";"),nt=g.replace(";","|"),tt="^(^([0][0-9]|[1][0-2])"+h+"([0-5][0-9])"+h+"([0-5][0-9])\\s("+nt+")$)|(^([0][0-9]|[1][0-2])"+h+"([0-5][0-9])\\s("+nt+")$)$",it="^(^([0-1][0-9]|[2][0-3])"+h+"([0-5][0-9])"+h+"([0-5][0-9])$)|(^([0-1][0-9]|[2][0-3])"+h+"([0-5][0-9])$)$",e=-1,v=-1,w=-1,y="",p=t.split(h),k=new RegExp(tt),c=k.exec(t),d=new RegExp(it),l=d.exec(t),u,o,a,f;return(c&&c[0]==t?(y=t.substring(t.length-2).substring(0,1),e=parseInt(p[0],10),y.toUpperCase()==b[1].substring(0,1).toUpperCase()&&(e+=12,24==e&&(e=12)),v=parseInt(p[1],10),w=n.length>9?parseInt(p[2].substring(0,2),10):0):l&&l[0]==t&&(e=parseInt(p[0],10),v=parseInt(p[1],10),w=t.length>5?parseInt(p[2],10):0),e!=-1&&v!=-1&&w!=-1||(s=!1),s||(MaskedEditSetMessage(n,n.InvalidValueMessage,n.InvalidValueText),MaskedEditSetCssClass(n,n.InvalidValueCssClass)),s&&(""!=r||""!=i))&&(""!=i&&(u=-1,o=-1,a=-1,f=i.split(h),c=k.exec(i),l=d.exec(i),c&&c[0]==i?(y=i.substring(i.length-2).substring(0,1),u=parseInt(f[0],10),y.toUpperCase()==b[1].substring(0,1).toUpperCase()&&(u+=12,24==u&&(u=0)),o=parseInt(f[1],10),a=i.length>9?parseInt(f[2].substring(0,2),10):0):l&&l[0]==i&&(u=parseInt(f[0],10),o=parseInt(f[1],10),a=i.length>5?parseInt(f[2],10):0),s=e>u||e==u&&v>o||e==u&&v==o&&w>=a,s||(MaskedEditSetMessage(n,n.MinimumValueMessage,n.MinimumValueText),MaskedEditSetCssClass(n,n.InvalidValueCssClass))),""!=r&&s&&(u=-1,o=-1,a=-1,f=r.split(h),c=k.exec(r),l=d.exec(r),c&&c[0]==r?(y=r.substring(r.length-2).substring(0,1),u=parseInt(f[0],10),y.toUpperCase()==b[1].substring(0,1).toUpperCase()&&(u+=12,24==u&&(u=0)),o=parseInt(f[1],10),a=r.length>9?parseInt(f[2].substring(0,2),10):0):l&&l[0]==r&&(u=parseInt(f[0],10),o=parseInt(f[1],10),a=r.length>5?parseInt(f[2],10):0),s=e0&&s>0&&e>0&&(l<=[,31,28,31,30,31,30,31,31,30,31,30,31][s]||29==l&&2==s&&e%4==0&&(e%100>0||e%400==0))),f||(MaskedEditSetMessage(n,n.InvalidValueMessage,n.InvalidValueText),MaskedEditSetCssClass(n,n.InvalidValueCssClass)),f&&(""!=r||""!=i)){var h,a=-1,c=-1,o=-1;""!=i&&(h=i.split(y),a=parseInt(h[u.indexOf("D")],10),c=parseInt(h[u.indexOf("M")],10),o=parseInt(h[u.indexOf("Y")],10),f=a>0&&c>0&&o>0&&e>o||e==o&&s>c||e==o&&s==c&&l>=a,f||(MaskedEditSetMessage(n,n.MinimumValueMessage,n.MinimumValueText),MaskedEditSetCssClass(n,n.InvalidValueCssClass)));f&&""!=r&&(h=r.split(y),a=parseInt(h[u.indexOf("D")],10),c=parseInt(h[u.indexOf("M")],10),o=parseInt(h[u.indexOf("Y")],10),f=a>0&&c>0&&o>0&&eCompnum&&(ret=!1,MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass))),ret&&""!=value.MinimumValue&&(Compnum=parseInt(value.MinimumValue,10),isNaN(Compnum)||num0?m[2]:"0")+"."+m[4]:(m[2].length>0?m[2]:"0")+"."+m[4],num=parseFloat(cleanInput),ret=!isNaN(num)),ret||(MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass)),ret&&(""!=value.MaximumValue&&(Compnum=parseFloat(value.MaximumValue),isNaN(Compnum)||num>Compnum&&(ret=!1,MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass))),ret&&""!=value.MinimumValue&&(Compnum=parseFloat(value.MinimumValue),isNaN(Compnum)||numnum&&(ret=!1,MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText),MaskedEditSetCssClass(value,value.InvalidValueCssClass))),ret&&""!=value.MinimumValue&&null!=value.MinimumValue.match(exp)&&(num=parseInt(value.MinimumValue,10),isNaN(num)||mask.lengthSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._borderStyleNames[t],r=this.getCurrentStyle(n,i);return"none"!=r},getMargin:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._marginWidthNames[t],r=this.getCurrentStyle(n,i);try{return this.parsePadding(r)}catch(n){return 0}},getBorderWidth:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));if(!this.isBorderVisible(n,t))return 0;var i=this._borderWidthNames[t],r=this.getCurrentStyle(n,i);return this.parseBorderWidth(r)},getPadding:function(n,t){if(!n)throw Error.argumentNull("element");if(tSys.Extended.UI.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,t,"Sys.Extended.UI.BoxSide"));var i=this._paddingWidthNames[t],r=this.getCurrentStyle(n,i);return this.parsePadding(r)},parseBorderWidth:function(n){var r,t,i,u,f;if(this._borderThicknesses||(r={},t=document.createElement("div"),t.style.visibility="hidden",t.style.position="absolute",t.style.fontSize="1px",document.body.appendChild(t),i=document.createElement("div"),i.style.height="0px",i.style.overflow="hidden",t.appendChild(i),u=t.offsetHeight,i.style.borderTop="solid black",i.style.borderTopWidth="thin",r.thin=t.offsetHeight-u,i.style.borderTopWidth="medium",r.medium=t.offsetHeight-u,i.style.borderTopWidth="thick",r.thick=t.offsetHeight-u,t.removeChild(i),document.body.removeChild(t),this._borderThicknesses=r),n){switch(n){case"thin":case"medium":case"thick":return this._borderThicknesses[n];case"inherit":return 0}return f=this.parseUnit(n),Sys.Debug.assert("px"==f.type,String.format(Sys.Extended.UI.Resources.Common_InvalidBorderWidthUnit,f.type)),f.size}return 0},parsePadding:function(n){if(n){if("inherit"==n)return 0;var t=this.parseUnit(n);return"px"!==t.type&&Sys.Debug.fail(String.format(Sys.Extended.UI.Resources.Common_InvalidPaddingUnit,t.type)),t.size}return 0},parseUnit:function(n){var t,f,u;if(!n)throw Error.argumentNull("value");n=n.trim().toLowerCase();for(var e=n.length,i=-1,r=0;r"9")&&"-"!=t&&"."!=t&&","!=t)break;i=r}if(i==-1)throw Error.create(Sys.Extended.UI.Resources.Common_UnitHasNoDigits);return f=i0){var func;if((func=window[value])instanceof Function||(func=eval(value))instanceof Function)return func}}return null},addCssClasses:function(n,t){for(var i=0;i=n.x&&t=n.y&&it&&(f="l"==r?f.substr(f.length-t,t):f.substr(0,t)),f},__DOMEvents:{focusin:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focusin",!0,!1,window,1)}},focusout:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focusout",!0,!1,window,1)}},activate:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("activate",!0,!0,window,1)}},focus:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("focus",!1,!1,window,1)}},blur:{eventGroup:"UIEvents",init:function(n){n.initUIEvent("blur",!1,!1,window,1)}},click:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("click",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},dblclick:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("click",!0,!0,window,2,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mousedown:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousedown",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseup:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mouseup",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseover:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mouseover",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mousemove:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousemove",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},mouseout:{eventGroup:"MouseEvents",init:function(n,t){n.initMouseEvent("mousemove",!0,!0,window,1,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null)}},load:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("load",!1,!1)}},unload:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("unload",!1,!1)}},select:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("select",!0,!1)}},change:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("change",!0,!1)}},submit:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("submit",!0,!0)}},reset:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("reset",!0,!1)}},resize:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("resize",!0,!1)}},scroll:{eventGroup:"HTMLEvents",init:function(n){n.initEvent("scroll",!0,!1)}}},tryFireRawEvent:function(n,t){try{if(n.fireEvent)return n.fireEvent("on"+t.type,t),!0;if(n.dispatchEvent)return n.dispatchEvent(t),!0}catch(n){}return!1},tryFireEvent:function(n,t,i){var u,r;try{if(document.createEventObject)return r=document.createEventObject(),$common.applyProperties(r,i||{}),n.fireEvent("on"+t,r),!0;if(document.createEvent&&(u=$common.__DOMEvents[t],u))return r=document.createEvent(u.eventGroup),u.init(r,i||{}),n.dispatchEvent(r),!0}catch(n){}return!1},wrapElement:function(n,t,i){var r=n.parentNode;r.replaceChild(t,n);(i||t).appendChild(n)},unwrapElement:function(n,t){var i=t.parentNode;null!=i&&($common.removeElement(n),i.replaceChild(n,t))},removeElement:function(n){var t=n.parentNode;null!=t&&t.removeChild(n)},applyProperties:function(n,t){var r,i,u;for(r in t)i=t[r],null!=i&&Object.getType(i)===Object?(u=n[r],$common.applyProperties(u,i)):n[r]=i},createElementFromTemplate:function(n,t,i){var f,h,r,e,s,c,o,u;if("undefined"!=typeof n.nameTable&&(f=n.nameTable,String.isInstanceOfType(f)&&(f=i[f]),null!=f&&(i=f)),h=null,"undefined"!=typeof n.name&&(h=n.name),r=document.createElement(n.nodeName),("undefined"!=typeof n.name&&i&&(i[n.name]=r),"undefined"!=typeof n.parent&&null==t)&&(e=n.parent,String.isInstanceOfType(e)&&(e=i[e]),null!=e&&(t=e)),"undefined"!=typeof n.properties&&null!=n.properties&&$common.applyProperties(r,n.properties),"undefined"!=typeof n.cssClasses&&null!=n.cssClasses&&$common.addCssClasses(r,n.cssClasses),"undefined"!=typeof n.events&&null!=n.events&&$addHandlers(r,n.events),"undefined"!=typeof n.visible&&null!=n.visible&&this.setVisible(r,n.visible),t&&t.appendChild(r),"undefined"!=typeof n.opacity&&null!=n.opacity&&$common.setElementOpacity(r,n.opacity),"undefined"!=typeof n.children&&null!=n.children)for(s=0;s100&&(n=100);this._percentComplete=n;this.raisePropertyChanged("percentComplete");t&&this.onStep(n);100===n&&this.stop(!1)},setOwner:function(n){this._owner=n},add_started:function(n){this.get_events().addHandler("started",n)},remove_started:function(n){this.get_events().removeHandler("started",n)},raise_started:function(){var n=this.get_events().getHandler("started");n&&n(this,Sys.EventArgs.Empty)},raiseStarted:function(){Sys.Extended.Deprecated("raiseStarted()","raise_started()");this.raise_started()},add_ended:function(n){this.get_events().addHandler("ended",n)},remove_ended:function(n){this.get_events().removeHandler("ended",n)},raise_ended:function(){var n=this.get_events().getHandler("ended");n&&n(this,Sys.EventArgs.Empty)},raiseEnded:function(){Sys.Extended.Deprecated("raiseEnded()","raise_ended()");this.raise_ended()},add_step:function(n){this.get_events().addHandler("step",n)},remove_step:function(n){this.get_events().removeHandler("step",n)},raise_step:function(){var n=this.get_events().getHandler("step");n&&n(this,Sys.EventArgs.Empty)},raiseStep:function(){Sys.Extended.Deprecated("raiseStep()","raise_step()");this.raise_ended()},get_target:function(){return!this._target&&this._parentAnimation?this._parentAnimation.get_target():this._target},set_target:function(n){this._target!=n&&(this._target=n,this.raisePropertyChanged("target"))},setAnimationTarget:function(n){var i=null,t=$get(n),r;if(t?i=t:(r=$find(n),r&&(t=r.get_element(),t&&(i=t))),!i)throw Error.argument("id",String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound,n));this.set_target(i)},set_animationTarget:function(n){Sys.Extended.Deprecated("setAnimationTarget(id)","set_animationTarget(id)");this.setAnimationTarget(n)},get_duration:function(){return this._duration},set_duration:function(n){n=this._getFloat(n);this._duration!=n&&(this._duration=n,this.raisePropertyChanged("duration"))},get_fps:function(){return this._fps},set_fps:function(n){n=this._getInteger(n);this.fps!=n&&(this._fps=n,this.raisePropertyChanged("fps"))},get_isActive:function(){return null!==this._timer},get_isPlaying:function(){return null!==this._timer&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(n){return String.isInstanceOfType(n)?Boolean.parse(n):n},_getInteger:function(n){return String.isInstanceOfType(n)?parseInt(n):n},_getFloat:function(n){return String.isInstanceOfType(n)?parseFloat(n):n},_getEnum:function(n,t){return String.isInstanceOfType(n)&&t&&t.parse?t.parse(n):n}},$AA.Animation.registerClass("Sys.Extended.UI.Animation.Animation",Sys.Component),$AA.registerAnimation("animation",$AA.Animation),$AA.ParentAnimation=function(n,t,i,r){if($AA.ParentAnimation.initializeBase(this,[n,t,i]),this._animations=[],r&&r.length)for(var u=0;u=0;n--)this._animations[n].dispose(),this._animations[n]=null;Array.clear(this._animations);this._animations=[];this.raisePropertyChanged("animations")}}},$AA.ParentAnimation.registerClass("Sys.Extended.UI.Animation.ParentAnimation",$AA.Animation),$AA.registerAnimation("parent",$AA.ParentAnimation),$AA.ParallelAnimation=function(n,t,i,r){$AA.ParallelAnimation.initializeBase(this,[n,t,i,r])},$AA.ParallelAnimation.prototype={add:function(n){$AA.ParallelAnimation.callBaseMethod(this,"add",[n]);n.setOwner(this)},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,"onStart");for(var t=this.get_animations(),n=0;n=1||this._iterations<=0?(this._remainingIterations--,this._index=0,i=n[0],i.add_ended(this._handler),i.play()):this.stop()},onStep:function(){throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence);},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,"onEnd")},get_isActive:function(){return!0},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(n){n=this._getInteger(n);this._iterations!=n&&(this._iterations=n,this.raisePropertyChanged("iterations"))},get_isInfinite:function(){return this._iterations<=0}},$AA.SequenceAnimation.registerClass("Sys.Extended.UI.Animation.SequenceAnimation",$AA.ParentAnimation),$AA.registerAnimation("sequence",$AA.SequenceAnimation),$AA.SelectionAnimation=function(n,t,i,r){$AA.SelectionAnimation.initializeBase(this,[n,t,i,r]);this._selectedIndex=-1;this._selected=null},$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented();},onStart:function(){$AA.SelectionAnimation.callBaseMethod(this,"onStart");var n=this.get_animations();this._selectedIndex=this.getSelectedIndex();this._selectedIndex>=0&&this._selectedIndex0)try{selected=eval(this._conditionScript)?0:1}catch(t){}return selected},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(n){this._conditionScript!=n&&(this._conditionScript=n,this.raisePropertyChanged("conditionScript"))}},$AA.ConditionAnimation.registerClass("Sys.Extended.UI.Animation.ConditionAnimation",$AA.SelectionAnimation),$AA.registerAnimation("condition",$AA.ConditionAnimation),$AA.CaseAnimation=function(n,t,i,r,u){$AA.CaseAnimation.initializeBase(this,[n,t,i,r]);this._selectScript=u},$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1,result;if(this._selectScript&&this._selectScript.length>0)try{result=eval(this._selectScript);void 0!==result&&(selected=result)}catch(t){}return selected},get_selectScript:function(){return this._selectScript},set_selectScript:function(n){this._selectScript!=n&&(this._selectScript=n,this.raisePropertyChanged("selectScript"))}},$AA.CaseAnimation.registerClass("Sys.Extended.UI.Animation.CaseAnimation",$AA.SelectionAnimation),$AA.registerAnimation("case",$AA.CaseAnimation),$AA.FadeEffect=function(){throw Error.invalidOperation();},$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1},$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect",!1),$AA.FadeAnimation=function(n,t,i,r,u,f,e){$AA.FadeAnimation.initializeBase(this,[n,t,i]);this._effect=void 0!==r?r:$AA.FadeEffect.FadeIn;this._max=void 0!==f?f:1;this._min=void 0!==u?u:0;this._start=this._min;this._end=this._max;this._layoutCreated=!1;this._forceLayoutInIE=void 0===e||null===e||e;this._currentTarget=null;this._resetOpacities()},$AA.FadeAnimation.prototype={_resetOpacities:function(){this._effect==$AA.FadeEffect.FadeIn?(this._start=this._min,this._end=this._max):(this._start=this._max,this._end=this._min)},_createLayout:function(){var n=this._currentTarget,t;n&&(this._originalWidth=$common.getCurrentStyle(n,"width"),t=$common.getCurrentStyle(n,"height"),this._originalBackColor=$common.getCurrentStyle(n,"backgroundColor"),this._originalWidth&&""!=this._originalWidth&&"auto"!=this._originalWidth||t&&""!=t&&"auto"!=t||(n.style.width=n.offsetWidth+"px"),this._originalBackColor&&""!=this._originalBackColor&&"transparent"!=this._originalBackColor&&"rgba(0, 0, 0, 0)"!=this._originalBackColor||(n.style.backgroundColor=$common.getInheritedBackgroundColor(n)),this._layoutCreated=!0)},onStart:function(){$AA.FadeAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target();this.setValue(this._start);this._forceLayoutInIE&&!this._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer&&this._createLayout()},getAnimatedValue:function(n){return this.interpolate(this._start,this._end,n)},setValue:function(n){this._currentTarget&&$common.setElementOpacity(this._currentTarget,n)},get_effect:function(){return this._effect},set_effect:function(n){n=this._getEnum(n,$AA.FadeEffect);this._effect!=n&&(this._effect=n,this._resetOpacities(),this.raisePropertyChanged("effect"))},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(n){n=this._getFloat(n);this._min!=n&&(this._min=n,this._resetOpacities(),this.raisePropertyChanged("minimumOpacity"))},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(n){n=this._getFloat(n);this._max!=n&&(this._max=n,this._resetOpacities(),this.raisePropertyChanged("maximumOpacity"))},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(n){n=this._getBoolean(n);this._forceLayoutInIE!=n&&(this._forceLayoutInIE=n,this.raisePropertyChanged("forceLayoutInIE"))},setStartValue:function(n){n=this._getFloat(n);this._start=n},set_startValue:function(n){Sys.Extended.Deprecated("setStartValue(value)","set_startValue(value)");this.setStartValue(n)}},$AA.FadeAnimation.registerClass("Sys.Extended.UI.Animation.FadeAnimation",$AA.Animation),$AA.registerAnimation("fade",$AA.FadeAnimation),$AA.FadeInAnimation=function(n,t,i,r,u,f){$AA.FadeInAnimation.initializeBase(this,[n,t,i,$AA.FadeEffect.FadeIn,r,u,f])},$AA.FadeInAnimation.prototype={onStart:function(){$AA.FadeInAnimation.callBaseMethod(this,"onStart");this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}},$AA.FadeInAnimation.registerClass("Sys.Extended.UI.Animation.FadeInAnimation",$AA.FadeAnimation),$AA.registerAnimation("fadeIn",$AA.FadeInAnimation),$AA.FadeOutAnimation=function(n,t,i,r,u,f){$AA.FadeOutAnimation.initializeBase(this,[n,t,i,$AA.FadeEffect.FadeOut,r,u,f])},$AA.FadeOutAnimation.prototype={onStart:function(){$AA.FadeOutAnimation.callBaseMethod(this,"onStart");this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}},$AA.FadeOutAnimation.registerClass("Sys.Extended.UI.Animation.FadeOutAnimation",$AA.FadeAnimation),$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation),$AA.PulseAnimation=function(n,t,i,r,u,f,e){$AA.PulseAnimation.initializeBase(this,[n,t,i,null,void 0!==r?r:3]);this._out=new $AA.FadeOutAnimation(n,t,i,u,f,e);this.add(this._out);this._in=new $AA.FadeInAnimation(n,t,i,u,f,e);this.add(this._in)},$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(n){n=this._getFloat(n);this._out.set_minimumOpacity(n);this._in.set_minimumOpacity(n);this.raisePropertyChanged("minimumOpacity")},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(n){n=this._getFloat(n);this._out.set_maximumOpacity(n);this._in.set_maximumOpacity(n);this.raisePropertyChanged("maximumOpacity")},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(n){n=this._getBoolean(n);this._out.set_forceLayoutInIE(n);this._in.set_forceLayoutInIE(n);this.raisePropertyChanged("forceLayoutInIE")},setDuration:function(n){n=this._getFloat(n);$AA.PulseAnimation.callBaseMethod(this,"set_duration",[n]);this._in.set_duration(n);this._out.set_duration(n)},set_duration:function(n){Sys.Extended.Deprecated("setDuration(value)","set_duration(value)");this.setDuration(n)},setFps:function(n){n=this._getInteger(n);$AA.PulseAnimation.callBaseMethod(this,"set_fps",[n]);this._in.set_fps(n);this._out.set_fps(n)},set_fps:function(n){Sys.Extended.Deprecated("setFps(value)","set_fps(value)");this.setFps(n)}},$AA.PulseAnimation.registerClass("Sys.Extended.UI.Animation.PulseAnimation",$AA.SequenceAnimation),$AA.registerAnimation("pulse",$AA.PulseAnimation),$AA.PropertyAnimation=function(n,t,i,r,u){$AA.PropertyAnimation.initializeBase(this,[n,t,i]);this._property=r;this._propertyKey=u;this._currentTarget=null},$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target()},setValue:function(n){var t=this._currentTarget;t&&this._property&&this._property.length>0&&(this._propertyKey&&this._propertyKey.length>0&&t[this._property]?t[this._property][this._propertyKey]=n:t[this._property]=n)},getValue:function(){var t=this.get_target(),n;return t&&this._property&&this._property.length>0&&(n=t[this._property],n)?this._propertyKey&&this._propertyKey.length>0?n[this._propertyKey]:n:null},get_property:function(){return this._property},set_property:function(n){this._property!=n&&(this._property=n,this.raisePropertyChanged("property"))},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(n){this._propertyKey!=n&&(this._propertyKey=n,this.raisePropertyChanged("propertyKey"))}},$AA.PropertyAnimation.registerClass("Sys.Extended.UI.Animation.PropertyAnimation",$AA.Animation),$AA.registerAnimation("property",$AA.PropertyAnimation),$AA.DiscreteAnimation=function(n,t,i,r,u,f){$AA.DiscreteAnimation.initializeBase(this,[n,t,i,r,u]);this._values=f&&f.length?f:[]},$AA.DiscreteAnimation.prototype={getAnimatedValue:function(n){var t=Math.floor(this.interpolate(0,this._values.length-1,n));return this._values[t]},get_values:function(){return this._values},set_values:function(n){this._values!=n&&(this._values=n,this.raisePropertyChanged("values"))}},$AA.DiscreteAnimation.registerClass("Sys.Extended.UI.Animation.DiscreteAnimation",$AA.PropertyAnimation),$AA.registerAnimation("discrete",$AA.DiscreteAnimation),$AA.InterpolatedAnimation=function(n,t,i,r,u,f,e){$AA.InterpolatedAnimation.initializeBase(this,[n,t,i,void 0!==r?r:"style",u]);this._startValue=f;this._endValue=e},$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(n){n=this._getFloat(n);this._startValue!=n&&(this._startValue=n,this.raisePropertyChanged("startValue"))},get_endValue:function(){return this._endValue},set_endValue:function(n){n=this._getFloat(n);this._endValue!=n&&(this._endValue=n,this.raisePropertyChanged("endValue"))}},$AA.InterpolatedAnimation.registerClass("Sys.Extended.UI.Animation.InterpolatedAnimation",$AA.PropertyAnimation),$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation),$AA.ColorAnimation=function(n,t,i,r,u,f,e){$AA.ColorAnimation.initializeBase(this,[n,t,i,r,u,f,e]);this._start=null;this._end=null;this._interpolateRed=!1;this._interpolateGreen=!1;this._interpolateBlue=!1},$AA.ColorAnimation.prototype={onStart:function(){$AA.ColorAnimation.callBaseMethod(this,"onStart");this._start=$AA.ColorAnimation.getRGB(this.get_startValue());this._end=$AA.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(n){var t=this._start.Red,i=this._start.Green,r=this._start.Blue;return this._interpolateRed&&(t=Math.round(this.interpolate(t,this._end.Red,n))),this._interpolateGreen&&(i=Math.round(this.interpolate(i,this._end.Green,n))),this._interpolateBlue&&(r=Math.round(this.interpolate(r,this._end.Blue,n))),$AA.ColorAnimation.toColor(t,i,r)},set_startValue:function(n){this._startValue!=n&&(this._startValue=n,this.raisePropertyChanged("startValue"))},set_endValue:function(n){this._endValue!=n&&(this._endValue=n,this.raisePropertyChanged("endValue"))}},$AA.ColorAnimation.getRGB=function(n){if(!n||7!=n.length)throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor,n);return{Red:parseInt(n.substr(1,2),16),Green:parseInt(n.substr(3,2),16),Blue:parseInt(n.substr(5,2),16)}},$AA.ColorAnimation.toColor=function(n,t,i){var r=n.toString(16),u=t.toString(16),f=i.toString(16);return 1==r.length&&(r="0"+r),1==u.length&&(u="0"+u),1==f.length&&(f="0"+f),"#"+r+u+f},$AA.ColorAnimation.registerClass("Sys.Extended.UI.Animation.ColorAnimation",$AA.InterpolatedAnimation),$AA.registerAnimation("color",$AA.ColorAnimation),$AA.LengthAnimation=function(n,t,i,r,u,f,e,o){$AA.LengthAnimation.initializeBase(this,[n,t,i,r,u,f,e]);this._unit=null!=o?o:"px"},$AA.LengthAnimation.prototype={getAnimatedValue:function(n){var t=this.interpolate(this.get_startValue(),this.get_endValue(),n);return Math.round(t)+this._unit},get_unit:function(){return this._unit},set_unit:function(n){this._unit!=n&&(this._unit=n,this.raisePropertyChanged("unit"))}},$AA.LengthAnimation.registerClass("Sys.Extended.UI.Animation.LengthAnimation",$AA.InterpolatedAnimation),$AA.registerAnimation("length",$AA.LengthAnimation),$AA.MoveAnimation=function(n,t,i,r,u,f,e){$AA.MoveAnimation.initializeBase(this,[n,t,i,null]);this._horizontal=r?r:0;this._vertical=u?u:0;this._relative=void 0===f||f;this._horizontalAnimation=new $AA.LengthAnimation(n,t,i,"style","left",null,null,e);this._verticalAnimation=new $AA.LengthAnimation(n,t,i,"style","top",null,null,e);this.add(this._verticalAnimation);this.add(this._horizontalAnimation)},$AA.MoveAnimation.prototype={onStart:function(){$AA.MoveAnimation.callBaseMethod(this,"onStart");var n=this.get_target();this._horizontalAnimation.set_startValue(n.offsetLeft);this._horizontalAnimation.set_endValue(this._relative?n.offsetLeft+this._horizontal:this._horizontal);this._verticalAnimation.set_startValue(n.offsetTop);this._verticalAnimation.set_endValue(this._relative?n.offsetTop+this._vertical:this._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(n){n=this._getFloat(n);this._horizontal!=n&&(this._horizontal=n,this.raisePropertyChanged("horizontal"))},get_vertical:function(){return this._vertical},set_vertical:function(n){n=this._getFloat(n);this._vertical!=n&&(this._vertical=n,this.raisePropertyChanged("vertical"))},get_relative:function(){return this._relative},set_relative:function(n){n=this._getBoolean(n);this._relative!=n&&(this._relative=n,this.raisePropertyChanged("relative"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(n){var t=this._horizontalAnimation.get_unit();t!=n&&(this._horizontalAnimation.set_unit(n),this._verticalAnimation.set_unit(n),this.raisePropertyChanged("unit"))}},$AA.MoveAnimation.registerClass("Sys.Extended.UI.Animation.MoveAnimation",$AA.ParallelAnimation),$AA.registerAnimation("move",$AA.MoveAnimation),$AA.ResizeAnimation=function(n,t,i,r,u,f){$AA.ResizeAnimation.initializeBase(this,[n,t,i,null]);this._width=r;this._height=u;this._horizontalAnimation=new $AA.LengthAnimation(n,t,i,"style","width",null,null,f);this._verticalAnimation=new $AA.LengthAnimation(n,t,i,"style","height",null,null,f);this.add(this._horizontalAnimation);this.add(this._verticalAnimation)},$AA.ResizeAnimation.prototype={onStart:function(){$AA.ResizeAnimation.callBaseMethod(this,"onStart");var n=this.get_target();this._horizontalAnimation.set_startValue(n.offsetWidth);this._verticalAnimation.set_startValue(n.offsetHeight);this._horizontalAnimation.set_endValue(null!==this._width&&void 0!==this._width?this._width:n.offsetWidth);this._verticalAnimation.set_endValue(null!==this._height&&void 0!==this._height?this._height:n.offsetHeight)},get_width:function(){return this._width},set_width:function(n){n=this._getFloat(n);this._width!=n&&(this._width=n,this.raisePropertyChanged("width"))},get_height:function(){return this._height},set_height:function(n){n=this._getFloat(n);this._height!=n&&(this._height=n,this.raisePropertyChanged("height"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(n){var t=this._horizontalAnimation.get_unit();t!=n&&(this._horizontalAnimation.set_unit(n),this._verticalAnimation.set_unit(n),this.raisePropertyChanged("unit"))}},$AA.ResizeAnimation.registerClass("Sys.Extended.UI.Animation.ResizeAnimation",$AA.ParallelAnimation),$AA.registerAnimation("resize",$AA.ResizeAnimation),$AA.ScaleAnimation=function(n,t,i,r,u,f,e,o){$AA.ScaleAnimation.initializeBase(this,[n,t,i]);this._scaleFactor=void 0!==r?r:1;this._unit=void 0!==u?u:"px";this._center=f;this._scaleFont=e;this._fontUnit=void 0!==o?o:"pt";this._element=null;this._initialHeight=null;this._initialWidth=null;this._initialTop=null;this._initialLeft=null;this._initialFontSize=null},$AA.ScaleAnimation.prototype={getAnimatedValue:function(n){return this.interpolate(1,this._scaleFactor,n)},onStart:function(){$AA.ScaleAnimation.callBaseMethod(this,"onStart");this._element=this.get_target();this._element&&(this._initialHeight=this._element.offsetHeight,this._initialWidth=this._element.offsetWidth,this._center&&(this._initialTop=this._element.offsetTop,this._initialLeft=this._element.offsetLeft),this._scaleFont&&(this._initialFontSize=parseFloat($common.getCurrentStyle(this._element,"fontSize"))))},setValue:function(n){var i,r,t;this._element&&(i=Math.round(this._initialWidth*n),r=Math.round(this._initialHeight*n),(this._element.style.width=i+this._unit,this._element.style.height=r+this._unit,this._center&&(this._element.style.top=this._initialTop+Math.round((this._initialHeight-r)/2)+this._unit,this._element.style.left=this._initialLeft+Math.round((this._initialWidth-i)/2)+this._unit),this._scaleFont)&&(t=this._initialFontSize*n,"px"!=this._fontUnit&&"pt"!=this._fontUnit||(t=Math.round(t)),this._element.style.fontSize=t+this._fontUnit))},onEnd:function(){this._element=null;this._initialHeight=null;this._initialWidth=null;this._initialTop=null;this._initialLeft=null;this._initialFontSize=null;$AA.ScaleAnimation.callBaseMethod(this,"onEnd")},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(n){n=this._getFloat(n);this._scaleFactor!=n&&(this._scaleFactor=n,this.raisePropertyChanged("scaleFactor"))},get_unit:function(){return this._unit},set_unit:function(n){this._unit!=n&&(this._unit=n,this.raisePropertyChanged("unit"))},get_center:function(){return this._center},set_center:function(n){n=this._getBoolean(n);this._center!=n&&(this._center=n,this.raisePropertyChanged("center"))},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(n){n=this._getBoolean(n);this._scaleFont!=n&&(this._scaleFont=n,this.raisePropertyChanged("scaleFont"))},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(n){this._fontUnit!=n&&(this._fontUnit=n,this.raisePropertyChanged("fontUnit"))}},$AA.ScaleAnimation.registerClass("Sys.Extended.UI.Animation.ScaleAnimation",$AA.Animation),$AA.registerAnimation("scale",$AA.ScaleAnimation),$AA.Action=function(n,t,i){$AA.Action.initializeBase(this,[n,t,i]);void 0===t&&this.set_duration(0)},$AA.Action.prototype={onEnd:function(){this.doAction();$AA.Action.callBaseMethod(this,"onEnd")},doAction:function(){throw Error.notImplemented();},getAnimatedValue:function(){},setValue:function(){}},$AA.Action.registerClass("Sys.Extended.UI.Animation.Action",$AA.Animation),$AA.registerAnimation("action",$AA.Action),$AA.EnableAction=function(n,t,i,r){$AA.EnableAction.initializeBase(this,[n,t,i]);this._enabled=void 0===r||r},$AA.EnableAction.prototype={doAction:function(){var n=this.get_target();n&&(n.disabled=!this._enabled)},get_enabled:function(){return this._enabled},set_enabled:function(n){n=this._getBoolean(n);this._enabled!=n&&(this._enabled=n,this.raisePropertyChanged("enabled"))}},$AA.EnableAction.registerClass("Sys.Extended.UI.Animation.EnableAction",$AA.Action),$AA.registerAnimation("enableAction",$AA.EnableAction),$AA.HideAction=function(n,t,i,r){$AA.HideAction.initializeBase(this,[n,t,i]);this._visible=r},$AA.HideAction.prototype={doAction:function(){var n=this.get_target();n&&$common.setVisible(n,this._visible)},get_visible:function(){return this._visible},set_visible:function(n){this._visible!=n&&(this._visible=n,this.raisePropertyChanged("visible"))}},$AA.HideAction.registerClass("Sys.Extended.UI.Animation.HideAction",$AA.Action),$AA.registerAnimation("hideAction",$AA.HideAction),$AA.StyleAction=function(n,t,i,r,u){$AA.StyleAction.initializeBase(this,[n,t,i]);this._attribute=r;this._value=u},$AA.StyleAction.prototype={doAction:function(){var n=this.get_target();n&&(n.style[this._attribute]=this._value)},get_attribute:function(){return this._attribute},set_attribute:function(n){this._attribute!=n&&(this._attribute=n,this.raisePropertyChanged("attribute"))},get_value:function(){return this._value},set_value:function(n){this._value!=n&&(this._value=n,this.raisePropertyChanged("value"))}},$AA.StyleAction.registerClass("Sys.Extended.UI.Animation.StyleAction",$AA.Action),$AA.registerAnimation("styleAction",$AA.StyleAction),$AA.OpacityAction=function(n,t,i,r){$AA.OpacityAction.initializeBase(this,[n,t,i]);this._opacity=r},$AA.OpacityAction.prototype={doAction:function(){var n=this.get_target();n&&$common.setElementOpacity(n,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(n){n=this._getFloat(n);this._opacity!=n&&(this._opacity=n,this.raisePropertyChanged("opacity"))}},$AA.OpacityAction.registerClass("Sys.Extended.UI.Animation.OpacityAction",$AA.Action),$AA.registerAnimation("opacityAction",$AA.OpacityAction),$AA.ScriptAction=function(n,t,i,r){$AA.ScriptAction.initializeBase(this,[n,t,i]);this._script=r},$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(t){}},get_script:function(){return this._script},set_script:function(n){this._script!=n&&(this._script=n,this.raisePropertyChanged("script"))}},$AA.ScriptAction.registerClass("Sys.Extended.UI.Animation.ScriptAction",$AA.Action),$AA.registerAnimation("scriptAction",$AA.ScriptAction),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BehaviorBase=function(n){Sys.Extended.UI.BehaviorBase.initializeBase(this,[n]);this._clientStateFieldID=null;this._pageRequestManager=null;this._partialUpdateBeginRequestHandler=null;this._partialUpdateEndRequestHandler=null},Sys.Extended.UI.BehaviorBase.prototype={initialize:function(){Sys.Extended.UI.BehaviorBase.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.BehaviorBase.callBaseMethod(this,"dispose");this._pageRequestManager&&(this._partialUpdateBeginRequestHandler&&(this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler),this._partialUpdateBeginRequestHandler=null),this._partialUpdateEndRequestHandler&&(this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler),this._partialUpdateEndRequestHandler=null),this._pageRequestManager=null)},get_ClientStateFieldID:function(){return this._clientStateFieldID},set_ClientStateFieldID:function(n){this._clientStateFieldID!=n&&(this._clientStateFieldID=n,this.raisePropertyChanged("ClientStateFieldID"))},get_ClientState:function(){if(this._clientStateFieldID){var n=document.getElementById(this._clientStateFieldID);if(n)return n.value}return null},set_ClientState:function(n){if(this._clientStateFieldID){var t=document.getElementById(this._clientStateFieldID);t&&(t.value=n)}},registerPartialUpdateEvents:function(){Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager&&(this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance(),this._pageRequestManager&&(this._partialUpdateBeginRequestHandler=Function.createDelegate(this,this._partialUpdateBeginRequest),this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler),this._partialUpdateEndRequestHandler=Function.createDelegate(this,this._partialUpdateEndRequest),this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler)))},_partialUpdateBeginRequest:function(){},_partialUpdateEndRequest:function(){}},Sys.Extended.UI.BehaviorBase.registerClass("Sys.Extended.UI.BehaviorBase",Sys.UI.Behavior),Sys.Extended.UI.DynamicPopulateBehaviorBase=function(n){Sys.Extended.UI.DynamicPopulateBehaviorBase.initializeBase(this,[n]);this._DynamicControlID=null;this._DynamicContextKey=null;this._DynamicServicePath=null;this._DynamicServiceMethod=null;this._cacheDynamicResults=!1;this._dynamicPopulateBehavior=null;this._populatingHandler=null;this._populatedHandler=null},Sys.Extended.UI.DynamicPopulateBehaviorBase.prototype={initialize:function(){Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this,"initialize");this._populatingHandler=Function.createDelegate(this,this._onPopulating);this._populatedHandler=Function.createDelegate(this,this._onPopulated)},dispose:function(){this._populatedHandler&&(this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.remove_populated(this._populatedHandler),this._populatedHandler=null);this._populatingHandler&&(this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.remove_populating(this._populatingHandler),this._populatingHandler=null);this._dynamicPopulateBehavior&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);Sys.Extended.UI.DynamicPopulateBehaviorBase.callBaseMethod(this,"dispose")},populate:function(n){this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.get_element()!=$get(this._DynamicControlID)&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);!this._dynamicPopulateBehavior&&this._DynamicControlID&&this._DynamicServiceMethod&&(this._dynamicPopulateBehavior=$create(Sys.Extended.UI.DynamicPopulateBehavior,{id:this.get_id()+"_DynamicPopulateBehavior",ContextKey:this._DynamicContextKey,ServicePath:this._DynamicServicePath,ServiceMethod:this._DynamicServiceMethod,cacheDynamicResults:this._cacheDynamicResults},null,null,$get(this._DynamicControlID)),this._dynamicPopulateBehavior.add_populating(this._populatingHandler),this._dynamicPopulateBehavior.add_populated(this._populatedHandler));this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.populate(n?n:this._DynamicContextKey)},_onPopulating:function(n,t){this.raisePopulating(t)},_onPopulated:function(n,t){this.raisePopulated(t)},get_dynamicControlID:function(){return this._DynamicControlID},get_DynamicControlID:this.get_dynamicControlID,set_dynamicControlID:function(n){this._DynamicControlID!=n&&(this._DynamicControlID=n,this.raisePropertyChanged("dynamicControlID"),this.raisePropertyChanged("DynamicControlID"))},set_DynamicControlID:this.set_dynamicControlID,get_dynamicContextKey:function(){return this._DynamicContextKey},get_DynamicContextKey:this.get_dynamicContextKey,set_dynamicContextKey:function(n){this._DynamicContextKey!=n&&(this._DynamicContextKey=n,this.raisePropertyChanged("dynamicContextKey"),this.raisePropertyChanged("DynamicContextKey"))},set_DynamicContextKey:this.set_dynamicContextKey,get_dynamicServicePath:function(){return this._DynamicServicePath},get_DynamicServicePath:this.get_dynamicServicePath,set_dynamicServicePath:function(n){this._DynamicServicePath!=n&&(this._DynamicServicePath=n,this.raisePropertyChanged("dynamicServicePath"),this.raisePropertyChanged("DynamicServicePath"))},set_DynamicServicePath:this.set_dynamicServicePath,get_dynamicServiceMethod:function(){return this._DynamicServiceMethod},get_DynamicServiceMethod:this.get_dynamicServiceMethod,set_dynamicServiceMethod:function(n){this._DynamicServiceMethod!=n&&(this._DynamicServiceMethod=n,this.raisePropertyChanged("dynamicServiceMethod"),this.raisePropertyChanged("DynamicServiceMethod"))},set_DynamicServiceMethod:this.set_dynamicServiceMethod,get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(n){this._cacheDynamicResults!=n&&(this._cacheDynamicResults=n,this.raisePropertyChanged("cacheDynamicResults"))},add_populated:function(n){this.get_events().addHandler("populated",n)},remove_populated:function(n){this.get_events().removeHandler("populated",n)},raisePopulated:function(n){var t=this.get_events().getHandler("populated");t&&t(this,n)},add_populating:function(n){this.get_events().addHandler("populating",n)},remove_populating:function(n){this.get_events().removeHandler("populating",n)},raisePopulating:function(n){var t=this.get_events().getHandler("populating");t&&t(this,n)}},Sys.Extended.UI.DynamicPopulateBehaviorBase.registerClass("Sys.Extended.UI.DynamicPopulateBehaviorBase",Sys.Extended.UI.BehaviorBase),Sys.Extended.UI.ControlBase=function(n){Sys.Extended.UI.ControlBase.initializeBase(this,[n]);this._clientStateField=null;this._callbackTarget=null;this._onsubmit$delegate=Function.createDelegate(this,this._onsubmit);this._oncomplete$delegate=Function.createDelegate(this,this._oncomplete);this._onerror$delegate=Function.createDelegate(this,this._onerror)},Sys.Extended.UI.ControlBase.__doPostBack=function(n,t){if(!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())for(var i=0;i7&&0!=Sys.Browser.documentMode;this._paneHeaderClassNames=[]},Sys.Extended.UI.AccordionBehavior.prototype={initialize:function(){var t,i,n,r,u;for(Sys.Extended.UI.AccordionBehavior.callBaseMethod(this,"initialize"),this._headerClickHandler=Function.createDelegate(this,this._onHeaderClick),t=this.get_ClientState(),null!==t&&""!==t&&this._changeSelectedIndex(parseInt(t),!1,!0),i=this.get_element().childNodes,n={},n.value=0;n.value0&&this._changeSelectedIndex(0,!1,!0);this._initializeLayout()},_getNextDiv:function(n,t){for(var i=null;t.value=7,(!i||i&&n.height&&n.height.length>0)&&(n.height="auto"),(!i||i&&n.overflow&&n.overflow.length>0)&&(n.overflow="auto")):(this._addResizeHandler(),n.height=u.offsetHeight+"px",n.overflow="hidden"),t=0;t=0;t--)n=this._panes[t],n&&(n.header&&(n.header._index=null,$removeHandler(n.header,"click",this._headerClickHandler),n.header=null),n.content&&(n.content._original=null,n.content=null),this._panes[t]=null,delete this._panes[t]);this._panes=null;this._headerClickHandler=null;Sys.Extended.UI.AccordionBehavior.callBaseMethod(this,"dispose")},_disposeResizeHandler:function(){this._resizeHandler&&($removeHandler(window,"resize",this._resizeHandler),this._resizeHandler=null)},_disposeAnimations:function(){for(var n,t=0;t0&&(t=Math.min(t,r)))),t},_getTotalSize:function(n){var t=$common.getSize(n),i=$common.getMarginBox(n);return t.width+=i.horizontal,t.height+=i.vertical,t},_getGutterSize:function(n){var i={width:0,height:0},t;try{t=$common.getPaddingBox(n);i.width+=t.horizontal;i.height+=t.vertical}catch(n){}try{t=$common.getBorderBox(n);i.width+=t.horizontal;i.height+=t.vertical}catch(n){}return t=$common.getMarginBox(n),i.width+=t.horizontal,i.height+=t.vertical,i},add_selectedIndexChanging:function(n){this.get_events().addHandler("selectedIndexChanging",n)},remove_selectedIndexChanging:function(n){this.get_events().removeHandler("selectedIndexChanging",n)},raiseSelectedIndexChanging:function(n){Sys.Extended.Deprecated("raiseSelectedIndexChanging(eventArgs)","raise_selectedIndexChanging(eventArgs)");this.raise_selectedIndexChanging(n)},raise_selectedIndexChanging:function(n){var t=this.get_events().getHandler("selectedIndexChanging");t&&t(this,n)},add_selectedIndexChanged:function(n){this.get_events().addHandler("selectedIndexChanged",n)},remove_selectedIndexChanged:function(n){this.get_events().removeHandler("selectedIndexChanged",n)},raiseSelectedIndexChanged:function(n){Sys.Extended.Deprecated("raiseSelectedIndexChanged(eventArgs)","raise_selectedIndexChanged(eventArgs)");this.raise_selectedIndexChanged(n)},raise_selectedIndexChanged:function(n){var t=this.get_events().getHandler("selectedIndexChanged");t&&t(this,n)},getPane:function(n){return void 0!==n&&null!==n||(n=this._selectedIndex),this._panes&&n>=0&&n=0?n.lastIndexOf("\\"):n.lastIndexOf("/"),t=n.substring(r),0!==t.indexOf("\\")&&0!==t.indexOf("/")||(t=t.substring(1)),i=t)}return i};this.getFileType=function(n){if(!n)throw"file must defined or not null";if(!n.value&&n.name)return n.name.substring(n.name.lastIndexOf(".")+1);if(n.value&&(n=n.value),"string"!=typeof n)throw"can't resolve file type.";return n.substring(n.lastIndexOf(".")+1)};this.sizeToString=function(n){if(!n||n<=0)return"0 Kb";var t=Math.floor(Math.log(n)/Math.log(1024));return(n/Math.pow(1024,Math.floor(t))).toFixed(2)+" "+["bytes","kb","MB","GB","TB","PB"][t]};this.checkHtml5BrowserSupport=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob&&(new XMLHttpRequest).upload}},Sys.Extended.UI.AjaxFileUpload.Item=function(n,t,i){this._deleteButton=null;this._parentId=n;this._inputElementValue=t.value;this._id=t.id;this._slices=t.slices;this._sliceIndex=0;this._fileInfoContainer=null;this._fileStatusText=null;this._isUploaded=!1;this._isUploading=!1;this._fileSize=0;this._fileName="";this._fileType="";this._bytesUploaded=0;this._ui=this.initUI(i)},Sys.Extended.UI.AjaxFileUpload.Item.prototype={initUI:function(n){var c=this,t=this._inputElementValue,e=new Sys.Extended.UI.AjaxFileUpload.Utils,l=e.checkHtml5BrowserSupport(),i=this._id,r=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileItemContainer_"+i},cssClasses:["ajax__fileupload_fileItemInfo"]}),u=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileInfoContainer_"+i,style:{display:"inline-block"}}}),o=$common.createElementFromTemplate({nodeName:"span",properties:{id:this._parentId+"_FileItemInfo_"+i},cssClasses:["ajax__fileupload_fileItemInfo"]}),s=$common.createElementFromTemplate({nodeName:"span",properties:{id:this._parentId+"_FileItemStatus_"+i},cssClasses:["uploadstatus"]}),f=$common.createElementFromTemplate({nodeName:"div",properties:{id:this._parentId+"_FileItemDeleteButton_"+i},cssClasses:["removeButton"]}),h;return(this._fileName=e.getFileName(t),l)?(this._fileSize=t.size,h=t.type?'('+t.type+")<\/span>":"",o.innerHTML=''+this._fileName+"<\/span> "+h+' - '+e.sizeToString(t.size)+"<\/span> ",this._fileType=t.type):(o.innerHTML=''+this._fileName+"<\/span>",this._fileType=e.getFileType(t)),u.appendChild(o),u.appendChild(s),$common.setText(f,Sys.Extended.UI.Resources.AjaxFileUpload_Remove),$addHandlers(f,{click:Function.createDelegate(this,function(){n(c)})}),Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<=8?(r.appendChild(f),r.appendChild(u)):(r.appendChild(u),r.appendChild(f)),this._fileInfoContainer=u,this._deleteButton=f,this._fileStatusText=s,r},setStatus:function(n,t){$common.setText(this._fileStatusText," ("+t+")");this._fileInfoContainer.setAttribute("class",n+"State")},disabled:function(n){this._deleteButton.disabled=n?"disabled":""},hide:function(){this._deleteButton.style.visibility="hidden"},destroy:function(){$common.removeElement(this._inputElementValue);$common.removeElement(this._deleteButton);$common.removeElement(this._ui)},get_inputElementValue:function(){return this._inputElementValue},appendNodeTo:function(n){n.appendChild(this._ui)},removeNodeFrom:function(n){n.removeChild(this._ui)}},Sys.Extended.UI.AjaxFileUpload.Processor=function(n,t){var r=new Sys.Extended.UI.AjaxFileUpload.Utils,i=new XMLHttpRequest;this._iframe=null;this._iframeName=n.get_id()+"_uploadIframe";this._form=null;this.initialize=function(){this.attachEvents();this.createIFrame();this.createForm()};this.attachEvents=function(){this.onFileSelected$delegate=Function.createDelegate(this,this.onFileSelectedHandler);this.attachFileInputEvents(t.inputFile,!0);var r=this;i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var t=i.responseText;t&&(t=parseFloat(t).toFixed(2),n.setPercent(t));t<100&&setTimeout(function(){r.pollingServerProgress(!0)},500)}}};this.attachFileInputEvents=function(n,t){t?$addHandlers(n,{change:this.onFileSelected$delegate}):$common.removeHandlers(n,{change:this.onFileSelected$delegate})};this.onFileSelectedHandler=function(){var i={id:r.generateGuid(),value:t.inputFile,type:r.getFileType(t.inputFile.value)};return n.fileTypeIsValid(i.type)?n.fileSizeExceeded(i.value.size)?void n.confirmFileIsTooLarge(i):(n.addFileToQueue(i),void this.createInputFileElement()):void n.confirmFileIsInvalid(i)};this.createInputFileElement=function(){var i=t.inputFile,f,u;i.style.zIndex=-999;$common.setLocation(i,{x:-99999,y:-99999});this.attachFileInputEvents(i,!1);f=n.get_id()+"_file_"+r.generateGuid();u=$common.createElementFromTemplate({nodeName:"input",properties:{id:f,name:"act-file-data",type:"file",style:{zIndex:0,cursor:"pointer",position:"absolute"},multiple:!0}},i.parentNode);$common.setElementOpacity(u,0);this.attachFileInputEvents(u,!0);t.inputFile=u};this.startUpload=function(){var t=this._form,i=n.getNextFile(),r;if(!i)return n._currentFileId=null,this.setThrobber(!1),void n.done();for(n.setAsUploading(i),r=i.get_inputElementValue(),n._currentFileId=i._id,this.setThrobber(!0);t.firstChild;)t.removeChild(t.firstChild);r.name="act-file-data";t.appendChild(r);t.setAttribute("action",n.get_uploadHandlerPath()+"?contextKey="+n.get_contextKey()+"&controlID="+n.get_id()+"&fileId="+n._currentFileId+"&fileName="+encodeURIComponent(i._fileName)+"&usePoll="+(n.get_serverPollingSupport()?"true":"false"));t.submit()};this.cancelUpload=function(){var t=new XMLHttpRequest,r=this;i&&i.abort();t.open("POST","?contextKey="+n.get_contextKey()+"&controlID="+n.get_id()+"&cancel=1&guid="+n._currentFileId+r.getQueryString(),!0);t.onreadystatechange=function(){if(r.setThrobber(!1),4==t.readyState){if(200!=t.status)throw r.raiseUploadError(t),"Failed to cancel upload.";n.cancelUpload()}};t.send(null)};this.getQueryString=function(){return"&"+window.location.search.replace("?","")};this.createIFrame=function(){var t=this._iframeName,n=document.createElement("IFRAME");n.width="0";n.height="0";n.style.display="none";n.src="about:blank";n.id=t;n.name=t;n.security="restricted";document.body.appendChild(n);n.contentWindow.name=t;$addHandlers(n,{load:Function.createDelegate(this,this.onIFrameLoadedHandler)});this._iframe=n};this.onIFrameLoadedHandler=function(t){if(n._currentFileId)try{var i=this._iframe,r=null;if(i.contentDocument?r=i.contentDocument:i.contentWindow?r=i.contentWindow.document:i.document&&(r=i.document),null==r)throw"Document not initialized";n.doneAndUploadNextFile(n.getCurrentFileItem())}catch(t){if(!n._canceled||!t.message||!(t.message.indexOf("Access is denied")>-1||t.message.indexOf("Permission denied")>-1))throw this.raiseUploadError(t),t;}};this.setThrobber=function(i){return n.get_serverPollingSupport()?(n.setPercent(0),$common.setVisible(t.progressBar,!!i),$common.setVisible(t.progressBarContainer,!!i),void this.pollingServerProgress(i)):void(null!=n.get_throbber()&&(n.get_throbber().style.display=i?"":"none"))};this.pollingServerProgress=function(t){t&&n._currentFileId&&(i.open("GET","?contextKey="+n.get_contextKey()+"&controlID="+n.get_id()+"&poll=1&guid="+n._currentFileId,!0),i.send(null))};this.createForm=function(){var t,i="___postForm"+n.get_id();try{t=document.createElement('
')}catch(n){t=document.createElement("form");t.setAttribute("id",i);t.setAttribute("method","post");t.setAttribute("target",this._iframe.id);t.setAttribute("enctype","multipart/form-data")}t.style.visibility="hidden";t.style.display="none";document.body.appendChild(t);this._form=t};this.raiseUploadError=function(t){n.raise_uploadError(t);i&&i.abort();n._currentFileId=null};this.resetUI=function(){n.setFileStatus(n._currentFileId,"error",Sys.Extended.UI.Resources.AjaxFileUpload_error)}},Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5=function(n,t){var i=new Sys.Extended.UI.AjaxFileUpload.Utils,r=1e3*n.get_chunkSize(),u=0,f=null;this.initialize=function(){$common.setVisible(t.dropZone,!0);t.dropZone.innerHTML=Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles;this.attachEvents()};this.attachEvents=function(){this.onFileDropped$delegate=Function.createDelegate(this,this.onFileDroppedHandler);this.onFileDragOver$delegate=Function.createDelegate(this,this.onFileDragOverHandler);this.onFileSelected$delegate=Function.createDelegate(this,this.onFileSelectedHandler);t.inputFile.addEventListener("change",this.onFileSelected$delegate,!1);t.dropZone.addEventListener("drop",this.onFileDropped$delegate,!1);t.dropZone.addEventListener("dragover",this.onFileDragOver$delegate,!1)};this.onFileDroppedHandler=function(t){t.stopPropagation();t.preventDefault();n.get_enabled()&&(this.addFilesToQueue(t.dataTransfer.files),n.get_autoStartUpload()&&n.startUpload())};this.onFileDragOverHandler=function(n){n.stopPropagation();n.preventDefault()};this.onFileSelectedHandler=function(t){this.addFilesToQueue(t.target.files);this.createInputFileElement();n.get_autoStartUpload()&&n.startUpload()};this.createInputFileElement=function(){var u=t.inputFile,f,r;delete u;f=n.get_id()+"_file_"+i.generateGuid();r=$common.createElementFromTemplate({nodeName:"input",properties:{id:f,name:"act-file-data",type:"file",style:{zIndex:0,cursor:"pointer",position:"absolute"},multiple:!0}},u.parentNode);$common.setElementOpacity(r,0);this.attachFileInputEvents(r,!0);t.inputFile=r};this.attachFileInputEvents=function(n,t){t?$addHandlers(n,{change:this.onFileSelected$delegate}):$common.removeHandlers(n,{change:this.onFileSelected$delegate})};this.addFilesToQueue=function(u){for(var o,s,e,f=0;fr&&(s=Math.ceil(o.size/r)),e={id:i.generateGuid(),value:u[f],type:i.getFileType(u[f]),uploaded:!1,slices:s},n.fileTypeIsValid(e.type)){if(n.fileSizeExceeded(e.value.size))n.confirmFileIsTooLarge(e);else if(!n.addFileToQueue(e))break}else n.confirmFileIsInvalid(e);t.inputFile.value=null};this.cancelUpload=function(){f&&f.abort();n.cancelUpload()};this.startUpload=function(){var i=n.getNextFile();i?(0===i._sliceIndex&&n.setPercent(0),$common.setVisible(t.progressBarContainer,!0),this.upload(i)):(n._currentFileId=null,n.setPercent(0),$common.setVisible(t.progressBarContainer,!1),n.done())};this.resetUI=function(){$common.setVisible(t.progressBarContainer,!1);$common.setVisible(n._elements.uploadOrCancelButton,!1);var i=n.getNextFile();i._isUploaded=!0;i._isUploading=!1};this.upload=function(i){var o,s;if(n._isUploading){$common.setVisible(t.progressBar,!0);n.setAsUploading(i);var f=i.get_inputElementValue(),h=i._slices&&i._slices>0,a=0==i._sliceIndex;h&&(o=i._sliceIndex*r,s=o+r,f=f.slice(o,s>f.size?f.size:s));var c=new FormData,l=n._currentFileId=i._id,u=new XMLHttpRequest,v=this,e=function(n){return function(t){n.call(v,l,t)}};u.upload.addEventListener("progress",e(this.onProgressHandler),!1);u.addEventListener("load",e(this.onUploadCompleteHandler),!1);u.addEventListener("error",e(this.onUploadFailedHandler),!1);u.addEventListener("abort",e(this.onUploadCanceledHandler),!1);u.open("POST",n.get_uploadHandlerPath()+"?contextKey="+n.get_contextKey()+"&controlID="+n.get_id()+"&fileId="+l+"&fileName="+encodeURIComponent(i._fileName)+"&chunked="+(h?"true":"false")+"&firstChunk="+a,!0);c.append("act-file-data",f);u.send(c)}};this.onProgressHandler=function(t,i){if(n._isUploading&&i.lengthComputable){u=i.loaded;var r=n.getFileItem(t),f=r._slices,e=r._bytesUploaded+u,o=f-r._sliceIndex==1?e:i.total*f,s=0==f?(100*i.loaded/i.total).toFixed(2):(e/o*100).toFixed(2);n.setPercent(s)}};this.onUploadCompleteHandler=function(t){var e=this,r=n.getFileItem(t),f=r.get_inputElementValue();r._slices&&r._slices>0&&r._sliceIndex+10&&this._filesInQueue.length>=i?(alert(Sys.Extended.UI.Resources.AjaxFileUpload_MaxNumberOfFilesExceeded),!1):(t=new Sys.Extended.UI.AjaxFileUpload.Item(this.get_id(),n,Function.createDelegate(this,this.removeFileFromQueueHandler)),t.appendNodeTo(this._elements.queueContainer),t.setStatus("pending",Sys.Extended.UI.Resources.AjaxFileUpload_Pending),$common.setVisible(this._elements.queueContainer,!0),$common.setVisible(this._elements.uploadOrCancelButton,!0),this._filesInQueue.push(t),this._showFilesCount(),!0)},_showFilesCount:function(){var n=0==this._filesInQueue.length;this.setStatusMessage(n?Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload:String.format(Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue,this._filesInQueue.length.toString()))},fileTypeIsValid:function(n){var i,t,r;if(!this._allowedFileTypes)return!0;for(i=this._allowedFileTypes.split(","),t=0;tthis.getMaxFileSizeInBytes()},confirmFileIsInvalid:function(n){var t=new Sys.Extended.UI.AjaxFileUpload.Utils;alert(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_WrongFileType,t.getFileName(n.value),n.type))},confirmFileIsTooLarge:function(n){var t=new Sys.Extended.UI.AjaxFileUpload.Utils;alert(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_TooLargeFile,t.getFileName(n.value),this.get_maxFileSize()))},getMaxFileSizeInBytes:function(){return 1024*this.get_maxFileSize()},doneAndUploadNextFile:function(n){var t=new XMLHttpRequest,i=this;t.open("POST","?contextKey="+this.get_contextKey()+"&controlID="+this.get_id()+"&done=1&guid="+n._id+this.getQueryString(),!0);t.onreadystatechange=function(){if(4==t.readyState){if(200!=t.status||""==t.responseText)throw i.setFileStatus(n,"error",Sys.Extended.UI.Resources.AjaxFileUpload_error),i.raise_uploadError(t),"error raising upload complete event and start new upload";i.raise_uploadComplete(Sys.Serialization.JavaScriptSerializer.deserialize(t.responseText));i._processor.startUpload()}};t.send()},getQueryString:function(){return"&"+window.location.search.replace("?","")},cancelUpload:function(){var i=this.getCurrentFileItem(),n,t;for(i._isUploaded=!1,i._isUploading=!1,this.setStatusMessage(Sys.Extended.UI.Resources.AjaxFileUpload_UploadCanceled),n=0;n=100&&(n="100");t.style.width=n+"%";$common.setText(t,String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage,n))},get_allowedFileTypes:function(){return this._allowedFileTypes},set_allowedFileTypes:function(n){this._allowedFileTypes=n},get_contextKey:function(){return this._contextKey},set_contextKey:function(n){this._contextKey=n},get_postBackUrl:function(){return this._postBackUrl},set_postBackUrl:function(n){this._postBackUrl=n},get_mode:function(){return this._mode},set_mode:function(n){this._mode=n},get_autoStartUpload:function(){return this._autoStartUpload},set_autoStartUpload:function(n){this._autoStartUpload=n},get_serverPollingSupport:function(){return this._serverPollingSupport},set_serverPollingSupport:function(n){this._serverPollingSupport=n},get_throbber:function(){return this._throbber},set_throbber:function(n){this._throbber=n},get_maximumNumberOfFiles:function(){return this._maximumNumberOfFiles},set_maximumNumberOfFiles:function(n){this._maximumNumberOfFiles=n},get_chunkSize:function(){return this._chunkSize},set_chunkSize:function(n){this._chunkSize=n},get_clearFileListAfterUpload:function(){return this._clearFileListAfterUpload},set_clearFileListAfterUpload:function(n){this._clearFileListAfterUpload=n},get_useAbsoluteHandlerPath:function(){return this._useAbsoluteHandlerPath},set_useAbsoluteHandlerPath:function(n){this._useAbsoluteHandlerPath=n},get_maxFileSize:function(){return this._maxFileSize},set_maxFileSize:function(n){this._maxFileSize=n},get_uploadHandlerPath:function(){return this._uploadHandlerPath},set_uploadHandlerPath:function(n){this._uploadHandlerPath=n},get_enabled:function(){return this.enabled},set_enabled:function(n){this.enabled=n},add_uploadStart:function(n){this.get_events().addHandler("uploadStart",n)},remove_uploadStart:function(n){this.get_events().removeHandler("uploadStart",n)},raiseUploadStart:function(n){Sys.Extended.Deprecated("raiseUploadStart(e)","raise_uploadStart(e)");this.raise_uploadStart(n)},raise_uploadStart:function(n){var t=this.get_events().getHandler("uploadStart"),i;t&&(i=new Sys.Extended.UI.AjaxFileUploadStartEventArgs(n.FilesInQueue,n.ServerArguments),t(this,i))},add_uploadComplete:function(n){this.get_events().addHandler("uploadComplete",n)},remove_uploadComplete:function(n){this.get_events().removeHandler("uploadComplete",n)},raiseUploadComplete:function(n){Sys.Extended.Deprecated("raiseUploadComplete(e)","raise_uploadComplete(e)");this.raise_uploadComplete(n)},raise_uploadComplete:function(n){var t=this.getCurrentFileItem(),i,r,u;if(!t||!n||n.FileId!==t._id)throw"Invalid finalizing upload server response.";this.setFileStatus(t,"uploaded",Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded);this.setStatusMessage("Uploaded "+this._currentQueueIndex+" of "+this._filesInQueue.length+" file(s)");t._isUploaded=!0;t._isUploading=!1;t.hide();i=this.get_events().getHandler("uploadComplete");i&&(r=Array.indexOf(this._filesInQueue,t),u=new Sys.Extended.UI.AjaxFileUploadEventArgs(n.FileId,n.StatusMessage,n.FileName,n.FileSize,n.ContentType,n.PostedUrl,r,this._filesInQueue.length),i(this,u))},add_uploadCompleteAll:function(n){this.get_events().addHandler("uploadCompleteAll",n)},remove_uploadCompleteAll:function(n){this.get_events().removeHandler("uploadCompleteAll",n)},raiseUploadCompleteAll:function(){Sys.Extended.Deprecated("raiseUploadCompleteAll(e)","raise_uploadCompleteAll(e)");this.raise_uploadCompleteAll("raiseUploadCompleteAll(e)","raise_uploadCompleteAll(e)")},raise_uploadCompleteAll:function(n){var t=this.get_events().getHandler("uploadCompleteAll"),i;t&&(i=new Sys.Extended.UI.AjaxFileUploadCompleteAllEventArgs(n.FilesInQueue,n.FilesUploaded,n.Reason,n.ServerArguments),t(this,i))},add_uploadError:function(n){this.get_events().addHandler("uploadError",n)},remove_uploadError:function(n){this.get_events().removeHandler("uploadError",n)},raiseUploadError:function(n){Sys.Extended.Deprecated("raiseUploadError(e)","raise_uploadError(e)");this.raise_uploadError(n)},raise_uploadError:function(n){var t=this.get_events().getHandler("uploadError");t&&t(this,n);this._processor.resetUI();this._canceled=!1;this._isUploading=!1;this._isUploaded=!0;this.enableControls(!0)},getCurrentFileItem:function(){return this.getFileItem(this._currentFileId)},getNextFile:function(){var n,t;if(!this._isUploading)return null;for(n=0;n{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n+=this.drawBackgroundHorizontalLines();n+=this.drawBackgroundVerticalLines();n+=this.drawBaseLines();n+=this.drawLegendArea();n+=this.drawAxisValues();this._parentDiv.innerHTML=n;this.drawAreas()},calculateInterval:function(){this.startX=this._chartWidth/10+.5;this.endX=parseInt(this._chartWidth)-4.5;this.startY=this.yMin>=0?Math.round(parseInt(this._chartHeight)-24*parseInt(this._chartHeight)/100)+.5:Math.round(parseInt(this._chartHeight)-12*parseInt(this._chartHeight)/100)/2+.5;this.yInterval=this.startY/(this._valueAxisLines+1)},calculateMinMaxValues:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.AreaChartType.Basic)for(n=0;nthis.yMax&&(this.yMax=u),i=0?this.yMax:this.yMax>Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t);this.startX=this.startX+(10*this.roundedTickRange*this._valueAxisLines/10).toString().length*this.charLength},drawBackgroundHorizontalLines:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._categoryAxisLineColor);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._categoryAxisLineColor);return t},drawBackgroundVerticalLines:function(){var t="",n;for(this.xInterval=Math.round((parseInt(this._chartWidth)-this.startX)/this.arrXAxisLength),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);if(this.yMin<0)for(n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);return t},drawBaseLines:function(){var t="",n;for(t+=String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);for(n=0;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*n,this._baseLineColor);if(this.yMin<0)for(t+=String.format('<\/path>',this.startX,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*n,this._baseLineColor);return t},drawLegendArea:function(){for(var r,c,e="",o=82*parseInt(this._chartHeight)/100+5,t=7.5,i=5,l=0,n=0;nparseInt(this._chartWidth)/2&&(r/=2,c=!0);e+="";e+=String.format('<\/path>',parseInt(this._chartWidth)/2-r/2,o,Math.round(parseInt(this._chartWidth)/2+5*l)+Math.round((t+2*i)*this._series.length),Math.round(97.5*parseInt(this._chartHeight)/100));for(var f=40*parseInt(this._chartWidth)/100-r/2+t+i,s=f,u=40*parseInt(this._chartWidth)/100-r/2,h=u,n=0;n<\/path>',u,o+7.5,u+t,o+15,n+1,this._series[n].AreaColor),e+=String.format('{2}<\/text>',f,o+15,this._series[n].Name),this._series[n].Name.length>10?(h=u+5*this._series[n].Name.length+t+2*i,s=f+5*this._series[n].Name.length+t+2*i):(h=h+6*this._series[n].Name.length+t+2*i,s=s+6*this._series[n].Name.length+t+2*i);return e+"<\/g>"},drawAxisValues:function(){for(var i="",t=0,n=0;n{2}<\/text>',Math.round(this.startX+10*this.xInterval*n/10+this.xInterval/2-t),this.startY+Math.round(65*this.yInterval/100),this.arrXAxis[n]);for(n=0;n<=this._valueAxisLines;n++)t=5.5*(10*this.roundedTickRange*n/10).toString().length,i+=String.format('{2}<\/text>',this.startX-t-15,this.startY-10*this.yInterval*n/10+3.5,10*this.roundedTickRange*n/10);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t=5.5*(10*this.roundedTickRange*n/10).toString().length,i+=String.format('-{2}<\/text>',this.startX-t-19,this.startY+10*this.yInterval*n/10,10*this.roundedTickRange*n/10);return i},initializeSVG:function(){var n=String.format('',this._theme);return n+=String.format('',this._chartWidth,this._chartHeight),n+="",n+='',n+='<\/stop>',n+='<\/stop>',n+='<\/stop><\/linearGradient>',n+="<\/defs>",n+=String.format('<\/path>',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10),n+=String.format('<\/path>',this._chartWidth,this._chartHeight),n+String.format('<\/path>',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10)},drawAreas:function(){for(var n,u,f=this.get_displayValues(),e="",t=[],o=[],s=[],r=[],i=0;i0?String.format('{2}<\/text>',this.startX+this.xInterval*i+this.xInterval/2-t[n].toString().length*this.charLength,this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))-7.5,f?t[n]:""):String.format('{2}<\/text>',this.startX+this.xInterval*i+this.xInterval/2-t[n].toString().length*this.charLength,this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))+7.5,f?t[n]:"");o[n]=this.startX+this.xInterval*i+this.xInterval/2;s[n]=this.startY-Math.round(t[n]*(this.yInterval/this.roundedTickRange))}this._parentDiv.innerHTML=this._parentDiv.innerHTML+e;this._parentDiv.innerHTML;this._drawArea(r,0)},_drawArea:function(n,t){var i=this;i._parentDiv.innerHTML=i._parentDiv.innerHTML.replace("<\/svg>","")+String.format('<\/path><\/g><\/svg>',n[t],t+1,i._series[t].AreaColor);t++;t0){if("error"==t[0])return void this._onError(t[1]);u=parseInt(t[0])}t.length>1&&(i=t[1]);""!=this.get_completeBackColor()&&(null!=this._innerTB?this._innerTB.style.backgroundColor=this.get_completeBackColor():this._inputFile.style.backgroundColor=this.get_completeBackColor());this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value,u,i,null))},_onload:function(n){function w(n,t){return s=t,""}function l(){try{c.document||setTimeout(l,100)}catch(n){return}var n=c.document;n.open();n.write(""+t.body.innerHTML+"<\/body>");n.close()}var a=!0,f=this,i=document.getElementById(this._formName),t,v,u,y,e,o,s,h,p,c,r,n;try{if(t=this._iframe.contentWindow.document,null==t||null==t.location){n={message:Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem};throw n;}if("about:blank"==t.location.href){if(this._removeTimer(),""!=this.get_uploadingBackColor()&&(null!=this._innerTB?this._innerTB.style.backgroundColor=this.get_uploadingBackColor():this._inputFile.style.backgroundColor=this.get_uploadingBackColor()),v=this._onStart(this._inputFile.value),v)return u=this._postBackUrl,u+=u.indexOf("?")===-1?"?":"&",i.action=u+"AsyncFileUploadID="+this.get_element().id+"&rnd="+Math.random().toString().replace(/\./g,""),i.target=this._iframeName,a=!1,this.setThrobber(!0),setTimeout(function(){i.submit();f._waitTimer=setTimeout(function(){f._wait()},100)},0),!0}else{if(""==t.body.innerHTML)return!0;if(e=t.getElementById(this.get_element().id),o="",null==e){s=Sys.Extended.UI.Resources.AsyncFileUpload_UnknownServerError;t.body.innerHTML.replace(/Exception\]:([^\n\r]+)[\n\r]/,w);h=Sys.Extended.UI.Resources.AsyncFileUpload_ServerResponseError+": '"+s+"'";p=confirm(h+"\n\n"+Sys.Extended.UI.Resources.AsyncFileUpload_ConfirmToSeeErrorPage);p&&(c=window.open("","NotFoundInAnswer","toolbar=0,status=1,scrollbars=1,resizable=1,width=600,height=400"),setTimeout(l,0));n={message:h};throw n;}if(r=e.innerHTML.split("------"),r.length>0){if("error"==r[0]){n={message:r[1]};throw n;}y=parseInt(r[0])}r.length>1&&(o=r[1]);this._removeTimer();i.target="_top";i.action=this._postBackUrl;""!=this.get_completeBackColor()&&(null!=this._innerTB?this._innerTB.style.backgroundColor=this.get_completeBackColor():this._inputFile.style.backgroundColor=this.get_completeBackColor());this.setThrobber(!1);this.raise_uploadComplete(new Sys.Extended.UI.AsyncFileUploadEventArgs(this._inputFile.value,y,o,null))}}catch(n){this._removeTimer();i.target="_top";i.action=this._postBackUrl;this._onError(n.message)}finally{a&&setTimeout(function(){f._removeIframe()},100)}},_wait:function(){var n,t,i;if(null!=this._waitTimer){n=this;try{t=this._iframe.contentWindow.document;i=t.location;i.href;this._waitTimer=setTimeout(function(){n._wait()},100)}catch(t){setTimeout(function(){n._removeIframe()},100);setTimeout(function(){n._onError(Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem)},0);this._waitTimer=null}}}},Sys.Extended.UI.AsyncFileUpload.registerClass("Sys.Extended.UI.AsyncFileUpload",Sys.Extended.UI.ControlBase),Sys.Extended.UI.AsyncFileUploadEventArgs=function(n,t,i,r){if(4!=arguments.length)throw Error.parameterCount();Sys.Extended.UI.AsyncFileUploadEventArgs.initializeBase(this);this._fileName=n;this._length=t;this._contentType=i;this._errorMessage=r},Sys.Extended.UI.AsyncFileUploadEventArgs.prototype={get_fileName:function(){var n=this._fileName.lastIndexOf("/"),t=this._fileName.lastIndexOf("\\");return this._fileName.substr((n>t?n:t)+1)},get_path:function(){return this._fileName},get_length:function(){return this._length},get_contentType:function(){return this._contentType},get_errorMessage:function(){return this._errorMessage}},Sys.Extended.UI.AsyncFileUploadEventArgs.registerClass("Sys.Extended.UI.AsyncFileUploadEventArgs",Sys.EventArgs),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BarChart=function(n){Sys.Extended.UI.BarChart.initializeBase(this,[n]);this._chartWidth="300";this._chartHeight="200";this._chartTitle="";this._categoriesAxis="";this._series=null;this._chartType=Sys.Extended.UI.BarChartType.Column;this._theme="BarChart";this._valueAxisLines=9;this._chartTitleColor="";this._valueAxisLineColor="";this._categoryAxisLineColor="";this._baseLineColor="";this._container=null;this.yMax=0;this.yMin=0;this.xMax=0;this.xMin=0;this.roundedTickRange=0;this.startX=0;this.startY=0;this.endX=0;this.endY=0;this.xInterval=0;this.yInterval=0;this.arrXAxis;this.arrXAxisLength=0;this.arrYAxis;this.arrYAxisLength=0;this.charLength=3.5;this.arrCombinedData=null},Sys.Extended.UI.BarChart.prototype={initialize:function(){if(Sys.Extended.UI.BarChart.callBaseMethod(this,"initialize"),!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))throw"Browser does not support SVG.";0==this._valueAxisLines&&(this._valueAxisLines=9);this._parentDiv=this.get_container();this._chartType==Sys.Extended.UI.BarChartType.Column||this._chartType==Sys.Extended.UI.BarChartType.StackedColumn?this.generateColumnChart():this._chartType!=Sys.Extended.UI.BarChartType.Bar&&this._chartType!=Sys.Extended.UI.BarChartType.StackedBar||this.generateBarChart()},dispose:function(){Sys.Extended.UI.BarChart.callBaseMethod(this,"dispose")},generateColumnChart:function(){this.arrXAxis=this._categoriesAxis.split(",");this.arrXAxisLength=this.arrXAxis.length;this.calculateMinMaxValuesForColumnType();this.calculateIntervalForColumnType();this.calculateValueAxisForColumnType();var n=this.initializeSVG();n+=String.format('{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n+=this.drawBackgroundHorizontalLinesForColumnType();n+=this.drawBackgroundVerticalLinesForColumnType();n+=this.drawBaseLinesForColumnType();n+=this.drawLegendArea();n+=this.drawAxisValuesForColumnType();n+=this.drawBarsForColumnType();n+="<\/svg>";this._parentDiv.innerHTML=n},calculateIntervalForColumnType:function(){this.startX=this._chartWidth/10+.5;this.endX=parseInt(this._chartWidth)-4.5;this.startY=this.yMin>=0?Math.round(parseInt(this._chartHeight)-24*parseInt(this._chartHeight)/100)+.5:Math.round(parseInt(this._chartHeight)-12*parseInt(this._chartHeight)/100)/2+.5;this.yInterval=this.startY/(this._valueAxisLines+1)},calculateMinMaxValuesForColumnType:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.BarChartType.Column)for(n=0;nthis.yMax&&(this.yMax=u),i=0?this.yMax:this.yMax>Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t);this.startX=this.startX+(10*this.roundedTickRange*this._valueAxisLines/10).toString().length*this.charLength},drawBackgroundHorizontalLinesForColumnType:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._categoryAxisLineColor);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._categoryAxisLineColor);return t},drawBackgroundVerticalLinesForColumnType:function(){var t="",n;for(this.xInterval=Math.round((parseInt(this._chartWidth)-this.startX)/this.arrXAxisLength),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);if(this.yMin<0)for(n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._valueAxisLineColor);return t},drawBaseLinesForColumnType:function(){var t="",n;for(t+=String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY-this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),n=0;n<\/path>',parseInt(this._chartWidth)-5-this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);for(n=0;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*n,this._baseLineColor);if(this.yMin<0)for(t+=String.format('<\/path>',this.startX,this.startY+this.yInterval*this._valueAxisLines,this.startY,this._baseLineColor),n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*n,this._baseLineColor);return t},drawAxisValuesForColumnType:function(){for(var i="",t=0,n=0;n{2}<\/text>',Math.round(this.startX+10*this.xInterval*n/10+this.xInterval/2-t),this.startY+Math.round(65*this.yInterval/100),this.arrXAxis[n]);for(n=0;n<=this._valueAxisLines;n++)t=5.5*(10*this.roundedTickRange*n/10).toString().length,i+=String.format('{2}<\/text>',this.startX-t-15,this.startY-10*this.yInterval*n/10+3.5,10*this.roundedTickRange*n/10);if(this.yMin<0)for(n=1;n<=this._valueAxisLines;n++)t=5.5*(10*this.roundedTickRange*n/10).toString().length,i+=String.format('-{2}<\/text>',this.startX-t-19,this.startY+10*this.yInterval*n/10,10*this.roundedTickRange*n/10);return i},drawBarsForColumnType:function(){for(var r="",o=this._series.length,u=this.xInterval/10,n,i=this._chartType==Sys.Extended.UI.BarChartType.Column?Math.round((80*this.xInterval/100-u*o)/o):Math.round(80*this.xInterval/100),t=0;t",this._chartType==Sys.Extended.UI.BarChartType.Column)for(n=0;n',this.startX+this.xInterval*t+15*this.xInterval/100+(u+i)*n,this.startX+this.xInterval*t+15*this.xInterval/100+(u+i)*n+i,this.startY,this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):String.format('',this.startX+this.xInterval*t+12.5*this.xInterval/100+(u+i)*n,this.startX+this.xInterval*t+12.5*this.xInterval/100+(u+i)*n+i,this.startY,this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor),r+=this.yVal>0?String.format('{2}<\/text>',this.startX+this.xInterval*t+this.xInterval/5+(u+i)*n+i/10-Math.round(this.yVal.toString().length*this.charLength/2),this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange))-7.5,this.yVal):String.format('{2}<\/text>',this.startX+this.xInterval*t+this.xInterval/5+(u+i)*n+i/10-Math.round(this.yVal.toString().length*this.charLength/2),this.startY-Math.round(this.yVal*(this.yInterval/this.roundedTickRange))+7.5,this.yVal);else for(var f=this.startY,e=this.startY,n=0;n0?String.format('',this.startX+10*this.xInterval*t/10+7.5*this.xInterval/100,this.startX+10*this.xInterval*t/10+7.5*this.xInterval/100+i,f,f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):String.format('',this.startX+10*this.xInterval*t/10+7.5*this.xInterval/100,this.startX+10*this.xInterval*t/10+7.5*this.xInterval/100+i,e,e-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):this.yVal>0?String.format('',this.startX+10*this.xInterval*t/10+this.xInterval/20,this.startX+10*this.xInterval*t/10+this.xInterval/20+i,f,f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor):String.format('',this.startX+10*this.xInterval*t/10+this.xInterval/20,this.startX+10*this.xInterval*t/10+this.xInterval/20+i,e,e-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)),n+1,this._series[n].BarColor),this.yVal>0?(r+=String.format('{2}<\/text>',this.startX+10*this.xInterval*t/10+30*this.xInterval/100+i/10,f-Math.round(this.yVal*(this.yInterval/this.roundedTickRange)/2),this.yVal),f-=Math.round(this.yVal*(this.yInterval/this.roundedTickRange))):(r+=String.format('{2}<\/text>',this.startX+10*this.xInterval*t/10+30*this.xInterval/100+i/10,e+Math.round(Math.abs(this.yVal)*(this.yInterval/this.roundedTickRange)/2),this.yVal),e-=Math.round(this.yVal*(this.yInterval/this.roundedTickRange)));r+="<\/g>"}return r},initializeSVG:function(){var n=String.format('',this._theme);return n+=String.format('',this._chartWidth,this._chartHeight),n+="",n+='',n+='<\/stop>',n+='<\/stop>',n+='<\/stop><\/linearGradient>',n+="<\/defs>",n+String.format('',this._chartWidth,this._chartHeight)},drawLegendArea:function(){for(var t,c,e="",o=84*parseInt(this._chartHeight)/100+5,i=7.5,r=5,l=0,n=0;nparseInt(this._chartWidth)/2&&(t/=2,c=!0);e+="";e+=String.format('<\/path>',Math.round(parseInt(this._chartWidth)/2-t/2),o,Math.round(parseInt(this._chartWidth)/2+t/2),Math.round(97.5*parseInt(this._chartHeight)/100));for(var f=40*parseInt(this._chartWidth)/100-t/2+i+r,s=f,u=40*parseInt(this._chartWidth)/100-t/2,h=u,n=0;n<\/path>',u,o+7.5,u+i,o+15,n+1,this._series[n].BarColor),e+=String.format('{2}<\/text>',f,o+15,this._series[n].Name),this._series[n].Name.length>10?(h=u+5*this._series[n].Name.length+i+2*r,s=f+5*this._series[n].Name.length+i+2*r):(h=h+6*this._series[n].Name.length+i+2*r,s=s+6*this._series[n].Name.length+i+2*r);return e+"<\/g>"},generateBarChart:function(){this.arrYAxis=this._categoriesAxis.split(",");this.arrYAxisLength=this.arrYAxis.length;this.calculateMinMaxValuesForBarType();this.calculateIntervalForBarType();this.calculateValueAxisForBarType();var n=this.initializeSVG();n+=String.format('{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);n+=this.drawBackgroundHorizontalLinesForBarType();n+=this.drawBackgroundVerticalLinesForBarType();n+=this.drawBaseLinesForBarType();n+=this.drawLegendArea();n+=this.drawAxisValuesForBarType();n+=this.drawBarsForBarType();n+="<\/svg>";this._parentDiv.innerHTML=n},calculateIntervalForBarType:function(){this.startY=Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/5)+.5;this.endY=8*parseInt(this._chartHeight)/100+5;this.endX=parseInt(this._chartWidth)-10+.5;this.startX=this.xMin>=0?15*this._chartWidth/100+.5:Math.round(parseInt(this._chartWidth)/2)+.5;this.xInterval=Math.round((this.endX-this.startX)/this._valueAxisLines)},calculateMinMaxValuesForBarType:function(){var u,i,r,t,n;if(this._chartType==Sys.Extended.UI.BarChartType.Bar)for(n=0;nthis.xMax&&(this.xMax=u),i=0?this.xMax:this.xMax>Math.abs(this.xMin)?this.xMax:Math.abs(this.xMin);n=i/(this._valueAxisLines-1);n<1?this.roundedTickRange=n.toFixed(1):(r=Math.ceil(Math.log(n)/Math.log(10)-1),t=Math.pow(10,r),this.roundedTickRange=Math.ceil(n/t)*t)},drawBackgroundVerticalLinesForBarType:function(){for(var t="",n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY-this.yInterval*this.arrYAxisLength,this._categoryAxisLineColor);if(this.xMin<0)for(n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY-this.yInterval*this.arrYAxisLength,this._categoryAxisLineColor);return t},drawBackgroundHorizontalLinesForBarType:function(){var t="",n;for(this.yInterval=Math.round((this.startY-this.endY)/this.arrYAxisLength),n=0;n<=this.arrYAxisLength;n++)t+=String.format('<\/path>',this.startX,this.startX+this.xInterval*this._valueAxisLines,this.startY-this.yInterval*n,this._valueAxisLineColor);if(this.xMin<0)for(n=0;n<=this.arrYAxisLength;n++)t+=String.format('<\/path>',this.startX,this.startX-this.xInterval*this._valueAxisLines,this.startY-this.yInterval*n,this._valueAxisLineColor);return t},drawBaseLinesForBarType:function(){var t="",n;for(t+=String.format('<\/path>',this.startX,this.startY,this.endY,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startX-4,this.startY,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.endX,this.startY,this._baseLineColor),n=0;n<\/path>',this.startX,this.startX-4,this.startY-this.yInterval*n,this._baseLineColor);for(n=0;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);if(this.xMin<0)for(t+=String.format('<\/path>',this.startX,this.startX-this.xInterval*this._valueAxisLines,this.startY,this._baseLineColor),n=1;n<=this._valueAxisLines;n++)t+=String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);return t},drawAxisValuesForBarType:function(){for(var t="",i=0,n=0;n{2}<\/text>',this.startX-15*this.xInterval/100-i,Math.round(this.startY-this.yInterval*(n+1)+60*this.yInterval/100),this.arrYAxis[n]);for(n=0;n<=this._valueAxisLines;n++)t+=String.format('{2}<\/text>',this.startX+this.xInterval*n-(this.roundedTickRange*n).toString().length*this.charLength,this.startY+35*this.yInterval/100,this.roundedTickRange*n);if(this.xMin<0)for(n=1;n<=this._valueAxisLines;n++)t+=String.format('-{2}<\/text>',this.startX-this.xInterval*n-(this.roundedTickRange*n).toString().length*this.charLength,this.startY+35*this.yInterval/100,this.roundedTickRange*n);return t},drawBarsForBarType:function(){for(var n,r="",o=this._series.length,u=this.yInterval/10,i=this._chartType==Sys.Extended.UI.BarChartType.Bar?Math.round((80*this.yInterval/100-u*o)/o):Math.round(80*this.yInterval/100),t=0;t",this._chartType==Sys.Extended.UI.BarChartType.Bar)for(n=0;n',this.startX,this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-15*this.yInterval/100-(u+i)*n,this.startY-this.yInterval*t-15*this.yInterval/100-(u+i)*n-i,n+1,this._series[n].BarColor):String.format('',this.startX,this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-12.5*this.yInterval/100-(u+i)*n,this.startY-this.yInterval*t-12.5*this.yInterval/100-(u+i)*n-i,n+1,this._series[n].BarColor),r+=this.xVal>0?String.format('{2}<\/text>',this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange))+this.xVal.toString().length*this.charLength,this.startY-this.yInterval*t-this.yInterval/5-(u+i)*n-i/10,this.xVal):String.format('{2}<\/text>',this.startX+Math.round(this.xVal*(this.xInterval/this.roundedTickRange))-(this.xVal.toString().length+1)*this.charLength-5,this.startY-this.yInterval*t-this.yInterval/5-(u+i)*n-i/10,this.xVal);else for(var f=this.startX,e=this.startX,n=0;n0?String.format('',f,f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval/10,this.startY-this.yInterval*t-this.xInterval/10-i,n+1,this._series[n].BarColor):String.format('',e,e+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-this.yInterval/10,this.startY-this.yInterval*t-this.xInterval/10-i,n+1,this._series[n].BarColor):this.xVal>0?String.format('',f,f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-7.55*this.yInterval/100,this.startY-this.yInterval*t-7.5*this.xInterval/100-i,n+1,this._series[n].BarColor):String.format('',e,e+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)),this.startY-this.yInterval*t-7.55*this.yInterval/100,this.startY-this.yInterval*t-7.5*this.xInterval/100-i,n+1,this._series[n].BarColor),this.xVal>0?(r+=String.format('{2}<\/text>',f+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)/2),this.startY-this.yInterval*t-30*this.yInterval/100-i/10,this.xVal),f+=Math.round(this.xVal*(this.xInterval/this.roundedTickRange))):(r+=String.format('{2}<\/text>',e+Math.round(this.xVal*(this.xInterval/this.roundedTickRange)/2),this.startY-this.yInterval*t-30*this.yInterval/100-i/10,this.xVal),e+=Math.round(this.xVal*(this.xInterval/this.roundedTickRange)));r+="<\/g>"}return r},get_chartWidth:function(){return this._chartWidth},set_chartWidth:function(n){this._chartWidth=n},get_chartHeight:function(){return this._chartHeight},set_chartHeight:function(n){this._chartHeight=n},get_chartTitle:function(){return this._chartTitle},set_chartTitle:function(n){this._chartTitle=n},get_categoriesAxis:function(){return this._categoriesAxis},set_categoriesAxis:function(n){this._categoriesAxis=n},get_clientSeries:function(){return this._series},set_clientSeries:function(n){this._series=n},get_ClientSeries:function(){return Sys.Extended.Deprecated("get_ClientSeries","get_clientSeries"),this.get_clientSeries()},set_ClientSeries:function(n){Sys.Extended.Deprecated("set_ClientSeries","set_clientSeries");this.set_clientSeries(n)},get_chartType:function(){return this._chartType},set_chartType:function(n){this._chartType=n},get_theme:function(){return this._theme},set_theme:function(n){this._theme=n},get_valueAxisLines:function(){return this._valueAxisLines},set_valueAxisLines:function(n){this._valueAxisLines=n},get_chartTitleColor:function(){return this._chartTitleColor},set_chartTitleColor:function(n){this._chartTitleColor=n},get_valueAxisLineColor:function(){return this._valueAxisLineColor},set_valueAxisLineColor:function(n){this._valueAxisLineColor=n},get_categoryAxisLineColor:function(){return this._categoryAxisLineColor},set_categoryAxisLineColor:function(n){this._categoryAxisLineColor=n},get_baseLineColor:function(){return this._baseLineColor},set_baseLineColor:function(n){this._baseLineColor=n},get_container:function(){return this._container},set_container:function(n){this._container=n}},Sys.Extended.UI.BarChart.registerClass("Sys.Extended.UI.BarChart",Sys.Extended.UI.ControlBase),Sys.Extended.UI.BarChartType=function(){throw Error.invalidOperation();},Sys.Extended.UI.BarChartType.prototype={Column:0,Bar:1,StackedColumn:2,StackedBar:3},Sys.Extended.UI.BarChartType.registerEnum("Sys.Extended.UI.BarChartType",!1),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BubbleChart=function(n){Sys.Extended.UI.BubbleChart.initializeBase(this,[n]);var t=this.get_id();t=t.replace("_ctl00","");this._parentDiv=document.getElementById(t+"__ParentDiv");this._chartWidth="300";this._chartHeight="200";this._chartTitle="";this._bubbleChartClientValues=null;this._theme="BubbleChart";this._yAxisLines=6;this._xAxisLines=6;this._bubbleSizes=5;this._chartTitleColor="";this._yAxisLineColor="";this._xAxisLineColor="";this._baseLineColor="";this._tooltipBackgroundColor="#FFFFFF";this._tooltipFontColor="#0E426C";this._tooltipBorderColor="#B85B3E";this._xAxisLabel="";this._yAxisLabel="";this._bubbleLabel="";this._axislabelFontColor="#000000";this.yMax=0;this.yMin=0;this.xMax=0;this.xMin=0;this.dataMax=0;this.dataMin=0;this.yRoundedIntervalLabelSize=0;this.xRoundedIntervalLabelSize=0;this.roundedBubbleSize=0;this.startX=0;this.startY=0;this.endX=0;this.endY=0;this.xInterval=0;this.yInterval=0;this.charLength=3.5;this._divTooltip=null},Sys.Extended.UI.BubbleChart.prototype={initialize:function(){if(Sys.Extended.UI.BubbleChart.callBaseMethod(this,"initialize"),!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))throw"Current version of browser does not support SVG.";0==this._yAxisLines&&(this._yAxisLines=6);0==this._xAxisLines&&(this._xAxisLines=6);0==this._bubbleSizes&&(this._bubbleSizes=5);this.generateTooltipDiv();this.generateBubbleChart()},dispose:function(){Sys.Extended.UI.BubbleChart.callBaseMethod(this,"dispose")},generateTooltipDiv:function(){this._divTooltip=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_tooltipDiv",style:{position:"absolute",backgroundColor:this._tooltipBackgroundColor,borderStyle:"solid",borderWidth:"5px",borderColor:this._tooltipBorderColor,left:"0px",top:"0px",color:this._tooltipFontColor,visibility:"hidden",zIndex:Sys.Extended.UI.zIndex.BubbleChartTooltip,padding:"10px"}}},this._parentDiv)},generateBubbleChart:function(){this.calculateMinMaxValues();this.calculateBubbleSize();this.calculateAxisValues();var n=this.intializeSVG();n+=String.format('{2}<\/text>',parseInt(this._chartWidth)/2-this._chartTitle.length*this.charLength,parseInt(this._chartHeight)/20,this._chartTitle,this._chartTitleColor);this.calculateIntervals();n+=this.drawBackgroundHorizontalLines();n+=this.drawBackgroundVerticalLines();n+=this.drawBaseLines();n+=this.drawAxisValues();this._parentDiv.innerHTML=this._parentDiv.innerHTML+n;this.drawBubbles(this,0)},intializeSVG:function(){var n=String.format('',this._theme);return n=String.format('',this._chartWidth,this._chartHeight,.99*parseFloat(this._chartWidth),.99*parseFloat(this._chartHeight)),n+=String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10),n+=String.format('',this._chartWidth,parseInt(this._chartHeight)-5),n+String.format('',parseInt(this._chartHeight)/10+5,parseInt(this._chartWidth)-5,parseInt(this._chartHeight)-parseInt(this._chartHeight)/10)},drawBubbles:function(n,t){n._parentDiv.innerHTML=n._parentDiv.innerHTML.replace("<\/svg>","")+String.format('<\/circle><\/svg>',n.startX+Math.round(parseFloat(n._bubbleChartClientValues[t].X)/n.xRoundedIntervalLabelSize*n.xInterval),n.startY+Math.round(-1*parseFloat(n._bubbleChartClientValues[t].Y)/n.yRoundedIntervalLabelSize*n.yInterval),Math.round(parseFloat(n._bubbleChartClientValues[t].Data)/n.roundedBubbleSize*n._bubbleSizes),n._bubbleChartClientValues[t].BubbleColor,t+1,n._bubbleChartClientValues[t].Category,n._bubbleChartClientValues[t].Data,n._bubbleLabel);t++;tthis.dataMax&&(this.dataMax=parseFloat(this._bubbleChartClientValues[n].Data)),parseFloat(this._bubbleChartClientValues[n].Data)this.xMax&&(this.xMax=parseFloat(this._bubbleChartClientValues[n].X)),parseFloat(this._bubbleChartClientValues[n].Data)this.yMax&&(this.yMax=parseFloat(this._bubbleChartClientValues[n].Y)),parseFloat(this._bubbleChartClientValues[n].Y)Math.abs(this.yMin)?this.yMax:Math.abs(this.yMin):this.yMax;n=i/(this._yAxisLines-1);n<1?this.yRoundedIntervalLabelSize=n.toFixed(1):(x=Math.ceil(Math.log(n)/Math.log(10)-1),pow10x=Math.pow(10,x),this.yRoundedIntervalLabelSize=Math.ceil(n/pow10x)*pow10x);r=this.xMin<0?this.xMax>Math.abs(this.xMin)?this.xMax:Math.abs(this.xMin):this.xMax;t=r/(this._xAxisLines-1);n<1?this.xRoundedIntervalLabelSize=t.toFixed(1):(x=Math.ceil(Math.log(t)/Math.log(10)-1),pow10x=Math.pow(10,x),this.xRoundedIntervalLabelSize=Math.ceil(t/pow10x)*pow10x)},calculateIntervals:function(){this.endX=parseFloat(this._chartWidth)-parseFloat(this._chartWidth)/20;this.startX=this.xMin<0?Math.round(parseFloat(this._chartWidth)+parseFloat(this._chartWidth)/10)/2+.5:parseFloat(this._chartWidth)/5+.5;this.xInterval=this.xMin<0?(this.endX-this.startX)/this._xAxisLines:Math.round((this.endX-this.startX)/this._xAxisLines);this.startY=this.yMin<0?Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/20)/2+.5:Math.round(parseInt(this._chartHeight)-parseInt(this._chartHeight)/5)+.5;this.yInterval=this.startY/(this._yAxisLines+1);this.endY=this.startY-this.yInterval*this._yAxisLines},drawBackgroundHorizontalLines:function(){for(var t="",n=1;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY-this.yInterval*n,this._xAxisLineColor);if(this.yMin<0)for(n=1;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX,this.endX,this.startY+this.yInterval*n,this._xAxisLineColor);if(this.xMin<0)for(n=1;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY-this.yInterval*n,this._xAxisLineColor);if(this.xMin<0&&this.yMin<0)for(n=1;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY+this.yInterval*n,this._xAxisLineColor);return t},drawBackgroundVerticalLines:function(){for(var t="",n=1;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.endY,this._yAxisLineColor);if(this.xMin<0)for(n=1;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.endY,this._yAxisLineColor);if(this.yMin<0)for(n=1;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);if(this.xMin<0&&this.yMin<0)for(n=1;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY+this.yInterval*this._yAxisLines,this._yAxisLineColor);return t},drawBaseLines:function(){var t="",n;for(t+=String.format('<\/path>',this.startX,this.startY,this.endX,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY,this.startY+4,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY,this.endY,this._baseLineColor),t+=String.format('<\/path>',this.startX,this.startY,this.startX+4,this._baseLineColor),n=0;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY-this.yInterval*n,this._baseLineColor);if(this.yMin<0){for(n=1;n<=this._yAxisLines;n++)t+=String.format('<\/path>',this.startX-4,this.startX,this.startY+this.yInterval*n,this._baseLineColor);t+=String.format('<\/path>',this.startX-this.xInterval*this._xAxisLines,this.startY,this.startY+4,this._baseLineColor);t+=String.format('<\/path>',this.startX,this.startY,this.startY+this.yInterval*this._yAxisLines,this._baseLineColor)}for(n=0;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX+this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);if(this.xMin<0){for(n=1;n<=this._xAxisLines;n++)t+=String.format('<\/path>',this.startX-this.xInterval*n,this.startY,this.startY+4,this._baseLineColor);t+=String.format('<\/path>',this.startX,this.startX-this.xInterval*this._xAxisLines,this.startY,this._baseLineColor)}return t},drawAxisValues:function(){for(var r,i="",t=0,n=1;n<=this._yAxisLines;n++)t=5.5*(10*this.yRoundedIntervalLabelSize*n/10).toString().length,i+=String.format('{2}<\/text>',this.startX-t-10,this.startY-this.yInterval*n+4,10*this.yRoundedIntervalLabelSize*n/10);if(this.yMin<0)for(n=1;n<=this._yAxisLines;n++)t=5.5*(10*this.yRoundedIntervalLabelSize*n/10).toString().length+5.5,i+=String.format('-{2}<\/text>',this.startX-t-10,this.startY+this.yInterval*n+4,10*this.yRoundedIntervalLabelSize*n/10);for(n=1;n<=this._xAxisLines;n++)t=5.5*(10*this.xRoundedIntervalLabelSize*n/10).toString().length,i+=String.format('{2}<\/text>',Math.round(this.startX+this.xInterval*n-t/2),this.startY+Math.round(this.yInterval/4)+5,10*this.xRoundedIntervalLabelSize*n/10);if(this.xMin<0)for(n=1;n<=this._xAxisLines;n++)t=5.5*(10*this.xRoundedIntervalLabelSize*n/10).toString().length+5.5,i+=String.format('-{2}<\/text>',Math.round(this.startX-this.xInterval*n-t/2),this.startY+Math.round(this.yInterval/4)+5,10*this.xRoundedIntervalLabelSize*n/10);return r=this.yMin<0?Math.round(this.startY+this.yInterval*this._yAxisLines-(this.startY-this.yInterval*this._yAxisLines))/2:Math.round((this.startY-this.endY)/2),i+=String.format('{2}<\/text>',Math.round(parseFloat(this._chartWidth)/20),r+this._yAxisLabel.toString().length*this.charLength,this._yAxisLabel,this._axislabelFontColor),i+String.format('{2}<\/text>',Math.round(parseInt(this._chartWidth)/2-this._xAxisLabel.toString().length*this.charLength/2),Math.round(90*parseInt(this._chartHeight)/100+5),this._xAxisLabel,this._axislabelFontColor)},get_chartWidth:function(){return this._chartWidth},set_chartWidth:function(n){this._chartWidth=n},get_chartHeight:function(){return this._chartHeight},set_chartHeight:function(n){this._chartHeight=n},get_chartTitle:function(){return this._chartTitle},set_chartTitle:function(n){this._chartTitle=n},get_bubbleChartClientValues:function(){return this._bubbleChartClientValues},set_bubbleChartClientValues:function(n){this._bubbleChartClientValues=n},get_BubbleChartClientValues:function(){return Sys.Extended.Deprecated("get_BubbleChartClientValues","get_bubbleChartClientValues"),this.get_bubbleChartClientValues()},set_BubbleChartClientValues:function(n){Sys.Extended.Deprecated("set_BubbleChartClientValues","set_bubbleChartClientValues");this.set_bubbleChartClientValues(n)},get_theme:function(){return this._theme},set_theme:function(n){this._theme=n},get_yAxisLines:function(){return this._yAxisLines},set_yAxisLines:function(n){this._yAxisLines=n},get_xAxisLines:function(){return this._xAxisLines},set_xAxisLines:function(n){this._xAxisLines=n},get_chartTitleColor:function(){return this._chartTitleColor},set_chartTitleColor:function(n){this._chartTitleColor=n},get_yAxisLineColor:function(){return this._yAxisLineColor},set_yAxisLineColor:function(n){this._yAxisLineColor=n},get_xAxisLineColor:function(){return this._xAxisLineColor},set_xAxisLineColor:function(n){this._xAxisLineColor=n},get_bubbleSizes:function(){return this._bubbleSizes},set_bubbleSizes:function(n){this._bubbleSizes=n},get_baseLineColor:function(){return this._baseLineColor},set_baseLineColor:function(n){this._baseLineColor=n},get_tooltipBackgroundColor:function(){return this.tooltipBackgroundColor},set_tooltipBackgroundColor:function(n){this.tooltipBackgroundColor=n},get_tooltipFontColor:function(){return this._tooltipFontColor},set_tooltipFontColor:function(n){this._tooltipFontColor=n},get_tooltipBorderColor:function(){return this._tooltipBorderColor},set_tooltipBorderColor:function(n){this._tooltipBorderColor=n},get_xAxisLabel:function(){return this._xAxisLabel},set_xAxisLabel:function(n){this._xAxisLabel=n},get_yAxisLabel:function(){return this._yAxisLabel},set_yAxisLabel:function(n){this._yAxisLabel=n},get_bubbleLabel:function(){return this._bubbleLabel},set_bubbleLabel:function(n){this._bubbleLabel=n},get_axislabelFontColor:function(){return this._axislabelFontColor},set_axislabelFontColor:function(n){this._axislabelFontColor=n}},Sys.Extended.UI.BubbleChart.registerClass("Sys.Extended.UI.BubbleChart",Sys.Extended.UI.ControlBase),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.PopupBehavior=function(n){Sys.Extended.UI.PopupBehavior.initializeBase(this,[n]);this._x=0;this._y=0;this._positioningMode=Sys.Extended.UI.PositioningMode.Absolute;this._parentElement=null;this._parentElementID=null;this._moveHandler=null;this._firstPopup=!0;this._originalParent=null;this._visible=!1;this._unselectable=null;this._onShow=null;this._onHide=null;this._onShowEndedHandler=Function.createDelegate(this,this._onShowEnded);this._onHideEndedHandler=Function.createDelegate(this,this._onHideEnded)},Sys.Extended.UI.PopupBehavior.prototype={initialize:function(){Sys.Extended.UI.PopupBehavior.callBaseMethod(this,"initialize");this._hidePopup();this.get_element().style.position="absolute"},dispose:function(){var n=this.get_element();n&&(this._visible&&this.hide(),this._originalParent&&(n.parentNode.removeChild(n),this._originalParent.appendChild(n),this._originalParent=null),n._hideWindowedElementsIFrame=null);this._parentElement=null;this._onShow&&this._onShow.get_animation()&&this._onShow.get_animation().remove_ended(this._onShowEndedHandler);this._onShow=null;this._onHide&&this._onHide.get_animation()&&this._onHide.get_animation().remove_ended(this._onHideEndedHandler);this._onHide=null;Sys.Extended.UI.PopupBehavior.callBaseMethod(this,"dispose")},show:function(){var n,t;this._visible||(n=new Sys.CancelEventArgs,(this.raise_showing(n),n.get_cancel())||(this._visible=!0,t=this.get_element(),$common.setVisible(t,!0),this.setupPopup(),this._onShow?($common.setVisible(t,!1),this.onShow()):this.raise_shown(Sys.EventArgs.Empty)))},hide:function(){if(this._visible){var n=new Sys.CancelEventArgs;this.raise_hiding(n);n.get_cancel()||(this._visible=!1,this._onHide?this.onHide():(this._hidePopup(),this._hideCleanup()))}},getBounds:function(){var f,n,i=this.get_element(),s=i.offsetParent||document.documentElement,e,r,u,o,t;this.get_parentElement()?(n=$common.getBounds(this.get_parentElement()),e=$common.getLocation(s),f={x:n.x-e.x,y:n.y-e.y}):(n=$common.getBounds(s),f={x:0,y:0});r=i.offsetWidth-(i.clientLeft?2*i.clientLeft:0);u=i.offsetHeight-(i.clientTop?2*i.clientTop:0);this._firstpopup&&(i.style.width=r+"px",this._firstpopup=!1);switch(this._positioningMode){case Sys.Extended.UI.PositioningMode.Center:t={x:Math.round(n.width/2-r/2),y:Math.round(n.height/2-u/2),altX:Math.round(n.width/2-r/2),altY:Math.round(n.height/2-u/2)};break;case Sys.Extended.UI.PositioningMode.BottomLeft:t={x:0,y:n.height,altX:n.width-r,altY:0-u};break;case Sys.Extended.UI.PositioningMode.BottomRight:t={x:n.width-r,y:n.height,altX:0,altY:0-u};break;case Sys.Extended.UI.PositioningMode.TopLeft:t={x:0,y:-i.offsetHeight,altX:n.width-r,altY:n.height};break;case Sys.Extended.UI.PositioningMode.TopRight:t={x:n.width-r,y:-i.offsetHeight,altX:0,altY:n.height};break;case Sys.Extended.UI.PositioningMode.Right:t={x:n.width,y:0,altX:-i.offsetWidth,altY:n.height-u};break;case Sys.Extended.UI.PositioningMode.Left:t={x:-i.offsetWidth,y:0,altX:n.width,altY:n.height-u};break;default:t={x:0,y:0,altX:0,altY:0}}return t.x+=this._x+f.x,t.altX+=this._x+f.x,t.y+=this._y+f.y,t.altY+=this._y+f.y,o=this._verifyPosition(t,r,u,n),new Sys.UI.Bounds(o.x,o.y,r,u)},_verifyPosition:function(n,t,i){var u=0,f=0,r=this._getWindowBounds(),e;return n.x+t>r.x+r.width||n.xn.altX&&(u=n.x):r.width+r.x-n.altXn.altX?Math.abs(r.x-n.x):r.x-n.x,er.y+r.height||n.yi-r.height-r.y+n.y&&(f=n.y):r.height+r.y-n.altY<\/html>';",n.style.position="absolute",n.style.display="none",n.scrolling="no",n.frameBorder="0",n.tabIndex="-1",n.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)",t.parentNode.insertBefore(n,t),t._hideWindowedElementsIFrame=n,this._moveHandler=Function.createDelegate(this,this._onMove),Sys.UI.DomEvent.addHandler(t,"move",this._moveHandler)),$common.setBounds(n,$common.getBounds(t)),n.style.left=t.style.left,n.style.top=t.style.top,n.style.display=t.style.display,t.currentStyle&&t.currentStyle.zIndex?n.style.zIndex=t.currentStyle.zIndex:t.style.zIndex&&(n.style.zIndex=t.style.zIndex))},setupPopup:function(){var n=this.get_element(),t=this.getBounds();$common.setLocation(n,t);this.adjustPopupPosition(t);n.style.zIndex=Sys.Extended.UI.zIndex.Popup;this.addBackgroundIFrame()},_hidePopup:function(){var n=this.get_element();$common.setVisible(n,!1);n.originalWidth&&(n.style.width=n.originalWidth+"px",n.originalWidth=null)},_hideCleanup:function(){var t=this.get_element(),n;(this._moveHandler&&(Sys.UI.DomEvent.removeHandler(t,"move",this._moveHandler),this._moveHandler=null),Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(n=t._hideWindowedElementsIFrame,n&&(n.style.display="none"));this.raise_hidden(Sys.EventArgs.Empty)},_onMove:function(){var n=this.get_element();n._hideWindowedElementsIFrame&&(n.parentNode.insertBefore(n._hideWindowedElementsIFrame,n),n._hideWindowedElementsIFrame.style.top=n.style.top,n._hideWindowedElementsIFrame.style.left=n.style.left)},get_onShow:function(){return this._onShow?this._onShow.get_json():null},set_onShow:function(n){this._onShow||(this._onShow=new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()),this._onShow.initialize());this._onShow.set_json(n);var t=this._onShow.get_animation();t&&t.add_ended(this._onShowEndedHandler);this.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._onShow},onShow:function(){this._onShow&&(this._onHide&&this._onHide.quit(),this._onShow.play())},_onShowEnded:function(){this.adjustPopupPosition();this.addBackgroundIFrame();this.raise_shown(Sys.EventArgs.Empty)},get_onHide:function(){return this._onHide?this._onHide.get_json():null},set_onHide:function(n){this._onHide||(this._onHide=new Sys.Extended.UI.Animation.GenericAnimationBehavior(this.get_element()),this._onHide.initialize());this._onHide.set_json(n);var t=this._onHide.get_animation();t&&t.add_ended(this._onHideEndedHandler);this.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._onHide},onHide:function(){this._onHide&&(this._onShow&&this._onShow.quit(),this._onHide.play())},_onHideEnded:function(){this._hideCleanup()},get_parentElement:function(){return!this._parentElement&&this._parentElementID&&this.set_parentElement($get(this._parentElementID)),this._parentElement},set_parentElement:function(n){this._parentElement=n;this.raisePropertyChanged("parentElement")},get_parentElementID:function(){return this._parentElement?this._parentElement.id:this._parentElementID},set_parentElementID:function(n){this._parentElementID=n;this.get_isInitialized()&&this.set_parentElement($get(n))},get_positioningMode:function(){return this._positioningMode},set_positioningMode:function(n){this._positioningMode=n;this.raisePropertyChanged("positioningMode")},get_x:function(){return this._x},set_x:function(n){n!=this._x&&(this._x=n,this._visible&&this.setupPopup(),this.raisePropertyChanged("x"))},get_y:function(){return this._y},set_y:function(n){n!=this._y&&(this._y=n,this._visible&&this.setupPopup(),this.raisePropertyChanged("y"))},get_visible:function(){return this._visible},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)");this.raise_showing(n)},add_shown:function(n){this.get_events().addHandler("shown",n)},remove_shown:function(n){this.get_events().removeHandler("shown",n)},raise_shown:function(n){var t=this.get_events().getHandler("shown");t&&t(this,n)},raiseShown:function(n){Sys.Extended.Deprecated("raiseShown(eventArgs)","raise_shown(eventArgs)");this.raise_shown(n)},add_hiding:function(n){this.get_events().addHandler("hiding",n)},remove_hiding:function(n){this.get_events().removeHandler("hiding",n)},raise_hiding:function(n){var t=this.get_events().getHandler("hiding");t&&t(this,n)},raiseHiding:function(n){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)");this.raise_hiding(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(n){var t=this.get_events().getHandler("hidden");t&&t(this,n)},raiseHidden:function(n){Sys.Extended.Deprecated("raiseHidden(eventArgs)","raise_hidden(eventArgs)");this.raise_hidden(n)},get_unselectable:function(){return this._unselectable},set_unselectable:function(n){this._unselectable=n;this.raisePropertyChanged("unselectable")}},Sys.Extended.UI.PopupBehavior.registerClass("Sys.Extended.UI.PopupBehavior",Sys.Extended.UI.BehaviorBase),Sys.Extended.UI.PositioningMode=function(){throw Error.invalidOperation();},Sys.Extended.UI.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5,Right:6,Left:7},Sys.Extended.UI.PositioningMode.registerEnum("Sys.Extended.UI.PositioningMode"),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.AutoCompleteBehavior=function(n){Sys.Extended.UI.AutoCompleteBehavior.initializeBase(this,[n]);this._servicePath=null;this._serviceMethod=null;this._contextKey=null;this._useContextKey=!1;this._minimumPrefixLength=3;this._completionSetCount=10;this._completionInterval=1e3;this._completionListElementID=null;this._completionListElement=null;this._textColor="windowtext";this._textBackground="window";this._popupBehavior=null;this._popupBehaviorHiddenHandler=null;this._onShowJson=null;this._onHideJson=null;this._timer=null;this._cache=null;this._currentPrefix=null;this._selectIndex=-1;this._focusHandler=null;this._blurHandler=null;this._bodyClickHandler=null;this._clickHandler=null;this._completionListBlurHandler=null;this._keyDownHandler=null;this._mouseDownHandler=null;this._mouseUpHandler=null;this._mouseOverHandler=null;this._tickHandler=null;this._enableCaching=!0;this._flyoutHasFocus=!1;this._textBoxHasFocus=!1;this._completionListCssClass=null;this._completionListItemCssClass=null;this._highlightedItemCssClass=null;this._delimiterCharacters=null;this._firstRowSelected=!1;this._showOnlyCurrentWordInCompletionListItem=!1;this._webRequest=null},Sys.Extended.UI.AutoCompleteBehavior.prototype={initialize:function(){Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this,"initialize");$common.prepareHiddenElementForATDeviceUpdate();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._completionListBlurHandler=Function.createDelegate(this,this._onCompletionListBlur);this._bodyClickHandler=Function.createDelegate(this,this._onCompletionListBlur);this._clickHandler=Function.createDelegate(this,this._onInputClick);this._timer=new Sys.Timer;this.initializeTimer(this._timer);var n=this.get_element();this.initializeTextBox(n);null!==this._completionListElementID&&(this._completionListElement=$get(this._completionListElementID));null==this._completionListElement&&(this._completionListElement=document.createElement("ul"),this._completionListElement.id=this.get_id()+"_completionListElem",Sys.Browser.agent===Sys.Browser.Safari?document.body.appendChild(this._completionListElement):n.parentNode.insertBefore(this._completionListElement,n.nextSibling));this.initializeCompletionList(this._completionListElement);this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"PopupBehavior",parentElement:n,positioningMode:Sys.Extended.UI.PositioningMode.BottomLeft},null,null,this._completionListElement);this._popupBehavior.add_hidden(this._popupBehaviorHiddenHandler);this._onShowJson&&this._popupBehavior.set_onShow(this._onShowJson);this._onHideJson&&this._popupBehavior.set_onHide(this._onHideJson)},dispose:function(){this._onShowJson=null;this._onHideJson=null;this._popupBehavior&&(this._popupBehaviorHiddenHandler&&this._popupBehavior.remove_hidden(this._popupBehaviorHiddenHandler),this._popupBehavior.dispose(),this._popupBehavior=null);this._timer&&(this._timer.dispose(),this._timer=null);var n=this.get_element();n&&($removeHandler(n,"focus",this._focusHandler),$removeHandler(n,"blur",this._blurHandler),$removeHandler(n,"keydown",this._keyDownHandler),$removeHandler(n,"click",this._clickHandler),$removeHandler(this._completionListElement,"blur",this._completionListBlurHandler),$removeHandler(this._completionListElement,"mousedown",this._mouseDownHandler),$removeHandler(this._completionListElement,"mouseup",this._mouseUpHandler),$removeHandler(this._completionListElement,"mouseover",this._mouseOverHandler));this._bodyClickHandler&&($removeHandler(document.body,"click",this._bodyClickHandler),this._bodyClickHandler=null);this._popupBehaviorHiddenHandler=null;this._tickHandler=null;this._focusHandler=null;this._blurHandler=null;this._clickHandler=null;this._keyDownHandler=null;this._completionListBlurHandler=null;this._mouseDownHandler=null;this._mouseUpHandler=null;this._mouseOverHandler=null;Sys.Extended.UI.AutoCompleteBehavior.callBaseMethod(this,"dispose")},initializeTimer:function(n){n.set_interval(this._completionInterval);n.add_tick(this._tickHandler)},initializeTextBox:function(n){n.autocomplete="off";$addHandler(n,"focus",this._focusHandler);$addHandler(n,"blur",this._blurHandler);$addHandler(n,"keydown",this._keyDownHandler);$addHandler(n,"click",this._clickHandler)},initializeCompletionList:function(n){if(this._completionListCssClass)Sys.UI.DomElement.addCssClass(n,this._completionListCssClass);else{var t=n.style;t.textAlign="left";t.visibility="hidden";t.cursor="default";t.listStyle="none";t.padding="0px";t.margin="0px! important";Sys.Browser.agent===Sys.Browser.Safari?(t.border="solid 1px gray",t.backgroundColor="white",t.color="black"):(t.border="solid 1px buttonshadow",t.backgroundColor=this._textBackground,t.color=this._textColor)}$addHandler(n,"mousedown",this._mouseDownHandler);$addHandler(n,"mouseup",this._mouseUpHandler);$addHandler(n,"mouseover",this._mouseOverHandler);$addHandler(n,"blur",this._completionListBlurHandler);$addHandler(document.body,"click",this._bodyClickHandler)},_onInputClick:function(n){n||(n=window.event);n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},_currentCompletionWord:function(){var u=this.get_element(),t=u.value,r=t,n,i;return this.get_isMultiWord()&&(n=this._getCurrentWordStartIndex(),i=this._getCurrentWordEndIndex(n),r=i<=n?t.substring(n):t.substring(n,i)),r},_getCursorIndex:function(){return this.get_element().selectionStart},_getCurrentWordStartIndex:function(){for(var r,u=this.get_element(),f=u.value.substring(0,this._getCursorIndex()),n=0,t=-1,i=0;it&&(t=r);return n=t,n>=this._getCursorIndex()&&(n=0),n<0?0:n+1},_getCurrentWordEndIndex:function(n){for(var i,u=this.get_element(),f=u.value.substring(n),t=0,r=0;r0&&(i0&&(f=r.substring(0,t));u>t&&(e=r.substring(u));i=f+n+e}return i},_hideCompletionList:function(){var n=new Sys.CancelEventArgs;this.raise_hiding(n);n.get_cancel()||this.hidePopup()},showPopup:function(){this._popupBehavior.show();this.raise_shown(Sys.EventArgs.Empty)},hidePopup:function(){this._popupBehavior?this._popupBehavior.hide():this._popupHidden()},_popupHidden:function(){this._completionListElement.innerHTML="";this._selectIndex=-1;this._flyoutHasFocus=!1;this.raise_hidden(Sys.EventArgs.Empty)},_highlightItem:function(n){for(var t,r=this._completionListElement.childNodes,i=0;i0&&(this._selectIndex--,this._handleScroll(this._completionListElement.childNodes[this._selectIndex],this._selectIndex),this._highlightItem(this._completionListElement.childNodes[this._selectIndex]),n.stopPropagation(),n.preventDefault()):t===Sys.UI.Key.down?this._selectIndex=0&&(i.scrollTop+=r.height*t-(i.clientHeight+i.scrollTop)+r.height);r.height*(u-(t+1))-(i.scrollHeight-i.scrollTop)>=0&&(i.scrollTop-=r.height*(u-(t+1))-(i.scrollHeight-i.scrollTop)+r.height);i.scrollTop%r.height!=0&&(r.height*(t+1)-(i.clientHeight+i.scrollTop)>=0?i.scrollTop-=i.scrollTop%r.height:i.scrollTop+=r.height-i.scrollTop%r.height)},_handleFlyoutFocus:function(){this._textBoxHasFocus||this._flyoutHasFocus||(this._webRequest&&(this._webRequest.get_executor().abort(),this._webRequest=null),this._hideCompletionList())},_onLostFocus:function(){this._textBoxHasFocus=!1;this._timer.set_enabled(!1);window.setTimeout(Function.createDelegate(this,this._handleFlyoutFocus),500)},_onMethodComplete:function(n,t){this._webRequest=null;this._update(t,n,!0)},_onMethodFailed:function(){this._webRequest=null},_onTimerTick:function(n,t){var i,t,r;if(this._timer.set_enabled(!1),this._servicePath&&this._serviceMethod){if(i=this._currentCompletionWord(),i.trim().length0&&f-r>c-l?un.getTicks()?1:this._ticks0?this._layoutRequested=!0:this._performLayout()},_buildCalendar:function(){var t=this.get_element(),n=this.get_id();this._container=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_container"},cssClasses:[this._cssClass],visible:!1},t.parentNode);this._popupDiv=$common.createElementFromTemplate({nodeName:"div",events:this._popup$delegates,properties:{id:n+"_popupDiv"},cssClasses:["ajax__calendar_container"]},this._container)},_buildHeader:function(){var n=this.get_id(),t,i,r;this._header=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_header"},cssClasses:["ajax__calendar_header"]},this._popupDiv);t=$common.createElementFromTemplate({nodeName:"div"},this._header);this._prevArrow=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_prevArrow",mode:"prev"},events:this._cell$delegates,cssClasses:["ajax__calendar_prev"]},t);i=$common.createElementFromTemplate({nodeName:"div"},this._header);this._nextArrow=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_nextArrow",mode:"next"},events:this._cell$delegates,cssClasses:["ajax__calendar_next"]},i);r=$common.createElementFromTemplate({nodeName:"div"},this._header);this._title=$common.createElementFromTemplate({nodeName:"div",properties:{id:n+"_title",mode:"title"},events:this._cell$delegates,cssClasses:["ajax__calendar_title"]},r)},_buildBody:function(){this._body=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_body"},cssClasses:["ajax__calendar_body"]},this._popupDiv);this._buildDays();this._buildMonths();this._buildYears()},_buildFooter:function(){var n=$common.createElementFromTemplate({nodeName:"div"},this._popupDiv);this._today=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_today",mode:"today"},events:this._cell$delegates,cssClasses:["ajax__calendar_footer","ajax__calendar_today"]},n)},_buildDays:function(){var t=(Sys.CultureInfo.CurrentCulture.dateTimeFormat,this.get_id()),n,u,r,i;for(this._days=$common.createElementFromTemplate({nodeName:"div",properties:{id:t+"_days"},cssClasses:["ajax__calendar_days"]},this._body),this._modes.days=this._days,this._daysTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:t+"_daysTable",style:{margin:"auto"}}},this._days),this._daysTableHeader=$common.createElementFromTemplate({nodeName:"thead",properties:{id:t+"_daysTableHeader"}},this._daysTable),this._daysTableHeaderRow=$common.createElementFromTemplate({nodeName:"tr",properties:{id:t+"_daysTableHeaderRow"}},this._daysTableHeader),n=0;n<7;n++)i=$common.createElementFromTemplate({nodeName:"td"},this._daysTableHeaderRow),$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_dayname"]},i);for(this._daysBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:t+"_daysBody"}},this._daysTable),n=0;n<6;n++)for(u=$common.createElementFromTemplate({nodeName:"tr"},this._daysBody),r=0;r<7;r++)i=$common.createElementFromTemplate({nodeName:"td"},u),$common.createElementFromTemplate({nodeName:"div",properties:{mode:"day",id:t+"_day_"+n+"_"+r,innerHTML:" "},events:this._cell$delegates,cssClasses:["ajax__calendar_day"]},i)},_buildMonths:function(){var f=Sys.CultureInfo.CurrentCulture.dateTimeFormat,i=this.get_id(),n,r,t,u;for(this._months=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_months"},cssClasses:["ajax__calendar_months"],visible:!1},this._body),this._modes.months=this._months,this._monthsTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:i+"_monthsTable",style:{margin:"auto"}}},this._months),this._monthsBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:i+"_monthsBody"}},this._monthsTable),n=0;n<3;n++)for(r=$common.createElementFromTemplate({nodeName:"tr"},this._monthsBody),t=0;t<4;t++)u=$common.createElementFromTemplate({nodeName:"td"},r),$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_month_"+n+"_"+t,mode:"month",month:4*n+t,innerHTML:"
"+f.AbbreviatedMonthNames[4*n+t]},events:this._cell$delegates,cssClasses:["ajax__calendar_month"]},u)},_buildYears:function(){var i=this.get_id(),n,r,t,u;for(this._years=$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_years"},cssClasses:["ajax__calendar_years"],visible:!1},this._body),this._modes.years=this._years,this._yearsTable=$common.createElementFromTemplate({nodeName:"table",properties:{id:i+"_yearsTable",style:{margin:"auto"}}},this._years),this._yearsBody=$common.createElementFromTemplate({nodeName:"tbody",properties:{id:i+"_yearsBody"}},this._yearsTable),n=0;n<3;n++)for(r=$common.createElementFromTemplate({nodeName:"tr"},this._yearsBody),t=0;t<4;t++)u=$common.createElementFromTemplate({nodeName:"td"},r),$common.createElementFromTemplate({nodeName:"div",properties:{id:i+"_year_"+n+"_"+t,mode:"year",year:4*n+t-1},events:this._cell$delegates,cssClasses:["ajax__calendar_year"]},u)},_isInDateRange:function(n,t,i){var r,u;switch(t){case"d":if(this._startDate&&this._getDateOnly(n)this._getDateOnly(this._endDate))return!1;break;case"M":if(this._startDate&&this._getMonthOnly(n)this._getMonthOnly(this._endDate))return!1;break;case"y":if(this._startDate&&n.getFullYear()this._endDate.getFullYear())return!1;break;case"yy":return this._startDate&&this._endDate?this._isInYearsDateRange(n,i):!this._startDate&&!this._endDate?!0:(r=this._getRangeStartYear(n),this._endDate&&rthis._startDate.getFullYear()))}return!0},_isInYearsDateRange:function(n,t){var i=this._getRangeStartYear(n),r=this._getRangeEndYear(n);switch(t){case Sys.Extended.UI.CalendarSwitchViewMode.PreviousRange:return r>this._startDate.getFullYear();case Sys.Extended.UI.CalendarSwitchViewMode.NextRange:return ithis._startDate.getFullYear()&&rn?($common.setLocation(r,{x:-162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(r),this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_endValue(0),$common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(i),this._modeChangeMoveBottomOrRightAnimation.set_startValue(0),this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width)):($common.setLocation(i,{x:0,y:0}),$common.setVisible(i,!0),this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left"),this._modeChangeMoveTopOrLeftAnimation.set_target(i),this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width),this._modeChangeMoveTopOrLeftAnimation.set_startValue(0),$common.setLocation(r,{x:162,y:0}),$common.setVisible(r,!0),this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left"),this._modeChangeMoveBottomOrRightAnimation.set_target(r),this._modeChangeMoveBottomOrRightAnimation.set_endValue(0),this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width));this._visibleDate=n;this.invalidate();u=Function.createDelegate(this,function(){this._body.removeChild(i);i=null;this._isAnimating=!1;this._modeChangeAnimation.remove_ended(u)});this._modeChangeAnimation.add_ended(u);this._modeChangeAnimation.play()},_canSwitchMonth:function(n,t){switch(this._mode){case"days":if(!this._isInDateRange(n,"M",t))return!1;break;case"months":if(!this._isInDateRange(n,"y",t))return!1;break;case"years":if(!this._isInDateRange(n,"yy",t))return!1}return!0},_switchMode:function(n,t){var u;if(!this._isAnimating&&this._mode!=n){var f=this._modeOrder[this._mode]this._endDate?n=this._endDate:this._startDate&&n1:n>0},_setOptions:function(n,t,i){var r,s,h,o,f,e,u,v;if(this.get_isInitialized()){if(r=this.get_element(),this._clearItems(),h="",i&&this._loadingText?(s=this._loadingText,this._selectedValue&&(h=this._selectedValue)):!i&&n&&0==n.length&&null!=this._emptyText?(s=this._emptyText,this._emptyValue&&(h=this._emptyValue)):this._promptText&&(s=this._promptText,this._promptValue&&(h=this._promptValue)),s&&(o=new Option(s,h),r.options[r.options.length]=o),f=null,e=-1,n){for(u=0;u0)?t||f||i||this.set_selectedValue("",""):this.set_selectedValue(r.options[0].value,r.options[0].text):(r.options[e].selected=!0,this.set_selectedValue(r.options[e].value,r.options[e].text)),r.childDropDown&&!i)for(u=0;u1&&(i-=1),i<1/6?n+6*(t-n)*i:i<.5?t:i<2/3?n+(t-n)*(2/3-i)*6:n},_createColorCell:function(n,t){var i="#"+n,r=$common.createElementFromTemplate({nodeName:"td"},t);$common.createElementFromTemplate({nodeName:"div",properties:{color:n,title:i,style:{backgroundColor:i},innerHTML:" "},events:this._cell$delegates},r)},_ensureColorPicker:function(){if(!this._container){var n=this.get_element();this._buildColorPicker();this._buildColors();this._popupBehavior=new $create(Sys.Extended.UI.PopupBehavior,{parentElement:n},{},{},this._popupDiv);this._popupBehavior.set_positioningMode(this._popupPosition)}},_showSample:function(n){if(this._sample){var t="";n&&(t="#"+n);this._sample.style.backgroundColor=t}},_restoreSample:function(){this._showSample(this._selectedColor)},_validate:function(n){return n&&Sys.Extended.UI.ColorPickerBehavior._colorRegex.test(n)},_element_onfocus:function(){this._enabled&&(this._button||(this.show(),this._popupMouseDown=!1))},_element_onblur:function(){this._enabled&&(this._button||this._doBlur())},_element_onchange:function(){if(!this._selectedColorChanging){var n=this._textbox.get_Value();(this._validate(n)||""===n)&&(this._selectedColor=n,this._restoreSample())}},_element_onkeypress:function(n){this._enabled&&(this._button||n.charCode!==Sys.UI.Key.esc||(n.stopPropagation(),n.preventDefault(),this.hide()))},_element_onclick:function(){this._enabled&&(this._button||(this.show(),this._popupMouseDown=!1))},_popup_onevent:function(n){n.stopPropagation();n.preventDefault()},_popup_onmousedown:function(){this._popupMouseDown=!0},_popup_onmouseup:function(){Sys.Browser.agent===Sys.Browser.Opera&&this._blur.get_isPending()&&this._blur.cancel();this._popupMouseDown=!1;this._focus()},_cell_onmouseover:function(n){n.stopPropagation();var t=n.target;this._showSample(t.color)},_cell_onmouseout:function(n){n.stopPropagation();this._restoreSample()},_cell_onclick:function(n){if(n.stopPropagation(),n.preventDefault(),this._enabled){var t=n.target;this.set_selectedColor(t.color);this._blur.post(!0);this.raise_colorSelectionChanged()}},_button_onclick:function(n){n.preventDefault();n.stopPropagation();this._enabled&&(this._isOpen?this.hide():this.show(),this._focus(),this._popupMouseDown=!1)},_button_onblur:function(){this._enabled&&(this._popupMouseDown||this.hide(),this._popupMouseDown=!1)},_button_onkeypress:function(n){this._enabled&&(n.charCode===Sys.UI.Key.esc&&(n.stopPropagation(),n.preventDefault(),this.hide()),this._popupMouseDown=!1)}},Sys.Extended.UI.ColorPickerBehavior.registerClass("Sys.Extended.UI.ColorPickerBehavior",Sys.Extended.UI.BehaviorBase),Sys.Extended.UI.ColorPickerPaletteStyle={Default:0,Continuous:1},Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.ComboBoxAutoCompleteMode=function(){},Sys.Extended.UI.ComboBoxAutoCompleteMode.prototype={None:0,Append:1,Suggest:2,SuggestAppend:3},Sys.Extended.UI.ComboBoxAutoCompleteMode.registerEnum("Sys.Extended.UI.ComboBoxAutoCompleteMode",!1),Sys.Extended.UI.ComboBoxStyle=function(){},Sys.Extended.UI.ComboBoxStyle.prototype={DropDownList:0,DropDown:1,Simple:2},Sys.Extended.UI.ComboBoxStyle.registerEnum("Sys.Extended.UI.ComboBoxStyle",!1),Sys.Extended.UI.ComboBoxTextSelectionStrategy=function(){},Sys.Extended.UI.ComboBoxTextSelectionStrategy.prototype={Unknown:0,Microsoft:1,W3C:2},Sys.Extended.UI.ComboBoxTextSelectionStrategy.registerEnum("Sys.Extended.UI.ComboBoxTextSelectionStrategy",!1),Sys.Extended.UI.ComboBox=function(n){Sys.Extended.UI.ComboBox.initializeBase(this,[n]);this._comboTableControl=null;this._textBoxControl=null;this._optionListControl=null;this._buttonControl=null;this._hiddenFieldControl=null;this._autoPostBack=!1;this._autoCompleteMode=null;this._dropDownStyle=null;this._caseSensitive=!1;this._originalSelectedIndex=null;this._listItemHoverCssClass=null;this._popupBehavior=null;this._supressFocusHide=!0;this._doingPostBack=!1;this._textSelectionStrategy=null;this._highlightSuggestedItem=!1;this._highlightedIndex=null;this._optionListItems=null;this._optionListItemHeight=null;this._optionListHeight=null;this._optionListWidth=null;this.clearDelegates()},Sys.Extended.UI.ComboBox.prototype={initialize:function(){Sys.Extended.UI.ComboBox.callBaseMethod(this,"initialize");ComboBox_Elements[ComboBox_Elements.length]=this;var t,i,n=this._findHiddenParent(this.get_comboTableControl());null!=n&&(t=n.style.display,i=n.style.visibility,n.style.visibility="visible",n.style.display="block");this.createDelegates();this.initializeTextBox();this.initializeButton();this.initializeOptionList();this.addHandlers();null!=n&&(n.style.visibility=i,n.style.display=t)},dispose:function(){this._popupBehavior&&(this._popupBehavior.remove_showing(this._popupShowingHandler),this._popupBehavior.remove_shown(this._popupShownHandler),this._popupBehavior.remove_hiding(this._popupHidingHandler),this._popupBehavior.dispose(),this._popupBehavior=null);this.clearHandlers();this.clearDelegates();Sys.Extended.UI.ComboBox.callBaseMethod(this,"dispose")},_findHiddenParent:function(n){var t=n.parentElement;return null==t||"hidden"==t.style.visibility||"none"==t.style.display?t:this._findHiddenParent(t)},createDelegates:function(){this._listMouseOverHandler=Function.createDelegate(this,this._onListMouseOver);this._listMouseOutHandler=Function.createDelegate(this,this._onListMouseOut);this._listMouseDownHandler=Function.createDelegate(this,this._onListMouseDown);this._listClickHandler=Function.createDelegate(this,this._onListClick);this._listDragHandler=Function.createDelegate(this,this._onListDrag);this._listSelectStartHandler=Function.createDelegate(this,this._onListSelectStart);this._listMouseWheelHandler=Function.createDelegate(this,this._onListMouseWheel);this._textBoxClickHandler=Function.createDelegate(this,this._onTextBoxClick);this._textBoxFocusHandler=Function.createDelegate(this,this._onTextBoxFocus);this._textBoxBlurHandler=Function.createDelegate(this,this._onTextBoxBlur);this._textBoxKeyPressHandler=Function.createDelegate(this,this._onTextBoxKeyPress);this._textBoxKeyDownHandler=Function.createDelegate(this,this._onTextBoxKeyDown);this._buttonClickHandler=Function.createDelegate(this,this._onButtonClick);this._buttonBlurHandler=Function.createDelegate(this,this._onButtonBlur);this._buttonKeyDownHandler=Function.createDelegate(this,this._onButtonKeyDown);this._buttonKeyPressHandler=Function.createDelegate(this,this._onButtonKeyPress);this._documentClickHandler=Function.createDelegate(this,this._onDocumentClick);this._documentMouseWheelHandler=Function.createDelegate(this,this._onDocumentMouseWheel);this._popupShowingHandler=Function.createDelegate(this,this._popupShowing);this._popupShownHandler=Function.createDelegate(this,this._popupShown);this._popupHidingHandler=Function.createDelegate(this,this._popupHiding)},clearDelegates:function(){this._listMouseOverHandler=null;this._listMouseOutHandler=null;this._listMouseDownHandler=null;this._listClickHandler=null;this._listDragHandler=null;this._listSelectStartHandler=null;this._listMouseWheelHandler=null;this._textBoxClickHandler=null;this._textBoxFocusHandler=null;this._textBoxBlurHandler=null;this._textBoxKeyPressHandler=null;this._textBoxKeyDownHandler=null;this._buttonClickHandler=null;this._buttonBlurHandler=null;this._buttonKeyDownHandler=null;this._buttonKeyPressHandler=null;this._documentClickHandler=null;this._documentMouseWheelHandler=null;this._popupShowingHandler=null;this._popupShownHandler=null;this._popupHidingHandler=null},addHandlers:function(){var n=this.get_optionListControl();$addHandlers(n,{mouseover:this._listMouseOverHandler,mouseout:this._listMouseOutHandler,mousedown:this._listMouseDownHandler,click:this._listClickHandler,drag:this._listDragHandler,selectstart:this._listSelectStartHandler},this);$addHandlers(this.get_textBoxControl(),{click:this._textBoxClickHandler,focus:this._textBoxFocusHandler,blur:this._textBoxBlurHandler,keypress:this._textBoxKeyPressHandler,keydown:this._textBoxKeyDownHandler},this);$addHandlers(this.get_buttonControl(),{click:this._buttonClickHandler,blur:this._buttonBlurHandler,keydown:this._buttonKeyDownHandler,keypress:this._buttonKeyPressHandler},this);$addHandler(document,"click",this._documentClickHandler);"undefined"==typeof n.onmousewheel?($addHandler(n,"DOMMouseScroll",this._listMouseWheelHandler),$addHandler(document,"DOMMouseScroll",this._documentMouseWheelHandler)):($addHandler(n,"mousewheel",this._listMouseWheelHandler),$addHandler(document,"mousewheel",this._documentMouseWheelHandler))},clearHandlers:function(){$clearHandlers(this.get_optionListControl());$clearHandlers(this.get_textBoxControl());$clearHandlers(this.get_buttonControl());$clearHandlers(document)},initializeTextBox:function(){var n=this.get_textBoxControl().style;""==n.margin&&(n.margin="0px")},initializeButton:function(){var n=this.get_buttonControl().style;""==n.height&&this.get_textBoxControl().offsetHeight>=0&&(n.height=this.get_textBoxControl().offsetHeight+"px");""==n.width&&(n.width=n.height);""==n.padding&&(n.padding="0px")},initializeOptionList:function(){var h,t,c,r,o,u,l,f,i,e;if(null==this.get_optionListControl()&&(h=document.createElement("ul"),this.get_element().appendChild(h),this.set_optionListControl(h)),t=this.get_optionListControl(),Sys.Browser.agent===Sys.Browser.Safari){for(c=t.parentNode,null!=c&&c.removeChild(t),r=this.get_element().parentNode;typeof r!=typeof document.forms[0];)r=r.parentNode;o=document.createElement("div");o.className=this.get_element().className;o.appendChild(t);r.appendChild(o)}for(u=t.style,u.display="block",u.zIndex=Sys.Extended.UI.zIndex.ComboBoxList,this._optionListItems=[],l=t.childNodes,f=0;f=0;)n=n.substring(0,s).trim()+" "+n.substring(s+1,n.length).trim(),s=n.indexOf("\r");for(e=n.indexOf("\n");e>=0;)n=n.substring(0,e).trim()+" "+n.substring(e+1,n.length).trim(),e=n.indexOf("\n");n=n.replace(/\&/g,"&").replace(/\"/g,'"').replace(/\>/g,">").replace(/\</g,"<");a.text=n.trim();Array.add(this._optionListItems,a);this.initializeOptionListItem(i)}else t.removeChild(i),f--;u.width=this._getOptionListBounds().width+"px";u.width="0px";this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"_PopupBehavior",parentElement:this.get_textBoxControl(),positioningMode:Sys.Extended.UI.PositioningMode.BottomLeft},null,null,t);this._popupBehavior.add_showing(this._popupShowingHandler);this._popupBehavior.add_shown(this._popupShownHandler);this._popupBehavior.add_hiding(this._popupHidingHandler);this.get_selectedIndex()>=0?(this._highlightListItem(this.get_selectedIndex()),this.get_textBoxControl().value=this._optionListItems[this.get_selectedIndex()].text):this.get_textBoxControl().value="";this._popupShowing();t.style.display="none"},initializeOptionListItem:function(n){n._textIsEmpty=!1;n.innerHTML.length<1&&(n.innerHTML=" ",n._textIsEmpty=!0)},_popupShowing:function(){var t=this._getWindowBounds(),i=Sys.UI.DomElement.getBounds(this.get_comboTableControl()),c=this._getOptionListBounds(),a=t.y+t.height/2,v=i.y+i.height,y=t.x+t.width/2,p=i.x+i.width/2,r=i.y-t.y,s="Top",h,n,e,f,u,o;v<=a&&(s="Bottom",r=t.height-i.height-r);h=this._getOptionListItemHeight();r=r>=c.height?c.height:h*(Math.floor(r/h)-2);var w=r/h,l=w=f&&(n=f)):n>=f&&(n=f);"Right"==e&&n=1?1:-1:n.rawEvent.wheelDelta>1?-1:1,this.get_optionListControl().scrollTop+=this._getOptionListItemHeight()*t,n.stopPropagation(),n.preventDefault(),!1},_onListMouseOver:function(n){var i=this.get_optionListControl();if(n.target!==i)for(var u=n.target,r=i.childNodes,t=0;t=0?(this.set_selectedIndex(this._highlightedIndex),this.get_textBoxControl().value=this._optionListItems[this.get_selectedIndex()].text):n==-3&&i.length>0&&this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.DropDownList?this.set_selectedIndex(-2):this._optionListItems.length<1&&(""==i||this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList)?(this.set_selectedIndex(-1),this.get_textBoxControl().value=""):this._optionListItems.length>=0&&n==-3&&this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList?(this.set_selectedIndex(0),this.get_textBoxControl().value=this._optionListItems[0].text):n>=0&&(this.set_selectedIndex(n),this.get_textBoxControl().value=this._optionListItems[n].text);this._popupBehavior.hide();1!=this.get_autoPostBack()||this._doingPostBack||this._originalSelectedIndex==this.get_selectedIndex()||(this._doingPostBack=!0,__doPostBack(this.get_element().id,""))},_onTextBoxKeyDown:function(n){var i=this._handleEnterKey(n),t;return null!=i?i:(this._handleArrowKey(n),t=this._handleErasureKeys(n),null==t||t)},_onTextBoxKeyPress:function(n){var c=this._handleEnterKey(n),e,o,f,h;if(null!=c)return c;if(e=this._handleArrowKey(n),null!=e)return e;if(o=this._handleNonCharacterKey(n),null!=o)return o;if(this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.Simple||this._popupBehavior._visible||this._popupBehavior.show(),this.get_selectedIndex()==-1&&this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDownList&&0==this._optionListItems.length)return this.get_textBoxControl().value="",n.preventDefault(),n.stopPropagation(),!1;var t=this._getTextSelectionInfo(this.get_textBoxControl(),n),r=t.selectionStart,u=t.selectionEnd,l=t.selectionPrefix+t.typedCharacter+t.selectionText.substring(1)+t.selectionSuffix,i=t.selectionPrefix+t.typedCharacter,s=this.get_textBoxControl().maxLength;return s<0&&(s=Number.MAX_VALUE),i.length>s&&(i=i.substring(0,this.get_textBoxControl().maxLength)),f=this._suggestIndex(l,i),this.get_autoCompleteMode()!=Sys.Extended.UI.ComboBoxAutoCompleteMode.Suggest&&this.get_autoCompleteMode()!=Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend||(this._highlightSuggestedItem=!0,this._popupBehavior._visible||this._popupBehavior.show()),f>=0?this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.Append||this.get_autoCompleteMode()==Sys.Extended.UI.ComboBoxAutoCompleteMode.SuggestAppend?(this.get_textBoxControl().value=this._optionListItems[f].text,r=t.selectionStart+1,u=this.get_textBoxControl().value.length):(this.get_textBoxControl().value=this._optionListItems[f].text.substring(0,i.length),r=this.get_textBoxControl().value.length,u=this.get_textBoxControl().value.length):this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.Simple&&this.get_dropDownStyle()!=Sys.Extended.UI.ComboBoxStyle.DropDown||(this.get_textBoxControl().value=i,r=i.length,u=i.length),h=this._handleErasureKeys(n),null!=h?h:(this._ensureHighlightedIndex(),this._ensureScrollTop(),this._setTextSelectionRange(this.get_textBoxControl(),r,u),n.preventDefault(),n.stopPropagation(),!1)},_onDocumentClick:function(){this._popupBehavior._visible&&this._popupBehavior.hide()},_onDocumentMouseWheel:function(){return this._popupBehavior&&this._popupBehavior.hide(),!0},_handleTextBoxFocus:function(n){!this._supressFocusHide&&this._popupBehavior._visible&&(this._popupBehavior.hide(),this._supressFocusHide=!0,this.get_autoPostBack()&&!this._doingPostBack&&this._originalSelectedIndex!=this.get_selectedIndex()&&(this._doingPostBack=!0,__doPostBack(this.get_element().id,"")));this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.Simple&&this._popupBehavior.show();this._setTextSelectionRange(this.get_textBoxControl(),0,this.get_textBoxControl().value.length);null!=n&&(n.preventDefault(),n.stopPropagation())},_highlightListItem:function(n,t){if(void 0==n||n<0)return void(void 0!=this._highlightedIndex&&this._highlightedIndex>=0&&this._highlightListItem(this._highlightedIndex,!1));var r=this.get_optionListControl().childNodes,i=r[n];if(1==t){if(this._highlightedIndex==n)return;n>=0&&(void 0==this.get_listItemHoverCssClass()||""==this.get_listItemHoverCssClass()?(i.style.backgroundColor="Highlight",i.style.color="HighlightText"):i.className=this.get_listItemHoverCssClass());null!=this._highlightedIndex&&this._highlightedIndex!=n&&this._highlightedIndex>=0&&this._highlightListItem(this._highlightedIndex,!1);this._highlightedIndex=n}else void 0==this.get_listItemHoverCssClass()||""==this.get_listItemHoverCssClass()?(i.style.backgroundColor="",i.style.color=""):i.className="",n==this._highlightedIndex&&(this._highlightedIndex=-1)},_suggestIndex:function(n,t){for(var e,o,f=-1,i=!1,u=!1,r=0;r0||1==i&&this._highlightedIndex=0&&(this.get_textBoxControl().value=this._optionListItems[this._highlightedIndex].text,this.set_selectedIndex(this._highlightedIndex),this.get_autoPostBack()&&__doPostBack(this.get_element().id,"")),this._popupBehavior.hide(),n.preventDefault(),n.stopPropagation(),!1):this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.Simple||this.get_dropDownStyle()==Sys.Extended.UI.ComboBoxStyle.DropDown||this._highlightedIndex==this.get_selectedIndex()||(n.preventDefault(),n.stopPropagation(),!1):null},_handleErasureKeys:function(n){var o=this._getKeyboardCode(n),s=o==Sys.UI.Key.backspace,f=o==Sys.UI.Key.del,r,u,t,i,e,h;return("undefined"==typeof event&&"keypress"==n.type&&(f=46==n.rawEvent.keyCode),s||f)?(t=this._getTextSelectionInfo(this.get_textBoxControl(),n),t.selectionStart0?(e=1,8==t.selectionPrefix.charCodeAt(t.selectionPrefix.length-1)&&(e=2),i=t.selectionPrefix.substr(0,t.selectionPrefix.length-e),i+=t.selectionSuffix,this.get_textBoxControl().value=i,r=t.selectionStart-1,u=t.selectionStart-1):f&&t.selectionStart=0)&&(h=this._isExactMatch(this._optionListItems[this._highlightedIndex].text,this.get_textBoxControl().value),h||this._highlightListItem(this._highlightedIndex,!1)),n.preventDefault(),n.stopPropagation(),!1):null},_handleNonCharacterKey:function(n){var t=this._getKeyboardCode(n),r=t==Sys.UI.Key.backspace,i=t==Sys.UI.Key.del;return"keypress"==n.type&&(i=46==n.rawEvent.code),r||i?null:this._isNonCharacterKey(n)?t!=Sys.UI.Key.esc||(this._popupBehavior.hide(),this.get_textBoxControl().blur(),n.preventDefault(),n.stopPropagation(),!1):null},_isNonCharacterKey:function(n){var t=this._getKeyboardCode(n);if(t==Sys.UI.Key.enter||t==Sys.UI.Key.esc)return!0;if(Sys.Browser.agent==Sys.Browser.Safari&&Sys.Browser.version<500){if(8==t||9==t||63272==t||63276==t||63277==t||63275==t||63273==t||63234==t||63235==t||t>=63236&&t<=63243||63248==t)return!0}else if(Sys.Browser.agent!=Sys.Browser.InternetExplorer)if(8==t||9==t||33==t||34==t||35==t||36==t||37==t||39==t||45==t||46==t){if(!n.shiftKey)return!0}else{if(145==t||19==t)return!0;if(Sys.Browser.agent==Sys.Browser.Opera){if(0==t||16==t||17==t)return!0}else if(Sys.Browser.agent==Sys.Browser.Firefox&&(91==t||92==t||93==t))return!0}else if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&46==t)return!0;return!1},_ensureScrollTop:function(){var n=this.get_optionListControl();if(this._highlightedIndex>=0){var t=this._getOptionListItemHeight(),i=t*this._highlightedIndex,r=n.scrollTop+n.clientHeight;(i<=n.scrollTop||i>=r)&&(n.scrollTop=this._highlightedIndex*t)}},_ensureSelectedIndex:function(){var n=this.get_hiddenFieldControl().value;""==n&&(n=this._optionListItems.length>0?0:-1,this.get_hiddenFieldControl().value=n.toString());null==this._originalSelectedIndex&&(this._originalSelectedIndex=parseInt(n))},_ensureHighlightedIndex:function(){var t=this.get_textBoxControl().value,r;if(!(null!=this._highlightedIndex&&this._highlightedIndex>=0&&this._isExactMatch(this._optionListItems[this._highlightedIndex].text,t))){for(var i=-1,u=!1,n=0;n=i.selectionStart?i.textBoxValue.substring(0,i.selectionStart):"",i.selectionText=i.textBoxValue.length>=i.selectionEnd?i.textBoxValue.substring(i.selectionStart,i.selectionEnd):"",i.selectionSuffix=i.textBoxValue.length>=i.selectionEnd?i.textBoxValue.substring(i.selectionEnd,i.textBoxValue.length):"",i.selectionTextFirst=i.selectionText.substring(0,1),i},_getOptionListItemHeight:function(){var n=this.get_optionListControl();return null==this._optionListItemHeight&&n.scrollHeight>0?this._optionListItemHeight=Math.round(n.scrollHeight/this._optionListItems.length):Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7&&Math.round(n.scrollHeight/this._optionListItems.length)0&&(this._scrollDeltaX=this._scrollDeltaY=0,t.clientXn.width-this._scrollEdgeConst&&(this._scrollDeltaX=this._scrollByConst),t.clientYn.height-this._scrollEdgeConst&&(this._scrollDeltaY=this._scrollByConst),0!=this._scrollDeltaX||0!=this._scrollDeltaY?this._scroller.set_enabled(!0):this._scroller.set_enabled(!1))},_onScrollerTick:function(){var t=document.body.scrollLeft,i=document.body.scrollTop;window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);var r=document.body.scrollLeft,u=document.body.scrollTop,n=this._activeDragVisual,f={x:parseInt(n.style.left)+(r-t),y:parseInt(n.style.top)+(u-i)};$common.setLocation(n,f)}},Sys.Extended.UI.GenericDragDropManager.registerClass("Sys.Extended.UI.GenericDragDropManager",Sys.Extended.UI.IEDragDropManager),Sys.Extended.UI.FloatingBehavior=function(n){function o(n){window._event=n;var t=this.get_element();this.checkCanDrag(n.target)&&(u=$common.getLocation(t),n.preventDefault(),this.startDragDrop(t))}Sys.Extended.UI.FloatingBehavior.initializeBase(this,[n]);var i,t,u,f,e,r=Function.createDelegate(this,o);this.add_move=function(n){this.get_events().addHandler("move",n)};this.remove_move=function(n){this.get_events().removeHandler("move",n)};this.get_handle=function(){return i};this.set_handle=function(n){null!=i&&$removeHandler(i,"mousedown",r);i=n;$addHandler(i,"mousedown",r)};this.get_profileProperty=function(){return f};this.set_profileProperty=function(n){f=n};this.get_profileComponent=function(){return e};this.set_profileComponent=function(n){e=n};this.get_location=function(){return t};this.set_location=function(n){t!=n&&(t=n,this.get_isInitialized()&&$common.setLocation(this.get_element(),t),this.raisePropertyChanged("location"))};this.initialize=function(){Sys.Extended.UI.FloatingBehavior.callBaseMethod(this,"initialize");Sys.Extended.UI.DragDropManager.registerDropTarget(this);var n=this.get_element();t||(t=$common.getLocation(n));n.style.position="fixed";$common.setLocation(n,t)};this.dispose=function(){Sys.Extended.UI.DragDropManager.unregisterDropTarget(this);i&&r&&$removeHandler(i,"mousedown",r);r=null;Sys.Extended.UI.FloatingBehavior.callBaseMethod(this,"dispose")};this.checkCanDrag=function(n){var t=n.tagName;return!("a"==t.toLowerCase()&&null!=n.href&&n.href.length>0)&&!(Array.indexOf(["input","button","select","textarea","label"],t.toLowerCase())>-1)};this.get_dragDataType=function(){return"_floatingObject"};this.getDragData=function(){return null};this.get_dragMode=function(){return Sys.Extended.UI.DragMode.Move};this.onDragStart=function(){};this.onDrag=function(){};this.onDragEnd=function(n){var i,r,f;n||(i=this.get_events().getHandler("move"),i&&(r=new Sys.CancelEventArgs,i(this,r),n=r.get_cancel()));f=this.get_element();n?$common.setLocation(f,u):(t=$common.getLocation(f),this.raisePropertyChanged("location"))};this.startDragDrop=function(n){Sys.Extended.UI.DragDropManager.startDragDrop(this,n,null)};this.get_dropTargetElement=function(){return document.body};this.canDrop=function(n,t){return"_floatingObject"==t};this.drop=function(){};this.onDragEnterTarget=function(){};this.onDragLeaveTarget=function(){};this.onDragInTarget=function(){}},Sys.Extended.UI.FloatingBehavior.registerClass("Sys.Extended.UI.FloatingBehavior",Sys.Extended.UI.BehaviorBase,Sys.Extended.UI.IDragSource,Sys.Extended.UI.IDropTarget,Sys.IDisposable),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.HoverBehavior=function(n){Sys.Extended.UI.HoverBehavior.initializeBase(this,[n]);this._elementHandlers=null;this._hoverElementHandlers=null;this._hoverElement=null;this._hoverCount=0;this._unhoverDelay=0;this._hoverDelay=0;this._hoverScript=null;this._unhoverScript=null;this._hoverFired=!1},Sys.Extended.UI.HoverBehavior.prototype={_setupHandlersArray:function(){var n=[];return n[0]=Function.createDelegate(this,this._onHover),n[1]=Function.createDelegate(this,this._onUnhover),n},get_elementHandlers:function(){return this._elementHandlers||(this._elementHandlers=this._setupHandlersArray()),this._elementHandlers},get_hoverElementHandlers:function(){return this._hoverElementHandlers||(this._hoverElementHandlers=this._setupHandlersArray()),this._hoverElementHandlers},get_hoverElement:function(){return this._hoverElement},set_hoverElement:function(n){n!=this._hoverElement&&(this._hoverElement&&this._setupHandlers(this._hoverElement,this.get_hoverElementHandlers(),!1),this._hoverElement=n,this._hoverElement&&this._setupHandlers(this._hoverElement,this.get_hoverElementHandlers(),!0))},get_hoverDelay:function(){return this._hoverDelay},set_hoverDelay:function(n){this._hoverDelay=n;this.raisePropertyChanged("hoverDelay")},get_hoverScript:function(){return this._hoverScript},set_hoverScript:function(n){this._hoverScript=n},get_unhoverDelay:function(){return this._unhoverDelay},set_unhoverDelay:function(n){this._unhoverDelay=n;this.raisePropertyChanged("unhoverDelay")},get_unhoverScript:function(){return this._unhoverScript},set_unhoverScript:function(n){this._unhoverScript=n},dispose:function(){var t=this.get_element(),n;this._elementHandlers&&(n=this.get_elementHandlers(),this._setupHandlers(t,n,!1),this._elementHandlers=null);this._hoverElement&&(n=this.get_hoverElementHandlers(),this._setupHandlers(this._hoverElement,n,!1),this._hoverElement=null);Sys.Extended.UI.HoverBehavior.callBaseMethod(this,"dispose")},initialize:function(){Sys.Extended.UI.HoverBehavior.callBaseMethod(this,"initialize");var n=this.get_elementHandlers();this._setupHandlers(this.get_element(),n,!0);this._hoverElement&&(n=this.get_hoverElementHandlers(),this._setupHandlers(this._hoverElement,n,!0))},add_hover:function(n){this.get_events().addHandler("hover",n)},remove_hover:function(n){this.get_events().removeHandler("hover",n)},_fireHover:function(){if(this._hoverCount&&!this._hoverFired){var handler=this.get_events().getHandler("hover");handler&&handler(this,Sys.EventArgs.Empty);this._hoverScript&&eval(this._hoverScript);this._hoverFired=!0}},_onHover:function(){this._hoverCount++;this._hoverDelay?window.setTimeout(Function.createDelegate(this,this._fireHover),this._hoverDelay):this._fireHover()},add_unhover:function(n){this.get_events().addHandler("unhover",n)},remove_unhover:function(n){this.get_events().removeHandler("unhover",n)},_fireUnhover:function(){if(this._hoverFired&&!this._hoverCount){this._hoverFired=!1;var handler=this.get_events().getHandler("unhover");handler&&handler(this,Sys.EventArgs.Empty);this._unhoverScript&&eval(this._unhoverScript)}},_onUnhover:function(){this._hoverCount--;this._hoverCount<=0&&(this._hoverCount=0,this._unhoverDelay?window.setTimeout(Function.createDelegate(this,this._fireUnhover),this._unhoverDelay):this._fireUnhover())},_setupHandlers:function(n,t,i){this.get_isInitialized()&&n&&(i?($addHandler(n,"mouseover",t[0]),$addHandler(n,"focus",t[0]),$addHandler(n,"mouseout",t[1]),$addHandler(n,"blur",t[1])):($removeHandler(n,"mouseover",t[0]),$removeHandler(n,"focus",t[0]),$removeHandler(n,"mouseout",t[1]),$removeHandler(n,"blur",t[1])))}},Sys.Extended.UI.HoverBehavior.descriptor={properties:[{name:"hoverElement",isDomElement:!0},{name:"unhoverDelay",type:Number}],events:[{name:"hover"},{name:"unhover"}]},Sys.Extended.UI.HoverBehavior.registerClass("Sys.Extended.UI.HoverBehavior",Sys.Extended.UI.BehaviorBase),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.DropDownBehavior=function(n){Sys.Extended.UI.DropDownBehavior.initializeBase(this,[n]);this._dropDownControl=null;this._highlightBorderColor="#2353B2";this._highlightBackgroundColor="#FFF3DB";this._dropArrowBackgroundColor="#C6E1FF";this._dropArrowImageUrl=null;this._dropArrowWidth="16px";this._oldBackgroundColor=null;this._dropFrame=null;this._dropArrow=null;this._dropArrowImage=null;this._dropWrapper=null;this._isOpen=!1;this._isOver=!1;this._wasClicked=null;this._dropWrapperHoverBehavior=null;this._dropPopupPopupBehavior=null;this._onShowJson=null;this._onHideJson=null;this._dropDownControl$delegates={click:Function.createDelegate(this,this._dropDownControl_onclick),contextmenu:Function.createDelegate(this,this._dropDownControl_oncontextmenu)};this._dropFrame$delegates={click:Function.createDelegate(this,this._dropFrame_onclick),contextmenu:Function.createDelegate(this,this._dropFrame_oncontextmenu)};this._dropWrapper$delegates={click:Function.createDelegate(this,this._dropWrapper_onclick),contextmenu:Function.createDelegate(this,this._dropWrapper_oncontextmenu)};this._document$delegates={click:Function.createDelegate(this,this._document_onclick),contextmenu:Function.createDelegate(this,this._document_oncontextmenu)};this._dropWrapperHoverBehavior$delegates={hover:Function.createDelegate(this,this._dropWrapperHoverBehavior_onhover),unhover:Function.createDelegate(this,this._dropWrapperHoverBehavior_onunhover)}},Sys.Extended.UI.DropDownBehavior.prototype={initialize:function(){var n,t,i;Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"initialize");n=this.get_element();t=n.parentNode;null==this._dropDownControl&&$common.createElementFromTemplate({parent:t,nameTable:this,name:"_dropDownControl",nodeName:"div",visible:!1,cssClasses:this._dropDownControl?null:["ajax__dropdown_panel"],properties:{__GENERATED:!0}});$addHandlers(this._dropDownControl,this._dropDownControl$delegates);i={};this._dropArrowImageUrl&&(i.src=this._dropArrowImageUrl);$common.createElementFromTemplate({parent:t,nameTable:this,name:"_dropFrame",nodeName:"span",visible:!1,children:[{name:"_dropFrameTop",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameRight",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameBottom",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropFrameLeft",nodeName:"div",cssClasses:["ajax__dropdown_frame_line"]},{name:"_dropArrow",nodeName:"div",cssClasses:this._dropArrowImageUrl?["ajax__dropdown_arrow"]:["ajax__dropdown_arrow","ajax__dropdown_arrow_image"],properties:{style:{width:this._dropArrowWidth,backgroundColor:this._dropArrowBackgroundColor}},events:this._dropFrame$delegates,children:[{name:"_dropArrowWrapper",nodeName:"div",visible:!!this._dropArrowImageUrl,cssClasses:["ajax__dropdown_arrow_wrapper"],children:[{name:"_dropArrowImage",nodeName:"img",properties:i}]}]}]});$common.createElementFromTemplate({parent:null,nameTable:this,name:"_dropWrapper",nodeName:"span",properties:{id:n.id+"_dropWrapper",style:{cursor:"default"}},events:this._dropWrapper$delegates,content:n});this._dropPopupPopupBehavior=$create(Sys.Extended.UI.PopupBehavior,{positioningMode:Sys.Extended.UI.PositioningMode.BottomRight,parentElement:n,y:-1},null,null,this._dropDownControl);this._onShowJson&&this._dropPopupPopupBehavior.set_onShow(this._onShowJson);this._onHideJson&&this._dropPopupPopupBehavior.set_onHide(this._onHideJson);this._dropWrapperHoverBehavior=$create(Sys.Extended.UI.HoverBehavior,{hoverElement:this._dropFrame},this._dropWrapperHoverBehavior$delegates,null,this._dropWrapper);$addHandlers(document,this._document$delegates)},dispose:function(){var n=this.get_element();this._isOpen&&(this.hide(),this.unhover(),this._isOpen=!1);$common.removeHandlers(document,this._document$delegates);this._onShowJson=null;this._onHideJson=null;this._dropPopupPopupBehavior&&(this._dropPopupPopupBehavior.dispose(),this._dropPopupPopupBehavior=null);this._dropWrapperHoverBehavior&&(this._dropWrapperHoverBehavior.dispose(),this._dropWrapperHoverBehavior=null);this._dropFrame&&($common.removeElement(this._dropFrame),this._dropFrame=null,this._dropFrameTop=null,this._dropFrameRight=null,this._dropFrameBottom=null,this._dropFrameLeft=null,this._dropArrow=null,this._dropArrowWrapper=null,this._dropArrowImage=null);this._dropWrapper&&($common.removeHandlers(this._dropWrapper,this._dropWrapper$delegates),$common.unwrapElement(n,this._dropWrapper),this._dropWrapper=null);this._dropDownControl&&($common.removeHandlers(this._dropDownControl,this._dropDownControl$delegates),this._dropDownControl.__GENERATED&&$common.removeElement(this._dropDownControl),this._dropDownControl=null);Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"dispose")},hover:function(){var t=this.get_element(),n,i,r;this._isOver||(this._isOver=!0,this.raiseHoverOver(Sys.EventArgs.Empty),n=$common.getBounds(t),$common.setLocation(this._dropFrame,{x:0,y:0}),$common.setVisible(this._dropFrame,!0),i=$common.getLocation(this._dropFrame),$common.setVisible(this._dropFrame,!1),n.x-=i.x,n.y-=i.y,$common.setBounds(this._dropFrameTop,{x:n.x,y:n.y,width:n.width,height:1}),$common.setBounds(this._dropFrameRight,{x:n.x+n.width-1,y:n.y,width:1,height:n.height}),$common.setBounds(this._dropFrameBottom,{x:n.x,y:n.y+n.height-1,width:n.width,height:1}),$common.setBounds(this._dropFrameLeft,{x:n.x,y:n.y,width:1,height:n.height}),$common.setBounds(this._dropArrow,{x:n.x+n.width-17,y:n.y+1,width:16,height:n.height-2}),this._dropFrameTop.style.backgroundColor=this._highlightBorderColor,this._dropFrameRight.style.backgroundColor=this._highlightBorderColor,this._dropFrameBottom.style.backgroundColor=this._highlightBorderColor,this._dropFrameLeft.style.backgroundColor=this._highlightBorderColor,$common.setVisible(this._dropFrame,!0),this._oldBackgroundColor||(this._oldBackgroundColor=$common.getCurrentStyle(t,"backgroundColor")),r=/\d{0,3},\s*\d{0,3},\s*\d{0,3}/,t.style.backgroundColor=r.test(this._highlightBackgroundColor)?"rgb("+this._highlightBackgroundColor+")":this._highlightBackgroundColor)},unhover:function(){var n=this.get_element();!this._isOver&&this._isOpen||(this._isOver=!1,this._isOpen||($common.setVisible(this._dropFrame,!1),this._oldBackgroundColor?(n.style.backgroundColor=this._oldBackgroundColor,this._oldBackgroundColor=null):n.style.backgroundColor="transparent"),this.raise_hoverOut(Sys.EventArgs.Empty))},show:function(){if(!this._isOpen){this.hover();var n=new Sys.CancelEventArgs;if(this.raise_showing(n),this.raise_popup(n),n.get_cancel())return;this._isOpen=!0;this.populate();(!this._dynamicPopulateBehavior||this._dynamicPopulateBehavior._populated&&this._cacheDynamicResults)&&this._showPopup()}},_showPopup:function(){this._dropPopupPopupBehavior.show();this.raise_shown(Sys.EventArgs.Empty)},hide:function(){if(this._isOpen){var n=new Sys.CancelEventArgs;if(this.raise_hiding(n),n.get_cancel())return;this._isOpen=!1;this._dropPopupPopupBehavior.hide();this.raise_hidden(Sys.EventArgs.Empty)}},_dropWrapperHoverBehavior_onhover:function(){this.hover()},_dropWrapperHoverBehavior_onunhover:function(){this.unhover()},_dropWrapper_onclick:function(n){"A"!=n.target.tagName&&(this._isOpen?this.hide():this.show(),this._wasClicked=!0)},_dropWrapper_oncontextmenu:function(n){"A"!=n.target.tagName&&(this._wasClicked=!0,n.preventDefault(),this.show())},_dropFrame_onclick:function(){this._isOpen?this.hide():this.show();this._wasClicked=!0},_dropFrame_oncontextmenu:function(n){this._wasClicked=!0;n.preventDefault();this.show()},_dropDownControl_onclick:function(){},_dropDownControl_oncontextmenu:function(n){this._wasClicked=!0;n.preventDefault()},_document_onclick:function(){this._wasClicked?this._wasClicked=!1:this._isOpen&&(this.hide(),this.unhover())},_document_oncontextmenu:function(){this._wasClicked?this._wasClicked=!1:this._isOpen&&(this.hide(),this.unhover())},_onPopulated:function(n,t){Sys.Extended.UI.DropDownBehavior.callBaseMethod(this,"_onPopulated",[n,t]);this._isOpen&&this._showPopup()},get_onShow:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onShow():this._onShowJson},set_onShow:function(n){this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.set_onShow(n):this._onShowJson=n;this.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onShowBehavior():null},onShow:function(){this._dropPopupPopupBehavior&&this._dropPopupPopupBehavior.onShow()},get_onHide:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onHide():this._onHideJson},set_onHide:function(n){this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.set_onHide(n):this._onHideJson=n;this.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._dropPopupPopupBehavior?this._dropPopupPopupBehavior.get_onHideBehavior():null},onHide:function(){this._dropPopupPopupBehavior&&this._dropPopupPopupBehavior.onHide()},get_dropDownControl:function(){return this._dropDownControl},set_dropDownControl:function(n){this._dropDownControl!=n&&(this._dropDownControl=n,this.raisePropertyChanged("dropDownControl"))},get_highlightBorderColor:function(){return this._highlightBorderColor},set_highlightBorderColor:function(n){this._highlightBorderColor!=n&&(this._highlightBorderColor=n,this.raisePropertyChanged("highlightBorderColor"))},get_highlightBackgroundColor:function(){return this._highlightBackgroundColor},set_highlightBackgroundColor:function(n){this._highlightBackgroundColor!=n&&(this._highlightBackgroundColor=n,this.get_isInitialized()&&this._isOpen&&(this._dropWrapper.style.backgroundColor=n),this.raisePropertyChanged("highlightBackgroundColor"))},get_dropArrowBackgroundColor:function(){return this._dropArrowBackgroundColor},set_dropArrowBackgroundColor:function(n){this._dropArrowBackgroundColor!=n&&(this._dropArrowBackgroundColor=n,this.get_isInitialized()&&(this._dropArrow.style.backgroundColor=n),this.raisePropertyChanged("dropArrowBackgroundColor"))},get_dropArrowImageUrl:function(){return this._dropArrowImageUrl},set_dropArrowImageUrl:function(n){this._dropArrowImageUrl!=n&&(this._dropArrowImageUrl=n,this.get_isInitialized()&&(this._dropArrow.className&&(this._dropArrow.className="",this._dropArrowWrapper.style.display="block"),this._dropArrowImage.src=n),this.raisePropertyChanged("dropArrowImageUrl"))},get_dropArrowWidth:function(){return this._dropArrowWidth},set_dropArrowWidth:function(n){this._dropArrowWidth!=n&&(this._dropArrowWidth=n,this.get_isInitialized()&&(this._dropArrow.style.width=n),this.raisePropertyChanged("dropArrowWidth"))},get_isOver:function(){return this._isOver},get_isOpen:function(){return this._isOpen},add_showing:function(n){this.get_events().addHandler("showing",n)},remove_showing:function(n){this.get_events().removeHandler("showing",n)},raise_showing:function(n){var t=this.get_events().getHandler("showing");t&&t(this,n)},raiseShowing:function(n){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)");this.raise_showing(n)},add_shown:function(n){this.get_events().addHandler("shown",n)},remove_shown:function(n){this.get_events().removeHandler("shown",n)},raise_shown:function(n){var t=this.get_events().getHandler("shown");t&&t(this,n)},raiseShown:function(n){Sys.Extended.Deprecated("raiseShown(eventArgs)","raise_shown(eventArgs)");this.raise_shown(n)},add_popup:function(n){this.get_events().addHandler("popup",n)},remove_popup:function(n){this.get_events().removeHandler("popup",n)},raise_popup:function(n){var t=this.get_events().getHandler("popup");t&&t(this,n)},raisePopup:function(n){Sys.Extended.Deprecated("raisePopup(eventArgs)","raise_popup(eventArgs)");this.raise_popup(n)},add_hiding:function(n){this.get_events().addHandler("hiding",n)},remove_hiding:function(n){this.get_events().removeHandler("hiding",n)},raise_hiding:function(n){var t=this.get_events().getHandler("hiding");t&&t(this,n)},raiseHiding:function(n){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)");this.raise_hiding(n)},add_hidden:function(n){this.get_events().addHandler("hidden",n)},remove_hidden:function(n){this.get_events().removeHandler("hidden",n)},raise_hidden:function(n){var t=this.get_events().getHandler("hidden");t&&t(this,n)},raiseHidden:function(n){Sys.Extended.Deprecated("raiseHidden(eventArgs)","raise_hidden(eventArgs)");this.raise_hidden(n)},add_hoverOver:function(n){this.get_events().addHandler("hoverOver",n)},remove_hoverOver:function(n){this.get_events().removeHandler("hoverOver",n)},raise_hoverOver:function(n){var t=this.get_events().getHandler("hoverOver");t&&t(this,n)},raiseHoverOver:function(n){Sys.Extended.Deprecated("raiseHoverOver(eventArgs)","raise_hoverOver(eventArgs)");this.raise_hoverOver(n)},add_hoverOut:function(n){this.get_events().addHandler("hoverOut",n)},remove_hoverOut:function(n){this.get_events().removeHandler("hoverOut",n)},raise_hoverOut:function(n){var t=this.get_events().getHandler("hoverOut");t&&t(this,n)},raiseHoverOut:function(n){Sys.Extended.Deprecated("raiseHoverOut(eventArgs)","raise_hoverOut(eventArgs)");this.raise_hoverOut(n)}},Sys.Extended.UI.DropDownBehavior.registerClass("Sys.Extended.UI.DropDownBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BoxCorners=function(){throw Error.invalidOperation();},Sys.Extended.UI.BoxCorners.prototype={None:0,TopLeft:1,TopRight:2,BottomRight:4,BottomLeft:8,Top:3,Right:6,Bottom:12,Left:9,All:15},Sys.Extended.UI.BoxCorners.registerEnum("Sys.Extended.UI.BoxCorners",!0),Sys.Extended.UI.RoundedCornersBehavior=function(n){Sys.Extended.UI.RoundedCornersBehavior.initializeBase(this,[n]);this._corners=Sys.Extended.UI.BoxCorners.All;this._radius=5;this._color=null;this._parentDiv=null;this._originalStyle=null;this._borderColor=null;this._isDirty=!0},Sys.Extended.UI.RoundedCornersBehavior.prototype={initialize:function(){Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"initialize");this.update()},dispose:function(){this.disposeParentDiv();Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"dispose")},update:function(){var n=this.get_element(),h,r,u;if(n&&this._isDirty&&!this.get_isUpdating())if(this.disposeParentDiv(),void 0!=n.style.borderRadius)n.style.borderRadius=this._radius+"px",this._borderColor?(n.style.border="solid",n.style.borderWidth="1px",n.style.borderColor=this._borderColor):(n.style.border="none",n.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(n.style.borderTopLeftRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(n.style.borderBottomLeftRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(n.style.borderTopRightRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(n.style.borderBottomRightRadius="0");else if(void 0!=n.style.MozBorderRadius)n.style.MozBorderRadius=this._radius+"px",this._borderColor?(n.style.border="solid",n.style.borderWidth="1px",n.style.borderColor=this._borderColor):(n.style.border="none",n.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(n.style.MozBorderRadiusTopleft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(n.style.MozBorderRadiusBottomleft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(n.style.MozBorderRadiusTopright="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(n.style.MozBorderRadiusBottomright="0");else if(void 0!=n.style.WebkitBorderRadius)n.style.WebkitBorderRadius=this._radius+"px",this._borderColor?(n.style.border="solid",n.style.borderWidth="1px",n.style.borderColor=this._borderColor):(n.style.border="none",n.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(n.style.WebkitBorderRadiusTopLeft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(n.style.WebkitBorderRadiusBottomLeft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(n.style.WebkitBorderRadiusTopRight="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(n.style.WebkitBorderRadiusBottomRight="0");else{var v=this.getBackgroundColor(),c=n.offsetWidth,t=n.cloneNode(!1);this.moveChildren(n,t);this._originalStyle=n.style.cssText;n.style.backgroundColor="transparent";n.style.verticalAlign="top";n.style.padding="0";n.style.overflow="";n.style.className="";n.style.height&&"auto"!=n.style.height?n.style.height=parseInt($common.getCurrentStyle(n,"height"))+2*this._radius+"px":!n.style.width&&00;e--){var y=Math.acos(e/s),o=s-Math.round(Math.sin(y)*s),i=document.createElement("DIV");(i.__roundedDiv=!0,i.style.backgroundColor=v,i.style.marginLeft=o+"px",i.style.marginRight=o-(this._borderColor?2:0)+"px",i.style.height="1px",i.style.fontSize="1px",i.style.overflow="hidden",this._borderColor)&&(i.style.borderLeftStyle="solid",i.style.borderRightStyle="solid",i.style.borderLeftColor=this._borderColor,i.style.borderRightColor=this._borderColor,h=Math.max(0,a-o-1),i.style.borderLeftWidth=h+1+"px",i.style.borderRightWidth=h+1+"px",e==l&&(i.__roundedDivNoBorder=!0,i.style.backgroundColor=this._borderColor));n.insertBefore(i,f);r=i;i=i.cloneNode(!0);i.__roundedDiv=!0;n.insertBefore(i,f);u=i;f=i;a=o;this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(r.style.marginLeft="0",this._borderColor&&(r.style.borderLeftWidth="1px"));this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(r.style.marginRight="0",this._borderColor&&(r.style.borderRightWidth="1px",r.style.marginRight="-2px"));this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(u.style.marginLeft="0",this._borderColor&&(u.style.borderLeftWidth="1px"));this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(u.style.marginRight="0",this._borderColor&&(u.style.borderRightWidth="1px",u.style.marginRight="-2px"))}n.insertBefore(t,f);this._parentDiv=t;this._isDirty=!1}},disposeParentDiv:function(){var n;if(this._parentDiv){for(var t=this.get_element(),r=t.childNodes,i=r.length-1;i>=0;i--)if(n=r[i],n){n==this._parentDiv&&this.moveChildren(n,t);try{t.removeChild(n)}catch(t){}}this._originalStyle&&(t.style.cssText=this._originalStyle,this._originalStyle=null);this._parentDiv=null}},getBackgroundColor:function(){return this._color?this._color:$common.getCurrentStyle(this.get_element(),"backgroundColor")},moveChildren:function(n,t){for(var i,r=0;n.hasChildNodes();)i=n.childNodes[0],i=n.removeChild(i),t.appendChild(i),r++;return r},isCornerSet:function(n){return(this._corners&n)!=Sys.Extended.UI.BoxCorners.None},setCorner:function(n,t){t?this.set_corners(this._corners|n):this.set_corners(this._corners&~n)},get_color:function(){return this._color},set_color:function(n){n!=this._color&&(this._color=n,this._isDirty=!0,this.update(),this.raisePropertyChanged("color"))},get_Color:function(){return Sys.Extended.Deprecated("get_Color()","get_color()"),this.get_color()},set_Color:function(n){Sys.Extended.Deprecated("set_Color(value)","set_color(value)");this.set_color(n)},get_radius:function(){return this._radius},set_radius:function(n){n!=this._radius&&(this._radius=n,this._isDirty=!0,this.update(),this.raisePropertyChanged("radius"))},get_Radius:function(){return Sys.Extended.Deprecated("get_Radius()","get_radius()"),this.get_radius()},set_Radius:function(n){Sys.Extended.Deprecated("set_Radius(value)","set_radius(value)");this.set_radius(n)},get_corners:function(){return this._corners},set_corners:function(n){n!=this._corners&&(this._corners=n,this._isDirty=!0,this.update(),this.raisePropertyChanged("corners"))},get_Corners:function(){return Sys.Extended.Deprecated("get_Corners()","get_corners()"),this.get_corners()},set_Corners:function(n){Sys.Extended.Deprecated("set_Corners(value)","set_corners(value)");this.set_corners(n)},get_borderColor:function(){return this._borderColor},set_borderColor:function(n){n!=this._borderColor&&(this._borderColor=n,this._isDirty=!0,this.update(),this.raisePropertyChanged("borderColor"))},get_BorderColor:function(){return Sys.Extended.Deprecated("get_BorderColor()","get_borderColor()"),this.get_borderColor()},set_BorderColor:function(n){Sys.Extended.Deprecated("set_BorderColor(value)","set_borderColor(value)");this.set_borderColor(n)}},Sys.Extended.UI.RoundedCornersBehavior.registerClass("Sys.Extended.UI.RoundedCornersBehavior",Sys.Extended.UI.BehaviorBase),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.DropShadowBehavior=function(n){Sys.Extended.UI.DropShadowBehavior.initializeBase(this,[n]);this._opacity=1;this._width=5;this._shadowDiv=null;this._trackPosition=null;this._trackPositionDelay=50;this._timer=null;this._tickHandler=null;this._roundedBehavior=null;this._shadowRoundedBehavior=null;this._rounded=!1;this._radius=5;this._lastX=null;this._lastY=null;this._lastW=null;this._lastH=null},Sys.Extended.UI.DropShadowBehavior.prototype={initialize:function(){Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this,"initialize");e=this.get_element();"absolute"!=$common.getCurrentStyle(e,"position",e.style.position)&&(e.style.position="relative");this._rounded&&this.setupRounded();this._trackPosition&&this.startTimer();this.setShadow()},dispose:function(){this.stopTimer();this.disposeShadowDiv();Sys.Extended.UI.DropShadowBehavior.callBaseMethod(this,"dispose")},buildShadowDiv:function(){if(e=this.get_element(),this.get_isInitialized()&&e&&this._width&&void 0==e.style.boxShadow&&void 0==e.style.MozBoxShadow&&void 0==e.style.WebkitBoxShadow){var n=document.createElement("DIV");n.style.backgroundColor="black";n.style.position="absolute";e.id&&(n.id=e.id+"_DropShadow");this._shadowDiv=n;e.parentNode.appendChild(n);this._rounded?(this._shadowDiv.style.height=Math.max(0,e.offsetHeight-2*this._radius)+"px",this._shadowRoundedBehavior?this._shadowRoundedBehavior.set_radius(this._radius):this._shadowRoundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,{Radius:this._radius},null,null,this._shadowDiv)):this._shadowRoundedBehavior&&this._shadowRoundedBehavior.set_radius(0);1!=this._opacity&&this.setupOpacity();this.setShadow(!1,!0);this.updateZIndex()}},disposeShadowDiv:function(){this._shadowDiv&&(this._shadowDiv.parentNode&&this._shadowDiv.parentNode.removeChild(this._shadowDiv),this._shadowDiv=null);this._shadowRoundedBehavior&&(this._shadowRoundedBehavior.dispose(),this._shadowRoundedBehavior=null)},onTimerTick:function(){this.setShadow()},startTimer:function(){this._timer||(this._tickHandler||(this._tickHandler=Function.createDelegate(this,this.onTimerTick)),this._timer=new Sys.Timer,this._timer.set_interval(this._trackPositionDelay),this._timer.add_tick(this._tickHandler),this._timer.set_enabled(!0))},stopTimer:function(){this._timer&&(this._timer.remove_tick(this._tickHandler),this._timer.set_enabled(!1),this._timer.dispose(),this._timer=null)},setShadow:function(n,t){var u,i,f,r,o;(e=this.get_element(),this.get_isInitialized()&&e&&(this._width||n))&&(void 0==e.style.boxShadow&&void 0==e.style.MozBoxShadow&&void 0==e.style.WebkitBoxShadow?(u=this._shadowDiv,u||this.buildShadowDiv(),i={x:e.offsetLeft,y:e.offsetTop},(n||this._lastX!=i.x||this._lastY!=i.y||!u)&&(this._lastX=i.x,this._lastY=i.y,r=this.get_width(),i.x+=r,i.y+=r,$common.setLocation(this._shadowDiv,i)),f=e.offsetHeight,r=e.offsetWidth,!n&&f==this._lastH&&r==this._lastW&&u||(this._lastW=r,this._lastH=f,this._rounded&&u&&!t?(this.disposeShadowDiv(),this.setShadow()):(this._shadowDiv.style.width=r+"px",this._shadowDiv.style.height=f+"px")),this._shadowDiv&&(this._shadowDiv.style.visibility=$common.getCurrentStyle(e,"visibility"))):(o=".25"==this._opacity?this._width+"px "+this._width+"px "+this._width+"px #D3D3D3":".5"==this._opacity?this._width+"px "+this._width+"px "+this._width+"px #778899":".75"==this._opacity?this._width+"px "+this._width+"px "+this._width+"px #808080":this._width+"px "+this._width+"px "+this._width+"px #000",void 0!=e.style.boxShadow?e.style.boxShadow=o:void 0!=e.style.MozBoxShadow?e.style.MozBoxShadow=o:void 0!=e.style.WebkitBoxShadow&&(e.style.WebkitBoxShadow=o)))},setupOpacity:function(){this.get_isInitialized()&&this._shadowDiv&&$common.setElementOpacity(this._shadowDiv,this._opacity)},setupRounded:function(){!this._roundedBehavior&&this._rounded&&(this._roundedBehavior=$create(Sys.Extended.UI.RoundedCornersBehavior,null,null,null,this.get_element()));this._roundedBehavior&&this._roundedBehavior.set_radius(this._rounded?this._radius:0)},updateZIndex:function(){if(this._shadowDiv){var i=this.get_element(),n=i.style.zIndex,t=this._shadowDiv.style.zIndex;t&&n&&n>t||(n=Math.max(2,n),t=n-1,i.style.zIndex=n,this._shadowDiv.style.zIndex=t)}},updateRoundedCorners:function(){this.get_isInitialized()&&(this.setupRounded(),this.disposeShadowDiv(),this.setShadow())},get_opacity:function(){return this._opacity},set_opacity:function(n){this._opacity!=n&&(this._opacity=n,this.setShadow(),this.setupOpacity(),this.raisePropertyChanged("opacity"))},get_Opacity:function(){return Sys.Extended.Deprecated("get_Opacity","get_opacity"),this.get_opacity()},set_Opacity:function(n){Sys.Extended.Deprecated("set_Opacity","set_opacity");this.set_opacity(n)},get_rounded:function(){return this._rounded},set_rounded:function(n){n!=this._rounded&&(this._rounded=n,this.updateRoundedCorners(),this.raisePropertyChanged("rounded"))},get_Rounded:function(){return Sys.Extended.Deprecated("get_Rounded","get_rounded"),this.get_rounded()},set_Rounded:function(n){Sys.Extended.Deprecated("set_Rounded","set_rounded");this.set_rounded(n)},get_radius:function(){return this._radius},set_radius:function(n){n!=this._radius&&(this._radius=n,this.updateRoundedCorners(),this.raisePropertyChanged("radius"))},get_Radius:function(){return Sys.Extended.Deprecated("get_Radius","get_radius"),this.get_radius()},set_Radius:function(n){Sys.Extended.Deprecated("set_Radius","set_radius");this.set_radius(n)},get_width:function(){return this._width},set_width:function(n){n!=this._width&&(this._width=n,this._shadowDiv&&$common.setVisible(this._shadowDiv,n>0),this.setShadow(!0),this.raisePropertyChanged("width"))},get_Width:function(){return Sys.Extended.Deprecated("get_Width","get_width"),this.get_width()},set_Width:function(n){Sys.Extended.Deprecated("set_Width","set_width");this.set_width(n)},get_trackPositionDelay:function(){return this._trackPositionDelay},set_trackPositionDelay:function(n){n!=this._trackPositionDelay&&(this._trackPositionDelay=n,e||(e=this.get_element()),void 0==e.style.boxShadow&&void 0==e.style.MozBoxShadow&&void 0==e.style.WebkitBoxShadow&&(this._trackPosition&&(this.stopTimer(),this.startTimer()),this.raisePropertyChanged("trackPositionDelay")))},get_TrackPositionDelay:function(){return Sys.Extended.Deprecated("get_TrackPositionDelay","get_trackPositionDelay"),this.get_trackPositionDelay()},set_TrackPositionDelay:function(n){Sys.Extended.Deprecated("set_TrackPositionDelay","set_trackPositionDelay");this.set_trackPositionDelay(n)},get_trackPosition:function(){return this._trackPosition},set_trackPosition:function(n){n!=this._trackPosition&&(this._trackPosition=n,e||(e=this.get_element()),void 0==e.style.boxShadow&&void 0==e.style.MozBoxShadow&&void 0==e.style.WebkitBoxShadow&&(this.get_element()&&(n?this.startTimer():this.stopTimer()),this.raisePropertyChanged("trackPosition")))},get_TrackPosition:function(){return Sys.Extended.Deprecated("get_TrackPosition","get_trackPosition"),this.get_trackPosition()},set_TrackPosition:function(n){Sys.Extended.Deprecated("set_TrackPosition","set_trackPosition");this.set_trackPosition(n)}},Sys.Extended.UI.DropShadowBehavior.registerClass("Sys.Extended.UI.DropShadowBehavior",Sys.Extended.UI.BehaviorBase),Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.FilteredTextBoxBehavior=function(n){Sys.Extended.UI.FilteredTextBoxBehavior.initializeBase(this,[n]);this._keypressHandler=null;this._changeHandler=null;this._intervalID=null;this._filterType=Sys.Extended.UI.FilterTypes.Custom;this._filterMode=Sys.Extended.UI.FilterModes.ValidChars;this._validChars=null;this._invalidChars=null;this._filterInterval=250;this.charTypes={};this.charTypes.LowercaseLetters="abcdefghijklmnopqrstuvwxyz";this.charTypes.UppercaseLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";this.charTypes.Numbers="0123456789"},Sys.Extended.UI.FilteredTextBoxBehavior.prototype={initialize:function(){var n,t;Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(this,"initialize");n=this.get_element();this._keypressHandler=Function.createDelegate(this,this._onkeypress);$addHandler(n,"keypress",this._keypressHandler);this._changeHandler=Function.createDelegate(this,this._onchange);$addHandler(n,"change",this._changeHandler);t=Function.createDelegate(this,this._intervalCallback);this._intervalID=window.setInterval(t,this._filterInterval)},dispose:function(){var n=this.get_element();$removeHandler(n,"keypress",this._keypressHandler);this._keypressHandler=null;$removeHandler(n,"change",this._changeHandler);this._changeHandler=null;window.clearInterval(this._intervalID);Sys.Extended.UI.FilteredTextBoxBehavior.callBaseMethod(this,"dispose")},_getValidChars:function(){if(this._validChars)return this._validChars;this._validChars="";for(type in this.charTypes){var n=Sys.Extended.UI.FilterTypes.toString(this._filterType);n.indexOf(type)!=-1&&(this._validChars+=this.charTypes[type])}return this._validChars},_getInvalidChars:function(){return this._invalidChars||(this._invalidChars=this.charTypes.Custom),this._invalidChars},_onkeypress:function(n){var t,i;if((0!=n.rawEvent.charCode&&(n.rawEvent.keyCode!=n.rawEvent.which||void 0!=n.rawEvent.charCode)||n.rawEvent.keyCode!=Sys.UI.Key.pageUp&&n.rawEvent.keyCode!=Sys.UI.Key.pageDown&&n.rawEvent.keyCode!=Sys.UI.Key.up&&n.rawEvent.keyCode!=Sys.UI.Key.down&&n.rawEvent.keyCode!=Sys.UI.Key.left&&n.rawEvent.keyCode!=Sys.UI.Key.right&&n.rawEvent.keyCode!=Sys.UI.Key.home&&n.rawEvent.keyCode!=Sys.UI.Key.end&&46!=n.rawEvent.keyCode)&&!n.ctrlKey){if("keyIdentifier"in n.rawEvent){if(n.rawEvent.ctrlKey||n.rawEvent.altKey||n.rawEvent.metaKey)return;if(t=n.rawEvent.charCode,63272==t)return}else t=n.charCode;t&&t>=32&&(i=String.fromCharCode(t),this._processKey(i)||n.preventDefault())}},_processKey:function(n){var t="",i=!1,r;return this._filterMode==Sys.Extended.UI.FilterModes.ValidChars?(t=this._getValidChars(),i=t&&t.length>0&&t.indexOf(n)==-1):(t=this._getInvalidChars(),i=t&&t.length>0&&t.indexOf(n)>-1),r=new Sys.Extended.UI.FilteredTextBoxProcessKeyEventArgs(n,Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_Value(),i),this.raise_processKey(r),!!r.get_allowKey()||(this.raise_filtered(new Sys.Extended.UI.FilteredTextBoxEventArgs(n)),!1)},_onchange:function(){for(var r,t=Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()),u=t.get_Value()||"",i=new Sys.StringBuilder,n=0;n"===this._editableDiv.innerHTML&&(n="");void 0!=this._sourceViewDiv.textContent?this._sourceViewDiv.textContent=this.cleanHtml(n):this._sourceViewDiv.innerText=this.cleanHtml(n)},cleanHtml:function(n){return n.replace(/
/g,"
")},_btnCancel_click:function(){this._popupBehavior.hide()},_rgbToHex:function(n){var t=/rgb\s?\(\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?\)/.exec(n);return"#"+(parseInt(t[3],10)|parseInt(t[2],10)<<8|parseInt(t[1],10)<<16).toString(16)},_encodeHtml:function(){var u=Sys.Browser.agent==Sys.Browser.InternetExplorer,n=(this._editableDiv.getElementsByTagName("*"),this._editableDiv.innerHTML),i,r,t;return u&&(i=/\<[^\>]+\>/g,n=n.replace(i,function(n){var t="",i="";return"]*)/g,n.replace(t,'="$1"').replace(i,"=$1")):n})),r=this._rgbToHex,t=function(){n=n.replace(/(\<[^\>]+)(rgb\s?\(\d{1,3}\s?\,\s?\d{1,3}\s?\,\s?\d{1,3}\s?\))([^\>]*\>)/gi,function(n,t,i,u){return(t||"")+(i&&r(i)||"")+(u||"")})},t(),t(),n=n.replace(/\sclass\=\"\"/gi,"").replace(/\sid\=\"\"/gi,""),n=n.replace(/\<(\/?)strong\>/gi,"<$1b>").replace(/\<(\/?)em\>/gi,"<$1i>"),n=n.replace(/&(?!g|lt;)/gi,"&").replace(/\xA0/gi," "),n=n.replace(//gi,">").replace(/\'/gi,"'").replace(/\"/gi,""")},_editableDiv_submit:function(){this._textbox._element.value=this._encodeHtml()},_isHtmlElement:function(n){return n instanceof HTMLElement},isValidTarget:function(n){return void 0!=n.name&&""!=n.name&&"select"!=n.tagName.toLowerCase()},isSimpleTextDecoration:function(n){return!!n&&("bold"==n.toLowerCase()||"italic"==n.toLowerCase()||"underline"==n.toLowerCase())},_executeCommand:function(n){var i,s,c,t,f,v,e,u,o,y,p;if(this.isValidTarget(n.target)){if(i=this._getSelection(),null!=i&&(s=this._isDescendantOrSelf(this._editableDiv,i.commonAncestorContainer),!s))return;var w=Sys.Browser.agent==Sys.Browser.Firefox,b=Sys.Browser.agent==Sys.Browser.Safari,k=Sys.Browser.agent==Sys.Browser.InternetExplorer||null==Sys.Browser.agent,h=Function.createDelegate(this,this._colorPicker_onchange);if(this.isSimpleTextDecoration(n.target.name)||this._executeStyleWithCssCommand(),c={JustifyRight:1,JustifyLeft:1,JustifyCenter:1,JustifyFull:1,Outdent:1},c[n.target.name])try{document.execCommand(n.target.name,!1,null)}catch(i){if(i&&2147500037==i.result){var l=window.getSelection().getRangeAt(0),r=document.createElement("div"),a=!1;for(r.style.height="1px;","true"==l.startContainer.contentEditable&&(window.getSelection().collapseToEnd(),a=!0),t=window.getSelection().getRangeAt(0).startContainer;t&&"true"!=t.contentEditable;)t=t.parentNode;if(!t)throw"Selected node is not editable!";t.insertBefore(r,t.childNodes[0]);document.execCommand(n.target.name,!1,null);r.parentNode.removeChild(r);a&&window.getSelection().addRange(l)}else window.console&&window.console.log&&window.console.log(i)}else if("createLink"==n.target.name)f=prompt("Please insert URL",""),f&&document.execCommand("createLink",!1,f);else if("ForeColor"==n.target.name)this._commandName=n.target.name,this.saveSelection(),this._foreColorPicker||(this._foreColorPicker=$create(Sys.Extended.UI.ColorPickerBehavior,{},{},{},this._foreColor),this._foreColorPicker.set_sample(this._foreColor.parentNode),this._foreColorPicker.add_colorSelectionChanged(h)),this._foreColorPicker.show();else if("BackColor"==n.target.name)this._commandName=n.target.name,this.saveSelection(),this._backColorPicker||(this._backColorPicker=$create(Sys.Extended.UI.ColorPickerBehavior,{},{},{},this._backColor),this._backColorPicker.set_sample(this._backColor.parentNode),this._backColorPicker.add_colorSelectionChanged(h)),this._backColorPicker.show();else if("UnSelect"==n.target.name)w?(this._editableDiv.focus(),v=window.getSelection(),v.collapse(this._editableDiv.firstChild,0)):document.execCommand(n.target.name,!1,null);else if("InsertImage"==n.target.name){for(this._isFocusInEditableDiv||this._editableDiv.focus(),this.saveSelection(),e=Sys.Application.getComponents(),u=0;u
'+y+"<\/div><\/blockquote>",document.execCommand("insertHTML",!1,p)):"InsertHorizontalRule"==n.target.name&&b?document.execCommand("insertHTML",!1,"
"):document.execCommand(n.target.name,!1,null)}},_colorPicker_onchange:function(n){this.restoreSelection();this.setColor(this._commandName,"#"+n._selectedColor)},setColor:function(n,t){if(/backcolor/i.test(n)){var i=Sys.Browser.agent==Sys.Browser.Firefox;i?(document.execCommand("stylewithcss",!1,!0),document.execCommand("hilitecolor",!1,t),document.execCommand("stylewithcss",!1,!1)):document.execCommand("backcolor",!1,t)}else document.execCommand("stylewithcss",!1,!0),document.execCommand(n,!1,t)},saveSelection:function(){this instanceof Sys.Extended.UI.HtmlEditorExtenderBehavior&&(this._savedRange=this._getSelection())},_getSelection:function(){return window.getSelection?window.getSelection().rangeCount&&window.getSelection().getRangeAt(0):document.selection?document.selection.createRange():null},_getSelectionHtml:function(){var n,t,r,i;return window.getSelection?((n=window.getSelection(),n.getRangeAt)?t=n.getRangeAt(0):(t=document.createRange(),t.setStart(n.anchorNode,n.anchorOffset),t.setEnd(n.focusNode,n.focusOffset)),r=t.cloneContents(),i=document.createElement("div"),i.appendChild(r),i.innerHTML):document.selection?(n=document.selection.createRange(),n.htmlText):""},_isDescendantOrSelf:function(n,t){if(!n||!t)return!1;if(n==t)return!0;for(var i=t.parentNode;null!=i;){if(i==n)return!0;i=i.parentNode}return!1},restoreSelection:function(){if(this._isInFocus=!0,null!=this._savedRange)if(window.getSelection){var n=window.getSelection();n.rangeCount>0&&n.removeAllRanges();n.addRange(this._savedRange)}else document.createRange?window.getSelection().addRange(this._savedRange):document.selection&&this._savedRange.select()},cleanWordHtml:function(n){return n=this._cleanOP(n),n=this._cleanMSO(n),n=this._cleanStyleAttr(n),n=this._cleanLangAttr(n),n=this._cleanXmlNamespaceTags(n),n=this._cleanComments(n),n=this._cleanFontFamily(n),n=this._cleanSpan(n),n=this._cleanB(n)},_cleanOP:function(n){return n=n.replace(/\s*<\/o:p>/g,""),n=n.replace(/[\s\S]*?<\/o:p>/g," ")},_cleanMSO:function(n){return n.replace(/\s*mso-[^:]+:[^;"]+;?/gi,"")},_cleanFontFamily:function(n){return n.replace(/\s*FONT-FAMILY:[^;"]*;?/gi,"")},_cleanSpan:function(n){return n=n.replace(/]*>\s* \s*<\/SPAN>/gi," "),n=n.replace(/]*><\/SPAN>/gi,""),n=n.replace(/([\s\S]*?)<\/SPAN>/gi,"$1"),n=n.replace(/\s*<\/span>/gi,"")},_cleanStyleAttr:function(n){return n.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi,"<$1$3")},_cleanLangAttr:function(n){return n.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3")},_cleanXmlNamespaceTags:function(n){return n.replace(/<\/?\w+:[^>]*>/gi,"")},_cleanComments:function(n){return n.replace(/<\!--[\s\S]*?-->/g,"")},_cleanB:function(n){return n=n.replace(/\s* \s*<\/b>/gi,""),n=n.replace(/\s*<\/b>/gi,"")},_elementVisible:function(n,t){"FORM"!=n.tagName&&(t?("none"==n.style.display&&(n.style.display="block",n.setAttribute("displayChanged",!0)),"hidden"==n.style.visibility&&(n.style.visibility="visible",n.setAttribute("visibleChanged",!0)),this._elementVisible(n.parentNode,!0)):(n.getAttribute("displayChanged")&&(n.style.display="none",n.removeAttribute("displayChanged")),n.getAttribute("visibleChanged")&&n.removeAttribute("visibleChanged"),this._elementVisible(n.parentNode,!1)))},_raiseEvent:function(n,t){var i=this.get_events().getHandler(n);i&&(t||(t=Sys.EventArgs.Empty),i(this,t))},get_buttonWidth:function(){return this._ButtonWidth},get_ButtonWidth:function(){return Sys.Extended.Deprecated("get_ButtonWidth()","get_buttonWidth()"),this.get_buttonWidth()},set_buttonWidth:function(n){this._ButtonWidth!=n&&(this._ButtonWidth=n,this.raisePropertyChanged("ButtonWidth"))},set_ButtonWidth:function(n){Sys.Extended.Deprecated("set_ButtonWidth(value)","set_buttonWidth(value)");this.set_buttonWidth(n)},get_buttonHeight:function(){return this._ButtonHeight},get_ButtonHeight:function(){return Sys.Extended.Deprecated("get_ButtonHeight()","get_buttonHeight()"),this.get_buttonHeight()},set_buttonHeight:function(n){this._ButtonHeight!=n&&(this._ButtonHeight=n,this.raisePropertyChanged("ButtonHeight"))},set_ButtonHeight:function(){Sys.Extended.Deprecated("set_ButtonHeight(value)","set_buttonHeight(value)");this.set_buttonHeight()},get_toolbarButtons:function(){return this._toolbarButtons},get_ToolbarButtons:function(){return Sys.Extended.Deprecated("get_ToolbarButtons()","get_toolbarButtons()"),this.get_toolbarButtons()},set_toolbarButtons:function(n){this._toolbarButtons!=n&&(this._toolbarButtons=n,this.raisePropertyChanged("ToolbarButtons"))},set_ToolbarButtons:function(n){Sys.Extended.Deprecated("set_ToolbarButtons(value)","set_ToolbarButtons(value)");this.set_toolbarButtons(n)},get_displaySourceTab:function(){return this._displaySourceTab},set_displaySourceTab:function(n){this._displaySourceTab!=n&&(this._displaySourceTab=n,this.raisePropertyChanged("DisplaySourceTab"))},get_displayPreviewTab:function(){return this._displayPreviewTab},set_displayPreviewTab:function(n){this._displayPreviewTab!=n&&(this._displayPreviewTab=n,this.raisePropertyChanged("DisplayPreviewTab"))},add_change:function(n){this.get_events().addHandler("change",n)},remove_change:function(n){this.get_events().removeHandler("change",n)},get_isDirty:function(){return this._isDirty}},Sys.Extended.UI.HtmlEditorExtenderBehavior.registerClass("Sys.Extended.UI.HtmlEditorExtenderBehavior",Sys.Extended.UI.BehaviorBase),HtmlEditorExtender_editableDivs=[],Sys.Extended.UI.HtmlEditorExtenderBehavior.WebForm_OnSubmit=function(){var r=Sys.Extended.UI.HtmlEditorExtenderBehavior._originalWebForm_OnSubmit(),t,n,i;if(r)for(t=Sys.Application.getComponents(),n=0;n")}catch(n){r=document.createElement("img");r.src=e;i._savedRange.insertNode(r)}else r=document.createElement("img"),r.src=e,i._savedRange.insertNode(r)},Sys.Extended.UI.HtmlEditorExtenderMode={Content:0,Source:1,Preview:2},Type.registerNamespace("Sys.Extended.UI.HtmlEditor"),Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs=function(n,t,i){if(3!=arguments.length)throw Error.parameterCount();Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.initializeBase(this);this._oldMode=n;this._newMode=t;this._editPanel=i},Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.prototype={get_oldMode:function(){return this._oldMode},get_newMode:function(){return this._newMode},get_editPanel:function(){return this._editPanel}},Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs.registerClass("Sys.Extended.UI.HtmlEditor.ActiveModeChangedArgs",Sys.EventArgs),Type.registerNamespace("Sys.Extended.UI.HtmlEditor"),Sys.Extended.UI.HtmlEditor.ActiveModeType=function(){},Sys.Extended.UI.HtmlEditor.ActiveModeType.prototype={Design:0,Html:1,Preview:2},Sys.Extended.UI.HtmlEditor.ActiveModeType_checkValue=function(n){return n>=0&&n<=2},Sys.Extended.UI.HtmlEditor.ActiveModeType.registerEnum("Sys.Extended.UI.HtmlEditor.ActiveModeType",!0),Type.registerNamespace("Sys.Extended.UI.HtmlEditor"),Sys.Extended.UI.HtmlEditor.Trim=function(n){return n.replace(/[\x00-\x1F]+/g,"")},Sys.Extended.UI.HtmlEditor.TrimAll=function(n){return n.replace(/[\x00-\x1F]/g,"").replace(/^[\x20]+/g,"").replace(/[\x20]+$/g,"")},Sys.Extended.UI.HtmlEditor.isIE=Sys.Browser.agent==Sys.Browser.InternetExplorer,Sys.Extended.UI.HtmlEditor.isSafari=Sys.Browser.agent==Sys.Browser.Safari||null==Sys.Browser.agent&&5==Sys.Browser.version&&"Netscape"==Sys.Browser.name,Sys.Extended.UI.HtmlEditor.isOpera=Sys.Browser.agent==Sys.Browser.Opera,Sys.Extended.UI.HtmlEditor.tryReplaceRgb=function(n){function t(n){return n<16?"0"+n.toString(16):n.toString(16)}function r(n,i,r,u,f){var e=parseInt(r),o=parseInt(u),s=parseInt(f);return"#"+t(e)+t(o)+t(s)}var i=n;try{i=i.replace(/(rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\))/gi,r)}catch(n){}return i},Sys.Extended.UI.HtmlEditor._getScrollTop=function(n){var t=n.document,i=0;return"number"==typeof n.pageYOffset&&(i=n.pageYOffset),t.body&&t.body.scrollTop?i=t.body.scrollTop:t.documentElement&&t.documentElement.scrollTop&&(i=t.documentElement.scrollTop),i},Sys.Extended.UI.HtmlEditor._getScrollLeft=function(n){var t=n.document,i=0;return"number"==typeof n.pageXOffset?i=n.pageXOffset:t.body&&t.body.scrollLeft?i=t.body.scrollLeft:t.documentElement&&t.documentElement.scrollLeft&&(i=t.documentElement.scrollLeft),i},Sys.Extended.UI.HtmlEditor.addFormOnSubmit=function(n,t){var i=window.theForm;null!=window.theForm&&"undefined"!=typeof theForm&&(null!=i.HtmlEditor_editPanels&&"undefined"!=typeof i.HtmlEditor_editPanels||(i.originalOnSubmit_HtmlEditor=window.theForm.onsubmit,i.HtmlEditor_editPanels=[],window.theForm.onsubmit=Sys.Extended.UI.HtmlEditor.EditPanelsOnSubmit,null!=window.__doPostBack&&"undefined"!=typeof __doPostBack&&(null!=window.__doPostBack_HtmlEditor_original&&"undefined"!=typeof __doPostBack_HtmlEditor_original||(window.__doPostBack_HtmlEditor_original=window.__doPostBack,window.__doPostBack=Sys.Extended.UI.HtmlEditor.EditPanelsOnPostBack)),null!=window.ValidatorGetValue&&"undefined"!=typeof ValidatorGetValue&&(null!=window.ValidatorGetValue_HtmlEditor_original&&"undefined"!=typeof ValidatorGetValue_HtmlEditor_original||(window.ValidatorGetValue_HtmlEditor_original=window.ValidatorGetValue,window.ValidatorGetValue=Sys.Extended.UI.HtmlEditor.ValidatorGetValue))),i.HtmlEditor_editPanels.push({handler:n,editPanel:t}))},Sys.Extended.UI.HtmlEditor.removeFormOnSubmit=function(n){var t=window.theForm,f,r,i,u;if(null!=window.theForm&&"undefined"!=typeof theForm&&(f=t.originalOnSubmit_HtmlEditor,null!=t.HtmlEditor_editPanels&&"undefined"!=typeof t.HtmlEditor_editPanels)){for(r=[],i=0;i]*?"+t+'=")([^"]*?)"',"ig"),f),""==r&&n.outerHTML.replace(new RegExp("^(?:<[^>]*?"+t+"=')([^']*?)'","ig"),f),""==r&&n.outerHTML.replace(new RegExp("^(?:<[^>]*?"+t+"=)([^s>]*?)","ig"),f),u!=r&&""!=r&&(u=r,u=u.replace(/&/g,"&")),u},Sys.Extended.UI.HtmlEditor.getRealAttribute=function(n,t){var e=t.toLowerCase(),f=n.attributes,r="",u,t;for(i=0;i=0)i--,t.parentNode.removeChild(t);else{for(var r=t.tagName.toLowerCase(),c=!1,v=Sys.Extended.UI.HtmlEditor.enabledWordTags.length,s=0;s0&&(t.style.width=t.getAttribute("width"));t.width&&t.width.length>0&&(t.style.width=t.width);t.width="";try{t.removeAttribute("width")}catch(n){}t.getAttribute("height")&&t.getAttribute("height").length>0&&(t.style.height=t.getAttribute("height"));t.height&&t.height.length>0&&(t.style.height=t.height);t.height="";try{t.removeAttribute("height")}catch(n){}if("table"==r&&(t.style.borderLeftWidth="1px",t.style.borderLeftColor="black",t.style.borderLeftStyle="solid",t.style.borderTopWidth="1px",t.style.borderTopColor="black",t.style.borderTopStyle="solid",t.style.backgroundColor=f,t.style.color=e),"td"==r&&(t.style.borderRightWidth="1px",t.style.borderRightColor="black",t.style.borderRightStyle="solid",t.style.borderBottomWidth="1px",t.style.borderBottomColor="black",t.style.borderBottomStyle="solid",t.style.backgroundColor=f,t.style.color=e),"font"==r||"span"==r){t.style.backgroundColor=f;t.style.color=e;for(var l=t.attributes,o=0,h=0;h]*?)>/gi,"").replace(/<\/html(?:[^>]*?)>[^\u0000]*$/gi,"").replace(/]*?)>[^\u0000]*?<\/head(?:[^>]*?)>/gi,"").replace(/]*?>([^\u0000]*?)<\/body(?:[^>]*?)>/gi,"$1").replace(/<\/?html(?:[^>]*?)>/gi,"").replace(/<\/?head(?:[^>]*?)>/gi,"").replace(/<\/?body(?:[^>]*?)>/gi,"").replace(//gi,"").replace(/(<[\/]?)(?:o|v|x|p|w|\?xml):(\w+)([^>]*?>)/gi,"$1$2$3").replace(/<(IMAGEDATA)([^>]*?)>/gi,"").replace(/]*>

 <\/p><\/p>/gi,"
").replace(/]*?\/>/gi,"").replace(/<(p|div)[^>]*?> <\/(\1)[^>]*?>/gi,"").replace(/<(p|div)[^>]*?><\/(\1)[^>]*?>/gi,""),i;do r=t,t=t.replace(/<([^>]*)(?:class|size|lang|face|start|type|border|[ovwxp]:\w+)=(?:\'[^\']*\'|\"[^\"]*\"|[^> ]+)([^>]*)>/gi,"<$1$2>");while(t!=r);i=document.createElement("div");i.innerHTML=t;u(i);t=Sys.Extended.UI.HtmlEditor.Trim(i.innerHTML);delete i;t=t.replace(/<[\/]?(xml|del|ins)[^>]*?>/gi,"").replace(/<(p|div)[^>]*?>/gi,"").replace(/<\/(p|div)[^>]*?>/gi,"
");do r=t,t=t.replace(/<\/b>/gi,"").replace(/<\/i>/gi,"").replace(/<\/u>/gi,"").replace(/<\/strong>/gi,"").replace(/<\/em>/gi,"").replace(/<\/sub>/gi,"").replace(/<\/sup>/gi,""),t=t.replace(/]*?><\/span>/gi,"").replace(/([^<]+?)<\/span>/gi,"$1"),t=t.replace(/]*?><\/font>/gi,"").replace(/([^<]+?)<\/font>/gi,"$1");while(t!=r);return t=t.replace(/’/g,"'").replace(/‘/g,"'").replace(/–/g,"-").replace(/—/g,"-").replace(/…/g,"...").replace(/"/g,'"').replace(/“/g,'"').replace(/”/g,'"').replace(//g,"").replace(/•/g,"").replace(/[ \s]+/g," ").replace(/(( )+)/g," "),document.all&&(t=t.replace(/^[\x00-\x1F]* /,"")),t},Sys.Extended.UI.HtmlEditor.spanJoiner=function(n,t,i,r,u){var y=0,h=n.childNodes.length,c,f,p,w,v,o,b,e,l,s;for("undefined"!=typeof i&&null!=i&&(y=i),"undefined"!=typeof r&&null!=r&&(h=r),c=y;c0||f.getAttribute("class")&&f.getAttribute("class").length>0)&&!Sys.Extended.UI.HtmlEditor.isTempElement(f)){n.removeChild(f);c--;h--;continue}if("SPAN"==f.tagName.toUpperCase()){for(;1==f.childNodes.length&&1==f.firstChild.nodeType;){if("SPAN"!=f.firstChild.tagName.toUpperCase()||Sys.Extended.UI.HtmlEditor.isTempElement(f.firstChild)){"SPAN"==f.firstChild.tagName.toUpperCase()&&Sys.Extended.UI.HtmlEditor.isTempElement(f.firstChild)&&(p=f.firstChild,f.parentNode.insertBefore(f.firstChild,f),f.parentNode.removeChild(f),f=p);break}var l=Sys.Extended.UI.HtmlEditor.differAttr(f.firstChild,[]),s=Sys.Extended.UI.HtmlEditor.differStyle(f.firstChild),a=f.firstChild;for(a.childNodes;null!=a.firstChild;)f.insertBefore(a.firstChild,a);for(e=0;e=0)f.style[s[e][0]]=s[e][1];else try{w=f.style[s[e][0]];f.style[s[e][0]]=f.style[s[e][0]]+" "+s[e][1];w==f.style[s[e][0]]&&(f.style[s[e][0]]=s[e][1])}catch(n){f.style[s[e][0]]=s[e][1]}else f.style[s[e][0]]=s[e][1]}catch(n){}for(e=0;e0||f.getAttribute("class")&&f.getAttribute("class").length>0)&&!Sys.Extended.UI.HtmlEditor.isTempElement(f)){n.removeChild(f);c--;h--;continue}Sys.Extended.UI.HtmlEditor.spanJoiner(f,t)}}},Sys.Extended.UI.HtmlEditor._styleTags=["strong","em","u","strike","s","span","font","b","sub","sup","a","i"],Sys.Extended.UI.HtmlEditor.isStyleTag=function(n){if(!n)return!1;for(var t=0;t0&&n.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName)>=0)},Sys.Extended.UI.HtmlEditor.differAttr=function(n,t,i){var o=[],u=n.parentNode,f,e;if("undefined"!=typeof i&&(u=i),u&&u.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(u.tagName)||(u=null),n.attributes)for(f=0;f/gi,"
")},Sys.Extended.UI.HtmlEditor._needsClosingTag=function(n){return" script style div span a del strong em u strike font b sub sup p iframe li ul ol placeholder textarea td tr ".indexOf(" "+n.tagName.toLowerCase()+" ")!=-1},Sys.Extended.UI.HtmlEditor._encodeText_=function(n){return n.replace(/&/gi,"&").replace(//gi,">").replace(/\"/gi,""").replace(/\xA0/gi," ")},Sys.Extended.UI.HtmlEditor._noNeedsClosingTag=function(n){return" hr br ".indexOf(" "+n.tagName.toLowerCase()+" ")!=-1},Sys.Extended.UI.HtmlEditor.canBeInsideP=function(n,t){var r,i;if(n&&n.style&&n.style.display&&"inline"==n.style.display.toLowerCase())return!0;if(r=n.tagName.toUpperCase(),2==r.length&&"H"==r.substr(0,1)&&parseInt(r.substr(1,1))>0)return!1;switch(r){case"TBODY":case"TR":case"TD":if("undefined"!=typeof t){for(i=n.parentNode;i&&i.tagName&&"TABLE"!=i.tagName.toUpperCase();)i=i.parentNode;if("TABLE"==i.tagName.toUpperCase()&&i.style&&i.style.display&&"inline"==i.style.display.toLowerCase())return!0}case"P":case"PRE":case"TABLE":case"OL":case"UL":case"LI":case"HR":case"DIV":case"BLOCKQUOTE":case"FORM":case"FIELDSET":case"LEGEND":return!1;default:return!0}},Sys.Extended.UI.HtmlEditor.convertAlign=function(n){var t,i;try{i=parseInt(n)-1}catch(t){return n}switch(i){case 1:t="left";break;case 2:t="right";break;case 3:t="texttop";break;case 4:t="absmiddle";break;case 5:t="baseline";break;case 6:t="absbottom";break;case 7:t="bottom";break;case 8:t="middle";break;case 9:t="top";break;default:t=n.replace(/\"/g,""")}return t},Sys.Extended.UI.HtmlEditor.getHTML=function(n,t,i){try{if("undefined"==typeof i){if(!t&&1==n.nodeType)return n.innerHTML;if(t&&1==n.nodeType&&Sys.Extended.UI.HtmlEditor.isIE)return n.outerHTML}}catch(n){}var r=new Sys.Extended.UI.HtmlEditor.jsDocument(!0);return Sys.Extended.UI.HtmlEditor._getHTML_(r,n,t),r.toString()},Sys.Extended.UI.HtmlEditor._getHTML_=function(n,t,i){function nt(n,t){g.push(t)}function tt(){var n=g[k];return k++,n}function it(n,t,i,r){return t+i.replace(/(,)/g,"")+r}function rt(n,t,i,r){return t+i.replace(/(['"])/g,"")+r}var h,l,y,e,f,p,c,w,b,v,a,u,r,o,k,s;switch(t.nodeType){case 1:case 11:if(t.tagName&&t.tagName.indexOf("/")>=0){if(Sys.Extended.UI.HtmlEditor.isIE){if(f=t.tagName.toLowerCase().substr(t.tagName.indexOf("/")+1),h=t.previousSibling,"embed"==f)return;for(;null!=h;){if(h.nodeType==t.nodeType&&h.tagName&&h.tagName.toLowerCase()==f)return void n.append("<\/teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":"+t.tagName.toLowerCase().substr(t.tagName.indexOf("/")+1)+">");h=h.previousSibling}}return}if(i&&t.tagName.length>0){if(f=t.tagName.toLowerCase(),l=!(t.hasChildNodes()||Sys.Extended.UI.HtmlEditor._needsClosingTag(t)),y=!0,p="",Sys.Extended.UI.HtmlEditor.isIE&&t.scopeName&&"undefined"!=typeof t.scopeName&&(p="HTML"==t.scopeName.toUpperCase()?"":t.scopeName+":"),Sys.Extended.UI.HtmlEditor.isIE&&(l||"placeholder"==f)&&!Sys.Extended.UI.HtmlEditor._noNeedsClosingTag(t)&&"embed"!=f)for(c=t.nextSibling;null!=c;){if(c.nodeType==t.nodeType&&c.tagName&&(w=c.tagName,w.indexOf("/")>=0&&w.toLowerCase().substr(w.indexOf("/")+1)==f)){l=!1;y=!1;break}c=c.nextSibling}for(Sys.Extended.UI.HtmlEditor.canBeInsideP(t)||n.append("\n"),n.append("<"+(l||y?p:"teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":")+f),Sys.Extended.UI.HtmlEditor.isIE&&t.name&&t.name.length>0&&n.append(' name="'+t.name.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.value&&t.value.length>0&&"textarea"!=f&&n.append(' value="'+t.value.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.className&&t.className.length>0&&n.append(' class="'+t.className.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.align&&t.align.length>0&&n.append(' align="'+t.align.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.color&&t.color.length>0&&n.append(' color="'+t.color.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.size&&t.size.length>0&&"+0"!=t.size&&n.append(' size="'+t.size.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.shape&&t.shape.length>0&&n.write(' shape="'+t.shape.replace(/\"/g,""")+'"'),Sys.Extended.UI.HtmlEditor.isIE&&t.coords&&t.coords.length>0&&n.write(' coords="'+t.coords.replace(/\"/g,""")+'"'),b=t.attributes,v=null,e=0;e]*?width=)([\\d]+)","ig"),function(n,t){o=t}),r!=o&&(r=o));else if("height"==u)(r=t.height,Sys.Extended.UI.HtmlEditor.isIE&&0==r)&&(o=0,t.outerHTML.replace(new RegExp("^(?:<[^>]*?height=)([\\d]+)","ig"),function(n,t){o=t}),r!=o&&(r=o));else{if(Sys.Extended.UI.HtmlEditor.isIE&&"name"==u&&t.name&&t.name.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"value"==u&&t.value&&t.value.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"align"==u&&t.align&&t.align.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"class"==u&&t.className&&t.className.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"color"==u&&t.color&&t.color.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"size"==u&&t.size&&t.size.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"shape"==u&&t.shape&&t.shape.length>0)continue;if(Sys.Extended.UI.HtmlEditor.isIE&&"coords"==u&&t.coords&&t.coords.length>0)continue;if("embed"==f&&"align"==u&&Sys.Extended.UI.HtmlEditor.isIE)r=Sys.Extended.UI.HtmlEditor.convertAlign(a.value);else{if(r=a.value,Sys.Extended.UI.HtmlEditor.isSafari&&"class"==u&&/apple-style/gi.test(r))continue;"src"!=u&&"href"!=u||(Sys.Extended.UI.HtmlEditor.isIE&&(r=Sys.Extended.UI.HtmlEditor.getRealAttributeIE(t,u,r)),r=r.replace(/(\(S\([A-Za-z0-9_]+\)\)\/)/,""));r=r.replace(/\"/g,""")}}s='"';(""+r).indexOf('"')>=0&&(s="'");null!=u&&n.append(" "+u+"="+s+r+s)}else Sys.Extended.UI.HtmlEditor.isSafari&&(v=a.value);if(t.style.cssText.length>0||null!=v){var u="style",d=/(url\((?:[^\)]*)\))/gi,g=[],r=(null!=v?v:t.style.cssText).toLowerCase();r.replace(d,nt);k=0;(r=Sys.Extended.UI.HtmlEditor.tryReplaceRgb(r.replace(d,tt)).replace(/(font-weight\s*:\s*)(700)/gi,"$1bold").replace(/([\s]*-moz-[^;]*[;][\s]*)/gi,"").replace(/(-moz-.*)$/i,"").replace(/(background-position: 0% 0%[;]*[\s]*)/gi,""),Sys.Extended.UI.HtmlEditor.isSafari&&(r=r.replace(/(text-decoration:)([^;$]+)([;$])/gi,it)),(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&(r=r.replace(/(font-family:)([^;]+)([;]*)/gi,rt)),r.length>0)&&(s='"',(""+r).indexOf('"')>=0&&(s="'"),n.append(" "+u+"="+s+r+s))}n.append(l?" />":">");"br"==f&&n.append("\n")}if(t.tagName&&"SCRIPT"==t.tagName.toUpperCase()&&n.append(t.text),t.tagName&&"STYLE"==t.tagName.toUpperCase())n.append(t.innerHTML);else for(e=t.firstChild;e;e=e.nextSibling)Sys.Extended.UI.HtmlEditor._getHTML_(n,e,!0);i&&t.tagName.length>0&&!l&&y&&n.append("<\/"+p+t.tagName.toLowerCase()+">");break;case 3:n.append(Sys.Extended.UI.HtmlEditor._encodeText_(""+t.data));break;case 8:t.length>0?n.append(""):n.append("")}},Sys.Extended.UI.HtmlEditor.RemoveContextMenu=function(){var n=this,t=n._contextElement.parentNode.removeChild(n._contextElement);t&&delete t;n._contextElement=null;n._contextTable=null;n.__saved_range__&&(n.__saved_range__.select(),n.__saved_range__=null)},Sys.Extended.UI.HtmlEditor.contentEditable=function(n,t){for(var i,r;null!=n;){try{if(i=null,null==n.contentEditable||"undefined"==typeof n.contentEditable||Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera?(r=n.getAttribute("contenteditable"),"boolean"==typeof r?i=r:"string"==typeof r&&"false"==r.toLowerCase()&&(i=!1)):i=!(!n.contentEditable||"false"==n.contentEditable),null!=i&&"boolean"==typeof i&&!i)return n}catch(n){}if("undefined"!=typeof t&&t)return null;if(null!=n.tagName&&"undefined"!=typeof n.tagName&&("BODY"==n.tagName.toUpperCase()||"HTML"==n.tagName.toUpperCase()))break;n=n.parentNode}return null},Sys.Extended.UI.HtmlEditor.getSelParent=function(n){var r=n._getSelection(),i=n._createRange(r),t=null,u;return Sys.Extended.UI.HtmlEditor.isIE?t="control"==r.type.toLowerCase()?i.item(0):n._getParent(i):(t=n._getParent(i),3!=t.nodeType&&i.startContainer==i.endContainer)&&(u=t,t=t.childNodes.item(i.startOffset),null==t&&(t=u)),t},Sys.Extended.UI.HtmlEditor.__getIndex=function(n){var t=0;if(n.parentNode)for(;t0)return!1;switch(t){case"BR":case"TBODY":case"TR":case"TD":case"P":case"PRE":case"TABLE":case"OL":case"UL":case"LI":case"HR":case"DIV":case"BLOCKQUOTE":case"FORM":case"FIELDSET":case"LEGEND":return!1;default:return!0}},Sys.Extended.UI.HtmlEditor.capLock=function(n){var t=n.charCode,i=n.shiftKey?n.shiftKey:16==t;return!!(t>=65&&t<=90&&!i||t>=97&&t<=122&&i)},Sys.Extended.UI.HtmlEditor.operateAnchors=function(n,t,i){for(var r,e,o,u,f,h=t.getElementsByTagName("A"),c=!1,s=0;s0){for(e=[],o=0;o0;)r.removeChild(e.pop());i||(f=t.createElement("IMG"),f.title=r.name,f.src=n._editPanel.get_imagePath_anchor(),f.setAttribute(n.noContextMenuAttributeName(),"yes"),r.appendChild(f))}return c},Sys.Extended.UI.HtmlEditor.operatePlaceHolders=function(n,t,i){var v=!1,c,l,e,u,r,a,o,s;if(i){for(var h=t.getElementsByTagName("IMG"),f=[],u=0;u0&&"placeholder"==c.toLowerCase()&&(l=t.createElement("PLACEHOLDER"),e=r.title,null!=e&&"undefined"!=typeof e||(e=r.getAttribute("title")),l.name=e,l.setAttribute("name",e),r.parentNode.insertBefore(l,r),r.parentNode.removeChild(r),v=!0)}else{for(var h=t.getElementsByTagName("PLACEHOLDER"),f=[],u=0;u0&&(a=!1)}catch(n){}a&&(o=r.name,null!=o&&"undefined"!=typeof o||(o=r.getAttribute("name")),s=t.createElement("IMG"),s.title=o,s.src=n._editPanel.get_imagePath_placeHolder(),s.setAttribute("dummytag","placeholder"),s.setAttribute("title",o),r.parentNode.insertBefore(s,r),r.parentNode.removeChild(r))}}return v},Sys.Extended.UI.HtmlEditor.inspectForShadows=function(n){for(var i=n.getElementsByTagName("IMG"),t=0;t0){try{Sys.Extended.UI.HtmlEditor.isIE?$removeHandler(i[t],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$removeHandler(i[t],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}catch(n){}Sys.Extended.UI.HtmlEditor.isIE?$addHandler(i[t],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$addHandler(i[t],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}},Sys.Extended.UI.HtmlEditor.attachedIdAttribute="obout-attached-id",Sys.Extended.UI.HtmlEditor.stopDrag=function(n){return n&&n.stopPropagation(),n.preventDefault(),!1},Sys.Extended.UI.HtmlEditor.replacingRules=[["strong","font-weight","bold"],["b","font-weight","bold"],["strong","font-weight","700"],["em","font-style","italic"],["i","font-style","italic"],["u","text-decoration","underline"],["strike","text-decoration","line-through"]],Sys.Extended.UI.HtmlEditor.replaceOldTags=function(n,t){for(var l,o,i,r,s,e,h=n.innerHTML,c=!1,u=0;u]","ig"),l.test(h)){c=!0;break}if(c||/]/gi.test(h))for(o=0;o0)e.appendChild(r),i=r;else{for(;r.firstChild;)e.appendChild(r.firstChild);n.removeChild(r);i=e}else i=r}Sys.Extended.UI.HtmlEditor.replaceOldTags(i,t)}},Sys.Extended.UI.HtmlEditor.getStyle=function(n,t){var i="";if(1==n.nodeType)if(n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.getComputedStyle)i=n.ownerDocument.defaultView.getComputedStyle(n,"").getPropertyValue(t);else if(n.currentStyle)try{t=t.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()});i=n.currentStyle[t]}catch(r){i=n.style[t]}else i=n.style[t];return i},Sys.Extended.UI.HtmlEditor._Marker=function(n,t,i){var r,u;if(Sys.Extended.UI.HtmlEditor.isIE)if(this._nArr=Sys.Extended.UI.HtmlEditor.getNames(n._doc.body),this._save=n._doc.body.innerHTML,this._tree=null,"control"==i.type.toLowerCase())try{for(r=t.item(0),this._tree=[];r&&(3==r.nodeType||!r.tagName||"BODY"!=r.tagName.toUpperCase());){for(u=0;r.previousSibling;)u++,r=r.previousSibling;this._tree.push(u);r=r.parentNode}}catch(n){}else this._offsetLeft=t.offsetLeft,this._offsetTop=t.offsetTop;else{this._save=Sys.Extended.UI.HtmlEditor.isOpera?Sys.Extended.UI.HtmlEditor.Trim(n._doc.body.innerHTML):n._doc.body.cloneNode(!0);this._tree=[];this._offset=0;try{for(r=t.startContainer,this._offset=t.startOffset,r&&1==r.nodeType&&"HTML"==r.tagName.toUpperCase()&&(r=n._doc.body,setTimeout(function(){try{i=n._getSelection();t=n._createRange();n._removeAllRanges(i);t.setStart(r,0);t.setEnd(r,0);n._selectRange(i,t)}catch(n){}},0));r&&r.nodeType&&(3==r.nodeType||!r.tagName||"BODY"!=r.tagName.toUpperCase());){for(u=0;r.previousSibling;)u++,Sys.Extended.UI.HtmlEditor.isOpera&&3==r.nodeType&&null!=r.previousSibling&&3==r.previousSibling.nodeType&&u--,r=r.previousSibling;this._tree.push(u);r=r.parentNode}}catch(n){}}},Sys.Extended.UI.HtmlEditor.__stackMaxSize=30,Sys.Extended.UI.HtmlEditor.getNames=function(n){for(var t,f=n.all,e=[],o=[],u=0;u0){for(var i=t.tagName,s=n.getElementsByTagName(i),h=0,r=0;rt[i][1]&&(n.getElementsByTagName(t[i][0])[t[i][1]].name=t[i][2])},Sys.Extended.UI.HtmlEditor._lookChild=function(n,t){for(var r,i=0;i=0)return i;return-1},Sys.Extended.UI.HtmlEditor.getHrefsText=function(n){function i(n,i,r,u,f,e){for(var s=i.replace(/^<([^\s>]+)/,"$1"),h=!0,o=0;o<]+)([^><]*?)(href=)(\"|')([^\\4]*?)(\\4)((?:[^><]*?)>)","ig");return n.replace(r,i),t},Sys.Extended.UI.HtmlEditor.setHrefsText=function(n,t){for(var e,i=0;i0&&(Sys.Extended.UI.HtmlEditor.isIE&&(e=u[r].innerHTML),u[r].href=t[i][f].replace(/&/gi,"&"),Sys.Extended.UI.HtmlEditor.isIE&&(u[r].innerHTML=e)),f++)},Sys.Extended.UI.HtmlEditor.getImagesText=function(n){function i(n,i,r,u){return t.push(u),n}var t=[];return n.replace(/()/gi,i),t},Sys.Extended.UI.HtmlEditor.setImagesText=function(n,t){for(var u=n.getElementsByTagName("IMG"),i=0,r=0;r0&&(u[r].src=t[i].replace(/&/gi,"&")),i++)},Sys.Extended.UI.HtmlEditor.canHaveChildren=function(n){return Sys.Extended.UI.HtmlEditor.isIE?n.canHaveChildren:!/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(n.tagName.toLowerCase())},Sys.Extended.UI.HtmlEditor._setCursor=function(n,t){var r=n,f,e,u,i;if(Sys.Extended.UI.HtmlEditor.isIE){u=t._getSelection();i=t._createRange(u);"control"==u.type.toLowerCase()&&(i.remove(0),u.empty(),i=t._createRange());e=3==r.nodeType;e&&(f=t._doc.createElement("SPAN"),f.innerHTML=" ",r.parentNode.insertBefore(f,r),r=f);var o=$common.getLocation(r),s=o.x,h=o.y;e&&f.parentNode.removeChild(f);try{i.moveToPoint(s,h)}catch(n){}i.select()}else u=t._getSelection(),i=t._createRange(),i.setStart(r,0),i.setEnd(r,0),t._removeAllRanges(u),t._selectRange(u,i),t.focusEditor()},Sys.Extended.UI.HtmlEditor.myClone=function(n,t,i){var r,u;if(Sys.Extended.UI.HtmlEditor.isIE&&n.tagName&&("EMBED"==n.tagName.toUpperCase()||"OBJECT"==n.tagName.toUpperCase())){u=t.createElement("DIV");try{u.innerHTML=n.outerHTML;r=u.firstChild}catch(t){r=n}delete u}else r=n.cloneNode(i);return r},Sys.Extended.UI.HtmlEditor.unStyle=function(n){function o(n,t,r,u,f){var e=r.cloneNode(!1),h,v,l,c,a,s;if(n)if(n.push&&"function"==typeof n.push)for(h=0;h0)&&(1==t.nodeType&&t.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(t.tagName)&&0==t.childNodes.length&&!Sys.Extended.UI.HtmlEditor.isTempElement(t)&&(t=null),t&&(0!=e.childNodes.length&&u?e.insertBefore(t,e.firstChild):e.appendChild(t))),t=v;if(0==e.childNodes.length)delete e,e=null;else if(1==e.childNodes.length&&3==e.firstChild.nodeType&&0==(""+e.firstChild.data).length)delete e,e=null;else if(!f&&e.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName)&&"A"!=e.tagName.toUpperCase()&&!Sys.Extended.UI.HtmlEditor.isTempElement(e)){for(l=e.childNodes.length,c=0;c0&&(n=t);var f=o(null,n.previousSibling,n.parentNode,!0,!1),e=o(null,n.nextSibling,n.parentNode,!1,!1),u=i.parentNode;if(f)if(f.push&&"function"==typeof f.push)for(r=0;r0&&n.id.indexOf(Sys.Extended.UI.HtmlEditor.smartClassName)>=0)},Sys.Extended.UI.HtmlEditor._moveTagsUp=function(n,t){function r(n){var t,i;if(Sys.Extended.UI.HtmlEditor.isInlineElement(n)&&3!=n.nodeType){if(n.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(n.tagName)&&"A"!=n.tagName.toUpperCase()&&!Sys.Extended.UI.HtmlEditor.isTempElement(n))for(t=n.firstChild;null!=t;)i=t.nextSibling,r(t),t=i}else Sys.Extended.UI.HtmlEditor.unStyle(n)}for(var u,i=n;null!=i&&i!=t;)u=i.nextSibling,r(i),i=u},Sys.Extended.UI.HtmlEditor._commonTotalParent=function(n,t){for(var u,f,r,i=n.parentNode,e=n;i;){if(i.tagName&&!Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&(u=Sys.Extended.UI.HtmlEditor._lookChild(i,t),u>=0)){for(f=0,r=0;r=0){for(f=0,r=0;r=0&&!r(e.substr(u,1));u--);else for(u=0;u=0&&u0||i&&0==u)&&(u0&&("\n"!=this.text[this.text.length-1]||"\n"!=n))&&(this.text[this.text.length]=n)};this.append=this.write;this.writeln=function(n){this.text[this.text.length]=n+"\n"};this.toString=function(){return this.text.join("")};this.clear=function(){delete this.text;this.text=null;this.text=[]}},Sys.Extended.UI.HtmlEditor.isHeader=function(n){var t=n.tagName.toUpperCase();return 2==t.length&&"H"==t.substr(0,1)&&parseInt(t.substr(1,1))>0},Sys.Extended.UI.HtmlEditor._getReallyFirst=function(n){return"undefined"!=typeof n.firstChild&&null!=n.firstChild&&"undefined"!=typeof n.firstChild.childNodes&&null!=n.firstChild.childNodes?Sys.Extended.UI.HtmlEditor._getReallyFirst(n.firstChild):n},Sys.Extended.UI.HtmlEditor._getReallyLast=function(n){return"undefined"!=typeof n.lastChild&&null!=n.lastChild&&"undefined"!=typeof n.lastChild.childNodes&&null!=n.lastChild.childNodes?Sys.Extended.UI.HtmlEditor._getReallyLast(n.lastChild):n},Sys.Extended.UI.HtmlEditor._reallyFirst=function(n,t){if(n.firstChild){if(n.firstChild==t)return!0;if(n.firstChild.childNodes&&0==Sys.Extended.UI.HtmlEditor._lookChild(n.firstChild,t))return Sys.Extended.UI.HtmlEditor._reallyFirst(n.firstChild,t)}return!1},Sys.Extended.UI.HtmlEditor._reallyLast=function(n,t){if(n.lastChild){if(n.lastChild==t)return!0;if(n.lastChild.childNodes&&Sys.Extended.UI.HtmlEditor._lookChild(n.lastChild,t)==n.lastChild.childNodes.length-1)return Sys.Extended.UI.HtmlEditor._reallyLast(n.lastChild,t)}return!1},Sys.Extended.UI.HtmlEditor.getContainer=function(n,t){var r,i,u;if(t==n)return n;if(1==n.nodeType)for(r=0;r=0))return i.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&"A"!=i.tagName.toUpperCase()&&!Sys.Extended.UI.HtmlEditor.isTempElement(i)?Sys.Extended.UI.HtmlEditor.getContainer(i,t):i}return null},Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt=function(n,t,i){var f=n.replace(/^(\d+)\.(\d+)px/i,"$1px"),e,o,r,s,u;if(!Sys.Extended.UI.HtmlEditor.isIE&&f&&f.length>0){if(e=f.toLowerCase().split(",")[0],"undefined"!=typeof i&&(o=document.getElementById(i),null!=o)){for(r=0;rut?a.parentNode.removeChild(a):n.appendChild(a),"BR"==nt&&s==y.length-1&&(d(),n=null),a==o[1]&&s==y.length-1&&(d(),n=null)):(n&&n.firstChild&&d(),null==n&&(n=f._doc.createElement("LI"),l.appendChild(n)),n.appendChild(a),d());n&&n.firstChild&&d()}if(null!=l){for(w=[],s=0;s0&&(s[0].parentNode!=r&&(i.length>0&&a(),i=[],r=s[0].parentNode),i.push(s));i.length>0&&a();null!=t&&e();this.setSelectionAfterOperation(o,v)};Sys.Extended.UI.HtmlEditor.MSIE_justify=function(n,t,i){function a(n){null!=n&&(1!=n.childNodes||n.firstChild!=e[0]&&n.firstChild!=e[1]||(n.parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n)))}function p(){var w,vt=r.firstChild,yt=r.lastChild,at=!1,y,et,d,t,i,ct,lt,ot,it,st,rt,ht,b,g,c,k;if(r.tagName&&!Sys.Extended.UI.HtmlEditor.isInlineElement(r)&&f[0][0]==vt&&f[f.length-1][f[f.length-1].length-1]==yt&&(w=r.tagName.toUpperCase(),"TD"!=w&&"TH"!=w&&"FIELDSET"!=w&&"LEGEND"!=w&&(at=!0)),at)if(g="",r.getAttribute("align")&&r.getAttribute("align").length>0&&(g=r.getAttribute("align")),r.align&&r.align.length>0&&(g=r.align),r.style.textAlign&&r.style.textAlign.length>0&&(g=r.style.textAlign),r.align="",r.setAttribute("align",""),r.removeAttribute("align"),("DIV"==w||"P"==w||Sys.Extended.UI.HtmlEditor.isHeader(r))&&"left"==n&&u)o.tryUnWrap(r,e,u)&&(l=!0);else{if("remain"!=n&&(r.style.textAlign="left"!=n||!u||"LI"==w&&r.parentNode.style.textAlign.length>0?n:""),u&&(r.style.margin="P"==w?"0px":""),"LI"==w){for(var v=r.parentNode,p=[],nt=0;nt0?n:"");u&&(t.style.margin="P"==i?"0px":"");for(var v=t.parentNode,p=[],nt=0;ntlt&&(!s||null!=t.nextSibling&&t.nextSibling==e[1])?t.parentNode.removeChild(t):y.appendChild(t),"BR"!=i||c!=d.length-1||s||(a(y),y=null),t==e[1]&&c==d.length-1&&(a(y),y=null))}for(var c,v=this.get_paragraphs(),e=this.getSelectionAfterOperation(v),r=null,f=[],o=this,u=!("undefined"==typeof t||!t),s="string"==typeof i,h="string"==typeof i?i:"",l=!1,y=0;y0&&(c[0].parentNode!=r&&(f.length>0&&p(),f=[],r=c[0].parentNode),f.push(c));f.length>0&&p();this.setSelectionAfterOperation(e,l)};Sys.Extended.UI.HtmlEditor.MSIE_indent=function(n){function e(n){if(1==n.nodeType){var t=i.rtlState()?n.style.marginRight:n.style.marginLeft;if(t.length>0)return parseInt(t)}return 0}function r(n,t){1==n.nodeType&&("P"==n.tagName.toUpperCase()&&""==t&&(t="0px"),i.rtlState()?n.style.marginRight=t:n.style.marginLeft=t)}function h(t){n?r(t,e(t)+40+"px"):"P"==t.tagName.toUpperCase()?e(t)>=40?r(t,e(t)-40+"px"):r(t,"0px"):e(t)>40?r(t,e(t)-40+"px"):r(t,"")}function c(n){null!=n&&(1!=n.childNodes||n.firstChild!=f[0]&&n.firstChild!=f[1]||(n.parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n)))}function v(){var ht=t.firstChild,ct=t.lastChild,nt,rt,o,v,et,ot,ut,tt,ft,d,st,w,it,a,l;if(t.tagName&&!Sys.Extended.UI.HtmlEditor.isInlineElement(t)&&u[0][0]==ht&&u[u.length-1][u[u.length-1].length-1]==ct){if(l="",t.getAttribute("align")&&t.getAttribute("align").length>0&&(l=t.getAttribute("align")),t.align&&t.align.length>0&&(l=t.align),t.style.textAlign&&t.style.textAlign.length>0&&(l=t.style.textAlign),("left"==l.toLowerCase()&&!i.rtlState()||"right"==l.toLowerCase()&&i.rtlState())&&(l=""),t.align="",t.setAttribute("align",""),t.removeAttribute("align"),h(t),nt=t.tagName.toUpperCase(),("DIV"==nt||"P"==nt||Sys.Extended.UI.HtmlEditor.isHeader(t))&&""==l)i.tryUnWrap(t,f)&&(s=!0);else if(t.style.textAlign=""!=l||"LI"==nt&&t.parentNode.style.textAlign.length>0?l:"","LI"==nt){for(var b=t.parentNode,y=[],g=0;got?o.parentNode.removeChild(o):p.appendChild(o),"BR"==v&&a==k.length-1&&(c(p),p=null),o==f[1]&&a==k.length-1&&(c(p),p=null))}for(var o,l=this.get_paragraphs(),f=this.getSelectionAfterOperation(l),t=null,u=[],i=this,s=!1,a=0;a0&&(o[0].parentNode!=t&&(u.length>0&&v(),u=[],t=o[0].parentNode),u.push(o));u.length>0&&v();this.setSelectionAfterOperation(f,s)};Sys.Extended.UI.HtmlEditor.getSelectionAfterOperation=function(n){var f,e,o,i;if(0==n.length)return[];var u=this._doc.createElement("SPAN"),r=this._doc.createElement("SPAN"),s=n[0][0],t=n[n.length-1][n[n.length-1].length-1];if(s==t&&1==t.nodeType&&0==t.childNodes.length&&Sys.Extended.UI.HtmlEditor.canHaveChildren(t))t.appendChild(u),t.appendChild(r);else{if(f=Sys.Extended.UI.HtmlEditor._getReallyFirst(s),f.parentNode.insertBefore(u,f),f==s){for(e=[],e.push(u),o=0;o<\/span><\/span>
";this.insertHTML(t);var i=this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName+"_ll"),r=this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName+"_rr"),u=this._TcurrentFormat;this._TcurrentFormat=null;this.setSelectionAfterOperation([i,r],!1);this._TcurrentFormat=u;n=this.getPseudoP()}catch(n){}return n};Sys.Extended.UI.HtmlEditor.getPseudoP=function(){var w=[],n,t,c,l,k,nt,y,u,a,tt,i,it,p,d,r,ut,f;try{var e=this._getSelection(),o=this._createRange(e),v=Sys.Extended.UI.HtmlEditor.smartClassName+"_right",b=Sys.Extended.UI.HtmlEditor.smartClassName+"_left",s=null,h=null;if(Sys.Extended.UI.HtmlEditor.isIE?"control"!=e.type.toLowerCase()&&(s=o.duplicate(),h=o.duplicate(),s.setEndPoint("EndToStart",o),h.setEndPoint("StartToEnd",o)):(s=o.cloneRange(),h=o.cloneRange(),s.setEnd(s.startContainer,s.startOffset),h.setStart(h.endContainer,h.endOffset)),n=null,t=null,Sys.Extended.UI.HtmlEditor.isIE&&"control"==e.type.toLowerCase())l=o.item(0),c=this._doc.createElement("SPAN"),c.id=b,l.parentNode.insertBefore(c,l),c=this._doc.createElement("SPAN"),c.id=v,null==l.nextSibling?l.parentNode.appendChild(c):l.parentNode.insertBefore(c,l.nextSibling);else{if(!this.insertHTML("",h))return[];if(!this.insertHTML("",s))return k=this._doc.getElementById(v),null!=k&&(a=k.parentNode,a.removeChild(k)),[]}if(n=this._doc.getElementById(b),t=this._doc.getElementById(v),null!=n&&null!=t)for(;null==n.nextSibling;)n.parentNode.nextSibling?n.parentNode.parentNode.insertBefore(n,n.parentNode.nextSibling):n.parentNode.parentNode.appendChild(n);if(null!=n&&null!=t){for(;null==t.previousSibling;)t.parentNode.parentNode.insertBefore(t,t.parentNode);1==t.previousSibling.nodeType&&(nt=t.previousSibling.tagName.toUpperCase(),"BR"!=nt&&"IMG"!=nt&&(y=Sys.Extended.UI.HtmlEditor._getReallyLast(t.previousSibling),1==y.nodeType&&Sys.Extended.UI.HtmlEditor.canHaveChildren(y)?y.appendChild(t):y.parentNode.appendChild(t)));t.previousSibling&&1==t.previousSibling.nodeType&&"BR"==t.previousSibling.tagName.toUpperCase()&&t.parentNode.insertBefore(t,t.previousSibling)}for(null==n&&(r=this._doc.createElement("SPAN"),r.id=b,t.parentNode.insertBefore(r,t),n=r),null==t&&(r=this._doc.createElement("SPAN"),r.id=v,n.nextSibling?n.parentNode.insertBefore(r,n.nextSibling):n.parentNode.appendChild(r),t=r),null!=n&&null!=t&&(n.parentNode==t?t.parentNode.insertBefore(n,t):t.parentNode==n&&(null!=n.nextSibling?n.parentNode.insertBefore(t,n.nextSibling):n.parentNode.appendChild(t)));null!=n.nextSibling&&3==n.nextSibling.nodeType&&0==(""+n.nextSibling.data).length;)n.parentNode.removeChild(n.nextSibling);if(null==this._TcurrentFormat&&null!=n&&null!=t&&n.nextSibling==t){for(u=t.parentNode,this._TcurrentFormat=null;u&&"BODY"!=u.tagName.toUpperCase()&&Sys.Extended.UI.HtmlEditor.isStyleTag(u.tagName);)"A"!=u.tagName.toUpperCase()&&(a=u.cloneNode(!1),null==this._TcurrentFormat?this._TcurrentFormat=a:(a.appendChild(this._TcurrentFormat),this._TcurrentFormat=a)),u=u.parentNode;this._TcurrentFormat&&(tt=this._doc.createElement("span"),tt.appendChild(this._TcurrentFormat),this._TcurrentFormat=tt.innerHTML)}for(i=n;i&&i.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&"A"!=i.tagName.toUpperCase();)i=i.parentNode;for(null!=i&&"P"==i.tagName.toUpperCase()?null!=i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n):Sys.Extended.UI.HtmlEditor.positionInParagraph(n,n.previousSibling,!0,n.parentNode),i=t;i&&i.tagName&&Sys.Extended.UI.HtmlEditor.isStyleTag(i.tagName)&&"A"!=i.tagName.toUpperCase();)i=i.parentNode;if(null!=i&&"P"==i.tagName.toUpperCase()?i.appendChild(t):Sys.Extended.UI.HtmlEditor.positionInParagraph(t,t.nextSibling,!1,t.parentNode),w=this.getPseudoP_Recur(n,t,0),it=n.parentNode.tagName.toUpperCase(),0!=w.length||null!=n.previousSibling||null!=t.nextSibling||n.nextSibling!=t||"P"!=it&&"DIV"!=llpTagName&&"LI"!=it||(w=[[n.parentNode]]),Sys.Extended.UI.HtmlEditor.isIE){e.empty();e=this._getSelection();p=this._createRange(e);d=this._createRange(e);try{null!=n&&p.moveToElementText(n);null!=t&&d.moveToElementText(t);null!=n&&null!=t?(p.setEndPoint("EndToEnd",d),p.select()):null!=n?p.select():null!=t&&d.select()}catch(w){}}null!=n&&n.parentNode.removeChild(n);null!=t&&t.parentNode.removeChild(t)}catch(w){for(var rt=this._doc.getElementsByTagName("SPAN"),g=[],f=0;f0&&(ut=new RegExp(Sys.Extended.UI.HtmlEditor.smartClassName,"ig"),ut.test(r.id)&&g.push(r));for(f=0;f0&&(y[e]=f,e++,f=[],o=0),f[o]=r,y[e]=f,e++,f=[],o=0;else if(ot=r.tagName?r.tagName.toUpperCase():null,"TABLE"==ot||"TBODY"==ot){for(d=r;"TABLE"!=d.tagName.toUpperCase();)d=d.parentNode;for(var dt=0,ht=0,gt=d.rows.item(d.rows.length-1).cells.length-1,ct=d.rows.length-1,c=0;c=0&&(dt=g,ht=c),Sys.Extended.UI.HtmlEditor._lookChild(b,w)>=0&&(gt=g,ct=c);for(c=ht;c<=ct;c++)for(g=c==ht?dt:0;g<=(c==ct?gt:d.rows.item(c).cells.length-1);g++)if(b=d.rows.item(c).cells.item(g),o>0&&(y[e]=f,e++,f=[],o=0),tt=Sys.Extended.UI.HtmlEditor._lookChild(b,p)>=0,it=Sys.Extended.UI.HtmlEditor._lookChild(b,w)>=0,tt||it){var s=p,l=w,at=Sys.Extended.UI.HtmlEditor.smartClassName+"_right_"+i,vt=Sys.Extended.UI.HtmlEditor.smartClassName+"_left_"+i;for(tt&&(l=this._doc.createElement("span"),l.id=at,b.appendChild(l)),it&&(s=this._doc.createElement("span"),s.id=vt,b.firstChild?b.insertBefore(s,b.firstChild):b.appendChild(s)),rt=this.getPseudoP_Recur(s,l,i+1),k=0;k0&&(y[e]=f,e++,f=[],o=0)}}else if("UL"==ot||"OL"==ot||"DL"==ot){for(var st=r,ni=0,ti=st.childNodes.length-1,c=0;c=0)&&(ni=c),(v==w||Sys.Extended.UI.HtmlEditor._lookChild(v,w)>=0)&&(ti=c));for(c=ni;c<=ti;c++)if(v=st.childNodes.item(c),o>0&&(y[e]=f,e++,f=[],o=0),tt=Sys.Extended.UI.HtmlEditor._lookChild(v,p)>=0,it=Sys.Extended.UI.HtmlEditor._lookChild(v,w)>=0,tt||it){var s=p,l=w,at=Sys.Extended.UI.HtmlEditor.smartClassName+"_right_"+i,vt=Sys.Extended.UI.HtmlEditor.smartClassName+"_left_"+i;for(tt&&(l=this._doc.createElement("span"),l.id=at,v.appendChild(l)),it&&(s=this._doc.createElement("span"),s.id=vt,v.firstChild?v.insertBefore(s,v.firstChild):v.appendChild(s)),rt=this.getPseudoP_Recur(s,l,i+1),k=0;k0&&(y[e]=f,e++,f=[],o=0)}}else if(tt=Sys.Extended.UI.HtmlEditor._lookChild(r,p)>=0,it=Sys.Extended.UI.HtmlEditor._lookChild(r,w)>=0,o>0&&(y[e]=f,e++,f=[],o=0),tt||it){var s=p,l=w,at=Sys.Extended.UI.HtmlEditor.smartClassName+"_right_"+i,vt=Sys.Extended.UI.HtmlEditor.smartClassName+"_left_"+i;for(tt&&(l=this._doc.createElement("span"),l.id=at,r.appendChild(l)),it&&(s=this._doc.createElement("span"),s.id=vt,r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s)),rt=this.getPseudoP_Recur(s,l,i+1),k=0;k0&&(y[e]=f,e++,f=[],o=0)}else{if(r.nodeType&&3==r.nodeType&&(wt=""+r.data,0==wt.length||/^[\n\r]+$/.test(wt))){if(ii=r.nextSibling,r.parentNode.removeChild(r),r==h)break;r=ii;continue}f[o]=r;o++}if(r==h)break;r=r.nextSibling}o>0&&(y[e]=f)}return y};Sys.Extended.UI.HtmlEditor.unWrap=function(n,t){var f=this,i,e,u,r;if(n.firstChild){for(;n.firstChild&&3==n.firstChild.nodeType&&""+n.firstChild.data=="";)n.removeChild(n.firstChild);for(i=[];n.firstChild;)n.firstChild!=t[0]&&n.firstChild!=t[1]&&i.push(n.firstChild),n.parentNode.insertBefore(n.firstChild,n);for(0==i.length&&(r=f._doc.createElement("BR"),n.parentNode.insertBefore(r,n)),Sys.Extended.UI.HtmlEditor.isIE&&1==i.length&&3==i[0].nodeType&&(e=""+i[0].data,1==e.length&&160==e.charCodeAt(0)&&(r=f._doc.createElement("BR"),i[0].parentNode.insertBefore(r,i[0]),i[0].parentNode.removeChild(i[0])));n.nextSibling&&3==n.nextSibling.nodeType&&""+n.nextSibling.data=="";)n.parentNode.removeChild(n.nextSibling);u=n.previousSibling&&t[1]==n.previousSibling?t[1].previousSibling:n.previousSibling;(u&&Sys.Extended.UI.HtmlEditor.isInlineElement(u)&&1==u.nodeType&&u.childNodes.length>0&&(u=Sys.Extended.UI.HtmlEditor._getReallyLast(u)),Sys.Extended.UI.HtmlEditor.isInlineElement(u)&&null!=n.nextSibling)&&(r=f._doc.createElement("BR"),n.parentNode.insertBefore(r,n))}else r=f._doc.createElement("BR"),n.parentNode.insertBefore(r,n);n.parentNode.removeChild(n)};Sys.Extended.UI.HtmlEditor.tryUnWrap=function(n,t,i){var c=this,o;n.style.textAlign="";for(var s=0,h=n.attributes,e=0;e0&&"transparent"!=s)return s;o=o.parentNode}return"#FFFFFF"}u="none";switch(n.toLowerCase()){case"forecolor":u="color";break;case"fontname":u="font-family";break;case"fontsize":u="font-size"}if(("font-size"==u||"font-family"==u)&&this._FontNotSet)for(r="",i=e.start;null!=i;){if("font-size"==u){if(i.style&&i.style.fontSize&&i.style.fontSize.length>0){r=i.style.fontSize;break}if(i.tagName&&"FONT"==i.tagName.toUpperCase()&&i.size&&i.size.length>0){r=Sys.Extended.UI.HtmlEditor.fontSizeSeek(i.size);break}}else{if(i.style&&i.style.fontFamily&&i.style.fontFamily.length>0){r=i.style.fontFamily;break}if(i.tagName&&"FONT"==i.tagName.toUpperCase()&&i.face&&i.face.length>0){r=i.face;break}}if(i.className&&i.className.length>0){r=Sys.Extended.UI.HtmlEditor.getStyle(i,u).toLowerCase();"font-size"==u&&(Sys.Extended.UI.HtmlEditor.isIE||(r=Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt(r,this,t)));break}if(f=i.tagName.toUpperCase(),"BODY"==f||"TD"==f)break;i=i.parentNode}else if(r=Sys.Extended.UI.HtmlEditor.getStyle(e.start,u).toLowerCase(),"font-size"==u&&!Sys.Extended.UI.HtmlEditor.isIE)for(r=Sys.Extended.UI.HtmlEditor._TryTransformFromPxToPt(r,this,t),i=e.start;null!=i;){if(i.style&&i.style.fontSize&&i.style.fontSize.length>0){r=i.style.fontSize;break}if(i.className&&i.className.length>0)break;if(f=i.tagName.toUpperCase(),"BODY"==f||"TD"==f)break;i=i.parentNode}if(null!=this._StyleForTyping&&this._StyleForTyping.length>0)for(h=0;h0))return void(t._updateTimer=setTimeout(ui,100))}t._updated_now=!0;t._editPanel.updateToolbar();t._updated_now=!1;t._updateTimer=null;Sys.Extended.UI.HtmlEditor.isIE||t.focusEditor()}catch(n){}}var t,fi,vt,ei,yt,w,oi,pt,ct,nt,rt,u,hi,ci,ft,kt,dt,yi,y,c,a,et,g,it,ot,e,tt,ni,ti,wi,o,at,l,ri,h,ii,st,f,i;try{if(t=this,t._editPanel!=Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel)return!0;if(Sys.Extended.UI.HtmlEditor.isIE)try{fi=this._doc.selection;ei=this._createRange(fi)}catch(bi){return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}if("mousedown"!=n.type&&"dblclick"!=n.type||this._focus(!0),!Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type&&n.keyCode==Sys.UI.Key.tab&&this._editPanel.get_suppressTabInDesignMode())return Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel=null,!0;if(this.isPopup())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(vt=!1,t._contextElement&&null!=t._contextElement){if(Function.createDelegate(this,Sys.Extended.UI.HtmlEditor.RemoveContextMenu)(),"keydown"==n.type||"keypress"==n.type)return void Sys.Extended.UI.HtmlEditor._stopEvent(n);vt=!0}if("function"==typeof t.captureInDesign&&t.captureInDesign(n)===!1)return void Sys.Extended.UI.HtmlEditor._stopEvent(n);if(Sys.Extended.UI.HtmlEditor.isIE&&"mousedown"==n.type&&n.ctrlKey){var f=t._getSelection(),gi=n.clientX,nr=n.clientY;return setTimeout(function(){var r=t._getSelection(),i,n;for("control"!=r.type.toLowerCase()&&(i=t._doc.body.createTextRange(),i.moveToPoint(gi,nr),i.select()),r=t._getSelection(),i=t._createRange(r),n=Sys.Extended.UI.HtmlEditor.getSelParent(t);null!=n&&"BODY"!=n.tagName.toUpperCase();){if("A"==n.tagName.toUpperCase()&&null!=n.href&&"undefined"!=typeof n.href&&n.href.length>0){window.open(n.href,"LinkViewWindow");break}n=n.parentNode}},0),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}if(u=Sys.Extended.UI.HtmlEditor.isIE?n.srcElement:n.target,null==u.tagName||"undefined"==typeof u.tagName||"HTML"!=u.tagName.toUpperCase()&&"BODY"!=u.tagName.toUpperCase()?null!=Sys.Extended.UI.HtmlEditor.contentEditable(u)&&setTimeout(function(){t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel&&t.toEndOfProtected()},0):1!=t.__kkoka&&(t.__kkoka=!0,setTimeout(function(){if(t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel&&!t.toEndOfProtected())try{t.focusEditor()}catch(n){}t.__kkoka=!1},0)),vt&&Sys.Extended.UI.HtmlEditor.isIE){yt=this._getSelection();try{if(ei=this._createRange(yt),"control"==yt.type.toLowerCase())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}catch(bi){return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}}if(w=Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type||"keypress"==n.type,n.type+"--"+w,w&&!this._editPanel.get_keyboardEnabled())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(o=String.fromCharCode(Sys.Extended.UI.HtmlEditor.isIE?n.keyCode:n.charCode).toLowerCase(),w&&null!=t._editPanel.get_hotkeys()&&t._editPanel.get_hotkeys().length>0)for(oi=t._editPanel.get_hotkeys().length,pt=o,18!=n.keyCode&&17!=n.keyCode&&16!=n.keyCode||(pt=null),ct=0;ct=33&&n.keyCode<=40&&!n.shiftKey)hi=n.keyCode==Sys.UI.Key.pageDown||n.keyCode==Sys.UI.Key.end||n.keyCode==Sys.UI.Key.right||n.keyCode==Sys.UI.Key.down,setTimeout(function(){var u=t._getSelection(),r=t._createRange(u),n,i;"control"==u.type.toLowerCase()&&(n=r.item(0),n.contentEditable&&"false"!=n.contentEditable||(r.remove(0),u.empty(),r=t._createRange(u),i=t._doc.createElement("SPAN"),i.appendChild(t._doc.createTextNode("")),hi?null==n.nextSibling?n.parentNode.appendChild(i):n.parentNode.insertBefore(i,n.nextSibling):n.parentNode.insertBefore(i,n),r.moveToElementText(i),r.select(),setTimeout(function(){t.focusEditor();i.parentNode.removeChild(i)},0)))},0);else if((w&&!Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isSafari&&"keydown"==n.type)&&n.ctrlKey&&!n.altKey){t._a_prize=!1;var f=null,i=null,o=String.fromCharCode(Sys.Extended.UI.HtmlEditor.isIE||Sys.Extended.UI.HtmlEditor.isOpera||Sys.Extended.UI.HtmlEditor.isSafari?n.keyCode:n.charCode).toLowerCase(),p=null,ut=null;if((Sys.Extended.UI.HtmlEditor.isIE||Sys.Extended.UI.HtmlEditor.isSafari)&&17==n.keyCode)return!1;if(Sys.Extended.UI.HtmlEditor.isIE||n.keyCode!=Sys.UI.Key.end||n.shiftKey){if(46==n.keyCode&&this.isShadowed())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(46==n.keyCode||n.keyCode==Sys.UI.Key.backspace)(Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type||!Sys.Extended.UI.HtmlEditor.isIE&&"keypress"==n.type)&&this._saveContent();else switch(o){case"a":if(!Sys.Extended.UI.HtmlEditor.isIE)return f=this._getSelection(),this._removeAllRanges(f),i=this._createRange(),i.selectNodeContents(this._doc.body),this._selectRange(f,i),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;t._a_prize=!0;break;case"z":return this.undo(),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"p":if(!Sys.Extended.UI.HtmlEditor.isIE)return setTimeout(function(){t._contextMenuCallP()},0),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;break;case"y":return this.redo(),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"x":if(this.isShadowed())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(this._saveContent(),Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type)return t.openWait(),setTimeout(function(){t._copyCut(o,!1);t.closeWait()},0),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;break;case"c":if(this.isShadowed())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type)return t.openWait(),setTimeout(function(){t._copyCut(o,!1);t.closeWait();setTimeout(function(){t._ifShadow()},0)},0),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;break;case"v":if(this.isShadowed())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(Sys.Extended.UI.HtmlEditor.isIE)return this._saveContent(),!0;this._commonPaste(n);break;case"b":return this._execCommand("bold",!1,ut),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"i":return this._execCommand("italic",!1,ut),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"u":return this._execCommand("underline",!1,ut),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"s":return this._execCommand("strikethrough",!1,ut),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"l":p="justifyleft";break;case"e":p="justifycenter";break;case"r":p="justifyright";break;case"j":p="justifyfull";break;case"q":return alert(this._doc.body.innerHTML),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"0":return ci="Your browser:\n\n"+navigator.userAgent,alert(ci),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;case"9":if(Sys.Extended.UI.HtmlEditor.isIE)f=t._getSelection(),i=t._createRange(f),alert("boundingLeft: "+i.boundingLeft+" boundingTop: "+i.boundingTop+"\nboundingWidth: "+i.boundingWidth+" boundingHeight: "+i.boundingHeight);else{var f=t._getSelection(),i=t._createRange(f),r=i.startContainer,b=i.endContainer,k="";k+="startContainer: "+(1==r.nodeType?r.tagName:"text")+"\n";k+="endContainer : "+(1==b.nodeType?b.tagName:"text")+"\n";r==b&&(k+="startOffset: "+i.startOffset+"\n",k+="endOffset : "+i.endOffset+"\n",1==r.nodeType&&(r=r.childNodes.item(i.startOffset),r&&r.nodeType?(k+="startOffset node: "+(1==r.nodeType?r.tagName:"text")+"\n",i.startOffset!=i.endOffset&&(r=b.childNodes.item(i.endOffset),r&&r.nodeType&&(k+="endOffset node: "+(1==r.nodeType?r.tagName:"text")+"\n"))):k+=r));alert(k)}return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}}else t._setToEnd();p&&(this._execCommand(p,!1,ut),"formatblock"!=p||Sys.Extended.UI.HtmlEditor.isIE||(this._saveContent(),this._undo(!1)),Sys.Extended.UI.HtmlEditor._stopEvent(n),"delete"!=p&&"paste"!=p||this._clearP())}else if(w||(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&"keydown"==n.type){if(Sys.Extended.UI.HtmlEditor.isIE&&this._tryForward&&(i=this._createRange(this._getSelection()),i.select(),this._tryForward=!1),o=String.fromCharCode(Sys.Extended.UI.HtmlEditor.isIE?n.keyCode:n.charCode).toLowerCase(),t._a_prize&&(t._a_prize=!1,setTimeout(bi,0)),this.isShadowed())return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;switch(n.keyCode){case Sys.UI.Key.tab:if((Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&"keydown"!=n.type)break;if(this._editPanel.get_suppressTabInDesignMode())return Sys.Extended.UI.HtmlEditor.isSafari&&Sys.Extended.UI.HtmlEditor._stopEvent(n),Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel=null,!0;this.isControl()||this.insertHTML("        ");Sys.Extended.UI.HtmlEditor._stopEvent(n);break;case 46:case Sys.UI.Key.backspace:if((Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&"keydown"!=n.type)break;if(((Sys.Extended.UI.HtmlEditor.isIE||Sys.Extended.UI.HtmlEditor.isSafari)&&"keydown"==n.type||!Sys.Extended.UI.HtmlEditor.isIE&&"keypress"==n.type)&&this._saveContent(),Sys.Extended.UI.HtmlEditor.isIE){if(f=t._getSelection(),"control"==f.type.toLowerCase()){if(8==n.keyCode)return setTimeout(function(){t._ifShadow();t.onContentChanged()},0),void Sys.Extended.UI.HtmlEditor._stopEvent(n);if(c=t._createRange(f),ft=c.item(0),"EMBED"==ft.tagName.toUpperCase()){for(ft.src="",ft.parentNode.removeChild(ft);c.length>0;)c.remove(0);try{c.collapse(!1)}catch(n){}return Sys.Extended.UI.HtmlEditor._stopEvent(n),t._saveContent(),void setTimeout(function(){t._undo(!1);t.onContentChanged()},0)}}kt=t._doc.body.getElementsByTagName("EMBED").length;kt>0&&(dt=t._body.ownerDocument.createElement("div"),t._body.appendChild(dt),n.keyCode,setTimeout(function(){t._body.removeChild(dt);var n=t._doc.body.getElementsByTagName("EMBED");kt!=n.length&&(t._saveContent(),setTimeout(function(){t._undo(!1);t.onContentChanged()},0))},0));setTimeout(function(){t._clearP()},0)}else{var i=this._createRange(this._getSelection()),r=i.startContainer,b=i.endContainer;if("keypress"==n.type&&(null!=Sys.Extended.UI.HtmlEditor.contentEditable(r)||null!=Sys.Extended.UI.HtmlEditor.contentEditable(b)))return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(r==b&&1==r.nodeType&&"TD"==r.tagName.toUpperCase()&&i.startOffset==i.startOffset&&r.childNodes.item(i.startOffset)&&r.childNodes.item(i.startOffset).tagName&&"BR"==r.childNodes.item(i.startOffset).tagName.toUpperCase()){for(var li=r.childNodes.item(i.startOffset),ai=0,vi=0,d=li.previousSibling;d;)ai++,d=d.previousSibling;for(d=li.nextSibling;d;)vi++,d=d.nextSibling;if(46==n.keyCode&&0==vi||n.keyCode==Sys.UI.Key.backspace&&0==ai||46==n.keyCode&&r.firstChild==r.lastChild&&1==r.firstChild.nodeType)return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}if(r==b&&3==r.nodeType&&i.startOffset==i.endOffset&&!Sys.Extended.UI.HtmlEditor.isOpera){if(yi=r.data+"",46==n.keyCode&&i.startOffset==yi.length&&(!r.nextSibling||3!=r.nextSibling.nodeType))return r.nextSibling&&(r.parentNode.removeChild(r.nextSibling),t.onContentChanged()),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;if(n.keyCode==Sys.UI.Key.backspace&&0==i.startOffset&&(!r.previousSibling||3!=r.previousSibling.nodeType))return r.previousSibling&&(r.parentNode.removeChild(r.previousSibling),t.onContentChanged()),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}if(n.keyCode==Sys.UI.Key.backspace&&1==r.nodeType&&r==b&&i.startOffset==i.endOffset&&(y=r.childNodes.item(i.startOffset),null!=y&&1==y.nodeType&&"BR"==y.tagName.toUpperCase()&&(y=y.previousSibling,null!=y&&3!=y.nodeType)))return y.parentNode.removeChild(y),t.onContentChanged(),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1;setTimeout(function(){var o=t._getSelection(),n=t._createRange(o),f=n.startContainer,s=n.endContainer,i;if(null!=Sys.Extended.UI.HtmlEditor.contentEditable(f)||null!=Sys.Extended.UI.HtmlEditor.contentEditable(s))return void t._undo(!1);if(Sys.Extended.UI.HtmlEditor.isOpera&&f==s&&3==f.nodeType&&0==f.data.length)f.parentNode.removeChild(f);else if(f==s&&1==f.nodeType&&Sys.Extended.UI.HtmlEditor.isStyleTag(f.tagName)&&n.startOffset==n.endOffset&&0==f.childNodes.length){for(;1==f.parentNode.nodeType&&Sys.Extended.UI.HtmlEditor.isStyleTag(f.parentNode.tagName)&&1==f.parentNode.childNodes.length;)f=f.parentNode;var r=f.nextSibling,u=f.previousSibling,e=f.parentNode;(e.removeChild(f),t.onContentChanged(),null==r&&null==u)?(n.setStart(e,0),n.setEnd(e,0)):null!=r&&null!=u?3==r.nodeType&&3==u.nodeType?(i=(""+u.data).length,u.appendData(r.data),e.removeChild(r),n.setStart(u,i),n.setEnd(u,i)):3==u.nodeType?(i=(""+u.data).length,n.setStart(u,i),n.setEnd(u,i)):3==r.nodeType?(n.setStart(r,0),n.setEnd(r,0)):r.childNodes.length>0?(n.setStart(r,0),n.setEnd(r,0)):(i=Sys.Extended.UI.HtmlEditor.__getIndex(r),n.setStart(e,i),n.setEnd(e,i)):null!=u?3==u.nodeType?(i=(""+u.data).length,n.setStart(u,i),n.setEnd(u,i)):(i=u.childNodes.length,i>0?(n.setStart(u,i),n.setEnd(u,i)):(i=Sys.Extended.UI.HtmlEditor.__getIndex(u),n.setStart(e,i),n.setEnd(e,i))):null!=r&&(3==r.nodeType?(n.setStart(r,0),n.setEnd(r,0)):(i=r.childNodes.length,i>0?(n.setStart(r,i),n.setEnd(r,i)):(i=Sys.Extended.UI.HtmlEditor.__getIndex(r),n.setStart(e,i),n.setEnd(e,i))));t._removeAllRanges(o);t._selectRange(o,n)}},0)}break;case Sys.UI.Key.enter:if((Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&"keydown"==n.type)break;if((!Sys.Extended.UI.HtmlEditor.isIE&&"keypress"==n.type||Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type)&&this._saveContent(),Sys.Extended.UI.HtmlEditor.isIE&&"keydown"==n.type){if(f=t._getSelection(),"control"==f.type.toLowerCase())break;if(c=t._createRange(f),n.shiftKey)break;if(e=c.parentElement(),"TEXTAREA"==e.tagName.toUpperCase())break;for(;e&&e.tagName&&"BODY"!=e.tagName.toUpperCase()&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName);)e=e.parentNode;if(e&&e.tagName&&(a=e.tagName.toUpperCase(),"P"==a||"LI"==a)){"LI"==a&&setTimeout(ki,0);break}try{var gt=Sys.Extended.UI.HtmlEditor.smartClassName+"_middle_add",s=null,tt="<\/span>";if(c.pasteHTML(tt),et=!1,s=t._doc.getElementById(gt),null!=s){for(g=s.nextSibling,it=s.parentNode;null==g&&null!=it&&Sys.Extended.UI.HtmlEditor.isStyleTag(it.tagName);)g=it.nextSibling,it=it.parentNode;null==g||Sys.Extended.UI.HtmlEditor.isInlineElement(g)||null==g.tagName||"undefined"==typeof g.tagName||(ot=g.tagName.toUpperCase(),"BR"!=ot&&"UL"!=ot&&"OL"!=ot&&"P"!=ot&&(et=!0));s.parentNode.removeChild(s)}if(c.pasteHTML("
"+(et?tt:"")),et&&(s=t._doc.getElementById(gt)),c.select(),et)return setTimeout(di,0),Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}catch(n){}Sys.Extended.UI.HtmlEditor._stopEvent(n)}else if(!n.shiftKey&&(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)){for(e=Sys.Extended.UI.HtmlEditor.getSelParent(this),3==e.nodeType&&(e=e.parentNode);e&&e.tagName&&"BODY"!=e.tagName.toUpperCase()&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName);)e=e.parentNode;if(e&&e.tagName&&("P"==e.tagName.toUpperCase()||"LI"==e.tagName.toUpperCase()))break;tt="
";Sys.Extended.UI.HtmlEditor.isOpera&&(f=t._getSelection(),i=t._createRange(f),i.startContainer==i.endContainer&&(1==i.startContainer.nodeType?(ni=i.startContainer.childNodes.item(i.startOffset),1==ni.nodeType&&"BR"==ni.tagName.toUpperCase()&&(tt+="
")):3!=i.startContainer.nodeType||i.startOffset!=i.endOffset||i.startContainer.data.length!=i.endOffset||i.startContainer.nextSibling&&3==i.startContainer.nextSibling.nodeType||(tt+=" ")));(this.insertHTML(tt),Sys.Extended.UI.HtmlEditor._stopEvent(n),Sys.Extended.UI.HtmlEditor.isOpera)&&(f=t._getSelection(),i=t._createRange(f),i.startContainer==i.endContainer&&3==i.startContainer.nodeType&&i.startOffset==i.endOffset&&0==i.startContainer.data.length&&(ti=i.startContainer.previousSibling,i.startContainer.parentNode.removeChild(i.startContainer),t._removeAllRanges(f),i=t._createRange(),i.setStart(ti,0),i.setEnd(ti,1),t._selectRange(f,i)));t.onContentChanged()}else Sys.Extended.UI.HtmlEditor.isSafari&&(this.insertHTML("
"),Sys.Extended.UI.HtmlEditor._stopEvent(n),t.onContentChanged())}}else t._a_prize=!1;if(Sys.Extended.UI.HtmlEditor.isIE&&"keypress"==n.type&&!n.ctrlKey){var o=n.keyCode,ii=t._getSelection(),st=t._createRange(ii);if(st.text.length>0){var ht=String.fromCharCode(o),pi=Sys.Extended.UI.HtmlEditor.capLock(n),tr=n.shiftKey&&!pi||pi;return tr||(ht=ht.toLowerCase()),l=Sys.Extended.UI.HtmlEditor.smartClassName+"StyleForTyping",h=t._doc.getElementById(l),null!=h&&(ht="<\/span>"+ht+"<\/span>",h.parentNode.removeChild(h)),st.pasteHTML(ht),null!=h&&(t.trickWithStyles(l),h=t._doc.getElementById(l+l),h.parentNode.removeChild(h)),Sys.Extended.UI.HtmlEditor._stopEvent(n),t.onContentChanged(),!1}}if("mouseup"==n.type||"mousedown"==n.type||"keydown"==n.type){if(wi=!0,"keydown"==n.type&&!n.ctrlKey&&(o=n.keyCode,(o>=48&&o<=90||32==o||13==o||o>=186&&o<=222||o>=96&&o<=111)&&null!=t._StyleForTyping)){for(t.n_arr=[],at=0;at <\/span>"),h=t._doc.getElementById(l),h&&h.nextSibling&&3==h.nextSibling.nodeType?(ri=!1,ii=t._getSelection(),st=t._createRange(ii),st.moveToElementText(t._doc.getElementById(l)),st.select()):h&&h.removeChild(h.firstChild)):t.insertHTML("<\/span>");ri&&setTimeout(function(){t.trickWithStyles(l);t.onContentChanged()},0)}!wi&&Sys.Extended.UI.HtmlEditor.isIE||t._updated_now||(t._updateTimer&&(clearTimeout(t._updateTimer),t._updateTimer=null),t._updateTimerLimit=3,t._updateTimer=setTimeout(ui,300))}return((Sys.Extended.UI.HtmlEditor.isIE||"keydown"!=n.type&&"keyup"!=n.type)&&(!Sys.Extended.UI.HtmlEditor.isIE||"keydown"!=n.type&&"keyup"!=n.type||16!=n.keyCode&&20!=n.keyCode)&&(t._StyleForTyping=null),Sys.Extended.UI.HtmlEditor.isSafari&&setTimeout(function(){t._createRange(t._getSelection())},0),Sys.Extended.UI.HtmlEditor.isIE||setTimeout(function(){var i,n,r;t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel&&(i=t._getSelection(),n=t._createRange(i),3!=n.startContainer.nodeType&&n.startContainer==n.endContainer&&n.startOffset==n.endOffset&&n.startContainer.childNodes.item(n.startOffset)&&3==n.startContainer.childNodes.item(n.startOffset).nodeType&&(r=n.startContainer.childNodes.item(n.startOffset),i.collapseToEnd(),t._removeAllRanges(i),i=t._getSelection(),n=t._createRange(i),n.setStart(r,0),n.setEnd(r,0),t._selectRange(i,n)))},0),Sys.Extended.UI.HtmlEditor.isIE)||(f=t._getSelection(),i=t._createRange(f),t._saved_startContainer=i.startContainer,t._saved_startOffset=i.startOffset),setTimeout(function(){try{t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel&&t._ifShadow()}catch(n){}},0),"keydown"==n.type&&(null!=t._AfterOnContentChanged&&"undefined"!=typeof t._AfterOnContentChanged&&t._AfterOnContentChanged||(t._AfterOnContentChanged=!0,setTimeout(function(){t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel&&(t.onContentChanged(),t._AfterOnContentChanged=!1)},0))),!0}catch(bi){return Sys.Extended.UI.HtmlEditor._stopEvent(n),!1}};Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.ModePanel=function(n){Sys.Extended.UI.HtmlEditor.ModePanel.initializeBase(this,[n]);this._activated=!1;this._isActivating=!1;this._editPanel=null;this._cachedContent=null;this._onbeforeunload$delegate=Function.createDelegate(this,this._onbeforeunload)};Sys.Extended.UI.HtmlEditor.ModePanel.prototype={set_editPanel:function(n){this._editPanel=n},get_content:function(){return this._activated?this._getContent():null!=this._cachedContent?this._cachedContent:""},set_content:function(n){if(this._cachedContent=n,this._activated||this._isActivating){if(this._isActivating){var t=this;return setTimeout(function(){t.set_content(n)},10),!1}this._setContent(n)}else this._activate(n);return!0},_activate:function(){this.get_element().style.display="";this._isActivating=!0},_activateFinished:function(){this._activated=!0;this._isActivating=!1;this._editPanel._setActive();this._editPanel.get_autofocus()&&this._focus()},_deactivate:function(){this.get_element().style.display="none";this._activated=!1;this._isActivating=!1},initialize:function(){Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"initialize");Sys.Extended.UI.HtmlEditor.isIE&&$addHandlers(window,{beforeunload:this._onbeforeunload$delegate})},dispose:function(){Sys.Extended.UI.HtmlEditor.isIE&&$common.removeHandlers(window,{beforeunload:this._onbeforeunload$delegate});this._activated&&(Sys.Extended.UI.HtmlEditor.isIE&&this._onbeforeunload(),this._deactivate());Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"dispose")},_onbeforeunload:function(){this._activated&&(this._editPanel._contentPrepared||(this._editPanel._prepareContentForPostback(this.get_content()),this._editPanel._contentPrepared=!0))},_getContent:function(){return null!=this._cachedContent?this._cachedContent:""},_setContent:function(){},_focus:function(){this._focused()},_focused:function(n){this._editPanel._focused(n);this._editPanel.set_autofocus(!0)},_really_focused:function(){this._editPanel._really_focused();this._editPanel.set_autofocus(!0)}};Sys.Extended.UI.HtmlEditor.ModePanel.registerClass("Sys.Extended.UI.HtmlEditor.ModePanel",Sys.UI.Control);Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.DesignPanel=function(n){Sys.Extended.UI.HtmlEditor.DesignPanel.initializeBase(this,[n]);this._doc=null;this._updated_now=!1;this._updateTimer=null;this._popup=null;this._contextElement=null;this._a_prize=!1;this.__stack=null;this._StyleForTyping=null;this.isWord=!1;this.isPlainText=!1;this.dfltBlockElement="P";this._FontNotSet=!0;this._design_timer1=null;this._events$delegate=Function.createDelegate(this,Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler);this._blur$delegate=Function.createDelegate(this,this._blur);this._focus$delegate=Function.createDelegate(this,this._focus_event)};Sys.Extended.UI.HtmlEditor.DesignPanel.prototype={initialize:function(){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"dispose")},_activate:function(n){Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"_activate");this._wasFocused=!1;this._initIframe(n);this._onDocumentLoaded()},_deactivate:function(){this._deactivateCommon();Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.open(),this._doc.write(""),this._doc.close(),this.get_element().src="javascript:false;");this._doc=null;Sys.Extended.UI.HtmlEditor.DesignPanel.callBaseMethod(this,"_deactivate")},_deactivateCommon:function(){this._editPanel.__blured=!1;for(var t=this._doc.body.getElementsByTagName("IMG"),n=0;n0)try{Sys.Extended.UI.HtmlEditor.isIE?$removeHandler(t[n],"dragstart",Sys.Extended.UI.HtmlEditor.stopDrag):$removeHandler(t[n],"draggesture",Sys.Extended.UI.HtmlEditor.stopDrag)}catch(t){}Sys.Extended.UI.HtmlEditor._removeEvents(this._doc,["keydown","keypress","mousedown","mouseup","dblclick"],this._events$delegate);Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["blur"],this._blur$delegate);Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["focus"],this._focus$delegate)},_initIframe:function(n){Sys.Extended.UI.HtmlEditor.isIE||(this._savedValue=n,this._absAndFixedParents=this._getAbsAndFixedParents());var t=Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(n));this._doc=this.get_element().contentWindow.document;Sys.Extended.UI.HtmlEditor.isIE||(this._doc.designMode="on");this._doc.open();this._doc.write('<\/head>'+t+"<\/body><\/html>");this._doc.close();this._doc.id="EditorDocument";Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.body.contentEditable=!0,this._tryForward=!0)},_blur:function(n){return this._editPanel.__blured=!0,Sys.Extended.UI.HtmlEditor.isIE||null==this._design_timer1||(clearTimeout(this._design_timer1),this._design_timer1=null),this.isPopup||this._editPanel._validate(n,null),!0},_focus_event:function(){if(this._editPanel.__blured=!1,Sys.Extended.UI.HtmlEditor.isIE)this._really_focused();else{var n=this;Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel=this._editPanel;null==this._design_timer1&&(this._design_timer1=setTimeout(function(){n._really_focused();n._design_timer1=null},0))}return!0},_getAbsAndFixedParents:function(){for(var n=this.get_element(),t="";null!=n&&n.tagName&&"body"!=n.tagName.toLowerCase();)t+=n.tagName,"absolute"!=n.style.position&&"fixed"!=n.style.position||(t+=": "+n.style.position),t+="\n",n=n.parentNode;return t},_onDocumentLoaded:function(){var n=this,t;if(!Sys.Extended.UI.HtmlEditor.isIE&&(t=this._getAbsAndFixedParents(),t!=this._absAndFixedParents))return this._initIframe(this._savedValue),void setTimeout(function(){n._onDocumentLoaded()},10);try{if(!Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.queryCommandValue("forecolor"),(Sys.Extended.UI.HtmlEditor.isSafari||Sys.Extended.UI.HtmlEditor.isOpera)&&!Sys.Extended.UI.HtmlEditor.isReallyVisible(this.get_element())))return void setTimeout(function(){n._onDocumentLoaded()},10);n._doc.body.innerHTML}catch(t){return void setTimeout(function(){n._onDocumentLoaded()},10)}this._afterBodyIsFormed();setTimeout(function(){n._activateFinished();Sys.Extended.UI.HtmlEditor.isIE&&!n._editPanel.get_autofocus()&&n._getSelection().empty()},0)},_afterBodyIsFormed:function(){var i=this,n,t;if(Sys.Extended.UI.HtmlEditor._addEvents(this._doc,["keydown","keypress","mousedown","mouseup","dblclick"],this._events$delegate),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor.inspectForShadows(i._doc.body),n=this._doc.body,1==n.childNodes.length&&n.firstChild.tagName&&"DIV"==n.firstChild.tagName.toUpperCase()&&n.firstChild.style.cssText.length>0&&n.firstChild.style.direction.length>0&&"absolute"!=Sys.Extended.UI.HtmlEditor.getStyle(n.firstChild,"position")){for(n.style.cssText=n.firstChild.style.cssText,t=n.firstChild;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}i._clearP()},_getContent:function(){var y,n,p,u,l,s,h,t,e,c,i,f;if(null!=this._popup&&"function"==typeof this._popup._forceImClose&&(y=this._popup._forceImClose,y(this._popup._iframe.contentWindow)),this._clearP(),Sys.Extended.UI.HtmlEditor.isIE)Sys.Extended.UI.HtmlEditor.spanJoiner(this._doc.body,this._doc),n=Sys.Extended.UI.HtmlEditor.getHTML(this._doc.body,!1,!0),n=n.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/gi,"$1 $3").replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/gi,"$1
$3").replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/gi,"$1
$3"),n=(this._doc.body.style.cssText.length>0?'

':"")+n+(this._doc.body.style.cssText.length>0?"<\/div>":""),this._editPanel.get_noScript()&&(n=n.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,"")),/)/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1$3").replace(/()/gi,"$1wmode=$3$4").replace(/()/gi,"$1$3")),p=new RegExp("(<[/]?)(teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":)","ig"),n=n.replace(p,"$1");else{u=this._doc.createElement("DIV");l=new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover;u.style.cssText=this._doc.body.style.cssText;this._editPanel.get_noScript()||this._doc.body.innerHTML.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi,function(n,t){return l.regReplScript1(n,t)});u.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML);for(var w=u.getElementsByTagName("IMG"),a=[],e=0;e0&&"embed"==h.toLowerCase()){var k=t.getAttribute("dummysrc"),o=t.getAttribute("dummybgcolor"),v=t.getAttribute("pseudomode"),b=t.attributes,r=this._doc.createElement("EMBED");for(r.src=k,r.width=t.width,r.height=t.height,o&&o.length>0&&(o=Sys.Extended.UI.HtmlEditor.tryReplaceRgb(o),r.setAttribute("bgcolor",o)),v&&v.length>0&&r.setAttribute("wmode",v),e=0;e0&&(r.style.width=t.style.width);t.style.height&&t.style.height.length>0&&(r.style.height=t.style.height);t.parentNode.insertBefore(r,t);t.parentNode.removeChild(t)}Sys.Extended.UI.HtmlEditor.spanJoiner(u,this._doc);n=Sys.Extended.UI.HtmlEditor.getHTML(u,u.style.cssText.length>0,!0);n=this._editPanel.get_noScript()?n.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,""):n.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi,function(n,t,i,r){return l.regReplFromScript1(n,t,i,r)});delete u}return n=Sys.Extended.UI.HtmlEditor.brXHTML(n.replace(/^([\n|\r]+)/,"")),this._editPanel.get_noUnicode()&&(n=n.replace(/([\u0080-\uFFFF])/g,function(n,t){return"&#"+t.charCodeAt(0).toString(10)+";"})),"
"==Sys.Extended.UI.HtmlEditor.Trim(n)&&(n=""),n},_setContent:function(n){this._deactivateCommon();var t=Sys.Extended.UI.HtmlEditor.Trim(this._prepareContent(n));this._doc.open();this._doc.write('<\/head>'+t+"<\/body><\/html>");this._doc.close();Sys.Extended.UI.HtmlEditor.isIE&&(this._doc.body.contentEditable=!0,this._tryForward=!0);this._afterBodyIsFormed();this._editPanel.get_autofocus()&&this._focus();Sys.Extended.UI.HtmlEditor.isIE&&!this._editPanel.get_autofocus()&&this._getSelection().empty()},_focus:function(n){this.focusEditor();this._focused(n)},focusEditor:function(){try{this.get_element().contentWindow.focus()}catch(n){}this._wasFocused||(this._wasFocused=!0,this._editPanel.get_startEnd()||this._setToEnd())},_prepareContent:function(n){var t=n,o,e,s,f,h,u,n;if(t=t.replace(/]*?)>(?:[^\u0000]*?)(]*?)>)(?:[^\u0000]*?)<\/object(?:[^>]*?)>/gi,"$1"),Sys.Extended.UI.HtmlEditor.isIE)return t=Sys.Extended.UI.HtmlEditor.Trim(t.replace(/([\n\r]+<)/g,"<").replace(/([^>])([\n\r]+)([^<])/g,"$1 $3")).replace(/(&)/g,"&amp;").replace(/\s*<\/td>/gi,"<\/td>").replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/gi,"$1 $3").replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/gi,"$1 $3"),/)/gi,"$1pseudomode=$3$4").replace(/(]*?>)/gi,'$1 wmode="transparent"$2')),t=t.replace(/&/gi,"&");o=new Sys.Extended.UI.HtmlEditor.DesignPanel.ScriptRecover;e=document.createElement("DIV");this._editPanel.get_noScript()||t.replace(/]*?)>(.*?)<\/script(?:[^>]*?>)/gi,function(n,t){return o.regReplScript1(n,t)});e.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(t.replace(/([^>])([\n\r]+)([^<])/g,"$1 $3"));for(var l=e.getElementsByTagName("EMBED"),c=[],f=0;f0&&(r.style.width=i.style.width);i.style.height&&i.style.height.length>0&&(r.style.height=i.style.height);i.parentNode.insertBefore(r,i);i.parentNode.removeChild(i)}return Sys.Extended.UI.HtmlEditor.spanJoiner(e,document),t=Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(e,!1,!0)),this._editPanel.get_noScript()||(t=t.replace(/(]*?)>)(.*?)(<\/script(?:[^>]*?)>)/gi,function(n,t,i,r){return o.regReplFromScript1(n,t,i,r)})),delete e,delete o,t=Sys.Extended.UI.HtmlEditor.brXHTML(t),0==t.length&&(t="
"),t},_clearP:function(){function u(n){var i=!1,t;if(1==n.nodeType){if((t=n.tagName.toUpperCase(),(!f||"LI"!=t)&&(Sys.Extended.UI.HtmlEditor.isRestricted(n)||"IMG"==t||"IFRAME"==t||"EMBED"==t||"SCRIPT"==t))||n.childNodes.length>1)return!0;if(0==n.childNodes.length)return!1;i|=u(n.firstChild)}else 3==n.nodeType&&(i|=!0);return i}var n,i,t,r,f;try{n=this._doc.body;n.firstChild&&3==n.firstChild.nodeType&&(i=Sys.Extended.UI.HtmlEditor.Trim(""+n.firstChild.data),0==i.length?n.removeChild(n.firstChild):i!=""+n.firstChild.data&&(n.firstChild.data=i));Sys.Extended.UI.HtmlEditor.isIE&&1==n.childNodes.length&&(n=n.firstChild,1==n.nodeType)&&(t=n.tagName.toLowerCase(),("p"==t||"ul"==t||"ol"==t)&&(r=!1,f="ul"==t||"ol"==t,1==n.childNodes.length&&(u(n.firstChild)||n.removeChild(n.firstChild)),r=!0,(r||"

 <\/p>"==n.parentNode.innerHTML.toLowerCase())&&this._doc.body.removeChild(n)))}catch(u){}},isControl:function(){var i,n,t;try{return(i=this._getSelection(),Sys.Extended.UI.HtmlEditor.isIE)?"control"==i.type.toLowerCase():(n=this._createRange(i),t=this._getParent(n),3!=t.nodeType&&n.startContainer==n.endContainer&&!!t.tagName&&null!=n.startContainer.childNodes.item(n.startOffset)&&(n.startOffset!=n.endOffset||!n.startContainer.childNodes.item(n.startOffset).tagName||"BR"!=n.startContainer.childNodes.item(n.startOffset).tagName.toUpperCase()&&!Sys.Extended.UI.HtmlEditor.isStyleTag(n.startContainer.childNodes.item(n.startOffset).tagName))&&!("BODY"==t.tagName.toUpperCase()&&0==n.startOffset&&n.endOffset>0&&n.endOffset==t.childNodes.length)&&(n.startOffset!=n.endOffset||3!=n.startContainer.childNodes.item(n.startOffset).nodeType))}catch(i){return!0}},isPopup:function(){return null!=this._popup},_getSelection:function(){var n,t,i,r;if(Sys.Extended.UI.HtmlEditor.isIE)return n=this._doc.selection;this.focusEditor();r=this.get_element().contentWindow;n=r.getSelection();t=this._createRange(n);i=t.startContainer;try{for(;i&&i.nodeType;)i=i.parentNode}catch(i){this._removeAllRanges(n);t=this._createRange(n);t.setStart(this._saved_startContainer,this._saved_startOffset);t.setEnd(this._saved_startContainer,this._saved_startOffset);this._selectRange(n,t);n=r.getSelection()}return n},_createRange:function(n){if(Sys.Extended.UI.HtmlEditor.isIE)return"undefined"==typeof n?this._doc.body.createTextRange():n.createRange();if(this.focusEditor(),"undefined"==typeof n)return this._doc.createRange();try{return n.getRangeAt(0)}catch(n){return this._doc.createRange()}},toEndOfProtected:function(){var i=this,f=this._getSelection(),n,r,u,t;try{t=this._createRange(f)}catch(t){return!1}if(Sys.Extended.UI.HtmlEditor.isIE?n=Sys.Extended.UI.HtmlEditor.contentEditable(Sys.Extended.UI.HtmlEditor.getSelParent(i)):(n=Sys.Extended.UI.HtmlEditor.contentEditable(t.startContainer),null==n&&(n=Sys.Extended.UI.HtmlEditor.contentEditable(t.endContainer))),Sys.Extended.UI.HtmlEditor.isIE&&null!=n){try{t.remove(n)}catch(t){}t=i._doc.body.createControlRange();t.add(n);t.select()}else Sys.Extended.UI.HtmlEditor.isIE||null==n||(u=i._getSelection(),null!=n.nextSibling&&3==n.nextSibling.nodeType?r=n.nextSibling:(r=i._doc.createTextNode(""),null!=n.nextSibling?n.parentNode.insertBefore(r,n.nextSibling):n.parentNode.appendChild(r)),i._removeAllRanges(u),t=i._createRange(u),t.setStart(r,0),t.setEnd(r,0),i._selectRange(u,t));return!0},_commonPaste:function(n){var t=this,r,i,f,u;(this._saveContent(),Sys.Extended.UI.HtmlEditor.isIE)?(this.openWait(),setTimeout(function(){t._paste(!t._editPanel.get_noPaste());t.closeWait()},0),Sys.Extended.UI.HtmlEditor._stopEvent(n)):this.isPlainText||this.isWord||this._editPanel.get_noPaste()?(r=t._getSafePlace(),null!=r?(i=t._doc.createElement("div"),i.style.display="inline",i.style.borderStyle="none",r.parentNode.insertBefore(i,r),i.appendChild(r),i.removeChild(r),i.innerHTML="xx",f=t._getSelection(),u=t._createRange(),t._removeAllRanges(f),u.setStart(i.firstChild,0),u.setEnd(i.firstChild,1),t._selectRange(f,u),t.openWait(),setTimeout(function(){var h=i.parentNode,f,o,r,n,u,s,e;for((i.lastChild.deleteData(i.lastChild.length-1,1),t.isWord)?(i.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(i.innerHTML),Sys.Extended.UI.HtmlEditor.replaceOldTags(i,t),Sys.Extended.UI.HtmlEditor.spanJoiner(i,t._doc)):(f=document.createElement("div"),f.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(i.innerHTML),o=new Sys.Extended.UI.HtmlEditor.jsDocument(!0),Sys.Extended.UI.HtmlEditor.__MozillaGetInnerText(f,o),i.innerHTML=o.toString().replace(//g,">").replace(/\r/g,"").replace(/\n/g,"
").replace(/\t/g," "),delete f);i.firstChild;)h.insertBefore(i.firstChild,i);r=null;n=null;i.nextSibling&&3==i.nextSibling.nodeType&&i.previousSibling&&3==i.previousSibling.nodeType&&(r=i.nextSibling,n=i.previousSibling);h.removeChild(i);u=null;(null!=r&&null!=n&&(u=n.data.length,n.data=""+n.data+r.data,r.parentNode.removeChild(r)),t.isWord=!1,t.isPlainText=!1,t.closeWait(),null!=u)&&(s=t._getSelection(),e=t._createRange(),t._removeAllRanges(s),e.setStart(n,u),e.setEnd(n,u),t._selectRange(s,e));t.onContentChanged()},0)):Sys.Extended.UI.HtmlEditor._stopEvent(n)):setTimeout(function(){Sys.Extended.UI.HtmlEditor.operateAnchors(t,t._doc,!t._editPanel.get_showAnchors());Sys.Extended.UI.HtmlEditor.operatePlaceHolders(t,t._doc,!t._editPanel.get_showPlaceHolders());Sys.Extended.UI.HtmlEditor.inspectForShadows(t._doc.body);t._checkImages(t._doc.body);t.onContentChanged()},0)},_selectRange:function(n,t){n.addRange(t);this.focusEditor()},_selectRng:function(n){var i=this._getSelection(),f,e;if(Sys.Extended.UI.HtmlEditor.isIE){var t=this._createRange(i),r=this._createRange(i),o=this._doc.createElement("span"),u=this._doc.createElement("span");n[0].parentNode.insertBefore(o,n[0]);n[n.length-1].nextSibling?n[n.length-1].parentNode.insertBefore(u,n[n.length-1].nextSibling):n[n.length-1].parentNode.appendChild(u);try{t.moveToElementText(o);f=t.moveStart("character",1);t.moveStart("character",-f);r.moveToElementText(u);f=r.moveEnd("character",-1);r.moveEnd("character",-f);t.setEndPoint("EndToEnd",r);t.select()}catch(n){}n[0].parentNode.removeChild(o);n[n.length-1].parentNode.removeChild(u)}else e=this._doc.createRange(),e.setStart(n[0],0),e.setEnd(n[n.length-1],(""+n[n.length-1].data).length),this._removeAllRanges(i),this._selectRange(i,e)},_removeAllRanges:function(n){n.removeAllRanges()},_setToEnd:function(){var n=this;setTimeout(function(){n._setToEnd_();n._editPanel.updateToolbar()},0)},_setToEnd_:function(){var n=this,e,u,r,i;if(Sys.Extended.UI.HtmlEditor.isIE)return u=n._getSelection(),r=n._createRange(u),"control"!=u.type.toLowerCase()&&(r.moveEnd("textedit",1),r.collapse(!1)),r.select(),void n.focusEditor();var f=0,t=n._doc.body,i=null;if(t.lastChild&&3==t.lastChild.nodeType?(t=t.lastChild,f=(""+t.data).length):(e=n._doc.createTextNode(""),t.lastChild&&1==t.lastChild.nodeType&&"BR"==t.lastChild.tagName.toUpperCase()?t.insertBefore(e,t.lastChild):t.appendChild(e),t=e,f=0),u=n._getSelection(),n._removeAllRanges(u),r=n._createRange(),r.setStart(t,f),r.setEnd(t,f),n._selectRange(u,r),null!=i&&n._doc.body.removeChild(i),n.focusEditor(),!Sys.Extended.UI.HtmlEditor.isSafari&&!Sys.Extended.UI.HtmlEditor.isOpera)try{i=n._doc.createElement("button");i.style.width="0px";i.style.height="20px";n._doc.body.appendChild(i);i.focus();i.blur();n.focusEditor();n._doc.body.removeChild(i)}catch(n){}},isShadowed:function(){var t,i,n,r,u;if(!this.isControl())return!1;if(i=this._getSelection(),n=this._createRange(i),t=Sys.Extended.UI.HtmlEditor.isIE?n.item(0):n.startContainer.childNodes.item(n.startOffset),t.tagName&&"IMG"==t.tagName.toUpperCase()&&t.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute)&&t.getAttribute(Sys.Extended.UI.HtmlEditor.attachedIdAttribute).length>0){if(r=this.getAttachedElement(t),null!=r){if(Sys.Extended.UI.HtmlEditor.isIE)n=this._doc.body.createControlRange(),n.add(r),n.select();else try{u=Sys.Extended.UI.HtmlEditor.__getIndex(r);i.collapseToEnd();this._removeAllRanges(i);n=this._createRange(i);n.setStart(r.parentNode,u);n.setEnd(r.parentNode,u+1);this._selectRange(i,n)}catch(t){return!0}return!1}return!0}return!1},_ifShadow:function(){var f,u,t;if(Sys.Extended.UI.HtmlEditor.isIE)try{this._doc.selection}catch(i){return!1}for(var i=this,r=null,n=Sys.Extended.UI.HtmlEditor.getSelParent(i);n&&(3==n.nodeType||n.tagName&&"BODY"!=n.tagName.toUpperCase());)if(3!=n.nodeType&&n.tagName){if(f=n.tagName.toUpperCase(),"TABLE"==f&&n.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute)&&"yes"==n.getAttribute(Sys.Extended.UI.HtmlEditor.noContextMenuAttribute)){r=n.rows.item(0).cells.item(0).firstChild;Sys.Extended.UI.HtmlEditor.isIE&&"P"==f&&(r=r.firstChild);break}n=n.parentNode}else n=n.parentNode;if(null!=r)if(u=i._getSelection(),t=i._createRange(u),Sys.Extended.UI.HtmlEditor.isIE)t=i._doc.body.createControlRange(),t.add(r),t.select();else try{u.collapseToEnd();i._removeAllRanges(u);t=i._createRange(u);t.setStart(r.parentNode,0);t.setEnd(r.parentNode,1);i._selectRange(u,t)}catch(i){}},_saveContent:function(){var n,t,i;try{try{n=this._getSelection();t=this._createRange(n)}catch(n){}i=new Sys.Extended.UI.HtmlEditor._Marker(this,t,n)}catch(n){return}for(this.__stack||(this.__stack=[],this.__stackPos=0);this.__stackPos]*/gi,"")+('"X"'==r?"":"align="+r)+u.replace(/\salign=[^\s>]*/gi,"")}var u,r,n,e,f,s,i,c,h,t,l;if(this.__stack&&this.__stackPos>=0&&this.__stackPos)/gi,v),this._doc.body.innerHTML="!!!<\/span>"+Sys.Extended.UI.HtmlEditor.Trim(f),this._doc.body.firstChild&&this._doc.body.removeChild(this._doc.body.firstChild),this._doc.body.firstChild&&this._doc.body.removeChild(this._doc.body.firstChild),s=Sys.Extended.UI.HtmlEditor.getHrefsText(f),Sys.Extended.UI.HtmlEditor.setHrefsText(this._doc.body,s),this._editPanel.get_relativeImages()&&(s=Sys.Extended.UI.HtmlEditor.getImagesText(f),Sys.Extended.UI.HtmlEditor.setImagesText(this._doc.body,s)),Sys.Extended.UI.HtmlEditor.setNames(this._doc.body,n._nArr),Sys.Extended.UI.HtmlEditor.operateAnchors(this,this._doc,!this._editPanel.get_showAnchors()),Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this,this._doc,!this._editPanel.get_showPlaceHolders()),null!=n._tree){i=this._doc.body;try{for(t=n._tree.length-1;t>=0;t--)i=i.childNodes.item(n._tree[t])}catch(v){return void(this.__stackPos>0&&(this.__stackPos--,this._restoreContent(),this.__stackPos++))}try{c=this._doc.body.createControlRange();c.add(i);c.select()}catch(v){}}else h=this,setTimeout(function(){try{if(h._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel){if(u=h._getSelection(),r=h._createRange(u),"control"!=u.type.toLowerCase())try{r.moveToPoint(n._offsetLeft,n._offsetTop)}catch(t){}r.select()}}catch(t){}},0)}else{if(Sys.Extended.UI.HtmlEditor.isOpera)this._doc.body.innerHTML=Sys.Extended.UI.HtmlEditor.Trim(n._save);else for(this._doc.body.innerHTML="",t=0;t=0;t--)y+=" "+n._tree[t],i=i.childNodes.item(n._tree[t]);l=n._offset;try{r.setStart(i,l);r.setEnd(i,l)}catch(v){return void Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body)}try{this._selectRange(u,r)}catch(v){}}try{Sys.Extended.UI.HtmlEditor.inspectForShadows(this._doc.body)}catch(v){}}},SaveContent:function(){this._saveContent()},RestoreContent:function(){this._undo(!1)},_undo:function(n){var i,t;if(this.__stack&&this.__stackPos>0){this.__stackPos==this.__stack.length&&n&&this._saveContent();do i=Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML),this.__stackPos--,this._restoreContent();while(Sys.Extended.UI.HtmlEditor.Trim(this._doc.body.innerHTML)==i&&this.__stackPos>0&&n);t=this;setTimeout(function(){try{t._ifShadow()}catch(n){}if(t._editPanel==Sys.Extended.UI.HtmlEditor.LastFocusedEditPanel)try{t._editPanel.updateToolbar()}catch(n){}n||t.onContentChanged()},0)}},_redo:function(){var i,t,n;this.__stack&&this.__stackPos0)&&(t=n._body.ownerDocument.createElement("div"),n._body.appendChild(t),setTimeout(function(){n._body.removeChild(t)},0)),this._restoreContent(),n=this,setTimeout(function(){n._ifShadow();n._editPanel.updateToolbar()},0))},undo:function(){this._undo(!0);this.onContentChanged()},redo:function(){this._redo();this.onContentChanged()},_contextMenuCallP:function(){},onContentChanged:function(){},_copyCut:function(n,t){var v=this,c,f,l,e,a,u,h,y,r,i;if(Sys.Extended.UI.HtmlEditor.isIE){var r=this._getSelection(),i=this._createRange(r),s=!1,o="";if("x"==n&&this._saveContent(),"control"==r.type.toLowerCase())s=!0,o=Sys.Extended.UI.HtmlEditor.getHTML(i.item(0),!0);else if(""!=i.text){if(s=!0,o=i.htmlText,c=i.duplicate(),f=this._getTextNodeCollection(),f.length<1)return;if(l=Sys.Extended.UI.HtmlEditor._commonParent(f[0],f[f.length-1]),null!=l&&f[0].previousSibling&&3==f[0].previousSibling.nodeType)for(e=l.parent;e&&"BODY"!=e.tagName.toUpperCase()&&Sys.Extended.UI.HtmlEditor.isStyleTag(e.tagName);)a=e.cloneNode(!1),a.innerHTML=o,o=a.outerHTML,e=e.parentNode;r=this._getSelection();r.empty();i=this._createRange(r);i.setEndPoint("EndToEnd",c);i.setEndPoint("StartToStart",c);i.select()}else""!=i.htmlText&&(s=!0,o=i.htmlText);s?(u=this._doc.createElement("DIV"),u.innerHTML="!!!<\/span>"+o,u.removeChild(u.firstChild),u.removeChild(u.firstChild),h=Sys.Extended.UI.HtmlEditor.getHTML(u,!1,!0),y=new RegExp("(<[/]?)(teo"+Sys.Extended.UI.HtmlEditor.smartClassName+":)","ig"),h=h.replace(y,"$1"),delete u,this._contentCopy(h,!0),i.select(),"x"==n&&(r.clear(),this._clearP())):"x"==n&&(r.clear(),this._clearP());t&&setTimeout(function(){v._editPanel.updateToolbar()},0)}else"x"==n?(this._saveContent(),r=this._getSelection(),i=this._createRange(r),this._removeAllRanges(r),i.deleteContents(),""==this._doc.body.innerHTML&&(this._doc.body.innerHTML="
",i.setStart(this._doc.body,0),i.setEnd(this._doc.body,0)),v.onContentChanged(),this._selectRange(r,i)):(r=this._getSelection(),i=this._createRange(r),this._removeAllRanges(r),alert(String.format(Sys.Extended.UI.Resources.HTMLEditor_toolbar_button_Use_verb,Sys.Extended.UI.HtmlEditor.isSafari&&navigator.userAgent.indexOf("mac")!=-1?"Apple-C":"Ctrl-C")),this._selectRange(r,i))},_paste:function(n,t){var l,a,f=this,v=this._getSelection(),o=this._createRange(v),i,r,s,h,e,c,u;if(!n)return l=o.offsetLeft,a=o.offsetTop,this.insertHTML(this._getPlain()),void f.onContentChanged();if(!this._editPanel.get_noPaste()){if(l=o.offsetLeft,a=o.offsetTop,r=this._doc.createElement("span"),s=this._contentCopy("",!1,t),/<[\/]*p[\s>]+/i.test(s)||/<[\/]*h/i.test(s))i=this._getSafePlace();else{if(i=this._doc.createElement("SPAN"),i.id=Sys.Extended.UI.HtmlEditor.smartClassName,!this.insertHTML(Sys.Extended.UI.HtmlEditor.getHTML(i,!0)))return;i=this._doc.getElementById(Sys.Extended.UI.HtmlEditor.smartClassName);i&&(i.id=null,i.removeAttribute("id"),i.setAttribute("para","no"))}if(r.innerHTML=s,i){if(this._checkImages(r),h=i.parentNode,e=i.getAttribute("para"),"no"!=e){if(e.indexOf("left")>=0&&r.firstChild&&r.firstChild.tagName&&"P"==r.firstChild.tagName.toUpperCase()){for(;r.firstChild.firstChild;)i.previousSibling.appendChild(r.firstChild.firstChild);r.removeChild(r.firstChild)}if(e.indexOf("right")>=0&&r.lastChild&&r.lastChild.tagName&&"P"==r.lastChild.tagName.toUpperCase()){for(;r.lastChild.lastChild;)i.nextSibling.insertBefore(r.lastChild.lastChild,i.nextSibling.firstChild);r.removeChild(r.lastChild)}}if(c=i,u=null,0==r.childNodes.length&&e.indexOf("left")>=0&&e.indexOf("right")>=0){for(i.nextSibling.firstChild&&(u=this._doc.createElement("span"),c=u,u.innerHTML="111",i.previousSibling.appendChild(u));i.nextSibling.firstChild;)i.previousSibling.appendChild(i.nextSibling.firstChild);h.removeChild(i.nextSibling)}else for(;r.firstChild;)h.insertBefore(r.firstChild,i);setTimeout(function(){var t=f._getSelection(),n=f._createRange(t);if("control"==t.type.toLowerCase())for(;n.length>0;)n.remove(0);try{n.collapse(!1)}catch(t){}f.focusEditor();Sys.Extended.UI.HtmlEditor._setCursor(c,f);u&&u.parentNode.removeChild(u);h.removeChild(i);Sys.Extended.UI.HtmlEditor.inspectForShadows(f._doc.body);f.onContentChanged();n.select()},0)}}},_contentCopy:function(n,t,i){var o,r,c,a,v,f,h,u,e,y;if(""!=n&&(n=n.replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/gi,"$1 $3").replace(/(]*?>)\s*( )\s*(<\/td[^>]*?>)/gi,"$1
$3").replace(/(]*?>)\s*( )\s*(<\/p[^>]*?>)/gi,"$1
$3")),o=this._doc.createElement("iframe"),o.width="0",o.height="0",Sys.Extended.UI.HtmlEditor.isIE&&(o.src="javascript:false;"),this._doc.appendChild(o),r=o.contentWindow.document,r.write("<\/head>"+n+"<\/body><\/html>"),r.close(),r.body.contentEditable=!0,c=r.body.createTextRange(),a=!1,""==n){for(c.execCommand("paste"),v=r.createElement("DIV"),f=0;f=0&&h.nextSibling&&3==h.nextSibling.nodeType&&(u=""+h.nextSibling.data,u.length&&160==u.charCodeAt(0)))){u=u.substr(1);h.nextSibling.data=u;a=!0;break}if("undefined"!=typeof i&&i&&(r.body.innerHTML=Sys.Extended.UI.HtmlEditor.cleanUp(r.body.innerHTML)),u=Sys.Extended.UI.HtmlEditor.Trim(Sys.Extended.UI.HtmlEditor.getHTML(r.body,!1,!0)),u=u.replace(/(]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/gi,""),r.body.innerHTML=u,!t){Sys.Extended.UI.HtmlEditor.operateAnchors(this,r,!this.showAnchors);Sys.Extended.UI.HtmlEditor.operatePlaceHolders(this,r,!this.showPlaceHolders);for(var l=r.body.getElementsByTagName("EMBED"),s=[],f=0;f\s*<\/td>/gi,"<\/td>").replace(/(]*?>)([\s ]*?)(<\/td[^>]*?>)/gi,"$1 $3").replace(/(]*?>)\s*(]*?>)\s*(<\/p[^>]*?>)/gi,"$1 $3").replace(/()/gi,"$1pseudomode=$3$4").replace(/(]*?>)/gi,'$1 wmode="transparent"$2'),l=r.body.getElementsByTagName("EMBED"),s=[],f=0;f