(function(a){a.plugins.ForceBlocks=function(d){var v=a.Event,s,g=this;var n,k,u,q;var c,r,p;n=a.isIE;k=a.isGecko;u=a.isOpera;q=a.isWebKit;c=a.each;r=a.extend;this.settings=p=r({element:"P"},d.settings.forceblocks);d.onPreInit.add(m,g);if(!n){d.onSetContent.add(function(t,w){if(w.format=="html"){w.content=w.content.replace(/
[\s\u00a0]+<\/p>/g,"
<\/p>/g,"
\u00a0
")});function m(){s=d.dom;v.add(d.getDoc(),"keyup",j);d.onSetContent.add(j);d.onBeforeGetContent.add(j);if(!n){d.onPreProcess.add(function(t,w){c(w.node.getElementsByTagName("br"),function(y){var x=y.parentNode;if(x&&x.nodeName=="p"&&(x.childNodes.length==1||x.lastChild==y)){x.replaceChild(t.getDoc().createTextNode("\u00a0"),y)}})});v.add(d.getDoc(),"keypress",function(t){if(t.keyCode==13&&!t.shiftKey){if(!o(t)){return v.cancel(t)}}});if(k){v.add(d.getDoc(),"keydown",function(t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){h(t,t.keyCode==8)}})}}}function b(x){var y,t;y=x.document;t=y.compatMode=="CSS1Compat"?y.documentElement:y.body;return{x:x.pageXOffset||t.scrollLeft,y:x.pageYOffset||t.scrollTop,w:x.innerWidth||t.clientWidth,h:x.innerHeight||t.clientHeight}}function l(B,y,z){var x=d.getDoc().createTreeWalker(B,4,null,false),B,A=-1;while(B=x.nextNode()){A++;if(y==0&&B==z){return A}if(y==1&&A==z){return B}}return -1}function j(){var C=this,O=d.getBody(),L=d.getDoc(),R=d.selection,D=R.getSel(),E=R.getRng(),P=-2,A,J,w,x,M=-16777215;var N,y,Q,I,F,z=O.childNodes,H,G,B;for(H=z.length-1;H>=0;H--){N=z[H];if(N.nodeType==3||(!f(N)&&N.nodeType!=8)){if(!y){if(N.nodeType!=3||/[^\s]/g.test(N.nodeValue)){if(P==-2&&E){if(!n){if(E.startContainer.nodeType==1&&(G=E.startContainer.childNodes[E.startOffset])&&G.nodeType==1){B=G.getAttribute("id");G.setAttribute("id","__mce")}else{if(d.dom.getParent(E.startContainer,function(t){return t===O})){J=E.startOffset;w=E.endOffset;P=l(O,0,E.startContainer);A=l(O,0,E.endContainer)}}}else{x=L.body.createTextRange();x.moveToElementText(O);x.collapse(1);Q=x.move("character",M)*-1;x=E.duplicate();x.collapse(1);I=x.move("character",M)*-1;x=E.duplicate();x.collapse(0);F=(x.move("character",M)*-1)-I;P=I-Q;A=F}}y=d.dom.create(p.element);y.appendChild(N.cloneNode(1));N.parentNode.replaceChild(y,N)}}else{if(y.hasChildNodes()){y.insertBefore(N,y.firstChild)}else{y.appendChild(N)}}}else{y=null}}if(P!=-2){if(!n){y=O.getElementsByTagName(p.element)[0];E=L.createRange();if(P!=-1){E.setStart(l(O,1,P),J)}else{E.setStart(y,0)}if(A!=-1){E.setEnd(l(O,1,A),w)}else{E.setEnd(y,0)}if(D){D.removeAllRanges();D.addRange(E)}}else{try{E=D.createRange();E.moveToElementText(O);E.collapse(1);E.moveStart("character",P);E.moveEnd("character",A);E.select()}catch(K){}}}else{if(!n&&(G=d.dom.get("__mce"))){if(B){G.setAttribute("id",B)}else{G.removeAttribute("id")}E=L.createRange();E.setStartBefore(G);E.setEndBefore(G);R.setRng(E)}}}function f(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 e(t){return s.getParent(t,function(w){return f(w)})}function i(t){t=t.innerHTML;t=t.replace(/]+>/g,"");return t.replace(/[ \t\r\n]+/g,"")==""}function o(O){var P=d.getDoc(),G=d.selection.getSel(),H=d.selection.getRng(),Q=P.body;var K,L,I,N,M,z,w,A,C,t,E,R,x,B,J,D,F;if(a.isOldWebKit){return true}K=P.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(true);L=P.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(true);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;N=I?G.anchorNode:G.focusNode;M=I?G.anchorOffset:G.focusOffset;z=I?G.focusNode:G.anchorNode;w=I?G.focusOffset:G.anchorOffset;N=N.nodeName=="BODY"?N.firstChild:N;z=z.nodeName=="BODY"?z.firstChild:z;A=e(N);C=e(z);t=A?A.nodeName:p.element;if(s.getParent(A,function(y){return/OL|UL/.test(y.nodeName)})){return true}if(A&&(A.nodeName=="CAPTION"||/absolute|relative|static/gi.test(A.style.position))){t=p.element;A=null}if(C&&(C.nodeName=="CAPTION"||/absolute|relative|static/gi.test(C.style.position))){t=p.element;C=null}if(/(TD|TABLE|TH|CAPTION)/.test(t)||(A&&t=="DIV"&&/left|right/gi.test(A.style.cssFloat))){t=p.element;A=C=null}E=(A&&A.nodeName==t)?A.cloneNode(0):P.createElement(t);R=(C&&C.nodeName==t)?C.cloneNode(0):P.createElement(t);R.id="";if(/^(H[1-6])$/.test(t)&&N.nodeValue&&M==N.nodeValue.length){R=P.createElement(p.element)}J=x=N;do{if(J==Q||J.nodeType==9||f(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=B=z;do{if(J==Q||J.nodeType==9||f(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}B=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(x.nodeName==t){K.setStart(x,0)}else{K.setStartBefore(x)}K.setEnd(N,M);E.appendChild(K.cloneContents());L.setEndAfter(B);L.setStart(z,w);R.appendChild(L.cloneContents());H=P.createRange();if(!x.previousSibling&&x.parentNode.nodeName==t){H.setStartBefore(x.parentNode)}else{if(K.startContainer.nodeName==t&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!B.nextSibling&&B.parentNode.nodeName==t){H.setEndAfter(B.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(E.firstChild&&E.firstChild.nodeName==t){E.innerHTML=E.firstChild.innerHTML}if(R.firstChild&&R.firstChild.nodeName==t){R.innerHTML=R.firstChild.innerHTML}if(i(E)){E.innerHTML=u?"