radiant-forum-extension 2.1.6 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/README.md +20 -16
  2. data/Rakefile +0 -16
  3. data/app/controllers/forum_base_controller.rb +32 -10
  4. data/app/controllers/posts_controller.rb +37 -14
  5. data/app/helpers/forum_helper.rb +23 -16
  6. data/app/models/forum.rb +11 -7
  7. data/app/models/post.rb +53 -14
  8. data/app/models/post_attachment.rb +1 -1
  9. data/app/models/topic.rb +21 -8
  10. data/app/views/admin/dashboard/_forum_dashboard.html.haml +51 -0
  11. data/app/views/admin/forums/_form.html.haml +12 -0
  12. data/app/views/admin/forums/edit.html.haml +1 -1
  13. data/app/views/admin/forums/index.html.haml +16 -20
  14. data/app/views/admin/posts/_form.html.haml +2 -2
  15. data/app/views/admin/posts/edit.html.haml +1 -1
  16. data/app/views/admin/posts/index.html.haml +5 -5
  17. data/app/views/admin/reader_configuration/_edit_forum.html.haml +6 -0
  18. data/app/views/admin/reader_configuration/_forum.html.haml +5 -1
  19. data/app/views/admin/topics/_form.html.haml +3 -5
  20. data/app/views/admin/topics/edit.html.haml +1 -1
  21. data/app/views/admin/topics/index.html.haml +5 -5
  22. data/app/views/forums/_forum.html.haml +6 -5
  23. data/app/views/forums/_latest.html.haml +14 -12
  24. data/app/views/forums/_statistics.html.haml +4 -4
  25. data/app/views/forums/index.html.haml +8 -10
  26. data/app/views/forums/index.rss.builder +2 -2
  27. data/app/views/forums/show.html.haml +12 -15
  28. data/app/views/pages/_add_comment.html.haml +9 -8
  29. data/app/views/pages/_comments.html.haml +3 -3
  30. data/app/views/posts/_attachments.html.haml +1 -1
  31. data/app/views/posts/_confirm_delete.html.haml +7 -2
  32. data/app/views/posts/_context.html.haml +5 -5
  33. data/app/views/posts/_edit_links.html.haml +4 -4
  34. data/app/views/posts/_form.html.haml +15 -12
  35. data/app/views/posts/_ineditable.html.haml +7 -0
  36. data/app/views/posts/_latest.html.haml +3 -8
  37. data/app/views/posts/_minimal.html.haml +7 -0
  38. data/app/views/posts/_post.html.haml +20 -17
  39. data/app/views/posts/_post.rss.builder +2 -2
  40. data/app/views/posts/_search_form.html.haml +13 -13
  41. data/app/views/posts/_search_results.html.haml +15 -0
  42. data/app/views/posts/_search_summary.html.haml +13 -0
  43. data/app/views/posts/_uploader.html.haml +1 -1
  44. data/app/views/posts/edit.html.haml +22 -21
  45. data/app/views/posts/index.html.haml +12 -19
  46. data/app/views/posts/index.rss.builder +6 -6
  47. data/app/views/posts/new.html.haml +19 -22
  48. data/app/views/posts/remove.html.haml +15 -15
  49. data/app/views/posts/show.html.haml +16 -10
  50. data/app/views/readers/_forum_messages.html.haml +9 -6
  51. data/app/views/readers/_messages_summary.html.haml +1 -1
  52. data/app/views/shared/_standard_forum_parts.html.haml +41 -0
  53. data/app/views/topics/_busiest.html.haml +9 -8
  54. data/app/views/topics/_context.html.haml +11 -8
  55. data/app/views/topics/_latest.html.haml +2 -2
  56. data/app/views/topics/_locked.html.haml +1 -1
  57. data/app/views/topics/_minimal.html.haml +2 -2
  58. data/app/views/topics/_replies.html.haml +4 -3
  59. data/app/views/topics/_reply.html.haml +13 -8
  60. data/app/views/topics/_topic.html.haml +5 -9
  61. data/app/views/topics/_topic.rss.builder +1 -1
  62. data/app/views/topics/index.html.haml +14 -10
  63. data/app/views/topics/index.rss.builder +2 -2
  64. data/app/views/topics/show.html.haml +20 -19
  65. data/app/views/topics/show.rss.builder +3 -3
  66. data/config/initializers/radiant_config.rb +4 -1
  67. data/config/locales/en.yml +202 -178
  68. data/db/migrate/002_pages_commentable.rb +1 -2
  69. data/db/migrate/004_sample_layout.rb +38 -15
  70. data/db/migrate/20110111080550_detach_observer.rb +4 -4
  71. data/db/migrate/20110613112823_search_text.rb +9 -0
  72. data/db/migrate/20110613130230_tidy_up.rb +27 -0
  73. data/db/migrate/20110630083446_page_replied_at.rb +11 -0
  74. data/forum_extension.rb +13 -11
  75. data/lib/commentable_model.rb +13 -9
  76. data/lib/forum_admin_ui.rb +6 -6
  77. data/lib/forum_page.rb +5 -3
  78. data/lib/forum_reader.rb +7 -1
  79. data/lib/forum_reader_sessions_controller.rb +2 -3
  80. data/lib/forum_tags.rb +126 -11
  81. data/lib/radiant-forum-extension.rb +8 -0
  82. data/public/cleditor/images/buttons.gif +0 -0
  83. data/public/cleditor/images/icons/1.gif +0 -0
  84. data/public/cleditor/images/icons/10.gif +0 -0
  85. data/public/cleditor/images/icons/11.gif +0 -0
  86. data/public/cleditor/images/icons/12.gif +0 -0
  87. data/public/cleditor/images/icons/2.gif +0 -0
  88. data/public/cleditor/images/icons/3.gif +0 -0
  89. data/public/cleditor/images/icons/4.gif +0 -0
  90. data/public/cleditor/images/icons/5.gif +0 -0
  91. data/public/cleditor/images/icons/6.gif +0 -0
  92. data/public/cleditor/images/icons/7.gif +0 -0
  93. data/public/cleditor/images/icons/8.gif +0 -0
  94. data/public/cleditor/images/icons/9.gif +0 -0
  95. data/public/cleditor/images/icons/icons.gif +0 -0
  96. data/public/cleditor/images/toolbar.gif +0 -0
  97. data/public/cleditor/jquery.cleditor.css +24 -0
  98. data/public/cleditor/jquery.cleditor.icon.js +65 -0
  99. data/public/cleditor/jquery.cleditor.js +1132 -0
  100. data/public/cleditor/jquery.cleditor.xhtml.js +230 -0
  101. data/public/javascripts/forum.js +146 -107
  102. data/public/stylesheets/sass/forum.sass +94 -58
  103. data/radiant-forum-extension.gemspec +25 -276
  104. data/spec/controllers/forums_controller_spec.rb +0 -7
  105. data/spec/controllers/posts_controller_spec.rb +20 -37
  106. data/spec/controllers/topics_controller_spec.rb +1 -7
  107. data/spec/datasets/forums_dataset.rb +38 -40
  108. data/spec/lib/commentable_model_spec.rb +26 -38
  109. data/spec/lib/forum_reader_spec.rb +0 -4
  110. data/spec/models/forum_spec.rb +46 -16
  111. data/spec/models/post_spec.rb +10 -6
  112. data/spec/models/topic_spec.rb +26 -17
  113. data/spec/spec_helper.rb +1 -0
  114. metadata +66 -99
  115. data/VERSION +0 -1
  116. data/app/views/forums/_standard_parts.html.haml +0 -59
  117. data/lib/sanitize/config/forum.rb +0 -49
  118. data/public/javascripts/gallery.js +0 -275
  119. data/public/punymce/blank.htm +0 -1
  120. data/public/punymce/css/content.css +0 -4
  121. data/public/punymce/css/editor.css +0 -58
  122. data/public/punymce/i18n/sv.js +0 -28
  123. data/public/punymce/img/icons.gif +0 -0
  124. data/public/punymce/img/icons_uncompressed.png +0 -0
  125. data/public/punymce/plugins/bbcode.js +0 -1
  126. data/public/punymce/plugins/bbcode_src.js +0 -50
  127. data/public/punymce/plugins/editsource/css/editor.css +0 -3
  128. data/public/punymce/plugins/editsource/editsource.js +0 -1
  129. data/public/punymce/plugins/editsource/editsource_src.js +0 -81
  130. data/public/punymce/plugins/editsource/img/icons.gif +0 -0
  131. data/public/punymce/plugins/emoticons/css/content.css +0 -13
  132. data/public/punymce/plugins/emoticons/css/editor.css +0 -17
  133. data/public/punymce/plugins/emoticons/emoticons.js +0 -1
  134. data/public/punymce/plugins/emoticons/emoticons_src.js +0 -303
  135. data/public/punymce/plugins/emoticons/img/emoticons.gif +0 -0
  136. data/public/punymce/plugins/emoticons/img/emoticons.png +0 -0
  137. data/public/punymce/plugins/emoticons/img/trans.gif +0 -0
  138. data/public/punymce/plugins/entities.js +0 -1
  139. data/public/punymce/plugins/entities_src.js +0 -37
  140. data/public/punymce/plugins/forceblocks.js +0 -1
  141. data/public/punymce/plugins/forceblocks_src.js +0 -465
  142. data/public/punymce/plugins/forcenl.js +0 -1
  143. data/public/punymce/plugins/forcenl_src.js +0 -26
  144. data/public/punymce/plugins/image/css/editor.css +0 -1
  145. data/public/punymce/plugins/image/image.js +0 -1
  146. data/public/punymce/plugins/image/image_src.js +0 -30
  147. data/public/punymce/plugins/image/img/icons.gif +0 -0
  148. data/public/punymce/plugins/link/css/editor.css +0 -2
  149. data/public/punymce/plugins/link/img/icons.gif +0 -0
  150. data/public/punymce/plugins/link/link.js +0 -1
  151. data/public/punymce/plugins/link/link_src.js +0 -36
  152. data/public/punymce/plugins/paste.js +0 -1
  153. data/public/punymce/plugins/paste_src.js +0 -169
  154. data/public/punymce/plugins/protect.js +0 -1
  155. data/public/punymce/plugins/protect_src.js +0 -30
  156. data/public/punymce/plugins/safari2x.js +0 -1
  157. data/public/punymce/plugins/safari2x_src.js +0 -284
  158. data/public/punymce/plugins/tabfocus.js +0 -1
  159. data/public/punymce/plugins/tabfocus_src.js +0 -45
  160. data/public/punymce/plugins/textcolor/css/editor.css +0 -7
  161. data/public/punymce/plugins/textcolor/img/icons.gif +0 -0
  162. data/public/punymce/plugins/textcolor/textcolor.js +0 -1
  163. data/public/punymce/plugins/textcolor/textcolor_src.js +0 -73
  164. data/public/punymce/puny_mce.js +0 -1
  165. data/public/punymce/puny_mce_full.js +0 -1
  166. data/public/punymce/puny_mce_src.js +0 -1460
