Xinha.loadStyle("ListType.css","ListType");function ListType(J){this.editor=J;var I=J.config;var G=this;if(I.ListType.mode=="toolbar"){var E={};E[Xinha._lc("Decimal numbers","ListType")]="decimal";E[Xinha._lc("Lower roman numbers","ListType")]="lower-roman";E[Xinha._lc("Upper roman numbers","ListType")]="upper-roman";E[Xinha._lc("Lower latin letters","ListType")]="lower-alpha";E[Xinha._lc("Upper latin letters","ListType")]="upper-alpha";if(!Xinha.is_ie){E[Xinha._lc("Lower greek letters","ListType")]="lower-greek"}var C={id:"listtype",tooltip:Xinha._lc("Choose list style type (for ordered lists)","ListType"),options:E,action:function(K){G.onSelect(K,this)},refresh:function(K){G.updateValue(K,this)},context:"ol"};I.registerDropdown(C);I.addToolbarElement("listtype",["insertorderedlist","orderedlist"],1)}else{J._ListType=J.addPanel("right");Xinha.freeLater(J,"_ListType");Xinha.addClass(J._ListType,"ListType");Xinha.addClass(J._ListType.parentNode,"dialog");J.notifyOn("modechange",function(L,K){if(K.mode=="text"){J.hidePanel(J._ListType)}});var H=["disc","circle","square","none"];var F=["decimal","lower-alpha","upper-alpha","lower-roman","upper-roman","none"];var D=document.createElement("div");D.style.height="90px";var B=document.createElement("div");this.divUL=B;B.style.display="none";for(var A=0;A<H.length;A++){B.appendChild(this.createImage(H[A]))}D.appendChild(B);var B=document.createElement("div");this.divOL=B;B.style.display="none";for(var A=0;A<F.length;A++){B.appendChild(this.createImage(F[A]))}D.appendChild(B);J._ListType.appendChild(D);J.hidePanel(J._ListType)}}Xinha.Config.prototype.ListType={mode:"toolbar"};ListType._pluginInfo={name:"ListType",version:"2.1",developer:"Laurent Vilday",developer_url:"http://www.mokhet.com/",c_owner:"Xinha community",sponsor:"",sponsor_url:"",license:"Creative Commons Attribution-ShareAlike License"};ListType.prototype.onSelect=function(D,C){var B=D._toolbarObjects[C.id].element;var A=D.getParentElement();while(!/^ol$/i.test(A.tagName)){A=A.parentNode}A.style.listStyleType=B.value};ListType.prototype.updateValue=function(F,E){var D=F._toolbarObjects[E.id].element;var C=F.getParentElement();while(C&&!/^ol$/i.test(C.tagName)){C=C.parentNode}if(!C){D.selectedIndex=0;return}var A=C.style.listStyleType;if(!A){D.selectedIndex=0}else{for(var B=D.firstChild;B;B=B.nextSibling){B.selected=(A.indexOf(B.value)!=-1)}}};ListType.prototype.onUpdateToolbar=function(){if(this.editor.config.ListType.mode=="toolbar"){return}var A=this.editor.getParentElement();while(A&&!/^[o|u]l$/i.test(A.tagName)){A=A.parentNode}if(A&&/^[o|u]l$/i.test(A.tagName)){this.showPanel(A)}else{if(this.editor._ListType.style.display!="none"){this.editor.hidePanel(this.editor._ListType)}}};ListType.prototype.createImage=function(D){var C=this;var B=this.editor;var A=document.createElement("a");A.href="javascript:void(0)";Xinha._addClass(A,D);Xinha._addEvent(A,"click",function(){var E=B._ListType.currentListTypeParent;E.style.listStyleType=D;C.showActive(E);return false});return A};ListType.prototype.showActive=function(B){var C=(B.tagName.toLowerCase()=="ul")?this.divUL:this.divOL;this.divUL.style.display="none";this.divOL.style.display="none";C.style.display="block";var A=B.style.listStyleType;if(""==A){A=(B.tagName.toLowerCase()=="ul")?"disc":"decimal"}for(var E=0;E<C.childNodes.length;E++){var D=C.childNodes[E];if(Xinha._hasClass(D,A)){Xinha._addClass(D,"active")}else{Xinha._removeClass(D,"active")}}};ListType.prototype.showPanel=function(A){this.editor._ListType.currentListTypeParent=A;this.showActive(A);this.editor.showPanel(this.editor._ListType)};