jive.ext.y._sliders_on=true;jive.ext.y._sliders=new jive.ext.y.HashTable();jive.ext.y.ySlider=function(b,f,a){var d=new Array();var c=this;this.hash=0;this.name=a;this.moving=false;if(!$obj(f)||f==null){f=new Object()}if(!$def(f.timeout)||f.timeout==null){f.timeout=false}this.go=function(){try{while(c.hash==0||$obj(jive.ext.y._sliders.get(c.hash))){c.hash=Math.round(Math.random()*10000)+1}jive.ext.y._sliders.put(c.hash,this);if(!f.timeout){f.timeout=40}for(var g=0;g<d.length;g++){d[g].init()}f.slideTime=b;f.stop=false;f.B=Math.PI/(2*f.slideTime);var h=new Date();f.C=h.getTime();if(!jive.ext.y._sliders_on){f.slideTime=0}if(!c.moving){this._slide()}}catch(e){alert("error initializing slider:"+f.message)}};this._slide=function(){try{var e,k,j,l;e=new Date();j=e.getTime()-f.C;if(f.stop){c.moving=false}else{if(j<f.slideTime){setTimeout("jive.ext.y._sliders.get('"+c.hash+"')._slide();",f.timeout);var k=Math.sin(f.B*j);for(var h=0;h<d.length;h++){d[h].tick(k)}c.moving=true}else{for(var h=0;h<d.length;h++){d[h].stop()}c.moving=false}}}catch(g){alert("error sliding slider:"+f)}};this.addTicker=function(e){d.push(e)}};jive.ext.y.EndOfSlideTicker=function(a){this.init=function(){};this.tick=function(b){};this.stop=function(){a()}};jive.ext.y.SlideToTicker=function(b,a,c){this.init=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}b.xTarget=a;b.yTarget=c;b.yA=b.yTarget-jive.ext.x.xTop(b);b.xA=b.xTarget-jive.ext.x.xLeft(b);b.yD=jive.ext.x.xTop(b);b.xD=jive.ext.x.xLeft(b)};this.tick=function(d){if(!(b=jive.ext.x.xGetElementById(b))){return}var f=Math.round(b.xA*d+b.xD);var e=Math.round(b.yA*d+b.yD);jive.ext.x.xMoveTo(b,f,e)};this.stop=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}jive.ext.x.xMoveTo(b,b.xTarget,b.yTarget)}};jive.ext.y.SlideHeightToTicker=function(b,a){this.init=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}b.xTargetH=a;b.xAH=b.xTargetH-jive.ext.x.xHeight(b);b.xDH=jive.ext.x.xHeight(b)};this.tick=function(d){if(!(b=jive.ext.x.xGetElementById(b))){return}var c=Math.round(b.xAH*d+b.xDH);jive.ext.x.xHeight(b,c)};this.stop=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}jive.ext.x.xHeight(b,b.xTargetH)}};jive.ext.y.SlideWidthToTicker=function(b,a){this.init=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}b.xTargetW=a;b.xAW=b.xTargetW-jive.ext.x.xWidth(b);b.xDW=jive.ext.x.xWidth(b)};this.tick=function(c){if(!(b=jive.ext.x.xGetElementById(b))){return}var d=Math.round(b.xAW*c+b.xDW);jive.ext.x.xWidth(b,d)};this.stop=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}jive.ext.x.xWidth(b,b.xTargetW)}};jive.ext.y.SlideTopToTicker=function(b,a){this.init=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}b.xTargetT=a;b.xAT=b.xTargetT-jive.ext.x.xTop(b);b.xDT=jive.ext.x.xTop(b)};this.tick=function(d){if(!(b=jive.ext.x.xGetElementById(b))){return}var c=Math.round(b.xAT*d+b.xDT);jive.ext.x.xTop(b,c)};this.stop=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}jive.ext.x.xTop(b,b.xTargetT)}};jive.ext.y.SlideBottomToTicker=function(b,a){this.init=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}b.xTargetT=a;b.xAT=b.xTargetT-jive.ext.y.yBottom(b);b.xDT=jive.ext.y.yBottom(b)};this.tick=function(d){if(!(b=jive.ext.x.xGetElementById(b))){return}var c=Math.round(b.xAT*d+b.xDT);jive.ext.y.yBottom(b,c)};this.stop=function(){if(!(b=jive.ext.x.xGetElementById(b))){return}jive.ext.y.yBottom(b,b.xTargetT)}};jive.ext.y.SlideOpacityToTicker=function(a,b){this.init=function(){if(!(a=jive.ext.x.xGetElementById(a))){return}a.xTargetO=b;a.xAO=a.xTargetO-jive.ext.y.yOpacity(a);a.xDO=jive.ext.y.yOpacity(a)};this.tick=function(c){if(!(a=jive.ext.x.xGetElementById(a))){return}var d=Math.round(a.xAO*c+a.xDO);jive.ext.y.yOpacity(a,d)};this.stop=function(){if(!(a=jive.ext.x.xGetElementById(a))){return}jive.ext.y.yOpacity(a,a.xTargetO)}};
;
var tinymce={majorVersion:"3",minorVersion:"2.5",releaseDate:"2009-06-29",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isOldWebKit=o.isWebKit&&!l.getSelection().getRangeAt;o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(typeof(d[e])!="undefined"){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var g,d=arguments,f,b=this.listeners,j;for(f=0;f<b.length;f++){try{j=b[f];g=j.cb.apply(j.scope,d)}catch(h){}if(g===false){break}}return g}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,g=[],d;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(h){if(h){g.push(h)}});e=g;for(c=f.length-1,g=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}g.push(f[c])}c=e.length-b;if(c<=0){return"/"+g.reverse().join("/")+d}return"/"+e.slice(0,c).join("/")+"/"+g.reverse().join("/")+d},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(){var d=tinymce.each,b=tinymce.is;var c=tinymce.isWebKit,a=tinymce.isIE;tinymce.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!tinymce.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},g);if(tinymce.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}tinymce.addUnload(f.destroy,f)},getRoot:function(){var e=this,f=e.settings;return(f&&e.get(f.root_element))||e.doc.body},getViewPort:function(f){var g,e;f=!f?this.win:f;g=f.document;if(g==null){return{x:0,y:0,w:1,h:1}}e=this.boxModel?g.documentElement:g.body;return{x:f.pageXOffset||e.scrollLeft,y:f.pageYOffset||e.scrollTop,w:f.innerWidth||e.clientWidth,h:f.innerHeight||e.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},getParent:function(h,g,e){return this.getParents(h,g,e,false)},getParents:function(m,j,h,l){var g=this,e,i=g.settings,k=[];m=g.get(m);l=l===undefined;if(i.strict_root){h=h||g.getRoot()}if(b(j,"string")){e=j;if(j==="*"){j=function(f){return f.nodeType==1}}else{j=function(f){return g.is(f,e)}}}while(m){if(m==h||!m.nodeType||m.nodeType===9){break}if(!j||j(m)){if(l){k.push(m)}else{return m}}m=m.parentNode}return l?k:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},select:function(g,f){var e=this;return tinymce.dom.Sizzle(g,e.get(f)||e.get(e.settings.root_element)||e.doc,[])},is:function(f,e){return tinymce.dom.Sizzle.matches(e,f.nodeType?[f]:f).length>0},add:function(i,k,e,g,j){var f=this;return this.run(i,function(m){var l,h;l=b(k,"string")?f.doc.createElement(k):k;f.setAttribs(l,e);if(g){if(g.nodeType){l.appendChild(g)}else{f.setHTML(l,g)}}return !j?m.appendChild(l):l})},create:function(g,e,f){return this.add(this.doc.createElement(g),g,e,f,1)},createHTML:function(l,e,i){var j="",g=this,f;j+="<"+l;for(f in e){if(e.hasOwnProperty(f)){j+=" "+f+'="'+g.encode(e[f])+'"'}}if(tinymce.is(i)){return j+">"+i+"</"+l+">"}return j+" />"},remove:function(g,e){var f=this;return this.run(g,function(l){var k,j,h;k=l.parentNode;if(!k){return null}if(e){for(h=l.childNodes.length-1;h>=0;h--){f.insertAfter(l.childNodes[h],l)}}if(f.fixPsuedoLeaks){k=l.cloneNode(true);e="IELeakGarbageBin";j=f.get(e)||f.add(f.doc.body,"div",{id:e,style:"display:none"});j.appendChild(l);j.innerHTML="";return k}return k.removeChild(l)})},setStyle:function(h,e,f){var g=this;return g.run(h,function(l){var k,j;k=l.style;e=e.replace(/-(\D)/g,function(m,i){return i.toUpperCase()});if(g.pixelStyles.test(e)&&(tinymce.is(f,"number")||/^[\-0-9\.]+$/.test(f))){f+="px"}switch(e){case"opacity":if(a){k.filter=f===""?"":"alpha(opacity="+(f*100)+")";if(!h.currentStyle||!h.currentStyle.hasLayout){k.display="inline-block"}}k[e]=k["-moz-opacity"]=k["-khtml-opacity"]=f||"";break;case"float":a?k.styleFloat=f:k.cssFloat=f;break;default:k[e]=f||""}if(g.settings.update_styles){g.setAttrib(l,"mce_style")}})},getStyle:function(h,e,g){h=this.get(h);if(!h){return false}if(this.doc.defaultView&&g){e=e.replace(/[A-Z]/g,function(i){return"-"+i});try{return this.doc.defaultView.getComputedStyle(h,null).getPropertyValue(e)}catch(f){return null}}if(typeof(e)=="undefined"){return false}e=e.replace(/-(\D)/g,function(j,i){return i.toUpperCase()});if(e=="float"){e=a?"styleFloat":"cssFloat"}if(h.currentStyle&&g){return h.currentStyle[e]}return h.style[e]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;d(j,function(e,k){g.setStyle(i,k,e)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){d(f,function(e,l){g.setStyle(k,l,e)});return}if(j.keep_values&&/^(| )(top|left|bottom|right|width|height)/i.test(f)){if(f){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){d(h,function(e,j){f.setAttrib(i,j,e)})})},getAttrib:function(i,k,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(k)){f=i.getAttribute("mce_"+k);if(f){if(typeof(f)=="object"&&k=="style"){var j=g.serializeStyle(f);if(f!=null&&typeof(f.cssText)!="undefined"){f=f.cssText}f=g.serializeStyle(g.parseStyle(f))}return f}}if(a&&g.props[k]){f=i[g.props[k]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(k,2)}if(k==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(c&&k==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(k){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return k}return h;case"shape":f=f.toLowerCase();break;default:if(k.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(g){var h=this,i=h.settings,j={};if(!g){return j}function e(v,o,u){var n,q,k,m;n=j[v+"-top"+o];if(!n){return}q=j[v+"-right"+o];if(n!=q){return}k=j[v+"-bottom"+o];if(q!=k){return}m=j[v+"-left"+o];if(k!=m){return}j[u]=m;delete j[v+"-top"+o];delete j[v+"-right"+o];delete j[v+"-bottom"+o];delete j[v+"-left"+o]}function f(m,l,k,o){var n;n=j[l];if(!n){return}n=j[k];if(!n){return}n=j[o];if(!n){return}j[m]=j[l]+" "+j[k]+" "+j[o];delete j[l];delete j[k];delete j[o]}g=g.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");d(g.split(";"),function(l){var k,m=[];if(l){l=l.replace(/_MCE_SEMI_/g,";");l=l.replace(/url\([^\)]+\)/g,function(n){m.push(n);return"url("+m.length+")"});l=l.split(":");k=tinymce.trim(l[1]);k=k.replace(/url\(([^\)]+)\)/g,function(o,n){return m[parseInt(n)-1]});k=k.replace(/rgb\([^\)]+\)/g,function(n){return h.toHex(n)});if(i.url_converter){k=k.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(n,o){return"url("+i.url_converter.call(i.url_converter_scope||h,h.decode(o),"style",null)+")"})}j[tinymce.trim(l[0]).toLowerCase()]=k}});e("border","","border");e("border","-width","border-width");e("border","-color","border-color");e("border","-style","border-style");e("padding","","padding");e("margin","","margin");f("border","border-width","border-style","border-color");if(a){if(j.border=="medium none"){j.border=""}}return j},serializeStyle:function(f){var e="";d(f,function(h,g){if(g&&h){if(tinymce.isGecko&&g.indexOf("-moz-")===0){return}switch(g){case"color":case"background-color":h=h.toLowerCase();break}e+=(e?" ":"")+g+": "+h+";"}});return e},loadCSS:function(e){var g=this,h=g.doc,f;if(!e){e=""}f=g.select("head")[0];d(e.split(","),function(i){var j;if(g.files[i]){return}g.files[i]=true;j=g.create("link",{rel:"stylesheet",href:tinymce._addVer(i)});if(a&&h.documentMode){j.onload=function(){h.recalc();j.onload=null}}f.appendChild(j)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=tinymce.trim(j!=" "?j:"")}return k.className})},hasClass:function(f,e){f=this.get(f);if(!f||!e){return false}return(" "+f.className+" ").indexOf(" "+e+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(e){return(!e?"mce_":e)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){while(m.childNodes.length>0){m.removeChild(m.childNodes[0])}h=f.create("div");h.innerHTML="<br />"+g;while(h.childNodes.length>1&&m.nodeType==1&&m.nodeName.toLowerCase()!="input"){m.appendChild(h.childNodes[1])}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/g,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(n,e){var p;if(e!=="mce_tmp"){p=q.getAttribute(e);if(!p&&e==="class"){p=q.className}l.setAttribute(e,p)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(i){var f=this,g=f.settings;if(!g.process_html){return i}if(tinymce.isGecko){i=i.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");i=i.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){i=i.replace(/&apos;/g,"&#39;");i=i.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}i=i.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(g.keep_values){if(/<script|noscript|style/.test(i)){function e(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}i=i.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(h,k,j){if(!k){k=' type="text/javascript"'}k=k.replace(/(type|language)=\"?/,"$&mce-");k=k.replace(/src=\"([^\"]+)\"?/,function(l,m){if(g.url_converter){m=f.encode(g.url_converter.call(g.url_converter_scope||f,f.decode(m),"src","script"))}return'mce_src="'+m+'"'});if(tinymce.trim(j)){j="<!--\n"+e(j)+"\n// -->"}return"<mce:script"+k+">"+j+"</mce:script>"});i=i.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(h,k,j){return"<mce:style"+k+">"+j+"</mce:style><style "+k+' mce_bogus="1">'+j+"</style>"});i=i.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,k,j){return"<mce:noscript"+k+"><!--"+f.encode(j).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}i=i.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");i=i.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,k){function j(n,l,p){var o=p;if(h.indexOf("mce_"+l)!=-1){return n}if(l=="style"){if(f._isRes(p)){return n}if(g.hex_colors){o=o.replace(/rgb\([^\)]+\)/g,function(m){return f.toHex(m)})}if(g.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(m,q){return"url("+f.encode(g.url_converter.call(g.url_converter_scope||f,f.decode(q),l,k))+")"})}}else{if(l!="coords"&&l!="shape"){if(g.url_converter){o=f.encode(g.url_converter.call(g.url_converter_scope||f,f.decode(p),l,k))}}}return" "+l+'="'+p+'" mce_'+l+'="'+o+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,j);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,j);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,j)})}return i},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(i,g,j){var f=this;return this.run(i,function(h){var l,k;h=f.get(h);j=j||h.ownerDocument||f.doc;if(a&&h.nodeType==1){h.outerHTML=g}else{k=j.createElement("body");k.innerHTML=g;l=k.lastChild;while(l){f.insertAfter(l.cloneNode(true),h);l=l.previousSibling}f.remove(h)}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(e){return e?(""+e).replace(/[<>&\"]/g,function(g,f){switch(g){case"&":return"&amp;";case'"':return"&quot;";case"<":return"&lt;";case">":return"&gt;"}return g}):e},insertAfter:function(g,f){var e=this;f=e.get(f);return this.run(g,function(j){var i,h;i=f.parentNode;h=f.nextSibling;if(h){i.insertBefore(j,h)}else{i.appendChild(j)}return j})},isBlock:function(e){if(e.nodeType&&e.nodeType!==1){return false}e=e.nodeName||e;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TR|TH|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(e)},replace:function(h,g,e){var f=this;if(b(g,"array")){h=h.cloneNode(true)}return f.run(g,function(i){if(e){d(i.childNodes,function(j){h.appendChild(j.cloneNode(true))})}if(f.fixPsuedoLeaks&&i.nodeType===1){i.parentNode.insertBefore(h,i);f.remove(i);return h}return i.parentNode.replaceChild(h,i)})},findCommonAncestor:function(g,e){var h=g,f;while(h){f=e;while(f&&h!=f){f=f.parentNode}if(h==f){break}h=h.parentNode}if(!h&&g.ownerDocument){return g.ownerDocument.documentElement}return h},toHex:function(e){var g=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(e);function f(h){h=parseInt(h).toString(16);return h.length>1?h:"0"+h}if(g){e="#"+f(g[1])+f(g[2])+f(g[3]);return e}return e},getClasses:function(){var k=this,e=[],j,l={},m=k.settings.class_filter,h;if(k.classes){return k.classes}function n(f){d(f.imports,function(i){n(i)});d(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){d(i.selectorText.split(","),function(o){o=o.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(o)||!/\.[\w\-]+$/.test(o)){return}h=o;o=o.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(m&&!(o=m(o,h))){return}if(!l[o]){e.push({"class":o});l[o]=1}})}break;case 3:n(i.styleSheet);break}})}try{d(k.doc.styleSheets,n)}catch(g){}if(e.length>0){k.classes=e}return e},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];d(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(f){var e;f=this.get(f);if(!f){return[]}if(a){e=[];if(f.nodeName=="OBJECT"){return f.attributes}f.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(h,g){e.push({specified:1,nodeName:g})});return e}return f.attributes},destroy:function(f){var e=this;if(e.events){e.events.destroy()}e.win=e.doc=e.root=e.events=null;if(!f){tinymce.removeUnload(e.destroy)}},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new tinymce.dom.Range(this)},split:function(k,j,n){var o=this,f=o.createRng(),l,i,m;function g(p,e){p=p[e];if(p&&p[e]&&p[e].nodeType==1&&h(p[e])){o.remove(p[e])}}function h(e){e=o.getOuterHTML(e);e=e.replace(/<(img|hr|table)/gi,"-");e=e.replace(/<[^>]+>/g,"");return e.replace(/[ \t\r\n]+|&nbsp;|&#160;/g,"")==""}if(k&&j){f.setStartBefore(k);f.setEndBefore(j);l=f.extractContents();f=o.createRng();f.setStartAfter(j);f.setEndAfter(k);i=f.extractContents();m=k.parentNode;g(l,"lastChild");if(!h(l)){m.insertBefore(l,k)}if(n){m.replaceChild(n,j)}else{m.insertBefore(j,k)}g(i,"firstChild");if(!h(i)){m.insertBefore(i,k)}o.remove(k);return n||j}},bind:function(i,e,h,g){var f=this;if(!f.events){f.events=new tinymce.dom.EventUtils()}return f.events.add(i,e,h,g||this)},unbind:function(h,e,g){var f=this;if(!f.events){f.events=new tinymce.dom.EventUtils()}return f.events.remove(h,e,g)},_isRes:function(e){return/^(top|left|bottom|right|width|height)/i.test(e)||/;\s*(top|left|bottom|right|width|height)/i.test(e)}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c!=null&&c.clientWidth),h:parseInt(this.getStyle("height")||c!=null&&c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;if(f==null){return}if(typeof(f)=="undefined"){return}function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h==null){return}if(typeof(h)=="undefined"){return}if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i&&g.win&&g.win.document){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",bool_attrs:/(checked|disabled|readonly|selected|nowrap)/,valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML="&nbsp;";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){f(i.dom.select("p table",l.node),function(m){if(d){m.outerHTML=m.outerHTML}i.dom.split(i.dom.getParent(m,"p"),m)})})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(m,l){var j,i=this,k;i._setup();l=l||{};l.format=l.format||"html";m=m.cloneNode(true);i.processObj=l;if(e.isWebKit){k=m.ownerDocument.implementation.createHTMLDocument("");k.body.appendChild(m)}i.key=""+(parseInt(i.key)+1);if(!l.no_events){l.node=m;i.onPreProcess.dispatch(i,l)}i.writer.reset();i._serializeNode(m,l.getInner);l.content=i.writer.getContent();if(!l.no_events){i.onPostProcess.dispatch(i,l)}i._postProcess(l);l.node=null;return e.trim(l.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");j=j.replace(/(type|language)=\"mce-/g,'$1="');if(k.entity_encoding=="raw"){j=j.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;if(j==null){return null}h=h||j.name;if((typeof(j.forcedVal)!="undefined")&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);if(this.settings.bool_attrs.test(h)&&k){k=(""+k).toLowerCase();if(k==="false"||k==="0"){return null}k=h}switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.plugins){l=d(q.plugins);g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){i._setActive(null);g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}}});q.loadQueue(function(){if(!v.removed){v.init()}})}if(w.plugins.indexOf("compat2x")!=-1){q.loadQueue(r)}else{r()}},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=window.CS_RESOURCE_BASE_URL+"/styles/tiny_mce3/themes/"+G.theme+"/skins/"+G.skin+"/dialog.css"}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}F.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />';F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',allowTransparency:true,frameBorder:"0",style:{width:"100%",height:z,position:"relative"}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.DOM.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer({entity_encoding:A.entity_encoding,entities:A.entities,valid_elements:A.verify_html===false?"*[*]":A.valid_elements,extended_valid_elements:A.extended_valid_elements,valid_child_elements:A.valid_child_elements,invalid_elements:A.invalid_elements,fix_table_elements:A.fix_table_elements,fix_list_elements:A.fix_list_elements,fix_content_duplication:A.fix_content_duplication,convert_fonts_to_spans:A.convert_fonts_to_spans,font_size_classes:A.font_size_classes,font_size_style_values:A.font_size_style_values,apply_source_formatting:A.apply_source_formatting,remove_linebreaks:A.remove_linebreaks,element_format:A.element_format,dom:z.dom});z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(v,u){var q=this,r=q.selection,x=r.getNode()||q.getBody();if(q.initialized){var w=b&&x.ownerDocument!=q.getDoc()?q.getBody():x;if(u||typeof(q.lastNodeChanged)=="undefined"||q.lastNodeChanged!=w){q.lastNodeChanged=w;q.onNodeChange.dispatch(q,v?v.controlManager||q.controlManager:q.controlManager,w,r.isCollapsed(),v)}}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br _moz_dirty="" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+shift+z",w.getLang("redo_desc"),"Redo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}w.onMouseDown.add(r);w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this);c.onExecCommand.add(function(e,f){if(f=="RemoveFormat"||f=="mceEndUndoLevel"||f=="Bold"||f=="Italic"||f=="Underline"||f=="Strikethrough"||f=="FontName"||f=="FontSize"||f=="mceBeginUndoLevel"||(f.length>"mceJiveStyle".length&&f.substr(0,"mceJiveStyle".length)=="mceJiveStyle")){e.undoManager.add()}})},add:function(d,j){var g=this,f,e=g.editor,c,h=e.settings,k,d;if(typeof(j)=="undefined"){j=false}d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");k=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&k&&d.content==k.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){c=d.bookmark||e.selection.getBookmark();if(c!=null&&typeof(c.start)!="undefined"){d.bookmark=c}else{if(!j){return}else{if(c==null){return}}}}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});if(typeof(b.bookmark)!="undefined"){c.selection.moveToBookmark(b.bookmark)}e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(e){var b,d,a,c,f,h;b=e.dom.Event;d=e.isIE;a=e.isGecko;c=e.isOpera;f=e.each;h=e.extend;function g(i){i=i.innerHTML;i=i.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");i=i.replace(/<[^>]+>/g,"");return i.replace(/[ \t\r\n]+/g,"")==""}e.create("tinymce.ForceBlocks",{ForceBlocks:function(j){var k=this,l=j.settings,m;k.editor=j;k.dom=j.dom;m=(l.forced_root_block||"p").toLowerCase();l.element=m.toUpperCase();j.onPreInit.add(k.setup,k);k.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+m+">","gi");k.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,m),"gi");k.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,m),"gi");function i(n,p){if(c){p.content=p.content.replace(k.reOpera,"</"+m+">")}p.content=p.content.replace(k.rePadd,"<"+m+"$1$2$3$4$5$6>\u00a0</"+m+">");if(!d&&!c&&p.set){p.content=p.content.replace(k.reNbsp2BR1,"<"+m+"$1$2><br /></"+m+">");p.content=p.content.replace(k.reNbsp2BR2,"<"+m+"$1$2><br /></"+m+">")}else{p.content=p.content.replace(k.reBR2Nbsp,"<"+m+"$1$2>\u00a0</"+m+">")}}j.onBeforeSetContent.add(i);j.onPostProcess.add(i);if(l.forced_root_block){j.onInit.add(k.forceRoots,k);j.onSetContent.add(k.forceRoots,k);j.onBeforeGetContent.add(k.forceRoots,k)}},setup:function(){var j=this,i=j.editor,k=i.settings;if(k.forced_root_block){i.onKeyUp.add(j.forceRoots,j);i.onPreProcess.add(j.forceRoots,j)}if(k.force_br_newlines){if(d){i.onKeyPress.add(function(m,p){var q,o=m.selection;if(p.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});q=m.dom.get("__");q.removeAttribute("id");o.select(q);o.collapse();return b.cancel(p)}})}return}if(!d&&k.force_p_newlines){i.onKeyPress.add(function(m,n){if(n.keyCode==13&&!n.shiftKey){if(!j.insertPara(n)){b.cancel(n)}}});if(a){i.onKeyDown.add(function(m,n){if((n.keyCode==8||n.keyCode==46)&&!n.shiftKey){j.backspaceDelete(n,n.keyCode==8)}})}}function l(n,m){var o=i.dom.create(m);f(n.attributes,function(p){if(p.specified&&p.nodeValue){o.setAttribute(p.nodeName.toLowerCase(),p.nodeValue)}});f(n.childNodes,function(p){o.appendChild(p.cloneNode(true))});n.parentNode.replaceChild(o,n);return o}i.onPreProcess.add(function(m,n){f(m.dom.select("p,h1,h2,h3,h4,h5,h6,div",n.node),function(o){if(g(o)){f(m.dom.select("span,em,strong,b,i",n.node),function(p){if(!p.hasChildNodes()){p.appendChild(m.getDoc().createTextNode("\u00a0"));return false}})}})});if(d){if(k.element!="P"){i.onKeyPress.add(function(m,n){j.lastElm=m.selection.getNode().nodeName});i.onKeyUp.add(function(o,q){var s,p=o.selection,r=p.getNode(),m=o.getBody();if(m.childNodes.length===1&&r.nodeName=="P"){r=l(r,k.element);p.select(r);p.collapse();o.nodeChanged()}else{if(q.keyCode==13&&!q.shiftKey&&j.lastElm!="P"){s=o.dom.getParent(r,"p");if(s){l(s,k.element);o.nodeChanged()}}}})}}},find:function(o,k,l){var j=this.editor,i=j.getDoc().createTreeWalker(o,4,null,false),m=-1;while(o=i.nextNode()){m++;if(k==0&&o==l){return m}if(k==1&&m==l){return o}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType==3||(!u.dom.isBlock(G)&&G.nodeType!=8)){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!d){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(i){return i===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);l.appendChild(G.cloneNode(1));G.parentNode.replaceChild(l,G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!d){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!d&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(j){var i=this.dom;return i.getParent(j,i.isBlock)},insertPara:function(M){var A=this,o=A.editor,I=o.dom,N=o.getDoc(),R=o.settings,B=o.selection.getSel(),C=B.getRangeAt(0),Q=N.body;var F,G,D,K,J,l,j,m,q,i,x,P,k,p,E,H=I.getViewPort(o.getWin()),w,z,v;F=N.createRange();F.setStart(B.anchorNode,B.anchorOffset);F.collapse(true);G=N.createRange();G.setStart(B.focusNode,B.focusOffset);G.collapse(true);D=F.compareBoundaryPoints(F.START_TO_END,G)<0;K=D?B.anchorNode:B.focusNode;J=D?B.anchorOffset:B.focusOffset;l=D?B.focusNode:B.anchorNode;j=D?B.focusOffset:B.anchorOffset;if(K===l&&/^(TD|TH)$/.test(K.nodeName)){if(K.firstChild.nodeName=="BR"){I.remove(K.firstChild)}if(K.childNodes.length==0){o.dom.add(K,R.element,null,"<br />");P=o.dom.add(K,R.element,null,"<br />")}else{E=K.innerHTML;K.innerHTML="";o.dom.add(K,R.element,null,E);P=o.dom.add(K,R.element,null,"<br />")}C=N.createRange();C.selectNodeContents(P);C.collapse(1);o.selection.setRng(C);return false}if(K==Q&&l==Q&&Q.firstChild&&o.dom.isBlock(Q.firstChild)){K=l=K.firstChild;J=j=0;F=N.createRange();F.setStart(K,0);G=N.createRange();G.setStart(l,0)}K=K.nodeName=="HTML"?N.body:K;K=K.nodeName=="BODY"?K.firstChild:K;l=l.nodeName=="HTML"?N.body:l;l=l.nodeName=="BODY"?l.firstChild:l;m=A.getParentBlock(K);q=A.getParentBlock(l);i=m?m.nodeName:R.element;if(A.dom.getParent(m,"ol,ul,pre")){return true}if(m&&(m.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;m=null}if(q&&(q.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;q=null}if(/(TD|TABLE|TH|CAPTION)/.test(i)||(m&&i=="DIV"&&/left|right/gi.test(I.getStyle(m,"float",1)))){i=R.element;m=q=null}x=(m&&m.nodeName==i)?m.cloneNode(0):o.dom.create(i);P=(q&&q.nodeName==i)?q.cloneNode(0):o.dom.create(i);P.removeAttribute("id");if(/^(H[1-6])$/.test(i)&&K.nodeValue&&J==K.nodeValue.length){P=o.dom.create(R.element)}E=k=K;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}k=E}while((E=E.previousSibling?E.previousSibling:E.parentNode));E=p=l;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}p=E}while((E=E.nextSibling?E.nextSibling:E.parentNode));if(k.nodeName==i){F.setStart(k,0)}else{F.setStartBefore(k)}F.setEnd(K,J);x.appendChild(F.cloneContents()||N.createTextNode(""));try{G.setEndAfter(p)}catch(L){}G.setStart(l,j);P.appendChild(G.cloneContents()||N.createTextNode(""));C=N.createRange();if(!k.previousSibling&&k.parentNode.nodeName==i){C.setStartBefore(k.parentNode)}else{if(F.startContainer.nodeName==i&&F.startOffset==0){C.setStartBefore(F.startContainer)}else{C.setStart(F.startContainer,F.startOffset)}}if(!p.nextSibling&&p.parentNode.nodeName==i){C.setEndAfter(p.parentNode)}else{C.setEnd(G.endContainer,G.endOffset)}C.deleteContents();if(c){o.getWin().scrollTo(0,H.y)}if(x.firstChild&&x.firstChild.nodeName==i){x.innerHTML=x.firstChild.innerHTML}if(P.firstChild&&P.firstChild.nodeName==i){P.innerHTML=P.firstChild.innerHTML}if(g(x)){x.innerHTML="<br />"}function O(y,s){var r=[],T,S,t;y.innerHTML="";if(R.keep_styles){S=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(S.nodeName)){T=S.cloneNode(false);I.setAttrib(T,"id","");r.push(T)}}while(S=S.parentNode)}if(r.length>0){for(t=r.length-1,T=y;t>=0;t--){T=T.appendChild(r[t])}r[0].innerHTML=c?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=c?"&nbsp;":"<br />"}}if(g(P)){v=O(P,l)}if(c&&parseFloat(opera.version())<9.5){C.insertNode(x);C.insertNode(P)}else{C.insertNode(P);C.insertNode(x)}P.normalize();x.normalize();function u(r){return N.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}C=N.createRange();C.selectNodeContents(a?u(v||P):v||P);C.collapse(1);B.removeAllRanges();B.addRange(C);w=o.dom.getPos(P).y;z=P.clientHeight;if(w<H.y||w+z>H.y+H.h){o.getWin().scrollTo(0,w<H.y?w:w-H.h+25)}return false},backspaceDelete:function(l,u){var x=this,k=x.editor,p=k.getBody(),j,m=k.selection,i=m.getRng(),o=i.startContainer,j,q,s;if(o&&k.dom.isBlock(o)&&!/^(TD|TH)$/.test(o.nodeName)&&u){if(o.childNodes.length==0||(o.childNodes.length==1&&o.firstChild.nodeName=="BR")){j=o;while((j=j.previousSibling)&&!k.dom.isBlock(j)){}if(j){if(o!=p.firstChild){q=k.dom.doc.createTreeWalker(j,NodeFilter.SHOW_TEXT,null,false);while(s=q.nextNode()){j=s}i=k.getDoc().createRange();i.setStart(j,j.nodeValue?j.nodeValue.length:0);i.setEnd(j,j.nodeValue?j.nodeValue.length:0);m.setRng(i);k.dom.remove(o)}return b.cancel(l)}}}function v(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(j=x.getParentBlock(n))){r=n.previousSibling;b.remove(p,"DOMNodeInserted",v);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){k.dom.remove(n)}}}b._add(p,"DOMNodeInserted",v);window.setTimeout(function(){b._remove(p,"DOMNodeInserted",v)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandSupported(b)){throw"Error"}}catch(d){c.windowManager.alert(c.getLang("clipboard_no_support"))}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
;
tinyMCE.addI18n({en:{common:{edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",apply:"Apply",insert:"Insert",update:"Update",cancel:"Cancel",close:"Close",browse:"Browse",class_name:"Class",not_set:"-- Not set --",clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",invalid_data:"Error: Invalid values entered, these are marked in red.",more_colors:"More colors"},contextmenu:{align:"Alignment",left:"Left",center:"Center",right:"Right",full:"Full"},insertdatetime:{date_fmt:"%Y-%m-%d",time_fmt:"%H:%M:%S",insertdate_desc:"Insert date",inserttime_desc:"Insert time",months_long:"January,February,March,April,May,June,July,August,September,October,November,December",months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"},print:{print_desc:"Print"},preview:{preview_desc:"Preview"},directionality:{ltr_desc:"Direction left to right",rtl_desc:"Direction right to left"},layer:{insertlayer_desc:"Insert new layer",forward_desc:"Move forward",backward_desc:"Move backward",absolute_desc:"Toggle absolute positioning",content:"New layer..."},save:{save_desc:"Save",cancel_desc:"Cancel all changes"},nonbreaking:{nonbreaking_desc:"Insert non-breaking space character"},iespell:{iespell_desc:"Run spell checking",download:"ieSpell not detected. Do you want to install it now?"},advhr:{advhr_desc:"Horizontal rule"},emotions:{emotions_desc:"Emotions"},searchreplace:{search_desc:"Find",replace_desc:"Find/Replace"},advimage:{image_desc:"Insert/edit image"},advlink:{link_desc:"Insert/edit link"},xhtmlxtras:{cite_desc:"Citation",abbr_desc:"Abbreviation",acronym_desc:"Acronym",del_desc:"Deletion",ins_desc:"Insertion",attribs_desc:"Insert/Edit Attributes"},style:{desc:"Edit CSS Style"},paste:{paste_text_desc:"Paste as Plain Text",paste_word_desc:"Paste from Word",selectall_desc:"Select All"},paste_dlg:{text_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",word_title:"Use CTRL+V on your keyboard to paste the text into the window."},table:{desc:"Inserts a new table",row_before_desc:"Insert row before",row_after_desc:"Insert row after",delete_row_desc:"Delete row",col_before_desc:"Insert column before",col_after_desc:"Insert column after",delete_col_desc:"Remove column",split_cells_desc:"Split merged table cells",merge_cells_desc:"Merge table cells",row_desc:"Table row properties",cell_desc:"Table cell properties",props_desc:"Table properties",paste_row_before_desc:"Paste table row before",paste_row_after_desc:"Paste table row after",cut_row_desc:"Cut table row",copy_row_desc:"Copy table row",del:"Delete table",row:"Row",col:"Column",cell:"Cell"},autosave:{unload_msg:"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle fullscreen mode"},media:{desc:"Insert / edit embedded media",edit:"Edit embedded media"},fullpage:{desc:"Document properties"},template:{desc:"Insert predefined template content"},visualchars:{desc:"Visual control characters on/off."},spellchecker:{desc:"Toggle spellchecker",menu:"Spellchecker settings",ignore_word:"Ignore word",ignore_words:"Ignore all",langs:"Languages",wait:"Please wait...",sug:"Suggestions",no_sug:"No suggestions",no_mpell:"No misspellings found."},pagebreak:{desc:"Insert page break."}}});
;
tinyMCE.addI18n('en.table',{
    desc:"Insert Table",
    row_up:"Move Row Up",
    row_down:"Move Row Down",
    col_left:"Move Column Left",
    col_right:"Move Column Right"
});
;
(function(){tinymce.create("tinymce.plugins.JiveListsPlugin",{lastList:null,lastPrevSib:null,fixLists:function(g){var d=g.selection.getNode();g.plugins.jivemacros.fixBodyParagraphs();var d=g.selection.getNode();var h=g.dom.getParent(d,"ul");if(h!=null&&h.nodeType==1&&h.nodeName.toLowerCase()=="ul"){var k=h.parentNode;if(k.nodeName.toLowerCase()=="li"){var j=g.selection.getBookmark();var c=k.parentNode;c.insertBefore(h,k);if(k.childNodes.length>0){c.insertBefore(k,h)}else{c.parentNode.removeChild(k)}g.selection.select(d);g.selection.collapse(true)}}d=g.dom.getParent(d,"li");if(d!=null&&d.nodeType==1&&d.nodeName.toLowerCase()=="li"){var e=g.dom.getParent(d,"ol,ul");if(tinymce.isGecko){for(var f=0;f<e.childNodes.length;f++){var k=e.childNodes[f];if(k.nodeType==1&&k.nodeName.toLowerCase()=="li"&&k.childNodes.length==0){k.appendChild(g.plugins.jivemacros.createEmptyPara(g.getDoc()))}}}if(e.parentNode.nodeName.toLowerCase()=="p"){var c=e.parentNode;c.parentNode.insertBefore(e,c);c.parentNode.removeChild(c);g.selection.select(d).collapse(true)}var a=e.previousSibling;if(a!=null&&e.nodeName==a.nodeName){var f=0;while(a.childNodes.length){e.insertBefore(a.childNodes[0],e.childNodes[f]);f++}}var a=e.nextSibling;if(a!=null&&e.nodeName==a.nodeName){while(a.childNodes.length){e.appendChild(a.childNodes[0])}}}if(this.lastList!=null&&this.lastList.parentNode!=null){var d=this.lastList.nextSibling;if(d!=null){if(d.nodeType==1&&d.nodeName.toLowerCase()=="br"){var c=g.plugins.jivemacros.createEmptyPara(g.getDoc());d.parentNode.insertBefore(c,d);d.parentNode.removeChild(d);var m=c.childNodes[c.childNodes.length-1];g.selection.select(m);g.selection.collapse(true)}}}else{if(this.lastPrevSib!=null){var d=this.lastPrevSib.nextSibling;if(d!=null){if(d.nodeType==1&&d.nodeName.toLowerCase()=="br"){var c=g.plugins.jivemacros.createEmptyPara(g.getDoc());d.parentNode.insertBefore(c,d);d.parentNode.removeChild(d);var m=c.childNodes[c.childNodes.length-1];g.selection.select(m);g.selection.collapse(true)}}}}},execCommand:function(d,j,c){var e=tinyMCE.activeEditor;if(d.indexOf("mceOLListStyle")==0){var g=parseInt(d.substr("mceOLListStyle".length));var h=e.plugins.jivelists.ol_styles;var a=h[g];var b=tinyMCE.activeEditor.selection.getNode();var i=e.dom.getParent(b,"ol");i.style.listStyleType=a[1];return true}if(d.indexOf("mceULListStyle")==0){var g=parseInt(d.substr("mceOLListStyle".length));var h=e.plugins.jivelists.ul_styles;var a=h[g];var b=tinyMCE.activeEditor.selection.getNode();var i=e.dom.getParent(b,"ul");i.style.listStyleType=a[1];return true}function l(o){var q=o.selection.getNode();q=o.dom.getParent(q,"ol,ul");var m=o.dom.getParent(q,"blockquote");if(m!=null){var p=o.getDoc().createElement(q.nodeName);m.parentNode.insertBefore(p,m);while(m.childNodes.length){p.appendChild(m.childNodes[0])}m.parentNode.removeChild(m);o.selection.select(q)}}var b=e.selection.getNode();var i=null;while(b!=null&&b.parentNode!=null&&(b=e.dom.getParent(b.parentNode,"ol,ul"))!=null){i=b}b=i;if(b!=null){this.lastList=b;this.lastPrevSib=b.previousSibling}else{this.lastList=null;this.lastPrevSib=null}function k(p,o){o=o||tinyMCE.activeEditor;var m=o.selection.getBookmark("simple"),n=p();if(tinymce.isWebKit){window.focus();o.focus();o.selection.moveToBookmark(m)}return n}if(d=="mceOutdent"){var f=this;k(function(){e.undoManager.add();e.execCommand("Outdent");f.fixLists(e);e.undoManager.add();e.execCommand("mceOutdentComplete")},e);return true}if(d=="mceIndent"){e.undoManager.add();e.execCommand("Indent");this.fixLists(e);l(e);e.undoManager.add();e.execCommand("mceIndentComplete");return true}if(d.indexOf("mceInsertUnorderedList")==0){e.execCommand("InsertUnorderedList");this.fixLists(e);e.undoManager.add();return true}if(d.indexOf("mceInsertOrderedList")==0){e.execCommand("InsertOrderedList");this.fixLists(e);e.undoManager.add();return true}return false},cleanList:function(a,c){var b=this;this._stripStyleAndMetaTags(a,c);this._wrapListChildren(a,c);if(c.nodeType!=1){return}$j.each(c.childNodes,function(){b.cleanList(a,this)})},_stripStyleAndMetaTags:function(a,b){if(b.nodeType!=1){return}$j.each(b.childNodes,function(){if(this.nodeType&&this.nodeType!=1&&this.nodeType!=3||this.nodeType==1&&(this.nodeName.toLowerCase()=="meta"||this.nodeName.toLowerCase()=="style")){b.removeChild(this)}})},_wrapListChildren:function(a,b){$j(b).filter("ul, ol").each(function(){var c=this;$j.each(this.childNodes,function(){var d;if(this.nodeType==3&&$j.trim(this.nodeValue)===""){c.removeChild(this)}else{if(this.nodeType==3||(this.nodeType==1&&!$j(this).is("li, ul, ol"))){d=a.getDoc().createElement("li");c.insertBefore(d,this);d.appendChild(this)}}})})},hasNoTextNodes:function(c){if(c.nodeType==3){return false}var a=true;if(c.nodeType==1){for(var b=0;a&&b<c.childNodes.length;b++){a=a&&this.hasNoTextNodes(c.childNodes[b])}}return a},init:function(a,b){this.url=b;var c=this;this.index=0;this.ol_styles=new Array();this.ol_styles.push(["default",""]);this.ol_styles.push(["none","none"]);this.ol_styles.push(["inherit","inherit"]);this.ol_styles.push(["d","decimal"]);this.ol_styles.push(["dz","decimal-leading-zero"]);this.ol_styles.push(["ur","upper-roman"]);this.ol_styles.push(["lr","lower-roman"]);this.ol_styles.push(["ua","upper-alpha"]);this.ol_styles.push(["la","lower-alpha"]);this.ol_styles.push(["lg","lower-greek"]);this.ol_styles.push(["ki","katakana-iroha"]);this.ol_styles.push(["k","katakana"]);this.ol_styles.push(["hii","hiragana-iroha"]);this.ol_styles.push(["hi","hiragana"]);this.ol_styles.push(["ci","cjk-ideographic"]);this.ol_styles.push(["g","georgian"]);this.ol_styles.push(["a","armenian"]);this.ol_styles.push(["he","hebrew"]);this.ul_styles=new Array();this.ul_styles.push(["default",""]);this.ul_styles.push(["none","none"]);this.ul_styles.push(["inherit","inherit"]);this.ul_styles.push(["s","square"]);this.ul_styles.push(["c","circle"]);this.ul_styles.push(["di","disc"]);a.onBeforeSetContent.add(function(d,e){if(tinymce.isIE){e.content=e.content.replace(/<br\/><\/li>/g,"</li>")}});a.onGetContent.add(function(d,e){if(tinymce.isIE){e.content=e.content.replace(/<\/li>/g,"<br></li>")}});a.onNodeChange.add(function(d){if(d.initialized){this.fixLists(d);var e=d.selection.getNode();var f=d.dom.getParent(e,"ul,ol");if(f){this.cleanList(d,f)}}},this);a.onInit.add(function(){if(a&&a.plugins.contextmenu){a.plugins.contextmenu.onContextMenu.add(function(d,h,l){var g,n=a.selection,f=n.getNode()||a.getBody();if(a.dom.getParent(l,"ol")){var p=a.dom.getParent(l,"ol");var q=a.dom.getParent(l,function(e){return $def(e.tagName)&&e.tagName.toLowerCase()=="ol"&&e!=p});h.addSeparator();g=h.addMenu({title:"jivelists.list_style",max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu"});var k=a.plugins.jivelists.ol_styles;for(var j=0;j<k.length;j++){if(q!=null||q==null&&k[j][0]!="inherit"){var o="";if(p.style.listStyleType==k[j][1]){o="mceMenuItemSelected"}else{o=""}g.add({title:"jivelists."+k[j][0],cmd:"mceOLListStyle"+j,"class":o})}if(j==2){g.addSeparator()}}}else{if(a.dom.getParent(l,"ul")){var p=a.dom.getParent(l,"ul");var q=a.dom.getParent(l,function(e){return $def(e.tagName)&&e.tagName.toLowerCase()=="ul"&&e!=p});h.addSeparator();g=h.addMenu({title:"jivelists.list_style",max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu"});var k=a.plugins.jivelists.ul_styles;for(var j=0;j<k.length;j++){if(q!=null||q==null&&k[j][0]!="inherit"){var o="";if(p.style.listStyleType==k[j][1]){o="mceMenuItemSelected"}else{o=""}g.add({title:"jivelists."+k[j][0],cmd:"mceULListStyle"+j,"class":o})}if(j==2){g.addSeparator()}}}}})}});this.prepForEnter=false;this.prepForDel=false;a.onKeyDown.addToTop(function(j,k){this.prepForEnter=false;this.prepForDel=false;if((k.keyCode==8||k.keyCode==46)&&j.selection.isCollapsed()){var q=j.dom.getParent(j.selection.getNode(),"li");var l=j.dom.getParent(j.selection.getNode(),"ul,ol");var g=j.selection;var s=g.getBookmark().start==0||g.getRng().startOffset==0;if(q!=null&&q.nodeType==1&&q.previousSibling==null&&tinymce.isGecko){var r=q.childNodes.length?q.childNodes[0]:null;var o=g.getBookmark();if(s){this.prepForDel=g.getBookmark();tinymce.dom.Event.cancel(k);while(q.childNodes.length){var i=q.childNodes[0];if(i.nodeType==1&&i.nodeName.toLowerCase()=="br"){var f=j.getDoc().createElement("P");f.appendChild(i);i=f}l.parentNode.insertBefore(i,l)}l.removeChild(q);if(r){j.selection.moveToBookmark(o)}}}else{if(q!=null&&q.nodeType==1&&s){this.prepForDel=g.getBookmark();tinymce.dom.Event.cancel(k);j.execCommand("mceOutdent");return false}}}else{if(k.keyCode==13&&!k.shiftKey){var q=j.dom.getParent(j.selection.getNode(),"li");var l=j.dom.getParent(j.selection.getNode(),"ul,ol");if(q!=null&&q.nodeType==1&&q.nextSibling==null&&q.childNodes.length==1&&this.hasNoTextNodes(q)){this.prepForEnter=true;var n=l.parentNode;if(n.nodeName.toLowerCase()=="ol"||n.nodeName.toLowerCase()=="ul"){j.execCommand("mceOutdent")}else{var f=j.plugins.jivemacros.createEmptyPara(j.getDoc());if(n.childNodes[n.childNodes.length-1]==l){n.appendChild(f)}else{n.insertBefore(f,l.nextSibling)}l.removeChild(q);if(l.childNodes.length==0){l.parentNode.removeChild(l)}j.selection.select(f.childNodes[0]);j.selection.collapse(true)}tinymce.dom.Event.cancel(k)}}else{if(k.keyCode==13&&k.shiftKey){window.breakNow=true;var q=j.dom.getParent(j.selection.getNode(),"li");var l=j.dom.getParent(j.selection.getNode(),"ul,ol");var g=j.selection;var m=j.plugins.jivemacros.isMacro(g.getNode())||j.plugins.jivemacros.isLink(g.getNode());var h=g.getNode();var d=g.getRng().startOffset==(g.getNode().childNodes[g.getNode().childNodes.length-1].nodeValue.length)&&h.childNodes.length>0&&h.childNodes[h.childNodes.length-1].nodeType==3&&g.getRng().startContainer==h.childNodes[h.childNodes.length-1];if(q!=null&&d){this.prepForEnter=true;tinymce.dom.Event.cancel(k);var f=j.getDoc().createElement("BR");q.appendChild(f);j.selection.select(f);j.selection.collapse()}}}}if(k.keyCode==9&&!k.ctrlKey&&!k.altKey){var f=j.dom.getParent(j.selection.getNode(),"table,ul,ol");if(f!=null&&f.nodeName.toLowerCase()!="table"){tinymce.dom.Event.cancel(k);return false}}},this);a.onKeyPress.add(function(d,g){if((g.keyCode==8||g.keyCode==46)&&this.prepForDel){tinymce.dom.Event.cancel(g);return false}if(g.keyCode==13&&this.prepForEnter){tinymce.dom.Event.cancel(g)}if(g.keyCode==9&&!g.ctrlKey&&!g.altKey){var f=d.dom.getParent(d.selection.getNode(),"table,ul,ol");if(f!=null&&f.nodeName.toLowerCase()!="table"){tinymce.dom.Event.cancel(g);return false}}},this);a.onKeyUp.add(function(f,j){if((j.keyCode==8||j.keyCode==46)&&this.prepForDel){tinymce.dom.Event.cancel(j);f.selection.moveToBookmark(this.prepForDel);var d=f.selection.getNode();if(d&&d.nodeName.toLowerCase()=="li"){var h=d?d.parentNode:null;var i=h?h.previousSibling:null;var g=(i&&i.childNodes.length)?i.childNodes[0]:null;if(g){f.selection.select(g);f.selection.collapse(true)}}return false}if(j.keyCode==13&&this.prepForEnter){tinymce.dom.Event.cancel(j)}if(j.keyCode==9&&!j.ctrlKey&&!j.altKey){var i=f.dom.getParent(f.selection.getNode(),"table,ul,ol");if(i!=null&&i.nodeName.toLowerCase()!="table"){try{if(j.shiftKey){f.execCommand("mceOutdent")}else{f.execCommand("mceIndent")}}catch(j){}tinymce.dom.Event.cancel(j);return false}}},this)},getInfo:function(){return{longname:"Jive Lists",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},createControl:function(b,a){return null}});tinymce.PluginManager.add("jivelists",tinymce.plugins.JiveListsPlugin)})();
;
tinyMCE.addI18n('en.jivelists',{
    list_style : 'List Style',
    inherit : "Inherit",
    none : "None",
    'default' : "Default",
    ur : "Upper Roman",
    lr : "Lower Roman",
    dz : "Decimal with Leading Zero",
    d  : "Decimal",
    ua : "Upper Alpha",
    la : "Lower Alpha",
    lg : "Lower Greek",
    ki : "Katakana-Iroha",
    hii: "Hiragana-Iroha",
    k  : "Katakana",
    hi : "Hiragana",
    ci : "Cjk-Ideographic",
    g  : "Georgian",
    a  : "Armenian",
    he : "Hebrew",
    s  : "Squares",
    c  : "Circles",
    di : "Discs"
});
;
(function(){tinymce.create("tinymce.plugins.JiveStylePlugin",{getInfo:function(){return{longname:"Image Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},init:function(b,c){b.onInit.add(function(e){var d=document.getElementById(e.id+"_jivestyle_action");if(d){var f=d.childNodes[0];while(f.childNodes.length>0){f.removeChild(f.childNodes[0])}f.appendChild(document.createTextNode(e.getLang("jivestyle.title")))}e.plugins.jivebuttons.initToolbar(e.id);setTimeout(function(h,g){return function(){h.plugins.jivebuttons.initToolbar(g)}}(e,e.id),300)});b.onNodeChange.add(function(d){return function(k,o,g){var e=k.dom.getParent(g,k.dom.isBlock);if(e){if(d.buttons.length>0){var f=k.selection;for(var j=0;j<d.buttons.length;j++){var m=window.document;var h=new tinymce.dom.DOMUtils(m);var l=$def(e.tagName)&&e.tagName.toLowerCase()==d.tagNames[j];var r=m.getElementById(d.buttons[j].id);var q=r.cells[0];if(l&&(f.isCollapsed()||f.getStart()==f.getEnd())){h.addClass(q,"mceMenuItemSelected")}else{h.removeClass(q,"mceMenuItemSelected")}}}}}}(this));function a(k){if(k.charAt(0)=="#"){k=k.substr(1,6)}k=k.replace(/ /g,"");k=k.toLowerCase();var j=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(g){return[parseInt(g[1]),parseInt(g[2]),parseInt(g[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(g){return[parseInt(g[1],16),parseInt(g[2],16),parseInt(g[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(g){return[parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16),parseInt(g[3]+g[3],16)]}}];for(var f=0;f<j.length;f++){var n=j[f].re;var e=j[f].process;var m=n.exec(k);if(m){channels=e(m);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}if(!this.ok){return""}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);var d=this.r.toString(16);var h=this.g.toString(16);var l=this.b.toString(16);if(d.length==1){d="0"+d}if(h.length==1){h="0"+h}if(l.length==1){l="0"+l}return"#"+d+h+l}this.buttons=new Array();this.tagNames=["p","h1","h2","h3","h4","h5","h6"]},formatSingleNode:function(b,e,d){var c;if(e.nodeName.toLowerCase()=="body"){if(e.childNodes.length==0){e.appendChild(b.plugins.jivemacros.createEmptyPara(b.getDoc()))}c=e.childNodes[0]}else{c=e}if(c){c.parentNode.insertBefore(d,c);while(c.childNodes.length){d.appendChild(c.childNodes[0])}c.parentNode.removeChild(c)}if(d.childNodes.length){d=d.childNodes[d.childNodes.length-1]}b.selection.select(d);var a=d.nodeType==1&&d.nodeName.toLowerCase()=="br";b.selection.collapse(a)},execCommand:function(p,m,u){var r=null;var g=tinyMCE.activeEditor;var h=new tinymce.EditorCommands(g);if(p=="mceJiveStyle"){var k=tinyMCE.activeEditor.controlManager;var a=k.get("jivestyle");a.showMenu();return true}else{if(p=="mceJiveStyleHeader1"){r="h1"}else{if(p=="mceJiveStyleHeader2"){r="h2"}else{if(p=="mceJiveStyleHeader3"){r="h3"}else{if(p=="mceJiveStyleHeader4"){r="h4"}else{if(p=="mceJiveStyleHeader5"){r="h5"}else{if(p=="mceJiveStyleHeader6"){r="h6"}else{if(p=="mceJiveStyleParagraph"){r="p"}}}}}}}}if(r!=null){var s=g.selection.getBookmark();var o=g.selection.getNode();var c=g.getDoc().createElement(r);if(!g.selection.isCollapsed()){var f=g.dom.getParent(g.selection.getStart(),"p,h1,h2,h3,h4,h5,h6");var e=g.dom.getParent(g.selection.getEnd(),"p,h1,h2,h3,h4,h5,h6");if(!f||f.nodeName.toLowerCase()=="body"){return}if(!e||e.nodeName.toLowerCase()=="body"){return}var l=f.parentNode;var j=g.plugins.jivemacros.ageTheNodes(f,e,g.getDoc());var d=false,t=false;for(var q=0;q<l.childNodes.length;q++){if(l.childNodes[q]==j[0]){d=true}if(l.childNodes[q]==j[1]){t=true}if(d){c=g.getDoc().createElement(r);g.plugins.jivestyle.formatSingleNode(g,l.childNodes[q],c)}if(t){break}}g.selection.moveToBookmark(s)}else{g.plugins.jivestyle.formatSingleNode(g,o,c);if($j(c).contents().length===0){$j(c).append("<span></span>")}g.selection.select($j(c).contents().get(0));g.selection.collapse()}return true}return false},isTag:function(b){var c=tinyMCE.activeEditor;var e=c.selection;if(e.isCollapsed()){var f=e.getNode();var d=c.dom.getParent(f,b);var a=$def(d)&&d!=null&&$def(d.tagName)&&d.tagName.toLowerCase()==b;if(a){return"mceMenuItemSelected"}else{return""}}else{return""}},addButton:function(a){this.buttons.push(a)},createControl:function(d,a){switch(d){case"jivestyle":var b=a.createSplitButton("jivestyle",{title:"jivestyle.title",cmd:"mceJiveStyle"});b.onRenderMenu.add(function(g,e){var f=tinyMCE.activeEditor.plugins.jivestyle;f.addButton(e.add({theTag:"p",title:"Paragraph",cmd:"mceJiveStyleParagraph","class":"mce_formatPreview mce_p "+tinyMCE.activeEditor.plugins.jivestyle.isTag("p")}));f.addButton(e.add({theTag:"h1",title:"Header 1",cmd:"mceJiveStyleHeader1","class":"mce_formatPreview mce_h1 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h1")}));f.addButton(e.add({theTag:"h2",title:"Header 2",cmd:"mceJiveStyleHeader2","class":"mce_formatPreview mce_h2 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h2")}));f.addButton(e.add({theTag:"h3",title:"Header 3",cmd:"mceJiveStyleHeader3","class":"mce_formatPreview mce_h3 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h3")}));f.addButton(e.add({theTag:"h4",title:"Header 4",cmd:"mceJiveStyleHeader4","class":"mce_formatPreview mce_h4 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h4")}));f.addButton(e.add({theTag:"h5",title:"Header 5",cmd:"mceJiveStyleHeader5","class":"mce_formatPreview mce_h5 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h5")}));f.addButton(e.add({theTag:"h6",title:"Header 6",cmd:"mceJiveStyleHeader6","class":"mce_formatPreview mce_h6 "+tinyMCE.activeEditor.plugins.jivestyle.isTag("h6")}))});return b}return null}});tinymce.PluginManager.add("jivestyle",tinymce.plugins.JiveStylePlugin)})();
;
tinyMCE.addI18n('en.jivestyle',{
    title : 'Style'
});

;
(function(){tinymce.create("tinymce.plugins.JiveMacrosPlugin",{_cache:new jive.ext.y.HashTable(),cache:function(e,a,c,b){var d=this._cache.get(b);if(!d){d=new jive.ext.y.HashTable();this._cache.put(b,d)}d.put(e,[c,a])},getTitleFor:function(a,c){var b=this._cache.get(a);if(!b){return false}return b.get(c)},deleteMacro:function(g,c){if(window.jiveRTE&&window.jiveRTE.macroEle){c=window.jiveRTE.macroEle;window.jiveRTE.macroEle=null}if($def(g)&&$def(c)){if(c==g.getBody()){return}var e=new tinymce.dom.DOMUtils(g.getBody());var h=e.getParent(c,function(j){return j==g.getBody()||j!=c});if(this.isExactMacro(c)){var d=this.getMacroFor(c);if(d.getMacroType()=="INLINE"){while(c.childNodes.length>0){var f=c.removeChild(c.childNodes[0]);h.insertBefore(f,c)}}else{if(d.getMacroType()=="TEXT"||d.getMacroType()=="INLINE"){while(c.childNodes.length>0){var f=c.removeChild(c.childNodes[0]);if(f.nodeType==3){var i=f.nodeValue;while(i.indexOf("\n")>=0){var a=g.getDoc().createElement("P");a.appendChild(g.getDoc().createTextNode(i.substr(0,i.indexOf("\n"))));h.insertBefore(a,c);if(i.length>i.indexOf("\n")+1){i=i.substr(i.indexOf("\n")+1)}else{i=""}}if(i.length>0){var a=g.getDoc().createElement("P");a.appendChild(g.getDoc().createTextNode(i));h.insertBefore(a,c)}}else{h.insertBefore(f,c)}}}}h.removeChild(c)}else{this.deleteMacro(g,h)}return}var g=tinyMCE.activeEditor;var b=g.selection;this.deleteMacro(g,b.getNode())},getNextSibling:function(a,b){if(b==null){return b}if(b.nextSibling!=null){return b.nextSibling}if(b==a.getBody()&&b.nextSibling==null){return null}return this.getNextSibling(a,this.getParentNode(a,b))},getParentNode:function(a,b){return(new tinymce.dom.DOMUtils(a.getDoc())).getParent(b,function(c){return c==a.getBody()||c!=b})},insertIntoPre:function(b,a){b.appendChild(a)},appendTextToPre:function(c,a,b){while(a.childNodes.length>0){c.appendChild(a.childNodes[0])}},getLineage:function(b,a){var c;if(a==b.getBody()){c=new Array();c.push(a)}else{c=this.getLineage(b,this.getParentNode(b,a));c.push(a)}return c},ageTheNodes:function(f,b,d){function a(g,h){return $j(h).parents().andSelf().filter(function(){var j=$j(this).parent().has(g).length>0,i=$j(this).has(g).length>0;return j&&!i}).get(0)}var c=a(b,f),e=a(f,b);return[c,e]},getOldestNode:function(e,k,h){var b=this.getLineage(e,k);var a=this.getLineage(e,h);if(b.length<a.length){var g=a;a=b;b=g;g=h;h=k;k=g}for(var d=1;d<a.length;d++){if(a[d]!=b[d]){var f=a[d-1];for(var c=0;c<f.childNodes.length;c++){if(f.childNodes[c]==b[d]){return h}else{if(f.childNodes[c]==a[d]){return k}}}}}return k},appendTextToPreUntilHelper:function(b,g,a,e){var c=false;if(a==null){return true}if(a==e){c=true}var f=b.getDoc();if(a.nodeType==3){this.insertIntoPre(g,a);return false}while(a.childNodes.length>0){var d=a.childNodes[0];if(this.appendTextToPreUntilHelper(b,g,d,e)){if(d.nodeType!=3){a.removeChild(d)}return true}if(d.nodeType!=3){a.removeChild(d)}}if(this.shouldEndLine(a)){this.insertIntoPre(g,f.createTextNode("\n"))}if(c){return c}if(a.nextSibling!=null){if(this.appendTextToPreUntilHelper(b,g,a.nextSibling,e)){return true}}return false},appendTextToPreUntil:function(c,g,a,f){var h=c.dom.getParent(a,c.dom.isBlock);var b=c.dom.getParent(f,c.dom.isBlock);if(h==null||b==null){h=a;b=f}if(h==b){g.appendChild(h);return}if(h.parentNode!=b.parentNode){var d=this.ageTheNodes(h,b);h=d[0];b=d[1]}var e=null;while(h&&(e=h.nextSibling)&&h!=f){g.appendChild(h);h=e}g.appendChild(f);return},getNodesBetweenHelper:function(c,b,h,a,g){var d=false;if(d){return d}if(a==null){return d}if(a==g){d=true}if(a.nodeType==1&&a.nodeName.toLowerCase()==h){b.push(a)}else{if(a.nodeType==1){for(var e=0;e<a.childNodes.length;e++){var f=a.childNodes[e];d=this.getNodesBetweenHelper(c,b,h,f,g)||d}if(d){return d}if(a.nextSibling!=null){d=d||this.getNodesBetweenHelper(c,b,h,a.nextSibling,g)}}}return d},getNodesBetween:function(c,f,a,e){var b=this.ageTheNodes(a,e,c.getDoc());var d=new Array();this.getNodesBetweenHelper(c,d,f,b[0],b[1]);return d},shouldEndLine:function(a){if(a.nodeType!=3&&(a.tagName.toLowerCase()=="div"||a.tagName.toLowerCase()=="p"||a.tagName.toLowerCase()=="pre"||a.tagName.toLowerCase()=="br")){return true}return false},applyParameterSet:function(c,b,d){if(this.isMacro(c)){if(d.deleteAll){var e=b.getAllowedParameters();for(var a=0;a<e.length;a++){c.removeAttribute("_"+e[a].name)}}for(var a=0;a<d.params.length;a++){c.setAttribute("_"+d.params[a].name,d.params[a].value)}this.removeDuplicateMacros(tinyMCE.activeEditor,false)}},buildMacro:function(e,j,o){if(!$def(j)){j=0}var k=tinyMCE.activeEditor;var d=k.selection;var m=k.getDoc();var c=e.getName();var f;var h=d.isCollapsed();if(e.getMacroType()=="TEXT"){f=m.createElement("pre");f.setAttribute("class","jive_text_macro jive_macro_"+c);f.className="jive_text_macro jive_macro_"+c}else{if(e.getMacroType()=="INLINE"){f=m.createElement("span");f.appendChild(m.createTextNode(c));f.setAttribute("class","jive_macro jive_macro_"+c);f.className="jive_macro jive_macro_"+c}else{f=m.createElement("img");f.setAttribute("class","jive_macro jive_macro_"+c);f.className="jive_macro jive_macro_"+c;var a=window.parent.CS_RESOURCE_BASE_URL+"/images/tiny_mce3/plugins/jiveemoticons/images/spacer.gif";if(!o){f.setAttribute("src",a);f.setAttribute("mce_src",a)}else{f.setAttribute("src",o);f.setAttribute("mce_src",o)}}}f.setAttribute("jivemacro",c);var l;var i=null;if(!d.isCollapsed()&&e.getMacroType()!="TEXT"){h=true}else{if(!d.isCollapsed()&&e.getMacroType()=="TEXT"){h=false;var n=d.getStart();var g=d.getEnd();if(n==g){i=n;l=this.getParentNode(k,i);if(e.getMacroType()=="TEXT"){this.appendTextToPre(f,i,m)}if(i.nodeName.toLowerCase()=="td"||i.nodeName.toLowerCase()=="th"){if(i.childNodes.length>0){i.insertBefore(f,i.childNodes[0])}else{i.appendChild(f)}}else{l.insertBefore(f,i);l.removeChild(i)}}else{i=this.getOldestNode(k,d.getNode(),n);var b=this.ageTheNodes(i,g,k.getDoc());i=b[0];g=b[1];l=this.getParentNode(k,i);l.insertBefore(f,i);if(e.getMacroType()=="TEXT"){this.appendTextToPreUntil(k,f,i,g)}}if(e.getMacroType()=="TEXT"){d.select(f.childNodes[0])}else{d.select(f)}d.collapse()}else{h=true;l=this.getParentNode(k,d.getNode());i=d.getNode();if(l==i){i=null}}}if(e.getMacroType()=="TEXT"&&f.childNodes.length==0){f.appendChild(this.createEmptyPara(k.getDoc()))}if(j!=null&&j>=0){var p=e.getParameterSets();if(j<p.length){var j=p[j];this.applyParameterSet(f,e,j)}}return f},insertMacro:function(a,c,b){return this.buildMacro(a,c,b)},execCommand:function(r,j,v){var c=tinyMCE.activeEditor;if(r.indexOf("mceMacroParamSet")==0){var d=r.substr("mceMacroParamSet".length);var t=parseInt(d.substr(0,d.indexOf("_")));var f=parseInt(d.substr(d.indexOf("_")+1));var a=jive.rte.macros[t].getParameterSets()[f];var m=c.selection.getNode();var g=c.dom.getParent(m,function(n){return $def(n.attributes.jivemacro)});if(g!=null){this.applyParameterSet(g,jive.rte.macros[t],a);c.selection.select(g)}return true}if(r.indexOf("mceAddJiveMacro")==0){var e=r.substr("mceAddJiveMacro".length);var a=0;var s=e.indexOf("_");if(s>=0){a=parseInt(e.substr(s+1));e=parseInt(e.substr(0,s))}else{e=parseInt(e)}var q=c.selection;var u=c.getDoc();var t=jive.rte.macros[e];if(t.getUrl().length>0){window.jiveRTE={macro:t,paramSet:a};var h=c.windowManager.open({url:CS_BASE_URL+t.getUrl(),width:500,height:400,inline:1},window.jiveRTE)}else{var b=c.selection.isCollapsed();var l=c.plugins.jivemacros.insertMacro(t,a);var i=c.selection.getNode();if(b){if(t.getMacroType().toLowerCase()=="text"){if(i.nodeName.toLowerCase()=="body"){i.appendChild(l)}else{this.insertAfter(i.parentNode,l,i)}if(l.childNodes.length){var k=l.childNodes[0];var o=true;if(k.childNodes.length==0){k.appendChild(c.getDoc().createElement("BR"));o=true}c.selection.select(k.childNodes[0]);c.selection.collapse(true)}}else{c.selection.setNode(l)}}this.removeDuplicateMacros(c,false);this.fixBodyParagraphs();c.undoManager.add(false,true)}return true}return false},isFirst:function(a,b){if(a.childNodes.length==0){return false}return(a.childNodes[0]==b||this.isFirst(a.childNodes[0],b))},isLink:function(a){if(a==null||a.nodeName.toLowerCase()=="body"){return false}if($def(a)&&$obj(a)&&a!=null&&$def(a.nodeType)&&a.nodeType!=3){if(a.nodeName.toLowerCase()=="a"){return a}else{return this.isLink(a.parentNode)}}return false},isMacro:function(a){while(a!=null&&$obj(a)){if(a.nodeName.toLowerCase()=="body"){return false}if($def(a.nodeType)&&a.nodeType==1&&$def(a.attributes.jivemacro)){return a}a=a.parentNode}return false},isExactMacro:function(a){if(a==null||a.nodeName.toLowerCase()=="body"){return false}if(a!=null&&$obj(a)&&$def(a.nodeType)&&a.nodeType==1){if($def(a.attributes.jivemacro)){return a}else{return false}}return false},getMacroFor:function(c){var d=this.isMacro(c);if(d){var a=d.attributes.jivemacro.nodeValue;for(var b=0;b<jive.rte.macros.length;b++){if(jive.rte.macros[b].getName()==a){return jive.rte.macros[b]}}}return null},createMozBR:function(c){var b=c.createElement("BR");var a;if($def(b.setAttribute)){b.setAttribute("_moz_dirty","");b.setAttribute("type","_moz")}else{a=c.createAttribute("_moz_dirty");a.value="";b.attributes.setNamedItem(a);a=c.createAttribute("type");a.value="_moz";b.attributes.setNamedItem(a)}return b},createEmptyPara:function(b){var a=b.createElement("P");a.appendChild(this.createMozBR(b));return a},findLastKid:function(a){if(a.nodeType==3){return null}if(a.childNodes.length==0){return null}if(this.isMacro(a)||$def(a.tagName)&&a.tagName.toLowerCase()=="table"||$def(a.tagName)&&a.tagName.toLowerCase()=="pre"){return a}return this.findLastKid(a.childNodes[a.childNodes.length-1])},isBR:function(a){if(a.nodeType==3){return false}return a.nodeName.toLowerCase()=="br"},convertDoubleLineBreaksToParagraphs:function(d,k){if(k.nodeType!=1){return}if(!d.dom.isBlock(k)&&k.nodeName.toLowerCase()!="body"){return}if(k.nodeName.toLowerCase()=="pre"){return}if(this.isExactMacro(k)){return}var b;if(k.childNodes.length>0){b=k.childNodes[k.childNodes.length-1]}for(var a=0;a<k.childNodes.length-1;a++){var c=k.childNodes[a];b=k.childNodes[a+1];if(c.nodeType==1&&(c.nodeName.toLowerCase()=="title"||c.nodeName.toLowerCase()=="meta"||c.nodeName.toLowerCase()=="colgroup")){k.removeChild(c);a--}else{if(c.nodeType==1&&(c.nodeName.toLowerCase()=="ol"||c.nodeName.toLowerCase()=="ul")){if(c.childNodes.length==0){k.removeChild(c);a--}}else{if(b.nodeType==1&&(b.nodeName.toLowerCase()=="ol"||b.nodeName.toLowerCase()=="ul")){if(b.childNodes.length==0){k.removeChild(b);a--}}else{if(this.isBR(c)&&this.isBR(b)){var h=d.dom.getParent(c,"li");if(h==null){var g=c.parentNode;var e=g.parentNode;a--;if(g.nodeName.toLowerCase()!="p"){g=c;e=g.parentNode;var f=this.createEmptyPara(d.getDoc());this.insertAfter(e,f,g);c.parentNode.removeChild(c);b.parentNode.removeChild(b);b=f}else{var j=d.getDoc().createElement("p");while(b.nextSibling!=null){j.appendChild(b.nextSibling)}this.insertAfter(e,j,g);this.insertAfter(e,this.createEmptyPara(d.getDoc()),g);c.parentNode.removeChild(c);b.parentNode.removeChild(b);b=j}}}else{this.convertDoubleLineBreaksToParagraphs(d,c)}}}}}if($def(b)){this.convertDoubleLineBreaksToParagraphs(d,b)}},toXML:function(f,b){if(f.nodeType==3){return f.nodeValue+"\n"}var d="";if(f.nodeName.toLowerCase()=="br"){for(var c=0;c<b;c++){d+="  "}return d+"<BR>\n"}for(var c=0;c<b;c++){d+="  "}d+="<"+f.nodeName+">\n";for(var e=0;e<f.childNodes.length;e++){var a=(f!=f.childNodes[e].parentNode);if(a){d+="<error>\n"}d+=this.toXML(f.childNodes[e],b+1);if(a){d+="</error>\n"}}for(var c=0;c<b;c++){d+="  "}d+="</"+f.nodeName+">\n";return d},cloneNodeWithoutKids:function(d){var c=d.ownerDocument;var a=c.createElement(d.nodeName);for(var b=0;b<d.attributes.length;b++){if(d.attributes[b].value!=null){a.setAttribute(d.attributes[b].name,d.attributes[b].value)}}return a},sanitizeXML:function(g){if(g.nodeType!=1){return}var a=false;var c=[];for(var d=0;d<g.childNodes.length;d++){if(g!=g.childNodes[d].parentNode){a=true}else{c.push(g.childNodes[d]);this.sanitizeXML(g.childNodes[d])}}if(g.nodeName.toLowerCase()!="body"){try{var b=this.cloneNodeWithoutKids(g);for(var d=0;d<c.length;d++){b.appendChild(c[d])}g.parentNode.insertBefore(b,g);g.parentNode.removeChild(g)}catch(f){console.log("error in fixIt: "+f.message)}}},fixBodyParagraphs:function(){var f=tinyMCE.activeEditor;var g=f.getBody();var h=f.selection,j=h.getBookmark();this.convertDoubleLineBreaksToParagraphs(f,g);var d=this.findLastKid(g);if(g.childNodes.length>0&&d){var k=f.getDoc();g.appendChild(this.createEmptyPara(k))}for(var e=0;e<g.childNodes.length;e++){var l=g.childNodes[e];if(typeof(l.tagName)!="undefined"){if(l.tagName.toLowerCase()=="img"){var c=f.getDoc().createElement("p");g.insertBefore(c,l);c.appendChild(l)}if(!tinymce.isIE){if(l.nodeType==1&&l.tagName.toLowerCase()=="p"){if(l.childNodes.length==0){l.appendChild(this.createMozBR(f.getDoc()))}}}}if(l.nodeType==3||$j(l).css("display")=="inline"){var a=new RegExp(/^[\s\f\n\r\t\v\u00A0\u2028\u2029\u0240]$/);if(l.nodeType==3&&!a.test(l.nodeValue)||l.nodeType!=3){var c=f.getDoc().createElement("p");f.getBody().insertBefore(c,l);e++;do{c.appendChild(l);if(l.nodeType==1&&l.nodeName.toLowerCase()=="br"){break}l=null;if(e<g.childNodes.length){l=g.childNodes[e]}e--}while(l!=null&&(l.nodeType==3||$j(l).css("display")=="inline"))}else{if(l.nodeType==3&&a.test(l.nodeValue)){l.parentNode.removeChild(l);e--}}}}if(typeof(this.typingInBody)!="undefined"&&this.typingInBody){h.moveToBookmark(j);this.typingInBody=false}},lastNodeChanged:null,lastScrollY:0,ensureParaEndsWithBr:function(b,d){if(tinymce.isIE){return}if(d.childNodes.length==0){d.appendChild(this.createMozBR(b.getDoc()))}else{var c=false;var a=d;while(!c&&a.nodeType==1&&a.childNodes.length>0){var e=a.childNodes[a.childNodes.length-1];if(e.nodeType==1&&e.nodeName.toLowerCase()=="br"){c=true}else{a=e}}if(!c){d.appendChild(this.createMozBR(b.getDoc()))}}},nodeChanged:function(b,a,d,e){if(d.nodeType==1&&d.nodeName.toLowerCase()=="p"){this.ensureParaEndsWithBr(b,d)}var c=this.getMacroFor(d);if(a.get("justifyleft")){if(c!=null){a.get("justifyleft").setDisabled(true);a.get("justifycenter").setDisabled(true);a.get("justifyright").setDisabled(true);a.get("justifyfull").setDisabled(true)}else{a.get("justifyleft").setDisabled(false);a.get("justifycenter").setDisabled(false);a.get("justifyright").setDisabled(false);a.get("justifyfull").setDisabled(false)}}b.plugins.jivemacros.removeDuplicateMacros(b,true)},validateMacroElements:function(c,a){a=$j(a);var d=c.getHiddenContainer();var b=c.getUIDForElement(a);while(b==null||c.getRTEElementFor(b).length>1){a=a.filter(":first");if(b!=null){a.removeClass("_jivemacro_uid"+b)}b=c.generateUID();a.addClass("_jivemacro_uid"+b);a.attr("_jivemacro_uid",b)}var e=null;d.children().each(function(){if($j(this).attr("id")==b){e=$j(this)}});if(e==null){e=$j("<div id='"+b+"' class='richContent'></div>");d.append(e)}return e},removeDeletedMacros:function(f){var a=window.editor.get(f.id);if(a!=null&&typeof(a)=="object"){var h=a.getWindow();var l=a.getDoc();var k=(h.pageYOffset)?(h.pageYOffset):(l.documentElement)?l.documentElement.scrollTop:l.body.scrollTop;var e=a.getHiddenContainer();e.css("top",-1*k);var b=e.children(".richContent");for(var d=0;d<b.length;d++){var j=$j(b[d]);var g=j.attr("id");var c=$j(a.getBody()).find("._jivemacro_uid"+g);if(c.length==0){a.removeMacroWithUID(g)}}}},removeDuplicateMacros:function(g,e){this.removeDeletedMacros(g);if(!tinymce.isIE){var c=g.getDoc().getElementsByTagName("td");for(var f=0;f<c.length;f++){var j=c[f];if(j.childNodes.length==0){j.appendChild(this.createMozBR(g.getDoc()))}}var c=g.getDoc().getElementsByTagName("th");for(var f=0;f<c.length;f++){var j=c[f];if(j.childNodes.length==0){j.appendChild(this.createMozBR(g.getDoc()))}}}var c=g.getDoc().getElementsByTagName("p");for(var f=0;f<c.length;f++){c[f].style.height=""}var a=window.editor.get(g.id);if(a!=null&&typeof(a)=="object"){var b=$j(g.getBody()).find(".jive_text_macro, .jive_macro");for(var f=0;f<b.length;f++){var j=b[f];if(this.isExactMacro(j)){var d=this.getMacroFor(j);if(d!=null&&d.usesCustomBackground()){var h=g.plugins.jivemacros.validateMacroElements(a,j);d.refreshPosition(a,j,h)}if(d!=null&&!e){d.refresh(a,j)}}}}},collapseToStart:null,insertAfter:function(c,b,a){if(a.nextSibling){return c.insertBefore(b,a.nextSibling)}else{return c.appendChild(b)}},putCursorAfter:function(a,e){var f=a.selection;var d;if(e.nextSibling==null||e.nextSibling.nodeName.toLowerCase()=="br"){var b=a.dom.getParent(e,function(h){return function(i){return i==a.getBody()||i!=h}}(e));if(tinymce.isWebKit){var g=a.getDoc().createElement("span");g.innerHTML="&nbsp;"}else{var g=a.getDoc().createTextNode(" ")}this.insertAfter(b,g,e);d=g}else{d=e.nextSibling}f.select(d);if(d.nodeType==3&&d.nodeValue.length<=1){f.collapse(true)}else{if(d.nodeType==3&&d.nodeValue.length>1){var c=f.getRng();c.setStart(d,tinymce.isWebKit?1:0);c.setEnd(d,tinymce.isWebKit?1:0);f.setRng(c)}else{if(d.nodeType==1&&d.childNodes.length>0){var c=f.getRng();c.setStart(d,tinymce.isWebKit?1:0);c.setEnd(d,tinymce.isWebKit?1:0);f.setRng(c)}else{f.collapse(true)}}}},putCursorBefore:function(b,d){if(d.previousSibling!=null){var f=d.previousSibling;var e=b.selection;var a;if(e.getSel().getRangeAt){a=e.getSel().getRangeAt(0)}else{a=document.createRange();a.setStart(e.getSel().anchorNode,e.getSel().anchorOffset);a.setEnd(e.getSel().focusNode,e.getSel().focusOffset)}var c=0;while(f.nodeType!=3&&f.nodeType==1&&f.childNodes&&f.childNodes.length!=0){f=f.childNodes[f.childNodes.length-1]}if(f.nodeType==3){c=f.nodeValue.length;a.setStart(f,c);a.setEnd(f,c);b.selection.setRng(a)}else{b.selection.select(f);b.selection.collapse(true)}return}},isLastNodeOf:function(c,b,a){if(b.childNodes.length>0&&b.childNodes[b.childNodes.length-1].nodeType==3&&c.getRng().startContainer!=b.childNodes[b.childNodes.length-1]){return false}if(b==a){return true}if(b.nextSibling!=null){return false}return this.isLastNodeOf(b.parentNode,a)},isFirstNodeOf:function(c,b,a){if(b.childNodes.length>0&&b.childNodes[0].nodeType==3&&c.getRng().startContainer!=b.childNodes[0]){return false}if(b==a){return true}if(b.previousSibling!=null){return false}return this.isLastNodeOf(b.parentNode,a)},killYourself:function(){clearInterval(this.intervalId)},init:function(a,b){this.url=b;for(var d=0;d<jive.rte.macros.length;d++){if(jive.rte.macros[d].getName()=="emoticon"){macro=jive.rte.macros[d]}}this.emoticon=macro;var c=this;var e=false;a.onKeyUp.addToTop(function(f,g){e=!f.selection.isCollapsed()},this);a.onMouseUp.addToTop(function(f,g){e=!f.selection.isCollapsed()},this);a.onKeyUp.addToTop(function(f,g){if(e&&(g.keyCode==8||g.keyCode==46)){f.undoManager.add(false,true)}},this);a.addCommand("mceJiveMacros",function(){var f=this.controlManager;var g=f.get("jivemacros");g.showMenu()});a.addCommand("mceEditJiveMacro",function(){var h=tinyMCE.activeEditor;var i=h.plugins.jivemacros.macro;var f=i.getAllowedParameters().length*28+88;if(i.getUrl().length>0){window.jiveRTE=new Object();window.jiveRTE.macro=i;window.jiveRTE.node=h.dom.getParent(h.selection.getNode(),h.plugins.jivemacros.isExactMacro);var g=h.windowManager.open({url:CS_BASE_URL+i.getUrl(),width:500,height:400,inline:1},{macro:i})}else{h.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/jivemacros/macro.htm",width:400,height:f,inline:1},{plugin_url:b,macro:i,cs_resource_base_url:CS_RESOURCE_BASE_URL})}});a.addCommand("mceDeleteJiveMacro",function(){var f=tinyMCE.activeEditor;this.deleteMacro(f,f.selection.getNode())},this);a.initialized=false;a.onBeforeGetContent.add(function(f){if(f.initialized){this.fixBodyParagraphs()}},this);a.onInit.add(function(){var f=tinyMCE.activeEditor,g=this;f.initialized=true;this.intervalId=setInterval(function(){try{if(f.destroyed){clearInterval(g.intervalId);return}var h=f.selection.getNode();var j=f.getWin().scrollY;if(h!=f.plugins.jivemacros.lastNodeChanged||f.plugins.jivemacros.isMacro(h)){f.plugins.jivemacros.removeDuplicateMacros(f,false)}else{if(j!=f.plugins.jivemacros.lastScrollY){f.plugins.jivemacros.removeDuplicateMacros(f,true)}}f.plugins.jivemacros.lastNodeChanged=h;f.plugins.jivemacros.lastScrollY=j}catch(i){console.log("error in setInterval");console.log(i)}},300);f.onMouseUp.add(function(i,k){var j=k.target;if(i.selection.isCollapsed()&&j.nodeName.toLowerCase()=="html"){var h=i.getBody();if(h){if(h.childNodes.length==0){i.plugins.jivemacros.fixBodyParagraphs()}while(h.nodeType==1&&h.childNodes.length){h=h.childNodes[h.childNodes.length-1]}}i.selection.select(h);if(h.nodeType==1&&h.nodeName.toLowerCase()=="br"){i.selection.collapse(true)}else{i.selection.collapse()}}});if(f&&f.plugins.contextmenu){f.plugins.contextmenu.onContextMenu.add(function(h,o,t){var l,u=f.selection,j=u.getNode()||f.getBody();var q=f.dom.getParent(j,function(i){return i==f.getBody()||f.plugins.jivemacros.isExactMacro(i)});if(!f.plugins.jivemacros.isExactMacro(q)){q=null}var n=null;var r=-1;var s=false;if(q!=null){for(var p=0;p<jive.rte.macros.length;p++){if(jive.rte.macros[p].getName()==q.attributes.jivemacro.value){n=jive.rte.macros[p];r=p;if(n.getName()=="code"){if(q.attributes.___default_attr.value=="html"){s=true}}}}}window.jiveRTE=new Object();window.jiveRTE.macroEle=q;if(n!=null){f.plugins.jivemacros.macro=n;o.removeAll();if(q.nodeName.toLowerCase()=="a"&&(n.getName()=="document"||n.getName()=="blogpost"||n.getName()=="thread"||n.getName()=="message"||n.getName()=="blog"||n.getName()=="community"||n.getName()=="space"||n.getName()=="user"||n.getName()=="project"||n.getName()=="task"||n.getName()=="group")){o.add({title:"jivemacros.unlink",cmd:"mceDeleteJiveMacro"})}else{var w=n.getParameterSets();if(w.length>1){if(n.getName()!="code"||!s){var k=f.getLang("jivemacros.macro."+n.getName()+".presets","jivemacros.presets");l=o.addMenu({title:k,max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu",icon:"jiveMacroPreset"});for(var p=0;p<w.length;p++){if(n.getName()!="code"||w[p].name!="html"){var v=f.getLang("jivemacros.macro."+n.getName()+".preset."+w[p].name,w[p].name);l.add({title:v,cmd:"mceMacroParamSet"+r+"_"+p,icon:"jiveMacro_"+n.getName()+"_"+w[p].name})}}}}if(n.getAllowedParameters().length>0&&n.isShowSettings()){o.add({title:"jivemacros.properties",icon:"jiveMacroProperties",cmd:"mceEditJiveMacro",ui:true})}o.add({title:"jivemacros.remove",icon:"jiveMacroDelete",cmd:"mceDeleteJiveMacro",ui:true})}}else{this.macro=null}})}},this);a.onEvent.add(function(f){return function(){f.plugins.jivemacros.removeDeletedMacros(f)}}(a));a.onNodeChange.add(this.nodeChanged,this);a.onExecCommand.add(function(f,h,g,i){switch(h){case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableRowUp":case"mceTableRowDown":case"mceTableColLeft":case"mceTableColRight":f.plugins.jivemacros.lastNodeChanged=null}});a.onKeyPress.addToTop(function(g,f){if(this.collapseToEnd!=null||this.collapseToStart!=null){tinymce.dom.Event.cancel(f)}var h=this.isMacro(g.selection.getNode());if(g.dom.hasClass(h,"default_title")){g.dom.removeClass(h,"default_title")}g.selection.lastSelected=g.selection.getNode()},this);a.onKeyDown.addToTop(function(j,s){if((s.keyCode==8||s.keyCode==46)&&!j.selection.isCollapsed()){j.undoManager.add(false,true)}j.selection.lastSelected=j.selection.getNode();var x=j.selection;var g=this.isMacro(x.getNode())||this.isLink(x.getNode());if((s.keyCode==37)&&g){var y=0;if(tinymce.isWebKit){y=1}var z=x.getRng().startOffset==y&&this.isFirstNodeOf(x,x.getNode(),g);z=z||j.dom.hasClass(g,"default_title");if(z){this.collapseToStart=g;x.select(g);x.collapse(true);tinymce.dom.Event.cancel(s);return false}}if((s.keyCode==39)&&g){if(g.childNodes.length==0){this.collapseToEnd=g;tinymce.dom.Event.cancel(s);return false}else{var u=x.getRng().startOffset==(x.getNode().childNodes[x.getNode().childNodes.length-1].nodeValue.length)&&this.isLastNodeOf(x,x.getNode(),g);u=u||j.dom.hasClass(g,"default_title");if(u){this.collapseToEnd=g;x.select(g);x.collapse();tinymce.dom.Event.cancel(s);return false}}}var o=j.getBody();if(o.childNodes.length>0){var v=j.selection.getNode();this.before=v;if(s.keyCode==13&&this.before.tagName=="PRE"){if(tinymce.isIE){var t=j.dom.getParent(v,"pre");tinymce.dom.Event.cancel(s);var l=j.selection.getSel().createRange();l.text="\n ";l.select();return}else{if(tinymce.isWebKit){tinymce.dom.Event.cancel(s);var h=j.selection.getNode().childNodes;var p=j.selection.getRng();if(h.length==0){j.selection.getNode().appendChild(j.getDoc().createTextNode("\n"))}else{var w=h[0].nodeValue;var k=Math.min(p.startOffset,w.length);var i=w.substr(0,k);var f=(k<w.length)?w.substr(k):"";h[0].nodeValue=i+"\n"+f;var m=f.substr(0,1);j.getWin().find(m,true,false,false,false,false,false);var A=j.selection;if(m=="\n"||m=="\r"){var q=A.getRng().cloneRange();j.getDoc().execCommand("SelectAll",false,null);q.setEnd(q.endContainer,q.endOffset+1);q.setStart(q.startContainer,q.startOffset+1);A.setRng(q)}A.collapse(true)}}}}}},this);a.onKeyUp.add(function(m,q){if(m.selection.getNode().nodeName.toLowerCase()=="body"&&!q.ctrlKey&&!q.altKey&&!q.shiftKey&&q.keyCode!=91&&q.keyCode!=92&&q.keyCode!=17&&q.keyCode!=18){this.typingInBody=true;this.fixBodyParagraphs()}if(q.keyCode==13){m.plugins.jivemacros.removeDuplicateMacros(m,false)}if(q.keyCode==90&&q.ctrlKey&&(m.selection.getNode().nodeName.toLowerCase()=="body"&&m.selection.lastSelected&&m.selection.lastSelected.nodeName.toLowerCase()!="body")){var n=m.selection.lastSelected;if(n.childNodes.length){n=n.childNodes[n.childNodes.length-1];m.selection.select(n);m.selection.collapse(true)}else{m.selection.select(n);m.selection.collapse()}}var j=m.selection;if(this.collapseToStart!=null){this.putCursorBefore(m,this.collapseToStart);tinymce.dom.Event.cancel(q);this.collapseToStart=null;return}if(this.collapseToEnd!=null){this.putCursorAfter(m,this.collapseToEnd);tinymce.dom.Event.cancel(q);this.collapseToEnd=null;return}if(this.before!=null&&(q.keyCode==39||q.keyCode==40)){var g=m.dom.getParent(m.selection.getNode(),"PRE");if(this.before.tagName!="PRE"&&g){if(this.before.childNodes.length==1&&this.before.childNodes[0].tagName=="BR"){var o=m.dom.getParent(this.before,function(p){return function(s){return s==m.getBody()||s!=p}}(this.before));if(o.childNodes[0]==this.before){o.removeChild(this.before);this.before=g;m.nodeChanged(false,true)}}}}m.plugins.jiveemoticons.encodeSmileys(m,m.selection.getNode());if(q.keyCode==37||q.keyCode==38){var j=m.selection;var k=m.dom.getParent(j.getNode(),function(p){return p==m.getBody()||m.plugins.jivemacros.isExactMacro(p)});if(!m.plugins.jivemacros.isExactMacro(k)){k=null}if(k==null){return}var l=this.isFirst(m.getBody(),k);var i=this.isMacro(k);var f=j.getBookmark().start==0||j.getRng().startOffset==0;if(l&&i&&f&&j.isCollapsed()){var h=m.getDoc().createElement("P");var r=m.getDoc().createElement("BR");h.appendChild(r);m.getBody().insertBefore(h,m.getBody().childNodes[0]);m.nodeChanged(false,true);return true}}},this)},getInfo:function(){return{longname:"Jive Macros",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},generateMacroMenu:function(c,f){var e=tinyMCE.activeEditor;var b=jive.rte.macros[f];var j=b.getParameterSets();var g=e.getLang("jivemacros.macro."+b.getName(),b.getName());if(j.length>1){var a=c.addMenu({title:g,max_height:"200","class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu",icon:"jiveMacro_"+b.getName()});for(var d=0;d<j.length;d++){var h=e.getLang("jivemacros.macro."+b.getName()+".preset."+j[d].name,j[d].name);if(j[d].name=="html"&&b.getName()=="code"){c.add({cmd:"mceAddJiveMacro"+f+"_"+d,title:h,max_height:"200",icon:"jiveMacro_"+b.getName()})}else{a.add({title:h,cmd:"mceAddJiveMacro"+f+"_"+d,icon:b.getName()+"_"+j[d].name})}}}else{if(j.length==1){var h=e.getLang("jivemacros.macro."+b.getName()+".preset."+j[0].name,j[0].name);c.add({cmd:"mceAddJiveMacro"+f,title:h,max_height:"200",icon:"jiveMacro_"+b.getName()})}else{c.add({cmd:"mceAddJiveMacro"+f,title:g,max_height:"200",icon:"jiveMacro_"+b.getName()})}}},createControl:function(i,a){switch(i){case"jivemacros":var h=a.createSplitButton("jivemacros",{title:"jivemacros.add",cmd:"mceJiveMacros"});for(var e=0;e<jive.rte.macros.length;e++){if(jive.rte.macros[e].isShowInMacroList()&&jive.rte.macros[e].getName()!="emoticon"&&!jive.rte.macros[e].isButton()){h.onRenderMenu.add(function(c){return function(l,j){var k=tinyMCE.activeEditor;k.plugins.jivemacros.generateMacroMenu(j,c)}}(e))}}return h;case"extra":var d=tinyMCE.activeEditor;for(var e=0;e<jive.rte.macros.length;e++){if(jive.rte.macros[e].isShowInMacroList()&&jive.rte.macros[e].getName()!="emoticon"&&jive.rte.macros[e].isButton()){var f=jive.rte.macros[e];var g=f.getParameterSets();var b=d.getLang("jivemacros.macro."+f.getName(),f.getName());if(g.length>1){var h=a.createSplitButton("extra",{title:b,image:"../jscripts/tiny_mce/plugins/example/img/example.gif",icon:"jiveMacro_"+f.getName(),cmd:"mceAddJiveMacro"+e});h.onRenderMenu.add(function(c){return function(n,j){for(var k=0;k<g.length;k++){var l=d.getLang("jivemacros.macro."+f.getName()+".preset."+g[k].name,g[k].name);j.add({title:l,cmd:"mceAddJiveMacro"+c+"_"+k,icon:f.getName()+"_"+g[k].name})}}}(e));return h}else{var h=a.createButton("extra",{title:b,cmd:"mceAddJiveMacro"+e,icon:"jiveMacro_"+f.getName()});return h}}}}return null}});tinymce.PluginManager.add("jivemacros",tinymce.plugins.JiveMacrosPlugin)})();
;
tinyMCE.addI18n('en.jivemacros',{
    unlink : "Unlink",
    add : 'Insert',
    remove : 'Remove',
    properties : 'Settings',
    title : 'Settings',
    presets : 'Presets',
    save: "Save",
    params : 'Parameters',
    'macro.toc': "Table of Contents",
    'macro.quote': "Quote",
    'macro.user': "User",
    'macro.youtube': "YouTube",
    'macro.youtube.attr.__default_attr': "URL or Video ID",
    'macro.youtube.attr.width': "Width",
    'macro.youtube.attr.height': "Height",
    'macro.emoticon.presets': "Emoticons",
    'macro.code': "Syntax Highlighting",
    'macro.code.presets': "Format",
    'macro.code.attr.__default_attr': "Format",
    'macro.code.preset.plain': "Plain",
    'macro.code.preset.sql': "SQL",
    'macro.code.preset.java': "Java",
    'macro.code.preset.html': "Insert Raw HTML",
    'macro.code.preset.xml': "XML",
    'macro.emoticon.preset.angry': "Angry",
    'macro.emoticon.preset.blush': "Blush",
    'macro.emoticon.preset.confused': "Confused",
    'macro.emoticon.preset.cool': "Cool",
    'macro.emoticon.preset.cry': "Cry",
    'macro.emoticon.preset.devil': "Devil",
    'macro.emoticon.preset.grin': "Grin",
    'macro.emoticon.preset.happy': "Happy",
    'macro.emoticon.preset.laugh': "Laugh",
    'macro.emoticon.preset.love': "Love",
    'macro.emoticon.preset.mischief': "Mischief",
    'macro.emoticon.preset.plain': "Plain",
    'macro.emoticon.preset.sad': "Sad",
    'macro.emoticon.preset.shocked': "Shocked",
    'macro.emoticon.preset.silly': "Silly",
    'macro.emoticon.preset.wink': "Wink",
    'macro.emoticon.preset.info': "Info",
    'macro.emoticon.preset.plus': "Plus",
    'macro.emoticon.preset.minus': "Minus",
    'macro.emoticon.preset.alert': "Alert"
});

;
tinyMCE.addI18n('en.jivemacros',{
    add : 'Insert',
    remove : 'Remove',
    properties : 'Settings',
    title : 'Settings',
    params : 'Parameters',
    presets : 'Presets',
    save: "Save"
});

;
// Plugin static class
(function() {

    tinymce.create('tinymce.plugins.JiveEmoticonsPlugin', {

        before : null,
        macro : null,

        shouldEncodeHuh : function(ed, n){
            var macroEle = ed.dom.getParent(n, function(ele){
                return ele == ed.getBody() || ed.plugins.jivemacros.isMacro(ele);
            });
            if(!ed.plugins.jivemacros.isMacro(macroEle)) macroEle = null;
            if(macroEle != null){
                var macro = ed.plugins.jivemacros.getMacroFor(macroEle);
                if(macro.getName() == "code") return false;
            }
            return true;
        },

        encodeSmileys : function(ed, n){
            var tofix = new Array();
            var that = this;
            var shorts = [
                [":D",  "grin",     ":D"],
                [":x",  "love",     ":x"],
                [";\\", "mischief", ";\\\\"],
                ["B-)", "cool",     "B-\\)"],
                ["]:)", "devil",    "\\]:\\)"],
                [":p",  "silly",    ":p"],
                [":P",  "silly",    ":P"],
                ["X-(", "angry",    "X\\-\\("],
                [":^0", "laugh",    ":^0"],
                [";)",  "wink",     ";\\)"],
                [":8}", "blush",    ":8}"],
                [":0",  "laugh",    ":0"],
                [":o",  "shocked",  ":o"],
                [":)",  "happy",    ":\\)"],
                [":(",  "sad",      ":\\("],
                ["(+)", "plus",     "\\(\\+\\)"],
                ["(-)", "minus",    "\\(\\-\\)"],
                ["(!)", "alert",    "\\(!\\)"],
                ["(i)", "info",     "\\(i\\)"]
            ];

            // Creates a single regular expression to match any shortcode.
            var combinedShortcodes = shorts.map(function(short) {
                short.last();
            }).join('|');

            var testForAnyEmoticon = new RegExp('(' + combinedShortcodes + ')', 'g');
            if(!testForAnyEmoticon.test(n.innerHTML)){
                return;
            }

            function encodeSmileysHelper(n){
                var firstNode = n;

                if(n.nodeType == 3 && n.previousNode != null && n.previousNode.nodeType == 3){
                    // this is a text node, with a text node before it
                    // but that means that we've already processed this node,
                    // since we process left to right and process all adjacent
                    // text nodes at one time.
                    //
                    // just return
                    return;
                }

                if(n.nodeType == 3){
                    // the goal is to merge the values of all the adjacent
                    // text nodes into one giant long string.
                    //
                    // then we'll loop over that string to find the index
                    // of where each emoticon matches according to our
                    // regex rules
                    //
                    // when we get a valid match, the index of that match
                    // will translate back to a text node, which we'll then
                    // split apart and insert an emoticon between them
                    //
                    // there may also be the case where an emoticon spans
                    // between two text nodes. in that case, then values of
                    // those two nodes will be modified to remove the emoticon
                    // text between them, and the emoticon node will be inserted
                    // between them. special care needs to be taken if either
                    // of the text nodes ends up with an empty nodeValue.



                    var combinedValue = "";
                    do{
                        combinedValue += n.nodeValue;
                    }while((n = n.nextSibling) && n != null && n.nodeType == 3);

                    // check to see if this group of text nodes
                    // contains an emoticon
                    var testForAnyEmoticon = new RegExp('(' + combinedShortcodes + ')', 'g');
                    if(!testForAnyEmoticon.test(combinedValue)){
                        return;
                    }
                    // now we have the String that represents all
                    // adjacent text nodes. find all emoticons
                    // in that string and record the index,
                    // shortcode, and emoticon name
                    var swaps = new Array();
                    for(var i=0;i<shorts.length;i++){
                        var tempIndex = 0;
                        var tempValue = combinedValue;
                        while(tempValue.length > 0){
                            var name = shorts[i][1];
                            var r1 = new RegExp('(' + shorts[i][2] + ')', 'g');
                            var r2 = new RegExp('(\\S' + shorts[i][2] + ')', 'g');
                            var r3 = new RegExp('(\\xA0' + shorts[i][2] + ')', 'g'); //  \\xA0 is the nonbreaking space
//                            var r4 = new RegExp('(\\S\\xA0)', 'g');

                            var r5 = new RegExp('(' + shorts[i][2] + '\\S)', 'g');
                            var r6 = new RegExp('(' + shorts[i][2] + '\\xA0)', 'g'); //  \\xA0 is the nonbreaking space

                            var index = tempValue.indexOf(shorts[i][0]);
    //                        console.log("testing for emoticons: " + v);
                            if(r1.test(tempValue)){
                                var R2 = r2.test(tempValue);
                                var R3 = r3.test(tempValue);
                                var R5 = r5.test(tempValue);
                                var R6 = r6.test(tempValue);
                                var left = ((!R2) || R3);
                                var prev = null;
                                var temp = null;
                                var right = ((!R5) || R6);
                                if(left && right){
                                    swaps.push([tempIndex + index, shorts[i][0], name]);
                                }

                                tempValue = tempValue.substr(index+1);
                                tempIndex = tempIndex + index + 1;
                            }else{
                                tempValue = "";
                            }
                        }
                    }
                    if(swaps.length){
                        //
                        // we've found a list of emoticons that need
                        // replacing in the String. sort that list
                        // in reverse order, so that we start replacing
                        // emoticons from last to first. This'll ensure
                        // that our index's won't change as we begin
                        // to remove the emoticon shortcodes from the
                        // text nodes
                        swaps.sort(function(a, b){
                            if(a[0] < b[0]) return 1;
                            return -1;
                        });
                        for(var i=0;i<swaps.length;i++){
                            var index = swaps[i][0];
                            var n = firstNode;
                            //
                            // find the text node that includes the
                            // given index for the emoticon
                            while(n.nodeType == 3 && index >= n.nodeValue.length){
                                index -= n.nodeValue.length;
                                n = n.nextSibling;
                            }

                            // if we're not playing with text nodes anymore
                            // then we need to bail. this can happen if we're
                            // inserting an emoticon and splitting apart
                            // text nodes who used to be siblings
                            if(n.nodeType != 3) return;


                            if(index + swaps[i][1].length > n.nodeValue.length){
                                //
                                // if this happens, then the text node does not
                                // fully include the emoticon. we need to merge
                                // the text nodes so that the first text node
                                // fully includes the emoticon shortcode, and the
                                // nextSibling no longer contains any of the shortcode
                                var numOfCharsToSteal = index + swaps[i][1].length - n.nodeValue.length;
                                if(n.nextSibling == null || n.nextSibling.nodeType != 3 || n.nextSibling.nodeValue.length < numOfCharsToSteal){
                                    // impossible! we're looking at the concat'd text
                                    // of all nodes and we found an emoticon here...
                                    // somethings is way wrong. bail.
                                    return;
                                }
                                if(n.nextSibling.nodeValue.length == numOfCharsToSteal){
                                    n.nodeValue += n.nextSibling.nodeValue;
                                    n.parentNode.removeChild(n.nextSibling);
                                }else{
                                    n.nodeValue += n.nextSibling.nodeValue.substr(0, numOfCharsToSteal);
                                    n.nextSibling.nodeValue = n.nextSibling.nodeValue.substr(numOfCharsToSteal);
                                }
//                                console.log("merged two text nodes that were splitting an emoticon");
                            }

                            // now we know that our emoticon starts inside
                            // the n node. confirm that it also ends in this
                            // node, or if it spills over into the next node
                            //
                            // this should always be true, since we just fixed
                            // this exact case in the code block above. If this
                            // fails, then that means the DOM no longer reflects
                            // what it did when we first looked for emoticon
                            // replacements
                            if(index + swaps[i][1].length <=  n.nodeValue.length){
                                var anchorNode = ed.selection.getSel().anchorNode;
                                var anchorOffset = ed.selection.getSel().anchorOffset;
                                var isAfter = false; // used for IE instead of anchorNode and anchorOffset
                                if(!$def(anchorOffset)){
                                    // we're in IE, so we need to fake it
                                    // look at the last X characters that the user
                                    // typed, and see if they match the shortcode.
                                    // if so, then we need to put the cursor immediately
                                    // after the newly inserted emoticon
                                    var r = ed.selection.getRng();
                                    r.moveStart("character", -swaps[i][1].length)
                                    isAfter = r.findText(swaps[i][1]);
                                }

                                var b = ed.selection.getBookmark();
                                var newRightText = n.nodeValue.substr(index + swaps[i][1].length);
                                var newLeftText = n.nodeValue.substr(0, index);
//                                console.log("swapping emoticon " + swaps[i][1] + " at index: " + index + " in \"" + n.nodeValue + "\"");
                                if(newRightText.length){
                                    // we're splitting a text node
                                    // in half. create a new text node
                                    var newRightNode = ed.getDoc().createTextNode(newRightText);
                                    n.parentNode.insertBefore(newRightNode, n);
                                    n.parentNode.insertBefore(n, newRightNode);
                                }
                                // create the emoticon macro
                                // and add it to the dom
                                var emote = ed.getDoc().createElement('IMG');
                                emote.setAttribute("class", "jive_macro jive_emote");
                                emote.setAttribute("jivemacro", "emoticon");
                                emote.setAttribute("___jive_emoticon_name", swaps[i][2]);
                                emote.setAttribute("src", window.CS_RESOURCE_BASE_URL + '/images/emoticons/' + swaps[i][2] + '.gif');
                                emote.setAttribute("mce_src", window.CS_RESOURCE_BASE_URL + '/images/emoticons/' + swaps[i][2] + '.gif');
                                n.parentNode.insertBefore(emote, n);
                                n.parentNode.insertBefore(n, emote);

                                // now fix or remove the text node
                                // that we found the shortcode in
                                if(newLeftText.length){
                                    n.nodeValue = newLeftText;
                                }else{
                                    n.parentNode.removeChild(n);
                                }

                                if(n == anchorNode && anchorOffset == (index + swaps[i][1].length) || isAfter){
                                    // this case happens when a user types
                                    // an emoticon shortcode that should be
                                    // immediately replaced. this is 99% of
                                    // the time
//                                    console.log("cursor was immediately after the img");
                                    ed.selection.select(emote);
                                    ed.selection.collapse();
                                }else if(n == anchorNode && anchorOffset >= index + swaps[i][1].length){
                                    // this case happens when an emoticon should
                                    // be replaced because it is now no longer
                                    // next to other text.
                                    //
                                    // example: (  | is the cursor)
                                    // "hand me my nose ring :)|!!!"
                                    // =>
                                    // "hand me my nose ring :) |!!!"
                                    //
                                    // in that example, the cursor should be
                                    // one space away from the emoticon that's
                                    // swapped out.
                                    //
                                    // the code below gets it 2 characters away
                                    // which is close. adjusting the bookmark
                                    // location doesn't seem to get it exact :/
//                                    console.log("cursor was elsewhere after the emoticon");
                                    b.start -= (swaps[i][1].length + 1);
                                    b.end -= (swaps[i][1].length + 1);
//                                    console.log(b);
                                    ed.selection.moveToBookmark(b);
                                }else{
                                    //
                                    // this case happens when the user
                                    // pastes in some text that has emoticons
                                    // to replace. the cursor is nowhere near
                                    // the emoticon that's replaced, so just
                                    // move the bookmark back to where it was.
                                    //
                                    // this is also off by a couple of characters
                                    // since we've changed:
                                    //  1) the number of characters in the document
                                    //  2) the number of nodes in the document
                                    //
                                    // it'll be close, but not exact. possible cursor
                                    // jump for a few characters
//                                    console.log("cursor was not close to emote (" + anchorOffset + " vs " + (index + swaps[i][1].length) + ")");
                                    ed.selection.moveToBookmark(b);
                                }

//                                console.log("swapped " + swaps[i][1]);
                            }else{
                                // bail, the DOM isn't what it was when
                                // we first found the replacement index
                                return;
                            }
                        }
                    }
                }else{
                    if(n.nodeName.toLowerCase() == "br") return;
                    if(that.shouldEncodeHuh(ed, n)){
                        for(var i=0;i<n.childNodes.length;i++){
                            encodeSmileysHelper(n.childNodes[i]);
                        }
                    }
                }
            }

            /*
            console.log("************************************");
            console.log("begin emoticon");
            console.log(ed.plugins.jivemacros.toXML(n, ""));
            */

//            var b = ed.selection.getBookmark();
            encodeSmileysHelper(n);
//            ed.selection.moveToBookmark(b);

//            for(var i=0;i<tofix.length;i++){
//                removeSurroundingSpans(tofix[i]);
//            }

        },


        nodeChanged : function(ed){
            if(this.before == null){
                this.before = ed.selection.getNode();
            }
            this.encodeSmileys(ed, this.before);
            this.before = ed.selection.getNode();
        },

        init : function(ed, url){
            var macro = null;
            for(var i=0;i<jive.rte.macros.length;i++){
                if(jive.rte.macros[i].getName() == "emoticon"){
                    macro = jive.rte.macros[i]
                }
            }
            if(macro != null){
                this.macro = macro;
//                ed.onNodeChange.add(this.nodeChanged, this);
            }

             // Is it's Opera or older FF use key handler
            if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
                ed.onKeyDown.add(function(ed, e) {
                if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
                    setTimeout(function(that, ed){ return function(){
                            that.encodeSmileys(ed, ed.getBody());
                        }
                    }(this, ed), 33);
                }, this);
            } else {
                // Grab contents on paste event on Gecko and WebKit
                ed.onPaste.addToTop(function(ed, e) {
                    setTimeout(function(that, ed){ return function(){
                            that.encodeSmileys(ed, ed.getBody());
                        }
                    }(this, ed), 33);
                }, this);
            }

        },

        /**
         *
         * @param cn
         * @param cm
         */
        execCommand : function(cmd, ui, val){
            if(cmd == 'mceJiveEmoticon'){
                var cm = tinyMCE.activeEditor.controlManager;
                var button = cm.get('jiveemoticons');
                button.showMenu();
                return true;
            }
            return false;
        },

        getInfo : function() {
            return {
                longname : 'Emoticons',
                author : 'Jive Software',
                authorurl : 'http://jivesoftware.com',
                infourl : 'http://jivesoftware.com',
                version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
            };
        },

        /**
         * Returns the HTML contents of the emoticons control.
         */
        createControl : function(n, cm) {
            switch(n){
                case 'jiveemoticons':
                    var c = cm.createSplitButton('jiveemoticons', {
                        title : 'jiveemoticons.desc',
                        cmd : "mceJiveEmoticon"
                    });
                    c.onRenderMenu.add(function(c, m) {
                        var ed = tinyMCE.activeEditor;
                        for(var j=0;j<jive.rte.macros.length;j++){
                            var macro = jive.rte.macros[j];
                            if(macro.isShowInMacroList() && macro.getName() == "emoticon"){
                                // presets menu
                                var paramSets = macro.getParameterSets();
                                for(var i=0;i<paramSets.length;i++){
                                    // mceMenuItemSelected
                                    var preset_title = ed.getLang("jivemacros.macro." + macro.getName() + ".preset." + paramSets[i].name, paramSets[i].name);
                                    m.add({title : preset_title, cmd : 'mceAddJiveMacro' + j + "_" + i, icon : "jiveMacro_" + macro.getName() + "_" + paramSets[i].name});
                                }
                            }
                        }
                    });
                    // Return the new menubutton instance
                    return c;
            }
            return null;
        }


    });
	// Register plugin
	tinymce.PluginManager.add('jiveemoticons', tinymce.plugins.JiveEmoticonsPlugin);
})();

;
tinyMCE.addI18n('en.jiveemoticons',{
    title : 'Insert emoticon',
    desc : 'Emoticons'
});
;
(function(){tinymce.create("tinymce.plugins.JiveButtonsPlugin",{execCommand:function(b,a,c){if(b=="mceNull"){return true}return false},initToolbar:function(j){var h,f,n;if(!j||typeof(j)!="string"){var e=window.editor.toArray();for(f=0;f<e.length;f++){if(e[f]&&e[f].getID){this.initToolbar(e[f].getID())}}return}else{h=tinyMCE.get(j)}var l=document.getElementById(j+"_magicspacer0");var g=document.getElementById(j+"_magicspacer1");var m=document.getElementById(j+"_toolbar1");if(l){var o=m.rows[0].cells;var d=0;for(f=1;f<3;f++){n=o[f];d+=jive.ext.x.xWidth(n)}d+=26;m=document.getElementById(j+"_toolbar2");o=m.rows[0].cells;var c=0;for(f=6;f<7;f++){n=o[f];c+=jive.ext.x.xWidth(n)}c+=133;c+=6;var b=d-c;if(b<-100){return}else{if(b<-30){var k=this;setTimeout(function(){k.initToolbar(j)},33);return}else{if(b<0){jive.ext.x.xDisplayNone(g);jive.ext.x.xDisplayBlock(l);jive.ext.x.xWidth(l,(b*-1)-1)}else{jive.ext.x.xDisplayNone(l);jive.ext.x.xDisplayBlock(g);if(b<=0){jive.ext.x.xDisplayNone(g)}else{jive.ext.x.xWidth(g,b-5)}}}}}var a=document.getElementById(j+"_spellchecker");if(a!==null){n=h.dom.getParent(a,function(i){return i!=a});n.style.width="100%"}if(tinymce.isIE){$j("#wysiwygtext_magicspacer1").closest("td").css("padding",0)}},init:function(a,b){this.url=b;var c=this;this.index=0;this.mindex=0;a.onInit.add(function(d){var e=$j('[id="'+d.id+'_toolbar1"]').get(0);var f=e.parentNode;if(tinymce.isIE){f.style.height=this.settings.default_height+"px"}else{f.style.height=(this.settings.default_height-1)+"px"}f.style.bottom="0px"})},getInfo:function(){return{longname:"Jive Buttons",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},createControl:function(d,a){var b;if(d=="spacerbutton"){b=a.createButton("spacerbutton"+this.index,{"class":"jive_spacer_button jive_spacer_button"+this.index,cmd:"mceNull"});this.index++;return b}if(d=="magicspacer"){b=a.createButton("magicspacer"+this.mindex,{"class":"jive_spacer_button jive_magicspacer_button",cmd:"mceNull"});this.mindex++;return b}return null}});tinymce.PluginManager.add("jivebuttons",tinymce.plugins.JiveButtonsPlugin)})();
;
(function(){tinymce.create("tinymce.plugins.JiveLinkPlugin",{getInfo:function(){return{longname:"Content Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},init:function(a,b){a.onBeforeGetContent.add(function(){if(this.lastActive!=null){a.dom.removeClass(this.lastActive,"active_link");this.lastActive=null}},this);a.onNodeChange.add(this.nodeChanged,this)},createControl:function(d,a){switch(d){case"jivelink":var b=a.createButton("jivelink",{title:"jivelink.link_desc",cmd:"mceJiveLink"});return b}return""},execCommand:function(e,d,f){switch(e){case"mceJiveLink":var h=false;var a=tinyMCE.activeEditor;var g=a.selection.getContent();var c=a.selection.getNode();var b=a.dom.getParent(c,"a");if(b!=null){a.dom.removeClass(b,"active_link");if(a.plugins.jivemacros.isMacro(b)){a.plugins.jivemacros.deleteMacro(a,b)}else{a.execCommand("unlink")}return true}else{if(a.selection.getNode()){h=(a.selection.getNode().nodeName.toLowerCase()=="img")||(g&&g.length>0)}a.windowManager.open({url:CS_BASE_URL+"/content-picker!input.jspa?name="+escape(g)+"&instantiatedFromGUIEditor=true",width:700+a.getLang("jivelink.delta_width",0),height:555+a.getLang("jivelink.delta_height",0),inline:"yes"},{editor_id:a.id});return true}}return false},lastActive:null,nodeChanged:function(b,a,f,g){if(f==null){return}var e=b.dom.getParent(f,"a");if(e!=null){b.controlManager.get("jivelink").setActive(true)}else{b.controlManager.get("jivelink").setActive(false)}if(this.lastActive!=null&&this.lastActive!=f){b.dom.removeClass(this.lastActive,"active_link");this.lastActive=null}var c=b.dom.getParent(f,"a");if(c&&c.nodeName.toLowerCase()=="a"&&this.lastActive==null){this.lastActive=c;b.dom.addClass(this.lastActive,"active_link")}var d=b.plugins.jivemacros.getMacroFor(f);if(d!=null&&d.getMacroType()=="INLINE"){if(this.lastActive==null||this.lastActive!=f){this.lastActive=this.isMacro(f);b.dom.addClass(this.lastActive,"active_link")}if(this.lastActive.childNodes.length>0&&b.dom.hasClass(this.lastActive,"default_title")){b.selection.select(this.lastActive.childNodes[0])}}}});tinymce.PluginManager.add("jivelink",tinymce.plugins.JiveLinkPlugin)})();
;
tinyMCE.addI18n('en.jivelink',{
    link_desc : 'Insert Link'
});
;
(function(){tinymce.create("tinymce.plugins.JiveImagePlugin",{getInfo:function(){return{longname:"Image Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},init:function(a,b){a.onInit.add(function(){if(!a.settings.images_enabled){a.controlManager.get("jiveimage").setDisabled(true)}},this)},createControl:function(d,a){switch(d){case"jiveimage":var b=a.createButton("jiveimage",{title:"jiveimage.link_desc",cmd:"mceJiveImage"});return b}return""},execCommand:function(c,b,d){switch(c){case"mceJiveImage":var a=tinyMCE.activeEditor;if(tinyMCE.settings.jive_image_picker_url){a.windowManager.open({url:CS_BASE_URL+tinyMCE.settings.jive_image_picker_url+"&instantiatedFromGUIEditor=true",width:580+a.getLang("jiveimage.delta_width",0),height:425+a.getLang("jiveimage.delta_height",0),inline:"yes"},{editor_id:a.id})}else{a.execCommand("mceAdvImage")}return true}return false},handleNodeChange:function(f,d,e,c,a,b){if(d==null){return}do{if(d.nodeName=="IMG"&&tinyMCE.getAttrib(d,"src")!=""){tinyMCE.switchClass(f+"_jiveimage","mceButtonSelected");return true}}while((d=d.parentNode));if(b){tinyMCE.switchClass(f+"_jiveimage","mceButtonNormal");return true}tinyMCE.switchClass(f+"_jiveimage","mceButtonDisabled");return true}});tinymce.PluginManager.add("jiveimage",tinymce.plugins.JiveImagePlugin)})();
;
tinyMCE.addI18n('en.jiveimage',{
    link_desc : 'Insert Image'
});
;
(function(){tinymce.create("tinymce.plugins.JiveQuotePlugin",{getInfo:function(){return{longname:"Jive Quote Button",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},createControl:function(d,a){switch(d){case"jivequote":var b=a.createButton("jivequote",{title:"jivequote.link_desc",cmd:"mceJiveQuote"});return b}return""},execCommand:function(e,n,c){switch(e){case"mceJiveQuote":var k=tinyMCE.activeEditor;var b=k.selection;var f=null;var h=b.isCollapsed();for(var j=0;j<jive.rte.macros.length;j++){var d=jive.rte.macros[j];if(d.getName()=="quote"){f=k.plugins.jivemacros.buildMacro(d)}}if(f&&h){while(f.childNodes.length>0){f.removeChild(f.childNodes[0])}if($def(window._jive_gui_quote_text)){var a=k.getDoc().createElement("DIV");a.innerHTML=_jive_gui_quote_text;if(a.childNodes.length>0){for(var j=0;j<a.childNodes.length;j++){if(a.childNodes[j].nodeType==1){var p=a.childNodes[j];var g=p.childNodes[0];while(g.childNodes.length>0){if(g.childNodes[0].className=="jive-quote-header"){var m=k.getDoc().createElement("P");m.appendChild(g.childNodes[0].childNodes[0]);f.appendChild(m);f.appendChild(k.plugins.jivemacros.createEmptyPara(k.getDoc()));g.removeChild(g.childNodes[0]);g.removeChild(g.childNodes[0]);g.removeChild(g.childNodes[0])}else{f.appendChild(g.childNodes[0])}}}}}}else{f.appendChild(k.plugins.jivemacros.createEmptyPara(k.getDoc()))}var l=k.dom.getParent(b.getNode(),"PRE");var o=null;if(!l){l=b.getNode().parentNode;o=b.getNode()}else{o=k.dom.getParent(b.getNode(),function(i){return i.nodeName.toLowerCase()=="body"||i.parentNode.nodeName=="PRE"})}if(o.nodeName.toLowerCase()=="body"){o=null}if(b.getNode().nodeName.toLowerCase()=="body"&&!o&&l.nodeName.toLowerCase()=="html"){l=b.getNode();o=null}if(l&&o){l.insertBefore(f,o)}else{l.appendChild(f);l.appendChild(k.plugins.jivemacros.createEmptyPara(k.getDoc()))}}else{}return true}return false}});tinymce.PluginManager.add("jivequote",tinymce.plugins.JiveQuotePlugin)})();
;
tinyMCE.addI18n('en.jivequote',{
    link_desc : 'Quote Previous Message'
});

;
(function(){tinymce.create("tinymce.plugins.JiveUtilPlugin",{getInfo:function(){return{longname:"Jive Utility Plugin",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},walkDOMTreeKids:function(a,c,d){d(a);if(a==c){return true}for(var b=0;b<a.childNodes.length;b++){if(this.walkDOMTreeKids(a.childNodes[b],c,d)){return true}}return false},walkDOMTree:function(a,b,c){if(this.walkDOMTreeKids(a,b,c)){return true}while(a.nextSibling!=null){a=a.nextSibling;if(this.walkDOMTreeKids(a,b,c)){return true}}function e(f){if(f.nodeType==1&&f.nodeName.toLowerCase()=="body"){return f}if(f.parentNode.nextSibling==null){return e(f.parentNode)}return f.parentNode.nextSibling}var d=e(a);if(d.nodeType==1&&d.nodeName.toLowerCase()=="body"){return true}return this.walkDOMTree(d,b,c)},textLengthIn:function(b){var a=0;this.walkDOMTreeKids(b,null,function(){if(b.nodeType==3){a+=b.nodeValue.length}});return a},getNodeAt:function(c,d){if(d==0){return c}if(c.nodeType!=1){return null}for(var b=0;b<c.childNodes.length;b++){var a=this.textLengthIn(c.childNodes[b]);if(d==0){return c.childNodes[b]}else{if(a>d){return this.getNodeAt(c.childNodes[b],d)}else{d-=a}}}}});tinymce.PluginManager.add("jiveutil",tinymce.plugins.JiveUtilPlugin)})();
;
(function(){tinymce.create("tinymce.plugins.JiveVideoPlugin",{getInfo:function(){return{longname:"Video Picker",author:"Jive Software",authorurl:"http://www.jivesoftware.com",infourl:"http://www.jivesoftware.com/",version:"1.0"}},enabled:[],init:function(a,b){a.onInit.add(function(){var e=["youtube","dailymotion","vimeo","google","videomacro"],d=0,c=this;this.enabled=[];jive.rte.macros.forEach(function(f){if(e.some(function(g){return g===f.getName()})&&f.isEnabled&&f.isEnabled()){d+=1;c.enabled.push(f)}});if(d==0){a.controlManager.get("jivevideo").setDisabled(true)}},this)},createControl:function(d,a){switch(d){case"jivevideo":var b=a.createButton("jivevideo",{title:"jivevideo.link_desc",cmd:"mceJiveVideo"});return b}return""},execCommand:function(c,b,d){switch(c){case"mceJiveVideo":var a=tinyMCE.activeEditor;a.windowManager.open({url:CS_BASE_URL+"/upload-video!input.jspa"+_jive_video_picker__url,width:550+parseInt(a.getLang("jivevideo.delta_width",0)),height:430+parseInt(a.getLang("jivevideo.delta_height",0)),inline:1});return true}return false}});tinymce.PluginManager.add("jivevideo",tinymce.plugins.JiveVideoPlugin)})();
;
tinyMCE.addI18n('en.jivevideo',{
    link_desc : 'Insert Video'
});


;
tinyMCE.addI18n('en.jivevideo',{
    num1: "1. ",
    num2: "2. ",
    title_new:"Insert Video",
    general_props:"Video Properties",
    site_title:"Select a Video Site",
    embed_title: "Enter Video Information",
    embed: "Video URL or Embed Code (example: http://youtube.com/watch?v=videoIdHere)",
    embed_error : "Please enter a valid URL or embed code",
    name_youtube: "YouTube",
    name_vimeo: "Vimeo",
    name_veoh: "Veoh",
    name_dailymotion: "Dailymotion",
    name_google: "Google"
});
;
(function(){tinymce.create("tinymce.plugins.TableToolbarPlugin",{init:function(a,b){var c=this;a.onPostRender.add(function(){var h=tinymce.DOM.get(a.id+"_toolbar3");if($def(h)&&h!=null){var e=h.rows[0].cells[h.rows[0].cells.length-1];var j=h.rows[0].cells[0];h.rows[0].insertBefore(j,e);for(var g=0;g<h.rows[0].cells.length;g++){var d=h.rows[0].cells[g];var f=d.childNodes[0];if(f.nodeName.toLowerCase()=="a"){$j(d).mouseover(function(){$j(e).text(f.title)})}}$j(h).mouseout(function(){$j(e).html(" ")})}tinymce.DOM.hide(a.id+"_toolbar3")});a.onNodeChange.add(function(d){return function(f,e,j){var g=f.dom.getParent(j,"table");if($def(g)&&g!=null&&$def(g.tagName)){d._showToolbar()}else{d._hideToolbar()}var e=f.controlManager;var j=f.selection.getNode();var h=f.dom.getParent(j,"tr");var i=f.dom.getParent(j,"td,th");if(h!=null&&i!=null){if(h.nextSibling==null){e.get("row_down").setDisabled(true)}else{e.get("row_down").setDisabled(false)}if(h.previousSibling==null){e.get("row_up").setDisabled(true)}else{e.get("row_up").setDisabled(false)}if(i.previousSibling==null){e.get("col_left").setDisabled(true)}else{e.get("col_left").setDisabled(false)}if(i.nextSibling==null){e.get("col_right").setDisabled(true)}else{e.get("col_right").setDisabled(false)}}}}(this))},_hidden:true,settings:new Object(),_showToolbar:function(){var b=tinyMCE.activeEditor;var a=b.controlManager;var d=$j('[id="'+b.id+'_toolbar3"]').get(0);if(d){if(this._hidden){tinymce.DOM.show(b.id+"_toolbar3");var e=d.parentNode;if(tinymce.isIE){e.style.height=b.settings.default_height+"px"}else{e.style.height=(b.settings.default_height-1)+"px"}tinymce.DOM.show(b.id+"_toolbar3");this._hidden=false;var c=new jive.ext.y.ySlider(300,this.settings);c.addTicker(new jive.ext.y.SlideBottomToTicker(e,31));c.go()}}},_hideToolbar:function(){var b=tinyMCE.activeEditor;var a=b.controlManager;var d=$j('[id="'+b.id+'_toolbar3"]').get(0);if(d){if(!this._hidden){var e=d.parentNode;if(tinymce.isIE){e.style.height=b.settings.default_height+"px"}else{e.style.height=(b.settings.default_height-1)+"px"}tinymce.DOM.hide(b.id+"_toolbar3");this._hidden=true;var c=new jive.ext.y.ySlider(300,this.settings);c.addTicker(new jive.ext.y.SlideBottomToTicker(e,0));c.go()}}},_resizeIframe:function(b,a){var c=b.getContentAreaContainer().firstChild;tinymce.DOM.setStyle(c,"height",c.clientHeight+a);b.theme.deltaHeight+=a},createControl:function(d,a){switch(d){case"tabletoolbar":var b=a.createButton("tabletoolbar",{title:"tabletoolbar.title",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});return b}return null},getInfo:function(){return{longname:"Table Toolbar Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("tabletoolbar",tinymce.plugins.TableToolbarPlugin)})();
;
tinyMCE.addI18n('en.tabletoolbar',{
    title : 'Insert Table'
});

;
(function(){tinymce.create("tinymce.plugins.AlignmentPlugin",{init:function(a,b){a.addCommand("mceAlignment",function(){var c=this.controlManager;var d=c.get("mysplitbutton");d.showMenu()});a.addCommand("mceNoFloatImage",function(){var c=tinyMCE.activeEditor;var d=c.selection;var f=d.getNode();var e=c.dom;e.setStyle(f,"float","")});a.addCommand("MyJustifyLeft",function(){var c=this.selection.getNode();if(c.style.textAlign=="left"){return}c.style.textAlign="left"});a.addCommand("MyJustifyRight",function(){var c=this.selection.getNode();if(c.style.textAlign=="right"){return}c.style.textAlign="right"});a.addCommand("MyJustifyCenter",function(){var c=this.selection.getNode();if(c.style.textAlign=="center"){return}c.style.textAlign="center"});a.addCommand("MyJustifyFull",function(){var c=this.selection.getNode();if(c.style.textAlign=="justify"){return}c.style.textAlign="justify"});a.onNodeChange.add(function(c){return function(e,d,g){var f=d.get("mysplitbutton");if($def(f)){if(typeof(f.lastClass)!="undefined"&&f.lastClass!=null){f.setState(f.lastClass,false)}if(g.style.textAlign=="right"){f.lastClass="_justifyright";f.lastExec="MyJustifyRight"}else{if(g.style.textAlign=="center"){f.lastClass="_justifycenter";f.lastExec="MyJustifyCenter"}else{if(g.style.textAlign=="justify"){f.lastClass="_justifyfull";f.lastExec="MyJustifyFull"}else{if(g.style.textAlign=="left"){f.lastClass="_justifyleft";f.lastExec="MyJustifyLeft"}else{f.lastClass="_justifyleft";f.lastExec="MyJustifyLeft"}}}}if(f.lastClass!=null){f.setState(f.lastClass,true)}}}}(this));this.url=b;this.that=this},createControl:function(d,a){switch(d){case"alignment":var b=a.createSplitButton("mysplitbutton",{title:"Alignment",cmd:"mceAlignment"});b.onRenderMenu.add(function(f,e){e.add({cmd:"MyJustifyLeft","class":"mceSplitButton_justifyleft",title:"alignament.left"})});b.onRenderMenu.add(function(f,e){e.add({cmd:"MyJustifyCenter","class":"mceSplitButton_justifycenter",title:"alignment.center"})});b.onRenderMenu.add(function(f,e){e.add({cmd:"MyJustifyRight","class":"mceSplitButton_justifyright",title:"alignment.right"})});b.onRenderMenu.add(function(f,e){e.add({cmd:"MyJustifyFull","class":"mceSplitButton_justifyfull",title:"alignment.full"})});return b}return null},getInfo:function(){return{longname:"Fancy Justify Button",author:"Adam Wulf",authorurl:"http://www.jivesoftware.com",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("alignment",tinymce.plugins.AlignmentPlugin)})();
;
(function(){var a=tinymce.dom.Event,d=tinymce.grep,e=tinymce.each,c=tinymce.inArray,b=tinymce.isOldWebKit;tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}f.onInit.add(function(){g._fixWebKitSpans();if(b){g._patchSafari2x(f)}});g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];g.namedFontSizes=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.onKeyPress.add(function(i,j){if(j.keyCode==13&&(j.shiftKey||i.settings.force_br_newlines&&i.selection.getNode().nodeName!="LI")){g._insertBR(i);a.cancel(j)}});f.addQueryValueHandler("FontSize",function(k,i){var l,i,j;if((l=f.dom.getParent(f.selection.getStart(),"span"))&&(i=l.style.fontSize)){j=tinymce.inArray(g.namedFontSizes,i)+1;return j}if((l=f.dom.getParent(f.selection.getEnd(),"span"))&&(i=l.style.fontSize)){j=tinymce.inArray(g.namedFontSizes,i)+1;return j}j=f.getDoc().queryCommandValue("FontSize");return j});f.addQueryValueHandler("FontName",function(j,i){var k,i;if((k=f.dom.getParent(f.selection.getStart(),"span"))&&(i=k.style.fontFamily)){return i.replace(/, /g,",")}if((k=f.dom.getParent(f.selection.getEnd(),"span"))&&(i=k.style.fontFamily)){return i.replace(/, /g,",")}return f.getDoc().queryCommandValue("FontName")});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onSetContent.add(function(){h=f.dom;e(["strong","b","em","u","strike","sub","sup","a"],function(i){e(d(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;e(d(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");j.content=j.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var g=this,f=g.editor;if(!b){a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})}else{f.onExecCommand.add(function(){e(f.dom.select("span"),function(h){g._fixAppleSpan(h)});f.nodeChanged()})}},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",c(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[c(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_patchSafari2x:function(g){var h=this,i,k,j=g.dom,f;if(g.windowManager.onBeforeOpen){g.windowManager.onBeforeOpen.add(function(){r=g.selection.getRng()})}g.selection.select=function(l){this.getSel().setBaseAndExtent(l,0,l,1)};k=g.selection.getNode;g.selection.getNode=function(){return h.selElm||k.call(this)};g.selection.getRng=function(){var m=this,n=m.getSel(),v=g.getDoc(),p,q,u,o;if(n.anchorNode){p=v.createRange();try{q=v.createRange();q.setStart(n.anchorNode,n.anchorOffset);q.collapse(1);u=v.createRange();u.setStart(n.focusNode,n.focusOffset);u.collapse(1);o=q.compareBoundaryPoints(q.START_TO_END,u)<0;p.setStart(o?n.anchorNode:n.focusNode,o?n.anchorOffset:n.focusOffset);p.setEnd(o?n.focusNode:n.anchorNode,o?n.focusOffset:n.anchorOffset);f=p}catch(l){}}return p||f};i=g.selection.setContent;g.selection.setContent=function(o,n){var p=this.getRng(),l;try{i.call(this,o,n)}catch(m){l=j.create("body");l.innerHTML=o;e(l.childNodes,function(q){p.insertNode(q.cloneNode(true))})}}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})();
;
(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;e.onBeginSpelling=new tinymce.util.Dispatcher(e);e.onEndSpelling=new tinymce.util.Dispatcher(e);e.addCommand("mceSpellCheck",function(){if(!g.active){e.onBeginSpelling.dispatch();e.setProgressState(1);g._cleanBody();g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);e.windowManager.alert("spellchecker.no_mpell");e.onEndSpelling.dispatch()}})}else{g._done()}});e.onInit.add(function(){if(e.settings.content_css!==false){e.dom.loadCSS(window.CS_RESOURCE_BASE_URL+"/styles/tiny_mce3/plugins/spellchecker/css/content.css")}});e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f,offset_x:-150});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",' \\t\\r!"#$%&()*+,-./:;<=>?@[]^_{|}����������������\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_cleanBody:function(){var e=this.editor,g=[],d="",f={},h=e.dom;this._walk(e.getBody(),function(i){while($def(i)&&i.nodeType==3&&i.nextSibling&&i.nextSibling.nodeType==3){i.nodeValue=i.nodeValue+i.nextSibling.nodeValue;i.nextSibling.parentNode.removeChild(i.nextSibling)}})},_getWords:function(){var e=this.editor,g=[],d="",f={},h=e.dom;this._walk(e.getBody(),function(k){if(k.nodeType==3){var i=h.getParent(k,"span");var j=h.getParent(k,"pre");if(i!=null&&$obj(i)&&e.plugins.jivemacros.isMacro(i)||j!=null&&$obj(j)&&e.plugins.jivemacros.isMacro(j)){}else{d+=k.nodeValue+" "}}});d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));c(d.split(" "),function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(q){var i,h,g,f,e,t,s,p,o,n="",k=this.editor,r=this._getSeparators(),j=k.dom,d=[];var l=k.selection,m=l.getBookmark();c(q,function(u){n+=(n?"|":"")+u});i=new RegExp("(["+r+"])("+n+")(["+r+"])","g");h=new RegExp("^("+n+")","g");g=new RegExp("("+n+")(["+r+"]?)$","g");f=new RegExp("^("+n+")(["+r+"]?)$","g");e=new RegExp("("+n+")(["+r+"])","g");t=new RegExp("(["+r+"])("+n+")(["+r+"])","g");s=new RegExp("(["+r+"])("+n+")$","g");p=new RegExp("^("+n+")(["+r+"])","g");o=new RegExp("^("+n+")$","g");this._walk(this.editor.getBody(),function(u){if(u.nodeType==3){d.push(u)}});c(d,function(z){var u;if(z.nodeType==3){var x=j.getParent(z,"span");var y=j.getParent(z,"pre");if($obj(x)&&k.plugins.jivemacros.isMacro(x)||$obj(y)&&k.plugins.jivemacros.isMacro(y)){}else{u=z.nodeValue;if(i.test(u)||h.test(u)||g.test(u)||f.test(u)){u=j.encode(u);for(var w=0;w<2;w++){u=u.replace(t,'$1<span class="mceItemHiddenSpellWord">\n$2\n</span>$3');u=u.replace(s,'$1<span class="mceItemHiddenSpellWord">\n$2\n</span>');u=u.replace(p,'<span class="mceItemHiddenSpellWord">\n$1\n</span>$2');u=u.replace(o,'<span class="mceItemHiddenSpellWord">\n$1\n</span>')}u=u.replace(/\n/g,"");j.replace(j.create("span",{"class":"mceItemHidden"},u),z)}}}});l.moveToBookmark(m)},_showMenu:function(g,i){var h=this,g=h.editor,d=h._menu,k,j=g.dom;if(!d){k=b.getPos(g.getContentAreaContainer());d=g.controlManager.createDropMenu("spellcheckermenu",{offset_x:k.x,offset_y:k.y,"class":"mceNoIcons"});h._menu=d}if(j.hasClass(i.target,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);h._sendRPC("getSuggestions",[h.selectedLang,j.decode(i.target.innerHTML)],function(e){d.removeAll();if(e.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(e,function(l){d.add({title:l,onclick:function(){j.replace(g.getDoc().createTextNode(l),i.target);g.undoManager.add();h._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}d.add({title:"spellchecker.ignore_word",onclick:function(){j.remove(i.target,1);h._checkDone()}});d.add({title:"spellchecker.ignore_words",onclick:function(){h._removeWords(j.decode(i.target.innerHTML));h._checkDone()}});d.update()});var f=j.getViewPort(g.getWin());g.selection.select(i.target);k=j.getPos(i.target);d.showMenu(k.x,k.y+i.target.offsetHeight-f.y);return tinymce.dom.Event.cancel(i)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.editor.onEndSpelling.dispatch();d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,h,d){var g=this,f=g.editor.getParam("spellchecker_rpc_url","{backend}");if(f=="{backend}"){g.editor.setProgressState(0);alert("Please specify: spellchecker_rpc_url");return}a.sendRPC({url:f,method:e,params:h,success:d,error:function(j,i){g.editor.setProgressState(0);g.editor.windowManager.alert(j.errstr||("Error response: "+i.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
;
(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText,cs_resource_base_url:CS_RESOURCE_BASE_URL})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();
;
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TablePlugin",{putCursorInCell:function(b,f){var e=false;if(f.childNodes.length==0){if(f.childNodes.length==0){f.appendChild(b.plugins.jivemacros.createEmptyPara(b.getDoc()));e=true}}var d=f.childNodes[0];var c=f;while(d.nodeType==1&&d.childNodes.length){c=d;d=d.childNodes[0]}b.selection.select(tinymce.isIE?c:d);b.selection.collapse(true);if(e){f.removeChild(f.childNodes[0])}},tempTable:null,fixTable:function(){if(this.tempTable!=null&&$def(this.tempTable)&&this.tempTable.getAttribute("width")){var c=this.tempTable.getAttribute("width");if(c.indexOf("%")==-1){c+="px"}this.tempTable.style.width=c;this.tempTable.removeAttribute("width");this.tempTable.setAttribute("mce_style",this.tempTable.getAttribute("style"))}if(this.tempTable.childNodes.length){var d=this.tempTable.childNodes[0];if(d.childNodes.length){var b=d.childNodes[0];if(b.childNodes.length){var e=b.childNodes[0];if(b.nodeName==e.nodeName&&b.nodeName.toLowerCase()=="tr"){while(b.childNodes.length){d.appendChild(b.childNodes[0])}d.removeChild(b)}}}}},fixInvisibleTableBorders:function(b,d){if(d.nodeType==1&&d.nodeName.toLowerCase()=="table"){if(d.style.borderCollapse=="collapse"){d.style.borderCollapse="separate";setTimeout(function(){d.style.borderCollapse="collapse"},330)}}else{if(d.nodeType==1){for(var c=0;c<d.childNodes.length;c++){this.fixInvisibleTableBorders(b,d.childNodes[c])}}}},init:function(b,c){var d=this;d.editor=b;d.url=c;a([["table","table.props_desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true],["row_up","table.row_up","mceTableRowUp",true],["row_down","table.row_down","mceTableRowDown",true],["col_left","table.col_left","mceTableColLeft",true],["col_right","table.col_right","mceTableColRight",true]],function(e){b.addButton(e[0],{title:e[1],cmd:e[2],ui:e[3]})});b.onInit.add(function(){if(tinymce.isGecko){b.plugins.table.fixInvisibleTableBorders(b,b.getBody())}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(h,f,j){var k,i=b.selection,g=i.getNode()||b.getBody();if(b.dom.getParent(j,"td")||b.dom.getParent(j,"th")){f.removeAll();if(g.nodeName=="A"&&!b.dom.getAttrib(g,"name")){f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});f.addSeparator()}if(g.nodeName=="IMG"&&g.className.indexOf("mceItem")==-1){f.add({title:"advanced.image_desc",icon:"image",cmd:b.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator()}f.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable",ui:true});f.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete",ui:true});f.addSeparator();k=f.addMenu({title:"table.cell"});k.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps",ui:true});k.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells",ui:true});k.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells",ui:true});k=f.addMenu({title:"table.row"});k.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps",ui:true});k.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});k.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});k.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});k.addSeparator();k.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});k.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});if(b.tableRowClipboard){k.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"});k.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"})}k=f.addMenu({title:"table.col"});k.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});k.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});k.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{if(b.dom.getParent(j,"img")==null){f.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true,value:{action:"insert"}})}}})}});b.onKeyUp.add(function(f,h){if(h.keyCode==9&&!h.ctrlKey&&!h.altKey){var g=f.dom.getParent(f.selection.getNode(),"td,th,caption");if(g!=null){if(h.shiftKey){if(g.previousSibling!=null){this.putCursorInCell(f,g.previousSibling)}else{var i=f.dom.getParent(g,"tr");if(i.previousSibling){this.putCursorInCell(f,i.previousSibling.cells[i.previousSibling.childNodes.length-1])}else{this.putCursorInCell(f,g)}}}else{if(g.nextSibling!=null){this.putCursorInCell(f,g.nextSibling)}else{var i=f.dom.getParent(g,"tr");if(i.nextSibling){this.putCursorInCell(f,i.nextSibling.cells[0])}else{f.execCommand("mceTableInsertRowAfter");this.putCursorInCell(f,i.nextSibling.cells[0])}}}f.nodeChanged();tinymce.dom.Event.cancel(h)}}},this);b.onKeyDown.add(function(f,h){if(h.keyCode==9&&!h.ctrlKey&&!h.altKey&&f.dom.getParent(f.selection.getNode(),"TABLE")){f.undoManager.add()}if(h.keyCode==9&&!h.ctrlKey&&!h.altKey){var g=f.dom.getParent(f.selection.getNode(),"td,th,caption");if(g!=null){tinymce.dom.Event.cancel(h)}}});b.onKeyPress.add(function(f,h){if(h.keyCode==9&&!h.ctrlKey&&!h.altKey){var g=f.dom.getParent(f.selection.getNode(),"td,th,caption");if(g!=null){tinymce.dom.Event.cancel(h)}}});if(!tinymce.isIE){if(b.getParam("table_selection",true)){b.onClick.add(function(f,g){g=g.target;if(g.nodeName==="TABLE"){f.selection.select(g)}})}}b.onMouseUp.add(function(f,h){var i=f.selection.getNode();var g=f.dom.getParent(i,"table");if(g){f.plugins.table.tempTable=g;if(h.target.nodeName.toLowerCase()=="tr"||h.target.nodeName.toLowerCase()=="table"){f.plugins.table._doExecCommand("fixMissingCells",g)}jive.ext.x.xTimer.set("timeout",f.plugins.table,"fixTable",33)}});b.onNodeChange.add(function(g,f,k){var i=g.dom.getParent(k,"td,th,caption");var e=g.dom.getParent(k,"td,th");if(e&&g.selection.isCollapsed()){var j=g.dom.getAttrib(e,"colspan");var h=g.dom.getAttrib(e,"rowspan");j=j==""?1:parseInt(j);h=h==""?1:parseInt(h);f.setDisabled("split_cells",j==1&&h==1);f.setDisabled("merge_cells",!(j==1&&h==1))}else{if(e){f.setDisabled("split_cells",false);f.setDisabled("merge_cells",false)}else{f.setDisabled("split_cells",true);f.setDisabled("merge_cells",true)}}if(i&&i.nodeName==="CAPTION"){i=null}f.setDisabled("delete_table",!i);f.setDisabled("delete_col",!i);f.setDisabled("delete_table",!i);f.setDisabled("delete_row",!i);f.setDisabled("col_after",!i);f.setDisabled("col_before",!i);f.setDisabled("row_after",!i);f.setDisabled("row_before",!i);f.setDisabled("row_props",!i);f.setDisabled("cell_props",!i)});if(!tinymce.isIE){b.onBeforeSetContent.add(function(e,f){if(f.initial){f.content=f.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?"<$1$2>&nbsp;</$1>":'<$1$2><br mce_bogus="1" /></$1>')}})}b.onKeyDown.addToTop(function(f,e){if(f.getBody().childNodes.length>0){this.before=f.selection.getNode()}},this);b.onKeyUp.add(function(o,t){if(this.before!=null&&(t.keyCode==39||t.keyCode==40)){var g=o.selection.getNode();var l=o.dom.getParent(g,"td");var i=o.dom.getParent(g,"th");var f=g.tagName.toLowerCase();if(this.before.tagName.toLowerCase()=="p"&&(l||i)){if(this.before.previousSibling==null){if(this.before.childNodes.length==1&&$def(this.before.childNodes[0].tagName)&&this.before.childNodes[0].tagName.toLowerCase()=="br"){var q=o.dom.getParent(this.before,function(p){return function(v){return v==o.getBody()||v!=p}}(this.before));q.removeChild(this.before);this.before=l?l:i}}}}if(this.before!=null&&(t.keyCode==38)){var j=o.selection;var k=j.getNode();var n=this.isFirst(o.getBody(),k);var s=o.getBody().childNodes[0].tagName.toLowerCase()=="table";var e=false;if(s){var r=o.dom.getParent(k,"tr");var m=o.dom.getParent(this.before,"tr");if(o.getBody().childNodes[0].rows.length>0){e=(r==o.getBody().childNodes[0].rows[0])&&r==m}}if(n&&s&&e&&j.isCollapsed()){var h=o.getDoc().createElement("P");var u=o.plugins.jivemacros.createMozBR(o.getDoc());h.appendChild(u);o.getBody().insertBefore(h,o.getBody().childNodes[0]);o.selection.select(u);o.selection.collapse(true)}}},this)},isFirst:function(b,c){if(b.childNodes.length==0){return false}return(b.childNodes[0]==c||this.isFirst(b.childNodes[0],c))},execCommand:function(g,f,h){var d=this.editor,c;switch(g){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":case"mceTableRowUp":case"mceTableRowDown":case"mceTableColLeft":case"mceTableColRight":d.execCommand("mceBeginUndoLevel");var e=this._doExecCommand(g,f,h);if(e==-1){return false}if(e){d.execCommand("mceEndUndoLevel");d.undoManager.add(false,true)}return true}return false},getInfo:function(){return{longname:"Tables",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_doExecCommand:function(aa,T,M){var b=this.editor,e=b,v=this.url;var aC=b.selection.getNode();var az=b.dom.getParent(aC,"tr");var Z=b.dom.getParent(aC,"td,th");var m=b.dom.getParent(aC,"table");var D=b.contentWindow.document;var aq=m?m.getAttribute("border"):"";if(az&&Z==null){Z=az.cells[0]}function u(x,r){for(var y=0;y<x.length;y++){if(x[y].length>0&&u(x[y],r)){return true}if(x[y]==r){return true}}return false}function aF(r,i){var x;ad=Y(m);r=r||0;i=i||0;r=Math.max(V.cellindex+r,0);i=Math.max(V.rowindex+i,0);b.execCommand("mceRepaint");x=d(ad,i,r);if(x){b.selection.select(x.firstChild||x);b.selection.collapse(1)}}function H(){var i=D.createElement("td");if(!tinymce.isIE){i.innerHTML='<br mce_bogus="1"/>'}return i}function aI(y){var x=1,r=1,i;if(i=y.getAttribute("colspan")){if(typeof(i.nodeValue)!="undefined"){x=i.nodeValue}else{x=i}}if(i=y.getAttribute("rowspan")){if(typeof(i.nodeValue)!="undefined"){r=i.nodeValue}else{r=i}}x=parseInt(x);r=parseInt(r);return{colspan:x,rowspan:r}}function k(r,aK){var i,aJ;for(aJ=0;aJ<r.length;aJ++){for(i=0;i<r[aJ].length;i++){if(r[aJ][i]==aK){return{cellindex:i,rowindex:aJ}}}}return null}function d(r,x,i){if(r[x]&&r[x][i]){return r[x][i]}return null}function ab(x,y){if(x.nodeName.toLowerCase()=="br"){return y}if(x.childNodes.length==0){return x}for(var r=0;r<x.childNodes.length;r++){if(x.childNodes[r].nodeType==3){x.removeChild(x.childNodes[r]);r--}else{y=ab(x.childNodes[r],x)}}if(x.childNodes.length==0){return x}return y}function f(r,x){var i=ab(r,r);if(i.childNodes.length==0){i.appendChild(x)}else{i.insertBefore(x,i.childNodes[i.childNodes.length-1])}if(!tinymce.isWebKit){b.selection.select(i)}b.focus()}function Y(aP){var i=[],aQ=aP.rows,aN,aM,aJ,aK,aO,r,aL;for(aM=0;aM<aQ.length;aM++){for(aN=0;aN<aQ[aM].cells.length;aN++){aJ=aQ[aM].cells[aN];aK=aI(aJ);for(aO=aN;i[aM]&&i[aM][aO];aO++){}for(aL=aM;aL<aM+aK.rowspan;aL++){if(!i[aL]){i[aL]=[]}for(r=aO;r<aO+aK.colspan;r++){i[aL][r]=aJ}}}}return i}function aH(aR,aO,aJ,y){var r=Y(aR),aQ=k(r,aJ);var aS,aN;if(y.cells.length!=aO.childNodes.length){aS=aO.childNodes;aN=null;for(var aP=0;aJ=d(r,aQ.rowindex,aP);aP++){var aL=true;var aM=aI(aJ);if(u(aS,aJ)){y.childNodes[aP]._delete=true}else{if((aN==null||aJ!=aN)&&aM.colspan>1){for(var aK=aP;aK<aP+aJ.colSpan;aK++){y.childNodes[aK]._delete=true}}}if((aN==null||aJ!=aN)&&aM.rowspan>1){aJ.rowSpan=aM.rowspan+1}if(aJ.rowSpan==1){aJ.removeAttribute("rowspan")}aN=aJ}ax(m)}}function ak(r,i){while((r=r.previousSibling)!=null){if(r.nodeName==i){return r}}return null}function C(y,aJ){var r=aJ.split(",");while((y=y.nextSibling)!=null){for(var x=0;x<r.length;x++){if(y.nodeName.toLowerCase()==r[x].toLowerCase()){return y}}}return null}function ax(aJ){if(aJ.rows==0){return}var y=aJ.rows[0];for(var x=0;x<aJ.rows.length;x++){var y=aJ.rows[x];if(y._delete){y.parentNode.removeChild(y);x--;continue}var aK=y.cells[0];if(aK.cells>1){do{var r=C(aK,"TD,TH");if(aK._delete){aK.parentNode.removeChild(aK)}}while((aK=r)!=null)}}}function p(y,aL,aK){y.rowspan=1;y.setAttribute("rowSpan","1");y.removeAttribute("rowSpan");var r=C(aL,"TR");for(var aJ=1;aJ<aK&&r;aJ++){var x=D.createElement("td");if(!tinymce.isIE){x.innerHTML='<br mce_bogus="1"/>'}if(tinymce.isIE){r.insertBefore(x,r.cells(y.cellIndex))}else{r.insertBefore(x,r.cells[y.cellIndex])}r=C(r,"TR")}}function X(aQ,aS,aM){var r=Y(aS);var y=aM.cloneNode(false);var aR=k(r,aM.cells[0]);var aN=null;var aL=b.dom.getAttrib(aS,"border");var aK=null;for(var aP=0;aK=d(r,aR.rowindex,aP);aP++){var aO=null;if(aN!=aK){for(var aJ=0;aJ<aM.cells.length;aJ++){if(aK==aM.cells[aJ]){aO=aK.cloneNode(true);break}}}if(aO==null){aO=aQ.createElement("td");if(!tinymce.isIE){aO.innerHTML='<br mce_bogus="1"/>'}}aO.removeAttribute("colSpan");aO.removeAttribute("rowspan");y.appendChild(aO);aN=aK}return y}switch(aa){case"fixMissingCells":var ad=Y(T);var al=0;for(var O=0;O<ad.length;O++){if(ad[O].length>al){al=ad[O].length}}for(var O=0;O<ad.length;O++){if(ad[O].length<al){T.rows[O].appendChild(H())}}return false;case"mceTableRowUp":if(az==null){return false}if(az.previousSibling!=null){var P=b.selection.getNode();az.parentNode.insertBefore(az,az.previousSibling);if(P.childNodes.length&&!tinymce.isIE){P=P.childNodes[0]}b.selection.select(P);b.selection.collapse(true);b.nodeChanged(false,true)}return true;case"mceTableRowDown":if(az==null){return false}if(az.nextSibling!=null){var P=b.selection.getNode();az.parentNode.insertBefore(az.nextSibling,az);if(P.childNodes.length&&!tinymce.isIE){P=P.childNodes[0]}b.selection.select(P);b.selection.collapse(true);b.nodeChanged(false,true)}return true;case"mceTableColRight":if(!az||!Z){return false}var ad=Y(m);var V=k(ad,Z);var q=null;var P=b.selection.getNode();for(var I=0;Z=d(ad,I,V.cellindex);I++){if(Z!=q){var am=$j(Z).next("td, th");if(am.length>0){Z.parentNode.insertBefore(am.get(0),Z)}q=Z}}if(P.childNodes.length&&!tinymce.isIE){P=P.childNodes[0]}b.selection.select(P);b.selection.collapse(true);b.nodeChanged(false,true);return true;case"mceTableColLeft":if(!az||!Z){return false}var ad=Y(m);var V=k(ad,Z);var q=null;var P=b.selection.getNode();for(var I=0;Z=d(ad,I,V.cellindex);I++){if(Z!=q){var E=$j(Z).prev("td, th");if(E.length>0){Z.parentNode.insertBefore(Z,E.get(0))}q=Z}}if(P.childNodes.length&&!tinymce.isIE){P=P.childNodes[0]}b.selection.select(P);b.selection.collapse(true);b.nodeChanged(false,true);return true;case"mceTableRowProps":if(az==null){return false}if(T){b.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/table/row.htm",width:400+parseInt(b.getLang("table.rowprops_delta_width",0)),height:221+parseInt(b.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:v,cs_resource_base_url:CS_RESOURCE_BASE_URL})}return false;case"mceTableCellProps":if(Z==null){return false}if(T){b.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/table/cell.htm",width:400+parseInt(b.getLang("table.cellprops_delta_width",0)),height:245+parseInt(b.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:v,cs_resource_base_url:CS_RESOURCE_BASE_URL})}return false;case"mceInsertTable":if(T){if(M&&M.action=="insert"){b.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/table/table.htm",width:420+parseInt(b.getLang("table.table_delta_width",0)),height:288+parseInt(b.getLang("table.table_delta_height",0)),inline:1},{plugin_url:v,action:M?M.action:0,cs_resource_base_url:CS_RESOURCE_BASE_URL})}else{b.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/table/table_edit.htm",width:420+parseInt(b.getLang("table.table_delta_width",0)),height:258+parseInt(b.getLang("table.table_delta_height",0)),inline:1},{plugin_url:v,action:M?M.action:0,cs_resource_base_url:CS_RESOURCE_BASE_URL})}}return false;case"mceTableDelete":var ac=b.dom.getParent(b.selection.getNode(),"table");if(ac){ac.parentNode.removeChild(ac);b.nodeChanged(false,true);b.execCommand("mceRepaint")}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":if(!m){switch(aa){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return -1;default:return true}}if(az&&m!=az.parentNode){m=e.dom.getParent(az,"table")}if(m&&(az||tinymce.isIE||tinymce.isWebKit)){switch(aa){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":var ah=[];var P=b.selection.getSel();var ad=Y(m);if(tinymce.isIE||tinymce.isWebKit){var s=e.dom.getParent(b.selection.getStart(),"td,th");var S=e.dom.getParent(b.selection.getEnd(),"td,th");if(s&&S){b.plugins.jiveutil.walkDOMTree(s,S,function(r){if(r.nodeType==1&&(r.nodeName.toLowerCase()=="td"||r.nodeName.toLowerCase()=="th")){var i=r;if(aa=="JustifyLeft"){i.style.textAlign="left";i.setAttribute("mce_style",i.getAttribute("style"))}else{if(aa=="JustifyRight"){i.style.textAlign="right";i.setAttribute("mce_style",i.getAttribute("style"))}else{if(aa=="JustifyCenter"){i.style.textAlign="center";i.setAttribute("mce_style",i.getAttribute("style"))}else{if(aa=="JustifyFull"){i.style.textAlign="justify";i.setAttribute("mce_style",i.getAttribute("style"))}}}}}})}break}else{if(P.rangeCount==1){var V=k(ad,Z);var aD=m.rows;for(var I=V.rowindex;I<ad.length;I++){var N=[];for(var J=V.cellindex;J<ad[I].length;J++){var ap=d(ad,I,J);if(ap&&!u(ah,ap)&&!u(N,ap)){var F=k(ad,ap);if(F.cellindex<V.cellindex+1&&F.rowindex<V.rowindex+1){N[N.length]=ap}}}if(N.length>0){ah[ah.length]=N}}}else{var W=[];var P=b.selection.getSel();var aB=null;var l=null;var z=-1,h=-1,w,g;for(var R=0;R<P.rangeCount;R++){var c=P.getRangeAt(R);var Z=c.startContainer.childNodes[c.startOffset];if(!Z){break}if(Z.nodeName=="TD"||Z.nodeName=="TH"){W[W.length]=Z}}var aD=m.rows;for(var I=0;I<aD.length;I++){var N=[];for(var J=0;J<aD[I].cells.length;J++){var ap=aD[I].cells[J];for(var R=0;R<W.length;R++){if(ap==W[R]){N[N.length]=ap}}}if(N.length>0){ah[ah.length]=N}}}}for(var I=0;I<ah.length;I++){for(var J=0;J<ah[I].length;J++){var ap=ah[I][J];if(aa=="JustifyLeft"){ap.style.textAlign="left";ap.setAttribute("mce_style",ap.getAttribute("style"))}else{if(aa=="JustifyRight"){ap.style.textAlign="right";ap.setAttribute("mce_style",ap.getAttribute("style"))}else{if(aa=="JustifyCenter"){ap.style.textAlign="center";ap.setAttribute("mce_style",ap.getAttribute("style"))}else{if(aa=="JustifyFull"){ap.style.textAlign="justify";ap.setAttribute("mce_style",ap.getAttribute("style"))}}}}}}break;case"mceTableCutRow":if(!az||!Z){return true}b.tableRowClipboard=X(D,m,az);b.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!az||!Z){return true}b.tableRowClipboard=X(D,m,az);break;case"mceTablePasteRowBefore":if(!az||!Z){return true}var j=b.tableRowClipboard.cloneNode(true);var aA=ak(az,"TR");if(aA!=null){aH(m,aA,aA.cells[0],j)}az.parentNode.insertBefore(j,az);break;case"mceTablePasteRowAfter":if(!az||!Z){return true}var ae=C(az,"TR");var j=b.tableRowClipboard.cloneNode(true);aH(m,az,Z,j);if(ae==null){az.parentNode.appendChild(j)}else{ae.parentNode.insertBefore(j,ae)}break;case"mceTableInsertRowBefore":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);var j=D.createElement("tr");var q=null;V.rowindex--;if(V.rowindex<0){V.rowindex=0}for(var J=0;Z=d(ad,V.rowindex,J);J++){if(Z!=q){var aw=aI(Z);if(aw.rowspan==1){var o=D.createElement("td");if(!tinymce.isIE){o.innerHTML='<br mce_bogus="1"/>'}o.colSpan=Z.colSpan;j.appendChild(o)}else{Z.rowSpan=aw.rowspan+1}if(Z.rowSpan==1){Z.removeAttribute("rowspan")}if(Z.colSpan==1){Z.removeAttribute("colSpan")}q=Z}}az.parentNode.insertBefore(j,az);aF(0,1);break;case"mceTableInsertRowAfter":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);var j=D.createElement("tr");var q=null;for(var J=0;Z=d(ad,V.rowindex,J);J++){if(Z!=q){var aw=aI(Z);if(aw.rowspan==1){var o=D.createElement("td");if(!tinymce.isIE){o.innerHTML='<br mce_bogus="1"/>'}o.colSpan=Z.colSpan;if(o.colSpan==1){o.removeAttribute("colSpan")}j.appendChild(o)}else{Z.rowSpan=aw.rowspan+1}if(Z.rowSpan==1){Z.removeAttribute("rowspan")}q=Z}}if(j.hasChildNodes()){var ae=C(az,"TR");if(ae){ae.parentNode.insertBefore(j,ae)}else{var G;if(m.childNodes.length>0){G=m.childNodes[0]}else{G=m}if(G.nodeName.toLowerCase()=="tbody"){G.appendChild(j)}else{m.appendChild(j)}}}aF(0,1);break;case"mceTableDeleteRow":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);if(ad.length==1){b.dom.remove(b.dom.getParent(m,"table"));return true}var W=az.cells;var ae=C(az,"TR");for(var J=0;J<W.length;J++){if(W[J].rowSpan>1){var o=W[J].cloneNode(true);var aw=aI(W[J]);o.rowSpan=aw.rowspan-1;if(o.rowSpan==1){o.removeAttribute("rowspan")}var ao=ae.cells[J];if(ao==null){ae.appendChild(o)}else{ae.insertBefore(o,ao)}}}var q=null;for(var J=0;Z=d(ad,V.rowindex,J);J++){if(Z!=q){var aw=aI(Z);if(aw.rowspan>1){Z.rowSpan=aw.rowspan-1}else{az=Z.parentNode;if(az.parentNode){az._delete=true}}if(az.rowSpan==1){az.removeAttribute("rowspan")}q=Z}}ax(m);aF(0,-1);break;case"mceTableInsertColBefore":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);var q=null;for(var I=0;Z=d(ad,I,V.cellindex);I++){if(Z!=q){var aw=aI(Z);if(aw.colspan==1){var o=Z.cloneNode(true);if(o.nodeName.toLowerCase()=="th"){f(o,e.getDoc().createTextNode("Header "+(V.cellindex+I+1)))}else{if(!tinymce.isIE){o.innerHTML='<br mce_bogus="1"/>'}else{o.innerHTML=""}}o.rowSpan=Z.rowSpan;if(o.rowSpan==1){o.removeAttribute("rowspan")}Z.parentNode.insertBefore(o,Z)}else{Z.colSpan++}if(Z.colSpan==1){Z.removeAttribute("colSpan")}q=Z}}aF();break;case"mceTableInsertColAfter":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);var q=null;for(var I=0;Z=d(ad,I,V.cellindex);I++){if(Z!=q){var aw=aI(Z);if(aw.colspan==1){var o=Z.cloneNode(true);if(o.nodeName.toLowerCase()=="th"){f(o,e.getDoc().createTextNode("Header "+(V.cellindex+I+2)))}else{if(!tinymce.isIE){o.innerHTML='<br mce_bogus="1"/>'}else{o.innerHTML=""}}o.rowSpan=Z.rowSpan;if(o.rowSpan==1){o.removeAttribute("rowspan")}var ao=C(Z,"TD,TH");if(ao==null){Z.parentNode.appendChild(o)}else{ao.parentNode.insertBefore(o,ao)}}else{Z.colSpan++}if(Z.colSpan==1){Z.removeAttribute("colSpan")}q=Z}}break;case"mceTableDeleteCol":if(!az||!Z){return true}var ad=Y(m);var V=k(ad,Z);var q=null;if(ad.length>1&&ad[0].length<=1){b.dom.remove(b.dom.getParent(m,"table"));return true}for(var I=0;Z=d(ad,I,V.cellindex);I++){if(Z!=q){var aw=aI(Z);if(aw.colspan>1){Z.colSpan=aw.colspan-1}else{if(Z.parentNode){Z.parentNode.removeChild(Z)}}if(Z.colSpan==1){Z.removeAttribute("colSpan")}q=Z}}aF(-1);break;case"mceTableSplitCells":if(!az||!Z){return true}var K=aI(Z);var U=K.colspan;var ar=K.rowspan;if(U>1||ar>1){Z.colSpan=1;for(var R=1;R<U;R++){var o=D.createElement("td");if(!tinymce.isIE){o.innerHTML='<br mce_bogus="1"/>'}az.insertBefore(o,C(Z,"TD,TH"));if(ar>1){p(o,az,ar)}}if(Z.colSpan==1){Z.removeAttribute("colSpan")}p(Z,az,ar)}if(Z.childNodes.length==0){Z.innerHTML='<br mce_bogus="1"/>'}b.selection.select(Z.childNodes[0]);b.selection.collapse(true);m=b.dom.getParent(b.selection.getNode(),"table");break;case"mceTableMergeCells":var ah=[];var P=b.selection.getSel();var ad=Y(m);if(tinymce.isIE||P.rangeCount==1){if(T){var at=aI(Z);var B=0;var aG=0;var ai=Z;while(ai&&ai.nextSibling){var av=aI(Z);B+=av.colspan;ai=ai.nextSibling}var ai=az;while(ai&&ai.nextSibling){aG+=1;ai=ai.nextSibling}b.windowManager.open({url:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/table/merge_cells.htm",width:360+parseInt(b.getLang("table.merge_cells_delta_width",0)),height:140,inline:1},{action:"update",numcols:at.colspan,numrows:at.rowspan,maxcols:B,maxrows:aG,plugin_url:v,cs_resource_base_url:CS_RESOURCE_BASE_URL});return false}else{var au=parseInt(M.numrows);var n=parseInt(M.numcols);var V=k(ad,Z);if((""+au)=="NaN"){au=1}if((""+n)=="NaN"){n=1}var aD=m.rows;for(var I=V.rowindex;I<ad.length;I++){var N=[];for(var J=V.cellindex;J<ad[I].length;J++){var ap=d(ad,I,J);if(ap&&!u(ah,ap)&&!u(N,ap)){var F=k(ad,ap);if(F.cellindex<V.cellindex+n&&F.rowindex<V.rowindex+au){N[N.length]=ap}}}if(N.length>0){ah[ah.length]=N}var ap=d(ad,V.rowindex,V.cellindex);a(e.dom.select("br",ap),function(x,r){if(r>0&&e.dom.getAttrib("mce_bogus")){e.dom.remove(x)}})}}}else{var W=[];var P=b.selection.getSel();var aB=null;var l=null;var z=-1,h=-1,w,g;if(P.rangeCount<2){return true}for(var R=0;R<P.rangeCount;R++){var c=P.getRangeAt(R);var Z=c.startContainer.childNodes[c.startOffset];if(!Z){break}if(Z.nodeName=="TD"||Z.nodeName=="TH"){W[W.length]=Z}}var aD=m.rows;for(var I=0;I<aD.length;I++){var N=[];for(var J=0;J<aD[I].cells.length;J++){var ap=aD[I].cells[J];for(var R=0;R<W.length;R++){if(ap==W[R]){N[N.length]=ap}}}if(N.length>0){ah[ah.length]=N}}var l=[];var aB=null;for(var I=0;I<ad.length;I++){for(var J=0;J<ad[I].length;J++){ad[I][J]._selected=false;for(var R=0;R<W.length;R++){if(ad[I][J]==W[R]){if(z==-1){z=J;h=I}w=J;g=I;ad[I][J]._selected=true}}}}for(var I=h;I<=g;I++){for(var J=z;J<=w;J++){if(!ad[I][J]._selected){alert("Invalid selection for merge.");return true}}}}var aE=1,aj=1;var af=-1;for(var I=0;I<ah.length;I++){var t=0;for(var J=0;J<ah[I].length;J++){var aw=aI(ah[I][J]);t+=aw.colspan;if(af!=-1&&aw.rowspan!=af){alert("Invalid selection for merge.");return true}af=aw.rowspan}if(t>aj){aj=t}af=-1}var A=-1;for(var J=0;J<ah[0].length;J++){var L=0;for(var I=0;I<ah.length;I++){var aw=aI(ah[I][J]);L+=aw.rowspan;if(A!=-1&&aw.colspan!=A){alert("Invalid selection for merge.");return true}A=aw.colspan}if(L>aE){aE=L}A=-1}Z=ah[0][0];Z.rowSpan=aE;Z.colSpan=aj;if(Z.rowSpan==1){Z.removeAttribute("rowspan")}if(Z.colSpan==1){Z.removeAttribute("colSpan")}for(var I=0;I<ah.length;I++){for(var J=0;J<ah[I].length;J++){var ay=ah[I][J].innerHTML;var Q=ay.replace(/[ \t\r\n]/g,"");if(Q!="<br/>"&&Q!="<br>"&&Q!='<br mce_bogus="1"/>'&&(J+I>0)){Z.innerHTML+=ay}if(ah[I][J]!=Z&&!ah[I][J]._deleted){var V=k(ad,ah[I][J]);var ag=ah[I][J].parentNode;ag.removeChild(ah[I][J]);ah[I][J]._deleted=true;if(!ag.hasChildNodes()){ag.parentNode.removeChild(ag);var an=null;for(var J=0;cellElm=d(ad,V.rowindex,J);J++){if(cellElm!=an&&cellElm.rowSpan>1){cellElm.rowSpan--}an=cellElm}if(Z.rowSpan>1){Z.rowSpan--}if(Z.rowSpan==1){Z.removeAttribute("rowspan")}}}}}a(e.dom.select("br",Z),function(x,r){if(r>0&&e.dom.getAttrib(x,"mce_bogus")){e.dom.remove(x)}});break}m=b.dom.getParent(b.selection.getNode(),"table");b.addVisual(m);b.nodeChanged(false,true)}return true}return false}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)})();
;
tinyMCE.addI18n("en.table_dlg",{general_tab:"General",advanced_tab:"Advanced",general_props:"General properties",advanced_props:"Advanced properties",rowtype:"Row in table part",title:"Insert/Modify table",width:"Width",height:"Height",cols:"Cols",rows:"Rows",cellspacing:"Cellspacing",cellpadding:"Cellpadding",border:"Border",align:"Alignment",align_default:"Default",align_left:"Left",align_right:"Right",align_middle:"Center",row_title:"Table row properties",cell_title:"Table cell properties",cell_type:"Cell type",valign:"Vertical alignment",align_top:"Top",align_bottom:"Bottom",bordercolor:"Border color",bgcolor:"Background color",merge_cells_title:"Merge table cells",id:"Id",style:"Style",langdir:"Language direction",langcode:"Language code",mime:"Target MIME type",ltr:"Left to right",rtl:"Right to left",bgimage:"Background image",summary:"Summary",td:"Data",th:"Header",cell_cell:"Update current cell",cell_row:"Update all cells in row",cell_all:"Update all cells in table",row_row:"Update current row",row_odd:"Update odd rows in table",row_even:"Update even rows in table",row_all:"Update all rows in table",thead:"Table Head",tbody:"Table Body",tfoot:"Table Foot",scope:"Scope",rowgroup:"Row Group",colgroup:"Col Group",col_limit:"You've exceeded the maximum number of columns of {$cols}.",row_limit:"You've exceeded the maximum number of rows of {$rows}.",cell_limit:"You've exceeded the maximum number of cells of {$cells}.",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",caption:"Table caption",frame:"Frame",frame_none:"none",frame_groups:"groups",frame_rows:"rows",frame_cols:"cols",frame_all:"all",rules:"Rules",rules_void:"void",rules_above:"above",rules_below:"below",rules_hsides:"hsides",rules_lhs:"lhs",rules_rhs:"rhs",rules_vsides:"vsides",rules_box:"box",rules_border:"border"});
;
tinyMCE.addI18n('en.table_dlg',{
    title_new:"Insert table",
    title_edit:"Modify table",
    merge_cells_description: "Choose the number of cells to the right and below the current cell that you would like to merge. Choose &apos;0&apos; if you do not want to merge any cells in the given direction."
});
;
(function(){tinymce.create("tinymce.plugins.HTML",{thunks:new Array(),registerToggleFunction:function(a){this.thunks.push(a)},toggleHTML:function(a){var c=a.plugins.html.thunks;for(var b=0;b<c.length;b++){c[b](a.id)}},prepForTab:false,prepForDel:false,prepForLargeDel:false,init:function(a,b){var c=this;c.editor=a;a.addCommand("mceToggleHTML",function(d,e){return function(){e.toggleHTML(d)}}(a,c));a.onBeforeSetContent.add(function(d,e){e.content=e.content.replace(/  /g,"&nbsp; ");e.content=e.content});a.onGetContent.add(function(d,e){e.content=e.content.replace(/&nbsp;/g," ");e.content=e.content});a.onKeyDown.add(function(e,d){this.prepForTab=false;this.prepForDel=false;this.prepForLargeDel=false;if(d.keyCode==9&&!d.ctrlKey&&!d.altKey&&!e.dom.getParent(e.selection.getNode(),"table")&&!e.dom.getParent(e.selection.getNode(),"ul,ol")){tinymce.dom.Event.cancel(d);this.prepForTab=true}if(tinymce.isGecko&&(d.keyCode==8||d.keyCode==46)&&!e.selection.isCollapsed()){if(e.selection.isCollapsed()){var f=e.selection.getNode();if(f.nodeName.toLowerCase()=="img"){}else{if(f.childNodes.length==0||f.childNodes.length==1&&f.childNodes[0].nodeName.toLowerCase()=="br"){tinymce.dom.Event.cancel(d);this.prepForDel=true}}}else{this.prepForLargeDel=e.selection.getStart().previousSibling}return false}},this);a.onKeyPress.add(function(e,d){if(this.prepForDel){tinymce.dom.Event.cancel(d)}if(d.keyCode==9&&!d.ctrlKey&&!d.altKey&&!e.dom.getParent(e.selection.getNode(),"table")&&!e.dom.getParent(e.selection.getNode(),"ul,ol")){tinymce.dom.Event.cancel(d)}},this);a.onKeyUp.add(function(e,d){if(this.prepForDel){tinymce.dom.Event.cancel(d);var g=e.selection.getStart();var f=g.previousSibling;if(f){g.parentNode.removeChild(g);while(f.nodeName.toLowerCase()=="ol"||f.nodeName.toLowerCase()=="ul"){f=f.childNodes[f.childNodes.length-1]}if(f.childNodes.length>0){e.selection.select(f.childNodes[f.childNodes.length-1]);e.selection.collapse()}else{e.selection.select(f);e.selection.collapse()}}}else{if(this.prepForLargeDel){tinymce.dom.Event.cancel(d)}}if(d.keyCode==9&&!d.ctrlKey&&!d.altKey&&this.prepForTab&&!e.dom.getParent(e.selection.getNode(),"table")&&!e.dom.getParent(e.selection.getNode(),"ul,ol")){tinymce.dom.Event.cancel(d);e.selection.setContent("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")}},this);a.addButton("html",{title:"html.desc",cmd:"mceToggleHTML"})},getInfo:function(){return{longname:"HTML mode",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("html",tinymce.plugins.HTML)})();
;
tinyMCE.addI18n('en.html',{
    desc:"Toggle HTML mode"
});
;
(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return true}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}return true},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})();
;
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/advimage/image.htm",width:560+parseInt(a.getLang("advimage.delta_width",0)),height:455+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b,cs_resource_base_url:CS_RESOURCE_BASE_URL})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
;
tinyMCE.addI18n("en.advimage_dlg",{tab_general:"General",tab_appearance:"Appearance",tab_advanced:"Advanced",general:"General",title:"Title",preview:"Preview",constrain_proportions:"Constrain proportions",langdir:"Language direction",langcode:"Language code",long_desc:"Long description link",style:"Style",classes:"Classes",ltr:"Left to right",rtl:"Right to left",id:"Id",map:"Image map",swap_image:"Swap image",alt_image:"Alternative image",mouseover:"for mouse over",mouseout:"for mouse out",misc:"Miscellaneous",example_img:"Appearance preview image",missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",dialog_title:"Insert/edit image",src:"Image URL",alt:"Image description",list:"Image list",border:"Border",dimensions:"Dimensions",vspace:"Vertical space",hspace:"Horizontal space",align:"Alignment",align_baseline:"Baseline",align_top:"Top",align_middle:"Middle",align_bottom:"Bottom",align_texttop:"Text top",align_textbottom:"Text bottom",align_left:"Left",align_right:"Right",image_list:"Image list"});
;
tinyMCE.addI18n('en.advimage_dlg',{
    dialog_title:"Insert Image",
    src:"URL",
    align_inline:"Normal",
    align_nowrap:"No Wrap",
    insert_desc : "Use the form below to insert a remote image from a web page into your discussion, document, blog post or comment.",
    from_the_web: "From the Web",
    example : "example"
});
;
(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:CS_BASE_URL+"/resources/scripts/tiny_mce3/plugins/advlink/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b,cs_resource_base_url:CS_RESOURCE_BASE_URL})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
;
tinyMCE.addI18n("en.advlink_dlg",{title:"Insert/edit link",url:"Link URL",target:"Target",titlefield:"Title",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",list:"Link list",general_tab:"General",popup_tab:"Popup",events_tab:"Events",advanced_tab:"Advanced",general_props:"General properties",popup_props:"Popup properties",event_props:"Events",advanced_props:"Advanced properties",popup_opts:"Options",anchor_names:"Anchors",target_same:"Open in this window / frame",target_parent:"Open in parent window / frame",target_top:"Open in top frame (replaces all frames)",target_blank:"Open in new window",popup:"Javascript popup",popup_url:"Popup URL",popup_name:"Window name",popup_return:"Insert 'return false'",popup_scrollbars:"Show scrollbars",popup_statusbar:"Show status bar",popup_toolbar:"Show toolbars",popup_menubar:"Show menu bar",popup_location:"Show location bar",popup_resizable:"Make window resizable",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_size:"Size",popup_position:"Position (X/Y)",id:"Id",style:"Style",classes:"Classes",target_name:"Target name",langdir:"Language direction",target_langcode:"Target language",langcode:"Language code",encoding:"Target character encoding",mime:"Target MIME type",rel:"Relationship page to target",rev:"Relationship target to page",tabindex:"Tabindex",accesskey:"Accesskey",ltr:"Left to right",rtl:"Right to left",link_list:"Link list"});
;
(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();
;
(function(){var e=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,f=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(g,h){g.onBeforeRenderUI.add(function(){g.windowManager=new tinymce.InlineWindowManager(g);e.loadCSS(CS_RESOURCE_BASE_URL+"/styles/tiny_mce3/plugins/inlinepopups/skins/"+(g.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(g){var h=this;h.parent(g);h.zIndex=300000;h.count=0},doc:null,open:function(B,r){var q=this,s,g="",i=q.editor,o=0,A=0,y,v,h,j,l,m,n;var k=0,z=0;var m=window;try{while(m.parent&&m!=m.parent&&typeof(m.parent.jive)!="undefined"){if(m.frameElement){k+=jive.ext.x.xPageX(m.frameElement);z+=jive.ext.x.xPageY(m.frameElement)}m=m.parent;m.editor=window.editor;m.jiveRTE=window.jiveRTE;m.tinymce=window.tinymce;m.tinyMCE=window.tinyMCE}}catch(C){}i.plugins.inlinepopups.doc=m.document;var E=i.plugins.inlinepopups.doc;var x=new tinymce.dom.DOMUtils(E);if(!$def(i.plugins.inlinepopups.overlay)){var D=E.createElement("DIV");D.className="overlay";D.setAttribute("class","overlay");E.body.appendChild(D);i.plugins.inlinepopups.overlay=D;jive.ext.x.xAddEventListener(D,"click",function(){var t=window.editor.toArray(function(u){return $def(u.closeAllDialogs)});for(var p=0;p<t.length;p++){t[p].closeAllDialogs()}})}B=B||{};r=r||{};if(!B.inline){return q.parent(B,r)}if(!B.type){q.bookmark=i.selection.getBookmark("simple")}s=x.uniqueId()+Math.round(Math.random()*10000000);y=x.getViewPort();B.width=parseInt(B.width||320);B.height=parseInt(B.height||240);B.min_width=parseInt(B.min_width||150);B.min_height=parseInt(B.min_height||100);B.max_width=parseInt(B.max_width||2000);B.max_height=parseInt(B.max_height||2000);B.left=B.left||Math.round(Math.max(y.x,y.x+(y.w/2)-(B.width/2)));B.top=B.top||Math.round(Math.max(y.y,y.y+(y.h/2)-(B.height/2)));B.left+=k;B.top+=z;B.movable=B.resizable=true;r.mce_width=B.width;r.mce_height=B.height;r.mce_inline=true;r.mce_window_id=s;r.mce_auto_focus=B.auto_focus;q.features=B;q.params=r;q.onOpen.dispatch(q,B,r);if(B.type){g+=" mceModal";if(B.type){g+=" mce"+B.type.substring(0,1).toUpperCase()+B.type.substring(1)}B.resizable=false}if(B.statusbar){g+=" mceStatusbar"}if(B.resizable){g+=" mceResizable"}if(B.minimizable){g+=" mceMinimizable"}if(B.maximizable){g+=" mceMaximizable"}if(B.movable){g+=" mceMovable"}q._addAll(E.body,["div",{id:s,"class":i.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:s+"_wrapper","class":"mceWrapper"+g},["div",{id:s+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:s+"_title"},B.title||""]],["div",{id:s+"_middle","class":"mceMiddle"},["div",{id:s+"_left","class":"mceLeft"}],["span",{id:s+"_content"}],["div",{id:s+"_right","class":"mceRight"}]],["div",{id:s+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:s+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:s+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);x.setStyles(s,{top:-10000,left:-10000});if(tinymce.isGecko){x.setStyle(s,"overflow","auto")}if(!B.type){o+=x.get(s+"_left").clientWidth;o+=x.get(s+"_right").clientWidth;A+=x.get(s+"_top").clientHeight;A+=x.get(s+"_bottom").clientHeight}x.setStyles(s,{top:B.top,left:B.left,width:B.width+o,height:B.height+A});n=B.url||B.file;if(n){if(tinymce.relaxedDomain){n+=(n.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}n=tinymce._addVer(n)}if(!B.type){x.add(s+"_content","iframe",{id:s+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});x.setStyles(s+"_ifr",{width:B.width,height:B.height});x.setAttrib(s+"_ifr","src",n)}else{try{q._addAll($j('[id="'+s+'_wrapper"]').get(0),["input",{id:s+"_ok","class":"mceOk",value:"Ok",type:"button"},"Ok"])}catch(C){x.add(s+"_wrapper","input",{id:s+"_ok","class":"mceOk",value:"Ok",type:"button"},"Ok")}if(B.type=="confirm"){x.add(s+"_wrapper","input",{"class":"mceCancel",value:"Cancel",type:"button"},"Cancel")}x.add(s+"_middle","div",{"class":"mceIcon"});x.setHTML(s+"_content",B.content.replace("\n","<br />"))}h=a.add(s,"mousedown",function(u){var F=u.target,p,t;p=q.windows[s];q.focus(s);if(F.nodeName.toLowerCase()=="a"||F.nodeName.toLowerCase()=="input"){if(F.className=="mceClose"){q.close(null,s);return a.cancel(u)}else{if(F.className=="mceOk"||F.className=="mceCancel"){B.button_func(F.className=="mceOk");return a.cancel(u)}else{if(F.className=="mceMax"){p.oldPos=p.element.getXY();p.oldSize=p.element.getSize();t=x.getViewPort();t.w-=2;t.h-=2;p.element.moveTo(t.x,t.y);p.element.resizeTo(t.w,t.h);x.setStyles(s+"_ifr",{width:t.w-p.deltaWidth,height:t.h-p.deltaHeight});x.addClass(s+"_wrapper","mceMaximized")}else{if(F.className=="mceMed"){p.element.moveTo(p.oldPos.x,p.oldPos.y);p.element.resizeTo(p.oldSize.w,p.oldSize.h);p.iframeElement.resizeTo(p.oldSize.w-p.deltaWidth,p.oldSize.h-p.deltaHeight);x.removeClass(s+"_wrapper","mceMaximized")}else{if(F.className=="mceMove"){return q._startDrag(s,u,F.className)}else{if(x.hasClass(F,"mceResize")){return q._startDrag(s,u,F.className.substring(13))}}}}}}}});j=function(u){var w=u.target||u.srcElement;if($def(w)&&w){q.focus(s);if(w.nodeName=="INPUT"||w.nodeName=="input"||w.nodeName=="A"||w.nodeName=="a"){switch(w.className){case"mceClose":var t=window.editor.toArray(function(F){return $def(F.closeAllDialogs)});for(var p=0;p<t.length;p++){t[p].closeAllDialogs()}return a.cancel(u);case"mceOk":case"mceCancel":B.button_func(w.className=="mceOk");return a.cancel(u)}}}};$j(E.body).find("#"+s).click(j);q.windows=q.windows||{};m=q.windows[s]={id:s,mousedown_func:h,click_func:j,element:new b(s,{blocker:1,container:i.getContainer()}),iframeElement:new b(s+"_ifr"),features:B,deltaWidth:o,deltaHeight:A};m.iframeElement.on("focus",function(){q.focus(s)});if(q.count==0&&q.editor.getParam("dialog_type")=="modal"){x.add(x.doc.body,"div",{id:"mceModalBlocker","class":(q.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{left:y.x,top:y.y,zIndex:q.zIndex-1}});x.show("mceModalBlocker")}else{x.setStyle("mceModalBlocker","z-index",q.zIndex-1)}q.focus(s);q._fixIELayout(s,1);if(x.get(s+"_ok")){x.get(s+"_ok").focus()}q.count++;i.plugins.inlinepopups.overlay.style.height=jive.ext.x.xDocHeight(E)+"px";i.plugins.inlinepopups.overlay.style.display="block";return m},focus:function(l){var h=tinyMCE.activeEditor;if(h.plugins.inlinepopups.doc==null){var g=window;while(g.parent&&g!=g.parent){g=g.parent;if(!$def(g.tinymce)){g.tinymce=window.tinymce;g.tinyMCE=window.tinyMCE}}h.plugins.inlinepopups.doc=g.document}var i=this,g=i.windows[l],j=tinyMCE.activeEditor.plugins.inlinepopups.doc,k=new tinymce.dom.DOMUtils(j);if($def(g)&&g){g.zIndex=this.zIndex++;g.element.setStyle("zIndex",g.zIndex);g.element.update()}l=l+"_wrapper";k.removeClass(i.lastId,"mceFocus");k.addClass(l,"mceFocus");i.lastId=l},_addAll:function(m,k){var h,o,g=this,j=tinyMCE.activeEditor.plugins.inlinepopups.doc,l=new tinymce.dom.DOMUtils(j);if(c(k,"string")){m.appendChild(l.doc.createTextNode(k))}else{if(k.length){m=m.appendChild(l.create(k[0],k[1]));for(h=2;h<k.length;h++){g._addAll(m,k[h])}}}},_startDrag:function(x,I,F){var q=this,v,B,H=tinyMCE.activeEditor.plugins.inlinepopups.doc,A=new tinymce.dom.DOMUtils(H);var g,m=q.windows[x],i=m.element,z=i.getXY(),y,r,G,h,C,u,s,k,j,n,l,o,D;h={x:0,y:0};C=A.getViewPort();C.w-=2;C.h-=2;k=I.screenX;j=I.screenY;n=l=o=D=0;v=a.add(H,"mouseup",function(p){a.remove(H,"mouseup",v);a.remove(H,"mousemove",B);if(g){g.remove()}i.moveBy(n,l);i.resizeBy(o,D);r=i.getSize();A.setStyles(x+"_ifr",{width:r.w-m.deltaWidth,height:r.h-m.deltaHeight});q._fixIELayout(x,1);return a.cancel(p)});if(F!="Move"){E()}function E(){var p=tinyMCE.activeEditor.plugins.inlinepopups.doc,t=new tinymce.dom.DOMUtils(p);if(g){return}q._fixIELayout(x,0);t.add(d.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(q.editor.settings.inlinepopups_skin||"clearlooks2"),style:{left:C.x,top:C.y,zIndex:q.zIndex+1}});g=new b("mceEventBlocker");g.update();y=i.getXY();r=i.getSize();u=h.x+y.x-C.x;s=h.y+y.y-C.y;t.add(g.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:u,top:s,width:r.w,height:r.h}});G=new b("mcePlaceHolder")}B=a.add(d,"mousemove",function(w){var p,J,t;E();p=w.screenX-k;J=w.screenY-j;switch(F){case"ResizeW":n=p;o=0-p;break;case"ResizeE":o=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(F=="ResizeNW"){n=p;o=0-p}else{if(F=="ResizeNE"){o=p}}l=J;D=0-J;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(F=="ResizeSW"){n=p;o=0-p}else{if(F=="ResizeSE"){o=p}}D=J;break;case"mceMove":n=p;l=J;break}if(o<(t=m.features.min_width-r.w)){if(n!==0){n+=o-t}o=t}if(D<(t=m.features.min_height-r.h)){if(l!==0){l+=D-t}D=t}o=Math.min(o,m.features.max_width-r.w);D=Math.min(D,m.features.max_height-r.h);n=Math.max(n,C.x-(u+C.x));l=Math.max(l,C.y-(s+C.y));n=Math.min(n,(C.w+C.x)-(u+r.w+C.x));l=Math.min(l,(C.h+C.y)-(s+r.h+C.y));if(n+l!==0){if(u+n<0){n=0}if(s+l<0){l=0}G.moveTo(u+n,s+l)}if(o+D!==0){G.resizeTo(r.w+o,r.h+D)}return a.cancel(w)});return a.cancel(I)},resizeBy:function(h,i,j){var g=this.windows[j];if(g){g.element.resizeBy(h,i);g.iframeElement.resizeBy(h,i)}},close:function(g,h){setTimeout(function(j,k,i){return function(){var q=tinyMCE.activeEditor.plugins.inlinepopups.doc,r=new tinymce.dom.DOMUtils(q);var m,l=0,o;i.count--;if(i.count==0){r.remove("mceModalBlocker")}if(!k&&j){i.parent(j);return}if(m=i.windows[k]){tinyMCE.activeEditor.plugins.inlinepopups.overlay.style.display="none";i.onClose.dispatch(i);a.remove(q,"mousedown",m.mousedownFunc);a.remove(q,"click",m.clickFunc);a.clear(k);a.clear(k+"_ifr");r.setAttrib(k+"_ifr","src",'javascript:""');var n=q.getElementById(m.id);try{m.element.remove();n.parentNode.removeChild(n)}catch(p){}delete i.windows[k]}else{}tinyMCE.activeEditor.focus();tinyMCE.activeEditor.undoManager.add()}}(g,h,this),33)},setTitle:function(g,k){var i=tinyMCE.activeEditor.plugins.inlinepopups.doc,j=new tinymce.dom.DOMUtils(i);var h;if(h=j.get(k+"_title")){h.innerHTML=j.encode(g)}},alert:function(h,g,l){var j=tinyMCE.activeEditor;if(j.plugins.inlinepopups.doc==null){var i=window;while(i.parent&&i!=i.parent){i=i.parent;if(!$def(i.tinymce)){i.tinymce=window.tinymce;i.tinyMCE=window.tinyMCE}}j.plugins.inlinepopups.doc=i.document}var m=tinyMCE.activeEditor.plugins.inlinepopups.doc,n=new tinymce.dom.DOMUtils(m);var k=this,i;i=k.open({title:k,type:"alert",button_func:function(o){if(g){g.call(o||k,o)}k.close(null,i.id)},content:n.encode(k.editor.getLang(h,h)),inline:1,width:400,height:130})},confirm:function(h,g,l){var j=tinyMCE.activeEditor;if(j.plugins.inlinepopups.doc==null){var i=window;while(i.parent&&i!=i.parent){i=i.parent;if(!$def(i.tinymce)){i.tinymce=window.tinymce;i.tinyMCE=window.tinyMCE}}j.plugins.inlinepopups.doc=i.document}var m=tinyMCE.activeEditor.plugins.inlinepopups.doc,n=new tinymce.dom.DOMUtils(m);var k=this,i;i=k.open({title:k,type:"confirm",button_func:function(o){if(g){g.call(o||k,o)}k.close(null,i.id)},content:n.encode(k.editor.getLang(h,h)),inline:1,width:400,height:130})},_fixIELayout:function(l,i){var j=tinyMCE.activeEditor.plugins.inlinepopups.doc,k=new tinymce.dom.DOMUtils(j);var g,h;if(!tinymce.isIE6){return}f(["n","s","w","e","nw","ne","sw","se"],function(m){var n=k.get(l+"_resize_"+m);k.setStyles(n,{width:i?n.clientWidth:"",height:i?n.clientHeight:"",cursor:k.getStyle(n,"cursor",1)});k.setStyle(l+"_bottom","bottom","-1px");n=0});if(g=this.windows[l]){g.element.hide();g.element.show();f(k.select("div,a",l),function(n,m){if(n.currentStyle.backgroundImage!="none"){h=new Image();h.src=n.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});k.get(l).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
;
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;if(d.nodeName!="A"){f.add({title:"jivelink.link_desc",icon:"link",cmd:"mceJiveLink",ui:true});f.addSeparator()}if(d.nodeName=="A"&&!h.dom.getAttrib(d,"name")){f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});f.addSeparator()}if(h.dom.getParent(d,"img")){g=f.addMenu({title:"contextmenu.align",icon:"align"});g.add({title:"advimage_dlg.align_inline",cmd:"mceNoFloatImage"});g.add({title:"advimage_dlg.align_left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"advimage_dlg.align_right",icon:"justifyright",cmd:"JustifyRight"})}else{if(h.settings.images_enabled){f.add({title:"advanced.insert_image_desc",icon:"image",cmd:h.plugins.jiveimage?"mceJiveImage":"mceImage",ui:true});f.addSeparator()}g=f.addMenu({title:"contextmenu.align",icon:"align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"})}l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
;
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"&nbsp;");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*(&nbsp;)+/g,/(&nbsp;|<br[^>]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||g.wordContent){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/&nbsp;/g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){f([/<\/?(span)[^>]*>/gi])}}if(b.getParam("paste_remove_spans")){f([/<\/?(span)[^>]*>/gi])}g.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,j){var c,g,d=h.selection,n,k,b,l,f;function m(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker">&nbsp;</span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol");var i=e.getParent(g,"table,p,h1,h2,h3,h4,h5,h6,ul,ol");if(c&&i.nodeName.toLowerCase()!="table"){g=e.split(c,g)}a(e.create("div",0,j).childNodes,function(o){n=g.parentNode.insertBefore(o.cloneNode(true),g)});m(n);e.remove("_marker");k=d.getStart();b=e.getViewPort(h.getWin());l=h.dom.getPos(k).y;f=k.clientHeight;if(l<b.y||l+f>b.y+b.h){h.getDoc().body.scrollTop=l<b.y?l:l-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
;
var foo=(function(){var d=tinymce.DOM,b=tinymce.dom.Event,g=tinymce.extend,e=tinymce.each,a=tinymce.util.Cookie,f,c=tinymce.explode;tinymce.ThemeManager.requireLangPack("advanced");tinymce.create("tinymce.themes.AdvancedTheme",{controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","jiveInsertUnorderedList"],numlist:["numlist_desc","jiveInsertOrderedList"],outdent:["outdent_desc","mceOutdent"],indent:["indent_desc","mceIndent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","mceRemoveFullFormat"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","blockquote"],removeListsFromHelper:function(i,n,h,l){var j=false;if(h==null){return true}if(h==l){j=true}var m=i.getDoc();if(h.nodeType==3||h.nodeName.toLowerCase()!="ol"&&h.nodeName.toLowerCase()!="ul"){n.appendChild(h);return false}while(h.childNodes.length>0){var k=h.childNodes[0];if(this.removeListsFromHelper(i,n,k,l)){if(h.nodeName.toLowerCase()=="ol"||h.nodeName.toLowerCase()=="ul"){h.removeChild(k)}return true}if(h.nodeName.toLowerCase()=="ol"||h.nodeName.toLowerCase()=="ul"){h.removeChild(k)}}if(this.shouldEndLine(h)){n.appendChild(m.createTextNode("\n"))}if(j){return j}if(h.nextSibling!=null){if(this.removeListsFromHelper(i,n,h.nextSibling,l)){return true}}return false},getParentNode:function(h,i){return(new tinymce.dom.DOMUtils(h.getDoc())).getParent(i,function(j){return j==h.getBody()||j!=i})},removeListsFrom:function(m,j,k,h){var n=false;if(k==null){return true}if(k==h){n=true}var p=m.getDoc();if(k.nodeType==3||k.nodeName.toLowerCase()!="ol"&&k.nodeName.toLowerCase()!="ul"){j.appendChild(k);return false}while(k.childNodes.length>0){var i=k.childNodes[0];if(this.removeListsFromHelper(m,j,i,h)){if(k.nodeName.toLowerCase()=="ol"||k.nodeName.toLowerCase()=="ul"){k.removeChild(i)}return true}if(k.nodeName.toLowerCase()=="ol"||k.nodeName.toLowerCase()=="ul"){k.removeChild(i)}}if(this.shouldEndLine(k)){j.appendChild(p.createTextNode("\n"))}if(n){if(k.nodeName.toLowerCase()=="ol"||k.nodeName.toLowerCase()=="ul"){var o=this.getParentNode(m,k);o.removeChild(k)}return n}if(k.nextSibling!=null){var l=k.nextSibling;if(k.nodeName.toLowerCase()=="ol"||k.nodeName.toLowerCase()=="ul"){var o=this.getParentNode(m,k);o.removeChild(k)}if(this.removeListsFromHelper(m,j,l,h)){return true}}var l=this.getNextSibling(m,k);if(k.nodeName.toLowerCase()=="ol"||k.nodeName.toLowerCase()=="ul"){var o=this.getParentNode(m,k);o.removeChild(k)}if(this.removeListsFrom(m,j,l,h)){return true}return false},init:function(i,j){var k=this,l,h;i.addCommand("mceRemoveFullFormat",function(){if(!i.selection.isCollapsed()){i.execCommand("RemoveFormat");var o=i.selection.getNode();var m=i.dom.getParent(o,"table");if(m==null){i.execCommand("FormatBlock",false,"<p>")}}});k.editor=i;k.url=j;k.onResolveName=new tinymce.util.Dispatcher(this);k.onResize=new tinymce.util.Dispatcher(this);k.settings=l=g({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},i.settings);if((h=l.theme_advanced_path_location)&&h!="none"){l.theme_advanced_statusbar_location=l.theme_advanced_path_location}if(l.theme_advanced_statusbar_location=="none"){l.theme_advanced_statusbar_location=0}i.onInit.add(function(){i.onNodeChange.add(k._nodeChanged,k);i.onKeyDown.add(k._keyDown,k);jive.ext.x.xTimer.set("timeout",k,"_refreshFont",33);jive.ext.x.xTimer.set("timeout",k,"_refreshFont",500);jive.ext.x.xTimer.set("timeout",k,"_refreshFontColor",33);jive.ext.x.xTimer.set("timeout",k,"_refreshFontColor",500);jive.ext.x.xTimer.set("timeout",k,"_refreshFontSize",33);jive.ext.x.xTimer.set("timeout",k,"_refreshFontSize",500);i.addCommand("jiveInsertUnorderedList",function(){i.execCommand("mceInsertUnorderedList");window.focus();i.focus()});i.addCommand("jiveInsertOrderedList",function(){i.execCommand("mceInsertOrderedList");window.focus();i.focus()});var p=i.controlManager.get("fontsizeselect");if(p){var o=document.createElement("DIV");var n=["8 pt","10 pt","12 pt","14 pt","18 pt","24 pt","36 pt"],m=[8,10,12,14,18,24,36];p.computed=new Array();document.body.appendChild(o);e(c(k.settings.theme_advanced_font_sizes),function(q){o.style.fontSize=m[q-1]+"pt";var r=jive.ext.x.xGetCS(o,"font-size");p.computed.push(r);p.add(n[parseInt(q)-1],q,{style:"font-size:"+m[q-1]+"pt","class":"mceFontSize"+q})});document.body.removeChild(o);i.onKeyUp.add(function(r){var q=r.controlManager;q.setActive("bold",r.queryCommandState("Bold"));q.setActive("italic",r.queryCommandState("Italic"));q.setActive("underline",r.queryCommandState("Underline"));q.setActive("strikethrough",r.queryCommandState("Strikethrough"))});i.onBeforeExecCommand.add(function(s,v,u,w){var r=s.controlManager;if(v=="Bold"){r.get("bold").setActive(s.queryCommandState("Bold"))}if(v=="Italic"){r.get("italic").setActive(s.queryCommandState("Italic"))}if(v=="Underline"){r.get("underline").setActive(s.queryCommandState("Underline"))}if(v=="Strikethrough"){r.get("strikethrough").setActive(s.queryCommandState("Strikethrough"))}if(v=="mceOutdentComplete"||v=="mceIndentComplete"){r.setDisabled("outdent",!s.queryCommandState("Outdent"))}if(v=="FontSize"){if(!s.selection.isCollapsed()){var q=s.selection.getStart();var t=s.selection.getEnd();q=s.plugins.jiveutil.getNodeAt(q,s.selection.getRng().startOffset);s.plugins.jiveutil.walkDOMTree(q,t,function(x){if(!tinymce.isWebKit&&x.style){x.style.fontSize=""}if(x.nodeType==1&&x.nodeName.toLowerCase()=="font"&&x.getAttribute("size")!=w){x.setAttribute("size",w)}})}}})}});i.onSetProgressState.add(function(o,m,p){var q,r=o.id,n;if(m){k.progressTimer=setTimeout(function(){q=o.getContainer();q=q.insertBefore(d.create("DIV",{style:"position:relative"}),q.firstChild);n=d.get(o.id+"_tbl");d.add(q,"div",{id:r+"_blocker","class":"mceBlocker",style:{width:n.clientWidth+2,height:n.clientHeight+2}});d.add(q,"div",{id:r+"_progress","class":"mceProgress",style:{left:n.clientWidth/2,top:n.clientHeight/2}})},p||0)}else{d.remove(r+"_blocker");d.remove(r+"_progress");clearTimeout(k.progressTimer)}});d.loadCSS(window.CS_RESOURCE_BASE_URL+"/"+(l.editor_css||"styles/tiny_mce3/themes/advanced/skins/"+i.settings.skin+"/ui.css"));if(l.skin_variant){d.loadCSS(i.baseURI.toAbsolute(l.editor_css||"themes/advanced/skins/"+i.settings.skin+"/ui_"+l.skin_variant+".css"))}},createControl:function(k,h){var i,j;if(j=h.createControl(k)){return j}switch(k){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((i=this.controls[k])){return h.createButton(k,{title:"advanced."+i[0],cmd:i[1],ui:i[2],value:i[3]})}},execCommand:function(j,i,k){var h=this["_"+j];if(h){h.call(this,i,k);return true}return false},_importClasses:function(){var h=this.editor,i=h.controlManager.get("styleselect");if(i.getLength()==0){e(h.dom.getClasses(),function(j){i.add(j["class"],j["class"])})}},_createStyleSelect:function(l){var i=this,h=i.editor,j=h.controlManager,k=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(m){if(k.selectedValue===m){h.execCommand("mceSetStyleInfo",0,{command:"mceRemoveFullFormat"});k.select();return false}else{h.execCommand("mceSetCSSClass",0,m)}}});if(k){e(h.getParam("theme_advanced_styles","","hash"),function(n,m){if(n){k.add(i.editor.translate(m),n)}});k.onPostRender.add(function(m,o){b.add(o,"focus",i._importClasses,i);b.add(o,"mousedown",i._importClasses,i)})}return k},_createFontSelect:function(){var j,i=this,h=i.editor;j=h.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",cmd:"FontName"});if(j){e(h.getParam("theme_advanced_fonts",i.settings.theme_advanced_fonts,"hash"),function(m,l){j.add(h.translate(l),m.toLowerCase(),{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return j},_createFontSizeSelect:function(){var i=this,h=i.editor;var j=h.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",cmd:"FontSize"});return j},_createBlockFormats:function(){var j,h={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},i=this;j=i.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(j){e(i.editor.getParam("theme_advanced_blockformats",i.settings.theme_advanced_blockformats,"hash"),function(m,l){j.add(i.editor.translate(l!=m?l:h[m]),m,{"class":"mce_formatPreview mce_"+m})})}return j},_createForeColorMenu:function(){var l,i=this,j=i.settings,k={},h;if(j.theme_advanced_more_colors){k.more_colors_func=function(){i._mceColorPicker(0,{color:l.value,func:function(m){l.setColor(m)}})}}if(h=j.theme_advanced_text_colors){k.colors=h}k.title="advanced.forecolor_desc";k.cmd="ForeColor";k.scope=this;l=i.editor.controlManager.createColorSplitButton("forecolor",k);l.oldSetColor=l.setColor;l.setColor=function(m){i.ignoreRefreshCommand=true;this.oldSetColor(m);i.ignoreRefreshCommand=false};return l},_createBackColorMenu:function(){var l,i=this,j=i.settings,k={},h;if(j.theme_advanced_more_colors){k.more_colors_func=function(){i._mceColorPicker(0,{color:l.value,func:function(m){l.setColor(m)}})}}if(h=j.theme_advanced_background_colors){k.colors=h}k.title="advanced.backcolor_desc";k.cmd="HiliteColor";k.scope=this;l=i.editor.controlManager.createColorSplitButton("backcolor",k);l.oldSetColor=l.setColor;l.setColor=function(m){i.ignoreRefreshCommand=true;this.oldSetColor(m);i.ignoreRefreshCommand=false};return l},renderUI:function(j){var l,k,m,u=this,q=u.editor,v=u.settings,r,i,h;l=i=d.create("span",{id:q.id+"_parent","class":"mceEditor "+q.settings.skin+"Skin"+(v.skin_variant?" "+q.settings.skin+"Skin"+u._ufirst(v.skin_variant):"")});if(!d.boxModel){l=d.add(l,"div",{"class":"mceOldBoxModel"})}l=r=d.add(l,"table",{id:q.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});l=m=d.add(l,"tbody");switch((v.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":k=u._rowLayout(v,m,j);break;case"customlayout":k=q.execCallback("theme_advanced_custom_layout",v,m,j,i);break;default:k=u._simpleLayout(v,m,j,i)}l=j.targetNode;h=d.stdMode?r.getElementsByTagName("tr"):r.rows;d.addClass(h[0],"mceFirst");d.addClass(h[h.length-1],"mceLast");e(d.select("tr",m),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(v.theme_advanced_toolbar_container)){d.get(v.theme_advanced_toolbar_container).appendChild(i)}else{d.insertAfter(i,l)}b.add(q.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){u._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!q.getParam("accessibility_focus")||q.getParam("tab_focus")){b.add(d.add(i,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(q.id).focus()})}if(v.theme_advanced_toolbar_location=="external"){j.deltaHeight=0}u.deltaHeight=j.deltaHeight;j.targetNode=null;return{iframeContainer:k,editorContainer:q.id+"_parent",sizeContainer:r,deltaHeight:j.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(h,i){var j=d.get(this.editor.id+"_tbl");this.resizeTo(j.clientWidth+h,j.clientHeight+i)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var h=this.editor.id;b.clear(h+"_resize");b.clear(h+"_path_row");b.clear(h+"_external_close")},_simpleLayout:function(x,q,j,h){var w=this,r=w.editor,u=x.theme_advanced_toolbar_location,l=x.theme_advanced_statusbar_location,k,i,m,v;if(u=="top"){w._addToolbars(q,j)}if(u=="external"){k=v=d.create("div",{style:"position:relative"});k=d.add(k,"div",{id:r.id+"_external","class":"mceExternalToolbar"});d.add(k,"a",{id:r.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});k=d.add(k,"table",{id:r.id+"_tblext",cellSpacing:0,cellPadding:0});m=d.add(k,"tbody");if(h.firstChild.className=="mceOldBoxModel"){h.firstChild.appendChild(v)}else{h.insertBefore(v,h.firstChild)}w._addToolbars(m,j);r.onMouseUp.add(function(){var o=d.get(r.id+"_external");d.show(o);d.hide(f);var n=b.add(r.id+"_external_close","click",function(){d.hide(r.id+"_external");b.remove(r.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(r.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";f=r.id+"_external";o=null})}if(l=="top"){w._addStatusBar(q,j)}if(!x.theme_advanced_toolbar_container){k=d.add(q,"tr");k=i=d.add(k,"td",{"class":"mceIframeContainer"})}if(u=="bottom"){w._addToolbars(q,j)}if(l=="bottom"){w._addStatusBar(q,j)}return i},_rowLayout:function(v,l,j){var u=this,m=u.editor,r,w,h=m.controlManager,k,i,q,p;r=v.theme_advanced_containers_default_class||"";w=v.theme_advanced_containers_default_align||"center";e(c(v.theme_advanced_containers||""),function(s,o){var n=v["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":k=d.add(l,"tr");k=i=d.add(k,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":u._addStatusBar(l,j);break;default:p=v["theme_advanced_container_"+s+"_align"].toLowerCase();p="mce"+u._ufirst(p);k=d.add(d.add(l,"tr"),"td",{"class":"mceToolbar "+(v["theme_advanced_container_"+s+"_class"]||r)+" "+p||w});q=h.createToolbar("toolbar"+o);u._addControls(n,q);d.setHTML(k,q.renderHTML());j.deltaHeight-=v.theme_advanced_row_height}});return i},_addControls:function(i,h){var j=this,k=j.settings,l,m=j.editor.controlManager;if(k.theme_advanced_disable&&!j._disabled){l={};e(c(k.theme_advanced_disable),function(n){l[n]=1});j._disabled=l}else{l=j._disabled}e(c(i),function(p){var o;if(l&&l[p]){return}if(p=="tablecontrols"){e(["table","delete_table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","row_up","row_down","col_left","col_right","|","split_cells","merge_cells"],function(q){q=j.createControl(q,m);if(q){h.add(q)}});return}o=j.createControl(p,m);if(o){h.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")||r.getParam("tab_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));l.innerHTML=q.join("")},_addStatusBar:function(l,i){var j,u=this,m=u.editor,v=u.settings,h,p,q,k;j=d.add(l,"tr");j=k=d.add(j,"td",{"class":"mceStatusbar"});j=d.add(j,"div",{id:m.id+"_path_row"});d.add(j,"a",{href:"#",accesskey:"x"});if(v.theme_advanced_resizing&&!tinymce.isOldWebKit){d.add(k,"a",{id:m.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(v.theme_advanced_resizing_use_cookie){m.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+m.id+"_size"),r=d.get(m.id+"_tbl");if(!n){return}if(v.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(m.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+u.deltaHeight)+"px"})}m.onPostRender.add(function(){b.add(m.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(m.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=v.theme_advanced_resizing_min_width||100;mih=v.theme_advanced_resizing_min_height||100;maw=v.theme_advanced_resizing_max_width||65535;mah=v.theme_advanced_resizing_max_height||65535;t=d.add(d.get(m.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);h={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};p=b.add(d.doc,"mousemove",function(B){var n,A;h.dx=B.screenX-h.x;h.dy=B.screenY-h.y;n=Math.max(miw,h.w+h.dx);A=Math.max(mih,h.h+h.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(v.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});q=b.add(d.doc,"mouseup",function(n){var w;b.remove(d.doc,"mousemove",p);b.remove(d.doc,"mouseup",q);z.style.display="";d.remove(t);if(h.dx===null){return}w=d.get(m.id+"_ifr");if(v.theme_advanced_resize_horizontal){z.style.width=Math.max(10,h.w+h.dx)+"px"}z.style.height=Math.max(10,h.h+h.dy)+"px";w.style.height=Math.max(10,w.clientHeight+h.dy)+"px";if(v.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+m.id+"_size",{cw:h.w+h.dx,ch:h.h+h.dy})}m.theme.onResize.dispatch(m.theme)});return b.cancel(x)})})}i.deltaHeight-=21;j=l=null},_getCurrentNode:function(h){var i=h.selection.getNode();if(i==null){if(h.getBody().childNodes.length>0){return h.getBody().childNodes[0]}else{return null}}return i},ignoreRefreshCommand:false,_refreshFontColor:function(k){if(!this.ignoreRefreshCommand){var j=tinyMCE.activeEditor;var m=$j('[id="'+j.id+'_forecolor_preview"]');var i;if(m.length>0){if(typeof(k)!="function"){var l=this._getCurrentNode(j);i=jive.ext.x.xGetCS(l,"color")}else{i=k("color")}m.css("background-color",i);var h=j.controlManager;h.get("forecolor").value=i}}},_refreshFont:function(l){var k=tinyMCE.activeEditor;var h=k.controlManager;var n=h.get("fontselect");var j;if(n){if(typeof(l)!="function"){var m=this._getCurrentNode(k);j=jive.ext.x.xGetCS(m,"font-family")}else{j=l("font-family")}if(j.indexOf(",")>=0){n.select(j.toLowerCase())}else{var i=false;e(k.getParam("theme_advanced_fonts",this.settings.theme_advanced_fonts,"hash"),function(q,p){if(!i){var o=q.split(",");if(o.indexOf(j)==0){i=true;n.select(q.toLowerCase())}}});if(i){return}e(k.getParam("theme_advanced_fonts",this.settings.theme_advanced_fonts,"hash"),function(q,p){if(!i){var o=q.split(",");if(o.indexOf(j)>=0){i=true;n.select(q.toLowerCase())}}})}}},_refreshFontSize:function(j){var i=tinyMCE.activeEditor;var h=i.controlManager;var n=h.get("fontsizeselect");var l;if(n){if(typeof(j)!="function"){var m=this._getCurrentNode(i);l=jive.ext.x.xGetCS(m,"font-size")}else{l=j("font-size")}var k;if(l&&l.indexOf&&l.indexOf("pt")>=0){k=n.computed.indexOf(l)}else{k=parseInt(l)-1}n.select(k+1)}},_keyDown:function(i,h){if(h.keyCode==13){}},_nodeChanged:function(k,r,i,o){var w=this,h,q=0,u,m,x=w.settings;tinymce.each(w.stateControls,function(n){r.setActive(n,k.queryCommandState(w.controls[n][1]))});r.setActive("visualaid",k.hasVisual);r.setDisabled("undo",!k.undoManager.hasUndo()&&!k.typing);r.setDisabled("redo",!k.undoManager.hasRedo());r.setDisabled("outdent",!k.queryCommandState("Outdent"));h=d.getParent(i,"A");if(m=r.get("link")){if(!h||!h.name){m.setDisabled(!h&&o);m.setActive(!!h)}}if(m=r.get("unlink")){m.setDisabled(!h&&o);m.setActive(!!h&&!h.name)}if(m=r.get("anchor")){m.setActive(!!h&&h.name);if(tinymce.isWebKit){h=d.getParent(i,"IMG");m.setActive(!!h&&d.getAttrib(h,"mce_name")=="a")}}h=d.getParent(i,"IMG");if(m=r.get("image")){m.setActive(!!h&&i.className.indexOf("mceItem")==-1)}if(m=r.get("styleselect")){if(i.className){w._importClasses();m.select(i.className)}else{m.select()}}if(m=r.get("formatselect")){h=d.getParent(i,d.isBlock);if(h){m.select(h.nodeName.toLowerCase())}}var j=this._getCurrentNode(k);var l=jive.ext.x.xGetCSFunc(j);if(m=r.get("fontselect")){m.select(k.queryCommandValue("FontName"));this._refreshFont(l)}if(m=r.get("forecolor")){this._refreshFontColor(l)}if(m=r.get("fontsizeselect")){this._refreshFontSize(l)}if(x.theme_advanced_path&&x.theme_advanced_statusbar_location){h=d.get(k.id+"_path")||d.add(k.id+"_path_row","span",{id:k.id+"_path"});d.setHTML(h,"");k.dom.getParent(i,function(y){var p=y.nodeName.toLowerCase(),s,v,t="";if(y.nodeType!=1||(d.hasClass(y,"mceItemHidden")||d.hasClass(y,"mceItemRemoved"))){return}if(u=d.getAttrib(y,"mce_name")){p=u}if(tinymce.isIE&&y.scopeName!=="HTML"){p=y.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(u=d.getAttrib(y,"src")){t+="src: "+u+" "}break;case"a":if(u=d.getAttrib(y,"name")){t+="name: "+u+" ";p+="#"+u}if(u=d.getAttrib(y,"href")){t+="href: "+u+" "}break;case"font":if(x.convert_fonts_to_spans){p="span"}if(u=d.getAttrib(y,"face")){t+="font: "+u+" "}if(u=d.getAttrib(y,"size")){t+="size: "+u+" "}if(u=d.getAttrib(y,"color")){t+="color: "+u+" "}break;case"span":if(u=d.getAttrib(y,"style")){t+="style: "+u+" "}break}if(u=d.getAttrib(y,"id")){t+="id: "+u+" "}if(u=y.className){u=u.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(u&&u.indexOf("mceItem")==-1){t+="class: "+u+" ";if(d.isBlock(y)||p=="img"||p=="span"){p+="."+u}}}p=p.replace(/(html:)/g,"");p={name:p,node:y,title:t};w.onResolveName.dispatch(w,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(q++)},p);if(h.hasChildNodes()){h.insertBefore(d.doc.createTextNode(" \u00bb "),h.firstChild);h.insertBefore(v,h.firstChild)}else{h.appendChild(v)}},k.getBody())}this.prepForReturn=false},_sel:function(h){this.editor.execCommand("mceSelectNodeDepth",false,h)},_mceInsertAnchor:function(j,i){var h=this.editor;h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(h.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(h.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var h=this.editor;h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(h.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(h.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var h=this.editor;h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(j,i){var h=this.editor;i=i||{};h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(h.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(h.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:i.color,func:i.func,theme_url:this.url,cs_resource_base_url:CS_RESOURCE_BASE_URL})},_mceCodeEditor:function(i,j){var h=this.editor;h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(h.getParam("theme_advanced_source_editor_width",720)),height:parseInt(h.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(i,j){var h=this.editor;if(h.dom.getAttrib(h.selection.getNode(),"class").indexOf("mceItem")!=-1){return}h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/image.htm",width:355+parseInt(h.getLang("advanced.image_delta_width",0)),height:275+parseInt(h.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(i,j){var h=this.editor;h.windowManager.open({url:tinymce.baseURL+"/themes/advanced/link.htm",width:310+parseInt(h.getLang("advanced.link_delta_width",0)),height:200+parseInt(h.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var h=this.editor;h.windowManager.confirm("advanced.newdocument",function(i){if(i){h.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var h=this;this._mceColorPicker(0,{color:h.fgColor,func:function(i){h.fgColor=i;h.editor.execCommand("ForeColor",false,i)}})},_mceBackColor:function(){var h=this;this._mceColorPicker(0,{color:h.bgColor,func:function(i){h.bgColor=i;h.editor.execCommand("HiliteColor",false,i)}})},_ufirst:function(h){return h.substring(0,1).toUpperCase()+h.substring(1)}});tinymce.ThemeManager.add("advanced",tinymce.themes.AdvancedTheme)}());
;
tinyMCE.addI18n("en.advanced",{style_select:"Styles",font_size:"Font size",fontdefault:"Font family",block:"Format",paragraph:"Paragraph",div:"Div",address:"Address",pre:"Preformatted",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",blockquote:"Blockquote",code:"Code",samp:"Code sample",dt:"Definition term ",dd:"Definition description",bold_desc:"Bold (Ctrl+B)",italic_desc:"Italic (Ctrl+I)",underline_desc:"Underline (Ctrl+U)",striketrough_desc:"Strikethrough",justifyleft_desc:"Align left",justifycenter_desc:"Align center",justifyright_desc:"Align right",justifyfull_desc:"Align full",bullist_desc:"Unordered list",numlist_desc:"Ordered list",outdent_desc:"Outdent",indent_desc:"Indent",undo_desc:"Undo (Ctrl+Z)",redo_desc:"Redo (Ctrl+Y)",link_desc:"Insert/edit link",unlink_desc:"Unlink",image_desc:"Insert/edit image",cleanup_desc:"Cleanup messy code",code_desc:"Edit HTML Source",sub_desc:"Subscript",sup_desc:"Superscript",hr_desc:"Insert horizontal ruler",removeformat_desc:"Remove formatting",custom1_desc:"Your custom description here",forecolor_desc:"Select text color",backcolor_desc:"Select background color",charmap_desc:"Insert custom character",visualaid_desc:"Toggle guidelines/invisible elements",anchor_desc:"Insert/edit anchor",cut_desc:"Cut",copy_desc:"Copy",paste_desc:"Paste",image_props_desc:"Image properties",newdocument_desc:"New document",help_desc:"Help",blockquote_desc:"Blockquote",clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",path:"Path",newdocument:"Are you sure you want clear all contents?",toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",more_colors:"More colors"});
;
tinyMCE.addI18n('en.advanced',{
    font_size:"Size",
    insert_image_desc:"Insert image",
    edit_image_desc:"Edit image"
});
;
tinyMCE.addI18n("en.advanced_dlg",{about_title:"About TinyMCE",about_general:"About",about_help:"Help",about_license:"License",about_plugins:"Plugins",about_plugin:"Plugin",about_author:"Author",about_version:"Version",about_loaded:"Loaded plugins",anchor_title:"Insert/edit anchor",anchor_name:"Anchor name",code_title:"HTML Source Editor",code_wordwrap:"Word wrap",colorpicker_title:"Select a color",colorpicker_picker_tab:"Picker",colorpicker_picker_title:"Color picker",colorpicker_palette_tab:"Palette",colorpicker_palette_title:"Palette colors",colorpicker_named_tab:"Named",colorpicker_named_title:"Named colors",colorpicker_color:"Color:",colorpicker_name:"Name:",charmap_title:"Select custom character",image_title:"Insert/edit image",image_src:"Image URL",image_alt:"Image description",image_list:"Image list",image_border:"Border",image_dimensions:"Dimensions",image_vspace:"Vertical space",image_hspace:"Horizontal space",image_align:"Alignment",image_align_baseline:"Baseline",image_align_top:"Top",image_align_middle:"Middle",image_align_bottom:"Bottom",image_align_texttop:"Text top",image_align_textbottom:"Text bottom",image_align_left:"Left",image_align_right:"Right",link_title:"Insert/edit link",link_url:"Link URL",link_target:"Target",link_target_same:"Open link in the same window",link_target_blank:"Open link in a new window",link_titlefield:"Title",link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",link_list:"Link list"});
;
jive.namespace("Gadgets");jive.Gadgets.GadgetSource=$Class.extend({init:function(a){a=a||{};this.id=a.id;this.GADGET_ENDPOINT=jive.rest.url("/gadget");this.options=function(e,c,d,b){if(d){c=c+"?"+$j.param(d)}return{type:e,url:this.GADGET_ENDPOINT+c,dataType:"json",contentType:"application/json; charset=utf-8",success:b}}},getGadgets:function(a){$j.ajax(this.options("GET","/",null,function(b){a(b.category)}))},setPref:function(a,b,d){var c={n:a,v:b};$j.ajax(this.options("PUT","/setpref/"+this.id,c,function(e){if(d&&e.gadget){d(e.gadget)}}))},getPreferences:function(a){$j.ajax(this.options("GET","/prefs/"+this.id,null,function(b){a(b.pref)}))},setPreferences:function(a,b){a.ajaxSubmit({url:this.GADGET_ENDPOINT+"/setprefs/",type:"POST",dataType:"json",success:function(c){b(c.gadget)}})},cancelEdit:function(a){$j.ajax(this.options("GET","/"+this.id,null,function(b){a(b.gadget)}))}});
;
(function(){var c="mceJiveGadget";var e;var b=e="jiveGadget";var f=new jive.Gadgets.GadgetSource();var a;var d=function(l,m){if(!a){m.add({title:"Loading gadgets..."});f.getGadgets(function(g){a=g;m.removeAll();d(l,m);m.hideMenu();l.showMenu()})}else{for(var n=0;n<a.length;n++){var j=a[n];if(a.length==1){h=m}else{var h=m.addMenu({title:j.name,"class":"mceDropDown defaultSkin mceMacroMenu mceListBoxMenu"})}for(var i=0;i<j.gadgets.length;i++){var k=j.gadgets[i];h.add({title:k.name,cmd:"openASubMenuCommand"})}}}};tinymce.create("tinymce.plugins.JiveGadgetPlugin",{init:function(h,g){},createControl:function(i,g){if(b!=i){return null}var h=g.createSplitButton(b,{title:"jiveGadget.desc",cmd:c});h.onRenderMenu.add(d);return h},execCommand:function(i){if(i!=c){return false}var g=tinyMCE.activeEditor.controlManager;var h=g.get(b);h.showMenu();return true},getInfo:function(){return{longname:"Jive OpenSocial Gadgets",author:"Jive Software",authorurl:"http://jivesoftware.com",infourl:"http://jivesoftware.com",version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}});tinymce.PluginManager.add(e,tinymce.plugins.JiveGadgetPlugin)})();
;
tinyMCE.addI18n('en.jiveGadget',{
    title : 'Gadgets',
    desc : 'Add an OpenSocial Gadget'
});
;
function addEvent(c,a,b){if(c.attachEvent){c.attachEvent("on"+a,b)}else{c.addEventListener(a,b,true)}}function setCookie(c,e,a,g,d,f){var b=c+"="+encodeURIComponent(e)+((a)?"; expires="+a.toGMTString():"")+((g)?"; path="+encodeURIComponent(g):"")+((d)?"; domain="+d:"")+((f)?"; secure":"");document.cookie=b}function getCookie(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!==0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return decodeURIComponent(b.substring(d+e.length,a))}function addImageElement(a,c,b){if($j("#"+c).length>0){return}createImageElement(a,c,b);if(typeof(autoSave)!="undefined"){autoSave.addImage(c)}}function createImageElement(a,d,c){var b=document.createElement("INPUT");b.setAttribute("type","hidden");b.setAttribute("name",a);b.setAttribute("id",d);b.setAttribute("value",c);$j("#postform").append(b)}function removeImageElement(a){$j("#"+a).remove();if(autoSave){autoSave.deleteImage(a)}};
;
JiveAutoSave=$Class.extend({init:function(h,c,g,a,b,f,j,k,i,l,d,e){this.enabled=h;this.interval=c;this.needSave=false;this.continuing=false;this.draftType=g;this.objectType=a;this.objectID=b;this.subject=j;this.body=f;this.images=k;this.properties=i;this.confirmation=false;this.confirmationMessage=l;this.saveMessage=d;this.savedMessage=e;this.spellcheck=false;if(h){this.autoSaveInit(c)}window.onbeforeunload=this.navigateAway.bind(this);$j(window).unload(this.doDiscard.bind(this));this.listeners=[]},addListener:function(a){this.listeners.push(a)},autoSaveInit:function(a){setInterval(this.saveDraft.bind(this),a*1000)},saveDraft:function(b){this.spellcheck=window.editor.get(this.body).isSpellChecking();if(this.spellcheck){return}if(this.needSave){var a={};a.ID=$j("#draftid").val();a.draftObjectType=this.draftType;a.draftContainerObjectType=this.objectType;a.draftContainerObjectID=this.objectID;a.subject=$j("#"+this.subject).val();if(this.draftType!=18){a.body=window.editor.get(this.body).getHTML()}else{a.body=$j("#"+this.body).val()}a.properties={};this.properties.map(function(c){var d=$j("#"+c);if(d.length>0){if(d.is(":checkbox, :radio")&&d.is(":checked")){a.properties[c]="checked"}else{if(d.is("select")){a.properties[c]=d.val()}else{if(d.is(":text")||d.is("input[type=hidden]")){if(d.val().length>0){a.properties[c]=d.val()}}}}}else{var e=window["get"+c];if(typeof e=="function"){a.properties[c]=e()}}});a.imageIDs=[];if(this.images){this.images.map(function(c){var d=$j("#"+c);if(d.attr("type")=="text"||d.attr("type")=="hidden"){if(d.val().length>0){a.imageIDs.push(d.val())}}})}Draft.saveDraft(a,this.postSave.bind(this))}else{Draft.keepAlive()}},postSave:function(a){this.needSave=false;$j("#draftid").val(a.ID);if(this.spellcheck){window.editor.get(this.body).toggleSpellChecker()}},messageChangeHandler:function(){this.needSave=true;this.confirmation=true},useDraft:function(b){this.enabled=true;this.autoSaveInit(this.interval);var a=this;if(typeof b=="string"){b=window[b]}if(typeof b!="function"){Draft.getDraft(this.draftType,this.objectType,this.objectID,{errorHandler:function(c){},callback:this.displayDraft.bind(this)})}else{Draft.getDraft(this.draftType,this.objectType,this.objectID,{errorHandler:function(c){},callback:function(c){a.displayDraft(c);b(c)}})}},displayDraft:function(b){if(!b){$j("#autosave-prompt").fadeOut();return}var a=b.properties;if(b.draftObjectType==18){for(var d in a){if(d.indexOf("jive-option-table-option-")>-1&&d!="jive-option-table-option-1"&&d!="jive-option-table-option-2"){addOption("jive-option-table","jive-option-table-row")}}}if(b.draftObjectType==18){$j("#"+this.body).val(b.body)}else{window.editor.get(this.body).setHTML(b.body)}$j("#"+this.subject).val(b.subject);this.properties.map(function(e){var f=$j("#"+e);if(f.length>0){if(f.is(":checkbox, :radio")){if(a[e]=="checked"){f.attr("checked",true)}}else{if(f.is("select")){if(a[e]!==undefined&&a[e]!==""){f.find("option").map(function(h,g){if($j(g).val()==a[e]){$j(g).attr("selected",true)}})}}else{if(f.is(":text")){if(a[e]!==undefined&&a[e]!==""){f.val(a[e])}else{f.val("")}}}}}else{f=window["set"+e];if(typeof f=="function"){f(a[e])}}});var c=b.imageIDs;if(c!=undefined&&c!=""&&c.length>0){if(!$j.isArray(c)){c=[c]}$j.each(c,function(f,e){var h="imageFile"+e,i=e,g=$j("#"+h);if(!this.images){this.images=[]}if($j.inArray(this.images,""+h)<0){this.images.push(h)}if(g.length<1){createImageElement("imageFile",h,i)}else{if(g.is(":text, input[type=hidden]")){if(c.indexOf(g.val())>-1){g.val(i)}else{g.val("")}}}})}$j("#autosave-prompt").fadeOut()},deleteDraft:function(){Draft.deleteDraft(this.draftType,this.objectType,this.objectID,false);this.enabled=true;this.autoSaveInit(this.interval);$j("#autosave-prompt").fadeOut()},navigateAway:function(a){if(this.confirmation){return this.confirmationMessage+"\n"}this.listeners.map(function(b){b.navigateAway(a)})},confirmDiscard:function(a){if(confirm(a)){cancelPost=true;window.onbeforeunload=null;return true}else{return false}},doDiscard:function(){cancelPost=true;Draft.deleteDraft(this.draftType,this.objectType,this.objectID,!this.continuing);this.continuing=false;window.onbeforeunload=null;$j(window).unbind("unload");return true},getProperties:function(){return this.properties},addProperty:function(a){this.properties.push(a);this.messageChangeHandler()},deleteProperty:function(a){this.properties=this.properties.filter(function(b){return b!=a});this.messageChangeHandler()},getImages:function(){return this.images},addImage:function(a){this.images.push(a);this.messageChangeHandler()},deleteImage:function(a){this.images=this.images.filter(function(b){return b!=a});this.messageChangeHandler()}});DummyAutoSave=$Class.extend({init:function(){},autoSaveInit:function(a){},addListener:function(){},saveDraft:function(a){},postSave:function(a){},messageChangeHandler:function(){},useDraft:function(a){},displayDraft:function(a){},deleteDraft:function(){},navigateAway:function(){},confirmDiscard:function(a){return false},getProperties:function(){},addProperty:function(a){},deleteProperty:function(a){},doDiscard:function(){},getImages:function(){},addImage:function(a){},deleteImage:function(a){}});
;
var preferredMode="";var currentMode="";var DWRTimeout=20000;var objectLookupSessionKey;var errorHandlerMessage="An error occurred:";var __postSubmitted=false;var cancelPost=false;function pause(d){if(window.showModalDialog){var c="window.setTimeout( function () { window.close(); }, "+d+");";var a=window.showModalDialog('javascript:document.writeln("<script>'+c+'<\/script>")')}else{var b=new Date();var e=b.getTime()+d;while(true){b=new Date();if(b.getTime()>e){return}}}}function setPreferredEditorMode(c){var a=window.autoSave||{};var b=a.confirmation;a.confirmation=false;WikiTextConverter.setPreferredEditorMode(c,{callback:function(){preferredMode=c;refreshLinks();a.confirmation=b},timeout:DWRTimeout,errorHandler:editorErrorHandler})}function getEditorMode(){return currentMode}function editorErrorHandler(b,a){if(b.indexOf("Timeout")==-1){$j("#dwr-error-text").text(errorHandlerMessage+" Error Code: "+b);$j("#dwr-error-table").fadeIn();setTimeout(function(){$j("#dwr-error-table").fadeOut()},10000)}}function trimString(a){a.replace(/^\s*|\s*$/g,"");return a}function validatePost(d,h,f){if(cancelPost){return true}if(typeof(f)=="undefined"){f="wysiwygtext"}var b=false;var e=document.getElementById("subject01");if(typeof(e)!="undefined"&&trimString(e.value)==""){var c=document.getElementById("post-error-table");if(c){c.style.display="block";scroll(0,0);c=document.getElementById("post-error-subject");if(c){c.style.display="block";scroll(0,0)}}b=true}else{var c=document.getElementById("post-error-subject");if(c){c.style.display="none"}}if(getEditorMode()=="text"||getEditorMode()=="preview"){var g=$j('[id="'+f+'"]');if(g.is(":visible")){window.editor.get(f).setHTML(g.val())}a=window.editor.get(f).getHTML();if(!h&&typeof(a)!="undefined"&&trimString(a.value)==""){var c=document.getElementById("post-error-table");scroll(0,0);if(c){c.style.display="block";c=document.getElementById("post-error-body");if(c){c.style.display="block";scroll(0,0)}}b=true}else{var c=document.getElementById("post-error-body");if(c){c.style.display="none"}}}else{var a;var g=$j('[id="'+f+'"]');a=window.editor.get(f).getHTML();a=jiveCustomCleanup("submit_content",a);if(window.editor.get(f).isTextOnly()){document.getElementById("textEditor").style.display="inline";document.getElementById("textEditor").innerHTML="";document.getElementById("textEditor").appendChild(document.createTextNode(a));document.getElementById("textEditor").style.display="none"}if(!h&&(a==null||trimString(a)=="")){var c=document.getElementById("post-error-table");if(c){c.style.display="block";scroll(0,0);c=document.getElementById("post-error-body");if(c){c.style.display="block";scroll(0,0)}}b=true}else{document.getElementById("textEditor").value=a;document.getElementById("postTypeFlag").value="true";var c=document.getElementById("post-error-body");if(c){c.style.display="none"}}}if(b){return false}var c=document.getElementById("post-error-table");if(c){c.style.display="none"}if(arguments.length>0){window.onbeforeunload=null}if(autoSave&&d){$j(window).unbind("unload",window.autoSave.doDiscard)}if(!__postSubmitted&&d){__postSubmitted=true;return true}else{if(!d){return true}}return false};
;
function jiveCustomCleanup(b,d){switch(b){case"submit_content":var f=d.indexOf("[code]");var a=d.indexOf("[/code]",f+6);var e="";if(f!=-1&&a!=-1){if(f>0){e+=d.substring(0,f)}while(f>-1&&a>-1){e+="[code]";var c=d.substring(f+6,a);c=tinyMCE.regexpReplace(c,"<br />","\n","gi");c=tinyMCE.regexpReplace(c,"<br/>","\n","gi");e+=c;e+="[/code]";f=d.indexOf("[code]",a+7);a=d.indexOf("[/code]",f+6)}if(a+7<d.length-1){e+=d.substring(a+7)}}else{e=d}e=e.replace(/\&\#39;/g,"'");e=e.replace(/\<td\>\n[\t ]*/g,"<td>");e=e.replace(/\<th\>\n[\t ]*/g,"<th>");return e;break;case"get_from_editor":var e=d.replace(/\&amp;/g,"&");e=e.replace(/\&quot;/g,'"');e=e.replace(/\&\#39;/g,"'");e=e.replace(/\<td\>\n[\t ]*/g,"<td>");e=e.replace(/\<th\>\n[\t ]*/g,"<th>");return e;break;case"insert_to_editor":d=TinyMCE_PastePlugin._cleanupWord(d);var f=d.indexOf("[code]");var a=d.indexOf("[/code]",f+6);if(f!=-1&&a!=-1){var e="";if(f>0){e+=d.substring(0,f)}while(f>-1&&a>-1){e+="[code]";var c=d.substring(f+6,a);c=tinyMCE.regexpReplace(c,"\n","<br />","gi");c=tinyMCE.regexpReplace(c,"\r\n","<br />","gi");e+=c;e+="[/code]";f=d.indexOf("[code]",a+7);a=d.indexOf("[/code]",f+6)}if(a+7<d.length-1){e+=d.substring(a+7)}return e}else{return d}break}return d}function jiveConvertWord(a,b){switch(a){case"before":if(tinyMCE.isGecko){b=b.replace(new RegExp("\n\t+","gi")," ")}break;case"after":break}return b}var guieditorplugins="";var guieditorvalidelements="";var guieditorbuttons="";if(typeof(_jive_plain_quote_text)!="undefined"&&_jive_tables_enabled){guieditorplugins="jivequote,jiveemoticons,jivespell,paste,table,jivelink,jiveimage";guieditorvalidelements="+code[class],+a[style|name|href|target|title|class],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],+p[style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br[clear],img[style|class|src|border|alt=|title|hspace|vspace|width|height|align|id],-sub[style|class],-sup[style|class],-blockquote[style],-div[class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[style|class|align],-h2[style|class|align],-h3[style|class|align],-h4[style|class|align],-h5[style|class|align],-h6[style|class|align],hr[class|style],-font[face|size|style|class|color],dd[class|title|style|lang],dl[class|title|style|lang],dt[class|title|style|lang],-table[border:1|class:jive-wiki-table],-tr,tbody,thead,tfoot,#td,#th";guieditorbuttons="tablecontrols,separator"}else{if(typeof(_jive_tables_enabled)!="undefined"){guieditorplugins="jiveemoticons,jivespell,paste,table,jivelink,jiveimage";guieditorvalidelements="+code[class],+a[style|name|href|target|title|class],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],+p[style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br[clear],img[style|class|src|border|alt=|title|hspace|vspace|width|height|align|id],-sub[style|class],-sup[style|class],-blockquote[style],-div[class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[style|class|align],-h2[style|class|align],-h3[style|class|align],-h4[style|class|align],-h5[style|class|align],-h6[style|class|align],hr[class|style],-font[face|size|style|class|color],dd[class|title|style|lang],dl[class|title|style|lang],dt[class|title|style|lang],-table[border:1|class:jive-wiki-table],-tr,tbody,thead,tfoot,#td,#th";guieditorbuttons="tablecontrols,separator"}else{if(typeof(_jive_plain_quote_text)!="undefined"){guieditorplugins="jivequote,jiveemoticons,jivespell,paste,jivelink,jiveimage";guieditorvalid_elements:"+code[class],+a[style|name|href|target|title|class],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],+p[style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br[clear],img[style|class|src|border|alt=|title|hspace|vspace|width|height|align|id],-sub[style|class],-sup[style|class],-blockquote[style],-div[class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[style|class|align],-h2[style|class|align],-h3[style|class|align],-h4[style|class|align],-h5[style|class|align],-h6[style|class|align],hr[class|style],-font[face|size|style|class|color],dd[class|title|style|lang],dl[class|title|style|lang],dt[class|title|style|lang]"}}};
;