@@ -1 +0,0 @@
1
- (function(p){var n,f,s,j,b,i,t,d,k;var a,h,g,q,m,r,l;l=navigator.userAgent;p.isOpera=q=window.opera&&opera.buildNumber;p.isWebKit=m=/WebKit/.test(l);p.isOldWebKit=r=m&&!window.getSelection().getRangeAt;p.isIE=h=!m&&!q&&(/MSIE/gi).test(l)&&(/Explorer/gi).test(navigator.appName);p.isGecko=g=!m&&/Gecko/.test(l);p.plugins={};function e(v,u){v=typeof(v);if(!u){return v!="undefined"}return v==u}function c(w,u,v){var x;if(!w){return 0}v=!v?w:v;if(e(w.length)){for(x=0;x<w.length;x++){if(u.call(v,w[x],x,w)===false){return 0}}}else{for(x in w){if(w.hasOwnProperty(x)){if(u.call(v,w[x],x,w)===false){return 0}}}}return 1}function o(v,u){c(u,function(w,x){v[x]=w});return v}o(p,{is:e,each:c,extend:o});p.I18n=k={bold:"Bold (Ctrl+B)",italic:"Italic (Ctrl+I)",underline:"Underline (Ctrl+U)",strike:"Striketrough",ul:"Insert unordered list",ol:"Insert ordered list",indent:"Indent",outdent:"Outdent",left:"Align left",center:"Align center",right:"Align right",style:"Font style",removeformat:"Remove format",increasefontsize:"Increase text size",decreasefontsize:"Decrease text size"};p.DOMUtils=n=function(v){this.files=[];try{v.execCommand("BackgroundImageCache",0,1)}catch(u){}o(this,{get:function(w){return w&&(!w.nodeType&&!w.location?v.getElementById(w):w)},add:function(A,B,w,y){var x=this,z;z=v.createElement(B);c(w,function(C,D){x.setAttr(z,D,C)});if(y){if(y.nodeType){z.appendChild(y)}else{z.innerHTML=y}}return A?A.appendChild(z):z},create:function(y,w,x){return this.add(0,y,w,x)},setAttr:function(x,y,w){x=this.get(x);if(!x){return 0}if(y=="style"){x.setAttribute("mce_style",w);x.style.cssText=w}if(y=="class"){x.className=w}if(w!=null&&w!=""){x.setAttribute(y,""+w)}else{x.removeAttribute(y)}return 1},getAttr:function(y,z,x){var w;y=this.get(y);if(!y){return false}if(!e(x)){x=""}if(/^(src|href|style)$/.test(z)){w=this.getAttr(y,"mce_"+z);if(w){return w}}w=y.getAttribute(z,2);if(z=="class"&&!w){w=y.className}if(z=="style"&&!w){w=y.style.cssText}else{if(!w){w=y.attributes[z];w=w&&e(w.nodeValue)?w.nodeValue:w}}if(m&&z=="class"&&w){w=w.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}return(w&&w!="")?""+w:x},select:function(w,z,x){var y=[];z=this.get(z);z=!z?v:z;c(w.split(","),function(A){c(z.getElementsByTagName(A),function(B){if(!x||x(B)){y.push(B)}})});return y},getPos:function(C,B){var w=0,x=0,z,y,A;C=this.get(C);if(p.isIE&&C){y=C.getBoundingClientRect();A=document;C=A.compatMode=="CSS1Compat"?A.documentElement:A.body;return{x:y.left+(C.scrollLeft||0),y:y.top+(C.scrollTop||0)}}while(C&&C!=B){w+=C.offsetLeft||0;x+=C.offsetTop||0;C=C.offsetParent}return{x:w,y:x}},loadCSS:function(w){var x=this;if(w){c(w.split(","),function(z){var y=-1;c(x.files,function(B,A){if(B==z){y=A;return false}});if(y!=-1){return}x.files.push(z);if(!v.createStyleSheet){x.add(x.select("head")[0],"link",{rel:"stylesheet",href:z})}else{v.createStyleSheet(z)}})}},addClass:function(x,z,w){var y;x=this.get(x);if(!x){return 0}y=this.removeClass(x,z);return x.className=w?z+(y!=""?(" "+y):""):(y!=""?(y+" "):"")+z},removeClass:function(w,x){w=this.get(w);if(!w){return 0}x=w.className.replace(new RegExp("(^|\\s+)"+x+"(\\s+|$)","g")," ");return w.className=x!=" "?x:""},hasClass:function(x,w){x=this.get(x);return new RegExp("\\b"+w+"\\b","g").test(x.className)},getParent:function(y,x,w){while(y){if(y==w){return null}if(x(y)){return y}y=y.parentNode}return null},keep:function(w){if(g){w=w.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");w=w.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>");w=w.replace(/<(\/?)del|<del( [^>]+)>/gi,"<$1strike$2>")}w=w.replace(/ (src|href|style)=\"([^\"]+)\"/gi,' $1="$2" mce_$1="$2"');return w}})};p.DOM=a=new n(document);p.Event=t={events:[],inits:[],unloads:[],add:function(z,A,y,x){var u,v=this,w=v.events;z=a.get(z);u=function(B){B=B||window.event;if(B&&!B.target&&h){B.target=B.srcElement}if(!x){return y(B)}return y.call(x,B)};if(A=="unload"){v.unloads.push(u);return u}if(A=="init"){if(v._init){u()}else{v.inits.push(u)}return u}w.push({obj:z,name:A,func:y,cfunc:u,scope:x});v._add(z,A,u);if(h&&w.length==1){t._add(window,"unload",v._unload,t)}return u},remove:function(x,y,w){var v=this,u=v.events;x=a.get(x);c(u,function(A,z){if(A.obj==x&&A.name==y&&(!w||A.func==w)){u.splice(z,1);v._remove(x,y,A.cfunc);return false}})},cancel:function(u){this.stop(u);return this.prevent(u)},stop:function(u){if(u.stopPropagation){u.stopPropagation()}else{u.cancelBubble=true}return false},prevent:function(u){if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false},_unload:function(){var u=t;c(u.events,function(v){u._remove(v.obj,v.name,v.cfunc)});u._remove(window,"unload",u._unload);u.events=[];c(u.unloads,function(v){v()})},_add:function(v,w,u){if(v.attachEvent){v.attachEvent("on"+w,u)}else{if(v.addEventListener){v.addEventListener(w,u,false)}else{v["on"+w]=u}}},_remove:function(v,w,u){if(v.detachEvent){v.detachEvent("on"+w,u)}else{if(v.removeEventListener){v.removeEventListener(w,u,false)}else{v["on"+w]=null}}},_pageInit:function(){var u=t;u._remove(window,"DOMContentLoaded",u._pageInit);u._init=true;c(u.inits,function(v){v()});u.inits=[]},_wait:function(){var u;if(h&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");a.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){t._pageInit();a.get("__ie_onload").onreadystatechange=null}}}else{t._add(window,"DOMContentLoaded",t._pageInit,t);if(h||m){u=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(u);t._pageInit()}},10)}}}};p.Dispatcher=i=function(u){var v=[];if(!u){u=this}o(this,{add:function(w,x){v.push({cb:w,scope:!x?u:x});return w},remove:function(w){c(v,function(y,x){if(w==y.cb){v.splice(x,1)}return false});return w},dispatch:function(){var x,w=arguments;c(v,function(y){return x=y.cb.apply(y.scope,w)});return x}})};p.Editor=j=function(B){var y,z,w=this;if(!p.baseURL){c(a.select("script"),function(C){if(/puny_mce/g.test(""+C.src)){p.baseURL=C.src.replace(/^(.+)\/puny_mce.+$/,"$1/")}})}this.settings=y=o({content_css:p.baseURL+"/css/content.css",editor_css:p.baseURL+"/css/editor.css",width:0,height:0,min_width:260,min_height:50,max_width:800,max_height:600,entities:"raw",spellcheck:0,resize:true,plugins:"",styles:[{title:"H1",cls:"h1",cmd:"FormatBlock",val:"<h1>"},{title:"H2",cls:"h2",cmd:"FormatBlock",val:"<h2>"},{title:"H3",cls:"h3",cmd:"FormatBlock",val:"<h3>"},{title:"Pre",cls:"pre",cmd:"FormatBlock",val:"<pre>"},{title:"Times",cls:"times",cmd:"FontName",val:"Times"},{title:"Arial",cls:"arial",cmd:"FontName",val:"Arial"},{title:"Courier",cls:"courier",cmd:"FontName",val:"Courier"}],toolbar:"bold,italic,underline,strike,increasefontsize,decreasefontsize,ul,ol,indent,outdent,left,center,right,style,removeformat"},B);w.tools={bold:{cmd:"Bold",title:k.bold},italic:{cmd:"Italic",title:k.italic},underline:{cmd:"Underline",title:k.underline},strike:{cmd:"Strikethrough",title:k.strike},ul:{cmd:"InsertUnorderedList",title:k.ul},ol:{cmd:"InsertOrderedList",title:k.ol},indent:{cmd:"Indent",title:k.indent},outdent:{cmd:"Outdent",title:k.outdent},left:{cmd:"JustifyLeft",title:k.left},center:{cmd:"JustifyCenter",title:k.center},right:{cmd:"JustifyRight",title:k.right},style:{cmd:"mceStyle",title:k.style},removeformat:{cmd:"RemoveFormat",title:k.removeformat},increasefontsize:{cmd:"IncreaseFontSize",title:k.increasefontsize},decreasefontsize:{cmd:"DecreaseFontSize",title:k.decreasefontsize}};a.loadCSS(y.editor_css);this.commands={mceStyle:function(J,I,H){var E,K=this,L=K.settings,C=L.id,D=a.getPos(H.target),F;if(K.hideMenu){return K.hideMenu()}function G(M){K.hideMenu=null;t.remove(document,"click",G);t.remove(K.getDoc(),"click",G);a.get(C+"_mstyle").style.display="none"}E=a.get(C+"_mstyle");if(!E){E=a.get(C+"_t");E=a.add(document.body,"div",{id:C+"_mstyle","class":"punymce_style punymce"});c(L.styles,function(M){t.add(a.add(E,"a",{href:"#","class":M.cls},M.title),"mousedown",function(N){G.call(K);K.execCommand(M.cmd,M.ui,M.val);if(q){K.getIfr().focus()}return t.cancel(N)})})}K.hideMenu=G;t.add(document,"click",G,K);t.add(K.getDoc(),"click",G,K);L=E.style;L.left=D.x+"px";L.top=(D.y+H.target.clientHeight+2)+"px";L.display="block"},FormatBlock:function(D,C,E){if(g&&/<(div|blockquote|code|dt|dd|dl|samp)>/gi.test(C)){C=C.replace(/[^a-z]/gi,"")}w.getDoc().execCommand("FormatBlock",0,C)},CreateLink:function(E,D){var F=w.dom,C="javascript:mox();";w.getDoc().execCommand("CreateLink",0,C);c(F.select("A"),function(G){if(F.getAttr(G,"href")==C){F.setAttr(G,"href",D);F.setAttr(G,"mce_href",D)}})},mceFontSizeDelta:function(E,D){var I=w.getDoc(),C,H,F,G=w.selection;C=parseInt(I.queryCommandValue("FontSize")||3);if(m){c([10,13,16,18,24,32,48],function(K,J){if(C==K){C=J+1;return false}})}if(C+D<=1){return}I.execCommand("FontSize",false,C+D)},IncreaseFontSize:function(){w.execCommand("mceFontSizeDelta",0,1)},DecreaseFontSize:function(){w.execCommand("mceFontSizeDelta",0,-1)},Indent:function(D,C,E){w.getDoc().execCommand("Indent",0,0);if(h){w.dom.getParent(w.selection.getNode(),function(F){if(F.nodeName=="BLOCKQUOTE"){F.dir=F.style.marginRight=""}})}},mceSetClass:function(D,C,F){var E=w.selection;if(e(C,"string")){C={element:"span","class":C}}if(E.isCollapsed()){w.dom.setAttr(E.getNode(),"class",C["class"])}else{E.setContent("<"+C.element+' class="'+C["class"]+'">'+E.getContent()+"</"+C.element+">")}},RemoveFormat:function(D,C,F){var E=w.selection;w.getDoc().execCommand("RemoveFormat",D,C);if(h){C=E.getContent();C=C.replace(/ (class|style)=\"[^\"]+\"/g,"");C=C.replace(/<\/?(font|strong|em|b|i|u|strike)>/g,"");C=C.replace(/<(font|strong|em|b|i|u|strike) [^>]+>/g,"");E.setContent(C)}}};function x(F){var G,E,C,D;G=a.get(y.id+"_c");C=G.clientWidth-2;D=G.clientHeight-2;E=a.get(y.id+"_p");E.style.width=C+"px";E.style.height=D+"px";G.style.display="none";E.style.display="block";w.resize={x:F.screenX,y:F.screenY,w:C,h:D};t.add(document,"mousemove",v,this);t.add(document,"mouseup",A,this);w.onResizeStart.dispatch(w,F,C,D)}function v(G){var E=w.resize,F,C,D;E.dx=G.screenX-E.x;E.dy=G.screenY-E.y;C=Math.max(y.min_width,E.w+E.dx);D=Math.max(y.min_height,E.h+E.dy);C=Math.min(y.max_width,C);D=Math.min(y.max_height,D);F=a.get(y.id+"_p");F.style.width=C+"px";F.style.height=D+"px";return t.cancel(G)}function A(D){var C=w.resize;t.remove(document,"mousemove",v,this);t.remove(document,"mouseup",A,this);a.get(y.id+"_c").style.display="";a.get(y.id+"_p").style.display="none";w.resizeBy(C.dx,C.dy);w.onResizeEnd.dispatch(w,D,C.dx,C.dy)}function u(){var C=a.get(y.id),D=w.getDoc();if(g){w.getDoc().designMode="On"}D.open();D.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body id="punymce"></body></html>');D.close();w.dom=z=new n(w.getDoc());z.loadCSS(y.content_css);w.onPreInit.dispatch(w);if(!y.spellcheck){w.getBody().spellcheck=0}t.add(w.getDoc(),"mouseup",w.nodeChanged,w);t.add(w.getDoc(),"keyup",w.nodeChanged,w);t.add(g?w.getDoc():w.getWin(),"focus",function(F){var E;if((E=p.focusEditor)!=null){E.onBlur.dispatch(E,w)}w.onFocus.dispatch(w,E);p.focusEditor=w},this);if(!h){w.getDoc().designMode="On"}else{w.getBody().contentEditable=true}w.setContent(e(C.value)?C.value:C.innerHTML,{load:true});a.get(y.id+"_c").style.display=w.orgDisplay;a.get(y.id).style.display="none";w.onInit.dispatch(w)}o(this,{serializer:new d(w),selection:new b(w),plugins:[]});c(["onPreInit","onInit","onFocus","onBlur","onResizeStart","onResizeEnd","onPreProcess","onPostProcess","onSetContent","onBeforeGetContent","onGetContent","onNodeChange"],function(C){w[C]=new i(w)});o(this,{init:function(){var H=a.get(y.id),J=H.parentNode,L,F,K,I,D,C,G,E=["bold","italic","underline","left","center","right"];c(y.plugins.split(","),function(M){if(M){w.plugins.push(new p.plugins[M](w))}});w.onNodeChange.add(function(){c(E,function(O){var N;try{N=w.getDoc().queryCommandState(w.tools[O].cmd)?a.addClass:a.removeClass;N.call(a,y.id+"_"+O,"active")}catch(M){}})});if(y.entities=="numeric"){w.onGetContent.add(function(M,N){if(N.format=="html"){N.content=N.content.replace(/[\u007E-\uFFFF]/g,function(O){return"&#"+O.charCodeAt(0)+";"})}})}L=!y.width?H.offsetWidth:y.width;F=!y.height?H.offsetHeight:y.height;w.orgDisplay=H.style.display;H.style.display="none";if(H.form){G=H.form;w._submit=G.submit;G.submit=function(){var N=a.get(y.id),M=N.form;w.save();M.submit=w._submit;M.submit()};t.add(0,"unload",function(){var M=a.get(y.id).form;w._submit=w.submit=null});t.add(G,"submit",w.save,w)}K='<div id="'+y.id+'_w" class="punymce"><table id="'+y.id+'_c" class="punymce"><tr class="mceToolbar">';K+='<td id="'+y.id+'_t"></td></tr><tr class="mceBody"><td></div><div id="'+y.id+'_b" class="mceBody">';if(y.resize){K+='<div id="'+y.id+'_r" class="mceResize"></div>'}K+="</td></tr></table>";K+='<div id="'+y.id+'_p" class="mcePlaceholder"></div></div>';if(!H.insertAdjacentHTML){C=H.ownerDocument.createRange();C.setStartBefore(H);J.insertBefore(C.createContextualFragment(K),H)}else{H.insertAdjacentHTML("beforeBegin",K)}D=a.get(y.id+"_t");I=a.add(D,"ul",{id:y.id+"_tb","class":"punymce"});c(y.toolbar.split(","),function(M){var N=w.tools[M];D=a.add(a.add(I,"li",{id:y.id+"_"+M,"class":M}),"a",{href:"javascript:void(0);","class":M,title:N.title,tabIndex:-1,onmousedown:"return false;"});t.add(D,"click",function(O){if(!a.hasClass(O.target.parentNode,"disabled")){w.execCommand(N.cmd,0,0,O)}return t.cancel(O)})});D=a.get(y.id+"_b");D=a.add(D,"iframe",{id:y.id+"_f",src:'javascript:""',frameBorder:"0","class":"punymce",style:"width:"+L+"px;height:"+F+"px"});w.resizeTo(L,F);if(m){t.add(D,"load",u,w);D.src=p.baseURL+"blank.htm"}else{u()}if(y.resize){t.add(y.id+"_r","mousedown",function(M){return x(M,y.id)},this)}I=G=H=D=null},getSize:function(){var C=a.get(y.id+"_f");return{w:C.clientWidth,h:C.clientHeight}},resizeTo:function(C,E){var D=a.get(y.id+"_f").style;C=Math.max(y.min_width,C);E=Math.max(y.min_height,E);C=Math.min(y.max_width,C);E=Math.min(y.max_height,E);w.width=C;w.height=E;D.width=C+"px";D.height=E+"px"},resizeBy:function(C,D){var E=w.getSize();w.resizeTo(E.w+C,E.h+D)},show:function(){a.get(y.id+"_w").style.display="block";a.get(y.id).style.display="none";w.load()},hide:function(){if(h){w.execCommand("SelectAll")}a.get(y.id+"_w").style.display="none";a.get(y.id).style.display=w.orgDisplay;w.save()},load:function(){var C=a.get(y.id);w.setContent(e(C.value)?C.value:C.innerHTML,{load:true})},save:function(){var D=a.get(y.id),C=w.getContent({save:true});if(/TEXTAREA|INPUT/.test(D.nodeName)){D.value=C}else{D.innerHTML=C}},setUseCSS:function(C){var E=w.getDoc(),D;try{E.execCommand("styleWithCSS",0,false)}catch(D){try{E.execCommand("useCSS",0,true)}catch(D){}}},execCommand:function(H,E,D,G){var C=w.commands,F;w.getWin().focus();w.setUseCSS(0);if(C[H]){F=C[H].call(w,E,D,G)}else{F=w.getDoc().execCommand(H,E,D)}if(F!==false){w.nodeChanged()}},getContent:function(D){var C;D=D||{};D.format=D.format||"html";w.onBeforeGetContent.dispatch(this,D);C=w.serializer.serialize(w.getBody(),D);C=C.replace(/^\s*|\s*$/g,"");D.content=C;w.onGetContent.dispatch(this,D);return D.content},setContent:function(C,D){D=D||{};D.content=C;w.onSetContent.dispatch(this,D);C=D.content;C=a.keep(C);w.getBody().innerHTML=C;if(D.format!="raw"){w.setContent(C=w.getContent(D),{format:"raw"})}else{w.getBody().innerHTML=C}return C},getIfr:function(){return a.get(y.id+"_f")},getWin:function(){return w.getIfr().contentWindow},getDoc:function(){return w.getWin().document},getBody:function(){return w.getDoc().body},nodeChanged:function(){w.setUseCSS(0);w.onNodeChange.dispatch(w,w.selection.getNode())}});t.add(window,"init",w.init,this)};p.Selection=b=function(u){var v=this;o(v,{getContent:function(z){var w,x=v.getRng(),y=document.createElement("body");z=z||{};if(v.isCollapsed()){return""}if(x.cloneContents){y.appendChild(x.cloneContents())}else{if(e(x.item)||e(x.htmlText)){y.innerHTML=x.item?x.item(0).outerHTML:x.htmlText}else{y.innerHTML=x.toString()}}if(z.format!="raw"){z.content=w;u.serializer.serialize(y,z);z.content=z.content.replace(/^\s*|\s*$/g,"");u.onGetContent.dispatch(w,z);w=z.content}else{w=y.innerHTML}return w},getText:function(){var x=v.getRng(),w=v.getSel();if(r){return w}return v.isCollapsed()?"":x.text||w.toString()},setContent:function(y,A){var z=v.getRng(),w,B,z,x;A=A||{format:"raw"};y=a.keep(y);if(A.format!="raw"){A.content=y;y=u.onSetContent.dispatch(this,A);y=A.content;w=u.dom.create("body");w.innerHTML=y}if(z.insertNode){z.deleteContents();z.insertNode(z.createContextualFragment(y+'<span id="__caret">_</span>'));B=u.dom.get("__caret");z=u.getDoc().createRange();z.setStartBefore(B);z.setEndBefore(B);x=v.getSel();x.removeAllRanges();x.addRange(z);B.parentNode.removeChild(B)}else{if(z.pasteHTML){z.pasteHTML(y)}else{z.item(0).outerHTML=y}}},select:function(A,z){var y=v.getRng(),x=v.getSel();if(y.moveToElementText){try{y.moveToElementText(A);y.select()}catch(w){}}else{if(x.addRange){z?y.selectNodeContents(A):y.selectNode(A);x.removeAllRanges();x.addRange(y)}else{x.setBaseAndExtent(A,0,A,1)}}return A},isCollapsed:function(){var w=v.getRng();if(w.item){return false}return w.boundingWidth==0||v.getSel().isCollapsed},collapse:function(w){var y=v.getRng(),x=v.getSel();if(y.select){y.collapse(w);y.select()}else{if(w){x.collapseToStart()}else{x.collapseToEnd()}}},getSel:function(){var x=u.getWin();return x.getSelection?x.getSelection():u.getDoc().selection},getRng:function(){var w=v.getSel(),C=u.getDoc(),y,A,B,x;if(!w){return null}try{return w.rangeCount>0?w.getRangeAt(0):(w.createRange?w.createRange():null)}catch(z){return C.body.createTextRange()}},setRng:function(x){var w=v.getSel();w.removeAllRanges();w.addRange(x)},setNode:function(w){v.setContent(u.dom.create("div",null,w).innerHTML)},getNode:function(){var x=v.getRng(),w=v.getSel(),y;if(!h){if(x){y=x.commonAncestorContainer;if(!x.collapsed){if(x.startContainer==x.endContainer){if(x.startOffset-x.endOffset<2){if(x.startContainer.hasChildNodes()){y=x.startContainer.childNodes[x.startOffset]}}}}}return a.getParent(y,function(z){return z.nodeType==1})}return x.item?x.item(0):x.parentElement()}})};p.Serializer=d=function(v){var x,y=0,z;function w(){var C=document.implementation;if(!C||!C.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(B){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(B){}}else{return C.createDocument("","",null)}}x=w();this.settings=z=o({valid_nodes:0,invalid_nodes:/(BODY)/,valid_attrs:0,node_filter:0,root_node:0,pi:0,invalid_attrs:/(^mce_|^_moz_|^contenteditable$)/,closed:/(BR|HR|INPUT|META|IMG)/},v.settings.serializer);function A(C){var B=[];C.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(E,D){B.push({specified:1,nodeName:D})});return B}function u(D,G){var H,B,I,F,E,J,C,L,K;if((!z.valid_nodes||z.valid_nodes.test(D.nodeName))&&(!z.invalid_nodes||!z.invalid_nodes.test(D.nodeName))&&(!z.node_filter||z.node_filter(D,G))){switch(D.nodeType){case 1:if(h){if(D.mce_serialized==y){return}D.mce_serialized=y}H=D.hasChildNodes();B=x.createElement(D.nodeName.toLowerCase());C=h?A(D):D.attributes;for(F=C.length-1;F>-1;F--){L=C[F];if(L.specified){J=L.nodeName.toLowerCase();if(z.invalid_attrs&&z.invalid_attrs.test(J)){continue}if(z.valid_attrs&&!z.valid_attrs.test(J)){continue}K=a.getAttr(D,J);if(K!==""){B.setAttribute(J,K)}}}if(!H&&!z.closed.test(D.nodeName)){B.appendChild(x.createTextNode(""))}G=G.appendChild(B);break;case 3:return G.appendChild(x.createTextNode(D.nodeValue));case 8:return G.appendChild(x.createComment(D.nodeValue))}}else{if(D.nodeType==1){H=D.hasChildNodes()}}if(H){I=D.firstChild;while(I){u(I,G);I=I.nextSibling}}}o(this,{serialize:function(D,C){var B;y=""+(parseInt(y)+1);if(x.firstChild){x.removeChild(x.firstChild)}D=C.node=D.cloneNode(1);v.onPreProcess.dispatch(this,C);u(D,x.appendChild(x.createElement("html")));B=x.xml||new XMLSerializer().serializeToString(x);if(!z.pi){B=B.replace(/<\?[^?]+\?>/g,"")}if(!z.root_node){B=B.replace(/<html>|<\/html>/g,"")}C.content=B;v.onPostProcess.dispatch(this,C);return C.content}})};t._wait();window.punymce=p})({});
@@ -1 +0,0 @@
1
- (function(q){var o,g,v,k,c,j,w,e,l;var a,i,h,t,n,u,m;m=navigator.userAgent;q.isOpera=t=window.opera&&opera.buildNumber;q.isWebKit=n=/WebKit/.test(m);q.isOldWebKit=u=n&&!window.getSelection().getRangeAt;q.isIE=i=!n&&!t&&(/MSIE/gi).test(m)&&(/Explorer/gi).test(navigator.appName);q.isGecko=h=!n&&/Gecko/.test(m);q.plugins={};function f(y,x){y=typeof(y);if(!x){return y!="undefined"}return y==x}function d(z,x,y){var A;if(!z){return 0}y=!y?z:y;if(f(z.length)){for(A=0;A<z.length;A++){if(x.call(y,z[A],A,z)===false){return 0}}}else{for(A in z){if(z.hasOwnProperty(A)){if(x.call(y,z[A],A,z)===false){return 0}}}}return 1}function p(y,x){d(x,function(z,A){y[A]=z});return y}p(q,{is:f,each:d,extend:p});q.I18n=l={bold:"Bold (Ctrl+B)",italic:"Italic (Ctrl+I)",underline:"Underline (Ctrl+U)",strike:"Striketrough",ul:"Insert unordered list",ol:"Insert ordered list",indent:"Indent",outdent:"Outdent",left:"Align left",center:"Align center",right:"Align right",style:"Font style",removeformat:"Remove format",increasefontsize:"Increase text size",decreasefontsize:"Decrease text size"};q.DOMUtils=o=function(y){this.files=[];try{y.execCommand("BackgroundImageCache",0,1)}catch(x){}p(this,{get:function(z){return z&&(!z.nodeType&&!z.location?y.getElementById(z):z)},add:function(D,E,z,B){var A=this,C;C=y.createElement(E);d(z,function(F,G){A.setAttr(C,G,F)});if(B){if(B.nodeType){C.appendChild(B)}else{C.innerHTML=B}}return D?D.appendChild(C):C},create:function(B,z,A){return this.add(0,B,z,A)},setAttr:function(A,B,z){A=this.get(A);if(!A){return 0}if(B=="style"){A.setAttribute("mce_style",z);A.style.cssText=z}if(B=="class"){A.className=z}if(z!=null&&z!=""){A.setAttribute(B,""+z)}else{A.removeAttribute(B)}return 1},getAttr:function(B,C,A){var z;B=this.get(B);if(!B){return false}if(!f(A)){A=""}if(/^(src|href|style)$/.test(C)){z=this.getAttr(B,"mce_"+C);if(z){return z}}z=B.getAttribute(C,2);if(C=="class"&&!z){z=B.className}if(C=="style"&&!z){z=B.style.cssText}else{if(!z){z=B.attributes[C];z=z&&f(z.nodeValue)?z.nodeValue:z}}if(n&&C=="class"&&z){z=z.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}return(z&&z!="")?""+z:A},select:function(z,C,A){var B=[];C=this.get(C);C=!C?y:C;d(z.split(","),function(D){d(C.getElementsByTagName(D),function(E){if(!A||A(E)){B.push(E)}})});return B},getPos:function(F,E){var z=0,A=0,C,B,D;F=this.get(F);if(q.isIE&&F){B=F.getBoundingClientRect();D=document;F=D.compatMode=="CSS1Compat"?D.documentElement:D.body;return{x:B.left+(F.scrollLeft||0),y:B.top+(F.scrollTop||0)}}while(F&&F!=E){z+=F.offsetLeft||0;A+=F.offsetTop||0;F=F.offsetParent}return{x:z,y:A}},loadCSS:function(z){var A=this;if(z){d(z.split(","),function(C){var B=-1;d(A.files,function(E,D){if(E==C){B=D;return false}});if(B!=-1){return}A.files.push(C);if(!y.createStyleSheet){A.add(A.select("head")[0],"link",{rel:"stylesheet",href:C})}else{y.createStyleSheet(C)}})}},addClass:function(A,C,z){var B;A=this.get(A);if(!A){return 0}B=this.removeClass(A,C);return A.className=z?C+(B!=""?(" "+B):""):(B!=""?(B+" "):"")+C},removeClass:function(z,A){z=this.get(z);if(!z){return 0}A=z.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)","g")," ");return z.className=A!=" "?A:""},hasClass:function(A,z){A=this.get(A);return new RegExp("\\b"+z+"\\b","g").test(A.className)},getParent:function(B,A,z){while(B){if(B==z){return null}if(A(B)){return B}B=B.parentNode}return null},keep:function(z){if(h){z=z.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");z=z.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>");z=z.replace(/<(\/?)del|<del( [^>]+)>/gi,"<$1strike$2>")}z=z.replace(/ (src|href|style)=\"([^\"]+)\"/gi,' $1="$2" mce_$1="$2"');return z}})};q.DOM=a=new o(document);q.Event=w={events:[],inits:[],unloads:[],add:function(C,D,B,A){var x,y=this,z=y.events;C=a.get(C);x=function(E){E=E||window.event;if(E&&!E.target&&i){E.target=E.srcElement}if(!A){return B(E)}return B.call(A,E)};if(D=="unload"){y.unloads.push(x);return x}if(D=="init"){if(y._init){x()}else{y.inits.push(x)}return x}z.push({obj:C,name:D,func:B,cfunc:x,scope:A});y._add(C,D,x);if(i&&z.length==1){w._add(window,"unload",y._unload,w)}return x},remove:function(A,B,z){var y=this,x=y.events;A=a.get(A);d(x,function(D,C){if(D.obj==A&&D.name==B&&(!z||D.func==z)){x.splice(C,1);y._remove(A,B,D.cfunc);return false}})},cancel:function(x){this.stop(x);return this.prevent(x)},stop:function(x){if(x.stopPropagation){x.stopPropagation()}else{x.cancelBubble=true}return false},prevent:function(x){if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false},_unload:function(){var x=w;d(x.events,function(y){x._remove(y.obj,y.name,y.cfunc)});x._remove(window,"unload",x._unload);x.events=[];d(x.unloads,function(y){y()})},_add:function(y,z,x){if(y.attachEvent){y.attachEvent("on"+z,x)}else{if(y.addEventListener){y.addEventListener(z,x,false)}else{y["on"+z]=x}}},_remove:function(y,z,x){if(y.detachEvent){y.detachEvent("on"+z,x)}else{if(y.removeEventListener){y.removeEventListener(z,x,false)}else{y["on"+z]=null}}},_pageInit:function(){var x=w;x._remove(window,"DOMContentLoaded",x._pageInit);x._init=true;d(x.inits,function(y){y()});x.inits=[]},_wait:function(){var x;if(i&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");a.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){w._pageInit();a.get("__ie_onload").onreadystatechange=null}}}else{w._add(window,"DOMContentLoaded",w._pageInit,w);if(i||n){x=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(x);w._pageInit()}},10)}}}};q.Dispatcher=j=function(x){var y=[];if(!x){x=this}p(this,{add:function(z,A){y.push({cb:z,scope:!A?x:A});return z},remove:function(z){d(y,function(B,A){if(z==B.cb){y.splice(A,1)}return false});return z},dispatch:function(){var A,z=arguments;d(y,function(B){return A=B.cb.apply(B.scope,z)});return A}})};q.Editor=k=function(E){var B,C,z=this;if(!q.baseURL){d(a.select("script"),function(F){if(/puny_mce/g.test(""+F.src)){q.baseURL=F.src.replace(/^(.+)\/puny_mce.+$/,"$1/")}})}this.settings=B=p({content_css:q.baseURL+"/css/content.css",editor_css:q.baseURL+"/css/editor.css",width:0,height:0,min_width:260,min_height:50,max_width:800,max_height:600,entities:"raw",spellcheck:0,resize:true,plugins:"",styles:[{title:"H1",cls:"h1",cmd:"FormatBlock",val:"<h1>"},{title:"H2",cls:"h2",cmd:"FormatBlock",val:"<h2>"},{title:"H3",cls:"h3",cmd:"FormatBlock",val:"<h3>"},{title:"Pre",cls:"pre",cmd:"FormatBlock",val:"<pre>"},{title:"Times",cls:"times",cmd:"FontName",val:"Times"},{title:"Arial",cls:"arial",cmd:"FontName",val:"Arial"},{title:"Courier",cls:"courier",cmd:"FontName",val:"Courier"}],toolbar:"bold,italic,underline,strike,increasefontsize,decreasefontsize,ul,ol,indent,outdent,left,center,right,style,removeformat"},E);z.tools={bold:{cmd:"Bold",title:l.bold},italic:{cmd:"Italic",title:l.italic},underline:{cmd:"Underline",title:l.underline},strike:{cmd:"Strikethrough",title:l.strike},ul:{cmd:"InsertUnorderedList",title:l.ul},ol:{cmd:"InsertOrderedList",title:l.ol},indent:{cmd:"Indent",title:l.indent},outdent:{cmd:"Outdent",title:l.outdent},left:{cmd:"JustifyLeft",title:l.left},center:{cmd:"JustifyCenter",title:l.center},right:{cmd:"JustifyRight",title:l.right},style:{cmd:"mceStyle",title:l.style},removeformat:{cmd:"RemoveFormat",title:l.removeformat},increasefontsize:{cmd:"IncreaseFontSize",title:l.increasefontsize},decreasefontsize:{cmd:"DecreaseFontSize",title:l.decreasefontsize}};a.loadCSS(B.editor_css);this.commands={mceStyle:function(M,L,K){var H,N=this,O=N.settings,F=O.id,G=a.getPos(K.target),I;if(N.hideMenu){return N.hideMenu()}function J(P){N.hideMenu=null;w.remove(document,"click",J);w.remove(N.getDoc(),"click",J);a.get(F+"_mstyle").style.display="none"}H=a.get(F+"_mstyle");if(!H){H=a.get(F+"_t");H=a.add(document.body,"div",{id:F+"_mstyle","class":"punymce_style punymce"});d(O.styles,function(P){w.add(a.add(H,"a",{href:"#","class":P.cls},P.title),"mousedown",function(Q){J.call(N);N.execCommand(P.cmd,P.ui,P.val);if(t){N.getIfr().focus()}return w.cancel(Q)})})}N.hideMenu=J;w.add(document,"click",J,N);w.add(N.getDoc(),"click",J,N);O=H.style;O.left=G.x+"px";O.top=(G.y+K.target.clientHeight+2)+"px";O.display="block"},FormatBlock:function(G,F,H){if(h&&/<(div|blockquote|code|dt|dd|dl|samp)>/gi.test(F)){F=F.replace(/[^a-z]/gi,"")}z.getDoc().execCommand("FormatBlock",0,F)},CreateLink:function(H,G){var I=z.dom,F="javascript:mox();";z.getDoc().execCommand("CreateLink",0,F);d(I.select("A"),function(J){if(I.getAttr(J,"href")==F){I.setAttr(J,"href",G);I.setAttr(J,"mce_href",G)}})},mceFontSizeDelta:function(H,G){var L=z.getDoc(),F,K,I,J=z.selection;F=parseInt(L.queryCommandValue("FontSize")||3);if(n){d([10,13,16,18,24,32,48],function(N,M){if(F==N){F=M+1;return false}})}if(F+G<=1){return}L.execCommand("FontSize",false,F+G)},IncreaseFontSize:function(){z.execCommand("mceFontSizeDelta",0,1)},DecreaseFontSize:function(){z.execCommand("mceFontSizeDelta",0,-1)},Indent:function(G,F,H){z.getDoc().execCommand("Indent",0,0);if(i){z.dom.getParent(z.selection.getNode(),function(I){if(I.nodeName=="BLOCKQUOTE"){I.dir=I.style.marginRight=""}})}},mceSetClass:function(G,F,I){var H=z.selection;if(f(F,"string")){F={element:"span","class":F}}if(H.isCollapsed()){z.dom.setAttr(H.getNode(),"class",F["class"])}else{H.setContent("<"+F.element+' class="'+F["class"]+'">'+H.getContent()+"</"+F.element+">")}},RemoveFormat:function(G,F,I){var H=z.selection;z.getDoc().execCommand("RemoveFormat",G,F);if(i){F=H.getContent();F=F.replace(/ (class|style)=\"[^\"]+\"/g,"");F=F.replace(/<\/?(font|strong|em|b|i|u|strike)>/g,"");F=F.replace(/<(font|strong|em|b|i|u|strike) [^>]+>/g,"");H.setContent(F)}}};function A(I){var J,H,F,G;J=a.get(B.id+"_c");F=J.clientWidth-2;G=J.clientHeight-2;H=a.get(B.id+"_p");H.style.width=F+"px";H.style.height=G+"px";J.style.display="none";H.style.display="block";z.resize={x:I.screenX,y:I.screenY,w:F,h:G};w.add(document,"mousemove",y,this);w.add(document,"mouseup",D,this);z.onResizeStart.dispatch(z,I,F,G)}function y(J){var H=z.resize,I,F,G;H.dx=J.screenX-H.x;H.dy=J.screenY-H.y;F=Math.max(B.min_width,H.w+H.dx);G=Math.max(B.min_height,H.h+H.dy);F=Math.min(B.max_width,F);G=Math.min(B.max_height,G);I=a.get(B.id+"_p");I.style.width=F+"px";I.style.height=G+"px";return w.cancel(J)}function D(G){var F=z.resize;w.remove(document,"mousemove",y,this);w.remove(document,"mouseup",D,this);a.get(B.id+"_c").style.display="";a.get(B.id+"_p").style.display="none";z.resizeBy(F.dx,F.dy);z.onResizeEnd.dispatch(z,G,F.dx,F.dy)}function x(){var F=a.get(B.id),G=z.getDoc();if(h){z.getDoc().designMode="On"}G.open();G.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body id="punymce"></body></html>');G.close();z.dom=C=new o(z.getDoc());C.loadCSS(B.content_css);z.onPreInit.dispatch(z);if(!B.spellcheck){z.getBody().spellcheck=0}w.add(z.getDoc(),"mouseup",z.nodeChanged,z);w.add(z.getDoc(),"keyup",z.nodeChanged,z);w.add(h?z.getDoc():z.getWin(),"focus",function(I){var H;if((H=q.focusEditor)!=null){H.onBlur.dispatch(H,z)}z.onFocus.dispatch(z,H);q.focusEditor=z},this);if(!i){z.getDoc().designMode="On"}else{z.getBody().contentEditable=true}z.setContent(f(F.value)?F.value:F.innerHTML,{load:true});a.get(B.id+"_c").style.display=z.orgDisplay;a.get(B.id).style.display="none";z.onInit.dispatch(z)}p(this,{serializer:new e(z),selection:new c(z),plugins:[]});d(["onPreInit","onInit","onFocus","onBlur","onResizeStart","onResizeEnd","onPreProcess","onPostProcess","onSetContent","onBeforeGetContent","onGetContent","onNodeChange"],function(F){z[F]=new j(z)});p(this,{init:function(){var K=a.get(B.id),M=K.parentNode,O,I,N,L,G,F,J,H=["bold","italic","underline","left","center","right"];d(B.plugins.split(","),function(P){if(P){z.plugins.push(new q.plugins[P](z))}});z.onNodeChange.add(function(){d(H,function(R){var Q;try{Q=z.getDoc().queryCommandState(z.tools[R].cmd)?a.addClass:a.removeClass;Q.call(a,B.id+"_"+R,"active")}catch(P){}})});if(B.entities=="numeric"){z.onGetContent.add(function(P,Q){if(Q.format=="html"){Q.content=Q.content.replace(/[\u007E-\uFFFF]/g,function(R){return"&#"+R.charCodeAt(0)+";"})}})}O=!B.width?K.offsetWidth:B.width;I=!B.height?K.offsetHeight:B.height;z.orgDisplay=K.style.display;K.style.display="none";if(K.form){J=K.form;z._submit=J.submit;J.submit=function(){var Q=a.get(B.id),P=Q.form;z.save();P.submit=z._submit;P.submit()};w.add(0,"unload",function(){var P=a.get(B.id).form;z._submit=z.submit=null});w.add(J,"submit",z.save,z)}N='<div id="'+B.id+'_w" class="punymce"><table id="'+B.id+'_c" class="punymce"><tr class="mceToolbar">';N+='<td id="'+B.id+'_t"></td></tr><tr class="mceBody"><td></div><div id="'+B.id+'_b" class="mceBody">';if(B.resize){N+='<div id="'+B.id+'_r" class="mceResize"></div>'}N+="</td></tr></table>";N+='<div id="'+B.id+'_p" class="mcePlaceholder"></div></div>';if(!K.insertAdjacentHTML){F=K.ownerDocument.createRange();F.setStartBefore(K);M.insertBefore(F.createContextualFragment(N),K)}else{K.insertAdjacentHTML("beforeBegin",N)}G=a.get(B.id+"_t");L=a.add(G,"ul",{id:B.id+"_tb","class":"punymce"});d(B.toolbar.split(","),function(P){var Q=z.tools[P];G=a.add(a.add(L,"li",{id:B.id+"_"+P,"class":P}),"a",{href:"javascript:void(0);","class":P,title:Q.title,tabIndex:-1,onmousedown:"return false;"});w.add(G,"click",function(R){if(!a.hasClass(R.target.parentNode,"disabled")){z.execCommand(Q.cmd,0,0,R)}return w.cancel(R)})});G=a.get(B.id+"_b");G=a.add(G,"iframe",{id:B.id+"_f",src:'javascript:""',frameBorder:"0","class":"punymce",style:"width:"+O+"px;height:"+I+"px"});z.resizeTo(O,I);if(n){w.add(G,"load",x,z);G.src=q.baseURL+"blank.htm"}else{x()}if(B.resize){w.add(B.id+"_r","mousedown",function(P){return A(P,B.id)},this)}L=J=K=G=null},getSize:function(){var F=a.get(B.id+"_f");return{w:F.clientWidth,h:F.clientHeight}},resizeTo:function(F,H){var G=a.get(B.id+"_f").style;F=Math.max(B.min_width,F);H=Math.max(B.min_height,H);F=Math.min(B.max_width,F);H=Math.min(B.max_height,H);z.width=F;z.height=H;G.width=F+"px";G.height=H+"px"},resizeBy:function(F,G){var H=z.getSize();z.resizeTo(H.w+F,H.h+G)},show:function(){a.get(B.id+"_w").style.display="block";a.get(B.id).style.display="none";z.load()},hide:function(){if(i){z.execCommand("SelectAll")}a.get(B.id+"_w").style.display="none";a.get(B.id).style.display=z.orgDisplay;z.save()},load:function(){var F=a.get(B.id);z.setContent(f(F.value)?F.value:F.innerHTML,{load:true})},save:function(){var G=a.get(B.id),F=z.getContent({save:true});if(/TEXTAREA|INPUT/.test(G.nodeName)){G.value=F}else{G.innerHTML=F}},setUseCSS:function(F){var H=z.getDoc(),G;try{H.execCommand("styleWithCSS",0,false)}catch(G){try{H.execCommand("useCSS",0,true)}catch(G){}}},execCommand:function(K,H,G,J){var F=z.commands,I;z.getWin().focus();z.setUseCSS(0);if(F[K]){I=F[K].call(z,H,G,J)}else{I=z.getDoc().execCommand(K,H,G)}if(I!==false){z.nodeChanged()}},getContent:function(G){var F;G=G||{};G.format=G.format||"html";z.onBeforeGetContent.dispatch(this,G);F=z.serializer.serialize(z.getBody(),G);F=F.replace(/^\s*|\s*$/g,"");G.content=F;z.onGetContent.dispatch(this,G);return G.content},setContent:function(F,G){G=G||{};G.content=F;z.onSetContent.dispatch(this,G);F=G.content;F=a.keep(F);z.getBody().innerHTML=F;if(G.format!="raw"){z.setContent(F=z.getContent(G),{format:"raw"})}else{z.getBody().innerHTML=F}return F},getIfr:function(){return a.get(B.id+"_f")},getWin:function(){return z.getIfr().contentWindow},getDoc:function(){return z.getWin().document},getBody:function(){return z.getDoc().body},nodeChanged:function(){z.setUseCSS(0);z.onNodeChange.dispatch(z,z.selection.getNode())}});w.add(window,"init",z.init,this)};q.Selection=c=function(x){var y=this;p(y,{getContent:function(C){var z,A=y.getRng(),B=document.createElement("body");C=C||{};if(y.isCollapsed()){return""}if(A.cloneContents){B.appendChild(A.cloneContents())}else{if(f(A.item)||f(A.htmlText)){B.innerHTML=A.item?A.item(0).outerHTML:A.htmlText}else{B.innerHTML=A.toString()}}if(C.format!="raw"){C.content=z;x.serializer.serialize(B,C);C.content=C.content.replace(/^\s*|\s*$/g,"");x.onGetContent.dispatch(z,C);z=C.content}else{z=B.innerHTML}return z},getText:function(){var A=y.getRng(),z=y.getSel();if(u){return z}return y.isCollapsed()?"":A.text||z.toString()},setContent:function(B,D){var C=y.getRng(),z,E,C,A;D=D||{format:"raw"};B=a.keep(B);if(D.format!="raw"){D.content=B;B=x.onSetContent.dispatch(this,D);B=D.content;z=x.dom.create("body");z.innerHTML=B}if(C.insertNode){C.deleteContents();C.insertNode(C.createContextualFragment(B+'<span id="__caret">_</span>'));E=x.dom.get("__caret");C=x.getDoc().createRange();C.setStartBefore(E);C.setEndBefore(E);A=y.getSel();A.removeAllRanges();A.addRange(C);E.parentNode.removeChild(E)}else{if(C.pasteHTML){C.pasteHTML(B)}else{C.item(0).outerHTML=B}}},select:function(D,C){var B=y.getRng(),A=y.getSel();if(B.moveToElementText){try{B.moveToElementText(D);B.select()}catch(z){}}else{if(A.addRange){C?B.selectNodeContents(D):B.selectNode(D);A.removeAllRanges();A.addRange(B)}else{A.setBaseAndExtent(D,0,D,1)}}return D},isCollapsed:function(){var z=y.getRng();if(z.item){return false}return z.boundingWidth==0||y.getSel().isCollapsed},collapse:function(z){var B=y.getRng(),A=y.getSel();if(B.select){B.collapse(z);B.select()}else{if(z){A.collapseToStart()}else{A.collapseToEnd()}}},getSel:function(){var z=x.getWin();return z.getSelection?z.getSelection():x.getDoc().selection},getRng:function(){var z=y.getSel(),F=x.getDoc(),B,D,E,A;if(!z){return null}try{return z.rangeCount>0?z.getRangeAt(0):(z.createRange?z.createRange():null)}catch(C){return F.body.createTextRange()}},setRng:function(A){var z=y.getSel();z.removeAllRanges();z.addRange(A)},setNode:function(z){y.setContent(x.dom.create("div",null,z).innerHTML)},getNode:function(){var A=y.getRng(),z=y.getSel(),B;if(!i){if(A){B=A.commonAncestorContainer;if(!A.collapsed){if(A.startContainer==A.endContainer){if(A.startOffset-A.endOffset<2){if(A.startContainer.hasChildNodes()){B=A.startContainer.childNodes[A.startOffset]}}}}}return a.getParent(B,function(C){return C.nodeType==1})}return A.item?A.item(0):A.parentElement()}})};q.Serializer=e=function(y){var A,B=0,C;function z(){var F=document.implementation;if(!F||!F.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(E){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(E){}}else{return F.createDocument("","",null)}}A=z();this.settings=C=p({valid_nodes:0,invalid_nodes:/(BODY)/,valid_attrs:0,node_filter:0,root_node:0,pi:0,invalid_attrs:/(^mce_|^_moz_|^contenteditable$)/,closed:/(BR|HR|INPUT|META|IMG)/},y.settings.serializer);function D(F){var E=[];F.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(H,G){E.push({specified:1,nodeName:G})});return E}function x(G,J){var K,E,L,I,H,M,F,O,N;if((!C.valid_nodes||C.valid_nodes.test(G.nodeName))&&(!C.invalid_nodes||!C.invalid_nodes.test(G.nodeName))&&(!C.node_filter||C.node_filter(G,J))){switch(G.nodeType){case 1:if(i){if(G.mce_serialized==B){return}G.mce_serialized=B}K=G.hasChildNodes();E=A.createElement(G.nodeName.toLowerCase());F=i?D(G):G.attributes;for(I=F.length-1;I>-1;I--){O=F[I];if(O.specified){M=O.nodeName.toLowerCase();if(C.invalid_attrs&&C.invalid_attrs.test(M)){continue}if(C.valid_attrs&&!C.valid_attrs.test(M)){continue}N=a.getAttr(G,M);if(N!==""){E.setAttribute(M,N)}}}if(!K&&!C.closed.test(G.nodeName)){E.appendChild(A.createTextNode(""))}J=J.appendChild(E);break;case 3:return J.appendChild(A.createTextNode(G.nodeValue));case 8:return J.appendChild(A.createComment(G.nodeValue))}}else{if(G.nodeType==1){K=G.hasChildNodes()}}if(K){L=G.firstChild;while(L){x(L,J);L=L.nextSibling}}}p(this,{serialize:function(G,F){var E;B=""+(parseInt(B)+1);if(A.firstChild){A.removeChild(A.firstChild)}G=F.node=G.cloneNode(1);y.onPreProcess.dispatch(this,F);x(G,A.appendChild(A.createElement("html")));E=A.xml||new XMLSerializer().serializeToString(A);if(!C.pi){E=E.replace(/<\?[^?]+\?>/g,"")}if(!C.root_node){E=E.replace(/<html>|<\/html>/g,"")}F.content=E;y.onPostProcess.dispatch(this,F);return F.content}})};w._wait();window.punymce=q})({});(function(a){a.plugins.ForceBlocks=function(e){var y=a.Event,w,h=this;var o,l,x,u;var d,v,q;o=a.isIE;l=a.isGecko;x=a.isOpera;u=a.isWebKit;d=a.each;v=a.extend;this.settings=q=v({element:"P"},e.settings.forceblocks);e.onPreInit.add(n,h);if(!o){e.onSetContent.add(function(t,z){if(z.format=="html"){z.content=z.content.replace(/<p>[\s\u00a0]+<\/p>/g,"<p><br /></p>")}})}e.onPostProcess.add(function(t,z){z.content=z.content.replace(/<p><\/p>/g,"<p>\u00a0</p>")});function n(){w=e.dom;y.add(e.getDoc(),"keyup",k);e.onSetContent.add(k);e.onBeforeGetContent.add(k);if(!o){e.onPreProcess.add(function(t,z){d(z.node.getElementsByTagName("br"),function(B){var A=B.parentNode;if(A&&A.nodeName=="p"&&(A.childNodes.length==1||A.lastChild==B)){A.replaceChild(t.getDoc().createTextNode("\u00a0"),B)}})});y.add(e.getDoc(),"keypress",function(t){if(t.keyCode==13&&!t.shiftKey){if(!p(t)){return y.cancel(t)}}});if(l){y.add(e.getDoc(),"keydown",function(t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){i(t,t.keyCode==8)}})}}}function c(z){var A,t;A=z.document;t=A.compatMode=="CSS1Compat"?A.documentElement:A.body;return{x:z.pageXOffset||t.scrollLeft,y:z.pageYOffset||t.scrollTop,w:z.innerWidth||t.clientWidth,h:z.innerHeight||t.clientHeight}}function m(D,A,B){var z=e.getDoc().createTreeWalker(D,4,null,false),D,C=-1;while(D=z.nextNode()){C++;if(A==0&&D==B){return C}if(A==1&&C==B){return D}}return -1}function k(){var F=this,R=e.getBody(),O=e.getDoc(),U=e.selection,G=U.getSel(),H=U.getRng(),S=-2,D,M,z,A,P=-16777215;var Q,B,T,L,I,C=R.childNodes,K,J,E;for(K=C.length-1;K>=0;K--){Q=C[K];if(Q.nodeType==3||(!g(Q)&&Q.nodeType!=8)){if(!B){if(Q.nodeType!=3||/[^\s]/g.test(Q.nodeValue)){if(S==-2&&H){if(!o){if(H.startContainer.nodeType==1&&(J=H.startContainer.childNodes[H.startOffset])&&J.nodeType==1){E=J.getAttribute("id");J.setAttribute("id","__mce")}else{if(e.dom.getParent(H.startContainer,function(t){return t===R})){M=H.startOffset;z=H.endOffset;S=m(R,0,H.startContainer);D=m(R,0,H.endContainer)}}}else{A=O.body.createTextRange();A.moveToElementText(R);A.collapse(1);T=A.move("character",P)*-1;A=H.duplicate();A.collapse(1);L=A.move("character",P)*-1;A=H.duplicate();A.collapse(0);I=(A.move("character",P)*-1)-L;S=L-T;D=I}}B=e.dom.create(q.element);B.appendChild(Q.cloneNode(1));Q.parentNode.replaceChild(B,Q)}}else{if(B.hasChildNodes()){B.insertBefore(Q,B.firstChild)}else{B.appendChild(Q)}}}else{B=null}}if(S!=-2){if(!o){B=R.getElementsByTagName(q.element)[0];H=O.createRange();if(S!=-1){H.setStart(m(R,1,S),M)}else{H.setStart(B,0)}if(D!=-1){H.setEnd(m(R,1,D),z)}else{H.setEnd(B,0)}if(G){G.removeAllRanges();G.addRange(H)}}else{try{H=G.createRange();H.moveToElementText(R);H.collapse(1);H.moveStart("character",S);H.moveEnd("character",D);H.select()}catch(N){}}}else{if(!o&&(J=e.dom.get("__mce"))){if(E){J.setAttribute("id",E)}else{J.removeAttribute("id")}H=O.createRange();H.setStartBefore(J);H.setEndBefore(J);U.setRng(H)}}}function g(t){return t.nodeType==1&&/^(H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CODE|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(t.nodeName)}function f(t){return w.getParent(t,function(z){return g(z)})}function j(t){t=t.innerHTML;t=t.replace(/<img|hr|table/g,"d");t=t.replace(/<[^>]+>/g,"");return t.replace(/[ \t\r\n]+/g,"")==""}function p(Q){var R=e.getDoc(),I=e.selection.getSel(),J=e.selection.getRng(),S=R.body;var M,N,K,P,O,B,z,C,E,t,G,T,A,D,L,F,H;if(a.isOldWebKit){return true}M=R.createRange();M.setStart(I.anchorNode,I.anchorOffset);M.collapse(true);N=R.createRange();N.setStart(I.focusNode,I.focusOffset);N.collapse(true);K=M.compareBoundaryPoints(M.START_TO_END,N)<0;P=K?I.anchorNode:I.focusNode;O=K?I.anchorOffset:I.focusOffset;B=K?I.focusNode:I.anchorNode;z=K?I.focusOffset:I.anchorOffset;P=P.nodeName=="BODY"?P.firstChild:P;B=B.nodeName=="BODY"?B.firstChild:B;C=f(P);E=f(B);t=C?C.nodeName:q.element;if(w.getParent(C,function(U){return/OL|UL/.test(U.nodeName)})){return true}if(C&&(C.nodeName=="CAPTION"||/absolute|relative|static/gi.test(C.style.position))){t=q.element;C=null}if(E&&(E.nodeName=="CAPTION"||/absolute|relative|static/gi.test(E.style.position))){t=q.element;E=null}if(/(TD|TABLE|TH|CAPTION)/.test(t)||(C&&t=="DIV"&&/left|right/gi.test(C.style.cssFloat))){t=q.element;C=E=null}G=(C&&C.nodeName==t)?C.cloneNode(0):R.createElement(t);T=(E&&E.nodeName==t)?E.cloneNode(0):R.createElement(t);T.id="";if(/^(H[1-6])$/.test(t)&&P.nodeValue&&O==P.nodeValue.length){T=R.createElement(q.element)}L=A=P;do{if(L==S||L.nodeType==9||g(L)||/(TD|TABLE|TH|CAPTION)/.test(L.nodeName)){break}A=L}while((L=L.previousSibling?L.previousSibling:L.parentNode));L=D=B;do{if(L==S||L.nodeType==9||g(L)||/(TD|TABLE|TH|CAPTION)/.test(L.nodeName)){break}D=L}while((L=L.nextSibling?L.nextSibling:L.parentNode));if(A.nodeName==t){M.setStart(A,0)}else{M.setStartBefore(A)}M.setEnd(P,O);G.appendChild(M.cloneContents());N.setEndAfter(D);N.setStart(B,z);T.appendChild(N.cloneContents());J=R.createRange();if(!A.previousSibling&&A.parentNode.nodeName==t){J.setStartBefore(A.parentNode)}else{if(M.startContainer.nodeName==t&&M.startOffset==0){J.setStartBefore(M.startContainer)}else{J.setStart(M.startContainer,M.startOffset)}}if(!D.nextSibling&&D.parentNode.nodeName==t){J.setEndAfter(D.parentNode)}else{J.setEnd(N.endContainer,N.endOffset)}J.deleteContents();if(G.firstChild&&G.firstChild.nodeName==t){G.innerHTML=G.firstChild.innerHTML}if(T.firstChild&&T.firstChild.nodeName==t){T.innerHTML=T.firstChild.innerHTML}if(j(G)){G.innerHTML=x?" <br />":"<br />"}if(j(T)){T.innerHTML=x?" <br />":"<br />"}if(x){J.insertNode(G);J.insertNode(T)}else{J.insertNode(T);J.insertNode(G)}T.normalize();G.normalize();J=R.createRange();J.selectNodeContents(T);J.collapse(1);I.removeAllRanges();I.addRange(J);vp=c(e.getWin());F=e.dom.getPos(T).y;H=T.clientHeight;if(F<vp.y||F+H>vp.y+vp.h){e.getWin().scrollTo(0,F<vp.y?F:F-vp.h+25)}return false}function i(A,G){var D=e.getBody(),z,B=e.selection,t=B.getRng(),C=t.startContainer,z,E,F;if(C&&g(C)&&!/^(TD|TH)$/.test(C.nodeName)&&G){if(C.childNodes.length==0||(C.childNodes.length==1&&C.firstChild.nodeName=="BR")){z=C;while((z=z.previousSibling)&&!g(z)){}if(z){if(C!=D.firstChild){E=e.getDoc().createTreeWalker(z,NodeFilter.SHOW_TEXT,null,false);while(F=E.nextNode()){z=F}t=e.getDoc().createRange();t.setStart(z,z.nodeValue?z.nodeValue.length:0);t.setEnd(z,z.nodeValue?z.nodeValue.length:0);B.getSel().removeAllRanges();B.getSel().addRange(t);C.parentNode.removeChild(C)}return y.cancel(A)}}}function H(I){var J;I=I.target;if(I&&I.parentNode&&I.nodeName=="BR"&&(z=f(I))){J=I.previousSibling;y.remove(D,"DOMNodeInserted",H);if(J&&J.nodeType==3&&/\s+$/.test(J.nodeValue)){return}if(I.previousSibling||I.nextSibling){I.parentNode.removeChild(I)}}}y._add(D,"DOMNodeInserted",H);window.setTimeout(function(){y._remove(D,"DOMNodeInserted",H)},1)}}})(punymce);(function(a){a.plugins.Emoticons=function(f){var l=a.Event,j,i,d,c,n,k,m,e;j=a.each;i=a.extend;d=a.isIE;c=a.isGecko;m=a.DOM;this.settings=n=i({emoticons:{happy:[":)","=)"],unhappy:[":|","=|"],sad:[":(","=("],grin:[":D","=D"],surprised:[":o",":O","=o","=O"],wink:[";)"],halfhappy:[":/","=/"],tounge:[":P",":p","=P","=p"],lol:[],mad:[],rolleyes:[],cool:[]},row_length:4,trans_img:a.baseURL+"plugins/emoticons/img/trans.gif",skip_css:0,auto_convert:1},f.settings.emoticons);if(!n.skip_css){m.loadCSS(a.baseURL+"/plugins/emoticons/css/editor.css")}k="";j(n.emoticons,function(h){j(h,function(o){if(k.length!=0){k+="|"}k+=o.replace(/([^a-zA-Z0-9])/g,"\\$1")})});k=new RegExp(k,"g");i(f.commands,{mceEmoticons:function(B,A,y){var q,C=this,h=f.settings.id,o=m.getPos(y.target),z,w;if(f.hideMenu){return f.hideMenu()}function x(p){f.hideMenu=null;l.remove(document,"click",x);l.remove(f.getDoc(),"click",x);m.get(h+"_memoticons").style.display="none";return 1}q=m.get(h+"_memoticons");if(!q){q=m.get(h+"_t");q=m.add(document.body,"div",{id:h+"_memoticons","class":"punymce_emoticons punymce"});q=m.add(q,"table",{"class":"punymce"});q=m.add(q,"tbody");z=n.row_length;j(n.emoticons,function(t,p){if(z==n.row_length){r=m.add(q,"tr");z=0}z++;l.add(m.add(m.add(r,"td"),"a",{href:"#","class":"emoticon "+p}),"mousedown",function(u){x.call(C);f.selection.setNode(f.dom.create("img",{title:t[0]||p,src:n.trans_img,"class":"emoticon "+p}));return l.cancel(u)})})}l.add(document,"click",x,C);l.add(f.getDoc(),"click",x,C);f.hideMenu=x;s=m.get(h+"_memoticons").style;s.left=o.x+"px";s.top=(o.y+y.target.clientHeight+2)+"px";s.display="block"}});function g(h){var o;j(n.emoticons,function(q,p){j(q,function(t){if(t==h){o=p;return false}});return !o});return o}f.onPreProcess.add(function(q,t){var p=t.node.getElementsByTagName("img"),h=[];j(p,function(o){h.push(o)});j(h,function(u){var o=f.dom.getAttr(u,"class");if(o&&o.indexOf("emoticon")!=-1){u.parentNode.replaceChild(f.getDoc().createTextNode(u.getAttribute("title")),u)}})});f.onSetContent.add(function(p,q){var h=[];e=q.content.replace(/(<\/?[^>]+>|:\/\/)/g,function(o){return o.replace(k,function(t){var u=g(t);if(u){h.push(t);return"�"+h.length+"�"}return t})});e=e.replace(k,function(o){return'<img src="'+n.trans_img+'" title="'+o+'" class="emoticon '+g(o)+'" />'});e=e.replace(/�([^�]+)�/g,function(t,o){return h[parseInt(o)-1]});q.content=e});f.onInit.add(function(){var h=f.dom;if(!n.skip_css){h.loadCSS(a.baseURL+"/plugins/emoticons/css/content.css")}l.add(f.getDoc(),"controlselect",function(o){if(h.getAttr(o.target,"class").indexOf("emoticon")!=-1){return l.cancel(o)}});if(c){l.add(f.getDoc(),"mousedown",function(o){if(h.getAttr(o.target,"class").indexOf("emoticon")!=-1){f.getDoc().execCommand("enableObjectResizing",false,false);return l.cancel(o)}else{f.getDoc().execCommand("enableObjectResizing",false,true)}});l.add(f.getDoc(),"keydown",function(u){var y=f.selection,v=y.getSel(),w=f.getDoc(),o=y.getRng(),x,p,q,t;x=o.startContainer;p=o.startOffset;if(x.nodeType==1){return}if(x){if(u.keyCode==39&&p==x.nodeValue.length){q=x.nextSibling;if(q&&q.nodeName=="IMG"){q=q.nextSibling;o=w.createRange();o.setStart(q,0);o.setEnd(q,0);v.removeAllRanges();v.addRange(o);return l.cancel(u)}}if(u.keyCode==37&&p==0){q=x.previousSibling;if(q&&q.nodeName=="IMG"){q=q.previousSibling;t=q.nodeValue.length;o=w.createRange();o.setStart(q,t);o.setEnd(q,t);v.removeAllRanges();v.addRange(o);return l.cancel(u)}}}})}l.add(f.getDoc(),"keypress",function(u){var q,y,p,x,w=f.getDoc(),v=f.selection,z=v.getSel(),o=v.getRng();function t(D){var C,B,A;if(!d){C=o.startContainer;B=o.startOffset;A=o.endOffset;if(B>0&&C.nodeType==3){return C.nodeValue.substring(Math.max(0,B+D),A)}}else{o=o.duplicate();o.moveStart("character",D);return o.text}}if(a.isOldWebKit||!n.auto_convert){return true}if(/(ttp|ftp):/i.test(t(-4))){return}p=t(-1);q=p+String.fromCharCode(u.charCode||u.keyCode);k.lastIndex=0;if(!p||!k.test(q)||x=="/"){return}if(y=g(q)){if(!d){o.setStart(o.startContainer,o.startOffset-1);z.removeAllRanges();z.addRange(o)}else{o=f.selection.getRng();o.moveStart("character",-1);o.select()}f.selection.setNode(h.create("img",{id:"emoticon",title:q,src:n.trans_img,"class":"emoticon "+y}));q=h.get("emoticon");h.setAttr(q,"id","");f.selection.select(q);f.selection.collapse(0);return l.cancel(u)}})});i(f.tools,{emoticons:{cmd:"mceEmoticons",title:a.I18n.emoticons}})};a.extend(a.I18n,{emoticons:"Insert emoticon"})})(punymce);(function(a){a.plugins.EditSource=function(d){var e=a.DOM,h=a.extend,g=a.each,f=a.isWebKit;var c=0;if(!d.settings.editsource||d.settings.editsource.skip_css){e.loadCSS(a.baseURL+"/plugins/editsource/css/editor.css")}d.onBeforeGetContent.add(function(i,j){if(j.save&&c){i.setContent(e.get(i.settings.id+"_editsourcearea").value,{load:true})}});h(d.commands,{mceEditSource:function(t,q,o){var k,j=d.getIfr(),i=d.settings.id,p=d.width,l=d.height,n,m=e.get(i+"_editsource");if(!c){e.addClass(m,"active");g(e.select("li",i+"_c"),function(u){if(u!=m){e.addClass(u,"disabled")}});k=e.add(j.parentNode,"textarea",{id:i+"_editsourcearea","class":"editsource",style:"width:"+p+"px;height:"+l+"px;"});k.value=d.getContent({save:true});k.focus();if(!f){e.add(j.parentNode,"div",{id:i+"_edspacer","class":"spacer",style:"width:"+p+"px;height:"+l+"px;"});j.style.display="none"}c=1;return false}c=0;e.removeClass(m,"active");if(!f){j.style.display="block";k=e.get(i+"_edspacer");k.parentNode.removeChild(k)}k=e.get(i+"_editsourcearea");d.setContent(k.value,{load:true});k.parentNode.removeChild(k);g(e.select("li",i+"_c"),function(u){e.removeClass(u,"disabled")});return false}});h(d.tools,{editsource:{cmd:"mceEditSource",title:a.I18n.editsource}})};a.extend(a.I18n,{editsource:"Edit HTML source"})})(punymce);(function(a){a.plugins.Image=function(c){var d=a.I18n;if(!c.settings.image||c.settings.image.skip_css){a.DOM.loadCSS(a.baseURL+"/plugins/image/css/editor.css")}a.extend(c.commands,{mceInsertImage:function(i,h,k){var g,j=c.selection.getNode();g=prompt(d.entersrc,j.nodeName=="IMG"?c.dom.getAttr(j,"src"):"");if(g){c.selection.setNode(c.dom.create("img",{src:g}))}}});a.extend(c.tools,{image:{cmd:"mceInsertImage",title:d.insertimage}})};a.extend(a.I18n,{insertimage:"Insert image",entersrc:"Enter the URL of the image"})})(punymce);(function(a){a.plugins.Link=function(c){var d=a.I18n;if(!c.settings.link||c.settings.link.skip_css){a.DOM.loadCSS(a.baseURL+"/plugins/link/css/editor.css")}a.extend(c.commands,{mceInsertLink:function(i,h,k){var g,j=c.selection.getNode();g=prompt(d.enterhref,j.nodeName=="A"?c.dom.getAttr(j,"href"):"");if(g){if(c.selection.isCollapsed()){c.selection.setContent('<a href="'+g+'">'+g+"</a>")}else{c.execCommand("CreateLink",0,g)}}}});a.extend(c.tools,{link:{cmd:"mceInsertLink",title:d.link},unlink:{cmd:"Unlink",title:d.unlink}})};a.extend(a.I18n,{link:"Insert link",unlink:"Unlink",enterhref:"Enter the URL of the link"})})(punymce);(function(a){a.plugins.TextColor=function(e){var d="000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF";var g=a.DOM,c=a.Event,h=a.each,i=a.extend,f;if(!e.settings.textcolor||e.settings.textcolor.skip_css){g.loadCSS(a.baseURL+"/plugins/textcolor/css/editor.css")}f=i({colors:d},e.settings.textcolor);i(e.commands,{mceColor:function(y,x,q){var l,z=this,j=e.settings.id,k=g.getPos(q.target),w,m;if(e.hideMenu){return e.hideMenu()}function o(n){e.hideMenu=null;c.remove(document,"click",o);c.remove(e.getDoc(),"click",o);g.get(j+"_mcolor").style.display="none";return 1}l=g.get(j+"_mcolor");if(!l){l=g.get(j+"_t");l=g.add(document.body,"div",{id:j+"_mcolor","class":"punymce_color punymce"});l=g.add(l,"table",{"class":"punymce"});l=g.add(l,"tbody");w=8;h(f.colors.split(","),function(n){if(w==8){r=g.add(l,"tr");w=0}w++;c.add(g.add(g.add(r,"td"),"a",{href:"#",style:"background:#"+n}),"mousedown",function(p){o.call(z);e.execCommand("forecolor",0,"#"+n);return c.cancel(p)})})}c.add(document,"click",o,z);c.add(e.getDoc(),"click",o,z);e.hideMenu=o;f=g.get(j+"_mcolor").style;f.left=k.x+"px";f.top=(k.y+q.target.clientHeight+2)+"px";f.display="block"}});i(e.tools,{textcolor:{cmd:"mceColor",title:a.I18n.textcolor}})};a.extend(a.I18n,{textcolor:"Text color"})})(punymce);(function(c){var a=c.Event;function d(i,g){var h,f;h=g.parentNode;f=g.nextSibling;if(f){h.insertBefore(i,f)}else{h.appendChild(i)}return i}function e(h,j,i){var f,g=h.getDoc().createTreeWalker(j,NodeFilter.SHOW_TEXT,null,false);if(i){return g.nextNode()}while(f=g.nextNode()){j=f}return j}c.plugins.Paste=function(g){var j=c.DOM,h;g.onPaste=new c.Dispatcher(g);function i(w){var x,u=[],n,t,m=g.selection,l,o,q,k,p;g.getWin().focus();if(h){r=g.selection.getRng();r.moveToBookmark(h);r.select()}x=w.split(/\r?\n/);if(x.length>1){w="";c.each(x,function(v){w+="<p>"+v+"</p>"});if(!c.isIE){g.execCommand("Delete");m.setContent('<span id="marker"></span>');n=g.dom.getParent(g.dom.get("marker").parentNode,function(v){u.push(v);if(/^(p|h[1-6]|div)$/i.test(v.nodeName)){return true}});if(n){g.onPaste.dispatch({text:w});l=o="";for(q=0;q<u.length;q++){l+="</"+u[q].nodeName.toLowerCase()+">"}for(q=u.length-1;q>=0;q--){o+="<"+u[q].nodeName.toLowerCase()+">"}w=l+w+o+'<span id="_caret">&nbsp;</span>';g.getBody().innerHTML=g.getBody().innerHTML.replace(/<span id=\"marker\"><\/span>/gi,w);t=g.dom.get("_caret");if(!c.isGecko){t.scrollIntoView()}k=g.getDoc().createRange();k.setStartBefore(t);k.setEndAfter(t);m.setRng(k);g.execCommand("Delete");return}else{p=g.dom.get("marker");p.parentNode.removeChild(p)}}}g.selection.setContent(w);g.onPaste.dispatch({text:w})}function f(q){var t,l,o=g.selection,m=o.getSel(),p,k=g.getBody();t=g.dom.add(k,"div",{id:"_mcePaste",style:"position:absolute;left:-10000px;top:"+k.scrollTop},"&nbsp;");p=o.getRng();t=t.firstChild;l=g.getDoc().createRange();l.setStart(t,0);l.setEnd(t,1);m.removeAllRanges();m.addRange(l);window.setTimeout(function(){var v=g.dom.get("_mcePaste"),u;u=v.innerHTML;v.parentNode.removeChild(v);if(p){o.setRng(p)}i(u.replace(/[\r\n]/g,"").replace(/<(\/p|br\s*\/?)>/g,"\n").replace(/<!--.*?-->/g,"").replace(/<[^>]+>/g,""))},0)}g.onInit.add(function(){if(c.isOpera){return}if(/Firefox\/2/.test(navigator.userAgent)){a.add(g.getDoc(),"keydown",function(k){if(((k.metaKey||k.ctrlKey)&&k.keyCode==86)||(k.shiftKey&&k.keyCode==45)){if(c.isIE){h=g.selection.getRng().getBookmark()}f(k)}},this)}else{a.add(c.isIE?g.getBody():g.getDoc(),"paste",function(k){var l;if(g.getWin().clipboardData){i(g.getWin().clipboardData.getData("Text"));return a.cancel(k)}if(k.clipboardData){i(k.clipboardData.getData("text/plain"));return a.cancel(k)}f(k)})}})}})(punymce);(function(a){a.plugins.BBCode=function(c){c.onGetContent.add(function(d,e){if(e.format=="bbcode"||e.save){a.each([[/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],[/<font.*?color=\"([^\"]+)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"],[/<img.*?src=\"([^\"]+)\".*?\/>/gi,"[img]$1[/img]"],[/<(br\s*\/)>/gi,"\n"],[/<(\/?)(strong|b)[^>]*>/gi,"[$1b]"],[/<(\/?)(em|i)[^>]*>/gi,"[$1i]"],[/<(\/?)u[^>]*>/gi,"[$1u]"],[/<(\/?)(code|pre)[^>]*>/gi,"[$1code]"],[/<(\/?)(span.*?class=\"quote\")[^>]*>(.*?)<\/span>/gi,"[$1quote]$3[/quote]"],[/<p>/gi,""],[/<\/p>/gi,"\n"],[/&quot;/gi,'"'],[/&lt;/gi,"<"],[/&gt;/gi,">"],[/&amp;/gi,"&"],[/<[^>]+>/gi,""]],function(f){e.content=e.content.replace(f[0],f[1])})}});c.onSetContent.add(function(d,e){if(e.format=="bbcode"||e.load){a.each([[/\n/gi,"<br />"],[/\[(\/?)b\]/gi,"<$1strong>"],[/\[(\/?)i\]/gi,"<$1em>"],[/\[(\/?)u\]/gi,"<$1u>"],[/\[(\/?)code\]/gi,"<$1pre>"],[/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'],[/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'],[/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'],[/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'],[/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quote">$1</span>']],function(f){e.content=e.content.replace(f[0],f[1])})}})}})(punymce);(function(a){a.plugins.Entities=function(f){var k,d,j="",c={},g,e,h;k=f.settings;k.entities="named";h=k.entity_list;if(!h){h="160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro"}d=h.split(",");for(g=0;g<d.length;g+=2){c[String.fromCharCode(d[g])]=d[g+1];e=parseInt(d[g]).toString(16);j+="\\u"+"0000".substring(e.length)+e}j=new RegExp("["+j+"]","g");f.onGetContent.add(function(i,l){if(l.format=="html"){l.content=l.content.replace(j,function(m){var n;if(n=c[m]){m="&"+n+";"}return m})}})}})(punymce);(function(a){a.plugins.Protect=function(c){var f=[],d,e;e=c.settings.protect||{};if(!e.list){e.list=[/<(script|noscript|style)[\u0000-\uFFFF]*?<\/(script|noscript|style)>/g]}c.onSetContent.add(function(g,h){a.each(e.list,function(i){h.content=h.content.replace(i,function(j){f.push(j);return"<!-- pro:"+(f.length-1)+" -->"})})});c.onGetContent.add(function(g,h){h.content=h.content.replace(/<!-- pro:([0-9]+) -->/g,function(j,i){return f[parseInt(i)]})})}})(punymce);(function(a){function c(g,e){var f,d;f=e.parentNode;d=e.nextSibling;if(d){f.insertBefore(g,d)}else{f.appendChild(g)}return g}a.plugins.TabFocus=function(e){var d=a.Event,f=a.DOM;e.onInit.add(function(){var h,g,i;i=c(f.create("a",{href:"#"}),f.get(e.settings.id+"_c"));d.add(i,"focus",function(j){e.getWin().focus()});d.add(e.getDoc(),"keydown",function(j){if(j.keyCode==9){return d.cancel(j)}});d.add(e.getDoc(),"keydown",function(j){if(j.keyCode==9){window.focus();f.get(e.settings.tabfocus_id).focus()}})})}})(punymce);(function(a){a.plugins.Safari2x=function(h){var k=a.each,l=a.Event,g,f,j;if(!a.isOldWebKit){return}h.selection.getRng=function(){var n=this,o=n.getSel(),w=h.getDoc(),q,u,v,p;if(o.anchorNode){q=w.createRange();try{u=w.createRange();u.setStart(o.anchorNode,o.anchorOffset);u.collapse(1);v=w.createRange();v.setStart(o.focusNode,o.focusOffset);v.collapse(1);p=u.compareBoundaryPoints(u.START_TO_END,v)<0;q.setStart(p?o.anchorNode:o.focusNode,p?o.anchorOffset:o.focusOffset);q.setEnd(p?o.focusNode:o.anchorNode,p?o.focusOffset:o.anchorOffset)}catch(m){}}return q};f=h.selection.setContent;h.selection.setContent=function(o,n){var p=this.getRng();try{f.call(this,o,n)}catch(m){b=h.dom.create("body");b.innerHTML=o;k(b.childNodes,function(q){p.insertNode(q.cloneNode(true))})}};j=h.selection.collapse;h.selection.collapse=function(m){try{j.call(this,m)}catch(n){}};h.onInit.add(function(){a.DOM.get(h.settings.id+"_r").style.display="none"});h.onPreInit.add(function(){l.add(h.getDoc(),"click",function(m){if(m.target.nodeName=="A"){h.selection.select(m.target);return l.cancel(m)}});l.add(h.getDoc(),"keydown",function(q){var m=h.selection,v,t,p,u;if(q.charCode>32||q.keyCode==13){v=h.dom.getParent(m.getNode(),function(o){return o.nodeName=="LI"});if(v){t=m.getRng().startOffset;if(q.keyCode==13){if(!v.hasChildNodes()){if(!v.nextSibling||v.nextSibling.nodeName!="LI"){p=h.dom.getParent(m.getNode(),function(o){return/(UL|OL)/.test(o.nodeName)});v.parentNode.removeChild(v);m.select(p.nextSibling);return}return l.cancel(q)}u=h.getDoc().createTextNode("\u00a0");v.appendChild(u);window.setTimeout(function(){var o=m.getNode();if(o.firstChild&&o.firstChild.nodeValue.charAt(0)=="\u00a0"){o.removeChild(o.firstChild);m.select(o)}},1)}else{u=String.fromCharCode(q.charCode);if(!/^\w$/.test(u)){return}m.setContent(u);p=m.getRng();m=m.getSel();v=m.anchorNode;if(v.nodeName=="LI"){m.setBaseAndExtent(v,1,v,1)}else{v=v.nextSibling;m.setBaseAndExtent(v,1,v,1)}return l.cancel(q)}}}})});function c(t,m){var q=h.getDoc(),p,o;m=m||{};q.execCommand("FontName",false,"_tmp");k(h.dom.select("span"),function(n){if(n.style.fontFamily=="_tmp"){p=d(n,t,m);if(!o){o=p}}});p=p.firstChild;h.selection.getSel().setBaseAndExtent(o,0,p,p.nodeValue.length)}function i(p){var o=h.selection,m;o.setContent("<"+p+'><li id="_tmp"></li></'+p+">");m=h.dom.get("_tmp");m.id="";o.select(m);o.collapse(1)}function e(m){return h.dom.getParent(m,function(o){return/^(H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CODE|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(o.nodeName)})}function d(p,t,m){var q=h.getDoc(),o;m=m||{};o=q.createElement(t);k(p.attributes,function(u){if(u.specified&&u.nodeValue){o.setAttribute(u.nodeName,u.nodeValue)}});k(m,function(u,n){o.setAttribute(n,u)});k(p.childNodes,function(u){o.appendChild(u.cloneNode(true))});p.parentNode.replaceChild(o,p);return o}a.extend(h.commands,{IncreaseFontSize:function(){var n=h.getDoc(),m=parseInt(n.queryCommandValue("FontSize"));n.execCommand("FontSize",false,(m+1)+"px")},DecreaseFontSize:function(){var n=h.getDoc(),m=parseInt(n.queryCommandValue("FontSize"));if(m>0){n.execCommand("FontSize",false,(m-1)+"px")}},Strikethrough:function(){c("strike")},CreateLink:function(n,m){c("a",{href:m,mce_href:m})},Unlink:function(){var m=h.selection;m.setContent(m.getContent().replace(/(<a[^>]+>|<\/a>)/,""))},RemoveFormat:function(){var m=h.selection;m.setContent(m.getContent().replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,""))},FormatBlock:function(o,m){var p=h.selection,q;q=e(h.selection.getNode());if(q){r=d(q,m.replace(/<|>/g,""))}p.select(r);p.collapse(1)},InsertUnorderedList:function(){i("ul")},InsertOrderedList:function(){i("ol")},Indent:function(){var o=e(h.selection.getNode()),m;if(o){m=parseInt(o.style.paddingLeft)||0;o.style.paddingLeft=(m+10)+"px"}},Outdent:function(){var o=e(h.selection.getNode()),m;if(o){m=parseInt(o.style.paddingLeft)||0;if(m>=10){o.style.paddingLeft=(m-10)+"px"}}}})}})(punymce);