/*
 * file: DEdit.js
 *
 * @BEGINLICENSE
 * Copyright 2010 Brook Novak  (email : brooknovak@seaweed-editor.com) 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * @ENDLICENSE
 */
(function(){var H,J;de={version:"0.0.1",m:[],collections:{},events:{},onready:(function(){var a0=[];function a1(){if(a0){for(var a2 in a0){a0[a2]()}a0=0}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);a1()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);a1()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(!a0){return}try{document.documentElement.doScroll("left")}catch(a2){setTimeout(arguments.callee,0);return}a1()})()}A(window,"load",function(){a1();ad(window,"load",arguments.callee)})}}return function(a2){if(a0){a0.push(a2)}else{a2()}}})(),init:function(){if(!de.m){return}H=document.body;var a3=de.m;var a6;do{a6=false;for(var a4=0;a4<a3.length;a4++){var a5=a3[a4];if(!a5.depends){continue}for(var a2=0;a2<a5.depends.length;a2++){for(var a1=a4+1;a1<a3.length;a1++){if(a5.depends[a2]==a3[a1].name){var a0=a3;a3=a0.slice(0,a4).concat(a0.slice(a4+1,a1+1).concat([a5].concat(a0.slice(a1+1))));a6=true;break}}if(a6){break}}if(a6){break}}}while(a6);for(a4 in a3){if(a3[a4].init){a3[a4].init()}}delete de.m}};function L(a1,a2){var a0=Array.prototype.slice.call(arguments);a0.splice(0,2);de.m.push({name:a1,init:a2,depends:a0})}function D(a3,a1,a0){if(a0!==false){a0=true}for(var a2 in a1){if(a0||typeof a3[a2]=="undefined"){a3[a2]=a1[a2]}}return a3}function aZ(a3){var a0=a3.split(",");var a2={};for(var a1 in a0){a2[a0[a1]]=true}return a2}function N(a0){return document.createElement(a0)}var aU=function(){var a0=function(){this.length=0;this.head=null;this.tail=null};a0.prototype={add:function(a3){var a2={data:a3,next:null,prev:null};if(this.length==0){this.head=a2;this.tail=a2}else{this.tail.next=a2;a2.prev=this.tail;this.tail=a2}this.length++},remove:function(a2){var a3=this.head;while(a3){if(a3.data==a2){a1(this,a3);return true}a3=a3.next}return false},removeAtIndex:function(a2){if(a2>-1&&a2<this.length){var a4;if(a2<(this.length/2)){a4=this.head;for(var a3=0;a3<a2;a3++){a4=a4.next}}else{a4=this.tail;for(var a3=this.length-1;a3>a2;a3--){a4=a4.prev}}a1(this,a4);return a4.data}return null},pop:function(){return this.removeAtIndex(this.length-1)},chop:function(a5){var a4=this.tail,a3=this.length;while(a4&&a4!=a5){a4=a4.prev;a3--}if(!a4){return false}if(a4.next){var a2=a4.next;while(a2){a2.prev.next=null;a2.prev=null;a2=a2.next}this.tail=a4;this.length=a3}return true},clear:function(){while(this.head){var a2=this.head;this.head=a2.next;a2.prev=a2.next=null}this.tail=null;this.length=0},iterate:function(a3){var a4=this.head;while(a4){var a2=a3(a4.data);if(a2===false){break}a4=a4.next}}};a0.prototype.push=a0.prototype.add;function a1(a2,a3){if(a2.length==1){a2.clear();return}if(a3==a2.head){a2.head=a3.next;a2.head.prev=null;a3.next=null}else{if(a3==a2.tail){a2.tail=a3.prev;a2.tail.next=null;a3.prev=null}else{a3.prev.next=a3.next;a3.next.prev=a3.prev;a3.next=a3.prev=null}}a2.length--}return a0}();de.collections.DoublyLinkedList=aU;function h(a1){var a3=[],a2;D(a1,{fireEvent:function(a8){if(a3.length>0){var a7,a5,a4,a6=Array.prototype.slice.call(arguments);a6.shift();a2=[];for(a7 in a3){a5=a3[a7];if(typeof a5.ref["on"+a8]=="function"){a5.ref["on"+a8].apply(a5.context,a6)}}a4=a2;a2=0;for(a7 in a4){this.removeObserver(a4[a7])}}},addObserver:function(a5,a6,a4){if(a0(a5)!=-1){return}a5={ref:a5,context:a6||a5};if(a4){a3.unshift(a5)}else{a3.push(a5)}},removeObserver:function(a4){if(a2){a2.push(a4)}else{var a5=a0(a4);if(a5>=0){a3.splice(a5,1)}}}});function a0(a4){for(var a5=0;a5<a3.length;a5++){if(a3[a5].ref==a4){return a5}}return -1}}de.model=h;L("Platform",function(){var a0=N("p");a0.style.margin="0 0 0 0";a0.style.padding="0 0 0 0";a0.style.textAlign="";var a1=N("span");a1.innerHTML="X";a0.appendChild(a1);H.appendChild(a0);_localeDirection=a1.offsetLeft<(a0.offsetWidth-(a1.offsetLeft+a1.offsetWidth))?"ltr":"rtl";H.removeChild(a0)});var W,E,G,p,K,d={UNKNOWN:-1,FIREFOX:1,OPERA:2,IE:3,CHROME:4,SAFARI:6,KONQUEROR:8,NETSCAPE:9,WINDOWS:1,MAC:2,LINUX:3,GECKO:1,TRIDENT:2,WEBKIT:3,KHTML:4,PRESTO:5};(function(){var a4=[{string:navigator.userAgent,subString:"Chrome",id:4,versionSearch:"Chrome"},{string:navigator.vendor,subString:"Apple",id:6,versionSearch:"Version"},{prop:window.opera,id:2,versionSearch:"Opera"},{string:navigator.vendor,subString:"KDE",id:8,versionSearch:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",id:1,versionSearch:"Firefox"},{string:navigator.userAgent,subString:"Netscape",id:9,versionSearch:"Netscape"},{string:navigator.userAgent,subString:"MSIE",id:3,versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Mozilla",id:9,versionSearch:"Mozilla"}];var a2=[{string:navigator.platform,subString:"Win",id:1},{string:navigator.platform,subString:"Mac",id:2},{string:navigator.platform,subString:"Linux",id:3},];var a1=[{string:navigator.userAgent,subString:"MSIE",id:2,versionSearch:"MSIE"},{string:navigator.userAgent,subString:"WebKit",id:3,versionSearch:"WebKit"},{string:navigator.userAgent,subString:"KHTML",id:4,versionSearch:"KHTML"},{string:navigator.userAgent,subString:"Gecko",id:1,versionSearch:"rv"},{prop:window.opera,id:5,versionSearch:"Presto"},];function a0(a8){for(var a5 in a8){var a6=a8[a5].string,a7=a8[a5].prop;if(a6){if(a6.indexOf(a8[a5].subString)!=-1){return a8[a5]}}else{if(a7){return a8[a5]}}}return null}function a3(a7,a5){if(!a5){return null}var a6=a7.indexOf(a5);if(a6==-1){return null}return parseFloat(a7.substring(a6+a5.length+1))}W=a0(a2);W=W?W.id||-1:-1;E=a0(a4);G=-1;if(E){G=a3(navigator.userAgent,E.versionSearch)||a3(navigator.appVersion,E.versionSearch);E=E.id}else{E=-1}p=a0(a1);K=-1;if(p){K=a3(navigator.userAgent,p.versionSearch);p=p.id}else{p=-1}})();D(de,{Platform:d,os:W,browser:E,browserVersion:G,engine:p,engineVersion:K,localDirection:null});var aI=function(){alert("hit!!!")};(function(){var a3={},a2=new aU(),a1=null,a0=0;aI=function(a4,a5){a3[a4]=a5};de.UndoMan={maxHistoryCount:100,ExecFlag:{GROUP:1,UPDATE_SELECTION:2,DONT_STORE:4},registerAction:aI,execute:function(a5,bb){var ba=Array.prototype.slice.call(arguments);if(typeof a5!="number"){a5=2;bb=ba[0];ba.shift()}else{ba.splice(0,2)}if(a0){a5=4}if((a5&1)&&!a1){aj("Cannot group action to nothing")}if(!a3[bb]){aj('Unknown action called "'+bb+'"')}var bd,a7=a3[bb],bc=new av(bb,a5,de.selection.getRange(false),de.selection.getRange(true));if(bc.selBefore){var a9=de.doc.getEditProperties(bc.selBefore.startNode);if(a9&&a9.afRE){var a8=a9.afRE.test(bb.toLowerCase()+(bb=="Format"?ba[0].toLowerCase():""));if(a8!=a9.afInclusive){return}}}this.fireEvent("BeforeExec",bc);a0++;try{bd=a7.exec.apply(bc,ba)}finally{a0--}if(!(a5&4)){var a6=aP();if(!a6||a6.length==0){this.fireEvent("AfterExec",bc);if(bc.selBefore){de.selection.setSelection(bc.selBefore.startNode,bc.selBefore.startIndex,bc.selBefore.endNode,bc.selBefore.endIndex,true)}return bd}if(!a1){a2.clear()}else{if(a1.next){a2.chop(a1)}}bc.opList=a6;a2.push(bc);a1=a2.tail;if(a2.length>this.maxHistoryCount&&this.maxHistoryCount>-1&&!(a7.flags&1)){a2.removeAtIndex(0)}}if(a5&2){var a4=bc.selAfter;if(!a4){de.selection.clear()}else{de.selection.setSelection(a4.startNode,a4.startIndex,a4.endNode,a4.endIndex,true)}}else{delete bc.selBefore;if(bc.selAfter){delete bc.selAfter}}delete bc.selBeforeOrdered;this.fireEvent("AfterExec",bc);return bd},undo:function(){do{if(!a1){return}var a4=a1.data;this.fireEvent("BeforeUndo",a4);try{u(a4.opList);a1=a1.prev}catch(a6){this.clear();throw a6}if(a4.flags&2){var a5=a4.selBefore;if(!a5){de.selection.clear()}else{de.selection.setSelection(a5.startNode,a5.startIndex,a5.endNode,a5.endIndex,true)}}this.fireEvent("AfterUndo",a4)}while(a1&&(a4.flags&1))},redo:function(){var a4=true;while(1){if(a2.length==0||a1==a2.tail){return}var a7=a1?a1.next:a2.head;var a5=a7.data;if(!a4&&!(a5.flags&1)){return}a1=a7;this.fireEvent("BeforeRedo",a5);try{aW(a5.opList)}catch(a6){this.clear();throw a6}if(a5.selAfter){var a8=a5.selAfter;if(!a8){de.selection.clear()}else{de.selection.setSelection(a8.startNode,a8.startIndex,a8.endNode,a8.endIndex,true)}}a4=false;this.fireEvent("AfterRedo",a5)}},clear:function(){a2.clear();a1=null},hasUndo:function(){return a1!=null},hasRedo:function(){return a2.length>0&&a1!=a2.tail}};h(de.UndoMan)})();var av=function(){var a0=function(a2,a1,a4,a3){this.name=a2;this.flags=a1;this.selBefore=a4;this.selBeforeOrdered=a3};a0.prototype={getEditSection:function(){if(this.opList){for(var a2 in this.opList){var a4=this.opList[a2];for(var a3 in a4){if(ap(a4[a3])&&aK(H,a4[a3])){var a1=de.doc.getEditSectionContainer(a4[a3]);if(a1){return a1}}}}}}};return a0}();var ai=document.elementFromPoint?function(a0,a2){switch(p){case 1:case 2:return document.elementFromPoint(a0,a2);default:var a1=aR();return document.elementFromPoint(a0+a1.left,a2+a1.top)}}:function(a0,a3){var a2=null;a1(H);return a2;function a1(a4){if(a4.childNodes.length>0){var a6=a4.firstChild;while(a6){if(a1(a6)){return true}a6=a6.nextSibling}}if(a4.nodeType==1&&(a4.offsetLeft||a4.offsetLeft==0)){var a5=f(a4);if(a3>=a5.y&&a3<=(a5.y+a4.offsetHeight)&&a0>=a5.x&&a0<=(a5.x+a4.offsetWidth)){a2=a4;return true}}return false}};function al(a0){var a3=0,a2=0,a1=0;do{if(a0.offsetLeft||a0.offsetTop){if(a0==H){if(!a1){a3+=Math.abs(a0.offsetLeft);a2+=Math.abs(a0.offsetTop)}}else{a3+=a0.offsetLeft;a2+=a0.offsetTop}}a1|=(a0.style&&a0.style.position=="fixed")}while(a0=a0.offsetParent);if(!a1){var a4=aR();a3-=a4.left;a2-=a4.top;if(p==2&&K<8){a3+=H.clientLeft;a2+=H.clientTop}}return{x:a3,y:a2}}var f=al;function aV(a2,a0){var a1=a0.nextSibling;if(!a1){a0.parentNode.appendChild(a2)}else{a0.parentNode.insertBefore(a2,a1)}return a2}function aX(a0,a3,a1){var a2=-1;var a4=a0.firstChild;while(++a2!=a1&&a4){a4=a4.nextSibling}if(a2==a1){if(a2==a0.childNodes.length){a0.appendChild(a3)}else{a0.insertBefore(a3,a4)}return a3}return null}function x(a1){var a0=0;ar(a1,true,function(a2){a0+=ah(a2)});return a0}function o(a1){var a2={};for(var a0 in a1){a2[a0]=a1[a0]}return a2}function I(a0,a7,a1,a2,a4){if(!a0){a0=aM(a7,[9,11])}var a3=aO(a7,a0,true,true);var a5=a3.length-1;(function a6(a9){var bb,a8,ba=false;if(a5>0){a5--;bb=a1?a3[a5].nextSibling:a3[a5].previousSibling;if(!a6(a3[a5])){return false}}else{if(a5==0){if(a1&&(!a2||a2.test(X(a9)))){a8=a4(a9);if(a8===false){return a8}ba=(a8===1)}if(!a1&&a9==a7){bb=null}else{bb=a1?a9.firstChild:a9.lastChild}}}if(!ba){while(bb){if(!a6(bb)){return false}bb=(a1)?bb.nextSibling:bb.previousSibling}}if(!a1&&(!a2||a2.test(X(a9)))){if(a4(a9)===false){return false}}return true})(a0)}function ar(a0,a3,a1,a2){I(a0,a3,a1,/^#text$/,a2)}function R(a0,a3,a1,a2){I(a0,a3,a1,null,a2)}function aK(a0,a1){a1=a1.parentNode;while(a1){if(a1==a0){return true}a1=a1.parentNode}return false}function aO(a5,a4,a0,a2){if(a5==a4){return(a0||a2)?[a5]:[]}var a1=a0?[a5]:[];var a3=a5.parentNode;while(a3&&a3!=a4){a1.push(a3);a3=a3.parentNode}if(a2&&a4&&a3==a4){a1.push(a4)}return a1}function j(a4,a1,a2,a0){var a3=null;while(a4){if(a2&&a2(a4)){if(a0){return a4}a3=a4}if(a4.parentNode==a1){break}a4=a4.parentNode}return a2?a3:a4}function w(a2,a1,a0){var a6=aO(a2,null,a0,1),a5=aO(a1,null,a0,1),a7=null;for(var a4 in a6){for(var a3 in a5){if(a6[a4]==a5[a3]){return a6[a4]}}}return null}function ag(a2,a0){var a1=null;I(null,a2,a0,null,function(a3){if(a3==a2){return true}a1=a3;return false});return a1}function aM(a2,a1){while(a2.parentNode){if(a1){for(var a0 in a1){if(a2.parentNode.nodeType==a1[a0]){return a2}}}a2=a2.parentNode}return a2}function l(a1){var a0=-1;while(a1){a0++;a1=a1.previousSibling}return a0}function aT(a4,a0){var a3="";var a6=0;var a5,a2;for(a2=0;a2<a4.length;a2++){a5=a4.charAt(a2);var a1=null;switch(a5){case'"':a1="&quot;";break;case"'":a1="&#39;";break;case"&":a1="&amp;";break;case"<":a1="&lt;";break;case">":a1="&gt;";break;default:if(a0&&a5=="\n"){a1="<br>"}else{if(M(a5)&&(a2==0||a2==(a4.length-1)||a4.charAt(a2-1)==" "||a4.charAt(a2+1)==" ")){a1="&nbsp;"}}}if(a1){if((a2-a6)>0){a3+=(a4.substring(a6,a2))}a3+=a1;a6=a2+1}}if((a2-a6)>0){a3+=(a4.substring(a6,a2))}return a3}function a(a1){var a0=N("span");a0.innerHTML=a1;return a0.firstChild.nodeValue}function ab(a0){while(a0){if(a0.nodeType==1){if(a0.style.display=="none"){return false}}a0=a0.parentNode}return true}function aD(a1,a0){while(a1&&a1.nodeType!=1){a1=a1.parentNode}if(!a1){return}if(window.getComputedStyle){return document.defaultView.getComputedStyle(a1,"").getPropertyValue(a0)}else{if(a1.currentStyle){return a1.currentStyle[t(a0)]}}}function ao(a1,a0){if(p==2){a1.style.setAttribute("cssText",a0)}else{a1.setAttribute("style",a0)}}function aJ(a1,a0,a2){if(p==2){a1.style.setAttribute(a0,a2)}else{a1.style[a0]=a2}}function aw(a0){return(p==2?a0.style.getAttribute("cssText"):a0.getAttribute("style"))||""}function r(a3){var a1=aw(a3);if(a1){a1=a1.split(";");for(var a2 in a1){var a0=a1[a2].indexOf(":");if(a0>0&&a0<(a1[a2].length-1)&&/\s*\S+\s*/.test(a1[a2].substr(a0))){return 1}}}}function e(a0){do{var a1=/([A-Z])/.exec(a0);if(a1){a0=a0.substr(0,a1.index)+"-"+a1[1].toLowerCase()+a0.substr(a1.index+1)}}while(a1);return a0}var k=function(){var a0=/^\s*rgb\s*\(\s*(\d+)\%?\s*\,\s*(\d+)\%?\s*\,\s*(\d+)\%?\s*\)\s*$/i,a1={maroon:[128,0,0],red:[255,0,0],orange:[255,165,0],yellow:[255,255,0],olive:[128,128,0],purple:[128,0,128],fuchsia:[255,0,255],white:[255,255,255],lime:[0,255,0],green:[0,128,0],navy:[0,0,128],blue:[0,0,255],aqua:[0,255,255],teal:[0,128,128],black:[0,0,0],silver:[12,12,12],gray:[128,128,128]};return function(a6){if(a6.charAt(0)=="#"){if(a6.length<7){a6+="000000"}return[parseInt(a6.substr(1,2),16),parseInt(a6.substr(3,2),16),parseInt(a6.substr(5,2),16)]}var a3=a0.exec(a6);if(a3){var a5=parseInt(a3[1]),a4=parseInt(a3[2]),a2=parseInt(a3[3]);if(a6.indexOf("%")>-1){if(a5>100){a5=100}a5=(255*a5)/100;if(a4>100){a4=100}a4=(255*a4)/100;if(a2>100){a2=100}a2=(255*a2)/100}else{if(a5>255){a5=255}if(a4>255){a4=255}if(a2>255){a2=255}}return[a5,a4,a2]}return a1[a6.toLowerCase()]||[255,255,255]}}();var ay=function(){var a1={bold:"700",normal:"400"};function a0(a2){return a1[a2.toLowerCase()]||a2}return function(a4,a3,a2){switch(a4){case"backgroundColor":case"borderColor":case"outlineColor":case"color":a3=k(a3);a2=k(a2);return a3[0]==a2[0]&&a3[1]==a2[1]&&a3[2]==a2[2];case"fontWeight":a3=a0(a3);a2=a0(a2);break}return a3==a2}}();function t(a0){do{var a1=a0.indexOf("-");if(a1>-1){a0=(a1==(a0.length-1))?a0.substr(0,a1):a0.substr(0,a1)+a0.charAt(a1+1).toUpperCase()+a0.substr(a1+2)}}while(a1>-1);return a0}function aG(a1){if(a1.outerHTML){return a1.outerHTML}else{var a0=N("span");a0.appendChild(a1.cloneNode(true));return a0.innerHTML}}function Z(){return !(E==3&&G<8)}function T(a2,a3){if(a2.nodeType==1||a2==H){var a1=au(a2);if(a1){var a4=a1.split(" ");for(var a0 in a4){if(a3.test(a4[a0])){return a4[a0]}}}}return null}function au(a0){return a0.className}function am(a1,a0){return E==3?a1.setAttribute("className",a0):a1.className=a0}function U(a2,a0){for(var a1 in a0){if(a0[a1]==a2){return parseInt(a1)}}return -1}function X(a0){return a0.nodeName.toLowerCase()}function ah(a1,a0){if(typeof a0=="undefined"){a0=null}return a1.nodeType==3?a1.nodeValue.length:a0}function ap(a0){return typeof Node=="object"?a0 instanceof Node:(typeof a0=="object"&&typeof a0.nodeType=="number"&&typeof a0.nodeName=="string")}D(de,{visitAllNodes:R,getCommonAncestor:w,getInnerText:function(a0){if(a0.nodeType==3){return a0.nodeValue}return a0.innerText||a0.textContent||""},parseHTMLString:a,insertAfter:aV,insertAt:aX,findClassName:T,getPositionInWindow:f,getOuterHTML:aG,getComputedStyle:aD});(function(){var a0=[];L("Changes",function(){de.Changes.clear();de.doc.addObserver({onSectionAdded:function(a1){a0.push({esNode:a1,initHTML:a1.innerHTML})}})},"Doc");de.Changes={getChangedEditableSections:function(){var a3=[],a8=/(<\s*\w+\s[^>]*?)(?:style|class|id|value)\s*=\s*(?:""|'')([^<]*?>)/i,a5=/(<\s*\w+\s[^>]*?)\s*(?:style|class|id|value)\s*(>|(?:[^=][^<]*?>))/i,a1=/<[^\/][^<>]*?\s[^<>]*>/,a4=/(?:[\t\n\r ]|&nbsp;)/g;ak(false);for(var a6 in a0){var a7=a0[a6];if(a2(a7.esNode.innerHTML)!=a2(a7.initHTML)||a7.dirty){a3.push(a7.esNode)}}ak(true);return a3;function a2(bd){bd=bd.replace(a4," ");var ba,bb,bc,a9="";for(bb=0;bb<(p==5?2:1);bb++){bc=bb==0?a8:a5;while(ba=bc.exec(bd)){bd=bd.substr(0,ba.index)+ba[1]+ba[2]+bd.substr(ba.index+ba[0].length)}}if(ba){while(ba=a1.exec(bd)){a9+=bd.substr(0,ba.index)+ba[0].replace(a4,"");bd=bd.substr(ba.index+ba[0].length)}a9+=bd}else{a9=bd}return de.spell.stripSpellWrapperHTML(a9)}},clear:function(a4){ak(false);if(a4){for(var a2 in a0){if(a0[a2].esNode==a4){a0[a2].initHTML=a4.innerHTML;a0[a2].dirty=0;break}}}else{a0=[];var a1=de.doc.getAllEditSections();for(var a2 in a1){var a3=a1[a2];a0.push({esNode:a3,initHTML:a3.innerHTML})}}ak(true)},dirty:function(a2){for(var a1 in a0){if(!a2||a0[a1].esNode==a2){a0[a1].dirty=1}}},reset:function(){de.UndoMan.clear();for(var a1 in a0){a0[a1].esNode.innerHTML=a0[a1].initHTML}this.clear()}}})();(function(){L("Clipboard",function(){switch(p){case 2:A(document,"keydown",bg);break;case 1:A(document,"keypress",bd);break;case 5:A(document,"keydown",a3);break;case 3:A(document,"copy",a4);A(document,"paste",a9);A(document,"keydown",bn);break}br=N("textarea");ao(br,"width:1px;height:1px;border-style:none");a6=N("div");am(a6,ax);ao(a6,"position:absolute;width:1px;height:1px;display:none;z-index:-500");a6.appendChild(br);H.appendChild(a6)},"events.Events");var bi,a2,a1,br,a6,bh=null,bb;function bl(bs){var bt="",bu;if(bs.nodeType==3&&aH(bs)){bt=bs.nodeValue.replace(/[\t\n\r]/g," ")}else{if(bs.nodeType==1){switch(X(bs)){case"br":bt+="\n";break;case"li":bt+="\n * ";break;default:if(aL(bs)){bt+="\n"}}bu=bs.firstChild;while(bu){bt+=bl(bu);bu=bu.nextSibling}if(aL(bs)){bt+="\n"}}}return bt}function a8(){var bs=de.selection.getHighlightedDOM();if(!bs){return null}a2=bs;bi=bl(a2);if(aL(a2)){bi=bi.replace(/^\n/,"").replace(/\n$/,"")}a1=false;return bi}function bk(){var bs=a8();if(bs){de.selection.remove()}return bs}function bc(bu){if(!de.cursor.exists()){return}de.selection.remove();var bv=de.cursor.getCurrentCursorDesc();var bs,by;if(bi){if(!a1){by=a2}else{if(bi.replace(/\s/g,"")==bu.replace(/\s/g,"")){by=a2}else{if(bu){bs=bu}else{by=a2}}}}else{bs=bu}if(by||bs){var bt=bv.relIndex;if(bv.isRightOf){bt++}if(X(bv.domNode)=="br"){bt=1}var bz=de.doc.getEditSectionContainer(bv.domNode);if(bz){var bx=de.doc.getEditProperties(bz);if(!bx.singleLine&&by){var bw=N("div");R(by,by,true,function(bA){if(bA.nodeType==3){bw.appendChild(bA.cloneNode(false))}else{if(ae(bA)&&n(bA,bv.domNode.parentNode)){var bB=1;R(bA,bA,true,function(bC){if(!aK(bA,bC)){return false}if(aL(bC)){bB=0;return false}});if(bB&&!(bx.singleLine&&X(bA)=="br")){bw.appendChild(bA.cloneNode(true));return 1}}}});if(bw.firstChild){de.UndoMan.execute("InsertHTML",bw.innerHTML,bv.domNode.parentNode,bv.domNode,bt)}}else{if(bs){if(!bx.singleLine&&/\n/.test(bs)){de.UndoMan.execute("InsertHTML",aT(bs,true),bv.domNode.parentNode,bv.domNode,bt)}else{de.UndoMan.execute("InsertText",bv.domNode,bs,bt)}}}}}}function bf(bt){var bs=window.clipboardData.setData("Text",bt);return bs===J||bs}function bm(){var bs=window.clipboardData.getData("Text");if(bs===""){if(!window.clipboardData.setData("Text",bs)){bs=null}}return bs}function bg(bt){bt=bt||window.event;if(!de.events.Keyboard.isAcceleratorDown(bt)){return}switch(bt.keyCode){case 67:case 88:var bs=bt.keyCode==67?a8():bk();if(bs){if(bf(bs)){a1=true}else{bq(bs)}}break;case 86:var bu=bm();if(bu){bc(bu)}else{be()}break}}function a5(){try{if(netscape.security.PrivilegeManager.enablePrivilege){netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}else{return false}}catch(bs){return false}return true}function bp(bx){try{if(!a5()){return false}var bw=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);bw.data=bx;var bs=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!bs){return false}bs.addDataFlavor("text/unicode");bs.setTransferData("text/unicode",bw,copytext.length*2);var bu=Components.interfaces.nsIClipboard;var bt=Components.classes["@mozilla.org/widget/clipboard;1"].getService(bu);if(!bt){return false}bt.setData(bs,null,bu.kGlobalClipboard)}catch(bv){return false}}function a7(){try{if(!a5()){return null}var bu=Components.classes["@mozilla.org/widget/clipboard;1"].getService(Components.interfaces.nsIClipboard);if(!bu){return null}var bs=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!bs){return null}bs.addDataFlavor("text/unicode");bu.getData(bs,bu.kGlobalClipboard);var bx={},bt={},bw="";bs.getTransferData("text/unicode",bx,bt);if(bx){bx=bx.value.QueryInterface(Components.interfaces.nsISupportsString)}if(bx){bw=bx.data.substring(0,bt.value/2)}return bw}catch(bv){return null}}function bd(bt){if(!de.events.Keyboard.isAcceleratorDown(bt)){return}switch(bt.which){case 99:case 67:case 120:case 88:var bs=(bt.which==67||bt.which==99)?a8():bk();if(bs){if(bp(bs)){a1=true}else{bq(bs)}}break;case 118:case 86:var bu=a7();if(bu){bc(bu)}else{be()}break}}function a3(bt){if(!de.events.Keyboard.isAcceleratorDown(bt)){return}switch(bt.keyCode){case 67:var bs=a8();if(bs){bq(bs)}break;case 88:var bs=bk();if(bs){bq(bs)}break;case 86:be();break}}function a4(bt){if(bh===null){var bs=a8();if(bs){bq(bs)}}}function a9(bs){if(de.cursor.exists()&&bh===null){bc(bs.clipboardData.getData("Text"));bs.preventDefault()}}function bn(bt){if(de.events.Keyboard.isAcceleratorDown(bt)){switch(bt.keyCode){case 88:var bs=bk();if(bs){bq(bs)}break;case 67:if(E==6&&W==2&&de.cursor.exists()){var bs=a8();if(bs){bq(bs)}}break;case 86:if(E==6&&W==2&&de.cursor.exists()){be()}break}}}function bq(bs){ba(bs)}function be(){ba()}function ba(bt){bb=de.cursor.getCurrentCursorDesc();if(bh){clearTimeout(bh)}br.value=bt?bt:"";var bv=aR();a6.style.left=(bv.left==0?-50:bv.left+10)+"px";a6.style.top=(bv.top==0?-50:bv.top+10)+"px";a6.style.display="";try{br.focus();br.select()}catch(bu){}var bs=bt?a0:bj;bh=setTimeout(bs,0)}function bo(){a6.style.display="none"}function a0(){bh=null;bo();a1=true;window.focus()}function bj(){bh=null;bo();if(bb){var bs=de.cursor.getCurrentCursorDesc();if(!bs||bs.domNode!=bb.domNode||bs.relIndex!=bb.relIndex){de.cursor.setCursor(bb)}}bc(br.value);window.focus()}})();function aQ(bg,a8,a1){var bh=a1||N("p");var a7=j(w(bg,a8,true),H,aL,true)||H;while(bg.firstChild){bg=bg.firstChild}while(a8.lastChild){a8=a8.lastChild}if(a7!=H&&!n(bh,a7)){if(X(a7)=="ul"||X(a7)=="ol"){bg=j(bg,a7);a8=j(a8,a7);var a6=[];while(bg){if(X(bg)=="li"){a6.push(bg)}bg=bg==a8?null:bg.nextSibling}return a6}return[a7]}var ba,bd=[],a4=[],a0,a9;R(a7,bg,false,bc);if(bd.length>0){for(var be in bd){if(bd[be].parentNode){bd[be].parentNode.removeChild(bd[be]);a4.push(bd[be])}}}a0=ba;if(!a0){a0=a7.firstChild;while(a0.firstChild){a0=a0.firstChild}}ba=null;bd=[];R(a7,a8,true,bc);if(bd.length>0){for(var be in bd){if(bd[be].parentNode){bd[be].parentNode.removeChild(bd[be]);a4.push(bd[be])}}}a9=ba;if(!a9){a9=a7.lastChild;while(a9.lastChild){a9=a9.lastChild}}for(var be in a4){H.appendChild(a4[be])}if(!a9||!a0){return[]}a3(a0,a9,a7);bf(a0,a9,a7,bh);var a2=j(bg,a7);a8=j(a8,a7);var a5=[];do{var bb=a2;while(bb){if(aL(bb)){a5.push(bb);break}bb=bb.firstChild}a2=a2==a8?null:a2.nextSibling}while(a2);return a5;function bc(bj){if(bj==a7){return}var bk=bj,bi=null;while(bk!=a7){if(aL(bk)){bi=bk}if(bk.parentNode==a7&&de.doc.getProtectedNodeContainer(bk)==bk){bd.push(bk);bi=null}bk=bk.parentNode}if(bi){ba=bi;return false}}function a3(bl,bi,bj){var bk=bl,bm=false;while(bk&&!bm){R(bj,bk,true,function(bp){bk=null;bm|=bp==bi;if(bp==bj){return}if(aL(bp)){var bo=bp;while(bo.parentNode!=bj){if(bo.previousSibling){var br=bo.parentNode.cloneNode(false);while(bo.previousSibling){var bq=bo.previousSibling;Q(2,bq);Q(1,bq,br,0)}Q(1,br,bo.parentNode.parentNode,l(bo.parentNode))}if(bo.nextSibling){var br=bo.parentNode.cloneNode(false);while(bo.nextSibling){var bn=bo.nextSibling;Q(2,bn);Q(1,bn,br)}Q(1,br,bo.parentNode.parentNode,l(bo.parentNode)+1)}bo=bo.parentNode}bk=bo.nextSibling;R(bp,bp,true,function(bs){if(bs==bi){bm=true}return !bm});return false}return !bm})}}function bf(bl,bp,bj,bi){bl=j(bl,bj);bp=j(bp,bj);var bq=bl,bm=null;while(bq){var bo=bq,bn=false;while(bo){if(aL(bo)){bn=true;break}bo=bo.firstChild}if(bn){if(bm){bk(bm,bq);bm=null}}else{if(!bm){if(!(bq.nodeType==3&&!aH(bq))){bm=bq}}}bq=bq==bp?null:bq.nextSibling}if(bm){bk(bm,null)}function bk(bv,bs){var bt=bi.cloneNode(false),br=bv;Q(1,bt,bj,l(bv));while(br!=bs){var bu=br.nextSibling;Q(2,br);Q(1,br,bt);br=bu}}}}(function(){var bs,be,a4=460,bm,a3,bq,bn,a8,bp,bh,bk=aZ("img,table,input,select,button,textarea,object"),bg=aZ("img,table,input,select,button,textarea,object,br");L("Cursor",function(){bq=N("span");bn=document.createTextNode("");bq.appendChild(bn);a8=document.createTextNode("");be=N("div");am(be,ax+" sw-cursor");H.appendChild(be);var bv="",bu=aD(be,"z-index");if(!bu||bu=="0"||bu=="auto"){}bv+="z-index:100";ao(be,"position:absolute; width:2px;visibility:hidden;"+bv);A(window,"resize",ba);A(document,"keystroke",bo);h(de.cursor);de.UndoMan.addObserver({onAfterExec:a5,onAfterUndo:a5,onAfterRedo:a5})},"UndoMan");de.cursor={PlacementFlag:{INSIDE:1,BEFORE:2,AFTER:4},doesNodeSupportCursor:function(bu){return !de.doc.isProtectedNode(bu)&&de.doc.isNodeEditable(bu)},setCursor:function(bv){if(bv&&!this.doesNodeSupportCursor(bv.domNode)){bv=null}bs=bv;a2(false);if(bs){be.style.left=(bs.docLeft+(bs.isRightOf?bs.width:0))+"px";be.style.top=bs.docTop+"px";be.style.height=bs.height+"px";var bu=aD(bs.domNode,"color");be.style.backgroundColor=bu?bu:"black";a2(true)}a3=null;this.fireEvent("CursorChanged",this.getCurrentCursorDesc());return bs!=null},getCursorDescAtXY:a9,getCurrentCursorDesc:function(){return bs?o(bs):null},refreshCursor:function(){if(!bs){return}if(bp){return}bc(bs);be.style.left=(bs.docLeft+(bs.isRightOf?bs.width:0))+"px";be.style.top=bs.docTop+"px";be.style.height=bs.height+"px"},scrollToCursor:a5,exists:function(){return bs!=null},isCursorEle:function(bu){return bu==be},getNonCursorNodeAtXY:function(bu,bx){var bv=be.style.display;be.style.display="none";var bw=ai(bu,bx);be.style.display=bv;return bw},getNextCursorMovement:br,isOnSameLine:a6,createCursorDesc:function(bw,bu,by){var bv=bf(bw);if(bv==0||(bv!=1&&((by&&!(bv&4))||(!by&&!(bv&2))))){return null}var bx={domNode:bw,relIndex:bu,isRightOf:by,placement:bv};bc(bx);if(bv==1&&(bx.width==0||bx.height==0)){return null}return bx},getPlacementFlags:bf,getNearestCursorDesc:function(bv,bu,bA,bx){if(X(bv)=="br"){bA=true}var bw=de.cursor.createCursorDesc(bv,bu,bA);if(bw&&X(bv)=="br"){var by=br(bw,true),bz=br(bw,false);if((!by||!a6(by,bw))&&(!bz||!a6(bz,bw))){return bw}return(bx?by:bz)||bw}return bw||br({domNode:bv,isRightOf:bA,relIndex:bu,y:f(bv).y},bx)}};function bo(bA,bC){if(!bs||bA.ctrlKey||bA.metaKey||bA.altKey){return}var bE=0;switch(bC){case"Left":case"Right":bE=1;var bD=br(bs,bC=="Left");if(!bD){bD=bs}var bz=bs;if(!de.cursor.setCursor(bD)&&bz){de.cursor.setCursor(bz)}break;case"Up":case"Down":bE=1;var bB=bC=="Up";var bx=aR();var bu=a3?a3:(bs.docLeft-bx.left)+(bs.isRightOf?bs.width:0);var bv=by();var bw;if(bv){bw=bi(bu,bs.docTop-bx.top,bv,bs,bB);a7()}if(!bw){bw=bs}var bz=bs;if(!de.cursor.setCursor(bw)&&bz){de.cursor.setCursor(bz)}a3=bu;break}if(bE){a5();return false}return true;function by(){var bH=[];var bL=[];var bJ;R(H,bs.domNode,!bB,function(bP){bK(bP);var bO=bf(bP);if(bO==0){return true}var bQ,bN;if(bP.nodeType==3){bQ=f(bP.parentNode);bN=bP.parentNode.offsetHeight}else{if(X(bP)=="br"){bQ=bd(bP);bN=bQ.height}else{bQ=f(bP);bN=bP.offsetHeight}}if(!a6(bJ?bJ:bs,{y:bQ.y,height:bN})){if(bJ){return false}bJ={y:bQ.y,height:bN}}if(bO==1){bH.push({domNode:bP,placement:1})}else{if(bO&2){if(bB){bL.push(bP)}else{bH.push({domNode:bP,placement:2})}}if(bO&4){if(bB){bH.push({domNode:bP,placement:4})}else{bL.push(bP)}}}});if(!bJ){return null}bK(null);if(bB){bH.reverse()}var bM=0;for(var bG in bH){var bI=bH[bG];var bF=ah(bI.domNode,1);bI.startIndex=bM;bI.endIndex=bI.startIndex+(bF-1);bI.length=bF;bM+=bF}return{nodes:bH,totalLength:bM};function bK(bN){while(bL.length>0){if(!bN||!aK(bL[bL.length-1],bN)){bH.push({domNode:bL.pop(),placement:bB?2:4})}else{break}}}}}function ba(bu){de.cursor.refreshCursor()}function bj(bu){be.style.visibility=bu?"visible":"hidden"}function bl(){return be.style.visibility=="visible"}function a2(bu){if(typeof bu!="undefined"){a2.on=bu}if(a2.on){bj(!bl());bm=setTimeout(a2,a4,1)}else{if(bm){clearTimeout(bm);bm=null;bj(false)}}}function a5(){if(!bs){return}var bv=_getViewPortSize(),bx=0,bu=0;if((bs.y+bs.height)>=bv.height){bu=(bs.y+bs.height)-bv.height}else{if(bs.y<0){bu=bs.y}}var bw=bs.x+(bs.isRightOf?bs.width:0)+parseInt(be.style.width);if(bw>=bv.width){bx=bw-bv.width}else{if(bs.x<0){bx=bs.x}}if(bx||bu){window.scrollBy(bx,bu)}}function bf(bx){var bw=de.doc.getPackageContainer(bx);if(bw){var bv=0;if(bw==bx){bv=2|4}return bv}if(de.doc.isESPlaceHolder(bx,false)){return(de.doc.isESPlaceHolder(bx,true))?2:0}if(de.doc.isMNPlaceHolder(bx,false)){return(de.doc.isMNPlaceHolder(bx,true))?2:0}if(bx.nodeType==3){if(aH(bx)){return 1}return 0}var bu=0;if(de.cursor.usrGetPlacementFlags){bu=de.cursor.usrGetPlacementFlags(bx);if(bu===J){bu=0}else{return bu}}if(bk[X(bx)]){bu=2}if(bg[X(bx)]){bu|=4}return bu}function bb(bw,bv,bu){if(a6(bw,bv)){return bw.adx<bv.adx}else{if(bw.ady==bv.ady){return Math.abs((bw.y+(bw.height/2))-bu)<Math.abs((bv.y+(bv.height/2))-bu)}}return bw.ady<bv.ady}function a1(by,bw,bu,bz){if(a6(by,bw)){return Math.abs(by.x-bu)<Math.abs(bw.x-bu)}var bx=Math.min(Math.abs(by.y-bz),Math.abs((by.y+by.height)-bz));var bv=Math.min(Math.abs(bw.y-bz),Math.abs((bw.y+bw.height)-bz));if(bx==bv){return Math.abs((by.y+(by.height/2))-bz)<Math.abs((bw.y+(bw.height/2))-bz)}return bx<bv}function a6(bv,bu){return(bv.y>=bu.y&&bv.y<(bu.y+bu.height))||(bu.y>=bv.y&&bu.y<(bv.y+bv.height))}function a7(){if(bp){bp.parentNode.removeChild(bq);bp.parentNode.removeChild(a8);bp.nodeValue=bh;bp=null}}function bt(bu){if(bp==bu){return}if(bp){a7()}bp=bu;bh=bu.nodeValue;bu.parentNode.insertBefore(bq,bu);bu.parentNode.insertBefore(a8,bq)}function a0(bu){a8.nodeValue=bh.substr(0,bu);bn.nodeValue=bh.charAt(bu);bp.nodeValue=bh.substr(bu+1);return bq.offsetHeight!=0&&bq.offsetWidth!=0}function bd(bv){a7();bp={};bn.nodeValue=B;aV(bq,bv);var bu=f(bq);bu.height=bq.offsetHeight;bq.parentNode.removeChild(bq);bp=null;return bu}function bc(bw){if(!bw){return}if(X(bw.domNode)=="br"){var bv=bd(bw.domNode);bw.x=bv.x;bw.y=bv.y;bw.height=bv.height;bw.width=0}else{var bx;if(bw.placement==1){bt(bw.domNode);a0(bw.relIndex);bx=bq}else{bx=bw.domNode}var by=f(bx);bw.x=by.x;bw.y=by.y;bw.width=bx.offsetWidth;bw.height=bx.offsetHeight}var bu=aR();bw.docLeft=bu.left+bw.x;bw.docTop=bu.top+bw.y;a7()}function br(bD,bx){var bu=bD.domNode,bG=bD.relIndex,bI=bD.isRightOf,bz,bB,bw,bv=bf(bD.domNode),bA,bC,bF=false,bH;if(bv==1){if(bD.isRightOf==bx){var by=de.cursor.createCursorDesc(bD.domNode,bD.relIndex,!bD.isRightOf);if(by){return by}}}else{if(bD.isRightOf&&bv!=1){if(bx){while(bu.lastChild){bu=bu.lastChild}if(bu!=bD.domNode){bG=ah(bu,2)-1;bI=true}}}}R(H,bu,!bx,function(bN){var bL=bN==bu;if(!ab(bN)||de.doc.isProtectedNode(bN)){bA=bN;return true}if(!bF&&!bL){bF=aL(bN)}bv=bf(bN);if(bA){var bS=w(bN,bA,true);var bP=aO(bx?bN:bA,bS,false);if(bx){bP.reverse();if((bv&4)&&!aK(bN,bA)&&X(bN)!="br"){bP.push(bN)}}else{if(!aK(bA,bN)&&X(bA)!="br"&&!de.doc.isProtectedNode(bA)&&!(bA==bu&&bI)){bP.push(bA)}}for(var bO in bP){var bK=bP[bO];if(bf(bK)&4){if(bE(bK)){return false}bz=bK;bB=1;bw=true;return false}bF|=aL(bK)}}if(bv==0){if(!de.doc.isNodePackaged(bN)){var bM=0;if(aA(bN)){bM=1}else{if(aF(bN)){bM=2}}if(bM){de.UndoMan.execute(de.UndoMan.hasUndo()?1:0,"InsertHTML",aG(bM==1?de.doc.createESPlaceholder(bN):de.doc.createMNPlaceholder()),bN,bN.firstChild,0);if(!bE(bN.firstChild)){bz=bN.firstChild;bB=0;bw=false}return false}}}else{if(bv==1){bt(bN);var bR=bL?bG:(bx?ah(bN)-1:0),bQ;if(bL){bQ=bI}else{if(bH){if(bF){bH=null;bQ=bx}else{bQ=bH.isRightOf}}else{bQ=bx}}for(;(bx&&bR>=0)||(!bx&&bR<bh.length);bR+=bx?-1:1){if(!a0(bR)){if(bL){bQ=!bQ}bL=false;continue}var bJ=f(bq);bJ.height=bq.offsetHeight;if(bE(bq,bJ)){return false}if(bH){if(!a6(bJ,bH)){bz=bN;bB=bR;bw=!bQ;return false}}if(!bL||bu!=bD.domNode){bz=bN;bB=bR;bw=bQ;return false}bt(bN);bL=false;bH={domNode:bN,isRightOf:bQ,y:bJ.y,height:bJ.height};if(de.doc.isMNPlaceHolder(bN)||de.doc.isESPlaceHolder(bN)){prevDesc.isRightOf=false;break}}a7()}else{if(bv&2){if(!bL||(bx&&bN==bu&&bI)){if(!bE(bN)){bz=bN;bw=false;bB=0}return false}}else{if(X(bN)=="br"){if(!bL){if(bE(bN)){return false}if(bx){bC=bN;if(bE(bA,bH&&bH.domNode==bA?bH:null)){return false}}else{bC=bN}}}}}}bA=bN;if(!bx&&bL&&bD.isRightOf&&bv!=1){return 1}});a7();return bz?de.cursor.createCursorDesc(bz,bB,bw):null;function bE(bL,bJ){if(bC){var bK=bd(bC),bJ=bJ||(X(bL)=="br"?bd(bL):{y:f(bL).y,height:bL.offsetHeight});if(!a6(bK,bJ)){bz=bC;bB=1;bw=true;return true}bC=null}return false}}function a9(bw,bu,by){if(!by){by=ai(bw,bu)}if(by==be){be.style.display="none";by=ai(bw,bu);be.style.display=""}if(!by){return null}var bx=bz();var bv=bi(bw,bu,bx);a7();return bv;function bz(){var bB=[],bD=0,bA=aN();(function bC(bI){var bF=bf(bI),bH,bE;if(bI.nodeType==1){bH=bI}else{if(bI.nodeType==3&&bF!=0){bt(bI);a8.nodeValue="";bn.nodeValue=bh;bp.nodeValue="";bH=bq}}if(bH){bE=X(bH)=="br"?bd(bH):f(bH);if((bE.y+bH.offsetHeight)<=0){a7();return true}if(bE.y>bA.height){a7();return false}a7()}if(bF==1){bB.push({domNode:bI,startIndex:bD,endIndex:bD+ah(bI)-1,length:ah(bI),placement:1});bD+=ah(bI)}else{if(bF&2){bB.push({domNode:bI,startIndex:bD,endIndex:bD+1,length:1,placement:2,posInWnd:bE});bD++}}var bJ=bI.firstChild;var bG=true;while(bJ){if(!bC(bJ)){bG=false;break}bJ=bJ.nextSibling}if(bF&4){bB.push({domNode:bI,startIndex:bD,endIndex:bD+1,length:1,placement:4,posInWnd:bE});bD++}return bG})(by);return{nodes:bB,totalLength:bD}}}function bi(bJ,bH,bC,bz,bE){var bw={};if(bC.totalLength==0){return null}var bx=bD(0,0,2);if(!bx){return null}var bO=bD(bC.nodes.length-1,bC.nodes[bC.nodes.length-1].length-1,1);if(bx.domNode==bO.domNode&&bx.absIndex==bO.absIndex){return bF(bx)}var bK=[bx,bO];var by=null;by=bb(bx,bO,bH)?bx:bO;var bP,bQ;for(var bv=1;bv<=2;bv++){if(bv==1){if(bz){bA(bx,bu(bx.absIndex),bO,bu(bO.absIndex));bL();bH=by.y+(by.height/2);by.ady=Math.abs(by.y-bH);continue}else{if(!bG()){continue}}}else{var bR=bB();if(typeof bR=="boolean"){if(!bR){break}}else{break}}while(true){if(bQ.absIndex==(bP.absIndex-1)){break}var bM=bQ.absIndex+Math.floor((bP.absIndex-bQ.absIndex)/2);if(bM==bQ.absIndex){bM++}else{if(bM==bP.absIndex){bM--}}var bI=bu(bM);var bN=bD(bI,bM-bC.nodes[bI].startIndex,0);if(!bN){break}if(bv==1){bK.push(bN)}if(bb(bN,by,bH)){by=bN}if(bv==1){if(bH>=bN.y&&bH<=(bN.y+bN.height)){break}else{if(bN.y>bH){bP=bN}else{bQ=bN}}}else{if(a6(bN,by)){if(bJ>=bN.x&&bJ<=(bN.x+bN.width)){break}else{if(bN.x>bJ){bP=bN}else{bQ=bN}}}else{if(bN.y>bH){bP=bN}else{bQ=bN}}}}}return bF(by);function bu(bU){var bT=bC.nodes;if(bT.length==1){return 0}if(bU>=bT[0].startIndex&&bU<=bT[0].endIndex){return 0}if(bU>=bT[bT.length-1].startIndex&&bU<=bT[bT.length-1].endIndex){return bT.length-1}var bV=0;var bS=bT.length-1;var bX;while(true){var bW=bV+Math.floor((bS-bV)/2);if(bW==bV){bW++}else{if(bW==bS){bW--}}if(bU>=bT[bW].startIndex&&bU<=bT[bW].endIndex){bX=bW;break}else{if(bU<bT[bW].startIndex){bS=bW}else{bV=bW}}}return bX}function bD(b1,b5,bZ){var bT=bC.nodes,bY=bZ==0||bZ==1,b0=b5,bV=b1,bW=null,bX;do{if(!bY&&bZ==0){b1=bV;b5=b0+1;if(b5>bT[b1].endIndex){b1++;b5=0}}var bS=false;while(b1>=0&&b1<bT.length){bX=bT[b1];if(ab(bX.domNode)){if(bX.placement==1){bt(bX.domNode);while(b5>=0&&b5<bh.length){if(bZ==0&&((bQ.domNode==bX.domNode&&bQ.relIndex==b5)||(bP.domNode==bX.domNode&&bP.relIndex==b5))){bS=true;break}if(bw["_"+b1+"_"+b5]){b5+=(bY?-1:1);continue}if(!a0(b5)){bw["_"+b1+"_"+b5]=true;b5+=(bY?-1:1);continue}bW=bq;break}}else{if(bZ==0&&((bQ.domNode==bX.domNode&&bQ.placement==bX.placement)||(bP.domNode==bX.domNode&&bP.placement==bX.placement))){bS=true;break}bW=bX.domNode;break}}if(bW||bS){break}b1+=(bY?-1:1);b5=(bY&&b1>=0&&b1<bT.length)?(bT[b1].placement==1?bT[b1].length-1:1):0}if(bW){break}}while(bZ==0&&!(bY=!bY));if(!bW){return null}var b4,bU,b6;if(bX.posInWnd){b4=bX.posInWnd}if(X(bW)=="br"){b4=b4||bd(bW);b6=b4.height;bU=0}else{b4=b4||f(bW);bU=bW.offsetWidth;b6=bW.offsetHeight}var b7=Math.abs(b4.x-bJ),b3=Math.abs(b4.x+bU-bJ),b2;switch(bX.placement){case 2:b2=false;break;case 4:b2=true;break;default:b2=b3<b7}return{domNode:bX.domNode,relIndex:b5,absIndex:bX.startIndex+b5,placement:bX.placement,isRightOf:b2,x:b4.x,y:b4.y,adx:b2?b3:b7,ady:Math.min(Math.abs(b4.y-bH),Math.abs(b4.y+bW.offsetHeight-bH)),width:bU,height:b6}}function bG(){if(!((bH>=bx.y&&bH<=(bx.y+bx.height))||(bH>=bO.y&&bH<=(bO.y+bO.height)))&&bH>=bx.y&&bH<=(bO.y+bO.height)){bQ=bx;bP=bO;return true}return false}function bB(){if(bJ>=by.x&&bJ<(by.x+by.width)){return false}else{if(by.x>bJ){bP=by;bQ=null;for(i in bK){bN=bK[i];if(bN.absIndex<by.absIndex&&(!bQ||bN.absIndex>bQ.absIndex)){bQ=bN}}if(!bQ){return by}}else{bQ=by;bP=null;for(i in bK){bN=bK[i];if(bN.absIndex>by.absIndex&&(!bP||bN.absIndex<bP.absIndex)){bP=bN}}if(!bP){return by}}}return true}function bL(){by=bE?bx:bO;for(var bS in bK){var bT=bK[bS];if(a6(bT,bz)||(bE&&bT.y>bz.y)||(!bE&&bT.y<bz.y)){continue}if(bb(bT,by,bH)){by=bT}}}function bA(bX,bZ,bU,bW){var b0=[[bX,bZ,bU,bW]];while(b0.length>0){var bY=b0.pop();bX=bY[0];bZ=bY[1];bU=bY[2];bW=bY[3];var bS=bZ;while(bS<bC.nodes.length&&X(bC.nodes[bS].domNode)=="table"){bS++}if(bS==bC.nodes.length){continue}if(bS!=bZ){bX=bD(bS,0,2);bZ=bS;bK.push(bX)}bS=bW;while(bS>=0&&X(bC.nodes[bS].domNode)=="table"){bS--}if(bS==-1){continue}if(bS!=bW){bU=bD(bS,bC.nodes[bS].length-1,1);bW=bS;bK.push(bU)}if(bX.absIndex>=(bU.absIndex-1)||a6(bU,bX)){continue}var bV=bX.absIndex+Math.floor((bU.absIndex-bX.absIndex)/2);if(bV==bX.absIndex){bV++}else{if(bV==bU.absIndex){bV--}}var bT=bu(bV);bQ=bX;bP=bU;var b1=bD(bT,bV-bC.nodes[bT].startIndex,0);if(!b1){continue}bK.push(b1);b0.push([bX,bZ,b1,bT]);b0.push([b1,bT,bU,bW])}}function bF(bV){if(!bV){return null}if(X(bV.domNode)=="br"){var bU=br(bV,true);if(bU&&a6(bV,bU)){bV=bU;bV.isRightOf=true}else{var bT=br(bV,false);if(bT&&a6(bV,bT)){bV=bT;bV.isRightOf=false}}}else{if(de.doc.isMNPlaceHolder(bV.domNode)){bV.isRightOf=false}}bV.placement=bf(bV.domNode);var bS=aR();bV.docLeft=bS.left+bV.x;bV.docTop=bS.top+bV.y;return bV}}})();var ax="sw-protect",af="editable",V="sw-packaged";function aF(a0){if(v(a0)){return !ac(a0)}return false}function aA(a0){if(de.doc.isEditSection(a0)){return !ac(a0)}return false}function ac(a0){var a1=false;R(a0,a0,true,function(a4){if(a4==a0||de.doc.isProtectedNode(a4)){return}var a3=de.cursor.getPlacementFlags(a4);if(a3==1){if(aH(a4)&&ah(a4)>0){if(M(a4.nodeValue)){var a5=N("span"),a2=document.createTextNode(a4.nodeValue);a5.appendChild(a2);a4.nodeValue="";a4.parentNode.appendChild(a5);a1=a5.offsetHeight!=0&&a5.offsetWidth!=0;a4.parentNode.removeChild(a5);a4.nodeValue=a2.nodeValue}else{a1=true}}}else{if(a3){a1=true}}return !a1});return a1}var v=function(){var a0=aZ("li,dd,dt,p,td,th,h1,h2,h3,h4,h5,h6,pre,div");return function(a1){return a0[X(a1)]||a1==H}}();(function(){L("Doc",function(){h(de.doc);var a8=de.doc.getAllEditSections();c=false;for(var a7 in a8){m(a8[a7],true)}c=true;de.doc.addObserver({onSectionAdded:function(a9){c=false;m(a9,false);c=true}})});var a4={},a3="sw-mn-ph",a1="sw-es-ph",a5=new RegExp("^"+af+".*$"),a2=new RegExp("^"+af+"-?(.+)$"),a0=new RegExp("^"+ax+"$"),a6=new RegExp("^"+V+"$");de.doc={getEditSectionContainer:function(a7){return j(a7,null,this.isEditSection,true)},isEditSection:function(a7){if(a7&&a7.nodeType==1){return T(a7,a5)}return false},getAllEditSections:function(){var a7=[];R(H,H,true,function(a8){if(de.doc.isEditSection(a8)){a7.push(a8)}});return a7},isNodeEditable:function(a7){var a8=this.getEditSectionContainer(a7);return a8!=null&&a8!=a7},getProtectedNodeContainer:function(a7){return j(a7,null,function(a8){return a8.nodeType==1&&T(a8,a0)},true)},isProtectedNode:function(a7){return this.getProtectedNodeContainer(a7)!=null},getPackageContainer:function(a7){return j(a7,null,function(a8){return a8.nodeType==1&&T(a8,a6)},true)},isNodePackaged:function(a7){return this.getPackageContainer(a7)!=null},declarePropertySet:function(a8,be){be=o(be);if(typeof be.actionFilter=="string"){var a7=be.actionFilter;if(a7.charAt(0)!="!"){be.afInclusive=true;if(a7){a7+=","}a7+="inserthtml,inserttext,removedom,removetext"}else{a7=a7.substr(1);be.afInclusive=false}var bg=a7.toLowerCase().split(",");var bd="(";for(var bb in bg){bd+=((bb=="0")?"":"|");var a9=bg[bb];var bc=/^format\((.+)\)$/.exec(a9);if(bc){var bf=bc[1].split(",");for(var ba in bf){bd+=((ba=="0")?"":"|")+"format"+bf[ba]}}else{bd+=a9;if(a9.indexOf("format")==0){bd+=".+"}}}bd+=")";be.afRE=new RegExp("^"+bd+"$")}a4[a8]=be},declarePropertySets:function(a8){for(var a7 in a8){this.declarePropertySet(a7,a8[a7])}},getEditProperties:function(a8){if(!this.isEditSection(a8)){a8=this.getEditSectionContainer(a8)}if(a8){var a7=T(a8,a5);if(a7){var a9=a2.exec(a7);return a9?a4[a9[1]]||{}:{}}return{}}return null},createMNPlaceholder:function(){var a7=N("span");am(a7,a3);a7.innerHTML="&nbsp;";return a7},isMNPlaceHolder:function(a8,a7){switch(a8.nodeType){case 1:return au(a8)==a3;case 3:return !a7&&a8.parentNode&&au(a8.parentNode)==a3}return false},createESPlaceholder:function(a7){var a8=this.getEditProperties(a7).phMarkup||"&nbsp;";var a9=N("span");am(a9,a1);a9.innerHTML=a8;return a9},isESPlaceHolder:function(a9,a7){while(a9){if(a9.nodeType==1){var a8=au(a9);if(a8==a1){return true}}if(a7){break}a9=a9.parentNode}return false},registerEditSection:function(a7,a9){var a8=au(a7);am(a7,(a8?a8+" ":"")+af+(a9?"-"+a9:""));if(!ac(a7)){a7.appendChild(this.createESPlaceholder(a7))}this.fireEvent("SectionAdded",a7)},unregisterEditSection:function(a7){var a8=au(a7);if(a8){am(a7,a8.replace(new RegExp("^|s"+af+"S*$","g"),""))}this.fireEvent("SectionRemoved",a7)}}})();var an={"1":"Bad arguments"};function aj(a0){throw new Error(typeof a0=="number"?an[a0]:a0)}function A(a3,a0,a2){if(a3.setInterval&&a3!=window){a3=window}switch(a0){case"keystroke":a1(a3,"keydown",function(a5){var a4=de.events.Keyboard.getKeyIdentifier(a5,true);if(a4){return a2(a5,a4)}});a1(a3,"keypress",function(a5){var a4=de.events.Keyboard.getKeyIdentifier(a5,false);if(a4){return a2(a5,a4)}});break;case"mousedown":a1(a3,a0,function(a4){return de.events.Mouse.sniffMouseDownEvent(a4)?a2(a4):true});break;case"mouseup":a1(a3,a0,function(a4){return de.events.Mouse.sniffMouseUpEvent(a4)?a2(a4):true});break;case"mousemove":a1(a3,a0,function(a4){return de.events.Mouse.sniffMouseMoveEvent(a4)?a2(a4):true});break;default:a1(a3,a0,a2)}function a1(a6,a4,a5){if(!a2.evWrappers){a2.evWrappers={}}if(!a2.evWrappers[a4]){a2.evWrappers[a4]=[]}a2.evWrappers[a4].push([a6,a7]);if(a6.addEventListener){a6.addEventListener(a4,a7,false)}else{if(a6.attachEvent){a6.attachEvent("on"+a4,a7)}}function a7(a8){de.events.current=a8=a8||window.event;try{if(a5(a8)===false){return de.events.consume(a8)}}finally{de.events.current=0}}}}function ad(a4,a1,a3){if(a1=="keystroke"){ad(a4,"keydown",a3);ad(a4,"keypress",a3);return}if(a3.evWrappers&&a3.evWrappers[a1]){for(var a2 in a3.evWrappers[a1]){var a0=a3.evWrappers[a1][a2];if(a0[0]==a4){if(a3.evWrappers[a1].length==1){delete a3.evWrappers[a1]}else{a3.evWrappers[a1].splice(a2,1)}a3=a0[1];break}}}if(a4.removeEventListener){a4.removeEventListener(a1,a3,false)}else{if(a4.detachEvent){a4.detachEvent("on"+a1,a3)}}}D(de.events,{current:0,addHandler:A,removeHandler:ad,getXYInWindowFromEvent:function(a2){var a1=0,a0=0;if(a2.clientX||a2.clientX===0){a1=a2.clientX;a0=a2.clientY}else{if(a2.pageX!=null){var a3=aR();a1=a2.pageX-a3.left;a0=a2.pageY-a3.top}}return{x:a1,y:a0}},getEventTarget:function(a0){return a0.target||a0.srcElement||document},consume:function(a0){de.events.stopPropogation(a0);de.events.preventDefault(a0);return false},stopPropogation:function(a0){if(p==2){a0.cancelBubble=true}else{if(a0.stopPropagation){a0.stopPropagation()}}},preventDefault:function(a0){if(p==2){a0.returnValue=false}else{if(a0.preventDefault){a0.preventDefault()}}}});(function(){var a4="1",a2="2",a3,a0=false,a1={};L("events.Mouse",function(){if(E==3){a3={"1":a4,"2":a2}}else{a3={"0":a4,"2":a2}}a1[a4]=a1[a2]=false});de.events.Mouse={sniffMouseDownEvent:function(a7){var a6=a3[a7.button];if(a6){if(W==2&&a6==a4&&a7.ctrlKey){a6=RIGHT_CLICK}a1[a6]=true}if(a5(a7)){a0=this.isLeftDown();return false}return true},sniffMouseUpEvent:function(a7){var a6=a3[a7.button];if(a6){if(W==2&&a6==a4){this.clearDownStates()}else{a1[a6]=false}}a0=this.isLeftDown();return !a5(a7)},sniffMouseMoveEvent:function(a6){return !(this.isLeftDown()&&a0)},isLeftDown:function(){return a1[a4]},isRightDown:function(){return a1[a2]},clearDownStates:function(){a1[a4]=false;a1[a2]=false}};function a5(a8){var a7=de.events.getEventTarget(a8);if(a7==window||a7==document||a7==document.documentElement){if(p==5){return}var a9=de.events.getXYInWindowFromEvent(a8),a6=_getViewPortSize();if(a9.x>=a6.width){return 1}return a9.y>=a6.height}}})();var q={};function at(a0,a1,a2){a0=a0.toLowerCase();q[a0+"Eval"]=a1;q[a0+"Wrapper"]=a2}(function(){function a0(a1,a2){var a3=N("span");aJ(a3,a1,a2);return a3}(function(a1){for(var a2 in a1){at(a2,a1[a2][0],a1[a2][1])}})({bold:[function(a4){var a3=[];if(X(a4)=="b"||X(a4)=="strong"){a3.push({type:1})}var a2=a4.style.fontWeight;if(a2){var a1=a2=="bold";if(!a1){a2=parseInt(a2);a1=(!isNaN(a2)&&a2>=700)}if(a1){a3.push({type:3,match:"fontWeight"})}}return a3.length>0?{strip:a3,inline:N("strong"),value:true}:null},function(){return N("strong")}],italics:[function(a2){var a1=[];if(X(a2)=="i"||X(a2)=="em"){a1.push({type:1})}if(a2.style.fontStyle=="italic"){a1.push({type:3,match:"fontStyle"})}return a1.length>0?{strip:a1,inline:N("em"),value:true}:null},function(){return N("em")}],underline:[function(a2){var a1=[];if(X(a2)=="u"){a1.push({type:1})}if(a2.style.textDecoration=="underline"){a1.push({type:3,match:"textDecoration"})}return a1.length>0?{strip:a1,inline:a0("textDecoration","underline"),value:true}:null},function(){return a0("textDecoration","underline")}],strike:[function(a2){var a1=[];if(X(a2)=="strike"){a1.push({type:1})}if(a2.style.textDecoration=="line-through"){a1.push({type:3,match:"textDecoration"})}return a1.length>0?{strip:a1,inline:a0("textDecoration","line-through"),value:true}:null},function(){return a0("textDecoration","line-through")}],color:[function(a1){if(a1.style.color&&a1.style.color.length>0){return{strip:[{type:3,match:"color"}],inline:a0("color",a1.style.color),value:a1.style.color}}},function(a1){return a0("color",a1)}],backcolor:[function(a1){if(a1.style.backgroundColor&&a1.style.backgroundColor.length>0){return{strip:[{type:3,match:"backgroundColor"}],inline:a0("backgroundColor",a1.style.backgroundColor),value:a1.style.backgroundColor}}},function(a1){return a0("backgroundColor",a1)}],fontsize:[function(a1){if(X(a1)=="small"||X(a1)=="big"){var a2=X(a1)=="small"?"smaller":"larger";return{strip:[{type:1}],inline:a0("fontSize",a2),value:a2}}if(a1.style.fontSize&&a1.style.fontSize.length>0){return{strip:[{type:3,match:"fontSize"}],inline:a0("fontSize",a1.style.fontSize),value:a1.style.fontSize}}},function(a1){return a0("fontSize",a1)}],fontfamily:[function(a1){if(a1.style.fontFamily&&a1.style.fontFamily.length>0){return{strip:[{type:3,match:"fontFamily"}],inline:a0("fontFamily",a1.style.fontFamily),value:a1.style.fontFamily}}},function(a1){return a0("fontFamily",a1)}],link:[function(a1){if(X(a1)=="a"){return{strip:[{type:1}],inline:a1.cloneNode(false),value:{url:a1.href,title:a1.title}}}},function(a1){var a2=N("a");a2.href=a1.url;a2.title=a1.title;return a2}]})})();var az=function(){var a1=function(a3,a2){this.node=a3;this.pos=a2;this.children=[];this.isShared=false;this.parent=null};a1.prototype={visit:function(a3){if(a3(this)===false){return false}for(var a2 in this.children){if(!this.children[a2].visit(a3)){return false}}return true},disconnect:function(){this.visit(function(a2){if(!a2.isShared){a0(a2,false)}})},collapse:function(){var a8=w(this.getStartFragment().node,this.getEndFragment().node,false),bb=this,bl=false,bi=this,a6=false;while(bb.node!=a8){bb=bb.children[0]}bi.disconnect();a9();var ba=a2(bb,true,a3(bi.getStartFragment())),bg,be;for(bg in ba){if(ba[bg].migrantRoots.length>0){var a4=ba[bg].migrationPoint.node,bj=ba[bg].migrationPoint.children[0].pos,bf=false,bc=0;if(bk(ba[bg].migrationPoint.children[0].node)){bj++}for(be=0;be<ba[bg].migrantRoots.length;be++){Q(1,ba[bg].migrantRoots[be],a4,bj+be)}if(v(a4)){R(a4,a4,true,function(bm){if(bm==a4){return}if(!(de.doc.isMNPlaceHolder(bm,false)&&(bm.nodeType==3?bm.parentNode.parentNode==a4:bm.parentNode==a4))&&de.cursor.getPlacementFlags(bm)){bf=true;return false}})}for(var bd=0;bd<a4.childNodes.length;bd++){var bh=a4.childNodes[bd];if(de.doc.isMNPlaceHolder(bh,true)||de.doc.isESPlaceHolder(bh,true)){if(bc||!v(a4)||bf){Q(2,bh)}bc=1}}}}return ba.length>0&&ba[0].migrantRoots.length>0?ba[0].migrantRoots[0]:null;function a2(bn,bs,bz){var bB={migrationPoint:bz,migrantRoots:[]};var by=[bB];for(var bw=bs?bn.getEndFragment():bn.getStartFragment();bw!=(bs?bn:bn.parent);bw=bw.parent){var bp,bq;if(bs){a6=false;for(var bv=bw.parent;bv!=bn;bv=bv.parent){if(bv.isShared&&a5(bv.node)){a6=true;break}}}if(!bs||bw.isShared){bp=bw.node;bq=bp.nextSibling;if(a5(bp)){bl=true;if(bs){Q(2,bw.node)}}if(!bs||a7(bp)){if(bp.firstChild){bp=bp.cloneNode(false)}else{Q(2,bp)}while(bB.migrationPoint!=bb&&!n(bp,bB.migrationPoint.node)&&X(bp)!="div"){bB.migrationPoint=a3(bB.migrationPoint)}for(var bt=0;bt<by.length;bt++){for(var br in by[bt].migrantRoots){Q(1,by[bt].migrantRoots[br],bp)}by[bt].migrantRoots=[bp];if(bt<(by.length-1)){bp=bp.cloneNode(false)}}}else{if(!a5(bp)){bl=true;if(!bp.firstChild){Q(2,bw.node)}}}}else{if(!bw.parent.isShared){continue}var bx=bi;while(bx.children.length>0&&bx!=bw.parent){bx=bx.children[0]}if(bx==bw.parent){bq=null;if(!bx.insertedPH){if(bk(bx.children[0].node)){bq=bx.node.childNodes.length>(bx.children[0].pos+1)?bx.node.childNodes[bx.children[0].pos+1]:null}else{bq=bx.node.childNodes.length>bx.children[0].pos?bx.node.childNodes[bx.children[0].pos]:null}}}else{bq=bw.parent.node.firstChild}}if(bs&&!a7(bw.parent.node)&&!a5(bw.parent.node)){bl=true}else{if(!bs&&bw==bn){continue}}var bA=bw.getIndexInParent();if(bs){bw.parent.migrantIndex=0}while(bq&&(a6||!bl)){bp=bq;bq=bp.nextSibling;bA++;var bm;if(bs){var bo;if(bw.parent.migrants&&bw.parent.migrants.length>bw.parent.migrantIndex){bo=bw.parent.migrants[bw.parent.migrantIndex]}else{bo=aa(bp.parentNode,bp,0,bp,ah(bp,1));if(!bw.parent.migrants){bw.parent.migrants=[]}bw.parent.migrants.push(bo)}bw.parent.migrantIndex++;bm=a2(bo.children[0],false,by[by.length-1].migrationPoint)}else{bm=a2(bw.parent.children[bA],false,by[by.length-1].migrationPoint)}for(var bt in bm){if(bm[bt].migrantRoots.length==0){continue}var bu=false;for(var br in by){if(by[br].migrationPoint==bm[bt].migrationPoint){by[br].migrantRoots=by[br].migrantRoots.concat(bm[bt].migrantRoots);bu=true;break}}if(!bu){by.push(bm[bt])}}bB=by[by.length-1]}}return by}function a3(bm){do{bm=bm.parent}while(bm!=bb&&!(bk(bm.node)&&a5(bm.node)));return bm}function a5(bm){return S(bm)||X(bm)=="li"}function a7(bm){return bm.nodeType==3||ae(bm)}function bk(bm){return aK(H,bm)}function a9(){for(var bn=bi.getStartFragment();bn!=null;bn=bn.parent?bn.parent:null){var bm=bn.node;if(v(bm)||de.doc.isEditSection(bm)){if(bn.isShared){var bq=0;if(aA(bm)){bq=1}else{if(aF(bm)){bq=2}}if(bq){var bp=bq==1?de.doc.createESPlaceholder(bm):de.doc.createMNPlaceholder();Q(1,bp,bm);bn.insertedPH=1}}else{while(bm.firstChild){Q(2,bm.firstChild)}Q(1,de.doc.createMNPlaceholder(),bm);bn.insertedPH=1;while(!bn.isShared){if(bn.parent.isShared){Q(1,bn.node,bn.parent.node,bn.pos)}else{var bo=bn.parent.node;while(bo.firstChild){Q(2,bo.firstChild)}Q(1,bn.node,bo)}if(!bn.parent){break}bn=bn.parent}}break}}}},getStartFragment:function(){var a2=this;while(a2.children.length>0){a2=a2.children[0]}return a2},getEndFragment:function(){var a2=this;while(a2.children.length>0){a2=a2.children[a2.children.length-1]}return a2},getIndexInParent:function(){if(!this.parent){return null}var a2=0;while(this!=this.parent.children[a2]){a2++}return a2},wasStartSplit:function(){return this.getStartFragment().preSplitNode?true:false},wasEndSplit:function(){return this.getEndFragment().postSplitNode?true:false},getPreSplitNode:function(){var a2=this.getStartFragment();return a2.preSplitNode?a2.preSplitNode:null},getPostSplitNode:function(){var a2=this.getEndFragment();return a2.postSplitNode?a2.postSplitNode:null},getAdjustedNodeIndex:function(a4,a2){if(a4.nodeType==3&&a2>=ah(a4)){var a5=this.getStartFragment(),a3=this.getEndFragment();if(a5.wasStartSplit()){var a6=a5.getPreSplitNode();if(a4==a6){a2-=ah(a6);a4=a5.node}}if(a3.wasEndSplit()&&a4==a3.node&&a2>=ah(a4)){a2-=ah(a3.node);a4=a3.getPostSplitNode()}}return{node:a4,index:a2}},getOriginalNodeIndex:function(a4,a2){if(a4.nodeType==3){var a5=this.getStartFragment(),a3=this.getEndFragment();if(a4==a3.getPostSplitNode()){a2+=ah(a3.node);a4=a3.node}if(a5.wasStartSplit()&&a4==a5.node){var a6=a5.getPreSplitNode();a2+=ah(a6);a4=a6}}return{node:a4,index:a2}}};function a0(a2,a3){if(a3||(a2.parent&&a2.parent.isShared)){Q(2,a2.node)}}return a1}();function aa(bc,a0,bb,a8,a6){if(!bc){bc=w(a0,a8)}var a7=false;while(a0.firstChild){a0=bb==0?a0.firstChild:a0.lastChild;a7=true}if(a7&&bb>0){bb=ah(a0,1)}a7=false;while(a8.firstChild){a8=a6==0?a8.firstChild:a8.lastChild;a7=true}if(a7&&a6>0){a6=ah(a8,1)}if(de.doc.isMNPlaceHolder(a0)||de.doc.isESPlaceHolder(a0)){bb=0}if(de.doc.isMNPlaceHolder(a8)||de.doc.isESPlaceHolder(a8)){a6=ah(a8,1)}var a3=[];R(bc,a0,true,function(bf){a3.push(bf);return bf!=a8});var be=aO(a0,bc,false,true);be.reverse();a3=be.concat(a3);var a5;for(var a2 in a3){var a1=a3[a2],bd=0,a4=0;if((a1==a0||a1==a8)&&a1.nodeType==3){if(a1==a0&&bb>0&&bb<ah(a1)){bd=a1;a1=Q(3,a1,bb);if(a8==a0){a8=a1;a6-=ah(a0)}a0=a1}if(a1==a8&&a6>0&&a6<ah(a1)){a4=Q(3,a1,a6)}}var a9=new az(a1,l(a1));if(!a5){a5=a9}else{a9.parent=null;a5.visit(function(bf){if(bf.node==a9.node.parentNode){a9.parent=bf}return a9.parent==null});a9.parent.children.push(a9)}a9.isShared=!(bd||a4)&&((a1==a0&&bb==ah(a1,1))||(a1==a8&&a6==0));if(bd){a9.preSplitNode=bd}if(a4){a9.postSplitNode=a4}}ba(a5);return a5;function ba(bi){var bf=false;for(var bg in bi.children){var bh=bi.children[bg];ba(bh);bf|=bh.isShared}bi.isShared|=(bf||bi==a5||bi.node.childNodes.length!=bi.children.length)}}de.buildFragment=aa;var aY={},aB,c=true;function P(a3,a1,a0,a2){if(!a3){a3=P.genOp+1;do{a3++}while(aY[a3]);P.genOp=a3}aY[a3]={exec:a1,undo:a0,redo:a2};return a3}P.genOp=100;function Q(a3){var a1=aY[a3];var a2=Array.prototype.slice.call(arguments);a2.shift();a2.unshift({opCode:a3});var a0=a1.exec.apply(a1,a2);if(c){if(!aB){aB=[]}aB.push(a2[0])}return a0}function aP(){var a0=aB;aB=null;return a0}function u(a3){for(var a1=a3.length-1;a1>=0;a1--){var a2=a3[a1];var a0=aY[a2.opCode];a0.undo(a2)}}function aW(a3){for(var a1 in a3){var a2=a3[a1];var a0=aY[a2.opCode];a0.redo(a2)}}de.recordOperations=function(a0){c=a0};P(1,function(a3,a1,a2,a0){a3.newNode=a1;a3.parent=a2;if(a0||a0===0){a3.pos=a0}this.redo(a3)},function(a0){a0.parent.removeChild(a0.newNode)},function(a0){if(a0.pos||a0.pos===0){aX(a0.parent,a0.newNode,a0.pos)}else{a0.parent.appendChild(a0.newNode)}});P(2,function(a0,a1){a0.parent=a1.parentNode;a0.pos=l(a1);a0.target=a1;this.redo(a0)},function(a0){aX(a0.parent,a0.target,a0.pos)},function(a0){a0.parent.removeChild(a0.target)});P(3,function(a1,a2,a0){a1.target=a2;a1.index=a0;a1.rem=a2.splitText(a0);return a1.rem},function(a0){a0.target.nodeValue+=a0.rem.nodeValue;a0.rem.parentNode.removeChild(a0.rem);a0.rem.nodeValue=""},function(a1){var a0=a1.target.nodeValue;a1.rem.nodeValue=a0.substr(a1.index);a1.target.nodeValue=a0.substr(0,a1.index);aV(a1.rem,a1.target)});P(4,function(a2,a4,a5,a0){a2.target=a4;a2.index=a0;a2.len=a5.length;var a3=a4.nodeValue.substr(0,a0),a1=a4.nodeValue.substr(a0);a4.nodeValue=a3+a5+a1},function(a1){a1.text=a1.target.nodeValue.substr(a1.index,a1.len);var a2=a1.target.nodeValue.substr(0,a1.index),a0=a1.target.nodeValue.substr(a1.index+a1.len);a1.target.nodeValue=a2+a0;delete a1.len},function(a1){a1.len=a1.text.length;var a2=a1.target.nodeValue.substr(0,a1.index),a0=a1.target.nodeValue.substr(a1.index);a1.target.nodeValue=a2+a1.text+a0;delete a1.text});P(5,function(a3,a5,a0,a2){a3.target=a5;a3.index=a0;a3.text=a5.nodeValue.substr(a0,a2);var a4=a5.nodeValue.substr(0,a0),a1=a5.nodeValue.substr(a0+a2);a5.nodeValue=a4+a1},aY[4].redo,aY[4].undo);P(6,function(a2,a3,a0,a1){a2.target=a3;a2.css=a0;a2.newValue=a1;a2.oldValue=p==2?a2.target.style.getAttribute(a2.css):a2.target.style[a2.css];this.redo(a2)},function(a0){if(p==2){a0.target.style.setAttribute(a0.css,a0.oldValue)}else{a0.target.style[a0.css]=a0.oldValue}},function(a0){if(p==2){a0.target.style.setAttribute(a0.css,a0.newValue)}else{a0.target.style[a0.css]=a0.newValue}});P(7,function(a1,a2,a0){a1.target=a2;a1.newName=a0;a1.oldName=au(a2);this.redo(a1)},function(a0){am(a0.target,a0.oldName)},function(a0){am(a0.target,a0.newName)});P(9,function(a1,a2,a0){a1.row=a2;a1.index=a0>a2.cells.length?a2.cells.length:a0;if(a1.index<0){a1.index=0}return this.redo(a1)},function(a0){a0.row.deleteCell(a0.index)},function(a0){return a0.row.insertCell(a0.index)});P(8,function(a2,a1,a0){a2.table=a1;a2.index=a0>a1.rows.length?a1.rows.length:a0;if(a2.index<0){a2.index=0}return this.redo(a2)},function(a0){a0.table.deleteRow(a0.index)},function(a0){return a0.table.insertRow(a0.index)});P(10,function(a2,a1,a0){a2.table=a1;a2.index=a0>=a1.rows.length?a1.rows.length-1:a0;if(a2.index<0){a2.index=0}this.redo(a2)},function(a1){var a0=a1.table.insertRow(a1.index);while(a1.row.firstChild){var a2=a1.row.firstChild;a1.row.removeChild(a2);a0.appendChild(a2)}delete a1.row},function(a0){a0.row=a0.table.rows[a0.index];a0.table.deleteRow(a0.index)});P(11,function(a1,a2,a0){a1.row=a2;a1.index=a0>=a2.cells.length?a2.cells.length-1:a0;if(a1.index<0){a1.index=0}this.redo(a1)},function(a0){var a2=a0.row.insertCell(a0.index);while(a0.cell.firstChild){var a1=a0.cell.firstChild;a0.cell.removeChild(a1);a2.appendChild(a1)}delete a0.cell},function(a0){a0.cell=a0.row.cells[a0.index];a0.row.deleteCell(a0.index)});(function(){var a1={specialToCharCode:{8:"Backspace",9:"Tab",13:"Enter",27:"Escape",32:"Space"},keyCodeToId:{16:"Shift",17:"Control",18:"Alt",20:"CapsLock",224:"Meta",37:"Left",38:"Up",39:"Right",40:"Down",33:"PageUp",34:"PageDown",35:"End",36:"Home",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",44:"PrintScreen",145:"Scroll",19:"Pause",91:"Win",93:"Apps"},numpadToCharCode:{96:"0".charCodeAt(0),97:"1".charCodeAt(0),98:"2".charCodeAt(0),99:"3".charCodeAt(0),100:"4".charCodeAt(0),101:"5".charCodeAt(0),102:"6".charCodeAt(0),103:"7".charCodeAt(0),104:"8".charCodeAt(0),105:"9".charCodeAt(0),106:"*".charCodeAt(0),107:"+".charCodeAt(0),109:"-".charCodeAt(0),110:".".charCodeAt(0),111:"/".charCodeAt(0)},charCodeA:"A".charCodeAt(0),charCodeZ:"Z".charCodeAt(0),charCodea:"a".charCodeAt(0),charCodez:"z".charCodeAt(0),charCode0:"0".charCodeAt(0),charCode9:"9".charCodeAt(0),keyCodeFix:{},charCodeToKeyCode:{},ambiguousKeyPressCodes:{}};a1.idToKeyCode={};for(var a2 in a1.keyCodeToId){a1.idToKeyCode[a1.keyCodeToId[a2]]=parseInt(a2,10)}for(var a2 in a1.specialToCharCode){a1.idToKeyCode[a1.specialToCharCode[a2]]=parseInt(a2,10)}switch(p){case 2:a1.charCodeToKeyCode={13:13,27:27};break;case 1:a1.keyCodeFix={12:a3("NumLock")};break;case 3:if(d.engineVersion&&d.engineVersion<525.13){a1.charCodeToKeyCode={63289:a3("NumLock"),63276:a3("PageUp"),63277:a3("PageDown"),63275:a3("End"),63273:a3("Home"),63234:a3("Left"),63232:a3("Up"),63235:a3("Right"),63233:a3("Down"),63272:a3("Delete"),63302:a3("Insert"),63236:a3("F1"),63237:a3("F2"),63238:a3("F3"),63239:a3("F4"),63240:a3("F5"),63241:a3("F6"),63242:a3("F7"),63243:a3("F8"),63244:a3("F9"),63245:a3("F10"),63246:a3("F11"),63247:a3("F12"),63248:a3("PrintScreen"),3:a3("Enter"),12:a3("NumLock"),13:a3("Enter")}}else{a1.charCodeToKeyCode={13:13,27:27}}break;case 5:a1.ambiguousKeyPressCodes={35:51,36:52,44:188,45:109,46:190,91:219,93:221};a1.prestoSimulateInvOnShift={51:1,52:1};a1.prestoUseWhichCodes={33:1,34:1,40:1,39:1,38:1,37:1,123:1};break}a1.ambiguousKeyPressCodesInv={};for(var a2 in a1.ambiguousKeyPressCodes){a1.ambiguousKeyPressCodesInv[a1.ambiguousKeyPressCodes[a2]]=parseInt(a2,10)}de.events.Keyboard={getKeyIdentifier:function(bc,ba){var bg,bf,a8=false;switch(p){case 2:if(ba&&(a0(bc.keyCode)||bc.keyCode==8||bc.keyCode==9)){bg=bc.keyCode}if((!ba&&!bc.ctrlKey)||(ba&&bc.ctrlKey)){if(a1.charCodeToKeyCode[bc.keyCode]){bg=a1.charCodeToKeyCode[bc.keyCode]}else{bf=bc.keyCode}}break;case 1:if(ba){if(bc.keyCode>=16&&bc.keyCode<=18){bg=bc.keyCode}}else{bg=a1.keyCodeFix[bc.keyCode]||bc.keyCode;bf=bc.charCode}break;case 3:if(E==6){if(ba){if(K&&K<525.13){bg=a1.charCodeToKeyCode[bc.charCode]||bc.keyCode}else{bg=bc.keyCode}if(!a0(bg)&&!this.isAcceleratorDown(bc)){bg=0}}else{if(K&&K<525.13){if(a1.charCodeToKeyCode[bc.charCode]){bg=a1.charCodeToKeyCode[bc.charCode]}else{bf=bc.charCode}}else{if(a1.charCodeToKeyCode[bc.keyCode]){bg=a1.charCodeToKeyCode[bc.keyCode]}else{bf=bc.keyCode}}}}else{if(E==4){if(ba){if(a0(bc.keyCode)){bg=bc.keyCode}else{if(this.isAcceleratorDown(bc)){bf=bc.keyCode}}}else{if(bc.charCode&&!this.isAcceleratorDown(bc)){bf=bc.charCode}}}else{a8=true}}break;case 5:if(ba){if(a1.ambiguousKeyPressCodesInv[bc.keyCode]){var bd=a1.prestoSimulateInvOnShift[bc.keyCode];if((bc.shiftKey&&bd)||(!bc.shiftKey&&!bd)){bf=a1.ambiguousKeyPressCodesInv[bc.keyCode]}}else{if(a1.ambiguousKeyPressCodes[bc.keyCode]){bg=bc.keyCode}}}else{if(bc.which&&(a7(bc.which)||a1.prestoUseWhichCodes[bc.which])){bf=bc.which}else{if(a1.keyCodeToId[bc.keyCode]){bg=bc.keyCode}else{bf=bc.keyCode}}}break;case 4:a8=true;break;default:a8=true}if(a8&&ba){if(bc.keyIdentifier&&bc.keyIdentifier.length>0){var a9=/^U\+([\dA-Fa-f]+)$/.exec(bc.keyIdentifier);if(a9){var bb=parseInt(a9[1],16);var be=String.fromCharCode(bb);if(bc.shiftKey){return be.toUpperCase()}else{return be.toLowerCase()}}else{return bc.keyIdentifier}}else{bg=bc.keyCode||bc.which;bf=bc.charCode}}if(bg){if(!ba&&a1.ambiguousKeyPressCodes[bg]){return null}return a4(bg)}else{if(bf){return a6(bf)}}return null},isAcceleratorDown:function(a8){return W==2?a8.metaKey:a8.ctrlKey}};function a0(a8){return typeof a1.keyCodeToId[a8]=="string"||typeof a1.specialToCharCode[a8]=="string"}function a5(a8){return a7(a8)||a1.specialToCharCode[a8]||a1.numpadToCharCode[a8]||a0(a8)}function a7(a8){return(a8>=a1.charCodeA&&a8<=a1.charCodeZ)||(a8>=a1.charCodea&&a8<=a1.charCodez)||(a8>=a1.charCode0&&a8<=a1.charCode9)}function a6(a8){return a1.specialToCharCode[a8]||String.fromCharCode(a8)}function a4(a9){if(a5(a9)){var a8=a1.numpadToCharCode[a9];if(a8){return String.fromCharCode(a8)}return(a1.keyCodeToId[a9]||a1.specialToCharCode[a9]||String.fromCharCode(a9))}else{return null}}function a3(a8){return a1.idToKeyCode[a8]||a8.charCodeAt(0)}})();var ak;(function(){var bb=null,bg=null,a4=null,bq=null,bn=null,bl=null,a2=null,ba={high:"#3B4B5B",low:"#DFFFFF"},a9=false,bk=false,br=3,bf=aZ("button,input,select,textarea"),bm=aZ("br,button,img,iframe,map,object,select,textarea,applet"),a1=/^\W$/,bc,a0,a6;L("Selection",function(){h(de.selection);if(typeof H.onselectstart!="undefined"){H.onselectstart=function(){return de.events.consume(window.event)}}var bs=p==1?window:document;A(bs,"mousedown",a8);A(bs,"mouseup",a3);A(bs,"mousemove",be);A(bs,"dblclick",bp);A(document,"keydown",function(bu){if(de.events.Keyboard.isAcceleratorDown(bu)){if(bu.keyCode==65){return false}}});de.cursor.addObserver({onCursorChanged:function(bv){if(a9){return}if(bv){var bu=bd(bv.domNode,bh(bv));if(de.events.current&&de.events.current.shiftKey&&bb){de.selection.setSelection(bb,bg,bu.node,bu.index,false)}else{de.selection.setSelection(bu.node,bu.index,null,null,false)}}else{de.selection.clear()}}});function bt(){de.selection.clear()}de.UndoMan.addObserver({onBeforeExec:bt,onBeforeUndo:bt,onBeforeRedo:bt});bc=N("div");am(bc,ax);bc.innerHTML='<input type="text" style="border-style:none">';ao(bc,"position:absolute;width:1px;height:1px;display:none;z-index:-500");a0=bc.firstChild;H.appendChild(bc)},"Cursor","UndoMan");function a8(bv){a6=0;var bu=de.events.getEventTarget(bv);var by=X(bu);if(bu&&bf[by]){if(by=="textarea"||(by=="input"&&bu.type=="text")){de.selection.clear();de.cursor.setCursor(null)}return}if(de.events.Mouse.isLeftDown()){if(de.doc.isProtectedNode(bu)){a6=1;return}var bs=de.events.getXYInWindowFromEvent(bv),bx=de.cursor.getCursorDescAtXY(bs.x,bs.y,bu);if(!bx){de.cursor.setCursor(null);return false}if(bv.shiftKey&&bb){a9=true;de.cursor.setCursor(bx);a9=false;var bt=bd(bx.domNode,bh(bx));a5(bb,bg,bt.node,bt.index,false)}else{de.cursor.setCursor(bx);if(!de.cursor.exists()&&!de.doc.isProtectedNode(bx.domNode)){var bt=bd(bx.domNode,bh(bx));a5(bt.node,bt.index,null,null,false)}}var bw=aR();bc.style.left=(bw.left==0?-50:bw.left+10)+"px";bc.style.top=(bw.top==0?-50:bw.top+10)+"px";bc.style.display="";a0.focus();a0.select();bc.style.display="none";return false}}function be(bw){if(de.events.Mouse.isLeftDown()&&bb&&!a6){bk=true;var bs=de.events.getXYInWindowFromEvent(bw),bv=de.cursor.getCurrentCursorDesc();if(bv&&bs.x>=(bv.x-br)&&bs.x<=(bv.x+bv.width+br)&&bs.y>=(bv.y-br)&&bs.y<=(bv.y+bv.height+br)){var bt=0;if(Math.abs(bs.x-bv.x)<Math.abs(bs.x-(bv.x+bv.width))){if(bv.isRightOf){bv.isRightOf=false;a9=true;de.cursor.setCursor(bv);a9=false;bt=1}}else{if(!bv.isRightOf){bv.isRightOf=true;a9=true;de.cursor.setCursor(bv);a9=false;bt=1}}if(bt){var bu=bd(bv.domNode,bh(bv));a5(bb,bg,bu.node,bu.index,false)}}else{bv=de.cursor.getCursorDescAtXY(bs.x,bs.y,de.events.getEventTarget(bw));if(bv&&!de.doc.isProtectedNode(bv.domNode)){var bu=bd(bv.domNode,bh(bv));a5(bb,bg,bu.node,bu.index)}}}}function a3(bs){if(bb&&bk){de.selection.fireEvent("SelectionChanged")}bk=false}function bp(bv){if(!de.doc.isProtectedNode(de.events.getEventTarget(bv))){de.selection.clear();var bs=de.events.getXYInWindowFromEvent(bv);var bu=de.cursor.getCursorDescAtXY(bs.x,bs.y,de.events.getEventTarget(bv));if(bu){var bt=de.selection.getWordRangeAt(bu.domNode,bu.relIndex);if(bt){a5(bt.startNode,bt.startIndex,bt.endNode,bt.endIndex)}}}return false}function bd(bt,bs){if(bn){return bn.getOriginalNodeIndex(bt,bs)}return{node:bt,index:bs}}function bi(bt,bs){if(bn){return bn.getAdjustedNodeIndex(bt,bs)}return{node:bt,index:bs}}ak=function(bs){if(bs&&bn){aW(a2)}else{if(!bs&&bn){u(a2)}}};function a7(){var bs=de.selection.getRange(true);try{var bu=de.cursor.getCurrentCursorDesc();bn=aa(w(bs.startNode,bs.endNode),bs.startNode,bs.startIndex,bs.endNode,bs.endIndex);bl=aP()||[];bn.visit(function(by){if(!by.isShared){var bx=by.node,bw=null;if(bx.nodeType==1){bw=bx}else{if(bx.nodeType==3&&by.parent.isShared&&aH(bx)){bw=N("span");bw.className="dehighlight-node";Q(1,bw,bx.parentNode,l(bx));Q(2,bx);Q(1,bx,bw)}}if(bw){Q(6,bw,"backgroundColor",ba.high);Q(6,bw,"color",ba.low)}}});a2=aP()||[];if(bu){var bt=bi(bu.domNode,bu.relIndex);if(bt.node!=bu.domNode||bt.index!=bu.relIndex){bu.domNode=bt.node;bu.relIndex=bt.index;a9=true;de.cursor.setCursor(bu);a9=false}}}catch(bv){settingHighlight=false;bb=a4=bn=null;a2=null;throw bv}}function bj(){if(bn){var bt=de.cursor.getCurrentCursorDesc();var bs=bt?bd(bt.domNode,bt.relIndex):null;u(a2);u(bl);a2=bl=bn=null;if(bs&&(bs.node!=bt.domNode||bs.index!=bt.relIndex)){bt.domNode=bs.node;bt.relIndex=bs.index;a9=true;de.cursor.setCursor(bt);a9=false}}}function a5(bt,bE,bB,by,bv){if(!bt){de.selection.clear(bv);return}if(bt==bB&&bE==by){bB=null}if(bt==bb&&bE==bg&&((!bB&&!a4)||(bB==a4&&by==bq))){return}bj();bb=bt;bg=bE;a4=bB;bq=by;if(a4){var bA=bo(),bz;while(bb){bz=de.doc.getProtectedNodeContainer(bb);if(bz){bb=(bA?bz.nextSibling:bz.previousSibling);if(bb){bg=bA?0:ah(bb,1)}}else{break}}while(a4){bz=de.doc.getProtectedNodeContainer(a4);if(bz){a4=(bA?bz.previousSibling:bz.nextSibling);if(a4){bq=bA?ah(a4,1):0}}else{break}}var bF=bb&&a4;if(bF){bF=false;var bw=[];R(w(bb,a4),bb,bA,function(bG){bz=de.doc.getProtectedNodeContainer(bG);if(bz){bw.push(bz)}if(bG==a4){bF=true;return false}})}if(!bF){de.selection.clear(bv);return}for(var bx in bw){var bD=bw[bx];if(bD.parentNode){bD.parentNode.removeChild(bD)}}for(var bx in bw){var bD=bw[bx];if(!bD.parentNode){H.appendChild(bD)}}a7()}if(bv!==false){var bs=null;if(de.selection.isRangeEditable()){var bu=a4?bi(a4,bq):bi(bb,bg);var bC=false;if(bu.node.nodeType==3&&bu.index>=ah(bu.node)){bC=true;bu.index--}bs=de.cursor.getNearestCursorDesc(bu.node,bu.index,bC,true)}a9=true;de.cursor.setCursor(bs);a9=false}if(!bk){de.selection.fireEvent("SelectionChanged")}}function bh(bt){var bs=bt.relIndex;if(bt.isRightOf&&bt.domNode.nodeType==3){bs++}return bs}function bo(){if(!a4){return true}if(bb==a4){return bg<bq}var bu=bi(bb,bg).node,bt=bi(a4,bq).node;var bs=false;R(H,bu,true,function(bv){bs=(bv==bt);return !bs});return bs}de.selection={setSelection:a5,clear:function(bs){bj();bb=a4=null;if(bs!==false){a9=true;de.cursor.setCursor(null);a9=false}if(!bk){de.selection.fireEvent("SelectionChanged")}},getRange:function(bu){if(!bb){return null}if(a4){var bs=bo();var bt=!bu||bs;range={inOrder:bu||(bs==bt),startNode:bt?bb:a4,startIndex:bt?bg:bq,endNode:bt?a4:bb,endIndex:bt?bq:bg}}else{range={startNode:bb,startIndex:bg}}return range},isRangeEditable:function(){if(bb){var bu=bi(bb,bg).node;var bt=a4?bi(a4,bq).node:bu;var bs=w(bu,bt,true);return(bu!=bt&&de.doc.isEditSection(bs))||de.doc.isNodeEditable(bs)}return false},getState:function(){if(bn){return"range"}if(bb){return"single"}return null},getActualNodeIndex:bi,getVirtualNodeIndex:bd,setHightlightCSS:function(){},remove:function(){var bs=this.getRange(true);if(bs&&bs.endNode){if(!this.isRangeEditable()){aj("Attempt to remove selection which contains uneditable content")}de.UndoMan.execute("RemoveDOM",bs.startNode,bs.startIndex,bs.endNode,bs.endIndex);return true}return false},getHighlightedDOM:function(){if(bn){u(a2);var bt=(function bs(bx){var bv=bx.node.cloneNode(false);for(var bu in bx.children){var bw=bs(bx.children[bu]);bv.appendChild(bw)}return bv})(bn);aW(a2);return bt}return null},selectAll:function(bs){if(!bs){var bt=de.cursor.getCurrentCursorDesc();if(bt){bs=de.doc.getEditSectionContainer(bt.domNode)}}if(bs){de.selection.setSelection(bs.firstChild,0,bs.lastChild,ah(bs.lastChild,1))}},selectES:function(bs,bv){var bu=bs;if(bv){while(bu.firstChild){bu=bu.firstChild}}else{while(bu.lastChild){bu=bu.lastChild}}var bt=de.cursor.getNearestCursorDesc(bu,bv?0:ah(bu,1),!bv,!bv);if(bt){de.cursor.setCursor(bt)}},getWordRangeAt:function(bw,bu){if(bw.nodeType==3){var bt={startNode:bw,startIndex:bu,endNode:bw,endIndex:bu};var bs=de.doc.isNodeEditable(bw);R(H,bw,false,function(by){if(by!=bw&&j(by,w(by,bw,true),bv,true)){return false}else{if(by.nodeType==3){for(var bx=by==bw?bu:ah(by)-1;bx>=0;bx--){var bz=by.nodeValue.charAt(bx);if(a1.test(bz)){return false}bt.startNode=by;bt.startIndex=bx}}}});R(H,bw,true,function(by){if(by!=bw&&(bv(by)||j(bw,w(by,bw,true),bv,true))){return false}if(by.nodeType==3){for(var bx=by==bw?bu:0;bx<ah(by);bx++){var bz=by.nodeValue.charAt(bx);if(a1.test(bz)){return false}bt.endNode=by;bt.endIndex=bx}}});bt.endIndex++;return bt}function bv(bx){return aL(bx)||bm[X(bx)]||(bs&&de.doc.isEditSection(bx))}},getEditState:function(bw){var bu={formatStates:{},inlineContainerType:null,textAlign:null,blockQuote:false};if(bn){u(a2);(function bv(bx){bs(bx.node)})(bn);aW(a2)}if(bb&&(bb.nodeType==3||ae(bb))){bs(bb.nodeType==3?bb.parentNode:bb)}return bu;function bt(bx){return X(bx)=="blockquote"}function bs(by){if(ae(by)){var bC=de.doc.getEditProperties(by)||{};for(var bB in bw){var bx=bw[bB].toLowerCase();if(!bu.formatStates[bx]||bu.formatStates[bx]!="mixed"){var bD=by,bz=false;while(bD!=H&&de.doc.isNodeEditable(bD)){var bE=q[bx+"Eval"](bD);if(bE){if(typeof bu.formatStates[bx]=="undefined"){bu.formatStates[bx]=bE.value}else{if(bu.formatStates[bx]!==bE.value){bu.formatStates[bx]="mixed"}}bz=true;break}bD=bD.parentNode}if(!bz){bu.formatStates[bx]=(bu.formatStates[bx]===null||typeof bu.formatStates[bx]=="undefined")?null:"mixed"}}}}if(by.nodeType==1){if(bu.textAlign!="mixed"){var bF=aD(by,"text-align");if(!bF){bF="start"}if(bF=="start"){bF=_localeDirection=="rtl"?"right":"left"}else{if(bF=="start"){bF=_localeDirection=="rtl"?"left":"right"}}if(!bu.textAlign){bu.textAlign=bF}else{if(bF!=bu.textAlign){bu.textAlign="mixed"}}}if(bu.inlineContainerType!="mixed"){var bG=aL(by)?by:j(by,H,aL,true);if(!de.doc.isNodeEditable(bG)){bG=null}var bA=bG?X(bG):"none";if(!bu.inlineContainerType){bu.inlineContainerType=bA}else{if(bA!=bu.inlineContainerType){bu.inlineContainerType="mixed"}}}if(!bu.blockQuote){var bH=bt(by)?by:j(by,H,bt,true);if(de.doc.isNodeEditable(bH)){bu.blockQuote=true}}}}}}})();L("Spell",function(){A(p==1?window:document,"mouseup",function(){var a1=de.selection.getRange();if(a1&&!a1.endNode){var a0=de.spell.getMarkedAncestor(a1.startNode);if(a0){de.selection.setSelection({startNode:a0,startIndex:0,endNode:a0,endIndex:1})}}})},"Selection");(function(){var a2="sw-spell-error",a1=/^sw-spell-error$/;de.spell={getWords:function(a3){if(!a3){a3=de.doc.getAllEditSections()}var a6=[],a4={};for(var a5 in a3){a0(a3[a5],function(a7){if(!a4[a7]){a6.push(a7);a4[a7]=1}})}return a6},markWords:function(a6,a3){if(!a3){a3=de.doc.getAllEditSections()}a6=aZ(typeof a6=="string"?a6.replace(/\s/g,","):a6.join(","));var a5=0;for(var a4 in a3){a0(a3[a4],function(ba,a8,bb,a7,a9){if(a6[ba]){var bc=de.UndoMan.execute(a5?1:0,"SpellMark",a8,bb,a7,a9+1);a5=1;return bc.children[bc.children.length-1].node}})}},clearAllMarks:function(a3){if(!a3){a3=de.doc.getAllEditSections()}var a5=[],a4;for(a4 in a3){R(a3[a4],a3[a4],true,function(a6){if(de.spell.isSpellErrorWrapper(a6)){a5.push(a6)}})}for(a4 in a5){de.UndoMan.execute(a4=="0"?0:1,"SpellUnmark",a5[a4])}return a5.length},ignoreError:function(a4,a3){de.UndoMan.execute(a3?a3:0,"SpellUnmark",a4)},correctError:function(a4,a3){de.UndoMan.execute("SpellCorrect",a4,a3)},getMarkedAncestor:function(a3){return this.isSpellErrorWrapper(a3)?a3:j(a3,this.isSpellErrorWrapper)},isSpellErrorWrapper:function(a3){return T(a3,a1)?true:false},stripSpellWrapperHTML:function(a3){var a4=/<span class\s*=\s*(?:"|')sw-spell-error(?:"|')\s*>([^<]+)<\/span>/i;while(match=a4.exec(a3)){a3=a3.substr(0,match.index)+match[1]+a3.substr(match.index+match[0].length)}return a3}};function a0(a6,bc){var a5=/^[^\w']$/,ba=a6,a4,bb,a9,a7,a3;while(ba){R(a6,ba,true,function(be){if(ba==be){ba=0}else{if(be.nodeType==3&&be.parentNode.nodeType==1){if(a9&&be.previousSibling!=a9){if(a8()){return false}}var bf=be.nodeValue,bd;for(bd=0;bd<bf.length;bd++){var bg=bf.charAt(bd);if(a5.test(bg)){if(a8()){return false}}else{if(!a4){a4=be;bb=bd;a3=""}a3+=bg;a9=be;a7=bd}}}}})}a8();function a8(){if(a4&&a9&&!de.doc.isProtectedNode(a4)&&!de.doc.isNodePackaged(a4)){ba=bc(a3,a4,bb,a9,a7);a4=a9=0;return ba}a4=a9=0}}aI("SpellMark",{exec:function(a4,a8,a3,a6){var ba=aa(null,a4,a8,a3,a6),a9=N("span");am(a9,a2);Q(1,a9,ba.node,ba.children[0].pos);for(var a5=0;a5<ba.children.length;a5++){var a7=ba.children[a5].node;Q(2,a7);Q(1,a7,a9)}return ba}});aI("SpellUnmark",{exec:function(a3){while(a3.firstChild){var a4=a3.firstChild;Q(2,a4);Q(1,a4,a3.parentNode,l(a3))}Q(2,a3)}});aI("SpellCorrect",{exec:function(a4,a3){Q(1,document.createTextNode(a3),a4.parentNode,l(a4));Q(2,a4)}})})();de.Typing={};(function(){L("Typing",function(){A(document,"keystroke",a1);h(de.Typing)},"MVC");function a1(bj,a8){var a2={cancel:false};de.Typing.fireEvent("Typing",a2,bj,a8);if(a2.cancel){return}if(de.events.Keyboard.isAcceleratorDown(bj)){switch(a8.toLowerCase()){case"z":de.UndoMan.undo();return false;case"y":de.UndoMan.redo();return false}}if(!de.selection.isRangeEditable()||!de.cursor.exists()){return}var a5=de.doc.getEditSectionContainer(de.cursor.getCurrentCursorDesc().domNode);if(de.events.Keyboard.isAcceleratorDown(bj)){switch(a8.toLowerCase()){case"b":a0("bold");return false;case"i":a0("italics");return false;case"u":a0("underline");return false;case"a":de.selection.selectAll(a5);return false}}else{if(!bj.ctrlKey&&!bj.metaKey&&!bj.altKey){var ba=a8;if(ba){if(ba.length>1){switch(ba){case"Space":ba=" ";break;case"Tab":if(aL(a5)||a5==H){var a3=j(de.cursor.getCurrentCursorDesc().domNode,H,aL,1);if(a3&&X(a3)=="li"){if(bj.shiftKey){de.UndoMan.execute("DemoteItem")}else{de.UndoMan.execute("PromoteItem")}}else{de.UndoMan.execute("Indent",!bj.shiftKey)}}return false;case"Delete":case"Backspace":if(de.selection.remove()){return false}else{var a7=de.cursor.getCurrentCursorDesc(),a4,bl;if(ba=="Backspace"){if(a7.isRightOf&&(a7.placement==(4|2))){a4=o(a7);a4.isRightOf=false}else{a4=de.cursor.getNextCursorMovement(a7,true)}bl=a7}else{a4=a7;if(!a7.isRightOf&&(a7.placement==(4|2))){bl=o(a7);bl.isRightOf=true}else{bl=de.cursor.getNextCursorMovement(a7,false)}}if(a4&&bl){var bb=de.doc.isNodeEditable(bl.domNode);if(bb&&bl.domNode!=a4.domNode){bb&=de.doc.isNodeEditable(a4.domNode)}if(bb){var bd;if(a4.domNode.nodeType==3){bd=a4.relIndex;if(a4.isRightOf){bd++}}else{if(X(a4.domNode)=="br"){var bh=0;I(w(a4.domNode,bl.domNode),a4.domNode,true,null,function(bm){if(X(bm)=="br"){bh++}return bm!=bl.domNode});bd=bh>1?1:0}else{bd=a4.isRightOf?1:0}}var bg;if(bl.domNode.nodeType==3){bg=bl.relIndex;if(bl.isRightOf){bg++}}else{if(X(bl.domNode)=="br"){var bh=0;I(w(a4.domNode,bl.domNode),a4.domNode,true,null,function(bm){if(X(bm)=="br"&&!(bm==a4.domNode&&bd==1)){bh++}return bm!=bl.domNode});bg=bh>1?0:1}else{bg=bl.isRightOf?1:0}}var bf=de.selection.getVirtualNodeIndex(a4.domNode,bd),a6=de.selection.getVirtualNodeIndex(bl.domNode,bg);if(bf.node==a6.node&&bf.node.nodeType==3){de.UndoMan.execute("RemoveText",bf.node,bf.index,a6.index-bf.index)}else{var be=w(bf.node,a6.node,true);if(de.doc.isEditSection(be)||de.doc.isNodeEditable(be)){de.UndoMan.execute("RemoveDOM",bf.node,bf.index,a6.node,a6.index)}}}}return false}case"Enter":de.selection.remove();var a7=de.cursor.getCurrentCursorDesc();var a9=a7.relIndex;if(a7.domNode.nodeType==3){a9+=(a7.isRightOf?1:0)}else{a9=a7.isRightOf?1:0}if(!de.doc.getEditProperties(a5).singleLine){if(bj.shiftKey){var bc="<br>";if(!(a7.domNode.nodeType==3&&a9<ah(a7.domNode))){bc+=aG(de.doc.createMNPlaceholder())}de.UndoMan.execute("InsertHTML",bc,a7.domNode.parentNode,a7.domNode,a9)}else{if(aL(a5)||a5==H){de.UndoMan.execute("SplitContainer",a7.domNode,a9)}}}return false;case"Home":case"End":var bk=ba=="Home",bi=de.cursor.getNearestCursorDesc(a5,bk?0:1,!bk,!bk);if(bi){de.cursor.setCursor(bi);de.cursor.scrollToCursor();return false}default:return true}}de.selection.remove();var a7=de.cursor.getCurrentCursorDesc();var a9=a7.relIndex;if(a7.domNode.nodeType==3&&a7.isRightOf){a9++}else{if(a7.domNode.nodeType==1){a9=a7.isRightOf?1:0}}de.UndoMan.execute("InsertText",a7.domNode,ba,a9);return false}}}}function a0(a2){return de.UndoMan.execute("Format",a2,!de.selection.getEditState([a2]).formatStates[a2])?true:false}})();(function(){var a0=aZ("dt,dd,caption,colgroup,col,thead,tfoot,tbody,legend,optgroup,option,area,frame");aI("TextAlign",{exec:function(a7,a3,a1){if(!a3){if(!this.selBefore){return}if(this.selBefore.endNode){a3=this.selBeforeOrdered.startNode;a1=this.selBeforeOrdered.endNode}else{a3=a1=this.selBefore.startNode}}var a5;var a2=w(a3,a1);for(var a6=0;a6<2;a6++){while(a2!=H&&!aL(a2)){a2=a2.parentNode}if(a2==H){break}if(X(a2)=="li"){a5=[a2];break}a2=a2.parentNode}if(!a5){a5=aQ(a3,a1)}for(var a4 in a5){R(a5[a4],a5[a4],true,function(a8){if(aL(a8)&&!a0[X(a8)]){Q(6,a8,"textAlign",a7)}})}this.selAfter=this.selBefore}})})();(function(){var a0=aZ("p,pre,h1,h2,h3,h4,h5,h6,li,address");aI("SplitContainer",{exec:function(a9,bd){var a3=j(a9.parentNode,H,aL,true)||H,bg,a4;if(!a0[X(a3)]){R(a3,a9,true,function(bi){if(aL(bi)){bg=bi}return bg==null});if(!bg||bg==a3){bg=a3;a4=1}else{if(bg==a9){bg=null}else{a4=0}}}else{bg=a3;a4=1}var a7;if(bg){a7=aa(a3,a9,bd,bg,a4);var bb=true;a7.visit(function(bi){if(!bi.isShared){bb=false}return bb});if(bb){a7=null}else{a7.disconnect()}}var a8,a2,a1;if(a0[X(a3)]){if(X(a3)!="li"&&a3!=H){var be=j(a3.parentNode,H,aL,true);if(be&&X(be)=="li"){a1=a3;a3=be}}a8=a3;a2=(a3.nodeName.charAt(0).toLowerCase()=="h"&&!a7)?N("p"):a3.cloneNode(false)}else{a2=N("p")}if(!a8){if(a7){var bf=a7.getStartFragment();if(a7.wasStartSplit()){a8=bf.getPreSplitNode()}else{if(bf.isShared){a8=bf.node}else{var bh=bf;while(!bh.isShared){bh=bh.parent}if(bh.node.firstChild){if(bh.children.length>0){if(bh.children[0].pos>0){a8=bh.node.childNodes[bh.children[0].pos-1]}else{Q(1,a2,bh.node,0);a8=null}}else{a8=bh.node.lastChild}}else{if(bh==a7){Q(1,a2,a3,0);a8=null}else{a8=bh.node}}}}}else{if(bd==0){Q(1,a2,a9.parentNode,l(a9));a8=null}else{a8=a9}}if(a8&&a8!=H&&!aL(a8)){while(a8!=H&&a8.parentNode!=H&&!aL(a8)&&!aL(a8.parentNode)){a8=a8.parentNode}}}if(a8){Q(1,a2,a8.parentNode,l(a8)+1)}if(a7){for(var ba in a7.children){var bc=a5(a7.children[ba]);if(bc){Q(1,bc,a2)}}}if(aF(a2)){Q(1,de.doc.createMNPlaceholder(),a2)}if(aF(a3)){Q(1,de.doc.createMNPlaceholder(),a3)}if(a1&&aF(a1)){Q(1,de.doc.createMNPlaceholder(),a1)}if(this.flags&2){var a6=de.cursor.getNearestCursorDesc(a2,0,false,false);if(a6){this.selAfter={startNode:a6.domNode,startIndex:a6.relIndex+(a6.domNode.nodeType==3&&a6.isRightOf?1:0)}}}function a5(bm){var bi;if(bm.isShared){var bl=true;bm.visit(function(bn){if(!bn.isShared){bl=false}return bl});if(bl){return null}bi=bm.node.cloneNode(false)}else{bi=bm.node;if(bi.parentNode&&bi.parentNode.nodeType!=11){Q(2,bi)}while(bi.firstChild){Q(2,bi.firstChild)}}for(var bj in bm.children){var bk=a5(bm.children[bj]);if(bk){Q(1,bk,bi)}}return bi}}})})();aI("RemoveText",{exec:function(a2,a5,a1){if(de.doc.isESPlaceHolder(a2,false)||de.doc.isMNPlaceHolder(a2,false)){if(this.flags&2){var a3=de.cursor.getCurrentCursorDesc();if(a3){this.selAfter={startNode:a3.domNode,startIndex:a3.relIndex+(a3.domNode.nodeType==3&&a3.isRightOf?1:0)}}}return}var a8,a7;if(a5==0){R(H,a2,false,function(ba){if(ba==a2){return}var a9=w(a2,ba);if(j(ba,a9,aL,true)){return false}if(ba.nodeType==3&&ah(ba)>0){if(M(ba.nodeValue.charAt(ah(ba)-1))){a8=a9;return false}}})}else{if(M(a2.nodeValue.charAt(a5-1))){a8=a2}}if((a5+a1)==ah(a2)){R(H,a2,true,function(ba){if(ba==a2){return}var a9=w(a2,ba);if(aL(ba)||j(a2,a9,aL,true)){return false}if(ah(ba,0)>0){if(M(ba.nodeValue.charAt(0))){a7=a9;return false}}})}else{if(M(a2.nodeValue.charAt(a5+a1))){a7=a2}}var a6=(a8&&a7&&a8!=a7)?w(a8,a7,true):a8||a7;if(a6){Y(a6)}Q(5,a2,a5,a1);if(a6){s(a6)}var a4,a0=de.doc.getEditSectionContainer(a2);if(a0&&aA(a0)){a4=de.doc.createESPlaceholder(a0)}else{a0=j(a2,H,aL,true)||H;if(aF(a0)){a4=de.doc.createMNPlaceholder()}}if(a4){Q(1,a4,a0)}if(this.flags&2){var a3=a4?de.cursor.createCursorDesc(a4,0,false):de.cursor.getNearestCursorDesc(a2,a5==0?0:a5-1,a5>0,false);if(a3){this.selAfter={startNode:a3.domNode,startIndex:a3.relIndex+(a3.domNode.nodeType==3&&a3.isRightOf?1:0)}}}if(ah(a2)==0){Q(2,a2)}}});aI("RemoveDOM",{exec:function(a0,a8,a5,a4){var a7=aa(w(a0,a5,false),a0,a8,a5,a4);Y(a7.node);var a1=a7.collapse();s(a7.node);if(this.flags&2){var a3;if(a1){a3=de.cursor.getNearestCursorDesc(a1,0,false,true)}else{var a6=a7.getStartFragment();while(a6.node!=H&&!aK(H,a6.node)){a6=a6.parent}var a2=a6.node;if(a6.children.length>0&&a2.childNodes.length>0&&a6.children[0].pos<=a2.childNodes.length){if(a6.children[0].pos==0){a3=de.cursor.getNearestCursorDesc(a2.firstChild,0,false,false)}else{var a9=a2.childNodes[a6.children[0].pos-1];a3=de.cursor.getNearestCursorDesc(a9,ah(a9,2)-1,true,false)}}else{a3=de.cursor.getNearestCursorDesc(a6.node,ah(a6.node,2)-1,true,true)}}if(a3){this.selAfter={startNode:a3.domNode,startIndex:a3.relIndex+(a3.domNode.nodeType==3&&a3.isRightOf?1:0)}}}}});aI("RemoveNode",{exec:function(a0){Q(2,a0)}});aI("PromoteItem",{exec:function(a4,a1){var a6=this;if(!a4){if(!a6.selBefore){return}if(a6.selBefore.endNode){a4=a6.selBeforeOrdered.startNode;a1=a6.selBeforeOrdered.endNode}else{a4=a1=a6.selBefore.startNode}}var a2=j(w(a4,a1,1),H,function(a8){var a9=X(a8);return a9=="li"||a9=="ol"||a9=="ul"},1);if(a2){var a7=[];if(X(a2)=="li"){a7.push(a2)}else{R(a2,a4,true,function(a8){if(X(a8)=="li"){a7.push(a8)}return a8!=a1});var a0=j(a4,a2,function(a8){return X(a8)=="li"},1);if(a0){a7.push(a0)}}for(var a5 in a7){a3(a7[a5])}}a6.selAfter=a6.selBefore;function a3(a9){var bc=a9.previousSibling,ba=a9.nextSibling;while(bc&&bc.nodeType==3){bc=bc.previousSibling}while(ba&&ba.nodeType==3){ba=ba.nextSibling}var a8;if(bc&&(X(bc)=="ol"||X(bc)=="ul")){a8=bc}else{a8=a9.parentNode.cloneNode(false);Q(1,a8,a9.parentNode,l(a9))}Q(2,a9);Q(1,a9,a8);if(ba&&X(ba)==X(a8)){Q(2,ba);while(ba.firstChild){var bb=ba.firstChild;Q(2,bb);Q(1,bb,a8)}}}}});(function(){aI("ModifyTable",{exec:function(be,ba,bf){var bl=null,bi=[];R(w(ba,bf),ba,true,function(bm){if(!bl){bl=j(bm,H,function(bn){return(X(bn)=="table")},true)}bi.push(bm);return bm!=bf});if(bl){var bb={start:null,end:null};for(var bg=0;bg<bl.rows.length;bg++){var bk=bl.rows[bg];for(var bh=0;bh<bk.cells.length;bh++){var bj=bk.cells[bh];for(var bc in bi){if(bi[bc]==bj||aK(bj,bi[bc])){if(!bb.start){bb.start=[parseInt(bg),parseInt(bh),bj]}bb.end=[parseInt(bg),parseInt(bh),bj];break}}}}if(bb.start){be=be.toLowerCase().split("-");switch(be[0]){case"insert":if(be.length==4){var bd=parseInt(be[3]);if(isNaN(bd)){aj(1)}if(be[1]=="rows"){a0(bl,bb,be[2]=="before",bd)}else{if(be[1]=="cols"){a7(bl,bb,be[2]=="before",bd)}else{aj(1)}}}else{aj(1)}break;case"delete":if(be.length!=2){aj(1)}switch(be[1]){case"table":a3(bl);break;case"rows":a1(bl,bb);break;case"cols":a9(bl,bb);break;default:aj(1)}break;case"merge":break;case"split":break;default:aj(1)}}}}});function a8(bc,ba){var bb=Q(9,bc,ba);de.UndoMan.execute(4,"InsertHTML","<p>"+aG(de.doc.createMNPlaceholder())+"</p>",bb)}function a0(bj,bg,bb,bd){var be;if(bb){be=bg.start[0]}else{be=bg.end[0]+1;var bh=bg.end[2].getAttribute("rowspan");if(bh){be+=(parseInt(bh)-1)}}if(be>bj.rows.length){be=bj.rows.length}var bf=a5(bj);for(var bc=0;bc<bd;bc++){var bi=Q(8,bj,be);for(var ba=0;ba<bf;ba++){a8(bi,0)}}}function a6(bd,bb){var ba;if(bb){ba=Math.min(bd.start[1],bd.end[1])}else{var bf=bd.start[1],be=bd.end[1];var bc=bd.start[2].getAttribute("colspan");if(bc){bf+=(parseInt(bc)-1)}bc=bd.end[2].getAttribute("colspan");if(bc){be+=(parseInt(bc)-1)}ba=Math.max(bf,be)}return ba}function a5(ba){var bb=0;for(var bc=0;bc<ba.rows.length;bc++){bb=Math.max(bb,ba.rows[bc].cells.length)}return bb}function a7(bk,bh,bc,be){var bj=a6(bh,bc);if(!bc){bj++}for(var bd=0;bd<be;bd++){for(var bf=0;bf<bk.rows.length;bf++){var bm=bk.rows[bf];var ba=-1,bl=bj;for(var bg=0;bg<bm.cells.length;bg++){var bi=bm.cells[bg];ba++;var bb=bi.getAttribute("colspan");if(bb){ba+=(parseInt(bb)-1)}if(ba>=bj){bl=parseInt(bg);break}}a8(bm,bl)}}}function a3(ba){Q(2,ba)}function a1(bc,bb){if(bb.start[0]==0&&bb.end[0]>=(bc.rows.length-1)){a3(bc)}else{for(var ba=0;ba<=(bb.end[0]-bb.start[0]);ba++){Q(10,bc,bb.start[0])}}}function a9(bl,bj){var bd=a6(bj,true),bg=a6(bj,false),bf=a5(bl);if(bd==0&&bg>=(bf-1)){a3(bl)}else{for(var be=0;be<=(bg-bd);be++){for(var bh=0;bh<bl.rows.length;bh++){var bm=bl.rows[bh];var ba=-1,bb=bd;for(var bi=0;bi<bm.cells.length;bi++){var bk=bm.cells[bi];ba++;var bc=bk.getAttribute("colspan");if(bc){ba+=(parseInt(bc)-1)}if(ba>=bd){bb=parseInt(bi);break}}Q(11,bm,bb)}}}}function a4(bb,ba){}function a2(bd){for(var ba in bd){var bc=bd[ba];if(X(bc)=="td"||X(bc)=="th"){var bb=bc.getAttribute("colspan");if(bb){Q(_Operation.SET_ATTRIBUTE,bc,"colspan","")}var bb=bc.getAttribute("rowspan");if(bb){Q(_Operation.SET_ATTRIBUTE,bc,"rowspan","")}}}}})();(function(){var a0=aZ("p, div");aI("Itemize",{exec:function(a3,a4,a1){if(!a4){if(!this.selBefore){return}if(this.selBefore.endNode){a4=this.selBeforeOrdered.startNode;a1=this.selBeforeOrdered.endNode}else{a4=a1=this.selBefore.startNode}}(function a2(br,bk,bD,bA){var bi=j(w(br,bk,true),H,aL,true)||H,bJ,bo;var bE=br,bB=bk;while(bE.firstChild){bE=bE.firstChild}while(bB.lastChild){bB=bB.lastChild}if(y(bi)&&X(bi)!="td"&&X(bi)!="th"){var a5=[];R(bi,bi,true,function(bK){if(bK.nodeType==1&&(X(bK)=="td"||X(bK)=="th")){a5.push(bK);return(bK!=bB&&!aK(bK,bB))}return bK!=bB});var bn=true,bh=[];for(var bH in a5){var bv=bj(a5[bH],a5[bH]);if(bv){bn&=bv.allListEles;bh.push(bv.nrange)}else{bh.push(0)}}for(var bH in a5){if(bh[bH]){a2(a5[bH],a5[bH],bn,bh[bH])}}return}if(X(bi)=="ul"||X(bi)=="ol"){bi=bi.parentNode}var bx=bi;for(var a8=0;a8<2&&bx;a8++){if(X(bx)=="li"){if((bA&&bD)||(!bA&&((a3&&X(bx.parentNode)=="ul")||(!a3&&X(bx.parentNode)=="ol")))){bJ=[bx]}else{bo=[bx];bi=bx.parentNode}break}bx=j(bx.parentNode,H,aL,true)}if(!bA&&!bJ&&!bo){var bv=bj(br,bk);if(bv){bA=bv.nrange;if(bv.allListEles){bJ=bA}else{bo=bA}}else{return}}else{if(bA){if(bD){bJ=bA}else{bo=bA}}}if(bJ){for(var bH in bJ){var by=bJ[bH];var ba=X(by);if(ba=="li"){a9(by,true)}else{if(ba=="ul"||ba=="ol"){var bw=aK(by,br)?j(br,by):by.firstChild,bl=aK(by,bk)?j(bk,by):by.lastChild;while(bw){var bb=bw;bw=bw==bl?null:bw.nextSibling;if(X(bb)=="li"){a9(bb,true)}}}}}}else{var bu;for(var bH in bo){var by=bo[bH];var bg=by==bi?by:j(by,bi),ba=X(by);if(ba=="li"){if(bH=="0"){bu=a9(by,false)}else{var bp=by.parentNode;Q(2,by);Q(1,by,bu);var a7=bp.firstChild;while(a7&&X(a7)!="li"){a7=a7.nextSibling}if(!a7){Q(2,bp)}}}else{if(bH=="0"){bu=N(a3?"ul":"ol");if(ba=="ul"||ba=="ol"){var a6=false;var bq=by.firstChild;while(bq&&X(bq)!="li"){a6|=(bq==br);bq=bq.nextSibling}if(bq){a6|=aK(bq,br)}Q(1,bu,bg.parentNode,l(bg)+(a6?0:1))}else{Q(1,bu,bg.parentNode,l(bg)+1)}}if(ba=="ul"||ba=="ol"){var be=aK(by,br)?j(br,by):by.firstChild,bC=aK(by,bk)?j(bk,by):by.lastChild;while(be){var bs=X(be)=="li"?be:null;be=be==bC?null:be.nextSibling;if(bs){Q(2,bs);Q(1,bs,bu);if(bg!=by){var bm=bs.firstChild;while(bm){if(bm.nodeType!=1&&bm.nodeType!=3){continue}var bG=by.parentNode,bf=[];while(bG){bf.push(bG.cloneNode(false));bG=bG==bg?null:bG.parentNode}for(var bF=bf.length-1;bF>0;bF--){bf[bF].appendChild(bf[bF-1])}Q(1,bf[bf.length-1],bs,l(bm));Q(2,bm);Q(1,bm,bf[0]);bm=bf[bf.length-1].nextSibling}}}}var bt=true;be=by.firstChild;while(be){if(X(be)=="li"){bt=false;break}be=be.nextSibling}if(bt){Q(2,bg)}}else{var bz=N("li");Q(1,bz,bu);Q(2,bg);Q(1,bg,bz);if(a0[ba]){var bc=by.parentNode;Q(2,by);while(by.firstChild){var bI=by.firstChild;Q(2,bI);Q(1,bI,bc)}}}}}}function a9(bO,bT){var bL=bO.previousSibling,bP=false,bQ=false,bU=bO.parentNode,bK=false,bN=null;while(!bP&&bL){bP|=X(bL)=="li";bL=bL.previousSibling}bL=bO.nextSibling;while(!bQ&&bL){bQ|=X(bL)=="li";bL=bL.nextSibling}if(bP){bU=bd(bU,bO,!bT,true);bK=true}if(bT){if(X(bU.parentNode)!="li"){aQ(bO,bO)}while(bO.firstChild){var bS=bO.firstChild;Q(2,bS);Q(1,bS,bU.parentNode,l(bU))}Q(2,bO)}else{if(bK){if(bQ){var bM=bO.nextSibling;while(X(bM)!="li"){bM=bM.nextSibling}bd(bU,bM,true,true)}bN=bU}else{bN=bd(bU,bO,true,false)}}bL=bU.firstChild;while(bL&&X(bL)!="li"){bL=bL.nextSibling}if(!bL){var bR=bU;while(bR.parentNode.childNodes.length==1&&!de.doc.isEditSection(bR.parentNode)&&bR.parentNode!=H){bR=bR.parentNode}Q(2,bR)}return bN}function bd(bM,bP,bL,bN){var bK=bL?N(X(bM)=="ol"?"ul":"ol"):bM.cloneNode(false);if(bN){while(bP){var bO=bP;bP=bP.nextSibling;Q(2,bO);Q(1,bO,bK)}Q(1,bK,bM.parentNode,l(bM)+1)}else{while(bP){var bO=bP;bP=bP.previousSibling;Q(2,bO);Q(1,bO,bK,0)}Q(1,bK,bM.parentNode,l(bM))}return bK}function bj(bP,bK){var bL=aQ(bP,bK);if(bL.length==0){return null}var bO=true;for(var bN in bL){var bM=X(bL[bN]);if(bM=="li"){bM=X(bL[bN].parentNode)}if((a3&&bM!="ul")||(!a3&&bM!="ol")){bO=false;break}}return{allListEles:bO,nrange:bL}}})(a4,a1);this.selAfter=this.selBefore}})})();aI("InsertText",{exec:function(a1,a4,a0){a4=a(aT(a4));var a2;if(de.doc.isESPlaceHolder(a1,false)||de.doc.isMNPlaceHolder(a1,false)){a2=a1;while(!(de.doc.isESPlaceHolder(a2,true)||de.doc.isMNPlaceHolder(a2,true))){a2=a2.parentNode}a1=a2}if(a1.nodeType==3){Q(4,a1,a4,a0);if(this.flags&2){this.selAfter={startNode:a1,startIndex:a0+a4.length}}}else{var a3=document.createTextNode(a4);Q(1,a3,a1.parentNode,l(a1)+(a0==0?0:1));if(a2){Q(2,a2)}if(this.flags&2){this.selAfter={startNode:a3,startIndex:a0+ah(a3)}}}if(a4.indexOf(B)!=-1){s(a1.parentNode)}}});aI("InsertHTML",{exec:function(a7,a8,bb,ba){var a5=[];var a1=a8==H?N("div"):a8.cloneNode(false);a1.innerHTML=a7;var bd=a1.firstChild;while(bd){a5.push(bd);bd=bd.nextSibling}for(var a6=0;a6<a5.length;a6++){a1.removeChild(a5[a6]);var be=0;if(a5[a6].nodeType==3){be=N("span");be.appendChild(a5[a6])}var a9=document.createTextNode("X");a8.appendChild(a9);a8.appendChild(be?be:a5[a6]);c=false;m(a5[a6],false);c=true;if(be){a5.splice(a6,1);if(!be.firstChild){a6--}else{var a0;while(a0=be.firstChild){be.removeChild(a0);a5.splice(a6,0,a0);a6++}a6--}a8.removeChild(be)}else{a8.removeChild(a5[a6])}a8.removeChild(a9)}var a4;if(de.doc.isESPlaceHolder(a8,false)||de.doc.isMNPlaceHolder(a8,false)){a4=a8}else{if(bb&&(de.doc.isESPlaceHolder(bb,false)||de.doc.isMNPlaceHolder(bb,false))){a4=bb}}if(a4){while(a4.parentNode&&(de.doc.isESPlaceHolder(a4.parentNode,false)||de.doc.isMNPlaceHolder(a4.parentNode,false))){a4=a4.parentNode}targetNode=a4;a8=a4.parentNode;bb=a4}var bc;if(bb&&bb.nodeType==3&&ba>0&&ba<ah(bb)){var bf=Q(3,bb,ba);if(M(bf.nodeValue.charAt(0))||M(bb.nodeValue.charAt(ba-1))){bc=bb.parentNode;Y(bc)}}var a2;if(!bb){a2=null}else{if(ba==0){a2=bb.previousSibling}else{a2=bb}}for(var a6 in a5){if(!a2){Q(1,a5[a6],a8,a8.firstChild?l(a8.firstChild):null)}else{Q(1,a5[a6],a8,l(a2)+1)}a2=a5[a6]}if(bc){m(bc)}if(bb&&(de.doc.isMNPlaceHolder(bb)||de.doc.isESPlaceHolder(bb))){Q(2,bb)}if(this.flags&2){var a3=de.cursor.getNearestCursorDesc(a5[a5.length-1],ah(a5[a5.length-1],2)-1,true,X(a5[a5.length-1])!="br");if(a3){this.selAfter={startNode:a3.domNode,startIndex:a3.relIndex+(a3.domNode.nodeType==3&&a3.isRightOf?1:0)}}}}});(function(){var a1=20,a0=aZ("dt,dd,caption,colgroup,col,thead,tfoot,tbody,tr,td,th,legend,optgroup,option,area,frame");aI("Indent",{exec:function(ba,a5,a9){if(!a5){if(!this.selBefore){return}if(this.selBefore.endNode){a5=this.selBeforeOrdered.startNode;a9=this.selBeforeOrdered.endNode}else{a5=a9=this.selBefore.startNode}}var a6;var a7=w(a5,a9);for(var a3=0;a3<2;a3++){while(a7!=H&&!aL(a7)){a7=a7.parentNode}if(a7==H){break}if(X(a7)=="li"){a6=[a7];break}a7=a7.parentNode}if(!a6){a6=aQ(a5,a9)}for(var a8 in a6){if(!a0[X(a6[a8])]){var a4=a6[a8];var a2=(a4.style.marginLeft&&a4.style.marginLeft.toLowerCase()!="auto")?a4.style.marginLeft:null;if(!a2){a2=aD(a4,"margin-left")}a2=(a2&&a2.toLowerCase()!="auto")?a2:"0";var bc;if(a2.indexOf("%")!=-1){bc=a4.offsetLeft}else{bc=parseInt(a2)}var bb=bc+((ba?1:-1)*a1);if(bb<0){bb=0}if(bc!=bb){Q(6,a4,"marginLeft",bb+"px")}}}this.selAfter=this.selBefore}})})();aI("Format",{exec:function(bb,bd,a6){bb=bb.toLowerCase();if(typeof q[bb+"Wrapper"]=="undefined"){return}var a7=bd?false:true,a1=false,a9=true,a0;if(!a6){if(!this.selBefore){return}a6=o(this.selBeforeOrdered);a0=o(a6);a9=this.selBefore.inOrder}else{a0=o(a6)}if(!a0.endNode){var a5=null;if(bb=="link"){var a8=a0.startNode;while(a8&&de.doc.isNodeEditable(a8)){if(a8.nodeType==1&&X(a8)=="a"){a5={startNode:a8,startIndex:0,endNode:a8,endIndex:1};break}a8=a8.parentNode}}a0=a5?a5:de.selection.getWordRangeAt(a0.startNode,a0.startIndex>=ah(a0.startNode)?ah(a0.startNode)-1:a0.startIndex);if(!a0){return}a1=a9=true}var bc=ba(a0.startNode,a0.startIndex,a0.endNode,a0.endIndex,q[bb+"Wrapper"](bd||""),a7,q[bb+"Eval"]);if(this.flags&2){if(a1){var a3=bc.getAdjustedNodeIndex(a6.startNode,a6.startIndex);this.selAfter={startNode:a3.node,startIndex:a3.index}}else{var bf=bc.getStartFragment(),a2=bc.getEndFragment();var be=0,a4=ah(a2.node,1);this.selAfter={startNode:a9?bf.node:a2.node,startIndex:a9?be:a4,endNode:a9?a2.node:bf.node,endIndex:a9?a4:be}}}function ba(bx,bk,bq,bi,bn,br,bg){var bv=arguments.length>7,bj=bk==ah(bx,1),bl=bi==0;var bp=aa(w(bx,bq,false),bx,bk,bq,bi);var bm=bp.getStartFragment(),by=bp.getEndFragment(),bw=bp.node;if(bj){bh(bm)}if(bl){bh(by)}function bh(bz){do{bz.dontFormat=1;bz=bz.parent}while(bz&&bz.children.length==1)}bp.visit(function(bz){if(!bz.dontFormat){bs(bz.node)}});if(!bv){var bu=bw;while(bu){bs(bu);if(bu==H){break}bu=bu.parentNode}}if(!br){bx=bm.node;bq=by.node;var bo=aa(bw,bx,bj?ah(bx,1):0,bq,bl?0:ah(bq,1));if(bj){bh(bo.getStartFragment())}if(bl){bh(bo.getEndFragment())}(function bt(bE){var bD=[];for(var bA in bE.children){var bC=bE.children[bA];if(bz(bC)){bD.push(bC.node)}else{bB();bt(bC)}}bB();function bB(){if(bD.length>0){var bH=bn.cloneNode(false);Q(1,bH,bE.node,l(bD[0]));for(var bF in bD){var bG=bD[bF];Q(2,bG);Q(1,bG,bH)}bD=[]}}function bz(bI){if(bI.dontFormat){return false}var bG=true;R(bI.node,bI.node,true,function(bJ){bG=!aL(bJ);return bG});if(bG){var bH=true;(function bF(bL,bK){if(bL.dontFormat){bH=false;return}if(bK.firstChild){bH=bK.childNodes.length==bL.children.length;if(bH){for(var bJ=0;bJ<bK.childNodes.length;bJ++){bF(bL.children[bJ],bK.childNodes[bJ]);if(!bH){break}}}}else{bH=bL.children.length==0}})(bI,bI.node);return bH}return false}})(bo)}return bp;function bs(bA){if(bA.nodeType==1){var bB=false,bI=bg(bA);if(bI){for(var bE in bI.strip){switch(bI.strip[bE].type){case 1:bB=true;break;case 2:var bK=au(bA);if(bK){var bJ=bK.split(" ");for(var bC in bJ){if(bJ[bC]==bI.strip[bE].match){bJ.splice(bC,1);break}}bK=bK.length>0?bJ.join(" "):"";Q(7,bA,bK)}break;case 3:Q(6,bA,bI.strip[bE].match,"");break}if(bB){break}}var bF=bA.firstChild;while(bF.firstChild){bF=bF.firstChild}var bz=bA.lastChild;while(bz.lastChild){bz=bz.lastChild}if(!bB&&X(bA)=="span"){bB=!au(bA);if(!bB){bB=r(bA)}}if(bB){var bH=[];while(bA.firstChild){var bD=bA.firstChild;Q(2,bD);Q(1,bD,bA.parentNode,l(bH.length>0?bH[bH.length-1]:bA)+1);bH.push(bD)}if(bH.length>0){if(bA==bw){bw=bA.parentNode}Q(2,bA)}}if(!bv){var bG=false;bp.visit(function(bL){bG=(!bL.dontFormat&&bL.node==bF);return !bG});if(!bG){ba(bF,0,bm.node,bj?ah(bm.node,1):0,bI.inline,false,bg,true)}bG=false;bp.visit(function(bL){bG=(!bL.dontFormat&&bL.node==bz);return !bG});if(!bG){ba(by.node,bl?0:ah(by.node,1),bz,ah(bz,1),bI.inline,false,bg,true)}}}}}}}});aI("DemoteItem",{exec:function(a4,a1){var a6=this;if(!a4){if(!a6.selBefore){return}if(a6.selBefore.endNode){a4=a6.selBeforeOrdered.startNode;a1=a6.selBeforeOrdered.endNode}else{a4=a1=a6.selBefore.startNode}}var a3=j(w(a4,a1,1),H,function(a8){var a9=X(a8);return a9=="li"||a9=="ol"||a9=="ul"},1);if(a3){var a7=[];if(X(a3)=="li"){a7.push(a3)}else{R(a3,a4,true,function(a8){if(X(a8)=="li"){a7.push(a8)}return a8!=a1});var a0=j(a4,a3,function(a8){return X(a8)=="li"},1);if(a0){a7.push(a0)}}for(var a5 in a7){a2(a7[a5])}}a6.selAfter=a6.selBefore;function a2(a9){var bb=a9.parentNode.parentNode;if(X(bb)=="ul"||X(bb)=="ol"){var ba=a9.nextSibling,be=a9.previousSibling;while(be&&be.nodeType==3){be=be.previousSibling}while(ba&&ba.nodeType==3){ba=ba.nextSibling}var a8;if(ba&&be){var bc=a9.parentNode.cloneNode(false);Q(1,bc,bb,l(a9.parentNode)+1);while(ba){var bd=ba;ba=ba.nextSibling;Q(2,bd);Q(1,bd,bc)}a8=l(bc)}else{if(ba){a8=l(a9.parentNode)}else{if(be){a8=l(a9.parentNode)+1}else{a8=l(a9.parentNode);Q(2,a9.parentNode)}}}Q(2,a9);Q(1,a9,bb,a8)}}}});(function(){aI("CreateTable",{exec:function(a1,a3,a4,a2,a6,a5){var a0="<table></table>"}})})();(function(){var a0=aZ("p,pre,h1,h2,h3,h4,h5,h6,address");aI("ChangeContainer",{exec:function(bb,a3,a9){if(!bb){bb="p"}bb=bb.toLowerCase();if(!a3){if(!this.selBefore){return}if(this.selBefore.endNode){a3=this.selBeforeOrdered.startNode;a9=this.selBeforeOrdered.endNode}else{a3=a9=this.selBefore.startNode}}var a4=aQ(a3,a9);for(var a8 in a4){var a2=a4[a8];if(X(a2)!=bb&&a0[X(a2)]){var a6=[],a7,bc=a2.parentNode,ba=l(a2);while(a7=a2.firstChild){a6.push(a7);Q(2,a7)}Q(2,a2);var a1=N(bb);Q(1,a1,bc,ba);for(var a5 in a6){Q(1,a6[a5],a1)}}}this.selAfter=this.selBefore}})})();aI("Blockquote",{exec:function(a2,a7){if(!a2){if(!this.selBefore){return}if(this.selBefore.endNode){a2=this.selBeforeOrdered.startNode;a7=this.selBeforeOrdered.endNode}else{a2=a7=this.selBefore.startNode}}var a9=null,a4=w(a2,a7,true);if(a0(a4)){a9=a4}else{R(a4,a2,true,function(ba){if(a0(ba)){a9=ba}return a9==null&&ba!=a7})}if(!a9){a9=j(a4,H,a0,true)||j(a2,a4,a0,true);if(!de.doc.isNodeEditable(a9)){a9=null}}if(a9){while(a9.firstChild){var a5=a9.firstChild;Q(2,a5);Q(1,a5,a9.parentNode,l(a9))}Q(2,a9)}else{var a3=aQ(a2,a7);var a8=N("blockquote");if(a3.length>0&&n(a8,a3[0].parentNode)){Q(1,a8,a3[0].parentNode,l(a3[0]));for(var a6 in a3){var a1=a3[a6];Q(2,a1);Q(1,a1,a8)}}}this.selAfter=this.selBefore;function a0(ba){return X(ba)=="blockquote"}}});var z={GB:"address,blockquote,center,del,div,h1,h2,h3,h4,h5,h6,hr,ins,isindex,noscript,p,pre",SI:"a,applet,basefont,bdo,br,font,iframe,img,map,area,object,param,q,script,span,sub,sup",PH:"abbr,acronym,cite,code,del,dfn,em,ins,kbd,samp,strong,var",F:"b,big,i,s,small,strike,tt,u",TE:"table,caption,colgroup,col,thead,tfoot,tbody,tr,td,th",NT:"table,textarea,tr,thead,tbody,tfoot,dl,ul,ol,menu,select,optgroup,option,script,style"};for(var aq in z){z[aq]=aZ(z[aq])}D(z,{B:D(aZ("dir,dl,fieldset,form,menu,noframes,ol,table,ul,dd,dt,frameset,li,tbody,td,tfoot,thead,th,tr"),z.GB),I:D(D(aZ("abbr,acronym,cite,code,dfn,em,kbd,samp,strong,var"),z.F),z.SI)});var F=function(){function a1(a5,a3){var a2=a3.split(","),a6=o(a5);for(var a4 in a2){delete a6[a2[a4]]}return a6}var a0=D(o(z.B),z.I);return{body:D(aZ("script,ins,del"),a0),address:D(aZ("p"),a0),blockquote:a0,centre:a0,del:a0,h1:z.I,h2:z.I,h3:z.I,h4:z.I,h5:z.I,h6:z.I,hr:{},ins:a0,isindex:{},noscript:a0,p:z.I,pre:a1(z.I,"img,object,applet,big,small,sub,sup,font,basefont"),dir:aZ("li"),dl:aZ("dd,dt"),dt:z.I,dd:a0,li:a0,menu:aZ("li"),ol:aZ("li"),ul:aZ("li"),table:aZ("caption,col,colgroup,thead,tfoot,tbody"),caption:z.I,colgroup:aZ("col"),col:{},thead:aZ("tr"),tfoot:aZ("tr"),tbody:aZ("tr"),tr:aZ("td,th"),td:a0,th:a0,form:a1(a0,"form"),button:a1(a0,"a,input,select,textarea,label,button,iframe,form,isindex,fieldset"),fieldset:D(aZ("legend"),a0),legend:z.I,input:{},label:a1(z.I,"label"),select:aZ("optgroup,option"),optgroup:aZ("option"),option:{},textarea:{},a:a1(z.I,"a"),applet:D(aZ("param"),a0),basefont:{},bdo:z.I,br:{},font:z.I,iframe:a0,img:{},map:D(aZ("area"),z.B),area:{},object:D(aZ("param"),a0),param:{},q:z.I,script:{},span:z.I,sub:z.I,sup:z.I,abbr:z.I,acroynm:z.I,cite:z.I,code:z.I,dfn:z.I,em:z.I,kbd:z.I,samp:z.I,strong:z.I,"var":z.I,b:z.I,big:z.I,i:z.I,s:z.I,small:z.I,strike:z.I,tt:z.I,u:z.I}}();function aC(a1,a0){if(a1.nodeType==1){return z[a0][X(a1)]?true:false}return false}function n(a2,a0){if(a2.nodeType==3){return true}var a1=F[X(a0)];if(a1){return a1[X(a2)]}return true}function aL(a0){return aC(a0,"B")}function S(a0){return aC(a0,"GB")}function ae(a0){return aC(a0,"I")}function g(a0){return aC(a0,"SI")}function O(a0){return aC(a0,"PH")}function aE(a0){return aC(a0,"F")}function y(a0){return aC(a0,"TE")}function M(a0){return/^[\t\n\r ]+$/.test(a0)}function aH(a0){return !aC(a0.parentNode,"NT")}var B=a("&nbsp;");D(de,{isBlock:aL});var b,C,aS,aR;(function(){var a3=1,a2,a1;L("viewport",function(){A(window,"resize",function(){a3=1})});de.getViewPortSize=_getViewPortSize=function(a4){if(a3||a4){a0()}return{width:a2,height:a1}};function a0(){if(E==3&&G<7){a2=document.documentElement.clientWidth;a1=document.documentElement.clientHeight}else{var a4=N("div");ao(a4,"position:fixed;top:0;left:0;width:100%;height:100%;border-style:none;margin:0");H.appendChild(a4);a2=a4.offsetWidth;a1=a4.offsetHeight;H.removeChild(a4)}a3=0}})();de.getDocumentScrollPos=aR=function(){var a1=0,a0=0;if(H.scrollLeft||H.scrollTop){a1=H.scrollLeft;a0=H.scrollTop}else{if(window.pageYOffset||window.pageXOffset){a1=window.pageXOffset;a0=window.pageYOffset}else{if(document.documentElement.scrollLeft||document.documentElement.scrollTop){a1=document.documentElement.scrollLeft;a0=document.documentElement.scrollTop}}}return{top:a0,left:a1}};function aN(){var a1=0,a0=0;if(window.innerWidth||window.innerHeight){a1=window.innerWidth;a0=window.innerHeight}else{if(document.documentElement.offsetWidth||document.documentElement.offsetWidth){a1=document.documentElement.offsetWidth;a0=document.documentElement.offsetHeight}else{if(H.offsetWidth||H.offsetWidth){a1=H.offsetWidth;a0=H.offsetWidth}}}return{width:a1,height:a0}}var m,s,Y;(function(){var a0=aZ("button,img,iframe,map,object"),a3=aZ("br,button,img,iframe,map,object,select,textarea,applet");Y=function(a5){ar(a5,a5,true,function(a6){if(aH(a6)&&a1(a6)=="normal"){a6.nodeValue=a6.nodeValue.replace(/[\t\n\r ]/g,B)}})};m=function(a8,bg){var bd;ar(a8,a8,true,function(bn){if(aH(bn)&&ah(bn)>0){bd=bn;return false}});if(!bd){return}var a7=a8;var bk=false;if(bg&&M(bd.nodeValue.charAt(0))){R(null,bd,false,function(bn){if(bn==bd){return}if(bn.nodeType==3){if(!aH(bn)){return false}a7=bn;if(!M(bn.nodeValue)){bk=true;return false}}else{if(!ae(bn)){return false}}})}var bi=aK(a8,a7),a5=0;while(a7){var be=a2(a7,a5,bk,a8,bi,false,false,bg);bk=false;bi=be.seenTargetNode;a7=be.resumeNode;a5=be.resumeIndex;if(be.startNode&&a1(be.startNode)!="pre"){if(a4(be.startNode,be.startIndex,be.endNode,be.endIndex)){if(be.startNode==be.endNode&&be.startIndex==(be.endIndex-1)){be.startNode=null}else{be.startIndex++}}if(be.startNode){var bc=aa(w(be.startNode,be.endNode,false),be.startNode,be.startIndex,be.endNode,be.endIndex);bc.disconnect();var a9=a7==a8;if(a7){var ba=bc.getStartFragment(),bm=bc.getEndFragment(),bj=false,bb=bc.wasStartSplit(),bh=bc.wasEndSplit();if(a7==be.startNode&&bb){if(a5>=ah(be.startNode)){var bl=ah(ba.node);if(a5<(ah(be.startNode)+bl)){a5=ah(be.startNode)-1}else{if(a7==be.endNode&&bh){a7=bm.getPostSplitNode();a5-=(ah(be.startNode)+bl)}else{assert(false)}}}bj=true}else{if(a7==be.endNode&&bh){var bl=ah(bm.node);if(a5>=bl){a7=bm.getPostSplitNode();a5-=bl;bj=true}else{a7=null}}}if(!bj){var bf;if(a7){bf=false;bc.visit(function(bn){if(!bn.isShared&&bn.node==a7){bf=true;return false}})}else{bf=true}if(bf){var a6=ba;while(!a6.isShared){a6=a6.parent}a7=a6.node;a5=a6==ba?ah(a7,1):0;if(a7.childNodes.length>0&&a6.children.length>0&&a6.children[0].pos>0){a7=a7.childNodes[a6.children[0].pos-1];a5=ah(a7,1)}}}if(a7&&a9){a8=a7}}}}}};s=function(bc){var a6=bc,bd=0;while(a6){var be=a2(a6,bd,false,bc,true,true,true,true);a6=be.resumeNode;bd=be.resumeIndex;if(be.startNode){var a8=a4(be.startNode,be.startIndex,be.endNode,be.endIndex),bb=[];ar(w(be.startNode,be.endNode,false),be.startNode,true,function(bf){bb.push(bf);if(bf==be.endNode){return false}});for(var a9=0;a9<bb.length;a9++){var a7=bb[a9];for(var ba=(a9==0?be.startIndex:0);ba<(a9==(bb.length-1)?be.endIndex:ah(a7));ba++){if(a7.nodeValue.charAt(ba)==B){if(!(!a8&&((a9==0&&ba==be.startIndex)||(a9==(bb.length-1)&&ba==(be.endIndex-1))))){var a5;if(ba==0){a5=(a9>0)?bb[a9-1].nodeValue.charAt(ah(bb[a9-1])-1):null}else{a5=a7.nodeValue.charAt(ba-1)}if(!a5||!M(a5)){if(ba==(ah(a7)-1)){a5=(a9<(bb.length-1))?bb[a9+1].nodeValue.charAt(0):null}else{a5=a7.nodeValue.charAt(ba+1)}if(!a5||!M(a5)){a7.nodeValue=a7.nodeValue.substr(0,ba)+" "+a7.nodeValue.substr(ba+1)}}}}}}}}};function a2(bh,bc,be,bg,bi,a7,a6,bb){var bf=null,bj=bc,a5,bk,bd,ba,a8,a9;R(null,bh,true,function(bq){if(bi&&bq!=bg&&(!a5||!bb)&&!aK(bg,bq)){return false}bi|=(bq==bg);a9=a1(bq);if(a5){var bl=w(bq,a5,false);var bp=aO(a5,bl,false,false);var bm=false;for(var bn in bp){if(!(ae(bp[bn])&&!a3[X(bp[bn])])){bm=true;break}}if(bm||a9!=a8){bf=bq;bj=0;return false}}if(bq.nodeType==3){if(bq.parentNode.nodeType!=8){if(!aH(bq)){if(a5){bf=bq;bj=0;return false}}else{while(bj<ah(bq)){var bo=bq.nodeValue.charAt(bj);if(M(bo)||(a7&&bo==B)){if(!be){if(a5){bd=bq;ba=bj+1}else{a5=bq;a8=a9;bk=bj;bd=null}}}else{be=false;if(bd||(a5&&(a6||bk==0))){bf=bq;return false}else{a5=null}}bj++}}}else{be=false}}else{be=false;if(bq.nodeType!=8){if(a5&&!(ae(bq)&&!a3[X(bq)])){bf=bq;bj=0;return false}}}bj=0});if(a5&&!bd){bd=a5;ba=bk+1}return{seenTargetNode:bi,resumeNode:bf,resumeIndex:bj,startNode:a5,startIndex:bk,endNode:bd,endIndex:ba}}function a4(a8,bb,a5,ba){var a7=a1(a8);if(bb==0){var a9=false;R(null,a8,false,function(bg){if(bg==a8){return}var be=a6(bg,a8);if(!be&&a9){var bc=w(bg,a8,false);var bf=aO(bg,bc,false,false);for(var bd in bf){a9=false;if(!a6(bf[bd],a8)&&!a9){return false}}be=false;a9=true}return be});if(!a9){return false}}if(ba==ah(a5)){var a9=false;R(null,a5,true,function(bg){if(bg==a5){return}var be=a6(bg,a5);if(!be&&a9){var bc=w(bg,a5,false);var bf=aO(a5,bc,false,false);for(var bd in bf){a9=false;if(!a6(bf[bd],a5)&&!a9){return false}}a9=true;be=false}return be});if(!a9){return false}}return true;function a6(bc,bd){if(bc.nodeType==3){if(ah(bc)>0){a9=aH(bc);return false}}else{if(a0[X(bc)]){a9=!aK(bc,bd);return false}else{if(aL(bc)||X(bc)=="br"){return false}}}return true}}function a1(a6){var a5=aD(a6,"white-space");if(!a5){do{if(X(a6)=="pre"){a5="pre";break}a6=a6.parentNode}while(a6&&a6.nodeType==1);if(!a5){a5="normal"}}return a5}})()})();
