]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15688: Modified version of TinyMCE that uses Moodle translation system. Includes...
authorscyrma <scyrma>
Fri, 1 Aug 2008 09:08:48 +0000 (09:08 +0000)
committerscyrma <scyrma>
Fri, 1 Aug 2008 09:08:48 +0000 (09:08 +0000)
compressor)

lib/editor/htmlEditor.class.php
lib/editor/tinymce.js.php
lib/editor/tinymce/jscripts/tiny_mce/tiny_mce.js
lib/editor/tinymce/jscripts/tiny_mce/tiny_mce_popup.js
lib/editor/tinymce/jscripts/tiny_mce/tiny_mce_src.js
lib/editor/tinymce/strings.php

index e405f426e219548563b642559fceaad4c70e69b0..4afdc97bef65b91db5af9f337e74fd9123c046e7 100644 (file)
@@ -42,10 +42,10 @@ class htmlEditor {
         switch ($editor) {
 
             case 'tinymce':
-                $editorlanguage = substr(current_language(), 0, 2);
-                $direction = get_string('thisdirection');
+                $editorlanguage = current_language();
                 $configuration[] = $CFG->httpswwwroot ."/lib/editor/tinymce/jscripts/tiny_mce/tiny_mce.js";
-                $configuration[] = $CFG->httpswwwroot ."/lib/editor/tinymce.js.php?course=$courseid&amp;editorlanguage=$editorlanguage&amp;direction=$direction";
+                //$configuration[] = $CFG->httpswwwroot ."/lib/editor/tinymce/jscripts/tiny_mce/tiny_mce_src.js";
+                $configuration[] = $CFG->httpswwwroot ."/lib/editor/tinymce.js.php?course=$courseid&amp;editorlanguage=$editorlanguage";
                 $configured['tinymce'] = true;
                 break;
 
index 4e17b7ef2a997122b5dec418023bf7bf2cabdba7..c985b401acb29b9cc6b9dab8d0925fd5ec069fbb 100644 (file)
@@ -5,8 +5,11 @@ define('NO_MOODLE_COOKIES', true);
 require_once('../../config.php');
 
 $courseid = optional_param('course', 0, PARAM_INT);
-$editorlanguage = optional_param('editorlanguage', 'en', PARAM_ALPHA);
-$directionality = optional_param('direction', get_string('thisdirection'), PARAM_ALPHA);
+$editorlanguage = optional_param('editorlanguage', 'en_utf8', PARAM_ALPHANUMEXT);
+
+$SESSION->lang = $editorlanguage;
+//$editorlanguage = substr($editorlanguage, 0, strrpos($editorlanguage, '_'));;
+$directionality = get_string('thisdirection');
 
 /*
  * This section configures the TinyMCE toolbar buttons on and off
@@ -105,51 +108,36 @@ $temp = explode('/', $temp);
 $root = $temp[1];
 
 $configuration = <<<EOF
+tinyMCE.init({
+    mode     : "exact",
+    elements : id,
+    theme    : "advanced",
 
-function createHTMLArea(id) {
-
-    random       = Math.ceil(1000*Math.random());
-    editor       = 'editor'+random;
-    editorsubmit = 'editorsubmit'+random;
-
-    tinyMCE.init({
-        mode     : "exact",
-        elements : id,
-        theme    : "advanced",
+    plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak,",
+    spellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
 
-        plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak,",
-        spellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
+    plugin_insertdate_dateFormat : "%Y-%m-%d",
+    plugin_insertdate_timeFormat : "%H:%M:%S",
 
-        plugin_insertdate_dateFormat : "%Y-%m-%d",
-        plugin_insertdate_timeFormat : "%H:%M:%S",
+    content_css : "/$root/lib/editor/tinymce/examples/css/content.css",
 
-        content_css : "/$root/lib/editor/tinymce/examples/css/content.css",
-
-        theme_advanced_toolbar_location : "top",
-        theme_advanced_toolbar_align : "top",
-        theme_advanced_statusbar_location : "bottom",
+    theme_advanced_toolbar_location : "top",
+    theme_advanced_toolbar_align : "top",
+    theme_advanced_statusbar_location : "bottom",
 
-        theme_advanced_resize_horizontal : true,
-        theme_advanced_resizing : true,
-        apply_source_formatting : true,
+    theme_advanced_resize_horizontal : true,
+    theme_advanced_resizing : true,
+    apply_source_formatting : true,
 
-        $editorhidebuttons
-        $editoraddbuttons3
-        $editoraddbuttons4
-
-    });
-
-document.getElementById('ed').form.editorsubmit_43 = document.getElementById('ed').form.onsubmit;
-document.getElementById('ed').form.onsubmit = function() { 
-    tinyMCE.triggerSave(); 
-    document.getElementById('ed').form.editorsubmit_43(); 
-    document.getElementById('ed').form.editorsubmit_43 = null;
-}
-
-}
+    $editorhidebuttons
+    $editoraddbuttons3
+    $editoraddbuttons4
 
+});
 EOF;
 
+$strtime = get_string('strftimetime');
+$strdate = get_string('strftimedaydate');
 
 echo <<<EOF
     tinyMCE.init({
@@ -157,6 +145,7 @@ echo <<<EOF
         relative_urls: false,
         editor_selector: "form-textarea-simple",
         document_base_url: "$CFG->httpswwwroot",
+        content_css: "$CFG->httpswwwroot/lib/editor/tinymce/examples/css/content.css",
         theme: "simple",
         skin: "o2k7",
         skin_variant: "silver",
@@ -180,15 +169,17 @@ echo <<<EOF
         entity_encoding: "raw",
         language: "$editorlanguage",
         directionality: "$directionality",
-        plugins: "safari,spellchecker,table,style,layer,advhr,advimage,advlink,emoticons,inlinepopups,media,searchreplace,paste,standardmenu,directionality,fullscreen,moodlelink,moodlenolink,dragmath,nonbreaking,contextmenu",
+        plugins: "safari,spellchecker,table,style,layer,advhr,advimage,advlink,emoticons,inlinepopups,media,searchreplace,paste,standardmenu,directionality,fullscreen,moodlenolink,dragmath,nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak",
+        plugin_insertdate_dateFormat : "$strdate",
+        plugin_insertdate_timeFormat : "$strtime",
         theme_advanced_layout_manager: "SimpleLayout",
         theme_advanced_toolbar_align : "left",
         theme_advanced_buttons1: "fontselect,fontsizeselect,formatselect,styleselect",
-        theme_advanced_buttons1_add: "|,undo,redo,|,search,spellchecker",
-        theme_advanced_buttons2: "bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull",
+        theme_advanced_buttons1_add: "|,undo,redo,|,search,replace,spellchecker,|,fullscreen",
+        theme_advanced_buttons2: "bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,|,cite,abbr,acronym",
         theme_advanced_buttons2_add: "|,selectall,cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl",
-        theme_advanced_buttons3: "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,anchor,|,emoticons,image,media,dragmath,advhr,nonbreaking,charmap",
-        theme_advanced_buttons3_add: "|,table,insertlayer,styleprops,|,code,fullscreen",
+        theme_advanced_buttons3: "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,anchor,|,insertdate,inserttime,|,emoticons,image,media,dragmath,advhr,nonbreaking,charmap",
+        theme_advanced_buttons3_add: "|,table,insertlayer,styleprops,visualchars,|,code,preview",
         theme_advanced_fonts: "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings", 
         moodleimage_course_id: $courseid,
         theme_advanced_resize_horizontal: true,
index 33d1c6dc351171c9ee82fc34db579d27c5802314..c473e19a47ec68f3336b5121724bf64f1192080e 100644 (file)
@@ -1 +1 @@
-var tinymce={majorVersion:'3',minorVersion:'0.9',releaseDate:'2008-06-02',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base,p,v;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;t.query=tinyMCEPreInit.query;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(v=nl[i].href){if(/^https?:\/\/[^\/]+$/.test(v))v+='/';base=v?v.match(/.*\//)[0]:'';}}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';if((p=n.src.indexOf('?'))!=-1)t.query=n.src.substring(p+1);t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=d.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=d.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1);}if(w.detachEvent){w.detachEvent('onbeforeunload',fakeUnload);w.detachEvent('onunload',unload);}else if(w.removeEventListener)w.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);unload();d=null;};d.attachEvent('onstop',stop);window.setTimeout(function(){d.detachEvent('onstop',stop);},0);}};if(w.attachEvent){w.attachEvent('onunload',unload);w.attachEvent('onbeforeunload',fakeUnload);}else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;},explode:function(s,d){return s?tinymce.map(s.split(d||','),tinymce.trim):s;},_addVer:function(u){var v;if(!this.query)return u;v=(u.indexOf('?')==-1?'?':'&')+this.query;if(u.indexOf('#')==-1)return u+v;return u.replace('#',v+'#');}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments,i,li=this.listeners,c;for(i=0;i<li.length;i++){c=li[i];s=c.cb.apply(c.scope,a);if(s===false)break;}return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf('://')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0;i<base.length;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0;i<items.length;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;i<base.length-(bp-1);i++)out+="../";for(i=bp-1;i<items.length;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);function ready(){if(!o.async||x.readyState==4||c++>10000){if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}else w.setTimeout(ready,10);};if(!o.async)return ready();t=w.setTimeout(ready,10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],'object'))t.setAttrib(e,k,''+a[k]);}if(a.style&&!is(a.style,'string')){each(a.style,function(v,n){t.setStyle(e,n,v);});}}if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v&&!t._isRes(v))e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv="";if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}v=e.getAttribute(n,2);if(!v){switch(n){case'class':v=e.className;break;default:if(isIE&&n==='name'&&e.nodeName==='A'){v=e.name;break;}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v;}}switch(n){case'style':v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v))e.setAttribute('mce_style',v);}break;}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0')v='';break;case'hspace':if(v===-1)v='';break;case'tabindex':if(v===32768)v='';break;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v&&v!='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null))+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,'</div>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x<n.childNodes.length;x++)p.appendChild(n.childNodes[x].cloneNode(true));n.swapNode(p);}}}}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/&apos;/g,'&#39;');h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(h.indexOf('<script')!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,'<mce:script$1><!--\n');h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,'\n// --></mce:script>');h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,'<mce:script$1></mce:script>');}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(t._isRes(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&amp;';case'"':return'&quot;';case'<':return'&lt;';case'>':return'&gt;';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.doc.getElementById(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){Event.domLoaded=1;return;}if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){function trimNl(s){return s.replace(/[\n\r]+/g,'');};var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;tinymce.addUnload(t.destroy,t);},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;return t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;},setContent:function(h,s){var t=this,r=t.getRng(),d=t.win.document;s=s||{format:'html'};s.set=true;h=t.dom.processHTML(h);if(r.insertNode){if(tinymce.isGecko&&h.indexOf('<')==-1){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h+'<span id="__caret">_</span>'));t.select(t.dom.get('__caret'));t.getRng().deleteContents();return;}try{if(d.queryCommandEnabled('InsertHTML'))return d.execCommand('InsertHTML',false,h);}catch(ex){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));}}else{if(r.item){d.execCommand('Delete',false,null);r=t.getRng();}r.pasteHTML(h);}},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot(),wb=0,wa=0,nv;sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=trimNl(n.nodeValue||'').length;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};trimNl(s.anchorNode.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});return{start:Math.max(e.start+s.anchorOffset-wb,0),end:Math.max(e.end+s.focusOffset-wb,0),scrollX:sx,scrollY:sy,beg:s.anchorOffset-wb==0};}else{e=getPos(ro,r.startContainer,r.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:Math.max(e.start+r.startOffset-wb,0),end:Math.max(e.end+r.endOffset-wa,0),scrollX:sx,scrollY:sy,beg:r.startOffset-wb==0};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd,nvl,nv;function getPos(r,sp,ep){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={},o,v,wa,wb;while((n=w.nextNode())!=null){wa=wb=0;nv=n.nodeValue||'';nvl=trimNl(nv).length;p+=nvl;if(p>=sp&&!d.startNode){o=sp-(p-nvl);if(b.beg&&o>=nvl)continue;d.startNode=n;d.startOffset=o+wb;}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-nvl)+wb;return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||s.isCollapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(r.startContainer==r.endContainer||(tinymce.isWebKit&&r.startContainer==r.endContainer.parentNode)){if(r.startOffset-r.endOffset<2||tinymce.isWebKit){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();},destroy:function(s){var t=this;t.win=null;if(!s)tinymce.removeUnload(t.destroy);}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g,' ')));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(this.valid)h=h.replace(/\%MCGT%/g,'&gt;');return h;}});})();(function(){tinymce.create('tinymce.dom.StringWriter',{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(s){this.settings=tinymce.extend({indent_char:' ',indentation:1},s);this.reset();},reset:function(){this.indent='';this.str="";this.tags=[];this.count=0;},writeStartElement:function(n){this._writeAttributesEnd();this.writeRaw('<'+n);this.tags.push(n);this.inAttr=true;this.count++;this.elementCount=this.count;},writeAttribute:function(n,v){var t=this;t.writeRaw(" "+t.encode(n)+'="'+t.encode(v)+'"');},writeEndElement:function(){var n;if(this.tags.length>0){n=this.tags.pop();if(this._writeAttributesEnd(1))this.writeRaw('</'+n+'>');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(v){this._writeAttributesEnd();this.writeRaw(this.encode(v));this.count++;},writeCDATA:function(v){this._writeAttributesEnd();this.writeRaw('<![CDATA['+v+']]>');this.count++;},writeComment:function(v){this._writeAttributesEnd();this.writeRaw('<!-- '+v+'-->');this.count++;},writeRaw:function(v){this.str+=v;},encode:function(s){return s.replace(/[<>&"]/g,function(v){switch(v){case'<':return'&lt;';case'>':return'&gt;';case'&':return'&amp;';case'"':return'&quot;';}return v;});},getContent:function(){return this.str;},_writeAttributesEnd:function(s){if(!this.inAttr)return;this.inAttr=false;if(s&&this.elementCount==this.count){this.writeRaw(' />');return false;}this.writeRaw('>');return true;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE,isGecko=tinymce.isGecko;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);if(tinymce.relaxedDomain&&tinymce.isGecko){t.writer=new tinymce.dom.StringWriter();}else{try{t.writer=new tinymce.dom.XMLWriter();}catch(ex){t.writer=new tinymce.dom.StringWriter();}}t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,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',valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,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},s);t.dom=s.dom;if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),pa2,n,tm,pl=[],i,ns;if(pa){pa2=pa.cloneNode(false);pl.push(e);for(n=e;n=n.parentNode;){pl.push(n);if(n==pa)break;}tm=pa2;for(i=pl.length-1;i>=0;i--){if(i==pl.length-1){while(ns=pl[i-1].nextSibling)tm.appendChild(ns.parentNode.removeChild(ns));}else{n=pl[i].cloneNode(false);if(i!=0){while(ns=pl[i-1].nextSibling)n.appendChild(ns.parentNode.removeChild(ns));}tm=tm.appendChild(n);}}e=t.dom.insertAfter(e.parentNode.removeChild(e),pa);t.dom.insertAfter(e,pa);t.dom.insertAfter(pa2,e);}});});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='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';intr='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';bloc='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';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p;if(o.format=='html'){p=t._protect({content:h,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});h=p.content;if(s.entity_encoding!=='raw')h=t._encode(h);if(!o.set){h=h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,s.entity_encoding=='numeric'?'<p$1>&#160;</p>':'<p$1>&nbsp;</p>');if(s.remove_linebreaks){h=h.replace(/\r?\n|\r/g,' ');h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.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>');h=h.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>');h=h.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(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);if(s.entity_encoding=='raw')h=h.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,'<p$1>\u00a0</p>');}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}else if(isGecko){if(n.nodeName==='BR'&&n.getAttribute('type')=='_moz')return;}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(!hc&&ru.padd)w.writeText('\u00a0');break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){var t=this;o.items=o.items||[];function enc(s){return s.replace(/[\r\n\\]/g,function(c){if(c==='\n')return'\\n';else if(c==='\\')return'\\\\';return'\\r';});};function dec(s){return s.replace(/\\[\\rn]/g,function(c){if(c==='\\n')return'\n';else if(c==='\\\\')return'\\';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p.pattern,function(x,a,b,c){b=dec(b);if(p.encode)b=t._encode(b);o.items.push(b);return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_encode:function(h){var t=this,s=t.settings,l;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(/,/g,'|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\s?mceItem\w+\s?/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each;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(tinymce.dom.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.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);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(!tinymce.dom.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);}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},remove:function(){DOM.remove(this.id);this.destroy();},destroy:function(){tinymce.dom.Event.clear(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{Separator:function(id,s){this.parent(id,s);this.classPrefix='mceSeparator';},renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':this.classPrefix});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();else o.remove();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||DOM.doc.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' mceNoIcons';this.parent(id,s);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb,cp=t.classPrefix;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);if(!tinymce.isOpera)DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,cp+'ItemSub')){m=t.items[e.id];if(m.isDisabled())return;dm=t;while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}if(m.settings.onclick)m.settings.onclick(e);return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,cp+'ItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,cp+'ItemActive');}}});}t.onShowMenu.dispatch(t);if(s.keyboard_focus){Event.add(co,'keydown',t._keyHandler,t);DOM.select('a','menu_'+t.id)[0].focus();t._focusIdx=0;}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);Event.remove(co,'keydown',t._keyHandler);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,t.classPrefix+'ItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);this.destroy();return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:200000'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':t.classPrefix+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':t.classPrefix+'Line'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_keyHandler:function(e){var t=this,kc=e.keyCode;function focus(d){var i=t._focusIdx+d,e=DOM.select('a','menu_'+t.id)[i];if(e){t._focusIdx=i;e.focus();}};switch(kc){case 38:focus(-1);return;case 40:focus(1);return;case 13:return;case 27:return this.hideMenu();}},_add:function(tb,o){var n,s=o.settings,a,ro,it,cp=this.classPrefix;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'ItemSeparator'});DOM.add(ro,'td',{'class':cp+'ItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'mceLast');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'Item '+cp+'ItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);DOM.add(n,'span',{'class':'mceIcon'+(s.icon?' mce_'+s.icon:'')});n=DOM.add(n,s.element||'span',{'class':'mceText',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'mceFirst');if((n=ro.previousSibling)&&DOM.hasClass(n,cp+'ItemSeparator'))DOM.addClass(ro,'mceFirst');if(o.collapse)DOM.addClass(ro,cp+'ItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'mceLast');DOM.addClass(ro,'mceLast');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var cp=this.classPrefix,s=this.settings,h,l;l=DOM.encode(s.label||'');h='<a id="'+this.id+'" href="javascript:;" class="'+cp+' '+cp+'Enabled '+s['class']+(l?' '+cp+'Labeled':'')+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="mceIcon" src="'+s.image+'" />'+l+'</a>';else h+='<span class="mceIcon '+s['class']+'"></span>'+(l?'<span class="'+cp+'Label">'+l+'</span>':'')+'</a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(v){var t=this,e,fv;if(v!=t.selectedValue){e=DOM.get(t.id+'_text');t.selectedValue=v;each(t.items,function(o){if(o.value==v){DOM.setHTML(e,DOM.encode(o.title));fv=1;return false;}});if(!fv){DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'mceTitle');e=0;return;}else DOM.removeClass(e,'mceTitle');}e=0;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings,cp=t.classPrefix;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="'+cp+' '+cp+'Enabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'mceText',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',tabindex:-1,href:'javascript:;','class':'mceOpen',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(t.menu&&t.menu.isMenuVisible)return t.hideMenu();if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.keyboard_focus=!tinymce.isOpera;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);DOM.addClass(t.id,t.classPrefix+'Selected');},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&(e.target.id==t.id+'_text'||e.target.id==t.id+'_open'))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,t.classPrefix+'Selected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':t.classPrefix+'Menu mceNoIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle'}).setDisabled(1);each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this,cp=t.classPrefix;Event.add(t.id,'click',t.showMenu,t);Event.add(t.id+'_text','focus',function(e){if(!t._focused){t.keyDownHandler=Event.add(t.id+'_text','keydown',function(e){var idx=-1,v,kc=e.keyCode;each(t.items,function(v,i){if(t.selectedValue==v.value)idx=i;});if(kc==38)v=t.items[idx-1];else if(kc==40)v=t.items[idx+1];else if(kc==13){v=t.selectedValue;t.selectedValue=null;t.settings.onselect(v);return Event.cancel(e);}if(v){t.hideMenu();t.select(v.value);}});}t._focused=1;});Event.add(t.id+'_text','blur',function(){Event.remove(t.id+'_text','keydown',t.keyDownHandler);t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.addClass(t.id,cp+'Hover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.removeClass(t.id,cp+'Hover');});}t.onPostRender.dispatch(t,DOM.get(t.id));},destroy:function(){this.parent();Event.clear(this.id+'_text');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(v){var e=DOM.get(this.id),ol=e.options;v=''+(v||'');e.selectedIndex=0;each(ol,function(o,i){if(o.value==v){e.selectedIndex=i;return false;}});},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=e.target.options[e.target.selectedIndex].value;t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||DOM.doc.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.settings.keyboard_focus=t._focused;m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.setState('Selected',1);t.isMenuVisible=1;},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}t.isMenuVisible=0;},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'mceAction '+s['class']});else h1=DOM.createHTML('span',{'class':'mceAction '+s['class']},'');h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'mceAction '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'mceOpen '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'mceOpen '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);Event.add(t.id+'_open','focus',function(){t._focused=1;});Event.add(t.id+'_open','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}},destroy:function(){this.parent();Event.clear(this.id+'_action');Event.clear(this.id+'_open');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.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'},t.settings);t.onShowMenu=new tinymce.util.Dispatcher(t);t.onHideMenu=new tinymce.util.Dispatcher(t);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e,p2;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27)t.hideMenu();});DOM.select('a',t.id+'_menu')[0].focus();}t.onShowMenu.dispatch(t);t.isMenuVisible=1;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');}t.onHideMenu.dispatch(t);t.isMenuVisible=0;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c},mce_color:'#'+c});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'mceMoreColors'});n=DOM.add(n,'a',{id:t.id+'_more',href:'javascript:;',onclick:'return false;','class':'mceMoreColors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');Event.add(t.id+'_menu','click',function(e){var c;e=e.target;if(e.nodeName=='A'&&(c=e.getAttribute('mce_color')))t.setColor(c);return Event.cancel(e);});return w;},setColor:function(c){var t=this;DOM.setStyle(t.id+'_preview','backgroundColor',c);t.value=c;t.hideMenu();t.settings.onselect(c);},postRender:function(){var t=this,id=t.id;t.parent();DOM.add(id+'_action','div',{id:id+'_preview','class':'mceColorPreview'});},destroy:function(){this.parent();Event.clear(this.id+'_menu');Event.clear(this.id+'_more');DOM.remove(this.id+'_menu');}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c,co,dom=tinymce.DOM,s=t.settings,i,pr,nx,cl;cl=t.controls;for(i=0;i<cl.length;i++){co=cl[i];pr=cl[i-1];nx=cl[i+1];if(i===0){c='mceToolbarStart';if(co.Button)c+=' mceToolbarStartButton';else if(co.SplitButton)c+=' mceToolbarStartSplitButton';else if(co.ListBox)c+=' mceToolbarStartListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));}if(pr&&co.ListBox){if(pr.Button||pr.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarEnd'},dom.createHTML('span',null,'<!-- IE -->'));}if(dom.stdMode)h+='<td style="position: relative">'+co.renderHTML()+'</td>';else h+='<td>'+co.renderHTML()+'</td>';if(nx&&co.ListBox){if(nx.Button||nx.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));}}c='mceToolbarEnd';if(co.Button)c+=' mceToolbarEndButton';else if(co.SplitButton)c+=' mceToolbarEndSplitButton';else if(co.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s;if(tinymce.EditorManager.settings){u=this.urls[n]+'/langs/'+tinymce.EditorManager.settings.language+'.js';s=tinymce.EditorManager.settings;if(s){if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){var t=this;if(t.urls[n])return;if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;t.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,explode=tinymce.explode;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,preInit:function(){var t=this,lo=window.location;tinymce.documentBaseURL=lo.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=lo.hostname&&lo.hostname)document.domain=tinymce.relaxedDomain=lo.hostname.replace(/.*\.(.+\..+)$/,'$1');t.onBeforeUnload=new tinymce.util.Dispatcher(t);Event.add(window,'beforeunload',function(e){t.onBeforeUnload.dispatch(t,e);});},init:function(s){var t=this,pl,sl=tinymce.ScriptLoader,c,e;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=explode(s.plugins);if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'&&!PluginManager.urls[v]){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(explode(s.browsers),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';if(l.length>0){each(explode(l),function(v){if(DOM.get(v))new tinymce.Editor(v,s).render(1);else{c=0;each(document.forms,function(f){each(f.elements,function(e){if(e.name===v){v='mce_editor_'+c;DOM.setAttrib(e,'id',v);new tinymce.Editor(v,s).render(1);}});});}});}break;case"textareas":case"specific_textareas":function hasClass(n,c){return c.constructor===RegExp?c.test(n.className):DOM.hasClass(n,c);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector)){e=DOM.get(v.name);if(!v.id&&!e)v.id=v.name;if(!v.id||t.get(v.id))v.id=DOM.uniqueId();new tinymce.Editor(v.id,s).render(1);}});break;}if(s.oninit){l=co=0;each(t.editors,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e.destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v),w;switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":if(!t.get(v))new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":w=v.window;w.tinyMCE=tinyMCE;w.tinymce=tinymce;tinymce.DOM.doc=w.document;tinymce.DOM.win=w;ed=new tinymce.Editor(v.element_id,v);ed.render();if(tinymce.isIE){function clr(){ed.destroy();w.detachEvent('onunload',clr);w=w.tinyMCE=w.tinymce=null;};w.attachEvent('onunload',clr);}v.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.EditorManager.preInit();})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep,explode=tinymce.explode;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['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(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.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|_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],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'},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(nst){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!Event.domLoaded){Event.add(document,'init',function(){t.render();});return;}if(!nst){s.strict_loading_mode=1;tinyMCE.settings=s;}if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.save)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}if(s.add_unload_trigger&&!s.ask){t._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(t.initialized&&!t.destroyed&&!t.isHidden())t.save({format:'raw',no_events:true});});}tinymce.addUnload(t.destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType&&!n.submit.length){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(explode(s.plugins),function(p){if(p&&p.charAt(0)!='-'&&!PluginManager.urls[p]){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){window.setTimeout(function(){Event.remove(t.id,'focus',ask);t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();});},0);};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti,u,bi,bc,re;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(explode(s.plugins.replace(/\-/g,'')),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});if(s.popup_css)s.popup_css=t.documentBaseURI.toAbsolute(s.popup_css);else s.popup_css=t.baseURI.toAbsolute("themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");if(s.popup_css_add)s.popup_css+=','+t.documentBaseURI.toAbsolute(s.popup_css_add);t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){if(!l.initial)return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd,ui,val,a){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint'&&(!a||!a.skip_undo))t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(a,o){if(!o||!o.initial)t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.offsetWidth;h=s.height||e.style.height||e.offsetHeight;t.orgDisplay=e.style.display;re=/^[0-9\.]+(|px)$/i;if(re.test(''+w))w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if(re.test(''+h))h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+((h+'').indexOf('%')==-1?(o.deltaHeight||0):'');if(h<100)h=100;t.iframeHTML=s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'"></base>';t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain)t.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";</script>';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='</head><body id="'+bi+'" class="mceContentBody '+bc+'"></body></html>';if(tinymce.relaxedDomain){if(isIE)u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('</('+v+')>','g'),'</'+n+'>');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(<p>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,'');});}if(isGecko){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this,ce=t.settings.content_editable;if(!sf){if(!ce)t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language,i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[this.settings.language+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;},save:function(o){var t=this,e=t.getElement(),h,f;if(!t.initialized)return;o=o||{};o.save=true;if(!o.no_events){t.undoManager.typing=0;t.undoManager.add();}o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />');o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o.content=h;if(!o.no_events)t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getBody(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getBody(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())try{d.execCommand("useCSS",0,true);}catch(ex){}}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.keyCode==46||e.keyCode==8||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i<el.length;i++){if(el[i].type!='hidden')return el[i];}}else{for(i=x-1;i>=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(o.ctrl!=e.ctrlKey&&(!tinymce.isMac||o.ctrl==e.metaKey))return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function convertToFonts(no){var n,f,nl,x,i,v,st;if(tinymce.isWebKit||!s.inline_styles)return;nl=t.dom.select('span',no);for(x=nl.length-1;x>=0;x--){n=nl[x];f=dom.create('font',{color:dom.toHex(dom.getStyle(n,'color')),face:dom.getStyle(n,'fontFamily'),style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});st=f.style;if(st.color||st.fontFamily){st.color=st.fontFamily='';dom.setAttrib(f,'mce_style','');}if(sl){i=inArray(sl,dom.getStyle(n,'fontSize'));if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));}}else if(cl){i=inArray(cl,dom.getAttrib(n,'class'));v=dom.getStyle(n,'fontSize');if(i==-1&&v.indexOf('pt')>0)i=inArray(fz,parseInt(v));if(i==-1)i=inArray(fzn,v);if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));f.style.fontSize='';}}if(f.color||f.face||f.size){f.style.fontFamily='';dom.setAttrib(f,'mce_style','');dom.replace(f,n,1);}f=n=null;}};t.onSetContent.add(function(ed,o){convertToFonts(ed.getBody());});t.onPreProcess.add(function(ed,o){var n,sp,nl,x;if(!s.inline_styles)return;if(o.get){nl=t.dom.select('font',o.node);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}}});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else ed.getDoc().execCommand('FontName',false,v);},FontSize:function(u,v){var ed=this.editor,s=ed.settings,fz=tinymce.explode(s.font_size_style_values),fzc=tinymce.explode(s.font_size_classes),h,bm;each(ed.dom.select('font'),function(e){e.style.fontSize='';});ed.getDoc().execCommand('FontSize',false,v);if(s.inline_styles){each(ed.dom.select('font'),function(e){if(!e.size||e.parentNode.nodeName=='FONT'&&e.size==e.parentNode.size){if(!bm)bm=ed.selection.getBookmark();ed.dom.remove(e,1);return;}if(v=e.size){if(fzc&&fzc.length>0)ed.dom.setAttrib(e,'class',fzc[parseInt(v)-1]);else ed.dom.setStyle(e,'fontSize',fz[parseInt(v)-1]);}});}ed.selection.moveToBookmark(bm);},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(isOpera||isWebKit){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(e=t.getSelectedElement())set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,bl,nb,b;function isBlock(n){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);};bl=dom.getParent(s.getNode(),function(n){return isBlock(n);});if(bl){if((isIE&&isBlock(bl.parentNode))||bl.nodeName=='DIV'){nb=ed.dom.create(val);each(dom.getAttribs(bl),function(v){dom.setAttrib(nb,v.nodeName,dom.getAttrib(bl,v.nodeName));});b=s.getBookmark();dom.replace(nb,bl,1);s.moveToBookmark(b);ed.nodeChanged();return;}}val=ed.settings.forced_root_block?(val||'<p>'):val;if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}else return!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE');return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList();},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(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),dom.isBlock);eb=dom.getParent(s.getEnd(),dom.isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),dom.isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),dom.isBlock);eb=dom.getParent(en||s.getEnd(),dom.isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(dom.isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0&&(t.index==0||t.index==t.data.length)?t.index-1:t.index];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection&&!l.initial)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length)t.index++;if(t.data.length===0&&!l.initial)return null;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s=ed.settings,elm;t.editor=ed;t.dom=ed.dom;elm=(s.forced_root_block||'p').toLowerCase();s.element=elm.toUpperCase();ed.onPreInit.add(t.setup,t);t.reOpera=new RegExp('(\\u00a0|&#160;|&nbsp;)<\/'+elm+'>','gi');t.rePadd=new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp('<p( )([^>]+)>(&nbsp;|&#160;)<\\\/p>|<p>(&nbsp;|&#160;)<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'</'+elm+'>');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0</'+elm+'>');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2><br /></'+elm+'>');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2><br /></'+elm+'>');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0</'+elm+'>');o.content=o.content.replace(t.reTrailBr,'</'+elm+'>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i;if(e&&e.keyCode==13)return true;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){if(ed.dom.getParent(r.startContainer,function(e){return e===b;})){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=b.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,dom=ed.dom,d=ed.getDoc(),se=ed.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'<br />');aft=ed.dom.add(sn,se.element,null,'<br />');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';if(isEmpty(aft))aft.innerHTML=isOpera?'&nbsp;':'<br />';if(isOpera){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();function first(n){return d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode()||n;};r=d.createRange();r.selectNodeContents(isGecko?first(aft):aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(y<vp.y||y+ch>vp.y+vp.h){ed.getWin().scrollTo(0,y<vp.y?y:y-vp.h+ch);}return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n,w,tn;if(sc&&ed.dom.isBlock(sc)&&!/^(TD|TH)$/.test(sc.nodeName)&&bs){if(sc.childNodes.length==0||(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR')){n=sc;while((n=n.previousSibling)&&!ed.dom.isBlock(n));if(n){if(sc!=b.firstChild){w=ed.dom.doc.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(tn=w.nextNode())n=tn;r=ed.getDoc().createRange();r.setStart(n,n.nodeValue?n.nodeValue.length:0);r.setEnd(n,n.nodeValue?n.nodeValue.length:0);se.setRng(r);ed.dom.remove(sc);}return Event.cancel(e);}}}function handler(e){e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&(n=t.getParentBlock(e))){Event.remove(b,'DOMNodeInserted',handler);if(e.previousSibling||e.nextSibling)ed.dom.remove(e);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t._cls={};t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s,cc){var t=this,ed=t.editor,c,bm,v,cls;s=extend({'class':'mceDropDown',constrain:ed.settings.constrain_menus},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant'))s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);id=t.prefix+id;cls=cc||t._cls.dropmenu||tinymce.ui.DropMenu;c=t.controls[id]=new cls(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,s.value);};}});ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createListBox:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else{cls=cc||t._cls.listbox||tinymce.ui.ListBox;c=new cls(id,s);}t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s,cc){var t=this,ed=t.editor,o,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.label=ed.translate(s.label);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':'mce_'+id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){cls=cc||t._cls.menubutton||tinymce.ui.MenuButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);}else{cls=t._cls.button||tinymce.ui.Button;c=new cls(id,s);}return t.add(c);},createMenuButton:function(id,s){s=s||{};s.menu_button=1;return this.createButton(id,s);},createSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;cls=cc||t._cls.splitbutton||tinymce.ui.SplitButton;c=t.add(new cls(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls,bm;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;cls=cc||t._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createToolbar:function(id,s,cc){var c,t=this,cls;id=t.prefix+id;cls=cc||t._cls.toolbar||tinymce.ui.Toolbar;c=new cls(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(cc){var cls=cc||this._cls.separator||tinymce.ui.Separator;return new cls();},setControlType:function(n,c){return this._cls[n.toLowerCase()]=c;},destroy:function(){each(this.controls,function(c){c.destroy();});this.controls=null;}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort(),u;s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;p.mce_auto_focus=s.auto_focus;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);u=s.url||s.file;if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);try{if(isIE&&mo){w=1;window.showModalDialog(u,window,f);}else w=window.open(u,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl,a,b,c,d,e){var f=tinymce.resolve(cl);return new f(a,b,c,d,e);},confirm:function(t,cb,s){cb.call(s||this,confirm(this._decode(this.editor.getLang(t,t))));},alert:function(tx,cb,s){var t=this;alert(t._decode(t.editor.getLang(tx,tx)));if(cb)cb.call(s||t);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}());
\ No newline at end of file
+var tinymce={majorVersion:"3",minorVersion:"0.9",releaseDate:"2008-06-02",_init:function(){var L=this,I=document,J=window,H=navigator,B=H.userAgent,G,A,F,E,D,K;L.isOpera=J.opera&&opera.buildNumber;L.isWebKit=/WebKit/.test(B);L.isOldWebKit=L.isWebKit&&!J.getSelection().getRangeAt;L.isIE=!L.isWebKit&&!L.isOpera&&(/MSIE/gi).test(B)&&(/Explorer/gi).test(H.appName);L.isIE6=L.isIE&&/MSIE [56]/.test(B);L.isGecko=!L.isWebKit&&/Gecko/.test(B);L.isMac=B.indexOf("Mac")!=-1;if(J.tinyMCEPreInit){L.suffix=tinyMCEPreInit.suffix;L.baseURL=tinyMCEPreInit.base;L.query=tinyMCEPreInit.query;return }L.suffix="";A=I.getElementsByTagName("base");for(G=0;G<A.length;G++){if(K=A[G].href){if(/^https?:\/\/[^\/]+$/.test(K)){K+="/"}E=K?K.match(/.*\//)[0]:""}}function C(M){if(M.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(M.src)){if(/_(src|dev)\.js/g.test(M.src)){L.suffix="_src"}if((D=M.src.indexOf("?"))!=-1){L.query=M.src.substring(D+1)}L.baseURL=M.src.substring(0,M.src.lastIndexOf("/"));if(E&&L.baseURL.indexOf("://")==-1){L.baseURL=E+L.baseURL}return L.baseURL}return null}A=I.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}F=I.getElementsByTagName("head")[0];if(F){A=F.getElementsByTagName("script");for(G=0;G<A.length;G++){if(C(A[G])){return }}}return },is:function(B,A){var C=typeof (B);if(!A){return C!="undefined"}if(A=="array"&&(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(D.hasOwnProperty(E)){if(A.call(C,D[E],E,D)===false){return 0}}}}return 1},map:function(A,B){var C=[];tinymce.each(A,function(D){C.push(B(D))});return C},grep:function(A,B){var C=[];tinymce.each(A,function(D){if(!B||B(D)){C.push(D)}});return C},inArray:function(B,C){var D,A;if(B){for(D=0,A=B.length;D<A;D++){if(B[D]===C){return D}}}return -1},extend:function(D,C){var B,A=arguments;for(B=1;B<A.length;B++){C=A[B];tinymce.each(C,function(E,F){if(typeof (E)!=="undefined"){D[F]=E}})}return D},trim:function(A){return(A?""+A:"").replace(/^\s*|\s*$/g,"")},create:function(I,A){var H=this,B,D,E,F,C,G=0;I=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(I);E=I[3].match(/(^|\.)(\w+)$/i)[2];D=H.createNS(I[3].replace(/\.\w+$/,""));if(D[E]){return }if(I[2]=="static"){D[E]=A;if(this.onCreate){this.onCreate(I[2],I[3],D[E])}return }if(!A[E]){A[E]=function(){};G=1}D[E]=A[E];H.extend(D[E].prototype,A);if(I[5]){B=H.resolve(I[5]).prototype;F=I[5].match(/\.(\w+)$/i)[1];C=D[E];if(G){D[E]=function(){return B[F].apply(this,arguments)}}else{D[E]=function(){this.parent=B[F];return C.apply(this,arguments)}}D[E].prototype[E]=D[E];H.each(B,function(J,K){D[E].prototype[K]=B[K]});H.each(A,function(J,K){if(B[K]){D[E].prototype[K]=function(){this.parent=B[K];return J.apply(this,arguments)}}else{if(K!=E){D[E].prototype[K]=J}}})}H.each(A["static"],function(J,K){D[E][K]=J});if(this.onCreate){this.onCreate(I[2],I[3],D[E].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 G=C.unloads,H,I;if(G){for(I in G){H=G[I];if(H&&H.func){H.func.call(H.scope,1)}}if(A.detachEvent){A.detachEvent("onbeforeunload",F);A.detachEvent("onunload",B)}else{if(A.removeEventListener){A.removeEventListener("unload",B,false)}}C.unloads=H=G=A=B=null;if(window.CollectGarbage){window.CollectGarbage()}}}function F(){var H=document;if(H.readyState=="interactive"){function G(){H.detachEvent("onstop",G);B();H=null}H.attachEvent("onstop",G);window.setTimeout(function(){H.detachEvent("onstop",G)},0)}}if(A.attachEvent){A.attachEvent("onunload",B);A.attachEvent("onbeforeunload",F)}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 D,B=arguments,C,A=this.listeners,E;for(C=0;C<A.length;C++){E=A[C];D=E.cb.apply(E.scope,B);if(D===false){break}}return D}});(function(){var A=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(D,F){var E=this,G,C,B;F=E.settings=F||{};if(/^(mailto|news|javascript|about):/i.test(D)||/^\s*#/.test(D)){E.source=D;return }if(D.indexOf("/")===0&&D.indexOf("//")!==0){D=(F.base_uri?F.base_uri.protocol||"http":"http")+"://mce_host"+D}if(D.indexOf("://")===-1&&D.indexOf("//")!==0){D=(F.base_uri.protocol||"http")+"://mce_host"+E.toAbsPath(F.base_uri.path,D)}D=D.replace(/@@/g,"(mce_at)");D=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(D);A(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(H,I){var J=D[I];if(J){J=J.replace(/\(mce_at\)/g,"@@")}E[H]=J});if(B=F.base_uri){if(!E.protocol){E.protocol=B.protocol}if(!E.userInfo){E.userInfo=B.userInfo}if(!E.port&&E.host=="mce_host"){E.port=B.port}if(!E.host||E.host=="mce_host"){E.host=B.host}E.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;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(F,G){var B,E=0,C="",D;F=F.substring(0,F.lastIndexOf("/"));F=F.split("/");B=G.split("/");if(F.length>=B.length){for(D=0;D<F.length;D++){if(D>=B.length||F[D]!=B[D]){E=D+1;break}}}if(F.length<B.length){for(D=0;D<B.length;D++){if(D>=F.length||F[D]!=B[D]){E=D+1;break}}}if(E==1){return G}for(D=0;D<F.length-(E-1);D++){C+="../"}for(D=E-1;D<B.length;D++){if(D!=E-1){C+="/"+B[D]}else{C+=B[D]}}return C},toAbsPath:function(D,E){var C,B=0,F=[];D=D.split("/");E=E.split("/");A(D,function(G){if(G){F.push(G)}});D=F;for(C=E.length-1,F=[];C>=0;C--){if(E[C].length==0||E[C]=="."){continue}if(E[C]==".."){B++;continue}if(B>0){B--;continue}F.push(E[C])}C=D.length-B;if(C<=0){return"/"+F.reverse().join("/")}return"/"+D.slice(0,C).join("/")+"/"+F.reverse().join("/")},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(H,B,E,D,G,C){var F="";A(B,function(J,I){F+=(!F?"":"&")+escape(I)+"="+escape(J)});this.set(H,F,E,D,G,C)},get:function(F){var E=document.cookie,D,C=F+"=",B;if(!E){return }B=E.indexOf("; "+C);if(B==-1){B=E.indexOf(C);if(B!=0){return null}}else{B+=2}D=E.indexOf(";",B);if(D==-1){D=E.length}return unescape(E.substring(B+C.length,D))},set:function(G,B,E,D,F,C){document.cookie=G+"="+escape(B)+((E)?"; expires="+E.toGMTString():"")+((D)?"; path="+escape(D):"")+((F)?"; domain="+F:"")+((C)?"; secure":"")},remove:function(D,B){var C=new Date();C.setTime(C.getTime()-1000);this.set(D,"",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(F){var A,D,B=window,G=0;F.scope=F.scope||this;F.success_scope=F.success_scope||F.scope;F.error_scope=F.error_scope||F.scope;F.async=F.async===false?false:true;F.data=F.data||"";function C(I){A=0;try{A=new ActiveXObject(I)}catch(H){}return A}A=B.XMLHttpRequest?new XMLHttpRequest():C("Microsoft.XMLHTTP")||C("Msxml2.XMLHTTP");if(A){if(A.overrideMimeType){A.overrideMimeType(F.content_type)}A.open(F.type||(F.data?"POST":"GET"),F.url,F.async);if(F.content_type){A.setRequestHeader("Content-Type",F.content_type)}A.send(F.data);function E(){if(!F.async||A.readyState==4||G++>10000){if(F.success&&G<10000&&A.status==200){F.success.call(F.success_scope,""+A.responseText,A,F)}else{if(F.error){F.error.call(F.error_scope,G>10000?"TIMED_OUT":"GENERAL",A,F)}}A=null}else{B.setTimeout(E,10)}}if(!F.async){return E()}D=B.setTimeout(E,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 each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand("BackgroundImageCache",false,true)}catch(e){t.cssFlicker=true}}tinymce.addUnload(t.destroy,t)},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight}},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,"width");h=t.getStyle(e,"height");if(w.indexOf("px")===-1){w=0}if(h.indexOf("px")===-1){h=0}return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight}},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root){r=r||this.getRoot()}if(is(f,"string")){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==="*"){s=true;return false}each(na.split(","),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false}});return s}}while(n){if(n==r){return null}if(f(n)){return n}n=n.parentNode}return null},get:function(e){var n;if(e&&this.doc&&typeof (e)=="string"){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n){return this.doc.getElementsByName(n)[1]}}return e},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id="_mc_tmp";pa="#_mc_tmp "+pa}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase())}}else{function get(s,n){return s.getElementsByTagName(n)}}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++){o.push(x[i])}return o}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||"*");c=" "+pl[2]+" ";for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(" "+n.className+" ").indexOf(c)!==-1){o.push(n)}}return o}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n)}}function collectIE(n){if(!n.getAttribute("mce_save")){n.setAttribute("mce_save","1");o.push(n)}}function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++){f(nl[i])}}each(pa.split(","),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n)});return }if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2])){collect(n)}});return }if(!(cs=t.cache[pa])){cs="x=(function(cf, s) {";pl=v.split(" ");each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||"*";cs+='find("'+p[1]+'", function(n) {';if(p[2]){cs+='if (n.id !== "'+p[2]+'") return;'}if(p[3]){cs+='var c = " " + n.className + " ";';cs+="if (";c="";each(p[3].split("."),function(v){if(v){c+=(c?"||":"")+'c.indexOf(" '+v+' ") === -1'}});cs+=c+") return;"}});cs+="cf(n);";for(i=pl.length-1;i>=0;i--){cs+="}, "+(i?"n":"s")+");"}cs+="})";t.cache[pa]=cs=eval(cs)}cs(isIE?collectIE:collect,s)});each(o,function(n){if(isIE){n.removeAttribute("mce_save")}else{delete n.mce_save}});return o},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,"string")?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],"object")){t.setAttrib(e,k,""+a[k])}}if(a.style&&!is(a.style,"string")){each(a.style,function(v,n){t.setStyle(e,n,v)})}}if(h){if(h.nodeType){e.appendChild(h)}else{t.setHTML(e,h)}}return !c?p.appendChild(e):e})},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1)},createHTML:function(n,a,h){var o="",t=this,k;o+="<"+n;for(k in a){if(a.hasOwnProperty(k)){o+=" "+k+'="'+t.encode(a[k])+'"'}}if(tinymce.is(h)){return o+">"+h+"</"+n+">"}return o+" />"},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p){return null}if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n)})}return p.removeChild(n)})},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(t.pixelStyles.test(na)&&(tinymce.is(v,"number")||/^[\-0-9\.]+$/.test(v))){v+="px"}switch(na){case"opacity":if(isIE){s.filter=v===""?"":"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout){s.display="inline-block"}}s[na]=s["-moz-opacity"]=s["-khtml-opacity"]=v||"";break;case"float":isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||""}if(t.settings.update_styles){t.setAttrib(e,"mce_style")}})},getStyle:function(n,na,c){n=this.get(n);if(!n){return false}if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return"-"+a});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(ex){return null}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});if(na=="float"){na=isIE?"styleFloat":"cssFloat"}if(n.currentStyle&&c){return n.currentStyle[na]}return n.style[na]},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v)});s.update_styles=ol;if(s.update_styles){t.setAttrib(e,s.cssText)}},setAttrib:function(e,n,v){var t=this;if(t.settings.strict){n=n.toLowerCase()}return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v&&!t._isRes(v)){e.setAttribute("mce_style",v,2)}else{e.removeAttribute("mce_style",2)}}e.style.cssText=v;break;case"class":e.className=v||"";break;case"src":case"href":if(s.keep_values){if(s.url_converter){v=s.url_converter.call(s.url_converter_scope||t,v,n,e)}t.setAttrib(e,"mce_"+n,v,2)}break}if(is(v)&&v!==null&&v.length!==0){e.setAttribute(n,""+v,2)}else{e.removeAttribute(n,2)}})},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v)})})},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1){return false}if(!is(dv)){dv=""}if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v){return v}}v=e.getAttribute(n,2);if(!v){switch(n){case"class":v=e.className;break;default:if(isIE&&n==="name"&&e.nodeName==="A"){v=e.name;break}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v}}switch(n){case"style":v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v)){e.setAttribute("mce_style",v)}}break}if(isWebKit&&n==="class"&&v){v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(isIE){switch(n){case"rowspan":case"colspan":if(v===1){v=""}break;case"size":if(v==="+0"){v=""}break;case"hspace":if(v===-1){v=""}break;case"tabindex":if(v===32768){v=""}break;case"shape":v=v.toLowerCase();break;default:if(n.indexOf("on")===0&&v){v=(""+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(v&&v!="")?""+v:dv},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select("html")[0],"borderWidth");x=(x=="medium"||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x}}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0}r=r.parentNode;if(r==d.body){break}}return{x:x,y:y}},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st){return o}function compress(p,s,ot){var t,r,b,l;t=o[p+"-top"+s];if(!t){return }r=o[p+"-right"+s];if(t!=r){return }b=o[p+"-bottom"+s];if(r!=b){return }l=o[p+"-left"+s];if(b!=l){return }o[ot]=l;delete o[p+"-top"+s];delete o[p+"-right"+s];delete o[p+"-bottom"+s];delete o[p+"-left"+s]}function compress2(ta,a,b,c){var t;t=o[a];if(!t){return }t=o[b];if(!t){return }t=o[c];if(!t){return }o[ta]=o[a]+" "+o[b]+" "+o[c];delete o[a];delete o[b];delete o[c]}each(st.split(";"),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return"url("+ur.length+")"});v=v.split(":");sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1]});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),"style",null))+")"})}o[tinymce.trim(v[0]).toLowerCase()]=sv}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2("border","border-width","border-style","border-color");if(isIE){if(o.border=="medium none"){o.border=""}}return o},serializeStyle:function(o){var s="";each(o,function(v,k){if(k&&v){switch(k){case"color":case"background-color":v=v.toLowerCase();break}s+=(s?" ":"")+k+": "+v+";"}});return s},loadCSS:function(u){var t=this,d=t.doc;if(!u){u=""}each(u.split(","),function(u){if(t.files[u]){return }t.files[u]=true;t.add(t.select("head")[0],"link",{rel:"stylesheet",href:tinymce._addVer(u)})})},addClass:function(e,c){return this.run(e,function(e){var o;if(!c){return 0}if(this.hasClass(e,c)){return e.className}o=this.removeClass(e,c);return e.className=(o!=""?(o+" "):"")+c})},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re){re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g")}v=e.className.replace(re," ");return e.className=tinymce.trim(v!=" "?v:"")}return e.className})},hasClass:function(n,c){n=this.get(n);if(!n||!c){return false}return(" "+n.className+" ").indexOf(" "+c+" ")!==-1},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){e=this.get(e);return e.style.display=="none"||this.getStyle(e,"display")=="none"},uniqueId:function(p){return(!p?"mce_":p)+(this.counter++)},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML="<br />"+h;e.removeChild(e.firstChild)}catch(ex){while(e.firstChild){e.firstChild.removeNode()}x=t.create("div");x.innerHTML="<br />"+h;each(x.childNodes,function(n,i){if(i){e.appendChild(n)}})}}if(t.settings.fix_ie_paragraphs){h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>')}set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break}n.removeAttribute("mce_keep")}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,"</div>");set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement("p");n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=="mce_tmp"){v=n.getAttribute(b);if(!v&&b==="class"){v=n.className}p.setAttribute(b,v)}});for(x=0;x<n.childNodes.length;x++){p.appendChild(n.childNodes[x].cloneNode(true))}n.swapNode(p)}}}}}else{e.innerHTML=h}return h})},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html){return h}if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(isIE){h=h.replace(/&apos;/g,"&#39;")}}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(s.keep_values){if(h.indexOf("<script")!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,"<mce:script$1><!--\n");h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,"\n// --></mce:script>");h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,"<mce:script$1></mce:script>")}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf("mce_"+b)!=-1){return m}if(b=="style"){if(t._isRes(c)){return m}if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v)})}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return"url("+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+")"})}}else{if(b!="coords"){if(s.url_converter){u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))}}}return" "+b+'="'+c+'" mce_'+b+'="'+u+'"'}a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle)})}return h},getOuterHTML:function(e){var d;e=this.get(e);if(!e){return null}if(isIE){return e.outerHTML}d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1){e.outerHTML=h}else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling}t.remove(e)}})},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return !e.firstChild?s:e.firstChild.nodeValue}return s},encode:function(s){return s?(""+s).replace(/[<>&\"]/g,function(c,b){switch(c){case"&":return"&amp;";case'"':return"&quot;";case"<":return"&lt;";case">":return"&gt;"}return c}):s},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns){p.insertBefore(n,ns)}else{p.appendChild(n)}return n})},isBlock:function(n){if(n.nodeType&&n.nodeType!==1){return false}n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n)},replace:function(n,o,k){if(is(o,"array")){n=n.cloneNode(true)}return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true))})}return o.parentNode.replaceChild(n,o)})},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:"0"+s}if(c){s="#"+hex(c[1])+hex(c[2])+hex(c[3]);return s}return s},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes){return t.classes}function addClasses(s){each(s.imports,function(r){addClasses(r)});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(","),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v)){return }ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(f&&!(v=f(v,ov))){return }if(!lo[v]){cl.push({"class":v});lo[v]=1}})}break;case 3:addClasses(r.styleSheet);break}})}try{each(t.doc.styleSheets,addClasses)}catch(ex){}if(cl.length>0){t.classes=cl}return cl},run:function(e,f,s){var t=this,o;if(t.doc&&typeof (e)==="string"){e=t.doc.getElementById(e)}if(!e){return false}s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof (e)=="string"){e=t.doc.getElementById(e)}o.push(f.call(s,e,i))}});return o}return f.call(s,e)},getAttribs:function(n){var o;n=this.get(n);if(!n){return[]}if(isIE){o=[];if(n.nodeName=="OBJECT"){return n.attributes}n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b})});return o}return n.attributes},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s){tinymce.removeUnload(t.destroy)}},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c)}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0})})();(function(){var E=tinymce.each,C=tinymce.DOM,B=tinymce.isIE,D=tinymce.isWebKit,A;tinymce.create("static tinymce.dom.Event",{inits:[],events:[],add:function(L,M,K,I){var F,G=this,H=G.events,J;if(L&&L instanceof Array){J=[];E(L,function(N){N=C.get(N);J.push(G.add(N,M,K,I))});return J}L=C.get(L);if(!L){return }F=function(N){N=N||window.event;if(N&&!N.target&&B){N.target=N.srcElement}if(!I){return K(N)}return K.call(I,N)};if(M=="unload"){tinymce.unloads.unshift({func:F});return F}if(M=="init"){if(G.domLoaded){F()}else{G.inits.push(F)}return F}H.push({obj:L,name:M,func:K,cfunc:F,scope:I});G._add(L,M,F);return K},remove:function(K,L,J){var G=this,F=G.events,H=false,I;if(K&&K instanceof Array){I=[];E(K,function(M){M=C.get(M);I.push(G.remove(M,L,J))});return I}K=C.get(K);E(F,function(N,M){if(N.obj==K&&N.name==L&&(!J||(N.func==J||N.cfunc==J))){F.splice(M,1);G._remove(K,L,N.cfunc);H=true;return false}});return H},clear:function(J){var H=this,F=H.events,G,I;if(J){J=C.get(J);for(G=F.length-1;G>=0;G--){I=F[G];if(I.obj===J){H._remove(I.obj,I.name,I.cfunc);I.obj=I.cfunc=null;F.splice(G,1)}}}},cancel:function(F){if(!F){return false}this.stop(F);return this.prevent(F)},stop:function(F){if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}return false},prevent:function(F){if(F.preventDefault){F.preventDefault()}else{F.returnValue=false}return false},_unload:function(){var F=A;E(F.events,function(H,G){F._remove(H.obj,H.name,H.cfunc);H.obj=H.cfunc=null});F.events=[];F=null},_add:function(G,H,F){if(G.attachEvent){G.attachEvent("on"+H,F)}else{if(G.addEventListener){G.addEventListener(H,F,false)}else{G["on"+H]=F}}},_remove:function(H,I,G){if(H){try{if(H.detachEvent){H.detachEvent("on"+I,G)}else{if(H.removeEventListener){H.removeEventListener(I,G,false)}else{H["on"+I]=null}}}catch(F){}}},_pageInit:function(){var F=A;F._remove(window,"DOMContentLoaded",F._pageInit);F.domLoaded=true;E(F.inits,function(G){G()});F.inits=[]},_wait:function(){var F;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){A.domLoaded=1;return }if(B&&document.location.protocol!="https:"){document.write("<script id=__ie_onload defer src='javascript:\"\"';><\/script>");C.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){A._pageInit();C.get("__ie_onload").onreadystatechange=null}}}else{A._add(window,"DOMContentLoaded",A._pageInit,A);if(B||D){F=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(F);A._pageInit()}},10)}}}});A=tinymce.dom.Event;A._wait();tinymce.addUnload(A._unload)})();(function(){var A=tinymce.each;tinymce.create("tinymce.dom.Element",{Element:function(F,D){var B=this,E,C;D=D||{};B.id=F;B.dom=E=D.dom||tinymce.DOM;B.settings=D;if(!tinymce.isIE){C=B.dom.get(B.id)}A(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(G){B[G]=function(){var H=arguments,I;if(tinymce.isOpera){H=[F];A(arguments,function(J){H.push(J)})}else{Array.prototype.unshift.call(H,C||F)}I=E[G].apply(E,H);B.update(G);return I}})},on:function(D,C,B){return tinymce.dom.Event.add(this.id,D,C,B)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var B=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||B.clientWidth),h:parseInt(this.getStyle("height")||B.clientHeight)}},moveTo:function(B,C){this.setStyles({left:B,top:C})},moveBy:function(B,D){var C=this.getXY();this.moveTo(C.x+B,C.y+D)},resizeTo:function(B,C){this.setStyles({width:B,height:C})},resizeBy:function(B,D){var C=this.getSize();this.resizeTo(C.w+B,C.h+D)},update:function(C){var D=this,B,E=D.dom;if(tinymce.isIE6&&D.settings.blocker){C=C||"";if(C.indexOf("get")===0||C.indexOf("has")===0||C.indexOf("is")===0){return }if(C=="remove"){E.remove(D.blocker);return }if(!D.blocker){D.blocker=E.uniqueId();B=E.add(D.settings.container||E.getRoot(),"iframe",{id:D.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});E.setStyle(B,"opacity",0)}else{B=E.get(D.blocker)}E.setStyle(B,"left",D.getStyle("left",1));E.setStyle(B,"top",D.getStyle("top",1));E.setStyle(B,"width",D.getStyle("width",1));E.setStyle(B,"height",D.getStyle("height",1));E.setStyle(B,"display",D.getStyle("display",1));E.setStyle(B,"zIndex",parseInt(D.getStyle("zIndex",1)||0)-1)}}})})();(function(){function D(E){return E.replace(/[\n\r]+/g,"")}var B=tinymce.is,A=tinymce.isIE,C=tinymce.each;tinymce.create("tinymce.dom.Selection",{Selection:function(H,G,F){var E=this;E.dom=H;E.win=G;E.serializer=F;tinymce.addUnload(E.destroy,E)},getContent:function(F){var E=this,G=E.getRng(),K=E.dom.create("body"),I=E.getSel(),H,J,L;F=F||{};H=J="";F.get=true;F.format=F.format||"html";if(F.format=="text"){return E.isCollapsed()?"":(G.text||(I.toString?I.toString():""))}if(G.cloneContents){L=G.cloneContents();if(L){K.appendChild(L)}}else{if(B(G.item)||B(G.htmlText)){K.innerHTML=G.item?G.item(0).outerHTML:G.htmlText}else{K.innerHTML=G.toString()}}if(/^\s/.test(K.innerHTML)){H=" "}if(/\s+$/.test(K.innerHTML)){J=" "}F.getInner=true;return E.isCollapsed()?"":H+E.serializer.serialize(K,F)+J},setContent:function(H,G){var F=this,I=F.getRng(),J=F.win.document;G=G||{format:"html"};G.set=true;H=F.dom.processHTML(H);if(I.insertNode){if(tinymce.isGecko&&H.indexOf("<")==-1){I.deleteContents();I.insertNode(F.getRng().createContextualFragment(H+'<span id="__caret">_</span>'));F.select(F.dom.get("__caret"));F.getRng().deleteContents();return }try{if(J.queryCommandEnabled("InsertHTML")){return J.execCommand("InsertHTML",false,H)}}catch(E){I.deleteContents();I.insertNode(F.getRng().createContextualFragment(H))}}else{if(I.item){J.execCommand("Delete",false,null);I=F.getRng()}I.pasteHTML(H)}},getStart:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(1);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.firstChild}return G}else{G=F.startContainer;if(G.nodeName=="BODY"){return G.firstChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getEnd:function(){var E=this,F=E.getRng(),G;if(A){if(F.item){return F.item(0)}F=F.duplicate();F.collapse(0);G=F.parentElement();if(G&&G.nodeName=="BODY"){return G.lastChild}return G}else{G=F.endContainer;if(G.nodeName=="BODY"){return G.lastChild}return E.dom.getParent(G,function(H){return H.nodeType==1})}},getBookmark:function(T){var I=this,L=I.getRng(),E,M,K,Q=I.dom.getViewPort(I.win),R,O,V,N,S=-16777215,J,G=I.dom.getRoot(),F=0,H=0,U;M=Q.x;K=Q.y;if(T=="simple"){return{rng:L,scrollX:M,scrollY:K}}if(A){if(L.item){R=L.item(0);C(I.dom.select(R.nodeName),function(X,W){if(R==X){O=W;return false}});return{tag:R.nodeName,index:O,scrollX:M,scrollY:K}}E=I.dom.doc.body.createTextRange();E.moveToElementText(G);E.collapse(true);V=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(true);O=Math.abs(E.move("character",S));E=L.duplicate();E.collapse(false);N=Math.abs(E.move("character",S))-O;return{start:O-V,length:N,scrollX:M,scrollY:K}}R=I.getNode();J=I.getSel();if(!J){return null}if(R&&R.nodeName=="IMG"){return{scrollX:M,scrollY:K}}function P(Y,b,X){var W=I.dom.doc.createTreeWalker(Y,NodeFilter.SHOW_TEXT,null,false),c,Z=0,a={};while((c=W.nextNode())!=null){if(c==b){a.start=Z}if(c==X){a.end=Z;return a}Z+=D(c.nodeValue||"").length}return null}if(J.anchorNode==J.focusNode&&J.anchorOffset==J.focusOffset){R=P(G,J.anchorNode,J.focusNode);if(!R){return{scrollX:M,scrollY:K}}D(J.anchorNode.nodeValue||"").replace(/^\s+/,function(W){F=W.length});return{start:Math.max(R.start+J.anchorOffset-F,0),end:Math.max(R.end+J.focusOffset-F,0),scrollX:M,scrollY:K,beg:J.anchorOffset-F==0}}else{R=P(G,L.startContainer,L.endContainer);if(!R){return{scrollX:M,scrollY:K}}return{start:Math.max(R.start+L.startOffset-F,0),end:Math.max(R.end+L.endOffset-H,0),scrollX:M,scrollY:K,beg:L.startOffset-F==0}}},moveToBookmark:function(M){var N=this,F=N.getRng(),O=N.getSel(),I=N.dom.getRoot(),L,G,J;function H(P,R,Z){var X=N.dom.doc.createTreeWalker(P,NodeFilter.SHOW_TEXT,null,false),T,Q=0,W={},S,Y,V,U;while((T=X.nextNode())!=null){V=U=0;J=T.nodeValue||"";G=D(J).length;Q+=G;if(Q>=R&&!W.startNode){S=R-(Q-G);if(M.beg&&S>=G){continue}W.startNode=T;W.startOffset=S+U}if(Q>=Z){W.endNode=T;W.endOffset=Z-(Q-G)+U;return W}}return null}if(!M){return false}N.win.scrollTo(M.scrollX,M.scrollY);if(A){if(F=M.rng){try{F.select()}catch(K){}return true}N.win.focus();if(M.tag){F=I.createControlRange();C(N.dom.select(M.tag),function(Q,P){if(P==M.index){F.addElement(Q)}})}else{try{if(M.start<0){return true}F=O.createRange();F.moveToElementText(I);F.collapse(true);F.moveStart("character",M.start);F.moveEnd("character",M.length)}catch(E){return true}}try{F.select()}catch(K){}return true}if(!O){return false}if(M.rng){O.removeAllRanges();O.addRange(M.rng)}else{if(B(M.start)&&B(M.end)){try{L=H(I,M.start,M.end);if(L){F=N.dom.doc.createRange();F.setStart(L.startNode,L.startOffset);F.setEnd(L.endNode,L.endOffset);O.removeAllRanges();O.addRange(F)}if(!tinymce.isOpera){N.win.focus()}}catch(K){}}}},select:function(F,K){var O=this,E=O.getRng(),P=O.getSel(),M,L,J,I=O.win.document;function G(Q){return Q?I.createTreeWalker(Q,NodeFilter.SHOW_TEXT,null,false).nextNode():null}function N(T){var S,R,Q;if(!T){return null}Q=I.createTreeWalker(T,NodeFilter.SHOW_TEXT,null,false);while(S=Q.nextNode()){R=S}return R}if(A){try{M=I.body;if(/^(IMG|TABLE)$/.test(F.nodeName)){E=M.createControlRange();E.addElement(F)}else{E=M.createTextRange();E.moveToElementText(F)}E.select()}catch(H){}}else{if(K){L=G(F);J=N(F);if(L&&J){E=I.createRange();E.setStart(L,0);E.setEnd(J,J.nodeValue.length)}else{E.selectNode(F)}}else{E.selectNode(F)}O.setRng(E)}return F},isCollapsed:function(){var E=this,G=E.getRng(),F=E.getSel();if(!G||G.item){return false}return !F||G.boundingWidth==0||F.isCollapsed},collapse:function(E){var F=this,G=F.getRng(),H;if(G.item){H=G.item(0);G=this.win.document.body.createTextRange();G.moveToElementText(H)}G.collapse(!!E);F.setRng(G)},getSel:function(){var F=this,E=this.win;return E.getSelection?E.getSelection():E.document.selection},getRng:function(){var F=this,G=F.getSel(),H;try{if(G){H=G.rangeCount>0?G.getRangeAt(0):(G.createRange?G.createRange():F.win.document.createRange())}}catch(E){}if(!H){H=A?F.win.document.body.createTextRange():F.win.document.createRange()}return H},setRng:function(G){var F;if(!A){F=this.getSel();if(F){F.removeAllRanges();F.addRange(G)}}else{try{G.select()}catch(E){}}},setNode:function(F){var E=this;E.setContent(E.dom.getOuterHTML(F));return F},getNode:function(){var E=this,G=E.getRng(),F=E.getSel(),H;if(!A){if(!G){return E.dom.getRoot()}H=G.commonAncestorContainer;if(!G.collapsed){if(G.startContainer==G.endContainer||(tinymce.isWebKit&&G.startContainer==G.endContainer.parentNode)){if(G.startOffset-G.endOffset<2||tinymce.isWebKit){if(G.startContainer.hasChildNodes()){H=G.startContainer.childNodes[G.startOffset]}}}}return E.dom.getParent(H,function(I){return I.nodeType==1})}return G.item?G.item(0):G.parentElement()},destroy:function(F){var E=this;E.win=null;if(!F){tinymce.removeUnload(E.destroy)}}})})();(function(){tinymce.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(B){function A(){var D=document.implementation;if(!D||!D.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(C){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(C){}}else{return D.createDocument("","",null)}}this.doc=A();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset()},reset:function(){var A=this,B=A.doc;if(B.firstChild){B.removeChild(B.firstChild)}A.node=B.appendChild(B.createElement("html"))},writeStartElement:function(B){var A=this;A.node=A.node.appendChild(A.doc.createElement(B))},writeAttribute:function(B,A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.setAttribute(B,A)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var A=this,B=A.node;B.appendChild(A.doc.createTextNode(""));A.node=B.parentNode},writeText:function(A){if(this.valid){A=A.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(A))},writeCDATA:function(A){this.node.appendChild(this.doc.createCDATA(A))},writeComment:function(A){this.node.appendChild(this.doc.createComment(A.replace(/\-\-/g," ")))},getContent:function(){var A;A=this.doc.xml||new XMLSerializer().serializeToString(this.doc);A=A.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");A=A.replace(/ ?\/>/g," />");if(this.valid){A=A.replace(/\%MCGT%/g,"&gt;")}return A}})})();(function(){tinymce.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(A){this.settings=tinymce.extend({indent_char:" ",indentation:1},A);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(A){this._writeAttributesEnd();this.writeRaw("<"+A);this.tags.push(A);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(C,A){var B=this;B.writeRaw(" "+B.encode(C)+'="'+B.encode(A)+'"')},writeEndElement:function(){var A;if(this.tags.length>0){A=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+A+">")}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(A){this._writeAttributesEnd();this.writeRaw(this.encode(A));this.count++},writeCDATA:function(A){this._writeAttributesEnd();this.writeRaw("<![CDATA["+A+"]]>");this.count++},writeComment:function(A){this._writeAttributesEnd();this.writeRaw("<!-- "+A+"-->");this.count++},writeRaw:function(A){this.str+=A},encode:function(A){return A.replace(/[<>&"]/g,function(B){switch(B){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return B})},getContent:function(){return this.str},_writeAttributesEnd:function(A){if(!this.inAttr){return }this.inAttr=false;if(A&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})();(function(){var G=tinymce.extend,E=tinymce.each,B=tinymce.util.Dispatcher,D=tinymce.isIE,A=tinymce.isGecko;function F(I){var H=[];if(I.nodeName=="OBJECT"){return I.attributes}I.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(K,J){H.push({specified:1,nodeName:J})});return H}function C(H){return H.replace(/([?+*])/g,".$1")}tinymce.create("tinymce.dom.Serializer",{Serializer:function(J){var I=this;I.key=0;I.onPreProcess=new B(I);I.onPostProcess=new B(I);if(tinymce.relaxedDomain&&tinymce.isGecko){I.writer=new tinymce.dom.StringWriter()}else{try{I.writer=new tinymce.dom.XMLWriter()}catch(H){I.writer=new tinymce.dom.StringWriter()}}I.settings=J=G({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,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",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,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},J);I.dom=J.dom;if(J.fix_list_elements){I.onPreProcess.add(function(R,O){var L,T,S=["ol","ul"],Q,P,N,K=/^(OL|UL)$/,U;function M(X,Y){var V=Y.split(","),W;while((X=X.previousSibling)!=null){for(W=0;W<V.length;W++){if(X.nodeName==V[W]){return X}}}return null}for(T=0;T<S.length;T++){L=I.dom.select(S[T],O.node);for(Q=0;Q<L.length;Q++){P=L[Q];N=P.parentNode;if(K.test(N.nodeName)){U=M(P,"LI");if(!U){U=I.dom.create("li");U.innerHTML="&nbsp;";U.appendChild(P);N.insertBefore(U,N.firstChild)}else{U.appendChild(P)}}}}})}if(J.fix_table_elements){I.onPreProcess.add(function(K,L){E(I.dom.select("table",L.node),function(S){var R=I.dom.getParent(S,"H1,H2,H3,H4,H5,H6,P"),N,T,M,Q=[],O,P;if(R){N=R.cloneNode(false);Q.push(S);for(T=S;T=T.parentNode;){Q.push(T);if(T==R){break}}M=N;for(O=Q.length-1;O>=0;O--){if(O==Q.length-1){while(P=Q[O-1].nextSibling){M.appendChild(P.parentNode.removeChild(P))}}else{T=Q[O].cloneNode(false);if(O!=0){while(P=Q[O-1].nextSibling){T.appendChild(P.parentNode.removeChild(P))}}M=M.appendChild(T)}}S=I.dom.insertAfter(S.parentNode.removeChild(S),R);I.dom.insertAfter(S,R);I.dom.insertAfter(N,S)}})})}},setEntities:function(N){var L=this,I,K,H={},M="",J;if(L.entityLookup){return }I=N.split(",");for(K=0;K<I.length;K+=2){J=I[K];if(J==34||J==38||J==60||J==62){continue}H[String.fromCharCode(I[K])]=I[K+1];J=parseInt(I[K]).toString(16);M+="\\u"+"0000".substring(J.length)+J}if(!M){L.settings.entity_encoding="raw";return }L.entitiesRE=new RegExp("["+M+"]","g");L.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";E(K.split(","),function(N){var O=N.split(/\[|\]/),M;N="";E(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");E(O[0].split("/"),function(P){J.childRules=J.childRules||{};J.childRules[P]=M})});K="";E(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();E(I.split(","),function(M){var P=M.split(/\[|\]/),L=P[0].split("/"),Q,K,O,N=[];if(J){K=tinymce.extend([],J.attribs)}if(P.length>1){E(P[1].split("|"),function(T){var R={},S;K=K||[];T=T.replace(/::/g,"~");T=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(T);T[2]=T[2].replace(/~/g,":");if(T[1]=="!"){Q=Q||[];Q.push(T[2])}if(T[1]=="-"){for(S=0;S<K.length;S++){if(K[S].name==T[2]){K.splice(S,1);return }}}switch(T[3]){case"=":R.defaultVal=T[4]||"";break;case":":R.forcedVal=T[4];break;case"<":R.validVals=T[4].split("?");break}if(/[*.?]/.test(T[2])){O=O||[];R.nameRE=new RegExp("^"+C(T[2])+"$");O.push(R)}else{R.name=T[2];K.push(R)}N.push(T[2])})}E(L,function(U,T){var V=U.charAt(0),S=1,R={};if(J){if(J.noEmpty){R.noEmpty=J.noEmpty}if(J.fullEnd){R.fullEnd=J.fullEnd}if(J.padd){R.padd=J.padd}}switch(V){case"-":R.noEmpty=true;break;case"+":R.fullEnd=true;break;case"#":R.padd=true;break;default:S=0}L[T]=U=U.substring(S);H.validElements[U]=1;if(/[*.?]/.test(L[0])){R.nameRE=new RegExp("^"+C(L[0])+"$");H.wildRules=H.wildRules||{};H.wildRules.push(R)}else{R.name=L[0];if(L[0]=="@"){J=R}H.rules[U]=R}R.attribs=K;if(Q){R.requiredAttribs=Q}if(O){U="";E(N,function(W){if(U){U+="|"}U+="("+C(W)+")"});R.validAttribsRE=new RegExp("^"+U.toLowerCase()+"$");R.wildAttribs=O}})});I="";E(H.validElements,function(L,K){if(I){I+="|"}if(K!="@"){I+=K}});H.validElementsRE=new RegExp("^("+C(I.toLowerCase())+")$")},findRule:function(L){var I=this,K=I.rules,H,J;I._setup();J=K[L];if(J){return J}K=I.wildRules;for(H=0;H<K.length;H++){if(K[H].nameRE.test(L)){return K[H]}}return null},findAttribRule:function(H,K){var I,J=H.wildAttribs;for(I=0;I<J.length;I++){if(J[I].nameRE.test(K)){return J[I]}}return null},serialize:function(K,J){var I,H=this;H._setup();J=J||{};J.format=J.format||"html";H.processObj=J;K=K.cloneNode(true);H.key=""+(parseInt(H.key)+1);if(!J.no_events){J.node=K;H.onPreProcess.dispatch(H,J)}H.writer.reset();H._serializeNode(K,J.getInner);J.content=H.writer.getContent();if(!J.no_events){H.onPostProcess.dispatch(H,J)}H._postProcess(J);J.node=null;return tinymce.trim(J.content)},_postProcess:function(M){var H=this,J=H.settings,I=M.content,L=[],K;if(M.format=="html"){K=H._protect({content:I,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});I=K.content;if(J.entity_encoding!=="raw"){I=H._encode(I)}if(!M.set){I=I.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,J.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(J.remove_linebreaks){I=I.replace(/\r?\n|\r/g," ");I=I.replace(/(<[^>]+>)\s+/g,"$1 ");I=I.replace(/\s+(<\/[^>]+>)/g," $1");I=I.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>");I=I.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>");I=I.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(J.apply_source_formatting&&J.indent_mode=="simple"){I=I.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");I=I.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");I=I.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");I=I.replace(/\n\n/g,"\n")}}I=H._unprotect(I,K);if(J.entity_encoding=="raw"){I=I.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}}M.content=I},_serializeNode:function(V,K){var R=this,S=R.settings,P=R.writer,M,I,O,X,W,Y,T,H,Q,J,N,U,L;if(!S.node_filter||S.node_filter(V)){switch(V.nodeType){case 1:if(V.hasAttribute?V.hasAttribute("mce_bogus"):V.getAttribute("mce_bogus")){return }L=false;M=V.hasChildNodes();J=V.getAttribute("mce_name")||V.nodeName.toLowerCase();if(D){if(V.scopeName!=="HTML"&&V.scopeName!=="html"){J=V.scopeName+":"+J}}if(J.indexOf("mce:")===0){J=J.substring(4)}if(!R.validElementsRE.test(J)||(R.invalidElementsRE&&R.invalidElementsRE.test(J))||K){L=true;break}if(D){if(S.fix_content_duplication){if(V.mce_serialized==R.key){return }V.mce_serialized=R.key}if(J.charAt(0)=="/"){J=J.substring(1)}}else{if(A){if(V.nodeName==="BR"&&V.getAttribute("type")=="_moz"){return }}}if(R.childRules){if(R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(J)){L=true;break}}R.elementName=J}N=R.findRule(J);J=N.name||J;if((!M&&N.noEmpty)||(D&&!J)){L=true;break}if(N.requiredAttribs){Y=N.requiredAttribs;for(X=Y.length-1;X>=0;X--){if(this.dom.getAttrib(V,Y[X])!==""){break}}if(X==-1){L=true;break}}P.writeStartElement(J);if(N.attribs){for(X=0,T=N.attribs,W=T.length;X<W;X++){Y=T[X];Q=R._getAttrib(V,Y);if(Q!==null){P.writeAttribute(Y.name,Q)}}}if(N.validAttribsRE){T=D?F(V):V.attributes;for(X=T.length-1;X>-1;X--){H=T[X];if(H.specified){Y=H.nodeName.toLowerCase();if(S.invalid_attrs.test(Y)||!N.validAttribsRE.test(Y)){continue}U=R.findAttribRule(N,Y);Q=R._getAttrib(V,U,Y);if(Q!==null){P.writeAttribute(Y,Q)}}}}if(!M&&N.padd){P.writeText("\u00a0")}break;case 3:if(R.childRules&&R.parentElementsRE.test(R.elementName)){if(!R.childRules[R.elementName].test(V.nodeName)){return }}return P.writeText(V.nodeValue);case 4:return P.writeCDATA(V.nodeValue);case 8:return P.writeComment(V.nodeValue)}}else{if(V.nodeType==1){M=V.hasChildNodes()}}if(M){O=V.firstChild;while(O){R._serializeNode(O);R.elementName=J;O=O.nextSibling}}if(!L){if(M||!S.closed.test(J)){P.writeFullEndElement()}else{P.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"})}E(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(H,I){H=H.replace(/\<!--mce:([0-9]+)--\>/g,function(K,J){return I.items[parseInt(J)]});I.items=[];return H},_encode:function(K){var I=this,J=I.settings,H;if(J.entity_encoding!=="raw"){if(J.entity_encoding.indexOf("named")!=-1){I.setEntities(J.entities);H=I.entityLookup;K=K.replace(I.entitiesRE,function(L){var M;if(M=H[L]){L="&"+M+";"}return L})}if(J.entity_encoding.indexOf("numeric")!=-1){K=K.replace(/[\u007E-\uFFFF]/g,function(L){return"&#"+L.charCodeAt(0)+";"})}}return K},_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(L,I,H){var K,J;H=H||I.name;if(I.forcedVal&&(J=I.forcedVal)){if(J==="{$uid}"){return this.dom.uniqueId()}return J}J=this.dom.getAttrib(L,H);switch(H){case"rowspan":case"colspan":if(J=="1"){J=""}break}if(this.attribValueFilter){J=this.attribValueFilter(H,J,L)}if(I.validVals){for(K=I.validVals.length-1;K>=0;K--){if(J==I.validVals[K]){break}}if(K==-1){return null}}if(J===""&&typeof (I.defaultVal)!="undefined"){J=I.defaultVal;if(J==="{$uid}"){return this.dom.uniqueId()}return J}else{if(H=="class"&&this.processObj.get){J=J.replace(/\s?mceItem\w+\s?/g,"")}}if(J===""){return null}return J}})})();(function(){var each=tinymce.each;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(tinymce.dom.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.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);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(!tinymce.dom.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)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})();(function(){var B=tinymce.DOM,A=tinymce.is;tinymce.create("tinymce.ui.Control",{Control:function(D,C){this.id=D;this.settings=C=C||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix="";this.scope=C.scope||this;this.disabled=0;this.active=0},setDisabled:function(C){var D;if(C!=this.disabled){D=B.get(this.id);if(D&&this.settings.unavailable_prefix){if(C){this.prevTitle=D.title;D.title=this.settings.unavailable_prefix+": "+D.title}else{D.title=this.prevTitle}}this.setState("Disabled",C);this.setState("Enabled",!C);this.disabled=C}},isDisabled:function(){return this.disabled},setActive:function(C){if(C!=this.active){this.setState("Active",C);this.active=C}},isActive:function(){return this.active},setState:function(E,C){var D=B.get(this.id);E=this.classPrefix+E;if(C){B.addClass(D,E)}else{B.removeClass(D,E)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(C){B.setHTML(C,this.renderHTML())},postRender:function(){var D=this,C;if(A(D.disabled)){C=D.disabled;D.disabled=-1;D.setDisabled(C)}if(A(D.active)){C=D.active;D.active=-1;D.setActive(C)}},remove:function(){B.remove(this.id);this.destroy()},destroy:function(){tinymce.dom.Event.clear(this.id)}})})();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(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(F,E){this.parent(F,E);this.classPrefix="mceMenuItem"},setSelected:function(E){this.setState("Selected",E);this.selected=E},isSelected:function(){return this.selected},postRender:function(){var E=this;E.parent();if(C(E.selected)){E.setSelected(E.selected)}}})})();(function(){var C=tinymce.is,B=tinymce.DOM,D=tinymce.each,A=tinymce.walk;tinymce.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(G,F){var E=this;E.parent(G,F);E.items={};E.collapsed=false;E.menuCount=0;E.onAddItem=new tinymce.util.Dispatcher(this)},expand:function(F){var E=this;if(F){A(E,function(G){if(G.expand){G.expand()}},"items",E)}E.collapsed=false},collapse:function(F){var E=this;if(F){A(E,function(G){if(G.collapse){G.collapse()}},"items",E)}E.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(E){if(!E.settings){E=new tinymce.ui.MenuItem(E.id||B.uniqueId(),E)}this.onAddItem.dispatch(this,E);return this.items[E.id]=E},addSeparator:function(){return this.add({separator:true})},addMenu:function(E){if(!E.collapse){E=this.createMenu(E)}this.menuCount++;return this.add(E)},hasMenus:function(){return this.menuCount!==0},remove:function(E){delete this.items[E.id]},removeAll:function(){var E=this;A(E,function(F){if(F.removeAll){F.removeAll()}else{F.remove()}F.destroy()},"items",E);E.items={}},createMenu:function(F){var E=new tinymce.ui.Menu(F.id||B.uniqueId(),F);E.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return E}})})();(function(){var D=tinymce.is,C=tinymce.DOM,E=tinymce.each,A=tinymce.dom.Event,B=tinymce.dom.Element;tinymce.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(G,F){F=F||{};F.container=F.container||C.doc.body;F.offset_x=F.offset_x||0;F.offset_y=F.offset_y||0;F.vp_offset_x=F.vp_offset_x||0;F.vp_offset_y=F.vp_offset_y||0;if(D(F.icons)&&!F.icons){F["class"]+=" mceNoIcons"}this.parent(G,F);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(I){var G=this,H=G.settings,F;I.container=I.container||H.container;I.parent=G;I.constrain=I.constrain||H.constrain;I["class"]=I["class"]||H["class"];I.vp_offset_x=I.vp_offset_x||H.vp_offset_x;I.vp_offset_y=I.vp_offset_y||H.vp_offset_y;F=new tinymce.ui.DropMenu(I.id||C.uniqueId(),I);F.onAddItem.add(G.onAddItem.dispatch,G.onAddItem);return F},update:function(){var H=this,I=H.settings,F=C.get("menu_"+H.id+"_tbl"),K=C.get("menu_"+H.id+"_co"),G,J;G=I.max_width?Math.min(F.clientWidth,I.max_width):F.clientWidth;J=I.max_height?Math.min(F.clientHeight,I.max_height):F.clientHeight;if(!C.boxModel){H.element.setStyles({width:G+2,height:J+2})}else{H.element.setStyles({width:G,height:J})}if(I.max_width){C.setStyle(K,"width",G)}if(I.max_height){C.setStyle(K,"height",J);if(F.clientHeight<I.max_height){C.setStyle(K,"overflow","hidden")}}},showMenu:function(N,L,P){var S=this,T=S.settings,M,F=C.getViewPort(),Q,J,R,O,G=2,I,H,K=S.classPrefix;S.collapse(1);if(S.isMenuVisible){return }if(!S.rendered){M=C.add(S.settings.container,S.renderNode());E(S.items,function(U){U.postRender()});S.element=new B("menu_"+S.id,{blocker:1,container:T.container})}else{M=C.get("menu_"+S.id)}if(!tinymce.isOpera){C.setStyles(M,{left:-65535,top:-65535})}C.show(M);S.update();N+=T.offset_x||0;L+=T.offset_y||0;F.w-=4;F.h-=4;if(T.constrain){Q=M.clientWidth-G;J=M.clientHeight-G;R=F.x+F.w;O=F.y+F.h;if((N+T.vp_offset_x+Q)>R){N=P?P-Q:Math.max(0,(R-T.vp_offset_x)-Q)}if((L+T.vp_offset_y+J)>O){L=Math.max(0,(O-T.vp_offset_y)-J)}}C.setStyles(M,{left:N,top:L});S.element.update();S.isMenuVisible=1;S.mouseClickFunc=A.add(M,"click",function(V){var U;V=V.target;if(V&&(V=C.getParent(V,"TR"))&&!C.hasClass(V,K+"ItemSub")){U=S.items[V.id];if(U.isDisabled()){return }I=S;while(I){if(I.hideMenu){I.hideMenu()}I=I.settings.parent}if(U.settings.onclick){U.settings.onclick(V)}return A.cancel(V)}});if(S.hasMenus()){S.mouseOverFunc=A.add(M,"mouseover",function(X){var U,W,V;X=X.target;if(X&&(X=C.getParent(X,"TR"))){U=S.items[X.id];if(S.lastMenu){S.lastMenu.collapse(1)}if(U.isDisabled()){return }if(X&&C.hasClass(X,K+"ItemSub")){W=C.getRect(X);U.showMenu((W.x+W.w-G),W.y-G,W.x);S.lastMenu=U;C.addClass(C.get(U.id).firstChild,K+"ItemActive")}}})}S.onShowMenu.dispatch(S);if(T.keyboard_focus){A.add(M,"keydown",S._keyHandler,S);C.select("a","menu_"+S.id)[0].focus();S._focusIdx=0}},hideMenu:function(I){var F=this,H=C.get("menu_"+F.id),G;if(!F.isMenuVisible){return }A.remove(H,"mouseover",F.mouseOverFunc);A.remove(H,"click",F.mouseClickFunc);A.remove(H,"keydown",F._keyHandler);C.hide(H);F.isMenuVisible=0;if(!I){F.collapse(1)}if(F.element){F.element.hide()}if(G=C.get(F.id)){C.removeClass(G.firstChild,F.classPrefix+"ItemActive")}F.onHideMenu.dispatch(F)},add:function(H){var F=this,G;H=F.parent(H);if(F.isRendered&&(G=C.get("menu_"+F.id))){F._add(C.select("tbody",G)[0],H)}return H},collapse:function(F){this.parent(F);this.hideMenu(1)},remove:function(F){C.remove(F.id);this.destroy();return this.parent(F)},destroy:function(){var F=this,G=C.get("menu_"+F.id);A.remove(G,"mouseover",F.mouseOverFunc);A.remove(G,"click",F.mouseClickFunc);if(F.element){F.element.remove()}C.remove(G)},renderNode:function(){var H=this,I=H.settings,K,G,J,F;F=C.create("div",{id:"menu_"+H.id,"class":I["class"],style:"position:absolute;left:0;top:0;z-index:200000"});J=C.add(F,"div",{id:"menu_"+H.id+"_co","class":H.classPrefix+(I["class"]?" "+I["class"]:"")});H.element=new B("menu_"+H.id,{blocker:1,container:I.container});if(I.menu_line){C.add(J,"span",{"class":H.classPrefix+"Line"})}K=C.add(J,"table",{id:"menu_"+H.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});G=C.add(K,"tbody");E(H.items,function(L){H._add(G,L)});H.rendered=true;return F},_keyHandler:function(I){var H=this,G=I.keyCode;function F(L){var J=H._focusIdx+L,K=C.select("a","menu_"+H.id)[J];if(K){H._focusIdx=J;K.focus()}}switch(G){case 38:F(-1);return ;case 40:F(1);return ;case 13:return ;case 27:return this.hideMenu()}},_add:function(G,L){var M,I=L.settings,F,J,H,K=this.classPrefix;if(I.separator){J=C.add(G,"tr",{id:L.id,"class":K+"ItemSeparator"});C.add(J,"td",{"class":K+"ItemSeparator"});if(M=J.previousSibling){C.addClass(M,"mceLast")}return }M=J=C.add(G,"tr",{id:L.id,"class":K+"Item "+K+"ItemEnabled"});M=H=C.add(M,"td");M=F=C.add(M,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});C.addClass(H,I["class"]);C.add(M,"span",{"class":"mceIcon"+(I.icon?" mce_"+I.icon:"")});M=C.add(M,I.element||"span",{"class":"mceText",title:L.settings.title},L.settings.title);if(L.settings.style){C.setAttrib(M,"style",L.settings.style)}if(G.childNodes.length==1){C.addClass(J,"mceFirst")}if((M=J.previousSibling)&&C.hasClass(M,K+"ItemSeparator")){C.addClass(J,"mceFirst")}if(L.collapse){C.addClass(J,K+"ItemSub")}if(M=J.previousSibling){C.removeClass(M,"mceLast")}C.addClass(J,"mceLast")}})})();(function(){var A=tinymce.DOM;tinymce.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(C,B){this.parent(C,B);this.classPrefix="mceButton"},renderHTML:function(){var E=this.classPrefix,D=this.settings,C,B;B=A.encode(D.label||"");C='<a id="'+this.id+'" href="javascript:;" class="'+E+" "+E+"Enabled "+D["class"]+(B?" "+E+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+A.encode(D.title)+'">';if(D.image){C+='<img class="mceIcon" src="'+D.image+'" />'+B+"</a>"}else{C+='<span class="mceIcon '+D["class"]+'"></span>'+(B?'<span class="'+E+'Label">'+B+"</span>":"")+"</a>"}return C},postRender:function(){var B=this,C=B.settings;tinymce.dom.Event.add(B.id,"click",function(D){if(!B.isDisabled()){return C.onclick.call(C.scope,D)}})}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(G,F){var E=this;E.parent(G,F);E.items=[];E.onChange=new A(E);E.onPostRender=new A(E);E.onAdd=new A(E);E.onRenderMenu=new tinymce.util.Dispatcher(this);E.classPrefix="mceListBox"},select:function(E){var F=this,H,G;if(E!=F.selectedValue){H=C.get(F.id+"_text");F.selectedValue=E;D(F.items,function(I){if(I.value==E){C.setHTML(H,C.encode(I.title));G=1;return false}});if(!G){C.setHTML(H,C.encode(F.settings.title));C.addClass(H,"mceTitle");H=0;return }else{C.removeClass(H,"mceTitle")}}H=0},add:function(H,E,G){var F=this;G=G||{};G=tinymce.extend(G,{title:H,value:E});F.items.push(G);F.onAdd.dispatch(F,G)},getLength:function(){return this.items.length},renderHTML:function(){var G="",E=this,F=E.settings,H=E.classPrefix;G='<table id="'+E.id+'" cellpadding="0" cellspacing="0" class="'+H+" "+H+"Enabled"+(F["class"]?(" "+F["class"]):"")+'"><tbody><tr>';G+="<td>"+C.createHTML("a",{id:E.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},C.encode(E.settings.title))+"</td>";G+="<td>"+C.createHTML("a",{id:E.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";G+="</tr></tbody></table>";return G},showMenu:function(){var F=this,I,H,G=C.get(this.id),E;if(F.isDisabled()||F.items.length==0){return }if(F.menu&&F.menu.isMenuVisible){return F.hideMenu()}if(!F.isMenuRendered){F.renderMenu();F.isMenuRendered=true}I=C.getPos(this.settings.menu_container);H=C.getPos(G);E=F.menu;E.settings.offset_x=H.x;E.settings.offset_y=H.y;E.settings.keyboard_focus=!tinymce.isOpera;if(F.oldID){E.items[F.oldID].setSelected(0)}D(F.items,function(J){if(J.value===F.selectedValue){E.items[J.id].setSelected(1);F.oldID=J.id}});E.showMenu(0,G.clientHeight);B.add(C.doc,"mousedown",F.hideMenu,F);C.addClass(F.id,F.classPrefix+"Selected")},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&(F.target.id==E.id+"_text"||F.target.id==E.id+"_open")){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceMenu")})){C.removeClass(E.id,E.classPrefix+"Selected");B.remove(C.doc,"mousedown",E.hideMenu,E);if(E.menu){E.menu.hideMenu()}}},renderMenu:function(){var F=this,E;E=F.settings.control_manager.createDropMenu(F.id+"_menu",{menu_line:1,"class":F.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});E.onHideMenu.add(F.hideMenu,F);E.add({title:F.settings.title,"class":"mceMenuItemTitle"}).setDisabled(1);D(F.items,function(G){G.id=C.uniqueId();G.onclick=function(){if(F.settings.onselect(G.value)!==false){F.select(G.value)}};E.add(G)});F.onRenderMenu.dispatch(F,E);F.menu=E},postRender:function(){var E=this,F=E.classPrefix;B.add(E.id,"click",E.showMenu,E);B.add(E.id+"_text","focus",function(G){if(!E._focused){E.keyDownHandler=B.add(E.id+"_text","keydown",function(K){var H=-1,I,J=K.keyCode;D(E.items,function(L,M){if(E.selectedValue==L.value){H=M}});if(J==38){I=E.items[H-1]}else{if(J==40){I=E.items[H+1]}else{if(J==13){I=E.selectedValue;E.selectedValue=null;E.settings.onselect(I);return B.cancel(K)}}}if(I){E.hideMenu();E.select(I.value)}})}E._focused=1});B.add(E.id+"_text","blur",function(){B.remove(E.id+"_text","keydown",E.keyDownHandler);E._focused=0});if(tinymce.isIE6||!C.boxModel){B.add(E.id,"mouseover",function(){if(!C.hasClass(E.id,F+"Disabled")){C.addClass(E.id,F+"Hover")}});B.add(E.id,"mouseout",function(){if(!C.hasClass(E.id,F+"Disabled")){C.removeClass(E.id,F+"Hover")}})}E.onPostRender.dispatch(E,C.get(E.id))},destroy:function(){this.parent();B.clear(this.id+"_text")}})})();(function(){var C=tinymce.DOM,B=tinymce.dom.Event,D=tinymce.each,A=tinymce.util.Dispatcher;tinymce.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(F,E){this.parent(F,E);this.classPrefix="mceNativeListBox"},setDisabled:function(E){C.get(this.id).disabled=E},isDisabled:function(){return C.get(this.id).disabled},select:function(E){var G=C.get(this.id),F=G.options;E=""+(E||"");G.selectedIndex=0;D(F,function(I,H){if(I.value==E){G.selectedIndex=H;return false}})},add:function(I,F,E){var H,G=this;E=E||{};E.value=F;if(G.isRendered()){C.add(C.get(this.id),"option",E,I)}H={title:I,value:F,attribs:E};G.items.push(H);G.onAdd.dispatch(G,H)},getLength:function(){return C.get(this.id).options.length-1},renderHTML:function(){var F,E=this;F=C.createHTML("option",{value:""},"-- "+E.settings.title+" --");D(E.items,function(G){F+=C.createHTML("option",{value:G.value},G.title)});F=C.createHTML("select",{id:E.id,"class":"mceNativeListBox"},F);return F},postRender:function(){var F=this,G;F.rendered=true;function E(I){var H=I.target.options[I.target.selectedIndex].value;F.onChange.dispatch(F,H);if(F.settings.onselect){F.settings.onselect(H)}}B.add(F.id,"change",E);B.add(F.id,"keydown",function(I){var H;B.remove(F.id,"change",G);H=B.add(F.id,"blur",function(){B.add(F.id,"change",E);B.remove(F.id,"blur",H)});if(I.keyCode==13||I.keyCode==32){E(I);return B.cancel(I)}});F.onPostRender.dispatch(F,C.get(F.id))}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(E,D){this.parent(E,D);this.onRenderMenu=new tinymce.util.Dispatcher(this);D.menu_container=D.menu_container||B.doc.body},showMenu:function(){var E=this,H,G,F=B.get(E.id),D;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=B.getPos(E.settings.menu_container);G=B.getPos(F);D=E.menu;D.settings.offset_x=G.x;D.settings.offset_y=G.y;D.settings.vp_offset_x=G.x;D.settings.vp_offset_y=G.y;D.settings.keyboard_focus=E._focused;D.showMenu(0,F.clientHeight);A.add(B.doc,"mousedown",E.hideMenu,E);E.setState("Selected",1);E.isMenuVisible=1},renderMenu:function(){var E=this,D;D=E.settings.control_manager.createDropMenu(E.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:E.settings.icons});D.onHideMenu.add(E.hideMenu,E);E.onRenderMenu.dispatch(E,D);E.menu=D},hideMenu:function(E){var D=this;if(E&&E.type=="mousedown"&&B.getParent(E.target,function(F){return F.id===D.id||F.id===D.id+"_open"})){return }if(!E||!B.getParent(E.target,function(F){return B.hasClass(F,"mceMenu")})){D.setState("Selected",0);A.remove(B.doc,"mousedown",D.hideMenu,D);if(D.menu){D.menu.hideMenu()}}D.isMenuVisible=0},postRender:function(){var D=this,E=D.settings;A.add(D.id,"click",function(){if(!D.isDisabled()){if(E.onclick){E.onclick(D.value)}D.showMenu()}})}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each;tinymce.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(E,D){this.parent(E,D);this.classPrefix="mceSplitButton"},renderHTML:function(){var G,E=this,F=E.settings,D;G="<tbody><tr>";if(F.image){D=B.createHTML("img ",{src:F.image,"class":"mceAction "+F["class"]})}else{D=B.createHTML("span",{"class":"mceAction "+F["class"]},"")}G+="<td>"+B.createHTML("a",{id:E.id+"_action",href:"javascript:;","class":"mceAction "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";D=B.createHTML("span",{"class":"mceOpen "+F["class"]});G+="<td>"+B.createHTML("a",{id:E.id+"_open",href:"javascript:;","class":"mceOpen "+F["class"],onclick:"return false;",onmousedown:"return false;",title:F.title},D)+"</td>";G+="</tr></tbody>";return B.createHTML("table",{id:E.id,"class":"mceSplitButton mceSplitButtonEnabled "+F["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:F.title},G)},postRender:function(){var D=this,E=D.settings;if(E.onclick){A.add(D.id+"_action","click",function(){if(!D.isDisabled()){E.onclick(D.value)}})}A.add(D.id+"_open","click",D.showMenu,D);A.add(D.id+"_open","focus",function(){D._focused=1});A.add(D.id+"_open","blur",function(){D._focused=0});if(tinymce.isIE6||!B.boxModel){A.add(D.id,"mouseover",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.addClass(D.id,"mceSplitButtonHover")}});A.add(D.id,"mouseout",function(){if(!B.hasClass(D.id,"mceSplitButtonDisabled")){B.removeClass(D.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();A.clear(this.id+"_action");A.clear(this.id+"_open")}})})();(function(){var C=tinymce.DOM,A=tinymce.dom.Event,B=tinymce.is,D=tinymce.each;tinymce.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(G,F){var E=this;E.parent(G,F);E.settings=F=tinymce.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"},E.settings);E.onShowMenu=new tinymce.util.Dispatcher(E);E.onHideMenu=new tinymce.util.Dispatcher(E);E.value=F.default_color},showMenu:function(){var E=this,F,I,H,G;if(E.isDisabled()){return }if(!E.isMenuRendered){E.renderMenu();E.isMenuRendered=true}if(E.isMenuVisible){return E.hideMenu()}H=C.get(E.id);C.show(E.id+"_menu");C.addClass(H,"mceSplitButtonSelected");G=C.getPos(H);C.setStyles(E.id+"_menu",{left:G.x,top:G.y+H.clientHeight,zIndex:200000});H=0;A.add(C.doc,"mousedown",E.hideMenu,E);if(E._focused){E._keyHandler=A.add(E.id+"_menu","keydown",function(J){if(J.keyCode==27){E.hideMenu()}});C.select("a",E.id+"_menu")[0].focus()}E.onShowMenu.dispatch(E);E.isMenuVisible=1},hideMenu:function(F){var E=this;if(F&&F.type=="mousedown"&&C.getParent(F.target,function(G){return G.id===E.id+"_open"})){return }if(!F||!C.getParent(F.target,function(G){return C.hasClass(G,"mceSplitButtonMenu")})){C.removeClass(E.id,"mceSplitButtonSelected");A.remove(C.doc,"mousedown",E.hideMenu,E);A.remove(E.id+"_menu","keydown",E._keyHandler);C.hide(E.id+"_menu")}E.onHideMenu.dispatch(E);E.isMenuVisible=0},renderMenu:function(){var I=this,E,H=0,J=I.settings,L,G,K,F;F=C.add(J.menu_container,"div",{id:I.id+"_menu","class":J.menu_class+" "+J["class"],style:"position:absolute;left:0;top:-1000px;"});E=C.add(F,"div",{"class":J["class"]+" mceSplitButtonMenu"});C.add(E,"span",{"class":"mceMenuLine"});L=C.add(E,"table",{"class":"mceColorSplitMenu"});G=C.add(L,"tbody");H=0;D(B(J.colors,"array")?J.colors:J.colors.split(","),function(M){M=M.replace(/^#/,"");if(!H--){K=C.add(G,"tr");H=J.grid_width-1}L=C.add(K,"td");L=C.add(L,"a",{href:"javascript:;",style:{backgroundColor:"#"+M},mce_color:"#"+M})});if(J.more_colors_func){L=C.add(G,"tr");L=C.add(L,"td",{colspan:J.grid_width,"class":"mceMoreColors"});L=C.add(L,"a",{id:I.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},J.more_colors_title);A.add(L,"click",function(M){J.more_colors_func.call(J.more_colors_scope||this);return A.cancel(M)})}C.addClass(E,"mceColorSplitMenu");A.add(I.id+"_menu","click",function(M){var N;M=M.target;if(M.nodeName=="A"&&(N=M.getAttribute("mce_color"))){I.setColor(N)}return A.cancel(M)});return F},setColor:function(F){var E=this;C.setStyle(E.id+"_preview","backgroundColor",F);E.value=F;E.hideMenu();E.settings.onselect(F)},postRender:function(){var E=this,F=E.id;E.parent();C.add(F+"_action","div",{id:F+"_preview","class":"mceColorPreview"})},destroy:function(){this.parent();A.clear(this.id+"_menu");A.clear(this.id+"_more");C.remove(this.id+"_menu")}})})();tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var I=this,D="",F,G,B=tinymce.DOM,J=I.settings,C,A,E,H;H=I.controls;for(C=0;C<H.length;C++){G=H[C];A=H[C-1];E=H[C+1];if(C===0){F="mceToolbarStart";if(G.Button){F+=" mceToolbarStartButton"}else{if(G.SplitButton){F+=" mceToolbarStartSplitButton"}else{if(G.ListBox){F+=" mceToolbarStartListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"))}if(A&&G.ListBox){if(A.Button||A.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarEnd"},B.createHTML("span",null,"<!-- IE -->"))}}if(B.stdMode){D+='<td style="position: relative">'+G.renderHTML()+"</td>"}else{D+="<td>"+G.renderHTML()+"</td>"}if(E&&G.ListBox){if(E.Button||E.SplitButton){D+=B.createHTML("td",{"class":"mceToolbarStart"},B.createHTML("span",null,"<!-- IE -->"))}}}F="mceToolbarEnd";if(G.Button){F+=" mceToolbarEndButton"}else{if(G.SplitButton){F+=" mceToolbarEndSplitButton"}else{if(G.ListBox){F+=" mceToolbarEndListBox"}}}D+=B.createHTML("td",{"class":F},B.createHTML("span",null,"<!-- IE -->"));return B.createHTML("table",{id:I.id,"class":"mceToolbar"+(J["class"]?" "+J["class"]:""),cellpadding:"0",cellspacing:"0",align:I.settings.align||""},"<tbody><tr>"+D+"</tr></tbody>")}});(function(){var A=tinymce.util.Dispatcher,B=tinymce.each;tinymce.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new A(this),get:function(C){return this.lookup[C]},requireLangPack:function(E){var C,D;if(tinymce.EditorManager.settings){l=tinyMCE.settings.language;C=tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0&context="+this.urls[E];D=tinymce.EditorManager.settings;if(D){if(!tinymce.dom.Event.domLoaded&&!D.strict_mode){tinymce.ScriptLoader.load(C)}else{tinymce.ScriptLoader.add(C)}}}},add:function(D,C){this.items.push(C);this.lookup[D]=C;this.onAdd.dispatch(this,D,C);return C},load:function(G,D,C,F){var E=this;if(E.urls[G]){return }if(D.indexOf("/")!=0&&D.indexOf("://")==-1){D=tinymce.baseURL+"/"+D}E.urls[G]=D.substring(0,D.lastIndexOf("/"));tinymce.ScriptLoader.add(D,C,F)}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager()}());(function(){var F=tinymce.each,G=tinymce.extend,E=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.ThemeManager,B=tinymce.PluginManager,D=tinymce.explode;tinymce.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var H=this,I=window.location;tinymce.documentBaseURL=I.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(tinymce.documentBaseURL)){tinymce.documentBaseURL+="/"}tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=I.hostname&&I.hostname){document.domain=tinymce.relaxedDomain=I.hostname.replace(/.*\.(.+\..+)$/,"$1")}H.onBeforeUnload=new tinymce.util.Dispatcher(H);A.add(window,"beforeunload",function(J){H.onBeforeUnload.dispatch(H,J)})},init:function(K){var I=this,J,H=tinymce.ScriptLoader,N,M;function L(Q,R,O){var P=Q[R];if(!P){return }if(tinymce.is(P,"string")){O=P.replace(/\.\w+$/,"");O=O?tinymce.resolve(O):0;P=tinymce.resolve(P)}return P.apply(O||this,Array.prototype.slice.call(arguments,2))}K=G({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},K);I.settings=K;if(!A.domLoaded&&!K.strict_loading_mode){if(K.language){l=tinyMCE.settings.language;H.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(K.theme&&K.theme.charAt(0)!="-"&&!C.urls[K.theme]){C.load(K.theme,"themes/"+K.theme+"/editor_template"+tinymce.suffix+".js")}if(K.plugins){J=D(K.plugins);if(tinymce.inArray(J,"compat2x")!=-1){B.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js")}F(J,function(O){if(O&&O.charAt(0)!="-"&&!B.urls[O]){if(!tinymce.isWebKit&&O=="safari"){return }B.load(O,"plugins/"+O+"/editor_plugin"+tinymce.suffix+".js")}})}H.loadQueue()}A.add(document,"init",function(){var O,Q;L(K,"onpageload");if(K.browsers){O=false;F(D(K.browsers),function(R){switch(R){case"ie":case"msie":if(tinymce.isIE){O=true}break;case"gecko":if(tinymce.isGecko){O=true}break;case"safari":case"webkit":if(tinymce.isWebKit){O=true}break;case"opera":if(tinymce.isOpera){O=true}break}});if(!O){return }}switch(K.mode){case"exact":O=K.elements||"";if(O.length>0){F(D(O),function(R){if(E.get(R)){new tinymce.Editor(R,K).render(1)}else{N=0;F(document.forms,function(S){F(S.elements,function(T){if(T.name===R){R="mce_editor_"+N;E.setAttrib(T,"id",R);new tinymce.Editor(R,K).render(1)}})})}})}break;case"textareas":case"specific_textareas":function P(S,R){return R.constructor===RegExp?R.test(S.className):E.hasClass(S,R)}F(E.select("textarea"),function(R){if(K.editor_deselector&&P(R,K.editor_deselector)){return }if(!K.editor_selector||P(R,K.editor_selector)){M=E.get(R.name);if(!R.id&&!M){R.id=R.name}if(!R.id||I.get(R.id)){R.id=E.uniqueId()}new tinymce.Editor(R.id,K).render(1)}});break}if(K.oninit){O=Q=0;F(I.editors,function(R){Q++;if(!R.initialized){R.onInit.add(function(){O++;if(O==Q){L(K,"oninit")}})}else{O++}if(O==Q){L(K,"oninit")}})}})},get:function(H){return this.editors[H]},getInstanceById:function(H){return this.get(H)},add:function(H){this.editors[H.id]=H;this._setActive(H);return H},remove:function(I){var H=this;if(!H.editors[I.id]){return null}delete H.editors[I.id];if(H.activeEditor==I){F(H.editors,function(J){H._setActive(J);return false})}I.destroy();return I},execCommand:function(N,L,K){var M=this,J=M.get(K),H;switch(N){case"mceFocus":J.focus();return true;case"mceAddEditor":case"mceAddControl":if(!M.get(K)){new tinymce.Editor(K,M.settings).render()}return true;case"mceAddFrameControl":H=K.window;H.tinyMCE=tinyMCE;H.tinymce=tinymce;tinymce.DOM.doc=H.document;tinymce.DOM.win=H;J=new tinymce.Editor(K.element_id,K);J.render();if(tinymce.isIE){function I(){J.destroy();H.detachEvent("onunload",I);H=H.tinyMCE=H.tinymce=null}H.attachEvent("onunload",I)}K.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":J.remove();return true;case"mceToggleEditor":if(!J){M.execCommand("mceAddControl",0,K);return true}if(J.isHidden()){J.show()}else{J.hide()}return true}if(M.activeEditor){return M.activeEditor.execCommand(N,L,K)}return false},execInstanceCommand:function(L,K,J,I){var H=this.get(L);if(H){return H.execCommand(K,J,I)}return false},triggerSave:function(){F(this.editors,function(H){H.save()})},addI18n:function(J,K){var H,I=this.i18n;if(!tinymce.is(J,"string")){F(J,function(M,L){F(M,function(O,N){F(O,function(Q,P){if(N==="common"){I[L+"."+P]=Q}else{I[L+"."+N+"."+P]=Q}})})})}else{F(K,function(M,L){I[J+"."+L]=M})}},_setActive:function(H){this.selectedInstance=this.activeEditor=H}});tinymce.EditorManager.preInit()})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var N=tinymce.DOM,K=tinymce.dom.Event,F=tinymce.extend,L=tinymce.util.Dispatcher;var J=tinymce.each,A=tinymce.isGecko,B=tinymce.isIE,E=tinymce.isWebKit;var D=tinymce.is,H=tinymce.ThemeManager,C=tinymce.PluginManager,I=tinymce.EditorManager;var O=tinymce.inArray,M=tinymce.grep,G=tinymce.explode;tinymce.create("tinymce.Editor",{Editor:function(R,Q){var P=this;P.id=P.editorId=R;P.execCommands={};P.queryStateCommands={};P.queryValueCommands={};P.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){P[S]=new L(P)});P.settings=Q=F({id:R,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:tinymce.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|_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],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"},Q);P.documentBaseURI=new tinymce.util.URI(Q.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});P.baseURI=I.baseURI;P.execCallback("setup",P)},render:function(R){var S=this,T=S.settings,U=S.id,P=tinymce.ScriptLoader;if(!K.domLoaded){K.add(document,"init",function(){S.render()});return }if(!R){T.strict_loading_mode=1;tinyMCE.settings=T}if(!S.getElement()){return }if(T.strict_loading_mode){P.settings.strict_mode=T.strict_loading_mode;tinymce.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(S.getElement().nodeName)&&T.hidden_input&&N.getParent(U,"form")){N.insertAfter(N.create("input",{type:"hidden",name:U}),U)}S.windowManager=new tinymce.WindowManager(S);if(T.encoding=="xml"){S.onGetContent.add(function(V,W){if(W.save){W.content=N.encode(W.content)}})}if(T.add_form_submit_trigger){S.onSubmit.addToTop(function(){if(S.initialized){S.save();S.isNotDirty=1}})}if(T.add_unload_trigger&&!T.ask){S._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(S.initialized&&!S.destroyed&&!S.isHidden()){S.save({format:"raw",no_events:true})}})}tinymce.addUnload(S.destroy,S);if(T.submit_patch){S.onBeforeRenderUI.add(function(){var V=S.getElement().form;if(!V){return }if(V._mceOldSubmit){return }if(!V.submit.nodeType&&!V.submit.length){S.formElement=V;V._mceOldSubmit=V.submit;V.submit=function(){I.triggerSave();S.isNotDirty=1;return this._mceOldSubmit(this)}}V=null})}function Q(){if(T.language){l=tinyMCE.settings.language;P.add(tinyMCE.settings.document_base_url+"/lib/editor/tinymce/strings.php?lang="+l+"&dlg=0")}if(T.theme.charAt(0)!="-"&&!H.urls[T.theme]){H.load(T.theme,"themes/"+T.theme+"/editor_template"+tinymce.suffix+".js")}J(G(T.plugins),function(V){if(V&&V.charAt(0)!="-"&&!C.urls[V]){if(!E&&V=="safari"){return }C.load(V,"plugins/"+V+"/editor_plugin"+tinymce.suffix+".js")}});P.loadQueue(function(){if(T.ask){function V(){window.setTimeout(function(){K.remove(S.id,"focus",V);S.windowManager.confirm(S.getLang("edit_confirm"),function(W){if(W){S.init()}})},0)}K.add(S.id,"focus",V);return }if(!S.removed){S.init()}})}if(T.plugins.indexOf("compat2x")!=-1){C.load("compat2x","plugins/compat2x/editor_plugin"+tinymce.suffix+".js");P.loadQueue(Q)}else{Q()}},init:function(){var R,a=this,b=a.settings,X,U,W=a.getElement(),Q,P,Y,T,V,Z;I.add(a);b.theme=b.theme.replace(/-/,"");Q=H.get(b.theme);a.theme=new Q();if(a.theme.init&&b.init_theme){a.theme.init(a,H.urls[b.theme]||tinymce.documentBaseURL.replace(/\/$/,""))}J(G(b.plugins.replace(/\-/g,"")),function(f){var g=C.get(f),e=C.urls[f]||tinymce.documentBaseURL.replace(/\/$/,""),d;if(g){d=new g(a,e);a.plugins[f]=d;if(d.init){d.init(a,e)}}});if(b.popup_css){b.popup_css=a.documentBaseURI.toAbsolute(b.popup_css)}else{b.popup_css=a.baseURI.toAbsolute("themes/"+b.theme+"/skins/"+b.skin+"/dialog.css")}if(b.popup_css_add){b.popup_css+=","+a.documentBaseURI.toAbsolute(b.popup_css_add)}a.controlManager=new tinymce.ControlManager(a);a.undoManager=new tinymce.UndoManager(a);a.undoManager.onAdd.add(function(d,c){if(!c.initial){return a.onChange.dispatch(a,c,d)}});a.undoManager.onUndo.add(function(d,c){return a.onUndo.dispatch(a,c,d)});a.undoManager.onRedo.add(function(d,c){return a.onRedo.dispatch(a,c,d)});if(b.custom_undo_redo){a.onExecCommand.add(function(d,f,e,g,c){if(f!="Undo"&&f!="Redo"&&f!="mceRepaint"&&(!c||!c.skip_undo)){a.undoManager.add()}})}a.onExecCommand.add(function(d,e){if(!/^(FontName|FontSize)$/.test(e)){a.nodeChanged()}});if(A){function S(c,d){if(!d||!d.initial){a.execCommand("mceRepaint")}}a.onUndo.add(S);a.onRedo.add(S);a.onSetContent.add(S)}a.onBeforeRenderUI.dispatch(a,a.controlManager);if(b.render_ui){X=b.width||W.style.width||W.offsetWidth;U=b.height||W.style.height||W.offsetHeight;a.orgDisplay=W.style.display;Z=/^[0-9\.]+(|px)$/i;if(Z.test(""+X)){X=Math.max(parseInt(X)+(Q.deltaWidth||0),100)}if(Z.test(""+U)){U=Math.max(parseInt(U)+(Q.deltaHeight||0),100)}Q=a.theme.renderUI({targetNode:W,width:X,height:U,deltaWidth:b.delta_width,deltaHeight:b.delta_height});a.editorContainer=Q.editorContainer}N.setStyles(Q.sizeContainer||Q.editorContainer,{width:X,height:U});U=(Q.iframeHeight||U)+((U+"").indexOf("%")==-1?(Q.deltaHeight||0):"");if(U<100){U=100}a.iframeHTML=b.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+a.documentBaseURI.getURI()+'"></base>';a.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain){a.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";<\/script>'}T=b.body_id||"tinymce";if(T.indexOf("=")!=-1){T=a.getParam("body_id","","hash");T=T[a.id]||T}V=b.body_class||"";if(V.indexOf("=")!=-1){V=a.getParam("body_class","","hash");V=V[a.id]||""}a.iframeHTML+='</head><body id="'+T+'" class="mceContentBody '+V+'"></body></html>';if(tinymce.relaxedDomain){if(B){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+a.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(tinymce.isOpera){Y='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}R=N.add(Q.iframeContainer,"iframe",{id:a.id+"_ifr",src:Y||'javascript:""',frameBorder:"0",style:{width:"100%",height:U}});a.contentAreaContainer=Q.iframeContainer;N.get(Q.editorContainer).style.display=a.orgDisplay;N.get(a.id).style.display="none";if(tinymce.isOldWebKit){K.add(R,"load",a.setupIframe,a);R.src=tinymce.baseURL+"/plugins/safari/blank.htm"}else{if(!B||!tinymce.relaxedDomain){a.setupIframe()}W=R=Q=null}},setupIframe:function(){var S=this,U=S.settings,V=N.get(S.id),W=S.getDoc(),T,Q;if(!B||!tinymce.relaxedDomain){W.open();W.write(S.iframeHTML);W.close()}if(!B){try{W.designMode="On"}catch(R){}}if(B){Q=S.getBody();N.hide(Q);Q.contentEditable=true;N.show(Q)}S.dom=new tinymce.DOM.DOMUtils(S.getDoc(),{keep_values:true,url_converter:S.convertURL,url_converter_scope:S,hex_colors:U.force_hex_style_colors,class_filter:U.class_filter,update_styles:1,fix_ie_paragraphs:1});S.serializer=new tinymce.dom.Serializer({entity_encoding:U.entity_encoding,entities:U.entities,valid_elements:U.verify_html===false?"*[*]":U.valid_elements,extended_valid_elements:U.extended_valid_elements,valid_child_elements:U.valid_child_elements,invalid_elements:U.invalid_elements,fix_table_elements:U.fix_table_elements,fix_list_elements:U.fix_list_elements,fix_content_duplication:U.fix_content_duplication,convert_fonts_to_spans:U.convert_fonts_to_spans,font_size_classes:U.font_size_classes,font_size_style_values:U.font_size_style_values,apply_source_formatting:U.apply_source_formatting,remove_linebreaks:U.remove_linebreaks,dom:S.dom});S.selection=new tinymce.dom.Selection(S.dom,S.getWin(),S.serializer);S.forceBlocks=new tinymce.ForceBlocks(S,{forced_root_block:U.forced_root_block});S.editorCommands=new tinymce.EditorCommands(S);S.serializer.onPreProcess.add(function(X,Y){return S.onPreProcess.dispatch(S,Y,X)});S.serializer.onPostProcess.add(function(X,Y){return S.onPostProcess.dispatch(S,Y,X)});S.onPreInit.dispatch(S);if(!U.gecko_spellcheck){S.getBody().spellcheck=0}S._addEvents();S.controlManager.onPostRender.dispatch(S,S.controlManager);S.onPostRender.dispatch(S);if(U.directionality){S.getBody().dir=U.directionality}if(U.nowrap){S.getBody().style.whiteSpace="nowrap"}if(U.auto_resize){S.onNodeChange.add(S.resizeToContent,S)}if(U.custom_elements){function P(X,Y){J(G(U.custom_elements),function(Z){var a;if(Z.indexOf("~")===0){Z=Z.substring(1);a="span"}else{a="div"}Y.content=Y.content.replace(new RegExp("<("+Z+")([^>]*)>","g"),"<"+a+' mce_name="$1"$2>');Y.content=Y.content.replace(new RegExp("</("+Z+")>","g"),"</"+a+">")})}S.onBeforeSetContent.add(P);S.onPostProcess.add(function(X,Y){if(Y.set){P(X,Y)}})}if(U.handle_node_change_callback){S.onNodeChange.add(function(Y,X,Z){S.execCallback("handle_node_change_callback",S.id,Z,-1,-1,true,S.selection.isCollapsed())})}if(U.save_callback){S.onSaveContent.add(function(X,Z){var Y=S.execCallback("save_callback",S.id,Z.content,S.getBody());if(Y){Z.content=Y}})}if(U.onchange_callback){S.onChange.add(function(Y,X){S.execCallback("onchange_callback",S,X)})}if(U.convert_newlines_to_brs){S.onBeforeSetContent.add(function(X,Y){if(Y.initial){Y.content=Y.content.replace(/\r?\n/g,"<br />")}})}if(U.fix_nesting&&B){S.onBeforeSetContent.add(function(X,Y){Y.content=S._fixNesting(Y.content)})}if(U.preformatted){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^\s*<pre.*?>/,"");Y.content=Y.content.replace(/<\/pre>\s*$/,"");if(Y.set){Y.content='<pre class="mceItemHidden">'+Y.content+"</pre>"}})}if(U.verify_css_classes){S.serializer.attribValueFilter=function(a,Y){var Z,X;if(a=="class"){if(!S.classesRE){X=S.dom.getClasses();if(X.length>0){Z="";J(X,function(b){Z+=(Z?"|":"")+b["class"]});S.classesRE=new RegExp("("+Z+")","gi")}}return !S.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(Y)||S.classesRE.test(Y)?Y:""}return Y}}if(U.convert_fonts_to_spans){S._convertFonts()}if(U.inline_styles){S._convertInlineElements()}if(U.cleanup_callback){S.onBeforeSetContent.add(function(X,Y){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)});S.onPreProcess.add(function(X,Y){if(Y.set){S.execCallback("cleanup_callback","insert_to_editor_dom",Y.node,Y)}if(Y.get){S.execCallback("cleanup_callback","get_from_editor_dom",Y.node,Y)}});S.onPostProcess.add(function(X,Y){if(Y.set){Y.content=S.execCallback("cleanup_callback","insert_to_editor",Y.content,Y)}if(Y.get){Y.content=S.execCallback("cleanup_callback","get_from_editor",Y.content,Y)}})}if(U.save_callback){S.onGetContent.add(function(X,Y){if(Y.save){Y.content=S.execCallback("save_callback",S.id,Y.content,S.getBody())}})}if(U.handle_event_callback){S.onEvent.add(function(X,Y,Z){if(S.execCallback("handle_event_callback",Y,X,Z)===false){K.cancel(Y)}})}S.onSetContent.add(function(){S.addVisual(S.getBody())});if(U.padd_empty_editor){S.onPostProcess.add(function(X,Y){Y.content=Y.content.replace(/^(<p>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(A){try{W.designMode="Off";W.designMode="On"}catch(R){}}setTimeout(function(){if(S.removed){return }S.load({initial:true,format:(U.cleanup_on_startup?"html":"raw")});S.startContent=S.getContent({format:"raw"});S.undoManager.add({initial:true});S.initialized=true;S.onInit.dispatch(S);S.execCallback("setupcontent_callback",S.id,S.getBody(),S.getDoc());S.execCallback("init_instance_callback",S);S.focus(true);S.nodeChanged({initial:1});if(U.content_css){tinymce.each(G(U.content_css),function(X){S.dom.loadCSS(S.documentBaseURI.toAbsolute(X))})}if(U.auto_focus){setTimeout(function(){var X=I.get(U.auto_focus);X.selection.select(X.getBody(),1);X.selection.collapse(1);X.getWin().focus()},100)}},1);V=null},focus:function(Q){var S,P=this,R=P.settings.content_editable;if(!Q){if(!R){P.getWin().focus()}}if(I.activeEditor!=P){if((S=I.activeEditor)!=null){S.onDeactivate.dispatch(S,P)}P.onActivate.dispatch(P,S)}I._setActive(P)},execCallback:function(S){var P=this,R=P.settings[S],Q;if(!R){return }if(P.callbackLookup&&(Q=P.callbackLookup[S])){R=Q.func;Q=Q.scope}if(D(R,"string")){Q=R.replace(/\.\w+$/,"");Q=Q?tinymce.resolve(Q):0;R=tinymce.resolve(R);P.callbackLookup=P.callbackLookup||{};P.callbackLookup[S]={func:R,scope:Q}}return R.apply(Q||P,Array.prototype.slice.call(arguments,1))},translate:function(P){var R=this.settings.language,Q=I.i18n;if(!P){return""}return Q[R+"."+P]||P.replace(/{\#([^}]+)\}/g,function(T,S){return Q[R+"."+S]||"{#"+S+"}"})},getLang:function(Q,P){return I.i18n[this.settings.language+"."+Q]||(D(P)?P:"{#"+Q+"}")},getParam:function(U,R,P){var S=tinymce.trim,Q=D(this.settings[U])?this.settings[U]:R,T;if(P==="hash"){T={};if(D(Q,"string")){J(Q.indexOf("=")>0?Q.split(/[;,](?![^=;,]*(?:[;,]|$))/):Q.split(","),function(V){V=V.split("=");if(V.length>1){T[S(V[0])]=S(V[1])}else{T[S(V[0])]=S(V)}})}else{T=Q}return T}return Q},nodeChanged:function(R){var P=this,Q=P.selection,S=Q.getNode()||P.getBody();if(P.initialized){P.onNodeChange.dispatch(P,R?R.controlManager||P.controlManager:P.controlManager,B&&S.ownerDocument!=P.getDoc()?P.getBody():S,Q.isCollapsed(),R)}},addButton:function(R,Q){var P=this;P.buttons=P.buttons||{};P.buttons[R]=Q},addCommand:function(R,Q,P){this.execCommands[R]={func:Q,scope:P||this}},addQueryStateHandler:function(R,Q,P){this.queryStateCommands[R]={func:Q,scope:P||this}},addQueryValueHandler:function(R,Q,P){this.queryValueCommands[R]={func:Q,scope:P||this}},addShortcut:function(R,T,P,S){var Q=this,U;if(!Q.settings.custom_shortcuts){return false}Q.shortcuts=Q.shortcuts||{};if(D(P,"string")){U=P;P=function(){Q.execCommand(U,false,null)}}if(D(P,"object")){U=P;P=function(){Q.execCommand(U[0],U[1],U[2])}}J(G(R),function(V){var W={func:P,scope:S||this,desc:T,alt:false,ctrl:false,shift:false};J(G(V,"+"),function(X){switch(X){case"alt":case"ctrl":case"shift":W[X]=true;break;default:W.charCode=X.charCodeAt(0);W.keyCode=X.toUpperCase().charCodeAt(0)}});Q.shortcuts[(W.ctrl?"ctrl":"")+","+(W.alt?"alt":"")+","+(W.shift?"shift":"")+","+W.keyCode]=W});return true},execCommand:function(U,T,W,P){var R=this,S=0,V,Q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(U)&&(!P||!P.skip_focus)){R.focus()}V={};R.onBeforeExecCommand.dispatch(R,U,T,W,V);if(V.terminate){return false}if(R.execCallback("execcommand_callback",R.id,R.selection.getNode(),U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(V=R.execCommands[U]){Q=V.func.call(V.scope,T,W);if(Q!==true){R.onExecCommand.dispatch(R,U,T,W,P);return Q}}J(R.plugins,function(X){if(X.execCommand&&X.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);S=1;return false}});if(S){return true}if(R.theme.execCommand&&R.theme.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}if(R.editorCommands.execCommand(U,T,W)){R.onExecCommand.dispatch(R,U,T,W,P);return true}R.getDoc().execCommand(U,T,W);R.onExecCommand.dispatch(R,U,T,W,P)},queryCommandState:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryStateCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandState(T);if(S!==-1){return S}try{return this.getDoc().queryCommandState(T)}catch(P){}},queryCommandValue:function(T){var Q=this,S,R;if(Q._isHidden()){return }if(S=Q.queryValueCommands[T]){R=S.func.call(S.scope);if(R!==true){return R}}S=Q.editorCommands.queryCommandValue(T);if(D(S)){return S}try{return this.getDoc().queryCommandValue(T)}catch(P){}},show:function(){var P=this;N.show(P.getContainer());N.hide(P.id);P.load()},hide:function(){var P=this,Q=P.getDoc();if(B&&Q){Q.execCommand("SelectAll")}P.save();N.hide(P.getContainer());N.setStyle(P.id,"display",P.orgDisplay)},isHidden:function(){return !N.isHidden(this.id)},setProgressState:function(P,Q,R){this.onSetProgressState.dispatch(this,P,Q,R);return P},resizeToContent:function(){var P=this;N.setStyle(P.id+"_ifr","height",P.getBody().scrollHeight)},load:function(S){var P=this,R=P.getElement(),Q;S=S||{};S.load=true;Q=P.setContent(D(R.value)?R.value:R.innerHTML,S);S.element=R;if(!S.no_events){P.onLoadContent.dispatch(P,S)}S.element=R=null;return Q},save:function(T){var P=this,S=P.getElement(),Q,R;if(!P.initialized){return }T=T||{};T.save=true;if(!T.no_events){P.undoManager.typing=0;P.undoManager.add()}T.element=S;Q=T.content=P.getContent(T);if(!T.no_events){P.onSaveContent.dispatch(P,T)}Q=T.content;if(!/TEXTAREA|INPUT/i.test(S.nodeName)){S.innerHTML=Q;if(R=N.getParent(P.id,"form")){J(R.elements,function(U){if(U.name==P.id){U.value=Q;return false}})}}else{S.value=Q}T.element=S=null;return Q},setContent:function(Q,R){var P=this;R=R||{};R.format=R.format||"html";R.set=true;R.content=Q;if(!R.no_events){P.onBeforeSetContent.dispatch(P,R)}if(!tinymce.isIE&&(Q.length===0||/^\s+$/.test(Q))){R.content=P.dom.setHTML(P.getBody(),'<br mce_bogus="1" />');R.format="raw"}R.content=P.dom.setHTML(P.getBody(),tinymce.trim(R.content));if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;R.content=P.dom.setHTML(P.getBody(),P.serializer.serialize(P.getBody(),R))}if(!R.no_events){P.onSetContent.dispatch(P,R)}return R.content},getContent:function(R){var P=this,Q;R=R||{};R.format=R.format||"html";R.get=true;if(!R.no_events){P.onBeforeGetContent.dispatch(P,R)}if(R.format!="raw"&&P.settings.cleanup){R.getInner=true;Q=P.serializer.serialize(P.getBody(),R)}else{Q=P.getBody().innerHTML}Q=Q.replace(/^\s*|\s*$/g,"");R.content=Q;if(!R.no_events){P.onGetContent.dispatch(P,R)}return R.content},isDirty:function(){var P=this;return tinymce.trim(P.startContent)!=tinymce.trim(P.getContent({format:"raw",no_events:1}))&&!P.isNotDirty},getContainer:function(){var P=this;if(!P.container){P.container=N.get(P.editorContainer||P.id+"_parent")}return P.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return N.get(this.settings.content_element||this.id)},getWin:function(){var P=this,Q;if(!P.contentWindow){Q=N.get(P.id+"_ifr");if(Q){P.contentWindow=Q.contentWindow}}return P.contentWindow},getDoc:function(){var Q=this,P;if(!Q.contentDocument){P=Q.getWin();if(P){Q.contentDocument=P.document}}return Q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(P,T,S){var Q=this,R=Q.settings;if(R.urlconverter_callback){return Q.execCallback("urlconverter_callback",P,S,true,T)}if(!R.convert_urls||(S&&S.nodeName=="LINK")||P.indexOf("file:")===0){return P}if(R.relative_urls){return Q.documentBaseURI.toRelative(P)}P=Q.documentBaseURI.toAbsolute(P,R.remove_script_host);return P},addVisual:function(R){var P=this,Q=P.settings;R=R||P.getBody();if(!D(P.hasVisual)){P.hasVisual=Q.visual}J(P.dom.select("table,a",R),function(T){var S;switch(T.nodeName){case"TABLE":S=P.dom.getAttrib(T,"border");if(!S||S=="0"){if(P.hasVisual){P.dom.addClass(T,Q.visual_table_class)}else{P.dom.removeClass(T,Q.visual_table_class)}}return ;case"A":S=P.dom.getAttrib(T,"name");if(S){if(P.hasVisual){P.dom.addClass(T,"mceItemAnchor")}else{P.dom.removeClass(T,"mceItemAnchor")}}return }});P.onVisualAid.dispatch(P,R,P.hasVisual)},remove:function(){var P=this,Q=P.getContainer();P.removed=1;P.hide();P.execCallback("remove_instance_callback",P);P.onRemove.dispatch(P);P.onExecCommand.listeners=[];I.remove(P);N.remove(Q)},destroy:function(Q){var P=this;if(P.destroyed){return }if(!Q){tinymce.removeUnload(P.destroy);tinyMCE.onBeforeUnload.remove(P._beforeUnload);if(P.theme.destroy){P.theme.destroy()}P.controlManager.destroy();P.selection.destroy();P.dom.destroy();if(!P.settings.content_editable){K.clear(P.getWin());K.clear(P.getDoc())}K.clear(P.getBody());K.clear(P.formElement)}if(P.formElement){P.formElement.submit=P.formElement._mceOldSubmit;P.formElement._mceOldSubmit=null}P.contentAreaContainer=P.formElement=P.container=P.settings.content_element=P.bodyElement=P.contentDocument=P.contentWindow=null;if(P.selection){P.selection=P.selection.win=P.selection.dom=P.selection.dom.doc=null}P.destroyed=1},_addEvents:function(){var W=this,Q,X=W.settings,T={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function P(a,b){var Z=a.type;if(W.removed){return }if(W.onEvent.dispatch(W,a,b)!==false){W[T[a.fakeType||a.type]].dispatch(W,a,b)}}J(T,function(a,Z){switch(Z){case"contextmenu":if(tinymce.isOpera){K.add(W.getBody(),"mousedown",function(b){if(b.ctrlKey){b.fakeType="contextmenu";P(b)}})}else{K.add(W.getBody(),Z,P)}break;case"paste":K.add(W.getBody(),Z,function(g){var b,d,c,f;if(g.clipboardData){b=g.clipboardData.getData("text/plain")}else{if(tinymce.isIE){b=W.getWin().clipboardData.getData("Text")}}P(g,{text:b,html:d})});break;case"submit":case"reset":K.add(W.getElement().form||N.getParent(W.id,"form"),Z,P);break;default:K.add(X.content_editable?W.getBody():W.getDoc(),Z,P)}});K.add(X.content_editable?W.getBody():(A?W.getDoc():W.getWin()),"focus",function(Z){W.focus(true)});if(tinymce.isGecko){K.add(W.getDoc(),"DOMNodeInserted",function(a){var Z;a=a.target;if(a.nodeType===1&&a.nodeName==="IMG"&&(Z=a.getAttribute("mce_src"))){a.src=W.documentBaseURI.toAbsolute(Z)}})}if(A){function R(){var a=this,c=a.getDoc(),b=a.settings;if(A){if(a._isHidden()){try{if(!b.content_editable){c.designMode="On"}}catch(Z){}}try{c.execCommand("styleWithCSS",0,false)}catch(Z){if(!a._isHidden()){try{c.execCommand("useCSS",0,true)}catch(Z){}}}if(!b.table_inline_editing){try{c.execCommand("enableInlineTableEditing",false,false)}catch(Z){}}if(!b.object_resizing){try{c.execCommand("enableObjectResizing",false,false)}catch(Z){}}}}W.onBeforeExecCommand.add(R);W.onMouseDown.add(R)}W.onMouseUp.add(W.nodeChanged);W.onClick.add(W.nodeChanged);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.keyCode==46||a.keyCode==8||a.ctrlKey){W.nodeChanged()}});W.onReset.add(function(){W.setContent(W.startContent,{format:"raw"})});if(W.getParam("tab_focus")){function Y(Z,a){if(a.keyCode===9){return K.cancel(a)}}function U(b,h){var Z,c,g,d,a;function j(e){g=N.getParent(b.id,"form");d=g.elements;if(g){J(d,function(k,f){if(k.id==b.id){Z=f;return false}});if(e>0){for(c=Z+1;c<d.length;c++){if(d[c].type!="hidden"){return d[c]}}}else{for(c=Z-1;c>=0;c--){if(d[c].type!="hidden"){return d[c]}}}}return null}if(h.keyCode===9){a=G(b.getParam("tab_focus"));if(a.length==1){a[1]=a[0];a[0]=":prev"}if(h.shiftKey){if(a[0]==":prev"){d=j(-1)}else{d=N.get(a[0])}}else{if(a[1]==":next"){d=j(1)}else{d=N.get(a[1])}}if(d){if(b=I.get(d.id||d.name)){b.focus()}else{window.setTimeout(function(){window.focus();d.focus()},10)}return K.cancel(h)}}}W.onKeyUp.add(Y);if(A){W.onKeyPress.add(U);W.onKeyDown.add(Y)}else{W.onKeyDown.add(U)}}if(X.custom_shortcuts){if(X.custom_undo_redo_keyboard_shortcuts){W.addShortcut("ctrl+z",W.getLang("undo_desc"),"Undo");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(Q=1;Q<=6;Q++){W.addShortcut("ctrl+"+Q,"",["FormatBlock",false,"<h"+Q+">"])}W.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);W.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);W.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function S(a){var Z=null;if(!a.altKey&&!a.ctrlKey&&!a.metaKey){return Z}J(W.shortcuts,function(b){if(b.ctrl!=a.ctrlKey&&(!tinymce.isMac||b.ctrl==a.metaKey)){return }if(b.alt!=a.altKey){return }if(b.shift!=a.shiftKey){return }if(a.keyCode==b.keyCode||(a.charCode&&a.charCode==b.charCode)){Z=b;return false}});return Z}W.onKeyUp.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyPress.add(function(Z,a){var b=S(a);if(b){return K.cancel(a)}});W.onKeyDown.add(function(Z,a){var b=S(a);if(b){b.func.call(b.scope);return K.cancel(a)}})}if(tinymce.isIE){K.add(W.getDoc(),"controlselect",function(b){var a=W.resizeInfo,Z;b=b.target;if(b.nodeName!=="IMG"){return }if(a){K.remove(a.node,a.ev,a.cb)}if(!W.dom.hasClass(b,"mceItemNoResize")){ev="resizeend";Z=K.add(b,ev,function(d){var c;d=d.target;if(c=W.dom.getStyle(d,"width")){W.dom.setAttrib(d,"width",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"width","")}if(c=W.dom.getStyle(d,"height")){W.dom.setAttrib(d,"height",c.replace(/[^0-9%]+/g,""));W.dom.setStyle(d,"height","")}})}else{ev="resizestart";Z=K.add(b,"resizestart",K.cancel,K)}a=W.resizeInfo={node:b,ev:ev,cb:Z}});W.onKeyDown.add(function(Z,a){switch(a.keyCode){case 8:if(W.selection.getRng().item){W.selection.getRng().item(0).removeNode();return K.cancel(a)}}})}if(tinymce.isOpera){W.onClick.add(function(Z,a){K.prevent(a)})}if(X.custom_undo_redo){function V(){W.undoManager.typing=0;W.undoManager.add()}if(tinymce.isIE){K.add(W.getWin(),"blur",function(Z){var a;if(W.selection){a=W.selection.getNode();if(!W.removed&&a.ownerDocument&&a.ownerDocument!=W.getDoc()){V()}}})}else{K.add(W.getDoc(),"blur",function(){if(W.selection&&!W.removed){V()}})}W.onMouseDown.add(V);W.onKeyUp.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45||a.ctrlKey){W.undoManager.typing=0;W.undoManager.add()}});W.onKeyDown.add(function(Z,a){if((a.keyCode>=33&&a.keyCode<=36)||(a.keyCode>=37&&a.keyCode<=40)||a.keyCode==13||a.keyCode==45){if(W.undoManager.typing){W.undoManager.add();W.undoManager.typing=0}return }if(!W.undoManager.typing){W.undoManager.add();W.undoManager.typing=1}})}},_convertInlineElements:function(){var V=this,X=V.settings,Q=V.dom,U,S,R,W,P;function T(Y,Z){if(!X.inline_styles){return }if(Z.get){J(V.dom.select("table,u,strike",Z.node),function(a){switch(a.nodeName){case"TABLE":if(U=Q.getAttrib(a,"height")){Q.setStyle(a,"height",U);Q.setAttrib(a,"height","")}break;case"U":case"STRIKE":a.style.textDecoration=a.nodeName=="U"?"underline":"line-through";Q.setAttrib(a,"mce_style","");Q.setAttrib(a,"mce_name","span");break}})}else{if(Z.set){J(V.dom.select("table,span",Z.node).reverse(),function(a){if(a.nodeName=="TABLE"){if(U=Q.getStyle(a,"height")){Q.setAttrib(a,"height",U.replace(/[^0-9%]+/g,""))}}else{if(a.style.textDecoration=="underline"){R="u"}else{if(a.style.textDecoration=="line-through"){R="strike"}else{R=""}}if(R){a.style.textDecoration="";Q.setAttrib(a,"mce_style","");S=Q.create(R,{style:Q.getAttrib(a,"style")});Q.replace(S,a,1)}}})}}}V.onPreProcess.add(T);if(!X.cleanup_on_startup){V.onSetContent.add(function(Y,Z){if(Z.initial){T(V,{node:V.getBody(),set:1})}})}},_convertFonts:function(){var U=this,V=U.settings,W=U.dom,T,Q,P,S;if(!V.inline_styles){return }T=[8,10,12,14,18,24,36];Q=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(P=V.font_size_style_values){P=G(P)}if(S=V.font_size_classes){S=G(S)}function R(d){var e,c,Y,X,b,Z,a;if(tinymce.isWebKit||!V.inline_styles){return }Y=U.dom.select("span",d);for(X=Y.length-1;X>=0;X--){e=Y[X];c=W.create("font",{color:W.toHex(W.getStyle(e,"color")),face:W.getStyle(e,"fontFamily"),style:W.getAttrib(e,"style"),"class":W.getAttrib(e,"class")});a=c.style;if(a.color||a.fontFamily){a.color=a.fontFamily="";W.setAttrib(c,"mce_style","")}if(P){b=O(P,W.getStyle(e,"fontSize"));if(b!=-1){W.setAttrib(c,"size",""+(b+1||1))}}else{if(S){b=O(S,W.getAttrib(e,"class"));Z=W.getStyle(e,"fontSize");if(b==-1&&Z.indexOf("pt")>0){b=O(T,parseInt(Z))}if(b==-1){b=O(Q,Z)}if(b!=-1){W.setAttrib(c,"size",""+(b+1||1));c.style.fontSize=""}}}if(c.color||c.face||c.size){c.style.fontFamily="";W.setAttrib(c,"mce_style","");W.replace(c,e,1)}c=e=null}}U.onSetContent.add(function(X,Y){R(X.getBody())});U.onPreProcess.add(function(Z,b){var c,a,Y,X;if(!V.inline_styles){return }if(b.get){Y=U.dom.select("font",b.node);for(X=Y.length-1;X>=0;X--){c=Y[X];a=W.create("span",{style:W.getAttrib(c,"style"),"class":W.getAttrib(c,"class")});W.setStyles(a,{fontFamily:W.getAttrib(c,"face"),color:W.getAttrib(c,"color"),backgroundColor:c.style.backgroundColor});if(c.size){if(P){W.setStyle(a,"fontSize",P[parseInt(c.size)-1])}else{W.setAttrib(a,"class",S[parseInt(c.size)-1])}}W.setAttrib(a,"mce_style","");W.replace(a,c,1)}}})},_isHidden:function(){var P;if(!A){return 0}P=this.selection.getSel();return(!P||!P.rangeCount||P.rangeCount==0)},_fixNesting:function(Q){var R=[],P;Q=Q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(T,S,V){var U;if(S==="/"){if(!R.length){return""}if(V!==R[R.length-1].tag){for(P=R.length-1;P>=0;P--){if(R[P].tag===V){R[P].close=1;break}}return""}else{R.pop();if(R.length&&R[R.length-1].close){T=T+"</"+R[R.length-1].tag+">";R.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(V)){return T}if(/\/>$/.test(T)){return T}R.push({tag:V})}return T});for(P=R.length-1;P>=0;P--){Q+="</"+R[P].tag+">"}return Q}})})();(function(){var E=tinymce.each,C=tinymce.isIE,A=tinymce.isGecko,B=tinymce.isOpera,D=tinymce.isWebKit;tinymce.create("tinymce.EditorCommands",{EditorCommands:function(F){this.editor=F},execCommand:function(K,J,L){var H=this,F=H.editor,I;switch(K){case"Cut":case"Copy":case"Paste":try{F.getDoc().execCommand(K,J,L)}catch(G){if(A){F.windowManager.confirm(F.getLang("clipboard_msg"),function(M){if(M){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","mceExternal")}})}else{F.windowManager.alert(F.getLang("clipboard_no_support"))}}return true;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;case"mceEndUndoLevel":case"mceAddUndoLevel":F.undoManager.add();return true;default:I=this[K];if(I){I.call(this,J,L);return true}}return false},Indent:function(){var F=this.editor,K=F.dom,I=F.selection,J,G,H;G=F.settings.indentation;H=/[a-z%]+$/i.exec(G);G=parseInt(G);if(F.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(L){K.setStyle(L,"paddingLeft",(parseInt(L.style.paddingLeft||0)+G)+H)});return }F.getDoc().execCommand("Indent",false,null);if(C){K.getParent(I.getNode(),function(L){if(L.nodeName=="BLOCKQUOTE"){L.dir=L.style.cssText=""}})}},Outdent:function(){var G=this.editor,L=G.dom,J=G.selection,K,F,H,I;H=G.settings.indentation;I=/[a-z%]+$/i.exec(H);H=parseInt(H);if(G.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){E(this._getSelectedBlocks(),function(M){F=Math.max(0,parseInt(M.style.paddingLeft||0)-H);L.setStyle(M,"paddingLeft",F?F+I:"")});return }G.getDoc().execCommand("Outdent",false,null)},mceSetAttribute:function(H,G){var F=this.editor,J=F.dom,I;if(I=J.getParent(F.selection.getNode(),J.isBlock)){J.setAttrib(I,G.name,G.value)}},mceSetContent:function(G,F){this.editor.setContent(F)},mceToggleVisualAid:function(){var F=this.editor;F.hasVisual=!F.hasVisual;F.addVisual()},mceReplaceContent:function(G,F){var H=this.editor.selection;H.setContent(F.replace(/\{\$selection\}/g,H.getContent({format:"text"})))},mceInsertLink:function(H,G){var F=this.editor,I=F.selection,J=F.dom.getParent(I.getNode(),"A");if(tinymce.is(G,"string")){G={href:G}}function K(L){E(G,function(N,M){F.dom.setAttrib(L,M,N)})}if(!J){F.execCommand("CreateLink",false,"javascript:mctmp(0);");E(F.dom.select("a"),function(L){if(L.href=="javascript:mctmp(0);"){K(L)}})}else{if(G.href){K(J)}else{F.dom.remove(J,1)}}},UnLink:function(){var F=this.editor,G=F.selection;if(G.isCollapsed()){G.select(G.getNode())}F.getDoc().execCommand("unlink",false,null);G.collapse(0)},FontName:function(H,G){var I=this,F=I.editor,J=F.selection,K;if(!G){if(J.isCollapsed()){J.select(J.getNode())}I.RemoveFormat()}else{F.getDoc().execCommand("FontName",false,G)}},FontSize:function(I,H){var G=this.editor,L=G.settings,J=tinymce.explode(L.font_size_style_values),F=tinymce.explode(L.font_size_classes),K,M;E(G.dom.select("font"),function(N){N.style.fontSize=""});G.getDoc().execCommand("FontSize",false,H);if(L.inline_styles){E(G.dom.select("font"),function(N){if(!N.size||N.parentNode.nodeName=="FONT"&&N.size==N.parentNode.size){if(!M){M=G.selection.getBookmark()}G.dom.remove(N,1);return }if(H=N.size){if(F&&F.length>0){G.dom.setAttrib(N,"class",F[parseInt(H)-1])}else{G.dom.setStyle(N,"fontSize",J[parseInt(H)-1])}}})}G.selection.moveToBookmark(M)},queryCommandValue:function(G){var F=this["queryValue"+G];if(F){return F.call(this,G)}return false},queryCommandState:function(G){var F;switch(G){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(G,G.substring(7).toLowerCase());default:if(F=this["queryState"+G]){return F.call(this,G)}}return -1},_queryState:function(G){try{return this.editor.getDoc().queryCommandState(G)}catch(F){}},_queryVal:function(G){try{return this.editor.getDoc().queryCommandValue(G)}catch(F){}},queryValueFontSize:function(){var G=this.editor,F=0,H;if(B||D){if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.size}return F}return this._queryVal("FontSize")},queryValueFontName:function(){var G=this.editor,F=0,H;if(H=G.dom.getParent(G.selection.getNode(),"FONT")){F=H.face}if(!F){F=this._queryVal("FontName")}return F},mceJustify:function(M,N){var J=this.editor,L=J.selection,F=L.getNode(),O=F.nodeName,G,I,H=J.dom,K;if(J.settings.inline_styles&&this.queryStateJustify(M,N)){K=1}G=H.getParent(F,J.dom.isBlock);if(O=="IMG"){if(N=="full"){return }if(K){if(N=="center"){H.setStyle(F.parentNode,"textAlign","")}H.setStyle(F,"float","");this.mceRepaint();return }if(N=="center"){if(/^(TD|TH)$/.test(G.nodeName)){G=0}if(!G||G.childNodes.length>1){I=H.create("p");I.appendChild(F.cloneNode(false));if(G){H.insertAfter(I,G)}else{H.insertAfter(I,F)}H.remove(F);F=I.firstChild;G=I}H.setStyle(G,"textAlign",N);H.setStyle(F,"float","")}else{H.setStyle(F,"float",N);H.setStyle(F.parentNode,"textAlign","")}this.mceRepaint();return }if(J.settings.inline_styles&&J.settings.forced_root_block){if(K){N=""}E(this._getSelectedBlocks(H.getParent(L.getStart(),H.isBlock),H.getParent(L.getEnd(),H.isBlock)),function(P){H.setAttrib(P,"align","");H.setStyle(P,"textAlign",N=="full"?"justify":N)});return }else{if(!K){J.getDoc().execCommand(M,false,null)}}if(J.settings.inline_styles){if(K){H.getParent(J.selection.getNode(),function(P){if(P.style&&P.style.textAlign){H.setStyle(P,"textAlign","")}});return }E(H.select("*"),function(Q){var P=Q.align;if(P){if(P=="full"){P="justify"}H.setStyle(Q,"textAlign",P);H.setAttrib(Q,"align","")}})}},mceSetCSSClass:function(G,F){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:F})},getSelectedElement:function(){var T=this,N=T.editor,M=N.dom,Q=N.selection,G=Q.getRng(),K,J,R,O,I,F,P,H,U,S;if(Q.isCollapsed()||G.item){return Q.getNode()}S=N.settings.merge_styles_invalid_parents;if(tinymce.is(S,"string")){S=new RegExp(S,"i")}if(C){K=G.duplicate();K.collapse(true);R=K.parentElement();J=G.duplicate();J.collapse(false);O=J.parentElement();if(R!=O){K.move("character",1);R=K.parentElement()}if(R==O){K=G.duplicate();K.moveToElementText(R);if(K.compareEndPoints("StartToStart",G)==0&&K.compareEndPoints("EndToEnd",G)==0){return S&&S.test(R.nodeName)?null:R}}}else{function L(V){return M.getParent(V,function(W){return W.nodeType==1})}R=G.startContainer;O=G.endContainer;I=G.startOffset;F=G.endOffset;if(!G.collapsed){if(R==O){if(I-F<2){if(R.hasChildNodes()){H=R.childNodes[I];return S&&S.test(H.nodeName)?null:H}}}}if(R.nodeType!=3||O.nodeType!=3){return null}if(I==0){H=L(R);if(H&&H.firstChild!=R){H=null}}if(I==R.nodeValue.length){P=R.nextSibling;if(P&&P.nodeType==1){H=R.nextSibling}}if(F==0){P=O.previousSibling;if(P&&P.nodeType==1){U=P}}if(F==O.nodeValue.length){U=L(O);if(U&&U.lastChild!=O){U=null}}if(H==U){return S&&H&&S.test(H.nodeName)?null:H}}return null},InsertHorizontalRule:function(){if(A||C){this.editor.selection.setContent("<hr />")}else{this.editor.getDoc().execCommand("InsertHorizontalRule",false,"")}},RemoveFormat:function(){var H=this,G=H.editor,I=G.selection,F;if(D){I.setContent(I.getContent({format:"raw"}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,""),{format:"raw"})}else{G.getDoc().execCommand("RemoveFormat",false,null)}H.mceSetStyleInfo(0,{command:"removeformat"});G.addVisual()},mceSetStyleInfo:function(M,L){var P=this,G=P.editor,I=G.getDoc(),F=G.dom,H,J,Q=G.selection,O=L.wrapper||"span",J=Q.getBookmark(),N;function K(S,R){if(S.nodeType==1){switch(L.command){case"setattrib":return F.setAttrib(S,L.name,L.value);case"setstyle":return F.setStyle(S,L.name,L.value);case"removeformat":return F.setAttrib(S,"class","")}}}N=G.settings.merge_styles_invalid_parents;if(tinymce.is(N,"string")){N=new RegExp(N,"i")}if(H=P.getSelectedElement()){K(H,1)}else{I.execCommand("FontName",false,"__");E(D?F.select("span"):F.select("font"),function(T){var R,S;if(F.getAttrib(T,"face")=="__"||T.style.fontFamily==="__"){R=F.create(O,{mce_new:"1"});K(R);E(T.childNodes,function(U){R.appendChild(U.cloneNode(true))});F.replace(R,T)}})}E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!F.getAttrib(S,"mce_new")){R=F.getParent(S,function(T){return T.nodeType==1&&F.getAttrib(T,"mce_new")});if(R){F.remove(S,1)}}});E(F.select(O).reverse(),function(S){var R=S.parentNode;if(!R||!F.getAttrib(S,"mce_new")){return }if(R.nodeName==O.toUpperCase()&&R.childNodes.length==1){return F.remove(R,1)}if(S.nodeType==1&&(!N||!N.test(R.nodeName))&&R.childNodes.length==1){K(R);F.setAttrib(S,"class","")}});E(F.select(O).reverse(),function(R){if(F.getAttrib(R,"mce_new")||(F.getAttribs(R).length<=1&&R.className==="")){if(!F.getAttrib(R,"class")&&!F.getAttrib(R,"style")){return F.remove(R,1)}F.setAttrib(R,"mce_new","")}});Q.moveToBookmark(J)},queryStateJustify:function(J,G){var F=this.editor,I=F.selection.getNode(),H=F.dom;if(I&&I.nodeName=="IMG"){if(H.getStyle(I,"float")==G){return 1}return I.parentNode.style.textAlign==G}I=H.getParent(F.selection.getStart(),function(K){return K.nodeType==1&&K.style.textAlign});if(G=="full"){G="justify"}if(F.settings.inline_styles){return(I&&I.style.textAlign==G)}return this._queryState(J)},HiliteColor:function(H,J){var G=this,F=G.editor,I=F.getDoc();function K(M){if(!A){return }try{I.execCommand("styleWithCSS",0,M)}catch(L){I.execCommand("useCSS",0,!M)}}if(A||B){K(true);I.execCommand("hilitecolor",false,J);K(false)}else{I.execCommand("BackColor",false,J)}},Undo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.undo();F.nodeChanged()}else{F.getDoc().execCommand("Undo",false,null)}},Redo:function(){var F=this.editor;if(F.settings.custom_undo_redo){F.undoManager.redo();F.nodeChanged()}else{F.getDoc().execCommand("Redo",false,null)}},FormatBlock:function(M,G){var N=this,K=N.editor,O=K.selection,I=K.dom,F,J,L;function H(P){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(P.nodeName)}F=I.getParent(O.getNode(),function(P){return H(P)});if(F){if((C&&H(F.parentNode))||F.nodeName=="DIV"){J=K.dom.create(G);E(I.getAttribs(F),function(P){I.setAttrib(J,P.nodeName,I.getAttrib(F,P.nodeName))});L=O.getBookmark();I.replace(J,F,1);O.moveToBookmark(L);K.nodeChanged();return }}G=K.settings.forced_root_block?(G||"<p>"):G;if(G.indexOf("<")==-1){G="<"+G+">"}if(tinymce.isGecko){G=G.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}K.getDoc().execCommand("FormatBlock",false,G)},mceCleanup:function(){var G=this.editor,H=G.selection,F=H.getBookmark();G.setContent(G.getContent());H.moveToBookmark(F)},mceRemoveNode:function(I,J){var G=this.editor,H=G.selection,F,K=J||H.getNode();if(K==G.getBody()){return }F=H.getBookmark();G.dom.remove(K,1);H.moveToBookmark(F);G.nodeChanged()},mceSelectNodeDepth:function(H,I){var F=this.editor,G=F.selection,J=0;F.dom.getParent(G.getNode(),function(K){if(K.nodeType==1&&J++==I){G.select(K);F.nodeChanged();return false}},F.getBody())},mceSelectNode:function(G,F){this.editor.selection.select(F)},mceInsertContent:function(F,G){this.editor.selection.setContent(G)},mceInsertRawHTML:function(G,H){var F=this.editor;F.selection.setContent("tiny_mce_marker");F.setContent(F.getContent().replace(/tiny_mce_marker/g,H))},mceRepaint:function(){var H,F,I=this.editor;if(tinymce.isGecko){try{H=I.selection;F=H.getBookmark(true);if(H.getSel()){H.getSel().selectAllChildren(I.getBody())}H.collapse(true);H.moveToBookmark(F)}catch(G){}}},queryStateUnderline:function(){var F=this.editor,G=F.selection.getNode();if(G&&G.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var F=this.editor,G;if(F.settings.inline_styles){if((G=F.dom.getParent(F.selection.getStart(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}if((G=F.dom.getParent(F.selection.getEnd(),F.dom.isBlock))&&parseInt(G.style.paddingLeft)>0){return true}}else{return !!F.dom.getParent(F.selection.getNode(),"BLOCKQUOTE")}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()},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(F){return F.nodeName==="BLOCKQUOTE"})},mceBlockQuote:function(){var Q=this,M=Q.editor,S=M.selection,J=M.dom,O,N,I,H,R,G,P,L,F;function K(T){return J.getParent(T,function(U){return U.nodeName==="BLOCKQUOTE"})}O=J.getParent(S.getStart(),J.isBlock);N=J.getParent(S.getEnd(),J.isBlock);if(R=K(O)){if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}if(K(N)){P=R.cloneNode(false);while(I=N.nextSibling){P.appendChild(I.parentNode.removeChild(I))}}if(P){J.insertAfter(P,R)}F=Q._getSelectedBlocks(O,N);for(L=F.length-1;L>=0;L--){J.insertAfter(F[L],R)}if(/^\s*$/.test(R.innerHTML)){J.remove(R,1)}if(P&&/^\s*$/.test(P.innerHTML)){J.remove(P,1)}if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(0);if(J.getParent(S.getStart(),J.isBlock)!=O){G=S.getRng();G.move("character",-1);G.select()}}}else{Q.editor.selection.moveToBookmark(H)}return }if(C&&!O&&!N){Q.editor.getDoc().execCommand("Indent");I=K(S.getNode());I.style.margin=I.dir="";return }if(!O||!N){return }if(O!=N||O.childNodes.length>1||(O.childNodes.length==1&&O.firstChild.nodeName!="BR")){H=S.getBookmark()}E(Q._getSelectedBlocks(K(S.getStart()),K(S.getEnd())),function(T){if(T.nodeName=="BLOCKQUOTE"&&!R){R=T;return }if(!R){R=J.create("blockquote");T.parentNode.insertBefore(R,T)}if(T.nodeName=="BLOCKQUOTE"&&R){I=T.firstChild;while(I){R.appendChild(I.cloneNode(true));I=I.nextSibling}J.remove(T);return }R.appendChild(J.remove(T))});if(!H){if(!C){G=M.getDoc().createRange();G.setStart(O,0);G.setEnd(O,0);S.setRng(G)}else{S.select(O);S.collapse(1)}}else{S.moveToBookmark(H)}},_getSelectedBlocks:function(M,F){var J=this.editor,I=J.dom,N=J.selection,L,K,H,G=[];L=I.getParent(M||N.getStart(),I.isBlock);K=I.getParent(F||N.getEnd(),I.isBlock);if(L){G.push(L)}if(L&&K&&L!=K){H=L;while((H=H.nextSibling)&&H!=K){if(I.isBlock(H)){G.push(H)}}}if(K&&L!=K){G.push(K)}return G}})})();tinymce.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(B){var C=this,A=tinymce.util.Dispatcher;C.editor=B;C.data=[];C.onAdd=new A(this);C.onUndo=new A(this);C.onRedo=new A(this)},add:function(B){var E=this,D,C=E.editor,A,F=C.settings,G;B=B||{};B.content=B.content||C.getContent({format:"raw",no_events:1});B.content=B.content.replace(/^\s*|\s*$/g,"");G=E.data[E.index>0&&(E.index==0||E.index==E.data.length)?E.index-1:E.index];if(!B.initial&&G&&B.content==G.content){return null}if(F.custom_undo_redo_levels){if(E.data.length>F.custom_undo_redo_levels){for(D=0;D<E.data.length-1;D++){E.data[D]=E.data[D+1]}E.data.length--;E.index=E.data.length}}if(F.custom_undo_redo_restore_selection&&!B.initial){B.bookmark=A=B.bookmark||C.selection.getBookmark()}if(E.index<E.data.length){E.index++}if(E.data.length===0&&!B.initial){return null}E.data.length=E.index+1;E.data[E.index++]=B;if(B.initial){E.index=0}if(E.data.length==2&&E.data[0].initial){E.data[0].bookmark=A}E.onAdd.dispatch(E,B);C.isNotDirty=0;return B},undo:function(){var D=this,B=D.editor,A=A,C;if(D.typing){D.add();D.typing=0}if(D.index>0){if(D.index==D.data.length&&D.index>1){C=D.index;D.typing=0;if(!D.add()){D.index=C}--D.index}A=D.data[--D.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);D.onUndo.dispatch(D,A)}return A},redo:function(){var C=this,B=C.editor,A=null;if(C.index<C.data.length-1){A=C.data[++C.index];B.setContent(A.content,{format:"raw"});B.selection.moveToBookmark(A.bookmark);C.onRedo.dispatch(C,A)}return A},clear:function(){var A=this;A.data=[];A.index=0;A.typing=0;A.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}});(function(){var B,D,A,C,E,F;B=tinymce.dom.Event;D=tinymce.isIE;A=tinymce.isGecko;C=tinymce.isOpera;E=tinymce.each;F=tinymce.extend;tinymce.create("tinymce.ForceBlocks",{ForceBlocks:function(H){var I=this,J=H.settings,K;I.editor=H;I.dom=H.dom;K=(J.forced_root_block||"p").toLowerCase();J.element=K.toUpperCase();H.onPreInit.add(I.setup,I);I.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+K+">","gi");I.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,K),"gi");I.reNbsp2BR2=new RegExp("<p( )([^>]+)>(&nbsp;|&#160;)<\\/p>|<p>(&nbsp;|&#160;)<\\/p>".replace(/p/g,K),"gi");I.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");I.reTrailBr=new RegExp("\\s*<br \\/>\\s*<\\/p>".replace(/p/g,K),"gi");function G(L,M){if(C){M.content=M.content.replace(I.reOpera,"</"+K+">")}M.content=M.content.replace(I.rePadd,"<"+K+"$1$2$3$4$5$6>\u00a0</"+K+">");if(!D&&!C&&M.set){M.content=M.content.replace(I.reNbsp2BR1,"<"+K+"$1$2><br /></"+K+">");M.content=M.content.replace(I.reNbsp2BR2,"<"+K+"$1$2><br /></"+K+">")}else{M.content=M.content.replace(I.reBR2Nbsp,"<"+K+"$1$2>\u00a0</"+K+">");M.content=M.content.replace(I.reTrailBr,"</"+K+">")}}H.onBeforeSetContent.add(G);H.onPostProcess.add(G);if(J.forced_root_block){H.onInit.add(I.forceRoots,I);H.onSetContent.add(I.forceRoots,I);H.onBeforeGetContent.add(I.forceRoots,I)}},setup:function(){var H=this,G=H.editor,I=G.settings;if(I.forced_root_block){G.onKeyUp.add(H.forceRoots,H);G.onPreProcess.add(H.forceRoots,H)}if(I.force_br_newlines){if(D){G.onKeyPress.add(function(K,M){var N,L=K.selection;if(M.keyCode==13&&L.getNode().nodeName!="LI"){L.setContent('<br id="__" /> ',{format:"raw"});N=K.dom.get("__");N.removeAttribute("id");L.select(N);L.collapse();return B.cancel(M)}})}return }if(!D&&I.force_p_newlines){G.onKeyPress.add(function(K,L){if(L.keyCode==13&&!L.shiftKey){if(!H.insertPara(L)){B.cancel(L)}}});if(A){G.onKeyDown.add(function(K,L){if((L.keyCode==8||L.keyCode==46)&&!L.shiftKey){H.backspaceDelete(L,L.keyCode==8)}})}}function J(L,K){var M=G.dom.create(K);E(L.attributes,function(N){if(N.specified&&N.nodeValue){M.setAttribute(N.nodeName.toLowerCase(),N.nodeValue)}});E(L.childNodes,function(N){M.appendChild(N.cloneNode(true))});L.parentNode.replaceChild(M,L);return M}if(D&&I.element!="P"){G.onKeyPress.add(function(K,L){H.lastElm=K.selection.getNode().nodeName});G.onKeyUp.add(function(L,N){var P,M=L.selection,O=M.getNode(),K=L.getBody();if(K.childNodes.length===1&&O.nodeName=="P"){O=J(O,I.element);M.select(O);M.collapse();L.nodeChanged()}else{if(N.keyCode==13&&!N.shiftKey&&H.lastElm!="P"){P=L.dom.getParent(O,"P");if(P){J(P,I.element);L.nodeChanged()}}}})}},find:function(L,I,J){var H=this.editor,G=H.getDoc().createTreeWalker(L,4,null,false),K=-1;while(L=G.nextNode()){K++;if(I==0&&L==J){return K}if(I==1&&K==J){return L}}return -1},forceRoots:function(L,U){var M=this,L=M.editor,Y=L.getBody(),V=L.getDoc(),f=L.selection,N=f.getSel(),O=f.getRng(),Z=-2,K,S,G,H,W=-16777215;var X,I,a,R,P,J=Y.childNodes,Q;if(U&&U.keyCode==13){return true}for(Q=J.length-1;Q>=0;Q--){X=J[Q];if(X.nodeType==3||(!M.dom.isBlock(X)&&X.nodeType!=8)){if(!I){if(X.nodeType!=3||/[^\s]/g.test(X.nodeValue)){if(Z==-2&&O){if(!D){if(L.dom.getParent(O.startContainer,function(b){return b===Y})){S=O.startOffset;G=O.endOffset;Z=M.find(Y,0,O.startContainer);K=M.find(Y,0,O.endContainer)}}else{H=V.body.createTextRange();H.moveToElementText(Y);H.collapse(1);a=H.move("character",W)*-1;H=O.duplicate();H.collapse(1);R=H.move("character",W)*-1;H=O.duplicate();H.collapse(0);P=(H.move("character",W)*-1)-R;Z=R-a;K=P}}I=L.dom.create(L.settings.forced_root_block);I.appendChild(X.cloneNode(1));X.parentNode.replaceChild(I,X)}}else{if(I.hasChildNodes()){I.insertBefore(X,I.firstChild)}else{I.appendChild(X)}}}else{I=null}}if(Z!=-2){if(!D){I=Y.getElementsByTagName(L.settings.element)[0];O=V.createRange();if(Z!=-1){O.setStart(M.find(Y,1,Z),S)}else{O.setStart(I,0)}if(K!=-1){O.setEnd(M.find(Y,1,K),G)}else{O.setEnd(I,0)}if(N){N.removeAllRanges();N.addRange(O)}}else{try{O=N.createRange();O.moveToElementText(Y);O.collapse(1);O.moveStart("character",Z);O.moveEnd("character",K);O.select()}catch(T){}}}},getParentBlock:function(H){var G=this.dom;return G.getParent(H,G.isBlock)},insertPara:function(i){var S=this,L=S.editor,c=L.dom,j=L.getDoc(),o=L.settings,U=L.selection.getSel(),V=U.getRangeAt(0),m=j.body;var Y,Z,W,g,f,J,H,K,N,G,Q,k,I,M,X,a=c.getViewPort(L.getWin()),P,R;function T(b){b=b.innerHTML;b=b.replace(/<(img|hr|table)/gi,"-");b=b.replace(/<[^>]+>/g,"");return b.replace(/[ \t\r\n]+/g,"")==""}Y=j.createRange();Y.setStart(U.anchorNode,U.anchorOffset);Y.collapse(true);Z=j.createRange();Z.setStart(U.focusNode,U.focusOffset);Z.collapse(true);W=Y.compareBoundaryPoints(Y.START_TO_END,Z)<0;g=W?U.anchorNode:U.focusNode;f=W?U.anchorOffset:U.focusOffset;J=W?U.focusNode:U.anchorNode;H=W?U.focusOffset:U.anchorOffset;if(g===J&&/^(TD|TH)$/.test(g.nodeName)){c.remove(g.firstChild);L.dom.add(g,o.element,null,"<br />");k=L.dom.add(g,o.element,null,"<br />");V=j.createRange();V.selectNodeContents(k);V.collapse(1);L.selection.setRng(V);return false}if(g==m&&J==m&&m.firstChild&&L.dom.isBlock(m.firstChild)){g=J=g.firstChild;f=H=0;Y=j.createRange();Y.setStart(g,0);Z=j.createRange();Z.setStart(J,0)}g=g.nodeName=="HTML"?j.body:g;g=g.nodeName=="BODY"?g.firstChild:g;J=J.nodeName=="HTML"?j.body:J;J=J.nodeName=="BODY"?J.firstChild:J;K=S.getParentBlock(g);N=S.getParentBlock(J);G=K?K.nodeName:o.element;if(S.dom.getParent(K,function(b){return/OL|UL|PRE/.test(b.nodeName)})){return true}if(K&&(K.nodeName=="CAPTION"||/absolute|relative|static/gi.test(K.style.position))){G=o.element;K=null}if(N&&(N.nodeName=="CAPTION"||/absolute|relative|static/gi.test(N.style.position))){G=o.element;N=null}if(/(TD|TABLE|TH|CAPTION)/.test(G)||(K&&G=="DIV"&&/left|right/gi.test(K.style.cssFloat))){G=o.element;K=N=null}Q=(K&&K.nodeName==G)?K.cloneNode(0):L.dom.create(G);k=(N&&N.nodeName==G)?N.cloneNode(0):L.dom.create(G);k.removeAttribute("id");if(/^(H[1-6])$/.test(G)&&g.nodeValue&&f==g.nodeValue.length){k=L.dom.create(o.element)}X=I=g;do{if(X==m||X.nodeType==9||S.dom.isBlock(X)||/(TD|TABLE|TH|CAPTION)/.test(X.nodeName)){break}I=X}while((X=X.previousSibling?X.previousSibling:X.parentNode));X=M=J;do{if(X==m||X.nodeType==9||S.dom.isBlock(X)||/(TD|TABLE|TH|CAPTION)/.test(X.nodeName)){break}M=X}while((X=X.nextSibling?X.nextSibling:X.parentNode));if(I.nodeName==G){Y.setStart(I,0)}else{Y.setStartBefore(I)}Y.setEnd(g,f);Q.appendChild(Y.cloneContents()||j.createTextNode(""));try{Z.setEndAfter(M)}catch(h){}Z.setStart(J,H);k.appendChild(Z.cloneContents()||j.createTextNode(""));V=j.createRange();if(!I.previousSibling&&I.parentNode.nodeName==G){V.setStartBefore(I.parentNode)}else{if(Y.startContainer.nodeName==G&&Y.startOffset==0){V.setStartBefore(Y.startContainer)}else{V.setStart(Y.startContainer,Y.startOffset)}}if(!M.nextSibling&&M.parentNode.nodeName==G){V.setEndAfter(M.parentNode)}else{V.setEnd(Z.endContainer,Z.endOffset)}V.deleteContents();if(C){L.getWin().scrollTo(0,a.y)}if(Q.firstChild&&Q.firstChild.nodeName==G){Q.innerHTML=Q.firstChild.innerHTML}if(k.firstChild&&k.firstChild.nodeName==G){k.innerHTML=k.firstChild.innerHTML}if(T(Q)){Q.innerHTML="<br />"}if(T(k)){k.innerHTML=C?"&nbsp;":"<br />"}if(C){V.insertNode(Q);V.insertNode(k)}else{V.insertNode(k);V.insertNode(Q)}k.normalize();Q.normalize();function O(b){return j.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,false).nextNode()||b}V=j.createRange();V.selectNodeContents(A?O(k):k);V.collapse(1);U.removeAllRanges();U.addRange(V);P=L.dom.getPos(k).y;R=k.clientHeight;if(P<a.y||P+R>a.y+a.h){L.getWin().scrollTo(0,P<a.y?P:P-a.h+R)}return false},backspaceDelete:function(J,P){var R=this,I=R.editor,M=I.getBody(),H,K=I.selection,G=K.getRng(),L=G.startContainer,H,N,O;if(L&&I.dom.isBlock(L)&&!/^(TD|TH)$/.test(L.nodeName)&&P){if(L.childNodes.length==0||(L.childNodes.length==1&&L.firstChild.nodeName=="BR")){H=L;while((H=H.previousSibling)&&!I.dom.isBlock(H)){}if(H){if(L!=M.firstChild){N=I.dom.doc.createTreeWalker(H,NodeFilter.SHOW_TEXT,null,false);while(O=N.nextNode()){H=O}G=I.getDoc().createRange();G.setStart(H,H.nodeValue?H.nodeValue.length:0);G.setEnd(H,H.nodeValue?H.nodeValue.length:0);K.setRng(G);I.dom.remove(L)}return B.cancel(J)}}}function Q(S){S=S.target;if(S&&S.parentNode&&S.nodeName=="BR"&&(H=R.getParentBlock(S))){B.remove(M,"DOMNodeInserted",Q);if(S.previousSibling||S.nextSibling){I.dom.remove(S)}}}B._add(M,"DOMNodeInserted",Q);window.setTimeout(function(){B._remove(M,"DOMNodeInserted",Q)},1)}})})();(function(){var B=tinymce.DOM,A=tinymce.dom.Event,C=tinymce.each,D=tinymce.extend;tinymce.create("tinymce.ControlManager",{ControlManager:function(E,H){var G=this,F;H=H||{};G.editor=E;G.controls={};G.onAdd=new tinymce.util.Dispatcher(G);G.onPostRender=new tinymce.util.Dispatcher(G);G.prefix=H.prefix||E.id+"_";G._cls={};G.onPostRender.add(function(){C(G.controls,function(I){I.postRender()})})},get:function(E){return this.controls[this.prefix+E]||this.controls[E]},setActive:function(G,E){var F=null;if(F=this.get(G)){F.setActive(E)}return F},setDisabled:function(G,E){var F=null;if(F=this.get(G)){F.setDisabled(E)}return F},add:function(F){var E=this;if(F){E.controls[F.id]=F;E.onAdd.dispatch(F,E)}return F},createControl:function(H){var G,F=this,E=F.editor;C(E.plugins,function(I){if(I.createControl){G=I.createControl(H,F);if(G){return false}}});switch(H){case"|":case"separator":return F.createSeparator()}if(!G&&E.buttons&&(G=E.buttons[H])){return F.createButton(H,G)}return F.add(G)},createDropMenu:function(E,M,G){var L=this,H=L.editor,I,F,J,K;M=D({"class":"mceDropDown",constrain:H.settings.constrain_menus},M);M["class"]=M["class"]+" "+H.getParam("skin")+"Skin";if(J=H.getParam("skin_variant")){M["class"]+=" "+H.getParam("skin")+"Skin"+J.substring(0,1).toUpperCase()+J.substring(1)}E=L.prefix+E;K=G||L._cls.dropmenu||tinymce.ui.DropMenu;I=L.controls[E]=new K(E,M);I.onAddItem.add(function(P,O){var N=O.settings;N.title=H.getLang(N.title,N.title);if(!N.onclick){N.onclick=function(Q){H.execCommand(N.cmd,N.ui||false,N.value)}}});H.onRemove.add(function(){I.destroy()});if(tinymce.isIE){I.onShowMenu.add(function(){F=H.selection.getBookmark(1)});I.onHideMenu.add(function(){if(F){H.selection.moveToBookmark(F)}})}return L.add(I)},createListBox:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;if(F.settings.use_native_selects){J=new tinymce.ui.NativeListBox(L,H)}else{E=K||G._cls.listbox||tinymce.ui.ListBox;J=new E(L,H)}G.controls[L]=J;if(tinymce.isWebKit){J.onPostRender.add(function(N,M){A.add(M,"mousedown",function(){F.bookmark=F.selection.getBookmark("simple")});A.add(M,"focus",function(){F.selection.moveToBookmark(F.bookmark);F.bookmark=null})})}if(J.hideMenu){F.onMouseDown.add(J.hideMenu,J)}return G.add(J)},createButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.label=F.translate(H.label);H.scope=H.scope||F;if(!H.onclick&&!H.menu_button){H.onclick=function(){F.execCommand(H.cmd,H.ui||false,H.value)}}H=D({title:H.title,"class":"mce_"+L,unavailable_prefix:F.getLang("unavailable",""),scope:H.scope,control_manager:G},H);L=G.prefix+L;if(H.menu_button){E=K||G._cls.menubutton||tinymce.ui.MenuButton;J=new E(L,H);F.onMouseDown.add(J.hideMenu,J)}else{E=G._cls.button||tinymce.ui.Button;J=new E(L,H)}return G.add(J)},createMenuButton:function(F,E){E=E||{};E.menu_button=1;return this.createButton(F,E)},createSplitButton:function(L,H,K){var G=this,F=G.editor,I,J,E;if(G.get(L)){return null}H.title=F.translate(H.title);H.scope=H.scope||F;if(!H.onclick){H.onclick=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}if(!H.onselect){H.onselect=function(M){F.execCommand(H.cmd,H.ui||false,M||H.value)}}H=D({title:H.title,"class":"mce_"+L,scope:H.scope,control_manager:G},H);L=G.prefix+L;E=K||G._cls.splitbutton||tinymce.ui.SplitButton;J=G.add(new E(L,H));F.onMouseDown.add(J.hideMenu,J);return J},createColorSplitButton:function(E,M,G){var K=this,I=K.editor,H,J,L,F;if(K.get(E)){return null}M.title=I.translate(M.title);M.scope=M.scope||I;if(!M.onclick){M.onclick=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}if(!M.onselect){M.onselect=function(N){I.execCommand(M.cmd,M.ui||false,N||M.value)}}M=D({title:M.title,"class":"mce_"+E,menu_class:I.getParam("skin")+"Skin",scope:M.scope,more_colors_title:I.getLang("more_colors")},M);E=K.prefix+E;L=G||K._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;J=new L(E,M);I.onMouseDown.add(J.hideMenu,J);I.onRemove.add(function(){J.destroy()});if(tinymce.isIE){J.onShowMenu.add(function(){F=I.selection.getBookmark(1)});J.onHideMenu.add(function(){if(F){I.selection.moveToBookmark(F)}})}return K.add(J)},createToolbar:function(J,G,I){var H,F=this,E;J=F.prefix+J;E=I||F._cls.toolbar||tinymce.ui.Toolbar;H=new E(J,G);if(F.get(J)){return null}return F.add(H)},createSeparator:function(F){var E=F||this._cls.separator||tinymce.ui.Separator;return new E()},setControlType:function(F,E){return this._cls[F.toLowerCase()]=E},destroy:function(){C(this.controls,function(E){E.destroy()});this.controls=null}})})();(function(){var A=tinymce.util.Dispatcher,D=tinymce.each,C=tinymce.isIE,B=tinymce.isOpera;tinymce.create("tinymce.WindowManager",{WindowManager:function(E){var F=this;F.editor=E;F.onOpen=new A(F);F.onClose=new A(F);F.params={};F.features={}},open:function(Q,F){var P=this,I="",L,K,G=P.editor.settings.dialog_type=="modal",N,M,H,E=tinymce.DOM.getViewPort(),O;Q=Q||{};F=F||{};M=B?E.w:screen.width;H=B?E.h:screen.height;Q.name=Q.name||"mc_"+new Date().getTime();Q.width=parseInt(Q.width||320);Q.height=parseInt(Q.height||240);Q.resizable=true;Q.left=Q.left||parseInt(M/2)-(Q.width/2);Q.top=Q.top||parseInt(H/2)-(Q.height/2);F.inline=false;F.mce_width=Q.width;F.mce_height=Q.height;F.mce_auto_focus=Q.auto_focus;if(G){if(C){Q.center=true;Q.help=false;Q.dialogWidth=Q.width+"px";Q.dialogHeight=Q.height+"px";Q.scroll=Q.scrollbars||false}}D(Q,function(S,R){if(tinymce.is(S,"boolean")){S=S?"yes":"no"}if(!/^(name|url)$/.test(R)){if(C&&G){I+=(I?";":"")+R+":"+S}else{I+=(I?",":"")+R+"="+S}}});P.features=Q;P.params=F;P.onOpen.dispatch(P,Q,F);O=Q.url||Q.file;if(tinymce.relaxedDomain){O+=(O.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}O=tinymce._addVer(O);try{if(C&&G){N=1;window.showModalDialog(O,window,I)}else{N=window.open(O,Q.name,I)}}catch(J){}if(!N){alert(P.editor.getLang("popup_blocked"))}},close:function(E){E.close();this.onClose.dispatch(this)},createInstance:function(G,F,E,K,J,I){var H=tinymce.resolve(G);return new H(F,E,K,J,I)},confirm:function(F,E,G){E.call(G||this,confirm(this._decode(this.editor.getLang(F,F))))},alert:function(F,E,H){var G=this;alert(G._decode(G.editor.getLang(F,F)));if(E){E.call(H||G)}},_decode:function(E){return tinymce.DOM.decode(E).replace(/\\n/g,"\n")}})}());
\ No newline at end of file
index 09345eaac21d68650dd30c8503c8c0079881ab36..b4ebd24943c78a2b84facae3417d0f6bcb765537 100644 (file)
@@ -95,10 +95,12 @@ tinyMCEPopup = {
        },\r
 \r
        requireLangPack : function() {\r
-               var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');\r
+        var u = tinyMCE.settings['document_base_url'];\r
+        var p = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');\r
 \r
                if (u && this.editor.settings.language) {\r
-                       u += '/langs/' + this.editor.settings.language + '_dlg.js';\r
+            l = tinyMCE.settings['language'];\r
+            u += '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=1&context=' + p;\r
 \r
                        if (!tinymce.ScriptLoader.isDone(u)) {\r
                                document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');\r
index f44564f090d2ff06ddec9d924a30bf28602dc8f3..fcd92b9485b8c03afe5395f14a6af45b59585a15 100644 (file)
@@ -6028,7 +6028,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
                        var u, s;\r
 \r
                        if (tinymce.EditorManager.settings) {\r
-                               u = this.urls[n] + '/langs/' + tinymce.EditorManager.settings.language + '.js';\r
+                l = tinyMCE.settings['language'];\r
+                               u = tinyMCE.settings['document_base_url'] + '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=0&context=' + this.urls[n]; \r
                                s = tinymce.EditorManager.settings;\r
 \r
                                if (s) {\r
@@ -6133,8 +6134,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
                        // If page not loaded and strict mode isn't enabled then load them\r
                        if (!Event.domLoaded && !s.strict_loading_mode) {\r
                                // Load language\r
-                               if (s.language)\r
-                                       sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');\r
+                               if (s.language) {\r
+                    l = tinyMCE.settings['language'];\r
+                    sl.add(tinyMCE.settings['document_base_url'] + '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=0');\r
+                }\r
 \r
                                // Load theme\r
                                if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])\r
@@ -6640,8 +6643,10 @@ var tinyMCE = window.tinyMCE = tinymce.EditorManager;
 \r
                        // Load scripts\r
                        function loadScripts() {\r
-                               if (s.language)\r
-                                       sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');\r
+                               if (s.language) {\r
+                    l = tinyMCE.settings['language'];\r
+                    sl.add(tinyMCE.settings['document_base_url'] + '/lib/editor/tinymce/strings.php?lang='+l+'&dlg=0');\r
+                }\r
 \r
                                if (s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])\r
                                        ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');\r
@@ -10602,4 +10607,4 @@ tinymce.create('tinymce.UndoManager', {
                }\r
 \r
                });\r
-}());
\ No newline at end of file
+}());\r
index b45005ad4c891c1fbd21e75dca4fc44ad988e090..251c377b747caf2dffbdb52012a0c54bb176625e 100644 (file)
@@ -1,13 +1,13 @@
 <?php
+define('NO_MOODLE_COOKIES', true);
 
 require_once('../../../config.php');
 
 $contexturl = optional_param('context', null, PARAM_URL);
 $isdialog = optional_param('dlg', false, PARAM_BOOL);
+$lang = optional_param('lang', 'en_utf8', PARAM_ALPHANUMEXT);
+$SESSION->lang = $lang;
 
-error_log($contexturl, 0);
-
-$lang = substr(current_language(), 0, 2);
 $output = '';
 
 // get the keys from the reference english translations
@@ -57,7 +57,6 @@ if (!is_null($contexturl)) {
     } 
     $output .= "}}});";
 }
-
 $lifetime = '86400';
 @header('Content-type: text/javascript; charset=utf-8');
 @header('Content-length: '.strlen($output));