Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons");Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles=function(n){Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.initializeBase(this,[n])};Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.prototype={callMethod:function(){if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.callBaseMethod(this,"callMethod"))return!1;var n=this._designPanel;setTimeout(function(){var ct=Sys.Extended.UI.HtmlEditor.isIE?"":Sys.Extended.UI.HtmlEditor.Trim(n.getSelectedHTML()),h=n._getSelection(),s=n._createRange(h),i=null,ft=!1,e,f,ot,it,r,v,k,st,y,nt,d,o,l,u,c,a,p,tt,ut,t;if(!n.isControl()&&(Sys.Extended.UI.HtmlEditor.isIE&&s.text.length>0||!Sys.Extended.UI.HtmlEditor.isIE&&ct.length>0)?i=n._getTextNodeCollection():(i=n._tryExpand(),ft=!0),i!=null&&i.length>0){var et=!1,p=!0;for(n._saveContent(),e=n._doc.createElement("span"),e.id="_left_",f=n._doc.createElement("span"),f.id="_right_",ot=i[0].parentNode,it=i[i.length-1].parentNode,ot.insertBefore(e,i[0]),i[i.length-1].nextSibling?it.insertBefore(f,i[i.length-1].nextSibling):it.appendChild(f);p;)for(p=!1,o=0;o0)&&(t.nodeType==1&&(Sys.Extended.UI.HtmlEditor.isStyleTag(t.tagName)&&t.tagName.toUpperCase()!="A"&&(!t.id||t.id!="_left_"&&t.id!="_right_")&&Sys.Extended.UI.HtmlEditor.spanJoiner(t),Sys.Extended.UI.HtmlEditor.isStyleTag(t.tagName)&&t.childNodes.length==0&&(!t.id||t.id!="_left_"&&t.id!="_right_")&&(t=null)),t&&(u.childNodes.length!=0&&r?u.insertBefore(t,u.firstChild):u.appendChild(t))),t=l;if(u.childNodes.length==0)delete u,u=null;else if(u.childNodes.length==1&&u.firstChild.nodeType==3&&(""+u.firstChild.data+"").length==0)delete u,u=null;else if(Sys.Extended.UI.HtmlEditor.isStyleTag(u.tagName)){for(s=u.childNodes.length,o=0;o0&&(l=u);var w=rt(null,l.previousSibling,l.parentNode,!0),b=rt(null,l.nextSibling,l.parentNode,!1),r=c.parentNode;if(w){if(w.push&&typeof w.push=="function")for(a=0;a0&&i.push(n)}else ht(n.firstChild,!1);if(p)return;var r=n.parentNode;if(t)while(n&&n.nextSibling==null)n=n.parentNode;n=n.nextSibling}}ht(e,!0);s=n._doc.createRange();s.setStart(i[0],0);s.setEnd(i[i.length-1],(""+i[i.length-1].data+"").length);n._removeAllRanges(h);n._selectRange(h,s)}try{if(e!=null)for(t=e.parentNode,t.removeChild(e);t&&t.childNodes.length==0;)t.parentNode.removeChild(t),t=t.parentNode;if(f!=null)for(t=f.parentNode,t.removeChild(f);t&&t.childNodes.length==0;)t.parentNode.removeChild(t),t=t.parentNode}catch(lt){}n.onContentChanged();n._editPanel.updateToolbar()}},0)}};Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.RemoveStyles",Sys.Extended.UI.HtmlEditor.ToolbarButtons.MethodButton);