671. File Comparison Report

Produced on Mon May 12 13:06:35 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

671.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\plugins\tiny_mce tiny_mce.js Thu Sep 20 08:59:26 2007 UTC
2 Dolphin-v.6.1.0\plugins\tiny_mce tiny_mce.js Thu Mar 27 13:53:28 2008 UTC

671.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 1 2
Inserted 0 0
Removed 0 0

671.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

671.4 Active regular expressions

No regular expressions were active.

671.5 Comparison detail

1   function T inyMCE_Eng ine(){var  ua;this.ma jorVersion ="2";this. minorVersi on="1.1.1" ;this.rele aseDate="2 007-05-14" ;this.inst ances=[];t his.switch ClassCache =[];this.w indowArgs= [];this.lo adedFiles= [];this.pe ndingFiles =[];this.l oadingInde x=0;this.c onfigs=[]; this.curre ntConfig=0 ;this.even tHandlers= [];this.lo g=[];this. undoLevels =[];this.u ndoIndex=0 ;this.typi ngUndoInde x=-1;this. settings=[ ];ua=navig ator.userA gent;this. isMSIE=(na vigator.ap pName=="Mi crosoft In ternet Exp lorer");th is.isMSIE5 =this.isMS IE&&(ua.in dexOf('MSI E 5')!=-1) ;this.isMS IE5_0=this .isMSIE&&( ua.indexOf ('MSIE 5.0 ')!=-1);th is.isMSIE7 =this.isMS IE&&(ua.in dexOf('MSI E 7')!=-1) ;this.isGe cko=ua.ind exOf('Geck o')!=-1;th is.isSafar i=ua.index Of('Safari ')!=-1;thi s.isOpera= window['op era']&&ope ra.buildNu mber?true: false;this .isMac=ua. indexOf('M ac')!=-1;t his.isNS7= ua.indexOf ('Netscape /7')!=-1;t his.isNS71 =ua.indexO f('Netscap e/7.1')!=- 1;this.dia logCounter =0;this.pl ugins=[];t his.themes =[];this.m enus=[];th is.loadedP lugins=[]; this.butto nMap=[];th is.isLoade d=false;if (this.isOp era){this. isMSIE=tru e;this.isG ecko=false ;this.isSa fari=false }this.isIE =this.isMS IE;this.is RealIE=thi s.isMSIE&& !this.isOp era;this.i dCounter=0 };TinyMCE_ Engine.pro totype={in it:functio n(settings ){var them e,nl,baseH REF="",i,c ssPath,ent ities,h,p, src,elemen ts=[],head ;if(this.i sMSIE5_0)r eturn;this .settings= settings;i f(typeof(d ocument.ex ecCommand) =='undefin ed')return ;if(!tinyM CE.baseURL ){head=doc ument.getE lementsByT agName('he ad')[0];if (head){for (i=0,nl=he ad.getElem entsByTagN ame('scrip t');i<nl.l ength;i++) elements.p ush(nl[i]) }for(i=0,n l=document .getElemen tsByTagNam e('script' );i<nl.len gth;i++)el ements.pus h(nl[i]);n l=document .getElemen tsByTagNam e('base'); for(i=0;i< nl.length; i++){if(nl [i].href)b aseHREF=nl [i].href}f or(i=0;i<e lements.le ngth;i++){ if(element s[i].src&& (elements[ i].src.ind exOf("tiny _mce.js")! =-1||eleme nts[i].src .indexOf(" tiny_mce_d ev.js")!=- 1||element s[i].src.i ndexOf("ti ny_mce_src .js")!=-1| |elements[ i].src.ind exOf("tiny _mce_gzip" )!=-1)){sr c=elements [i].src;ti nyMCE.srcM ode=(src.i ndexOf('_s rc')!=-1|| src.indexO f('_dev')! =-1)?'_src ':'';tinyM CE.gzipMod e=src.inde xOf('_gzip ')!=-1;src =src.subst ring(0,src .lastIndex Of('/'));i f(settings .exec_mode =="src"||s ettings.ex ec_mode==" normal")ti nyMCE.srcM ode=settin gs.exec_mo de=="src"? '_src':''; if(baseHRE F!==''&&sr c.indexOf( '://')==-1 )tinyMCE.b aseURL=bas eHREF+src; else tinyM CE.baseURL =src;break }}}this.do cumentBase Path=docum ent.locati on.href;if (this.docu mentBasePa th.indexOf ('?')!=-1) this.docum entBasePat h=this.doc umentBaseP ath.substr ing(0,this .documentB asePath.in dexOf('?') );this.doc umentURL=t his.docume ntBasePath ;this.docu mentBasePa th=this.do cumentBase Path.subst ring(0,thi s.document BasePath.l astIndexOf ('/'));if( tinyMCE.ba seURL.inde xOf('://') ==-1&&tiny MCE.baseUR L.charAt(0 )!='/'){ti nyMCE.base URL=this.d ocumentBas ePath+"/"+ tinyMCE.ba seURL}this ._def("mod e","none") ;this._def ("theme"," advanced") ;this._def ("plugins" ,"",true); this._def( "language" ,"en");thi s._def("do cs_languag e",this.se ttings.lan guage);thi s._def("el ements","" );this._de f("textare a_trigger" ,"mce_edit able");thi s._def("ed itor_selec tor","");t his._def(" editor_des elector"," mceNoEdito r");this._ def("valid _elements" ,"+a[id|st yle|rel|re v|charset| hreflang|d ir|lang|ta bindex|acc esskey|typ e|name|hre f|target|t itle|class |onfocus|o nblur|oncl ick|ondblc lick|onmou sedown|onm ouseup|onm ouseover|o nmousemove |onmouseou t|onkeypre ss|onkeydo wn|onkeyup ],-strong/ -b[class|s tyle],-em/ -i[class|s tyle],-str ike[class| style],-u[ class|styl e],#p[id|s tyle|dir|c lass|align ],-ol[clas s|style],- ul[class|s tyle],-li[ class|styl e],br,img[ id|dir|lan g|longdesc |usemap|st yle|class| src|onmous eover|onmo useout|bor der|alt=|t itle|hspac e|vspace|w idth|heigh t|align],- sub[style| class],-su p[style|cl ass],-bloc kquote[dir |style],-t able[borde r=0|cellsp acing|cell padding|wi dth|height |class|ali gn|summary |style|dir |id|lang|b gcolor|bac kground|bo rdercolor] ,-tr[id|la ng|dir|cla ss|rowspan |width|hei ght|align| valign|sty le|bgcolor |backgroun d|borderco lor],tbody [id|class] ,thead[id| class],tfo ot[id|clas s],#td[id| lang|dir|c lass|colsp an|rowspan |width|hei ght|align| valign|sty le|bgcolor |backgroun d|borderco lor|scope] ,-th[id|la ng|dir|cla ss|colspan |rowspan|w idth|heigh t|align|va lign|style |scope],ca ption[id|l ang|dir|cl ass|style] ,-div[id|d ir|class|a lign|style ],-span[st yle|class| align],-pr e[class|al ign|style] ,address[c lass|align |style],-h 1[id|style |dir|class |align],-h 2[id|style |dir|class |align],-h 3[id|style |dir|class |align],-h 4[id|style |dir|class |align],-h 5[id|style |dir|class |align],-h 6[id|style |dir|class |align],hr [class|sty le],-font[ face|size| style|id|c lass|dir|c olor],dd[i d|class|ti tle|style| dir|lang], dl[id|clas s|title|st yle|dir|la ng],dt[id| class|titl e|style|di r|lang],ci te[title|i d|class|st yle|dir|la ng],abbr[t itle|id|cl ass|style| dir|lang], acronym[ti tle|id|cla ss|style|d ir|lang],d el[title|i d|class|st yle|dir|la ng|datetim e|cite],in s[title|id |class|sty le|dir|lan g|datetime |cite]");t his._def(" extended_v alid_eleme nts","");t his._def(" invalid_el ements","" );this._de f("encodin g","");thi s._def("ur lconverter _callback" ,tinyMCE.g etParam("u rlconverto r_callback ","TinyMCE _Engine.pr ototype.co nvertURL") );this._de f("save_ca llback","" );this._de f("force_b r_newlines ",false);t his._def(" force_p_ne wlines",tr ue);this._ def("add_f orm_submit _trigger", true);this ._def("rel ative_urls ",true);th is._def("r emove_scri pt_host",t rue);this. _def("focu s_alert",t rue);this. _def("docu ment_base_ url",this. documentUR L);this._d ef("visual ",true);th is._def("v isual_tabl e_class"," mceVisualA id");this. _def("setu pcontent_c allback"," ");this._d ef("fix_co ntent_dupl ication",t rue);this. _def("cust om_undo_re do",true); this._def( "custom_un do_redo_le vels",-1); this._def( "custom_un do_redo_ke yboard_sho rtcuts",tr ue);this._ def("custo m_undo_red o_restore_ selection" ,true);thi s._def("cu stom_undo_ redo_globa l",false); this._def( "verify_ht ml",true); this._def( "apply_sou rce_format ting",fals e);this._d ef("direct ionality", "ltr");thi s._def("cl eanup_on_s tartup",fa lse);this. _def("inli ne_styles" ,false);th is._def("c onvert_new lines_to_b rs",false) ;this._def ("auto_res et_designm ode",true) ;this._def ("entities ","39,#39, 160,nbsp,1 61,iexcl,1 62,cent,16 3,pound,16 4,curren,1 65,yen,166 ,brvbar,16 7,sect,168 ,uml,169,c opy,170,or df,171,laq uo,172,not ,173,shy,1 74,reg,175 ,macr,176, deg,177,pl usmn,178,s up2,179,su p3,180,acu te,181,mic ro,182,par a,183,midd ot,184,ced il,185,sup 1,186,ordm ,187,raquo ,188,frac1 4,189,frac 12,190,fra c34,191,iq uest,192,A grave,193, Aacute,194 ,Acirc,195 ,Atilde,19 6,Auml,197 ,Aring,198 ,AElig,199 ,Ccedil,20 0,Egrave,2 01,Eacute, 202,Ecirc, 203,Euml,2 04,Igrave, 205,Iacute ,206,Icirc ,207,Iuml, 208,ETH,20 9,Ntilde,2 10,Ograve, 211,Oacute ,212,Ocirc ,213,Otild e,214,Ouml ,215,times ,216,Oslas h,217,Ugra ve,218,Uac ute,219,Uc irc,220,Uu ml,221,Yac ute,222,TH ORN,223,sz lig,224,ag rave,225,a acute,226, acirc,227, atilde,228 ,auml,229, aring,230, aelig,231, ccedil,232 ,egrave,23 3,eacute,2 34,ecirc,2 35,euml,23 6,igrave,2 37,iacute, 238,icirc, 239,iuml,2 40,eth,241 ,ntilde,24 2,ograve,2 43,oacute, 244,ocirc, 245,otilde ,246,ouml, 247,divide ,248,oslas h,249,ugra ve,250,uac ute,251,uc irc,252,uu ml,253,yac ute,254,th orn,255,yu ml,402,fno f,913,Alph a,914,Beta ,915,Gamma ,916,Delta ,917,Epsil on,918,Zet a,919,Eta, 920,Theta, 921,Iota,9 22,Kappa,9 23,Lambda, 924,Mu,925 ,Nu,926,Xi ,927,Omicr on,928,Pi, 929,Rho,93 1,Sigma,93 2,Tau,933, Upsilon,93 4,Phi,935, Chi,936,Ps i,937,Omeg a,945,alph a,946,beta ,947,gamma ,948,delta ,949,epsil on,950,zet a,951,eta, 952,theta, 953,iota,9 54,kappa,9 55,lambda, 956,mu,957 ,nu,958,xi ,959,omicr on,960,pi, 961,rho,96 2,sigmaf,9 63,sigma,9 64,tau,965 ,upsilon,9 66,phi,967 ,chi,968,p si,969,ome ga,977,the tasym,978, upsih,982, piv,8226,b ull,8230,h ellip,8242 ,prime,824 3,Prime,82 54,oline,8 260,frasl, 8472,weier p,8465,ima ge,8476,re al,8482,tr ade,8501,a lefsym,859 2,larr,859 3,uarr,859 4,rarr,859 5,darr,859 6,harr,862 9,crarr,86 56,lArr,86 57,uArr,86 58,rArr,86 59,dArr,86 60,hArr,87 04,forall, 8706,part, 8707,exist ,8709,empt y,8711,nab la,8712,is in,8713,no tin,8715,n i,8719,pro d,8721,sum ,8722,minu s,8727,low ast,8730,r adic,8733, prop,8734, infin,8736 ,ang,8743, and,8744,o r,8745,cap ,8746,cup, 8747,int,8 756,there4 ,8764,sim, 8773,cong, 8776,asymp ,8800,ne,8 801,equiv, 8804,le,88 05,ge,8834 ,sub,8835, sup,8836,n sub,8838,s ube,8839,s upe,8853,o plus,8855, otimes,886 9,perp,890 1,sdot,896 8,lceil,89 69,rceil,8 970,lfloor ,8971,rflo or,9001,la ng,9002,ra ng,9674,lo z,9824,spa des,9827,c lubs,9829, hearts,983 0,diams,34 ,quot,38,a mp,60,lt,6 2,gt,338,O Elig,339,o elig,352,S caron,353, scaron,376 ,Yuml,710, circ,732,t ilde,8194, ensp,8195, emsp,8201, thinsp,820 4,zwnj,820 5,zwj,8206 ,lrm,8207, rlm,8211,n dash,8212, mdash,8216 ,lsquo,821 7,rsquo,82 18,sbquo,8 220,ldquo, 8221,rdquo ,8222,bdqu o,8224,dag ger,8225,D agger,8240 ,permil,82 49,lsaquo, 8250,rsaqu o,8364,eur o",true);t his._def(" entity_enc oding","na med");this ._def("cle anup_callb ack","");t his._def(" add_unload _trigger", true);this ._def("ask ",false);t his._def(" nowrap",fa lse);this. _def("auto _resize",f alse);this ._def("aut o_focus",f alse);this ._def("cle anup",true );this._de f("remove_ linebreaks ",true);th is._def("b utton_tile _map",fals e);this._d ef("submit _patch",tr ue);this._ def("brows ers","msie ,safari,ge cko,opera" ,true);thi s._def("di alog_type" ,"window") ;this._def ("accessib ility_warn ings",true );this._de f("accessi bility_foc us",true); this._def( "merge_sty les_invali d_parents" ,"");this. _def("forc e_hex_styl e_colors", true);this ._def("tri m_span_ele ments",tru e);this._d ef("conver t_fonts_to _spans",fa lse);this. _def("doct ype",'<!DO CTYPE html  PUBLIC "- //W3C//DTD  HTML 4.0  Transition al//EN">') ;this._def ("font_siz e_classes" ,'');this. _def("font _size_styl e_values", 'xx-small, x-small,sm all,medium ,large,x-l arge,xx-la rge',true) ;this._def ("event_el ements",'a ,img',true );this._de f("convert _urls",tru e);this._d ef("table_ inline_edi ting",fals e);this._d ef("object _resizing" ,true);thi s._def("cu stom_short cuts",true );this._de f("convert _on_click" ,false);th is._def("c ontent_css ",'');this ._def("fix _list_elem ents",true );this._de f("fix_tab le_element s",false); this._def( "strict_lo ading_mode ",document .contentTy pe=='appli cation/xht ml+xml');t his._def(" hidden_tab _class",'' );this._de f("display _tab_class ",'');this ._def("gec ko_spellch eck",false );this._de f("hide_se lects_on_s ubmit",tru e);this._d ef("forced _root_bloc k",false); this._def( "remove_tr ailing_nbs p",false); if(this.is MSIE&&!thi s.isOpera) this.setti ngs.strict _loading_m ode=false; if(this.is MSIE&&this .settings. browsers.i ndexOf('ms ie')==-1)r eturn;if(t his.isGeck o&&this.se ttings.bro wsers.inde xOf('gecko ')==-1)ret urn;if(thi s.isSafari &&this.set tings.brow sers.index Of('safari ')==-1)ret urn;if(thi s.isOpera& &this.sett ings.brows ers.indexO f('opera') ==-1)retur n;baseHREF =tinyMCE.s ettings.do cument_bas e_url;h=do cument.loc ation.href ;p=h.index Of('://'); if(p>0&&do cument.loc ation.prot ocol!="fil e:"){p=h.i ndexOf('/' ,p+3);h=h. substring( 0,p);if(ba seHREF.ind exOf('://' )==-1)base HREF=h+bas eHREF;tiny MCE.settin gs.documen t_base_url =baseHREF; tinyMCE.se ttings.doc ument_base _prefix=h} if(baseHRE F.indexOf( '?')!=-1)b aseHREF=ba seHREF.sub string(0,b aseHREF.in dexOf('?') );this.set tings.base _href=base HREF.subst ring(0,bas eHREF.last IndexOf('/ '))+"/";th eme=this.s ettings.th eme;this.i nlineStric t='A|BR|SP AN|BDO|MAP |OBJECT|IM G|TT|I|B|B IG|SMALL|E M|STRONG|D FN|CODE|Q| SAMP|KBD|V AR|CITE|AB BR|ACRONYM |SUB|SUP|# text|#comm ent';this. inlineTran sitional=' A|BR|SPAN| BDO|OBJECT |APPLET|IM G|MAP|IFRA ME|TT|I|B| U|S|STRIKE |BIG|SMALL |FONT|BASE FONT|EM|ST RONG|DFN|C ODE|Q|SAMP |KBD|VAR|C ITE|ABBR|A CRONYM|SUB |SUP|INPUT |SELECT|TE XTAREA|LAB EL|BUTTON| #text|#com ment';this .blockElms ='H[1-6]|P |DIV|ADDRE SS|PRE|FOR M|TABLE|LI |OL|UL|TD| CAPTION|BL OCKQUOTE|C ENTER|DL|D T|DD|DIR|F IELDSET|FO RM|NOSCRIP T|NOFRAMES |MENU|ISIN DEX|SAMP'; this.block RegExp=new  RegExp("^ ("+this.bl ockElms+") $","i");th is.posKeyC odes=[13,4 5,36,35,33 ,34,37,38, 39,40];thi s.uniqueUR L='javascr ipt:void(0 91039730); ';this.uni queTag='<d iv id="mce TMPElement " style="d isplay: no ne">TMP</d iv>';this. callbacks= ['onInit', 'getInfo', 'getEditor Template', 'setupCont ent','onCh ange','onP ageLoad',' handleNode Change','i nitInstanc e','execCo mmand','ge tControlHT ML','handl eEvent','c leanup','r emoveInsta nce'];this .settings. theme_href =tinyMCE.b aseURL+"/t hemes/"+th eme;if(!ti nyMCE.isIE ||tinyMCE. isOpera)th is.setting s.force_br _newlines= false;if(t inyMCE.get Param("pop ups_css",f alse)){css Path=tinyM CE.getPara m("popups_ css","");i f(cssPath. indexOf(': //')==-1&& cssPath.ch arAt(0)!=' /')this.se ttings.pop ups_css=th is.documen tBasePath+ "/"+cssPat h;else thi s.settings .popups_cs s=cssPath} else this. settings.p opups_css= tinyMCE.ba seURL+"/th emes/"+the me+"/css/e ditor_popu p.css";if( tinyMCE.ge tParam("ed itor_css", false)){cs sPath=tiny MCE.getPar am("editor _css",""); if(cssPath .indexOf(' ://')==-1& &cssPath.c harAt(0)!= '/')this.s ettings.ed itor_css=t his.docume ntBasePath +"/"+cssPa th;else th is.setting s.editor_c ss=cssPath }else{if(t his.settin gs.editor_ css!=='')t his.settin gs.editor_ css=tinyMC E.baseURL+ "/themes/" +theme+"/c ss/editor_ ui.css"}if (this.conf igs.length ==0){if(ty peof(TinyM CECompress ed)=="unde fined"){ti nyMCE.addE vent(windo w,"DOMCont entLoaded" ,TinyMCE_E ngine.prot otype.onLo ad);if(tin yMCE.isRea lIE){if(do cument.bod y)tinyMCE. addEvent(d ocument.bo dy,"readys tatechange ",TinyMCE_ Engine.pro totype.onL oad);else  tinyMCE.ad dEvent(doc ument,"rea dystatecha nge",TinyM CE_Engine. prototype. onLoad)}ti nyMCE.addE vent(windo w,"load",T inyMCE_Eng ine.protot ype.onLoad );tinyMCE. _addUnload Events()}} this.loadS cript(tiny MCE.baseUR L+'/themes /'+this.se ttings.the me+'/edito r_template '+tinyMCE. srcMode+'. js');this. loadScript (tinyMCE.b aseURL+'/l angs/'+thi s.settings .language+ '.js');thi s.loadCSS( this.setti ngs.editor _css);p=ti nyMCE.getP aram('plug ins','',tr ue,',');if (p.length> 0){for(i=0 ;i<p.lengt h;i++){if( p[i].charA t(0)!='-') this.loadS cript(tiny MCE.baseUR L+'/plugin s/'+p[i]+' /editor_pl ugin'+tiny MCE.srcMod e+'.js')}} if(tinyMCE .getParam( 'entity_en coding')== 'named'){s ettings.cl eanup_enti ties=[];en tities=tin yMCE.getPa ram('entit ies','',tr ue,',');fo r(i=0;i<en tities.len gth;i+=2)s ettings.cl eanup_enti ties['c'+e ntities[i] ]=entities [i+1]}sett ings.index =this.conf igs.length ;this.conf igs[this.c onfigs.len gth]=setti ngs;this.l oadNextScr ipt();if(t his.isIE&& !this.isOp era){try{d ocument.ex ecCommand( 'Backgroun dImageCach e',false,t rue)}catch (e){}}this .xmlEncode Re=new Reg Exp('[<>&" ]','g')},_ addUnloadE vents:func tion(){var  st=tinyMC E.settings .add_unloa d_trigger; if(tinyMCE .isIE){if( st){tinyMC E.addEvent (window,"u nload",Tin yMCE_Engin e.prototyp e.unloadHa ndler);tin yMCE.addEv ent(window .document, "beforeunl oad",TinyM CE_Engine. prototype. unloadHand ler)}}else {if(st)tin yMCE.addEv ent(window ,"unload", function() {tinyMCE.t riggerSave (true,true )})}},_def :function( key,def_va l,t){var v =tinyMCE.g etParam(ke y,def_val) ;v=t?v.rep lace(/\s+/ g,""):v;th is.setting s[key]=v}, hasPlugin: function(n ){return t ypeof(this .plugins[n ])!="undef ined"&&thi s.plugins[ n]!=null}, addPlugin: function(n ,p){var op =this.plug ins[n];p.b aseURL=op? op.baseURL :tinyMCE.b aseURL+"/p lugins/"+n ;this.plug ins[n]=p;t his.loadNe xtScript() },setPlugi nBaseURL:f unction(n, u){var op= this.plugi ns[n];if(o p)op.baseU RL=u;else  this.plugi ns[n]={bas eURL:u}},l oadPlugin: function(n ,u){u=u.in dexOf('.js ')!=-1?u.s ubstring(0 ,u.lastInd exOf('/')) :u;u=u.cha rAt(u.leng th-1)=='/' ?u.substri ng(0,u.len gth-1):u;t his.plugin s[n]={base URL:u};thi s.loadScri pt(u+"/edi tor_plugin "+(tinyMCE .srcMode?' _src':'')+ ".js")},ha sTheme:fun ction(n){r eturn type of(this.th emes[n])!= "undefined "&&this.th emes[n]!=n ull},addTh eme:functi on(n,t){th is.themes[ n]=t;this. loadNextSc ript()},ad dMenu:func tion(n,m){ this.menus [n]=m},has Menu:funct ion(n){ret urn typeof (this.plug ins[n])!=" undefined" &&this.plu gins[n]!=n ull},loadS cript:func tion(url){ var i;for( i=0;i<this .loadedFil es.length; i++){if(th is.loadedF iles[i]==u rl)return} if(tinyMCE .settings. strict_loa ding_mode) this.pendi ngFiles[th is.pending Files.leng th]=url;el se documen t.write('< sc'+'ript  language=" javascript " type="te xt/javascr ipt" src=" '+url+'">< /script>') ;this.load edFiles[th is.loadedF iles.lengt h]=url},lo adNextScri pt:functio n(){var d= document,s e;if(!tiny MCE.settin gs.strict_ loading_mo de)return; if(this.lo adingIndex <this.pend ingFiles.l ength){se= d.createEl ementNS('h ttp://www. w3.org/199 9/xhtml',' script');s e.setAttri bute('lang uage','jav ascript'); se.setAttr ibute('typ e','text/j avascript' );se.setAt tribute('s rc',this.p endingFile s[this.loa dingIndex+ +]);d.getE lementsByT agName("he ad")[0].ap pendChild( se)}else t his.loadin gIndex=-1; },loadCSS: function(u rl){var ar =url.repla ce(/\s+/,' ').split(' ,');var lf len=0,cssl en=0,skip= false;var  x=0,i=0,nl ,le;for(x= 0,csslen=a r.length;x <csslen;x+ +){if(ar[x ]!=null&&a r[x]!='nul l'&&ar[x]. length>0){ for(i=0,lf len=this.l oadedFiles .length;i< lflen;i++) {if(this.l oadedFiles [i]==ar[x] ){skip=tru e;break}}i f(!skip){i f(tinyMCE. settings.s trict_load ing_mode){ nl=documen t.getEleme ntsByTagNa me("head") ;le=docume nt.createE lement('li nk');le.se tAttribute ('href',ar [x]);le.se tAttribute ('rel','st ylesheet') ;le.setAtt ribute('ty pe','text/ css');nl[0 ].appendCh ild(le)}el se documen t.write('< link href= "'+ar[x]+' " rel="sty lesheet" t ype="text/ css" />'); this.loade dFiles[thi s.loadedFi les.length ]=ar[x]}}} },importCS S:function (doc,css){ var css_ar y=css.repl ace(/\s+/, '').split( ',');var c sslen,elm, headArr,x, css_file;f or(x=0,css len=css_ar y.length;x <csslen;x+ +){css_fil e=css_ary[ x];if(css_ file!=null &&css_file !='null'&& css_file.l ength>0){i f(css_file .indexOf(' ://')==-1& &css_file. charAt(0)! ='/')css_f ile=this.d ocumentBas ePath+"/"+ css_file;i f(typeof(d oc.createS tyleSheet) =="undefin ed"){elm=d oc.createE lement("li nk");elm.r el="styles heet";elm. href=css_f ile;if((he adArr=doc. getElement sByTagName ("head"))! =null&&hea dArr.lengt h>0)headAr r[0].appen dChild(elm )}else doc .createSty leSheet(cs s_file)}}} ,confirmAd d:function (e,setting s){var elm =tinyMCE.i sIE?event. srcElement :e.target; var elemen tId=elm.na me?elm.nam e:elm.id;t inyMCE.set tings=sett ings;if(ti nyMCE.sett ings.conve rt_on_clic k||(!elm.g etAttribut e('mce_noa sk')&&conf irm(tinyMC ELang.lang _edit_conf irm)))tiny MCE.addMCE Control(el m,elementI d);elm.set Attribute( 'mce_noask ','true')} ,updateCon tent:funct ion(form_e lement_nam e){var for mElement,n ,inst,doc; formElemen t=document .getElemen tById(form _element_n ame);for(n  in tinyMC E.instance s){inst=ti nyMCE.inst ances[n];i f(!tinyMCE .isInstanc e(inst))co ntinue;ins t.switchSe ttings();i f(inst.for mElement== formElemen t){doc=ins t.getDoc() ;tinyMCE._ setHTML(do c,inst.for mElement.v alue);if(! tinyMCE.is IE)doc.bod y.innerHTM L=tinyMCE. _cleanupHT ML(inst,do c,this.set tings,doc. body,inst. visualAid) }}},addMCE Control:fu nction(rep lace_eleme nt,form_el ement_name ,target_do cument){va r id="mce_ editor_"+t inyMCE.idC ounter++;v ar inst=ne w TinyMCE_ Control(ti nyMCE.sett ings);inst .editorId= id;this.in stances[id ]=inst;ins t._onAdd(r eplace_ele ment,form_ element_na me,target_ document)} ,removeIns tance:func tion(ti){v ar t=[],n, i;for(n in  tinyMCE.i nstances){ i=tinyMCE. instances[ n];if(tiny MCE.isInst ance(i)&&t i!=i)t[n]= i}tinyMCE. instances= t;n=[];t=t inyMCE.und oLevels;fo r(i=0;i<t. length;i++ ){if(t[i]! =ti)n.push (t[i])}tin yMCE.undoL evels=n;ti nyMCE.undo Index=n.le ngth;tinyM CE.dispatc hCallback( ti,'remove _instance_ callback', 'removeIns tance',ti) ;return ti },removeMC EControl:f unction(ed itor_id){v ar inst=ti nyMCE.getI nstanceByI d(editor_i d),h,re,ot ,tn;if(ins t){inst.sw itchSettin gs();edito r_id=inst. editorId;h =tinyMCE.g etContent( editor_id) ;this.remo veInstance (inst);tin yMCE.selec tedElement =null;tiny MCE.select edInstance =null;re=d ocument.ge tElementBy Id(editor_ id+"_paren t");ot=ins t.oldTarge tElement;t n=ot.nodeN ame.toLowe rCase();if (tn=="text area"||tn= ="input"){ re.parentN ode.remove Child(re); ot.style.d isplay="in line";ot.v alue=h}els e{ot.inner HTML=h;ot. style.disp lay='block ';re.paren tNode.inse rtBefore(o t,re);re.p arentNode. removeChil d(re)}}},t riggerSave :function( skip_clean up,skip_ca llback){va r inst,n;i f(typeof(s kip_cleanu p)=="undef ined")skip _cleanup=f alse;if(ty peof(skip_ callback)= ="undefine d")skip_ca llback=fal se;for(n i n tinyMCE. instances) {inst=tiny MCE.instan ces[n];if( !tinyMCE.i sInstance( inst))cont inue;inst. triggerSav e(skip_cle anup,skip_ callback)} },resetFor m:function (form_inde x){var i,i nst,n,form Obj=docume nt.forms[f orm_index] ;for(n in  tinyMCE.in stances){i nst=tinyMC E.instance s[n];if(!t inyMCE.isI nstance(in st))contin ue;inst.sw itchSettin gs();for(i =0;i<formO bj.element s.length;i ++){if(ins t.formTarg etElementI d==formObj .elements[ i].name)in st.getBody ().innerHT ML=inst.st artContent }}},execIn stanceComm and:functi on(editor_ id,command ,user_inte rface,valu e,focus){v ar inst=ti nyMCE.getI nstanceByI d(editor_i d),r;if(in st){r=inst .selection .getRng(); if(typeof( focus)=="u ndefined") focus=true ;if(focus& &(!r||!r.i tem))inst. contentWin dow.focus( );inst.aut oResetDesi gnMode();t his.select edElement= inst.getFo cusElement ();inst.se lect();tin yMCE.execC ommand(com mand,user_ interface, value);if( tinyMCE.is IE&&window .event!=nu ll)tinyMCE .cancelEve nt(window. event)}},e xecCommand :function( command,us er_interfa ce,value){ var inst=t inyMCE.sel ectedInsta nce,n,pe,t e;user_int erface=use r_interfac e?user_int erface:fal se;value=v alue?value :null;if(i nst)inst.s witchSetti ngs();swit ch(command ){case"Und o":if(this .getParam( 'custom_un do_redo_gl obal')){if (this.undo Index>0){t inyMCE.nex tUndoRedoA ction='Und o';inst=th is.undoLev els[--this .undoIndex ];inst.sel ect();if(! tinyMCE.ne xtUndoRedo InstanceId )inst.exec Command('U ndo')}}els e inst.exe cCommand(' Undo');ret urn true;c ase"Redo": if(this.ge tParam('cu stom_undo_ redo_globa l')){if(th is.undoInd ex<=this.u ndoLevels. length-1){ tinyMCE.ne xtUndoRedo Action='Re do';inst=t his.undoLe vels[this. undoIndex+ +];inst.se lect();if( !tinyMCE.n extUndoRed oInstanceI d)inst.exe cCommand(' Redo')}}el se inst.ex ecCommand( 'Redo');re turn true; case'mceFo cus':inst= tinyMCE.ge tInstanceB yId(value) ;if(inst)i nst.getWin ().focus() ;return;ca se"mceAddC ontrol":ca se"mceAddE ditor":tin yMCE.addMC EControl(t inyMCE._ge tElementBy Id(value), value);ret urn;case"m ceAddFrame Control":t inyMCE.add MCEControl (tinyMCE._ getElement ById(value .element,v alue.docum ent),value .element,v alue.docum ent);retur n;case"mce RemoveCont rol":case" mceRemoveE ditor":tin yMCE.remov eMCEContro l(value);r eturn;case "mceToggle Editor":in st=tinyMCE .getInstan ceById(val ue);if(ins t){pe=docu ment.getEl ementById( inst.edito rId+'_pare nt');te=in st.oldTarg etElement; if(typeof( inst.enabl ed)=='unde fined')ins t.enabled= true;inst. enabled=!i nst.enable d;if(!inst .enabled){ pe.style.d isplay='no ne';if(te. nodeName== 'TEXTAREA' ||te.nodeN ame=='INPU T')te.valu e=inst.get HTML();els e te.inner HTML=inst. getHTML(); te.style.d isplay=ins t.oldTarge tDisplay;t inyMCE.dis patchCallb ack(inst,' hide_insta nce_callba ck','hideI nstance',i nst)}else{ pe.style.d isplay='bl ock';te.st yle.displa y='none';i f(te.nodeN ame=='TEXT AREA'||te. nodeName== 'INPUT')in st.setHTML (te.value) ;else inst .setHTML(t e.innerHTM L);inst.us eCSS=false ;tinyMCE.d ispatchCal lback(inst ,'show_ins tance_call back','sho wInstance' ,inst)}}el se tinyMCE .addMCECon trol(tinyM CE._getEle mentById(v alue),valu e);return; case"mceRe setDesignM ode":if(ti nyMCE.isGe cko){for(n  in tinyMC E.instance s){if(!tin yMCE.isIns tance(tiny MCE.instan ces[n]))co ntinue;try {tinyMCE.i nstances[n ].getDoc() .designMod e="off";ti nyMCE.inst ances[n].g etDoc().de signMode=" on";tinyMC E.instance s[n].useCS S=false}ca tch(e){}}} return}if( inst){inst .execComma nd(command ,user_inte rface,valu e)}else if (tinyMCE.s ettings.fo cus_alert) alert(tiny MCELang.la ng_focus_a lert)},_cr eateIFrame :function( replace_el ement,doc, win){var i frame,id=r eplace_ele ment.getAt tribute("i d");var aw ,ah;if(typ eof(doc)== "undefined ")doc=docu ment;if(ty peof(win)= ="undefine d")win=win dow;iframe =doc.creat eElement(" iframe");a w=""+tinyM CE.setting s.area_wid th;ah=""+t inyMCE.set tings.area _height;if (aw.indexO f('%')==-1 ){aw=parse Int(aw);aw =(isNaN(aw )||aw<0)?3 00:aw;aw=a w+"px"}if( ah.indexOf ('%')==-1) {ah=parseI nt(ah);ah= (isNaN(ah) ||ah<0)?24 0:ah;ah=ah +"px"}ifra me.setAttr ibute("id" ,id);ifram e.setAttri bute("name ",id);ifra me.setAttr ibute("cla ss","mceEd itorIframe ");iframe. setAttribu te("border ","0");ifr ame.setAtt ribute("fr ameBorder" ,"0");ifra me.setAttr ibute("mar ginWidth", "0");ifram e.setAttri bute("marg inHeight", "0");ifram e.setAttri bute("left Margin","0 ");iframe. setAttribu te("topMar gin","0"); iframe.set Attribute( "width",aw );iframe.s etAttribut e("height" ,ah);ifram e.setAttri bute("allo wtranspare ncy","true ");iframe. className= 'mceEditor Iframe';if (tinyMCE.s ettings.au to_resize) iframe.set Attribute( "scrolling ","no");if (tinyMCE.i sRealIE)if rame.setAt tribute("s rc",this.s ettings.de fault_docu ment);ifra me.style.w idth=aw;if rame.style .height=ah ;if(tinyMC E.settings .strict_lo ading_mode )iframe.st yle.margin Bottom='-5 px';if(tin yMCE.isRea lIE)replac e_element. outerHTML= iframe.out erHTML;els e replace_ element.pa rentNode.r eplaceChil d(iframe,r eplace_ele ment);if(t inyMCE.isR ealIE)retu rn win.fra mes[id];el se return  iframe},se tupContent :function( editor_id) {var inst= tinyMCE.in stances[ed itor_id],i ,doc=inst. getDoc(),h ead=doc.ge tElementsB yTagName(' head').ite m(0);var c ontent=ins t.startCon tent,conte ntElement, body;if(ti nyMCE.sett ings.stric t_loading_ mode){cont ent=conten t.replace( /&lt;/g,'< ');content =content.r eplace(/&g t;/g,'>'); content=co ntent.repl ace(/&quot ;/g,'"');c ontent=con tent.repla ce(/&amp;/ g,'&')}tin yMCE.selec tedInstanc e=inst;ins t.switchSe ttings();i f(!tinyMCE .isIE&&tin yMCE.getPa ram("setup content_re load",fals e)&&doc.ti tle!="blan k_page"){t ry{doc.loc ation.href =tinyMCE.b aseURL+"/b lank.htm"} catch(ex){ }window.se tTimeout(" tinyMCE.se tupContent ('"+editor _id+"');", 1000);retu rn}if(!hea d||!doc.bo dy){window .setTimeou t("tinyMCE .setupCont ent('"+edi tor_id+"') ;",10);ret urn}tinyMC E.importCS S(inst.get Doc(),tiny MCE.baseUR L+"/themes /"+inst.se ttings.the me+"/css/e ditor_cont ent.css"); tinyMCE.im portCSS(in st.getDoc( ),inst.set tings.cont ent_css);t inyMCE.dis patchCallb ack(inst,' init_insta nce_callba ck','initI nstance',i nst);if(ti nyMCE.getP aram('cust om_undo_re do_keyboar d_shortcut s')){inst. addShortcu t('ctrl',' z','lang_u ndo_desc', 'Undo');in st.addShor tcut('ctrl ','y','lan g_redo_des c','Redo') }for(i=1;i <=6;i++)in st.addShor tcut('ctrl ',''+i,'', 'FormatBlo ck',false, '<h'+i+'>' );inst.add Shortcut(' ctrl','7', '','Format Block',fal se,'<p>'); inst.addSh ortcut('ct rl','8','' ,'FormatBl ock',false ,'<div>'); inst.addSh ortcut('ct rl','9','' ,'FormatBl ock',false ,'<address >');if(tin yMCE.isGec ko){inst.a ddShortcut ('ctrl','b ','lang_bo ld_desc',' Bold');ins t.addShort cut('ctrl' ,'i','lang _italic_de sc','Itali c');inst.a ddShortcut ('ctrl','u ','lang_un derline_de sc','Under line')}if( tinyMCE.ge tParam("co nvert_font s_to_spans "))inst.ge tBody().se tAttribute ('id','mce SpanFonts' );if(tinyM CE.setting s.nowrap)d oc.body.st yle.whiteS pace="nowr ap";doc.bo dy.dir=thi s.settings .direction ality;doc. editorId=e ditor_id;i f(!tinyMCE .isIE)doc. documentEl ement.edit orId=edito r_id;inst. setBaseHRE F(tinyMCE. settings.b ase_href); if(tinyMCE .settings. convert_ne wlines_to_ brs){conte nt=tinyMCE .regexpRep lace(conte nt,"\r\n", "<br />"," gi");conte nt=tinyMCE .regexpRep lace(conte nt,"\r","< br />","gi ");content =tinyMCE.r egexpRepla ce(content ,"\n","<br  />","gi") }content=t inyMCE.sto reAwayURLs (content); content=ti nyMCE._cus tomCleanup (inst,"ins ert_to_edi tor",conte nt);if(tin yMCE.isIE) {window.se tInterval( 'try{tinyM CE.getCSSC lasses(tin yMCE.insta nces["'+ed itor_id+'" ].getDoc() , "'+edito r_id+'");} catch(e){} ',500);if( tinyMCE.se ttings.for ce_br_newl ines)doc.s tyleSheets [0].addRul e("p","mar gin: 0;"); body=inst. getBody(); body.edito rId=editor _id}conten t=tinyMCE. cleanupHTM LCode(cont ent);if(!t inyMCE.isI E){content Element=in st.getDoc( ).createEl ement("bod y");doc=in st.getDoc( );contentE lement.inn erHTML=con tent;if(ti nyMCE.sett ings.clean up_on_star tup)tinyMC E.setInner HTML(inst. getBody(), tinyMCE._c leanupHTML (inst,doc, this.setti ngs,conten tElement)) ;else tiny MCE.setInn erHTML(ins t.getBody( ),content) ;tinyMCE.c onvertAllR elativeURL s(inst.get Body())}el se{if(tiny MCE.settin gs.cleanup _on_startu p){tinyMCE ._setHTML( inst.getDo c(),conten t);try{tin yMCE.setIn nerHTML(in st.getBody (),tinyMCE ._cleanupH TML(inst,i nst.conten tDocument, this.setti ngs,inst.g etBody())) }catch(e){ }}else tin yMCE._setH TML(inst.g etDoc(),co ntent)}tin yMCE.handl eVisualAid (inst.getB ody(),true ,tinyMCE.s ettings.vi sual,inst) ;tinyMCE.d ispatchCal lback(inst ,'setupcon tent_callb ack','setu pContent', editor_id, inst.getBo dy(),inst. getDoc()); if(!tinyMC E.isIE)tin yMCE.addEv entHandler s(inst);if (tinyMCE.i sIE){tinyM CE.addEven t(inst.get Body(),"bl ur",TinyMC E_Engine.p rototype._ eventPatch );tinyMCE. addEvent(i nst.getBod y(),"befor edeactivat e",TinyMCE _Engine.pr ototype._e ventPatch) ;if(!tinyM CE.isOpera ){tinyMCE. addEvent(d oc.body,"m ousemove", TinyMCE_En gine.proto type.onMou seMove);ti nyMCE.addE vent(doc.b ody,"befor epaste",Ti nyMCE_Engi ne.prototy pe._eventP atch);tiny MCE.addEve nt(doc.bod y,"drop",T inyMCE_Eng ine.protot ype._event Patch)}}in st.select( );tinyMCE. selectedEl ement=inst .contentWi ndow.docum ent.body;t inyMCE._cu stomCleanu p(inst,"in sert_to_ed itor_dom", inst.getBo dy());tiny MCE._custo mCleanup(i nst,"setup _content_d om",inst.g etBody()); tinyMCE._s etEventsEn abled(inst .getBody() ,false);ti nyMCE.clea nupAnchors (inst.getD oc());if(t inyMCE.get Param("con vert_fonts _to_spans" ))tinyMCE. convertSpa nsToFonts( inst.getDo c());inst. startConte nt=tinyMCE .trim(inst .getBody() .innerHTML );inst.und oRedo.add( {content:i nst.startC ontent});i f(tinyMCE. isGecko){t inyMCE.sel ectNodes(i nst.getBod y(),functi on(n){if(n .nodeType= =3||n.node Type==8)n. nodeValue= n.nodeValu e.replace( new RegExp ('\\s(mce_ src|mce_hr ef)=\"[^\" ]*\"','gi' ),"");retu rn false}) }if(tinyMC E.isGecko) inst.getBo dy().spell check=tiny MCE.getPar am("gecko_ spellcheck ");tinyMCE ._removeIn ternal(ins t.getBody( ));inst.se lect();tin yMCE.trigg erNodeChan ge(false,t rue)},stor eAwayURLs: function(s ){if(!s.ma tch(/(mce_ src|mce_hr ef)/gi,s)) {s=s.repla ce(new Reg Exp('src\\ s*=\\s*\"( [^ >\"]*)\ "','gi'),' src="$1" m ce_src="$1 "');s=s.re place(new  RegExp('hr ef\\s*=\\s *\"([^ >\" ]*)\"','gi '),'href=" $1" mce_hr ef="$1"')} return s}, _removeInt ernal:func tion(n){if (tinyMCE.i sGecko){ti nyMCE.sele ctNodes(n, function(n ){if(n.nod eType==3|| n.nodeType ==8)n.node Value=n.no deValue.re place(new  RegExp('\\ s(mce_src| mce_href)= \"[^\"]*\" ','gi'),"" );return f alse})}},r emoveTinyM CEFormElem ents:funct ion(form_o bj){var i, elementId; if(!tinyMC E.getParam ('hide_sel ects_on_su bmit'))ret urn;if(typ eof(form_o bj)=="unde fined"||fo rm_obj==nu ll)return; if(form_ob j.nodeName !="FORM"){ if(form_ob j.form)for m_obj=form _obj.form; else form_ obj=tinyMC E.getParen tElement(f orm_obj,"f orm")}if(f orm_obj==n ull)return ;for(i=0;i <form_obj. elements.l ength;i++) {elementId =form_obj. elements[i ].name?for m_obj.elem ents[i].na me:form_ob j.elements [i].id;if( elementId. indexOf('m ce_editor_ ')==0)form _obj.eleme nts[i].dis abled=true }},handleE vent:funct ion(e){var  inst=tiny MCE.select edInstance ,i,elm,key s;if(typeo f(tinyMCE) =="undefin ed")return  true;if(t inyMCE.exe cuteCallba ck(tinyMCE .selectedI nstance,'h andle_even t_callback ','handleE vent',e))r eturn fals e;switch(e .type){cas e"beforede activate": case"blur" :if(tinyMC E.selected Instance)t inyMCE.sel ectedInsta nce.execCo mmand('mce EndTyping' );tinyMCE. hideMenus( );return;c ase"drop": case"befor epaste":if (tinyMCE.s electedIns tance)tiny MCE.select edInstance .setBaseHR EF(null);i f(tinyMCE. isRealIE){ var ife=ti nyMCE.sele ctedInstan ce.iframeE lement;if( ife.style. height.ind exOf('%')! =-1){ife._ oldHeight= ife.style. height;ife .style.hei ght=ife.cl ientHeight }}window.s etTimeout( "tinyMCE.s electedIns tance.setB aseHREF(ti nyMCE.sett ings.base_ href);tiny MCE._reset IframeHeig ht();",1); return;cas e"submit": tinyMCE.fo rmSubmit(t inyMCE.isM SIE?window .event.src Element:e. target);re turn;case" reset":var  formObj=t inyMCE.isI E?window.e vent.srcEl ement:e.ta rget;for(i =0;i<docum ent.forms. length;i++ ){if(docum ent.forms[ i]==formOb j)window.s etTimeout( 'tinyMCE.r esetForm(' +i+');',10 )}return;c ase"keypre ss":if(ins t&&inst.ha ndleShortc ut(e))retu rn false;i f(e.target .editorId) {tinyMCE.i nstances[e .target.ed itorId].se lect()}els e{if(e.tar get.ownerD ocument.ed itorId)tin yMCE.insta nces[e.tar get.ownerD ocument.ed itorId].se lect()}if( tinyMCE.se lectedInst ance)tinyM CE.selecte dInstance. switchSett ings();if( (tinyMCE.i sGecko||ti nyMCE.isOp era||tinyM CE.isSafar i)&&tinyMC E.settings .force_p_n ewlines&&e .keyCode== 13&&!e.shi ftKey){if( TinyMCE_Fo rceParagra phs._inser tPara(tiny MCE.select edInstance ,e)){tinyM CE.execCom mand("mceA ddUndoLeve l");return  tinyMCE.c ancelEvent (e)}}if((t inyMCE.isG ecko&&!tin yMCE.isSaf ari)&&tiny MCE.settin gs.force_p _newlines& &(e.keyCod e==8||e.ke yCode==46) &&!e.shift Key){if(Ti nyMCE_Forc eParagraph s._handleB ackSpace(t inyMCE.sel ectedInsta nce,e.type )){tinyMCE .execComma nd("mceAdd UndoLevel" );return t inyMCE.can celEvent(e )}}if(tiny MCE.isIE&& tinyMCE.se ttings.for ce_br_newl ines&&e.ke yCode==13) {if(e.targ et.editorI d)tinyMCE. instances[ e.target.e ditorId].s elect();if (tinyMCE.s electedIns tance){var  sel=tinyM CE.selecte dInstance. getDoc().s election;v ar rng=sel .createRan ge();if(ti nyMCE.getP arentEleme nt(rng.par entElement (),"li")!= null)retur n false;e. returnValu e=false;e. cancelBubb le=true;rn g.pasteHTM L("<br />" );rng.coll apse(false );rng.sele ct();tinyM CE.execCom mand("mceA ddUndoLeve l");tinyMC E.triggerN odeChange( false);ret urn false} }if(e.keyC ode==8||e. keyCode==4 6){tinyMCE .selectedE lement=e.t arget;tiny MCE.linkEl ement=tiny MCE.getPar entElement (e.target, "a");tinyM CE.imgElem ent=tinyMC E.getParen tElement(e .target,"i mg");tinyM CE.trigger NodeChange (false)}re turn false ;case"keyu p":case"ke ydown":tin yMCE.hideM enus();tin yMCE.hasMo useMoved=f alse;if(in st&&inst.h andleShort cut(e))ret urn false; inst._fixR ootBlocks( );if(inst. settings.r emove_trai ling_nbsp) inst._fixT railingNbs p();if(e.t arget.edit orId)tinyM CE.instanc es[e.targe t.editorId ].select() ;if(tinyMC E.selected Instance)t inyMCE.sel ectedInsta nce.switch Settings() ;inst=tiny MCE.select edInstance ;if(tinyMC E.isGecko& &tinyMCE.s ettings.fo rce_p_newl ines&&(e.k eyCode==8| |e.keyCode ==46)&&!e. shiftKey){ if(TinyMCE _ForcePara graphs._ha ndleBackSp ace(tinyMC E.selected Instance,e .type)){ti nyMCE.exec Command("m ceAddUndoL evel");e.p reventDefa ult();retu rn false}} tinyMCE.se lectedElem ent=null;t inyMCE.sel ectedNode= null;elm=t inyMCE.sel ectedInsta nce.getFoc usElement( );tinyMCE. linkElemen t=tinyMCE. getParentE lement(elm ,"a");tiny MCE.imgEle ment=tinyM CE.getPare ntElement( elm,"img") ;tinyMCE.s electedEle ment=elm;i f(tinyMCE. isGecko&&e .type=="ke yup"&&e.ke yCode==9)t inyMCE.han dleVisualA id(tinyMCE .selectedI nstance.ge tBody(),tr ue,tinyMCE .settings. visual,tin yMCE.selec tedInstanc e);if(tiny MCE.isIE&& e.type=="k eydown"&&e .keyCode== 13)tinyMCE .enterKeyE lement=tin yMCE.selec tedInstanc e.getFocus Element(); if(tinyMCE .isIE&&e.t ype=="keyu p"&&e.keyC ode==13){e lm=tinyMCE .enterKeyE lement;if( elm){var r e=new RegE xp('^HR|IM G|BR$','g' );var dre= new RegExp ('^H[1-6]$ ','g');if( !elm.hasCh ildNodes() &&!re.test (elm.nodeN ame)){if(d re.test(el m.nodeName ))elm.inne rHTML="&nb sp;&nbsp;" ;else elm. innerHTML= "&nbsp;"}} }keys=tiny MCE.posKey Codes;var  posKey=fal se;for(i=0 ;i<keys.le ngth;i++){ if(keys[i] ==e.keyCod e){posKey= true;break }}if(tinyM CE.isIE&&t inyMCE.set tings.cust om_undo_re do){keys=[ 8,46];for( i=0;i<keys .length;i+ +){if(keys [i]==e.key Code){if(e .type=="ke yup")tinyM CE.trigger NodeChange (false)}}} if(e.keyCo de==17)ret urn true;i f(tinyMCE. isGecko){i f(!posKey& &e.type==" keyup"&&!e .ctrlKey|| (e.ctrlKey &&(e.keyCo de==86||e. keyCode==8 8)))tinyMC E.execComm and("mceSt artTyping" )}else{if( !posKey&&e .type=="ke yup")tinyM CE.execCom mand("mceS tartTyping ")}if(e.ty pe=="keydo wn"&&(posK ey||e.ctrl Key)&&inst )inst.undo Bookmark=i nst.select ion.getBoo kmark();if (e.type==" keyup"&&(p osKey||e.c trlKey))ti nyMCE.exec Command("m ceEndTypin g");if(pos Key&&e.typ e=="keyup" )tinyMCE.t riggerNode Change(fal se);if(tin yMCE.isIE& &e.ctrlKey )window.se tTimeout(' tinyMCE.tr iggerNodeC hange(fals e);',1);br eak;case"m ousedown": case"mouse up":case"c lick":case "dblclick" :case"focu s":tinyMCE .hideMenus ();if(tiny MCE.select edInstance ){tinyMCE. selectedIn stance.swi tchSetting s();tinyMC E.selected Instance.i sFocused=t rue}var ta rgetBody=t inyMCE.get ParentElem ent(e.targ et,"html") ;for(var i nstanceNam e in tinyM CE.instanc es){if(!ti nyMCE.isIn stance(tin yMCE.insta nces[insta nceName])) continue;i nst=tinyMC E.instance s[instance Name];inst .autoReset DesignMode ();if(inst .getBody() .parentNod e==targetB ody){inst. select();t inyMCE.sel ectedEleme nt=e.targe t;tinyMCE. linkElemen t=tinyMCE. getParentE lement(tin yMCE.selec tedElement ,"a");tiny MCE.imgEle ment=tinyM CE.getPare ntElement( tinyMCE.se lectedElem ent,"img") ;break}}if (!tinyMCE. selectedIn stance.und oRedo.undo Levels[0]. bookmark&& (e.type==" mouseup"|| e.type=="d blclick")) tinyMCE.se lectedInst ance.undoR edo.undoLe vels[0].bo okmark=tin yMCE.selec tedInstanc e.selectio n.getBookm ark();if(e .type!="fo cus")tinyM CE.selecte dNode=null ;tinyMCE.t riggerNode Change(fal se);tinyMC E.execComm and("mceEn dTyping"); if(e.type= ="mouseup" )tinyMCE.e xecCommand ("mceAddUn doLevel"); if(!tinyMC E.selected Instance&& e.target.e ditorId)ti nyMCE.inst ances[e.ta rget.edito rId].selec t();return  false}},g etButtonHT ML:functio n(id,lang, img,cmd,ui ,val){var  h='',m,x,i o='';cmd=' tinyMCE.ex ecInstance Command(\' {$editor_i d}\',\''+c md+'\'';if (typeof(ui )!="undefi ned"&&ui!= null)cmd+= ','+ui;if( typeof(val )!="undefi ned"&&val! =null)cmd+ =",'"+val+ "'";cmd+=' );';if(tin yMCE.isRea lIE)io='on mouseover= "tinyMCE.l astHover =  this;"';i f(tinyMCE. getParam(' button_til e_map')&&( !tinyMCE.i sIE||tinyM CE.isOpera )&&(m=this .buttonMap [id])!=nul l&&(tinyMC E.getParam ("language ")=="en"|| img.indexO f('$lang') ==-1)){x=0 -(m*20)==0 ?'0':0-(m* 20);h+='<a  id="{$edi tor_id}_'+ id+'" href ="javascri pt:'+cmd+' " onclick= "'+cmd+'re turn false ;" onmouse down="retu rn false;"  '+io+' cl ass="mceTi ledButton  mceButtonN ormal" tar get="_self ">';h+='<i mg src="{$ themeurl}/ images/spa cer.gif" s tyle="back ground-pos ition: '+x +'px 0" al t="{$'+lan g+'}" titl e="{$'+lan g+'}" />'; h+='</a>'} else{h+='< a id="{$ed itor_id}_' +id+'" hre f="javascr ipt:'+cmd+ '" onclick ="'+cmd+'r eturn fals e;" onmous edown="ret urn false; " '+io+' c lass="mceB uttonNorma l" target= "_self">'; h+='<img s rc="'+img+ '" alt="{$ '+lang+'}"  title="{$ '+lang+'}"  />';h+='< /a>'}retur n h},getMe nuButtonHT ML:functio n(id,lang, img,mcmd,c md,ui,val) {var h='', m,x;mcmd=' tinyMCE.ex ecInstance Command(\' {$editor_i d}\',\''+m cmd+'\');' ;cmd='tiny MCE.execIn stanceComm and(\'{$ed itor_id}\' ,\''+cmd+' \'';if(typ eof(ui)!=" undefined" &&ui!=null )cmd+=','+ ui;if(type of(val)!=" undefined" &&val!=nul l)cmd+=",' "+val+"'"; cmd+=');'; if(tinyMCE .getParam( 'button_ti le_map')&& (!tinyMCE. isIE||tiny MCE.isOper a)&&(m=tin yMCE.butto nMap[id])! =null&&(ti nyMCE.getP aram("lang uage")=="e n"||img.in dexOf('$la ng')==-1)) {x=0-(m*20 )==0?'0':0 -(m*20);if (tinyMCE.i sRealIE)h+ ='<span id ="{$editor _id}_'+id+ '" class=" mceMenuBut ton" onmou seover="ti nyMCE._men uButtonEve nt(\'over\ ',this);ti nyMCE.last Hover = th is;" onmou seout="tin yMCE._menu ButtonEven t(\'out\', this);">'; else h+='< span id="{ $editor_id }_'+id+'"  class="mce MenuButton ">';h+='<a  href="jav ascript:'+ cmd+'" onc lick="'+cm d+'return  false;" on mousedown= "return fa lse;" clas s="mceTile dButton mc eMenuButto nNormal" t arget="_se lf">';h+=' <img src=" {$themeurl }/images/s pacer.gif"  style="wi dth: 20px;  height: 2 0px; backg round-posi tion: '+x+ 'px 0" tit le="{$'+la ng+'}" />< /a>';h+='< a href="ja vascript:' +mcmd+'" o nclick="'+ mcmd+'retu rn false;"  onmousedo wn="return  false;">< img src="{ $themeurl} /images/bu tton_menu. gif" title ="{$'+lang +'}" class ="mceMenuB utton" />' ;h+='</a>< /span>'}el se{if(tiny MCE.isReal IE)h+='<sp an id="{$e ditor_id}_ '+id+'" di r="ltr" cl ass="mceMe nuButton"  onmouseove r="tinyMCE ._menuButt onEvent(\' over\',thi s);tinyMCE .lastHover  = this;"  onmouseout ="tinyMCE. _menuButto nEvent(\'o ut\',this) ;">';else  h+='<span  id="{$edit or_id}_'+i d+'" dir=" ltr" class ="mceMenuB utton">';h +='<a href ="javascri pt:'+cmd+' " onclick= "'+cmd+'re turn false ;" onmouse down="retu rn false;"  class="mc eMenuButto nNormal" t arget="_se lf">';h+=' <img src=" '+img+'" t itle="{$'+ lang+'}" / ></a>';h+= '<a href=" javascript :'+mcmd+'"  onclick=" '+mcmd+'re turn false ;" onmouse down="retu rn false;" ><img src= "{$themeur l}/images/ button_men u.gif" tit le="{$'+la ng+'}" cla ss="mceMen uButton" / >';h+='</a ></span>'} return h}, _menuButto nEvent:fun ction(e,o) {if(o.clas sName=='mc eMenuButto nFocus')re turn;if(e= ='over')o. className= o.classNam e+' mceMen uHover';el se o.class Name=o.cla ssName.rep lace(/\s.* $/,'')},ad dButtonMap :function( m){var i,a =m.replace (/\s+/,'') .split(',' );for(i=0; i<a.length ;i++)this. buttonMap[ a[i]]=i},f ormSubmit: function(f ,p){var n, inst,found =false;if( f.form)f=f .form;for( n in tinyM CE.instanc es){inst=t inyMCE.ins tances[n]; if(!tinyMC E.isInstan ce(inst))c ontinue;if (inst.form Element){i f(f==inst. formElemen t.form){fo und=true;i nst.isNotD irty=true} }}if(found ){tinyMCE. removeTiny MCEFormEle ments(f);t inyMCE.tri ggerSave() }if(f.mceO ldSubmit&& p)f.mceOld Submit()}, submitPatc h:function (){tinyMCE .formSubmi t(this,tru e)},onLoad :function( ){var r,i, c,mode,tri gger,eleme nts,elemen t,settings ,elementId ,elm;var s elector,de selector,e lementRefA r,form;if( tinyMCE.se ttings.str ict_loadin g_mode&&th is.loading Index!=-1) {window.se tTimeout(' tinyMCE.on Load();',1 );return}i f(tinyMCE. isRealIE&& window.eve nt.type==" readystate change"&&d ocument.re adyState!= "complete" )return tr ue;if(tiny MCE.isLoad ed)return  true;tinyM CE.isLoade d=true;if( tinyMCE.is RealIE&&do cument.bod y&&window. location.h ref!=windo w.top.loca tion.href) {r=documen t.body.cre ateTextRan ge();r.col lapse(true );r.select ()}tinyMCE .dispatchC allback(nu ll,'onpage load','onP ageLoad'); for(c=0;c< tinyMCE.co nfigs.leng th;c++){ti nyMCE.sett ings=tinyM CE.configs [c];select or=tinyMCE .getParam( "editor_se lector");d eselector= tinyMCE.ge tParam("ed itor_desel ector");el ementRefAr =[];if(doc ument.form s&&tinyMCE .settings. add_form_s ubmit_trig ger&&!tiny MCE.submit Triggers){ for(i=0;i< document.f orms.lengt h;i++){for m=document .forms[i]; tinyMCE.ad dEvent(for m,"submit" ,TinyMCE_E ngine.prot otype.hand leEvent);t inyMCE.add Event(form ,"reset",T inyMCE_Eng ine.protot ype.handle Event);tin yMCE.submi tTriggers= true;if(ti nyMCE.sett ings.submi t_patch){t ry{form.mc eOldSubmit =form.subm it;form.su bmit=TinyM CE_Engine. prototype. submitPatc h}catch(e) {}}}}mode= tinyMCE.se ttings.mod e;switch(m ode){case" exact":ele ments=tiny MCE.getPar am('elemen ts','',tru e,',');for (i=0;i<ele ments.leng th;i++){el ement=tiny MCE._getEl ementById( elements[i ]);trigger =element?e lement.get Attribute( tinyMCE.se ttings.tex tarea_trig ger):"";if (new RegEx p('\\b'+de selector+' \\b').test (tinyMCE.g etAttrib(e lement,"cl ass")))con tinue;if(t rigger=="f alse")cont inue;if((t inyMCE.set tings.ask| |tinyMCE.s ettings.co nvert_on_c lick)&&ele ment){elem entRefAr[e lementRefA r.length]= element;co ntinue}if( element)ti nyMCE.addM CEControl( element,el ements[i]) }break;cas e"specific _textareas ":case"tex tareas":el ements=doc ument.getE lementsByT agName("te xtarea");f or(i=0;i<e lements.le ngth;i++){ elm=elemen ts.item(i) ;trigger=e lm.getAttr ibute(tiny MCE.settin gs.textare a_trigger) ;if(select or!==''&&! new RegExp ('\\b'+sel ector+'\\b ').test(ti nyMCE.getA ttrib(elm, "class"))) continue;i f(selector !=='')trig ger=select or!==''?"t rue":"";if (new RegEx p('\\b'+de selector+' \\b').test (tinyMCE.g etAttrib(e lm,"class" )))continu e;if((mode =="specifi c_textarea s"&&trigge r=="true") ||(mode==" textareas" &&trigger! ="false")) elementRef Ar[element RefAr.leng th]=elm}br eak}for(i= 0;i<elemen tRefAr.len gth;i++){e lement=ele mentRefAr[ i];element Id=element .name?elem ent.name:e lement.id; if(tinyMCE .settings. ask||tinyM CE.setting s.convert_ on_click){ if(tinyMCE .isGecko){ settings=t inyMCE.set tings;tiny MCE.addEve nt(element ,"focus",f unction(e) {window.se tTimeout(f unction(){ TinyMCE_En gine.proto type.confi rmAdd(e,se ttings)},1 0)});if(el ement.node Name!="TEX TAREA"&&el ement.node Name!="INP UT")tinyMC E.addEvent (element," click",fun ction(e){w indow.setT imeout(fun ction(){Ti nyMCE_Engi ne.prototy pe.confirm Add(e,sett ings)},10) });}else{s ettings=ti nyMCE.sett ings;tinyM CE.addEven t(element, "focus",fu nction(){T inyMCE_Eng ine.protot ype.confir mAdd(null, settings)} );tinyMCE. addEvent(e lement,"cl ick",funct ion(){Tiny MCE_Engine .prototype .confirmAd d(null,set tings)});} }else tiny MCE.addMCE Control(el ement,elem entId)}if( tinyMCE.se ttings.aut o_focus){w indow.setT imeout(fun ction(){va r inst=tin yMCE.getIn stanceById (tinyMCE.s ettings.au to_focus); inst.selec tion.selec tNode(inst .getBody() ,true,true );inst.con tentWindow .focus()}, 100)}tinyM CE.dispatc hCallback( null,'onin it','onIni t')}},isIn stance:fun ction(o){r eturn o!=n ull&&typeo f(o)=="obj ect"&&o.is TinyMCE_Co ntrol},get Param:func tion(name, default_va lue,strip_ whitespace ,split_chr ){var i,ou tArray,val ue=(typeof (this.sett ings[name] )=="undefi ned")?defa ult_value: this.setti ngs[name]; if(value== "true"||va lue=="fals e")return( value=="tr ue");if(st rip_whites pace)value =tinyMCE.r egexpRepla ce(value," [ \t\r\n]" ,"");if(ty peof(split _chr)!="un defined"&& split_chr! =null){val ue=value.s plit(split _chr);outA rray=[];fo r(i=0;i<va lue.length ;i++){if(v alue[i]&&v alue[i]!== '')outArra y[outArray .length]=v alue[i]}va lue=outArr ay}return  value},get Lang:funct ion(name,d efault_val ue,parse_e ntities,va ){var v=(t ypeof(tiny MCELang[na me])=="und efined")?d efault_val ue:tinyMCE Lang[name] ,n;if(pars e_entities )v=tinyMCE .entityDec ode(v);if( va){for(n  in va)v=th is.replace Var(v,n,va [n])}retur n v},entit yDecode:fu nction(s){ var e=docu ment.creat eElement(" div");e.in nerHTML=s; return!e.f irstChild? s:e.firstC hild.nodeV alue},addT oLang:func tion(prefi x,ar){var  k;for(k in  ar){if(ty peof(ar[k] )=='functi on')contin ue;tinyMCE Lang[(k.in dexOf('lan g_')==-1?' lang_':'') +(prefix!= =''?(prefi x+"_"):'') +k]=ar[k]} this.loadN extScript( )},trigger NodeChange :function( focus,setu p_content) {var elm,i nst,editor Id,undoInd ex=-1,undo Levels=-1, doc,anySel ection=fal se,st;if(t inyMCE.sel ectedInsta nce){inst= tinyMCE.se lectedInst ance;elm=( typeof(set up_content )!="undefi ned"&&setu p_content) ?tinyMCE.s electedEle ment:inst. getFocusEl ement();ed itorId=ins t.editorId ;st=inst.s election.g etSelected Text();if( tinyMCE.se ttings.aut o_resize)i nst.resize ToContent( );if(setup _content&& tinyMCE.is Gecko&&ins t.isHidden ())elm=ins t.getBody( );inst.swi tchSetting s();if(tin yMCE.selec tedElement )anySelect ion=(tinyM CE.selecte dElement.n odeName.to LowerCase( )=="img")| |(st&&st.l ength>0);i f(tinyMCE. settings.c ustom_undo _redo){und oIndex=ins t.undoRedo .undoIndex ;undoLevel s=inst.und oRedo.undo Levels.len gth}tinyMC E.dispatch Callback(i nst,'handl e_node_cha nge_callba ck','handl eNodeChang e',editorI d,elm,undo Index,undo Levels,ins t.visualAi d,anySelec tion,setup _content)} if(this.se lectedInst ance&&(typ eof(focus) =="undefin ed"||focus ))this.sel ectedInsta nce.conten tWindow.fo cus()},_cu stomCleanu p:function (inst,type ,content){ var pl,po, i,customCl eanup;cust omCleanup= tinyMCE.se ttings.cle anup_callb ack;if(cus tomCleanup !='')conte nt=tinyMCE .resolveDo ts(tinyMCE .settings. cleanup_ca llback,win dow)(type, content,in st);po=tin yMCE.theme s[tinyMCE. settings.t heme];if(p o&&po.clea nup)conten t=po.clean up(type,co ntent,inst );pl=inst. plugins;fo r(i=0;i<pl .length;i+ +){po=tiny MCE.plugin s[pl[i]];i f(po&&po.c leanup)con tent=po.cl eanup(type ,content,i nst)}retur n content} ,setConten t:function (h){if(tin yMCE.selec tedInstanc e){tinyMCE .selectedI nstance.ex ecCommand( 'mceSetCon tent',fals e,h);tinyM CE.selecte dInstance. repaint()} },importTh emeLanguag ePack:func tion(name) {if(typeof (name)=="u ndefined") name=tinyM CE.setting s.theme;ti nyMCE.load Script(tin yMCE.baseU RL+'/theme s/'+name+' /langs/'+t inyMCE.set tings.lang uage+'.js' )},importP luginLangu agePack:fu nction(nam e){var b=t inyMCE.bas eURL+'/plu gins/'+nam e;if(this. plugins[na me])b=this .plugins[n ame].baseU RL;tinyMCE .loadScrip t(b+'/lang s/'+tinyMC E.settings .language+ '.js')},ap plyTemplat e:function (h,ag){ret urn h.repl ace(new Re gExp('\\{\ \$([a-z0-9 _]+)\\}',' gi'),funct ion(m,s){i f(s.indexO f('lang_') ==0&&tinyM CELang[s]) return tin yMCELang[s ];if(ag&&a g[s])retur n ag[s];if (tinyMCE.s ettings[s] )return ti nyMCE.sett ings[s];if (m=='theme url')retur n tinyMCE. themeURL;r eturn m})} ,replaceVa r:function (h,r,v){re turn h.rep lace(new R egExp('{\\ \$'+r+'}', 'g'),v)},o penWindow: function(t emplate,ar gs){var ht ml,width,h eight,x,y, resizable, scrollbars ,url,name, win,modal, features;a rgs=!args? {}:args;ar gs.mce_tem plate_file =template. file;args. mce_width= template.w idth;args. mce_height =template. height;tin yMCE.windo wArgs=args ;html=temp late.html; if(!(width =parseInt( template.w idth)))wid th=320;if( !(height=p arseInt(te mplate.hei ght)))heig ht=200;if( tinyMCE.is IE)height+ =40;else h eight+=20; x=parseInt (screen.wi dth/ 2.0)  - (width / 2.0);y=par seInt(scre en.height/  2.0) - (h eight /2.0 );resizabl e=(args&&a rgs.resiza ble)?args. resizable: "no";scrol lbars=(arg s&&args.sc rollbars)? args.scrol lbars:"no" ;if(templa te.file.ch arAt(0)!=' /'&&templa te.file.in dexOf(':// ')==-1)url =tinyMCE.b aseURL+"/t hemes/"+ti nyMCE.getP aram("them e")+"/"+te mplate.fil e;else url =template. file;for(n ame in arg s){if(type of(args[na me])=='fun ction')con tinue;url= tinyMCE.re placeVar(u rl,name,es cape(args[ name]))}if (html){htm l=tinyMCE. replaceVar (html,"css ",this.set tings.popu ps_css);ht ml=tinyMCE .applyTemp late(html, args);win= window.ope n("","mceP opup"+new  Date().get Time(),"to p="+y+",le ft="+x+",s crollbars= "+scrollba rs+",dialo g=yes,mini mizable="+ resizable+ ",modal=ye s,width="+ width+",he ight="+hei ght+",resi zable="+re sizable);i f(win==nul l){alert(t inyMCELang .lang_popu p_blocked) ;return}wi n.document .write(htm l);win.doc ument.clos e();win.re sizeTo(wid th,height) ;win.focus ()}else{if ((tinyMCE. isRealIE)& &resizable !='yes'&&t inyMCE.set tings.dial og_type==" modal"){he ight+=10;f eatures="r esizable:" +resizable +";scroll: "+scrollba rs+";statu s:yes;cent er:yes;hel p:no;dialo gWidth:"+w idth+"px;d ialogHeigh t:"+height +"px;";win dow.showMo dalDialog( url,window ,features) }else{moda l=(resizab le=="yes") ?"no":"yes ";if(tinyM CE.isGecko &&tinyMCE. isMac)moda l="no";if( template.c lose_previ ous!="no") try{tinyMC E.lastWind ow.close() }catch(ex) {}win=wind ow.open(ur l,"mcePopu p"+new Dat e().getTim e(),"top=" +y+",left= "+x+",scro llbars="+s crollbars+ ",dialog=" +modal+",m inimizable ="+resizab le+",modal ="+modal+" ,width="+w idth+",hei ght="+heig ht+",resiz able="+res izable);if (win==null ){alert(ti nyMCELang. lang_popup _blocked); return}if( template.c lose_previ ous!="no") tinyMCE.la stWindow=w in;try{win .resizeTo( width,heig ht)}catch( e){}if(tin yMCE.isGec ko){if(win .document. defaultVie w.statusba r.visible) win.resize By(0,tinyM CE.isMac?1 0:24)}win. focus()}}} ,closeWind ow:functio n(win){win .close()}, getVisualA idClass:fu nction(cla ss_name,st ate){var i ,className s,ar,class Name,aidCl ass=tinyMC E.settings .visual_ta ble_class; if(typeof( state)=="u ndefined") state=tiny MCE.settin gs.visual; classNames =[];ar=cla ss_name.sp lit(' ');f or(i=0;i<a r.length;i ++){if(ar[ i]==aidCla ss)ar[i]=" ";if(ar[i] !=='')clas sNames[cla ssNames.le ngth]=ar[i ]}if(state )className s[classNam es.length] =aidClass; className= "";for(i=0 ;i<classNa mes.length ;i++){if(i >0)classNa me+=" ";cl assName+=c lassNames[ i]}return  className} ,handleVis ualAid:fun ction(el,d eep,state, inst,skip_ dispatch){ var i,x,y, tableEleme nt,anchorN ame,oldW,o ldH,bo,cn; if(!el)ret urn;if(!sk ip_dispatc h)tinyMCE. dispatchCa llback(ins t,'handle_ visual_aid _callback' ,'handleVi sualAid',e l,deep,sta te,inst);t ableElemen t=null;swi tch(el.nod eName){cas e"TABLE":o ldW=el.sty le.width;o ldH=el.sty le.height; bo=tinyMCE .getAttrib (el,"borde r");bo=bo= =''||bo==" 0"?true:fa lse;tinyMC E.setAttri b(el,"clas s",tinyMCE .getVisual AidClass(t inyMCE.get Attrib(el, "class"),s tate&&bo)) ;el.style. width=oldW ;el.style. height=old H;for(y=0; y<el.rows. length;y++ ){for(x=0; x<el.rows[ y].cells.l ength;x++) {cn=tinyMC E.getVisua lAidClass( tinyMCE.ge tAttrib(el .rows[y].c ells[x],"c lass"),sta te&&bo);ti nyMCE.setA ttrib(el.r ows[y].cel ls[x],"cla ss",cn)}}b reak;case" A":anchorN ame=tinyMC E.getAttri b(el,"name ");if(anch orName!==' '&&state){ el.title=a nchorName; tinyMCE.ad dCSSClass( el,'mceIte mAnchor')} else if(an chorName!= =''&&!stat e)el.class Name='';br eak}if(dee p&&el.hasC hildNodes( )){for(i=0 ;i<el.chil dNodes.len gth;i++)ti nyMCE.hand leVisualAi d(el.child Nodes[i],d eep,state, inst,true) }},fixGeck oBaseHREFB ug:functio n(m,e,h){v ar xsrc,xh ref;if(tin yMCE.isGec ko){if(m== 1){h=h.rep lace(/\ssr c=/gi," mc e_tsrc="); h=h.replac e(/\shref= /gi," mce_ thref=");r eturn h}el se{if(!new  RegExp('( src|href)= ','g').tes t(h))retur n h;tinyMC E.selectEl ements(e,' A,IMG,SELE CT,AREA,IF RAME,BASE, INPUT,SCRI PT,EMBED,O BJECT,LINK ',function (n){xsrc=t inyMCE.get Attrib(n," mce_tsrc") ;xhref=tin yMCE.getAt trib(n,"mc e_thref"); if(xsrc!== ''){try{n. src=tinyMC E.convertR elativeToA bsoluteURL (tinyMCE.s ettings.ba se_href,xs rc)}catch( e){}n.remo veAttribut e("mce_tsr c")}if(xhr ef!==''){t ry{n.href= tinyMCE.co nvertRelat iveToAbsol uteURL(tin yMCE.setti ngs.base_h ref,xhref) }catch(e){ }n.removeA ttribute(" mce_thref" )}return f alse});tin yMCE.selec tNodes(e,f unction(n) {if(n.node Type==3||n .nodeType= =8){n.node Value=n.no deValue.re place(/\sm ce_tsrc=/g i," src=") ;n.nodeVal ue=n.nodeV alue.repla ce(/\smce_ thref=/gi, " href=")} return fal se})}}retu rn h},_set HTML:funct ion(doc,ht ml_content ){var i,ht ml,paras,n ode;html_c ontent=tin yMCE.clean upHTMLCode (html_cont ent);try{t inyMCE.set InnerHTML( doc.body,h tml_conten t)}catch(e ){if(this. isMSIE)doc .body.crea teTextRang e().pasteH TML(html_c ontent)}if (tinyMCE.i sIE&&tinyM CE.setting s.fix_cont ent_duplic ation){par as=doc.get ElementsBy TagName("P ");for(i=0 ;i<paras.l ength;i++) {node=para s[i];while ((node=nod e.parentNo de)!=null) {if(node.n odeName==" P")node.ou terHTML=no de.innerHT ML}}html=d oc.body.in nerHTML;ti nyMCE.setI nnerHTML(d oc.body,ht ml)}tinyMC E.cleanupA nchors(doc );if(tinyM CE.getPara m("convert _fonts_to_ spans"))ti nyMCE.conv ertSpansTo Fonts(doc) },getEdito rId:functi on(form_el ement){var  inst=this .getInstan ceById(for m_element) ;if(!inst) return nul l;return i nst.editor Id},getIns tanceById: function(e ditor_id){ var inst=t his.instan ces[editor _id],n;if( !inst){for (n in tiny MCE.instan ces){inst= tinyMCE.in stances[n] ;if(!tinyM CE.isInsta nce(inst)) continue;i f(inst.for mTargetEle mentId==ed itor_id)re turn inst} }else retu rn inst;re turn null} ,queryInst anceComman dValue:fun ction(edit or_id,comm and){var i nst=tinyMC E.getInsta nceById(ed itor_id);i f(inst)ret urn inst.q ueryComman dValue(com mand);retu rn false}, queryInsta nceCommand State:func tion(edito r_id,comma nd){var in st=tinyMCE .getInstan ceById(edi tor_id);if (inst)retu rn inst.qu eryCommand State(comm and);retur n null},se tWindowArg :function( n,v){this. windowArgs [n]=v},get WindowArg: function(n ,d){return (typeof(th is.windowA rgs[n])==" undefined" )?d:this.w indowArgs[ n]},getCSS Classes:fu nction(edi tor_id,doc ){var i,c, x,rule,sty les,rules, csses,sele ctorText,i nst=tinyMC E.getInsta nceById(ed itor_id);v ar cssClas s,addClass ,p;if(!ins t)inst=tin yMCE.selec tedInstanc e;if(!inst )return[]; if(!doc)do c=inst.get Doc();if(i nst&&inst. cssClasses .length>0) return ins t.cssClass es;if(!doc )return;st yles=doc.s tyleSheets ;if(styles &&styles.l ength>0){f or(x=0;x<s tyles.leng th;x++){cs ses=null;t ry{csses=t inyMCE.isI E?doc.styl eSheets(x) .rules:sty les[x].css Rules}catc h(e){}if(! csses)retu rn[];for(i =0;i<csses .length;i+ +){selecto rText=csse s[i].selec torText;if (selectorT ext){rules =selectorT ext.split( ',');for(c =0;c<rules .length;c+ +){rule=ru les[c];whi le(rule.in dexOf(' ') ==0)rule=r ule.substr ing(1);if( rule.index Of(' ')!=- 1||rule.in dexOf(':') !=-1||rule .indexOf(' mceItem')! =-1)contin ue;if(rule .indexOf(t inyMCE.set tings.visu al_table_c lass)!=-1| |rule.inde xOf('mceEd itable')!= -1||rule.i ndexOf('mc eNonEditab le')!=-1)c ontinue;if (rule.inde xOf('.')!= -1){cssCla ss=rule.su bstring(ru le.indexOf ('.')+1);a ddClass=tr ue;for(p=0 ;p<inst.cs sClasses.l ength&&add Class;p++) {if(inst.c ssClasses[ p]==cssCla ss)addClas s=false}if (addClass) inst.cssCl asses[inst .cssClasse s.length]= cssClass}} }}}}return  inst.cssC lasses},re gexpReplac e:function (in_str,re g_exp,repl ace_str,op ts){var re ;if(in_str ==null)ret urn in_str ;if(typeof (opts)=="u ndefined") opts='g';r e=new RegE xp(reg_exp ,opts);ret urn in_str .replace(r e,replace_ str)},trim :function( s){return  s.replace( /^\s*|\s*$ /g,"")},cl eanupEvent Str:functi on(s){s="" +s;s=s.rep lace('func tion anony mous()\n{\ n','');s=s .replace(' \n}','');s =s.replace (/^return  true;/gi,' ');return  s},getCont rolHTML:fu nction(c){ var i,l,n, o,v,rtl=ti nyMCE.getL ang('lang_ dir')=='rt l';l=tinyM CE.plugins ;for(n in  l){o=l[n]; if(o.getCo ntrolHTML& &(v=o.getC ontrolHTML (c))!=='') {if(rtl)re turn'<span  dir="rtl" >'+tinyMCE .replaceVa r(v,"plugi nurl",o.ba seURL)+'</ span>';ret urn tinyMC E.replaceV ar(v,"plug inurl",o.b aseURL)}}o =tinyMCE.t hemes[tiny MCE.settin gs.theme]; if(o.getCo ntrolHTML& &(v=o.getC ontrolHTML (c))!=='') {if(rtl)re turn'<span  dir="rtl" >'+v+'</sp an>';retur n v}return ''},evalFu nc:functio n(f,idx,a, o){o=!o?wi ndow:o;f=t ypeof(f)== 'function' ?f:o[f];re turn f.app ly(o,Array .prototype .slice.cal l(a,idx))} ,dispatchC allback:fu nction(i,p ,n){return  this.call Func(i,p,n ,0,this.di spatchCall back.argum ents)},exe cuteCallba ck:functio n(i,p,n){r eturn this .callFunc( i,p,n,1,th is.execute Callback.a rguments)} ,execComma ndCallback :function( i,p,n){ret urn this.c allFunc(i, p,n,2,this .execComma ndCallback .arguments )},callFun c:function (ins,p,n,m ,a){var l, i,on,o,s,v ;s=m==2;l= tinyMCE.ge tParam(p,' ');if(l!== ''&&(v=tin yMCE.evalF unc(l,3,a) )==s&&m>0) return tru e;if(ins!= null){for( i=0,l=ins. plugins;i< l.length;i ++){o=tiny MCE.plugin s[l[i]];if (o[n]&&(v= tinyMCE.ev alFunc(n,3 ,a,o))==s& &m>0)retur n true}}l= tinyMCE.th emes;for(o n in l){o= l[on];if(o [n]&&(v=ti nyMCE.eval Func(n,3,a ,o))==s&&m >0)return  true}retur n false},r esolveDots :function( s,o){var i ;if(typeof (s)=='stri ng'){for(i =0,s=s.spl it('.');i< s.length;i ++)o=o[s[i ]]}else o= s;return o },xmlEncod e:function (s){return  s?(''+s). replace(th is.xmlEnco deRe,funct ion(c,b){s witch(c){c ase'&':ret urn'&amp;' ;case'"':r eturn'&quo t;';case'< ':return'& lt;';case' >':return' &gt;'}retu rn c}):s}, add:functi on(c,m){va r n;for(n  in m)c.pro totype[n]= m[n]},exte nd:functio n(p,np){va r o={},n;o .parent=p; for(n in p )o[n]=p[n] ;for(n in  np)o[n]=np [n];return  o},hideMe nus:functi on(){var e =tinyMCE.l astSelecte dMenuBtn;i f(tinyMCE. lastMenu){ tinyMCE.la stMenu.hid e();tinyMC E.lastMenu =null}if(e ){tinyMCE. switchClas s(e,tinyMC E.lastMenu BtnClass); tinyMCE.la stSelected MenuBtn=nu ll}}};var  TinyMCE=Ti nyMCE_Engi ne;var tin yMCE=new T inyMCE_Eng ine();var  tinyMCELan g={};funct ion TinyMC E_Control( settings){ var t,i,to s,fu,p,x,f n,fu,pn,s= settings;t his.undoRe doLevel=tr ue;this.is TinyMCE_Co ntrol=true ;this.enab led=true;t his.settin gs=s;this. settings.t heme=tinyM CE.getPara m("theme", "default") ;this.sett ings.width =tinyMCE.g etParam("w idth",-1); this.setti ngs.height =tinyMCE.g etParam("h eight",-1) ;this.sele ction=new  TinyMCE_Se lection(th is);this.u ndoRedo=ne w TinyMCE_ UndoRedo(t his);this. cleanup=ne w TinyMCE_ Cleanup(); this.short cuts=[];th is.hasMous eMoved=fal se;this.fo reColor=th is.backCol or="#99999 9";this.da ta={};this .cssClasse s=[];this. cleanup.in it({valid_ elements:s .valid_ele ments,exte nded_valid _elements: s.extended _valid_ele ments,vali d_child_el ements:s.v alid_child _elements, entities:s .entities, entity_enc oding:s.en tity_encod ing,debug: s.cleanup_ debug,inde nt:s.apply _source_fo rmatting,i nvalid_ele ments:s.in valid_elem ents,verif y_html:s.v erify_html ,fix_conte nt_duplica tion:s.fix _content_d uplication ,convert_f onts_to_sp ans:s.conv ert_fonts_ to_spans}) ;t=this.se ttings.the me;if(!tin yMCE.hasTh eme(t)){fn =tinyMCE.c allbacks;t os={};for( i=0;i<fn.l ength;i++) {if((fu=wi ndow['Tiny MCE_'+t+"_ "+fn[i]])) tos[fn[i]] =fu}tinyMC E.addTheme (t,tos)}th is.plugins =[];p=tiny MCE.getPar am('plugin s','',true ,',');if(p .length>0) {for(i=0;i <p.length; i++){pn=p[ i];if(pn.c harAt(0)== '-')pn=pn. substring( 1);if(!tin yMCE.hasPl ugin(pn)){ fn=tinyMCE .callbacks ;tos={};fo r(x=0;x<fn .length;x+ +){if((fu= window['Ti nyMCE_'+pn +"_"+fn[x] ]))tos[fn[ x]]=fu}tin yMCE.addPl ugin(pn,to s)}this.pl ugins[this .plugins.l ength]=pn} }};TinyMCE _Control.p rototype={ selection: null,setti ngs:null,c leanup:nul l,getData: function(n a){var o=t his.data[n a];if(!o)o =this.data [na]={};re turn o},ha sPlugin:fu nction(n){ var i;for( i=0;i<this .plugins.l ength;i++) {if(this.p lugins[i]= =n)return  true}retur n false},a ddPlugin:f unction(n, p){if(!thi s.hasPlugi n(n)){tiny MCE.addPlu gin(n,p);t his.plugin s[this.plu gins.lengt h]=n}},rep aint:funct ion(){var  s,b,ex;if( tinyMCE.is RealIE)ret urn;try{s= this.selec tion;b=s.g etBookmark (true);thi s.getBody( ).style.di splay='non e';this.ge tDoc().exe cCommand(' selectall' ,false,nul l);this.ge tSel().col lapseToSta rt();this. getBody(). style.disp lay='block ';s.moveTo Bookmark(b )}catch(ex ){}},switc hSettings: function() {if(tinyMC E.configs. length>1&& tinyMCE.cu rrentConfi g!=this.se ttings.ind ex){tinyMC E.settings =this.sett ings;tinyM CE.current Config=thi s.settings .index}},s elect:func tion(){var  oldInst=t inyMCE.sel ectedInsta nce;if(old Inst!=this ){if(oldIn st)oldInst .execComma nd('mceEnd Typing');t inyMCE.dis patchCallb ack(this,' select_ins tance_call back','sel ectInstanc e',this,ol dInst);tin yMCE.selec tedInstanc e=this}},g etBody:fun ction(){re turn this. contentBod y?this.con tentBody:t his.getDoc ().body},g etDoc:func tion(){ret urn this.c ontentWind ow.documen t},getWin: function() {return th is.content Window},ge tContainer Win:functi on(){retur n this.con tainerWind ow?this.co ntainerWin dow:window },getViewP ort:functi on(){retur n tinyMCE. getViewPor t(this.get Win())},ge tParentNod e:function (n,f){retu rn tinyMCE .getParent Node(n,f,t his.getBod y())},getP arentEleme nt:functio n(n,na,f){ return tin yMCE.getPa rentElemen t(n,na,f,t his.getBod y())},getP arentBlock Element:fu nction(n){ return tin yMCE.getPa rentBlockE lement(n,t his.getBod y())},resi zeToConten t:function (){var d=t his.getDoc (),b=d.bod y,de=d.doc umentEleme nt;this.if rameElemen t.style.he ight=(tiny MCE.isReal IE)?b.scro llHeight:d e.offsetHe ight+'px'} ,addShortc ut:functio n(m,k,d,cm d,ui,va){v ar n=typeo f(k)=="num ber",ie=ti nyMCE.isIE ,c,sc,i,sc l=this.sho rtcuts;if( !tinyMCE.g etParam('c ustom_shor tcuts'))re turn false ;m=m.toLow erCase();k =ie&&!n?k. toUpperCas e():k;c=n? null:k.cha rCodeAt(0) ;d=d&&d.in dexOf('lan g_')==0?ti nyMCE.getL ang(d):d;s c={alt:m.i ndexOf('al t')!=-1,ct rl:m.index Of('ctrl') !=-1,shift :m.indexOf ('shift')! =-1,charCo de:c,keyCo de:n?k:(ie ?c:null),d esc:d,cmd: cmd,ui:ui, val:va};fo r(i=0;i<sc l.length;i ++){if(sc. alt==scl[i ].alt&&sc. ctrl==scl[ i].ctrl&&s c.shift==s cl[i].shif t&&sc.char Code==scl[ i].charCod e&&sc.keyC ode==scl[i ].keyCode) {return fa lse}}scl[s cl.length] =sc;return  true},han dleShortcu t:function (e){var i, s,o;if(!e. altKey&&!e .ctrlKey)r eturn fals e;s=this.s hortcuts;f or(i=0;i<s .length;i+ +){o=s[i]; if(o.alt== e.altKey&& o.ctrl==e. ctrlKey&&( o.keyCode= =e.keyCode ||o.charCo de==e.char Code)){if( o.cmd&&(e. type=="key down"||(e. type=="key press"&&!t inyMCE.isO pera)))tin yMCE.execC ommand(o.c md,o.ui,o. val);tinyM CE.cancelE vent(e);re turn true} }return fa lse},autoR esetDesign Mode:funct ion(){if(! tinyMCE.is IE&&this.i sHidden()& &tinyMCE.g etParam('a uto_reset_ designmode '))eval('t ry { this. getDoc().d esignMode  = "On"; th is.useCSS  = false; }  catch(e)  {}')},isHi dden:funct ion(){var  s;if(tinyM CE.isIE)re turn false ;s=this.ge tSel();ret urn(!s||!s .rangeCoun t||s.range Count==0)} ,isDirty:f unction(){ return tin yMCE.trim( this.start Content)!= tinyMCE.tr im(this.ge tBody().in nerHTML)&& !this.isNo tDirty},_m ergeElemen ts:functio n(scmd,pa, ch,overrid e){var st, stc,classN ame,n;if(s cmd=="remo veformat") {pa.classN ame="";pa. style.cssT ext="";ch. className= "";ch.styl e.cssText= "";return} st=tinyMCE .parseStyl e(tinyMCE. getAttrib( pa,"style" ));stc=tin yMCE.parse Style(tiny MCE.getAtt rib(ch,"st yle"));cla ssName=tin yMCE.getAt trib(pa,"c lass");cla ssName=tin yMCE.getAt trib(ch,"c lass");if( override){ for(n in s t){if(type of(st[n])= ='function ')continue ;stc[n]=st [n]}}else{ for(n in s tc){if(typ eof(stc[n] )=='functi on')contin ue;st[n]=s tc[n]}}tin yMCE.setAt trib(pa,"s tyle",tiny MCE.serial izeStyle(s t));tinyMC E.setAttri b(pa,"clas s",tinyMCE .trim(clas sName));ch .className ="";ch.sty le.cssText ="";ch.rem oveAttribu te("class" );ch.remov eAttribute ("style")} ,_fixRootB locks:func tion(){var  rb,b,ne,b e,nx,bm;rb =tinyMCE.g etParam('f orced_root _block');i f(!rb)retu rn;b=this. getBody(); ne=b.first Child;whil e(ne){nx=n e.nextSibl ing;if(ne. nodeType== 3||!tinyMC E.blockReg Exp.test(n e.nodeName )){if(!bm) bm=this.se lection.ge tBookmark( );if(!be){ be=this.ge tDoc().cre ateElement (rb);be.ap pendChild( ne.cloneNo de(true)); b.replaceC hild(be,ne )}else{be. appendChil d(ne.clone Node(true) );b.remove Child(ne)} }else be=n ull;ne=nx} if(bm)this .selection .moveToBoo kmark(bm)} ,_fixTrail ingNbsp:fu nction(){v ar s=this. selection, e=s.getFoc usElement( ),bm,v;if( e&&tinyMCE .blockRegE xp.test(e. nodeName)& &e.firstCh ild){v=e.f irstChild. nodeValue; if(v&&v.le ngth>1&&/( ^\u00a0|\u 00a0$)/.te st(v)){e.f irstChild. nodeValue= v.replace( /(^\u00a0| \u00a0$)/, '');s.sele ctNode(e.f irstChild, true,false ,false);}} },_setUseC SS:functio n(b){var d =this.getD oc();try{d .execComma nd("useCSS ",false,!b )}catch(ex ){}try{d.e xecCommand ("styleWit hCSS",fals e,b)}catch (ex){}if(! tinyMCE.ge tParam("ta ble_inline _editing") )try{d.exe cCommand(' enableInli neTableEdi ting',fals e,"false") }catch(ex) {}if(!tiny MCE.getPar am("object _resizing" ))try{d.ex ecCommand( 'enableObj ectResizin g',false," false")}ca tch(ex){}} ,execComma nd:functio n(command, user_inter face,value ){var i,x, z,align,im g,div,doc= this.getDo c(),win=th is.getWin( ),focusElm =this.getF ocusElemen t();if(!ne w RegExp(' mceStartTy ping|mceEn dTyping|mc eBeginUndo Level|mceE ndUndoLeve l|mceAddUn doLevel',' gi').test( command))t his.undoBo okmark=nul l;if(!tiny MCE.isIE&& !this.useC SS){this._ setUseCSS( false);thi s.useCSS=t rue}this.c ontentDocu ment=doc;i f(!/mceSta rtTyping|m ceEndTypin g/.test(co mmand)){if (tinyMCE.e xecCommand Callback(t his,'execc ommand_cal lback','ex ecCommand' ,this.edit orId,this. getBody(), command,us er_interfa ce,value)) return}if( focusElm&& focusElm.n odeName==" IMG"){alig n=focusElm .getAttrib ute('align ');img=com mand=="Jus tifyCenter "?focusElm .cloneNode (false):fo cusElm;swi tch(comman d){case"Ju stifyLeft" :if(align= ='left')im g.removeAt tribute('a lign');els e img.setA ttribute(' align','le ft');div=f ocusElm.pa rentNode;i f(div&&div .nodeName= ="DIV"&&di v.childNod es.length= =1&&div.pa rentNode)d iv.parentN ode.replac eChild(img ,div);this .selection .selectNod e(img);thi s.repaint( );tinyMCE. triggerNod eChange(); return;cas e"JustifyC enter":img .removeAtt ribute('al ign');div= tinyMCE.ge tParentEle ment(focus Elm,"div") ;if(div&&d iv.style.t extAlign== "center"){ if(div.nod eName=="DI V"&&div.ch ildNodes.l ength==1&& div.parent Node)div.p arentNode. replaceChi ld(img,div )}else{div =this.getD oc().creat eElement(" div");div. style.text Align='cen ter';div.a ppendChild (img);focu sElm.paren tNode.repl aceChild(d iv,focusEl m)}this.se lection.se lectNode(i mg);this.r epaint();t inyMCE.tri ggerNodeCh ange();ret urn;case"J ustifyRigh t":if(alig n=='right' )img.remov eAttribute ('align'); else img.s etAttribut e('align', 'right');d iv=focusEl m.parentNo de;if(div& &div.nodeN ame=="DIV" &&div.chil dNodes.len gth==1&&di v.parentNo de)div.par entNode.re placeChild (img,div); this.selec tion.selec tNode(img) ;this.repa int();tiny MCE.trigge rNodeChang e();return }}if(tinyM CE.setting s.force_br _newlines) {var align Value="";i f(doc.sele ction.type !="Control "){switch( command){c ase"Justif yLeft":ali gnValue="l eft";break ;case"Just ifyCenter" :alignValu e="center" ;break;cas e"JustifyF ull":align Value="jus tify";brea k;case"Jus tifyRight" :alignValu e="right"; break}if(a lignValue! ==''){var  rng=doc.se lection.cr eateRange( );if((divE lm=tinyMCE .getParent Element(rn g.parentEl ement(),"d iv"))!=nul l)divElm.s etAttribut e("align", alignValue );else if( rng.pasteH TML&&rng.h tmlText.le ngth>0)rng .pasteHTML ('<div ali gn="'+alig nValue+'"> '+rng.html Text+"</di v>");tinyM CE.trigger NodeChange ();return} }}switch(c ommand){ca se"mceRepa int":this. repaint(); return tru e;case"unl ink":if(ti nyMCE.isGe cko&&this. getSel().i sCollapsed ){focusElm =tinyMCE.g etParentEl ement(focu sElm,'A'); if(focusEl m)this.sel ection.sel ectNode(fo cusElm,fal se)}this.g etDoc().ex ecCommand( command,us er_interfa ce,value); tinyMCE.is Gecko&&thi s.getSel() .collapseT oEnd();tin yMCE.trigg erNodeChan ge();retur n true;cas e"InsertUn orderedLis t":case"In sertOrdere dList":thi s.getDoc() .execComma nd(command ,user_inte rface,valu e);tinyMCE .triggerNo deChange() ;break;cas e"Striketh rough":thi s.getDoc() .execComma nd(command ,user_inte rface,valu e);tinyMCE .triggerNo deChange() ;break;cas e"mceSelec tNode":thi s.selectio n.selectNo de(value); tinyMCE.tr iggerNodeC hange();ti nyMCE.sele ctedNode=v alue;break ;case"Form atBlock":i f(value==n ull||value ==''){var  elm=tinyMC E.getParen tElement(t his.getFoc usElement( ),"p,div,h 1,h2,h3,h4 ,h5,h6,pre ,address,b lockquote, dt,dl,dd,s amp");if(e lm)this.ex ecCommand( "mceRemove Node",fals e,elm)}els e{if(!this .cleanup.i sValid(val ue))return  true;if(t inyMCE.isG ecko&&new  RegExp('<( div|blockq uote|code| dt|dd|dl|s amp)>','gi ').test(va lue))value =value.rep lace(/[^a- z]/gi,''); if(tinyMCE .isIE&&new  RegExp('b lockquote| code|samp' ,'gi').tes t(value)){ var b=this .selection .getBookma rk();this. getDoc().e xecCommand ("FormatBl ock",false ,'<p>');ti nyMCE.rena meElement( tinyMCE.ge tParentBlo ckElement( this.getFo cusElement ()),value) ;this.sele ction.move ToBookmark (b)}else t his.getDoc ().execCom mand("Form atBlock",f alse,value )}tinyMCE. triggerNod eChange(); break;case "mceRemove Node":if(! value)valu e=tinyMCE. getParentE lement(thi s.getFocus Element()) ;if(tinyMC E.isIE){va lue.outerH TML=value. innerHTML} else{var r ng=value.o wnerDocume nt.createR ange();rng .setStartB efore(valu e);rng.set EndAfter(v alue);rng. deleteCont ents();rng .insertNod e(rng.crea teContextu alFragment (value.inn erHTML))}t inyMCE.tri ggerNodeCh ange();bre ak;case"mc eSelectNod eDepth":va r parentNo de=this.ge tFocusElem ent();for( i=0;parent Node;i++){ if(parentN ode.nodeNa me.toLower Case()=="b ody")break ;if(parent Node.nodeN ame.toLowe rCase()==" #text"){i- -;parentNo de=parentN ode.parent Node;conti nue}if(i== value){thi s.selectio n.selectNo de(parentN ode,false) ;tinyMCE.t riggerNode Change();t inyMCE.sel ectedNode= parentNode ;return}pa rentNode=p arentNode. parentNode }break;cas e"mceSetSt yleInfo":c ase"SetSty leInfo":va r rng=this .getRng(); var sel=th is.getSel( );var scmd =value.com mand;var s name=value .name;var  svalue=val ue.value== null?'':va lue.value; var wrappe r=value.wr apper?valu e.wrapper: "span";var  parentElm =null;var  invalidRe= new RegExp ("^BODY|HT ML$","g"); var invali dParentsRe =tinyMCE.s ettings.me rge_styles _invalid_p arents!==' '?new RegE xp(tinyMCE .settings. merge_styl es_invalid _parents," gi"):null; if(tinyMCE .isIE){if( rng.item)p arentElm=r ng.item(0) ;else{var  pelm=rng.p arentEleme nt();var p rng=doc.se lection.cr eateRange( );prng.mov eToElement Text(pelm) ;if(rng.ht mlText==pr ng.htmlTex t||rng.bou ndingWidth ==0){if(in validParen tsRe==null ||!invalid ParentsRe. test(pelm. nodeName)) parentElm= pelm}}}els e{var felm =this.getF ocusElemen t();if(sel .isCollaps ed||(new R egExp('td| tr|tbody|t able|img', 'gi').test (felm.node Name)&&sel .anchorNod e==felm.pa rentNode)) parentElm= felm}if(pa rentElm&&! invalidRe. test(paren tElm.nodeN ame)){if(s cmd=="sets tyle")tiny MCE.setSty leAttrib(p arentElm,s name,svalu e);if(scmd =="setattr ib")tinyMC E.setAttri b(parentEl m,sname,sv alue);if(s cmd=="remo veformat") {parentElm .style.css Text='';ti nyMCE.setA ttrib(pare ntElm,'cla ss','')}va r ch=tinyM CE.getNode Tree(paren tElm,[],1) ;for(z=0;z <ch.length ;z++){if(c h[z]==pare ntElm)cont inue;if(sc md=="setst yle")tinyM CE.setStyl eAttrib(ch [z],sname, '');if(scm d=="setatt rib")tinyM CE.setAttr ib(ch[z],s name,'');i f(scmd=="r emoveforma t"){ch[z]. style.cssT ext='';tin yMCE.setAt trib(ch[z] ,'class',' ')}}}else{ this._setU seCSS(fals e);doc.exe cCommand(" FontName", false,"#mc e_temp_fon t#");var e lementArra y=tinyMCE. getElement sByAttribu teValue(th is.getBody (),"font", "face","#m ce_temp_fo nt#");for( x=0;x<elem entArray.l ength;x++) {elm=eleme ntArray[x] ;if(elm){v ar spanElm =doc.creat eElement(w rapper);if (scmd=="se tstyle")ti nyMCE.setS tyleAttrib (spanElm,s name,svalu e);if(scmd =="setattr ib")tinyMC E.setAttri b(spanElm, sname,sval ue);if(scm d=="remove format"){s panElm.sty le.cssText ='';tinyMC E.setAttri b(spanElm, 'class','' )}if(elm.h asChildNod es()){for( i=0;i<elm. childNodes .length;i+ +)spanElm. appendChil d(elm.chil dNodes[i]. cloneNode( true))}spa nElm.setAt tribute("m ce_new","t rue");elm. parentNode .replaceCh ild(spanEl m,elm);var  ch=tinyMC E.getNodeT ree(spanEl m,[],1);fo r(z=0;z<ch .length;z+ +){if(ch[z ]==spanElm )continue; if(scmd==" setstyle") tinyMCE.se tStyleAttr ib(ch[z],s name,'');i f(scmd=="s etattrib") tinyMCE.se tAttrib(ch [z],sname, '');if(scm d=="remove format"){c h[z].style .cssText=' ';tinyMCE. setAttrib( ch[z],'cla ss','')}}} }}var node s=doc.getE lementsByT agName(wra pper);for( i=nodes.le ngth-1;i>= 0;i--){var  elm=nodes [i];var is New=tinyMC E.getAttri b(elm,"mce _new")=="t rue";elm.r emoveAttri bute("mce_ new");if(e lm.childNo des&&elm.c hildNodes. length==1& &elm.child Nodes[0].n odeType==1 ){this._me rgeElement s(scmd,elm ,elm.child Nodes[0],i sNew);cont inue}if(el m.parentNo de.childNo des.length ==1&&!inva lidRe.test (elm.nodeN ame)&&!inv alidRe.tes t(elm.pare ntNode.nod eName)){if (invalidPa rentsRe==n ull||!inva lidParents Re.test(el m.parentNo de.nodeNam e))this._m ergeElemen ts(scmd,el m.parentNo de,elm,fal se)}}var n odes=doc.g etElements ByTagName( wrapper);f or(i=nodes .length-1; i>=0;i--){ var elm=no des[i],isE mpty=true; var tmp=do c.createEl ement("bod y");tmp.ap pendChild( elm.cloneN ode(false) );tmp.inne rHTML=tmp. innerHTML. replace(ne w RegExp(' style=""|c lass=""',' gi'),'');i f(new RegE xp('<span> ','gi').te st(tmp.inn erHTML)){f or(x=0;x<e lm.childNo des.length ;x++){if(e lm.parentN ode!=null) elm.parent Node.inser tBefore(el m.childNod es[x].clon eNode(true ),elm)}elm .parentNod e.removeCh ild(elm)}} if(scmd==" removeform at")tinyMC E.handleVi sualAid(th is.getBody (),true,th is.visualA id,this);t inyMCE.tri ggerNodeCh ange();bre ak;case"Fo ntName":if (value==nu ll){var s= this.getSe l();if(tin yMCE.isGec ko&&s.isCo llapsed){v ar f=tinyM CE.getPare ntElement( this.getFo cusElement (),"font") ;if(f!=nul l)this.sel ection.sel ectNode(f, false)}thi s.getDoc() .execComma nd("Remove Format",fa lse,null); if(f!=null &&tinyMCE. isGecko){v ar r=this. getRng().c loneRange( );r.collap se(true);s .removeAll Ranges();s .addRange( r)}}else t his.getDoc ().execCom mand('Font Name',fals e,value);i f(tinyMCE. isGecko)wi ndow.setTi meout('tin yMCE.trigg erNodeChan ge(false); ',1);retur n;case"Fon tSize":thi s.getDoc() .execComma nd('FontSi ze',false, value);if( tinyMCE.is Gecko)wind ow.setTime out('tinyM CE.trigger NodeChange (false);', 1);return; case"forec olor":valu e=value==n ull?this.f oreColor:v alue;value =tinyMCE.t rim(value) ;value=val ue.charAt( 0)!='#'?(i sNaN('0x'+ value)?val ue:'#'+val ue):value; this.foreC olor=value ;this.getD oc().execC ommand('fo recolor',f alse,value );break;ca se"HiliteC olor":valu e=value==n ull?this.b ackColor:v alue;value =tinyMCE.t rim(value) ;value=val ue.charAt( 0)!='#'?(i sNaN('0x'+ value)?val ue:'#'+val ue):value; this.backC olor=value ;if(tinyMC E.isGecko) {this._set UseCSS(tru e);this.ge tDoc().exe cCommand(' hilitecolo r',false,v alue);this ._setUseCS S(false)}e lse this.g etDoc().ex ecCommand( 'BackColor ',false,va lue);break ;case"Cut" :case"Copy ":case"Pas te":var cm dFailed=fa lse;eval(' try {this. getDoc().e xecCommand (command,  user_inter face, valu e);} catch  (e) {cmdF ailed = tr ue;}');if( tinyMCE.is Opera&&cmd Failed)ale rt('Curren tly not su pported by  your brow ser, use k eyboard sh ortcuts in stead.');i f(tinyMCE. isGecko&&c mdFailed){ if(confirm (tinyMCE.e ntityDecod e(tinyMCE. getLang('l ang_clipbo ard_msg')) ))window.o pen('http: //www.mozi lla.org/ed itor/midas demo/secur ityprefs.h tml','mceE xternal'); return}els e tinyMCE. triggerNod eChange(); break;case "mceSetCon tent":if(! value)valu e="";value =tinyMCE.s toreAwayUR Ls(value); value=tiny MCE._custo mCleanup(t his,"inser t_to_edito r",value); if(this.ge tBody().no deName=='B ODY')tinyM CE._setHTM L(doc,valu e);else th is.getBody ().innerHT ML=value;t inyMCE.set InnerHTML( this.getBo dy(),tinyM CE._cleanu pHTML(this ,doc,this. settings,t his.getBod y(),false, false,fals e,true));t inyMCE.con vertAllRel ativeURLs( this.getBo dy());tiny MCE._remov eInternal( this.getBo dy());if(t inyMCE.get Param("con vert_fonts _to_spans" ))tinyMCE. convertSpa nsToFonts( doc);tinyM CE.handleV isualAid(t his.getBod y(),true,t his.visual Aid,this); tinyMCE._s etEventsEn abled(this .getBody() ,false);th is._addBog usBR();ret urn true;c ase"mceCle anup":var  b=this.sel ection.get Bookmark() ;tinyMCE._ setHTML(th is.content Document,t his.getBod y().innerH TML);tinyM CE.setInne rHTML(this .getBody() ,tinyMCE._ cleanupHTM L(this,thi s.contentD ocument,th is.setting s,this.get Body(),thi s.visualAi d));tinyMC E.convertA llRelative URLs(doc.b ody);if(ti nyMCE.getP aram("conv ert_fonts_ to_spans") )tinyMCE.c onvertSpan sToFonts(d oc);tinyMC E.handleVi sualAid(th is.getBody (),true,th is.visualA id,this);t inyMCE._se tEventsEna bled(this. getBody(), false);thi s._addBogu sBR();this .repaint() ;this.sele ction.move ToBookmark (b);tinyMC E.triggerN odeChange( );break;ca se"mceRepl aceContent ":if(!valu e)value='' ;this.getW in().focus ();var sel ectedText= "";if(tiny MCE.isIE){ var rng=do c.selectio n.createRa nge();sele ctedText=r ng.text}el se selecte dText=this .getSel(). toString() ;if(select edText.len gth>0){val ue=tinyMCE .replaceVa r(value,"s election", selectedTe xt);tinyMC E.execComm and('mceIn sertConten t',false,v alue)}this ._addBogus BR();tinyM CE.trigger NodeChange ();break;c ase"mceSet Attribute" :if(typeof (value)==' object'){v ar targetE lms=(typeo f(value.ta rgets)=="u ndefined") ?"p,img,sp an,div,td, h1,h2,h3,h 4,h5,h6,pr e,address" :value.tar gets;var t argetNode= tinyMCE.ge tParentEle ment(this. getFocusEl ement(),ta rgetElms); if(targetN ode){targe tNode.setA ttribute(v alue.name, value.valu e);tinyMCE .triggerNo deChange() }}break;ca se"mceSetC SSClass":t his.execCo mmand("mce SetStyleIn fo",false, {command:" setattrib" ,name:"cla ss",value: value});br eak;case"m ceInsertRa wHTML":var  key='tiny _mce_marke r';this.ex ecCommand( 'mceBeginU ndoLevel') ;this.exec Command('m ceInsertCo ntent',fal se,key);va r scrollX= this.getBo dy().scrol lLeft+this .getDoc(). documentEl ement.scro llLeft;var  scrollY=t his.getBod y().scroll Top+this.g etDoc().do cumentElem ent.scroll Top;var ht ml=this.ge tBody().in nerHTML;if ((pos=html .indexOf(k ey))!=-1)t inyMCE.set InnerHTML( this.getBo dy(),html. substring( 0,pos)+val ue+html.su bstring(po s+key.leng th));this. contentWin dow.scroll To(scrollX ,scrollY); this.execC ommand('mc eEndUndoLe vel');brea k;case"mce InsertCont ent":if(!v alue)value ='';var in sertHTMLFa iled=false ;if(tinyMC E.isGecko| |tinyMCE.i sOpera){tr y{if(value .indexOf(' <')==-1&&! value.matc h(/(&#38;| &#160;|&#6 0;|&#62;)/ g)){var r= this.getRn g();var n= this.getDo c().create TextNode(t inyMCE.ent ityDecode( value));va r s=this.g etSel();va r r2=r.clo neRange(); s.removeAl lRanges(); r.deleteCo ntents();r .insertNod e(n);r2.se lectNode(n );r2.colla pse(false) ;s.removeA llRanges() ;s.addRang e(r2)}else {value=tin yMCE.fixGe ckoBaseHRE FBug(1,thi s.getDoc() ,value);th is.getDoc( ).execComm and('inser thtml',fal se,value); tinyMCE.fi xGeckoBase HREFBug(2, this.getDo c(),value) }}catch(ex ){insertHT MLFailed=t rue}if(!in sertHTMLFa iled){tiny MCE.trigge rNodeChang e();return }}if(!tiny MCE.isIE){ var isHTML =value.ind exOf('<')! =-1;var se l=this.get Sel();var  rng=this.g etRng();if (isHTML){i f(tinyMCE. isSafari){ var tmpRng =this.getD oc().creat eRange();t mpRng.setS tart(this. getBody(), 0);tmpRng. setEnd(thi s.getBody( ),0);value =tmpRng.cr eateContex tualFragme nt(value)} else value =rng.creat eContextua lFragment( value)}els e{value=do c.createTe xtNode(tin yMCE.entit yDecode(va lue))}if(t inyMCE.isS afari&&!is HTML){this .execComma nd('Insert Text',fals e,value.no deValue);t inyMCE.tri ggerNodeCh ange();ret urn true}e lse if(tin yMCE.isSaf ari&&isHTM L){rng.del eteContent s();rng.in sertNode(v alue);tiny MCE.trigge rNodeChang e();return  true}rng. deleteCont ents();if( rng.startC ontainer.n odeType==3 ){var node =rng.start Container. splitText( rng.startO ffset);nod e.parentNo de.insertB efore(valu e,node)}el se rng.ins ertNode(va lue);if(!i sHTML){sel .selectAll Children(d oc.body);s el.removeA llRanges() ;var rng=d oc.createR ange();rng .selectNod e(value);r ng.collaps e(false);s el.addRang e(rng)}els e rng.coll apse(false );tinyMCE. fixGeckoBa seHREFBug( 2,this.get Doc(),valu e)}else{va r rng=doc. selection. createRang e(),tmpRng =null;var  c=value.in dexOf('<!- -')!=-1;if (c)value=t inyMCE.uni queTag+val ue;if(rng. item)rng.i tem(0).out erHTML=val ue;else rn g.pasteHTM L(value);i f(c){var e =this.getD oc().getEl ementById( 'mceTMPEle ment');e.p arentNode. removeChil d(e)}}tiny MCE.execCo mmand("mce AddUndoLev el");tinyM CE.trigger NodeChange ();break;c ase"mceSta rtTyping": if(tinyMCE .settings. custom_und o_redo&&th is.undoRed o.typingUn doIndex==- 1){this.un doRedo.typ ingUndoInd ex=this.un doRedo.und oIndex;tin yMCE.typin gUndoIndex =tinyMCE.u ndoIndex;t his.execCo mmand('mce AddUndoLev el')}break ;case"mceE ndTyping": if(tinyMCE .settings. custom_und o_redo&&th is.undoRed o.typingUn doIndex!=- 1){this.ex ecCommand( 'mceAddUnd oLevel');t his.undoRe do.typingU ndoIndex=- 1}tinyMCE. typingUndo Index=-1;b reak;case" mceBeginUn doLevel":t his.undoRe doLevel=fa lse;break; case"mceEn dUndoLevel ":this.und oRedoLevel =true;this .execComma nd('mceAdd UndoLevel' );break;ca se"mceAddU ndoLevel": if(tinyMCE .settings. custom_und o_redo&&th is.undoRed oLevel){if (this.undo Redo.add() )tinyMCE.t riggerNode Change(fal se)}break; case"Undo" :if(tinyMC E.settings .custom_un do_redo){t inyMCE.exe cCommand(" mceEndTypi ng");this. undoRedo.u ndo();tiny MCE.trigge rNodeChang e()}else t his.getDoc ().execCom mand(comma nd,user_in terface,va lue);break ;case"Redo ":if(tinyM CE.setting s.custom_u ndo_redo){ tinyMCE.ex ecCommand( "mceEndTyp ing");this .undoRedo. redo();tin yMCE.trigg erNodeChan ge()}else  this.getDo c().execCo mmand(comm and,user_i nterface,v alue);brea k;case"mce ToggleVisu alAid":thi s.visualAi d=!this.vi sualAid;ti nyMCE.hand leVisualAi d(this.get Body(),tru e,this.vis ualAid,thi s);tinyMCE .triggerNo deChange() ;break;cas e"Indent": this.getDo c().execCo mmand(comm and,user_i nterface,v alue);tiny MCE.trigge rNodeChang e();if(tin yMCE.isIE) {var n=tin yMCE.getPa rentElemen t(this.get FocusEleme nt(),"bloc kquote");d o{if(n&&n. nodeName== "BLOCKQUOT E"){n.remo veAttribut e("dir");n .removeAtt ribute("st yle")}}whi le(n!=null &&(n=n.par entNode)!= null)}brea k;case"Rem oveFormat" :case"remo veformat": var text=t his.select ion.getSel ectedText( );if(tinyM CE.isOpera ){this.get Doc().exec Command("R emoveForma t",false,n ull);retur n}if(tinyM CE.isIE){t ry{var rng =doc.selec tion.creat eRange();r ng.execCom mand("Remo veFormat", false,null )}catch(e) {}this.exe cCommand(" mceSetStyl eInfo",fal se,{comman d:"removef ormat"})}e lse{this.g etDoc().ex ecCommand( command,us er_interfa ce,value); this.execC ommand("mc eSetStyleI nfo",false ,{command: "removefor mat"})}if( text.lengt h==0)this. execComman d("mceSetC SSClass",f alse,"");t inyMCE.tri ggerNodeCh ange();bre ak;default :this.getD oc().execC ommand(com mand,user_ interface, value);if( tinyMCE.is Gecko)wind ow.setTime out('tinyM CE.trigger NodeChange (false);', 1);else ti nyMCE.trig gerNodeCha nge()}if(c ommand!="m ceAddUndoL evel"&&com mand!="Und o"&&comman d!="Redo"& &command!= "mceStartT yping"&&co mmand!="mc eEndTyping ")tinyMCE. execComman d("mceAddU ndoLevel") },queryCom mandValue: function(c ){try{retu rn this.ge tDoc().que ryCommandV alue(c)}ca tch(e){ret urn null}} ,queryComm andState:f unction(c) {return th is.getDoc( ).queryCom mandState( c)},_addBo gusBR:func tion(){var  b=this.ge tBody();if (tinyMCE.i sGecko&&!b .hasChildN odes())b.i nnerHTML=' <br _moz_e ditor_bogu s_node="TR UE" />'},_ onAdd:func tion(repla ce_element ,form_elem ent_name,t arget_docu ment){var  hc,th,tos, editorTemp late,targe tDoc,delta Width,delt aHeight,ht ml,rng,fra gment;var  dynamicIFr ame,tElm,d oc,parentE lm;th=this .settings. theme;tos= tinyMCE.th emes[th];t argetDoc=t arget_docu ment?targe t_document :document; this.targe tDoc=targe tDoc;tinyM CE.themeUR L=tinyMCE. baseURL+"/ themes/"+t his.settin gs.theme;t his.settin gs.themeur l=tinyMCE. themeURL;i f(!replace _element){ alert("Err or: Could  not find t he target  element.") ;return fa lse}if(tos .getEditor Template)e ditorTempl ate=tos.ge tEditorTem plate(this .settings, this.edito rId);delta Width=edit orTemplate .delta_wid th?editorT emplate.de lta_width: 0;deltaHei ght=editor Template.d elta_heigh t?editorTe mplate.del ta_height: 0;html='<s pan id="'+ this.edito rId+'_pare nt" class= "mceEditor Container" >'+editorT emplate.ht ml;html=ti nyMCE.repl aceVar(htm l,"editor_ id",this.e ditorId);i f(!this.se ttings.def ault_docum ent)this.s ettings.de fault_docu ment=tinyM CE.baseURL +"/blank.h tm";this.s ettings.ol d_width=th is.setting s.width;th is.setting s.old_heig ht=this.se ttings.hei ght;if(thi s.settings .width==-1 )this.sett ings.width =replace_e lement.off setWidth;i f(this.set tings.heig ht==-1)thi s.settings .height=re place_elem ent.offset Height;if( this.setti ngs.width= =0)this.se ttings.wid th=replace _element.s tyle.width ;if(this.s ettings.he ight==0)th is.setting s.height=r eplace_ele ment.style .height;if (this.sett ings.width ==0)this.s ettings.wi dth=320;if (this.sett ings.heigh t==0)this. settings.h eight=240; this.setti ngs.area_w idth=parse Int(this.s ettings.wi dth);this. settings.a rea_height =parseInt( this.setti ngs.height );this.set tings.area _width+=de ltaWidth;t his.settin gs.area_he ight+=delt aHeight;th is.setting s.width_st yle=""+thi s.settings .width;thi s.settings .height_st yle=""+thi s.settings .height;if ((""+this. settings.w idth).inde xOf('%')!= -1)this.se ttings.are a_width="1 00%";else  this.setti ngs.width_ style+='px ';if((""+t his.settin gs.height) .indexOf(' %')!=-1)th is.setting s.area_hei ght="100%" ;else this .settings. height_sty le+='px';i f((""+repl ace_elemen t.style.wi dth).index Of('%')!=- 1){this.se ttings.wid th=replace _element.s tyle.width ;this.sett ings.area_ width="100 %";this.se ttings.wid th_style=" 100%"}if(( ""+replace _element.s tyle.heigh t).indexOf ('%')!=-1) {this.sett ings.heigh t=replace_ element.st yle.height ;this.sett ings.area_ height="10 0%";this.s ettings.he ight_style ="100%"}ht ml=tinyMCE .applyTemp late(html) ;this.sett ings.width =this.sett ings.old_w idth;this. settings.h eight=this .settings. old_height ;this.visu alAid=this .settings. visual;thi s.formTarg etElementI d=form_ele ment_name; if(replace _element.n odeName==" TEXTAREA"| |replace_e lement.nod eName=="IN PUT")this. startConte nt=replace _element.v alue;else  this.start Content=re place_elem ent.innerH TML;if(rep lace_eleme nt.nodeNam e!="TEXTAR EA"&&repla ce_element .nodeName! ="INPUT"){ this.oldTa rgetElemen t=replace_ element;hc ='<input t ype="hidde n" id="'+f orm_elemen t_name+'"  name="'+fo rm_element _name+'" / >';this.ol dTargetDis play=tinyM CE.getStyl e(this.old TargetElem ent,'displ ay','inlin e');this.o ldTargetEl ement.styl e.display= "none";htm l+='</span >';if(tiny MCE.isGeck o)html=hc+ html;else  html+=hc;i f(tinyMCE. isGecko){r ng=replace _element.o wnerDocume nt.createR ange();rng .setStartB efore(repl ace_elemen t);fragmen t=rng.crea teContextu alFragment (html);tin yMCE.inser tAfter(fra gment,repl ace_elemen t)}else re place_elem ent.insert AdjacentHT ML("before Begin",htm l)}else{ht ml+='</spa n>';this.o ldTargetEl ement=repl ace_elemen t;this.old TargetDisp lay=tinyMC E.getStyle (this.oldT argetEleme nt,'displa y','inline ');this.ol dTargetEle ment.style .display=" none";if(t inyMCE.isG ecko){rng= replace_el ement.owne rDocument. createRang e();rng.se tStartBefo re(replace _element); fragment=r ng.createC ontextualF ragment(ht ml);tinyMC E.insertAf ter(fragme nt,replace _element)} else repla ce_element .insertAdj acentHTML( "beforeBeg in",html)} dynamicIFr ame=false; tElm=targe tDoc.getEl ementById( this.edito rId);if(!t inyMCE.isI E){if(tElm &&(tElm.no deName=="S PAN"||tElm .nodeName= ="span")){ tElm=tinyM CE._create IFrame(tEl m,targetDo c);dynamic IFrame=tru e}this.tar getElement =tElm;this .iframeEle ment=tElm; this.conte ntDocument =tElm.cont entDocumen t;this.con tentWindow =tElm.cont entWindow; }else{if(t Elm&&tElm. nodeName== "SPAN")tEl m=tinyMCE. _createIFr ame(tElm,t argetDoc,t argetDoc.p arentWindo w);else tE lm=targetD oc.frames[ this.edito rId];this. targetElem ent=tElm;t his.iframe Element=ta rgetDoc.ge tElementBy Id(this.ed itorId);if (tinyMCE.i sOpera){th is.content Document=t his.iframe Element.co ntentDocum ent;this.c ontentWind ow=this.if rameElemen t.contentW indow;dyna micIFrame= true}else{ this.conte ntDocument =tElm.wind ow.documen t;this.con tentWindow =tElm.wind ow}this.ge tDoc().des ignMode="o n"}doc=thi s.contentD ocument;if (dynamicIF rame){html =tinyMCE.g etParam('d octype')+' <html><hea d xmlns="h ttp://www. w3.org/199 9/xhtml">< base href= "'+tinyMCE .settings. base_href+ '" /><titl e>blank_pa ge</title> <meta http -equiv="Co ntent-Type " content= "text/html ; charset= UTF-8"></h ead><body  class="mce ContentBod y"></body> </html>';t ry{if(!thi s.isHidden ())this.ge tDoc().des ignMode="o n";doc.ope n();doc.wr ite(html); doc.close( )}catch(e) {this.getD oc().locat ion.href=t inyMCE.bas eURL+"/bla nk.htm"}}i f(tinyMCE. isIE)windo w.setTimeo ut("tinyMC E.addEvent Handlers(t inyMCE.ins tances[\"" +this.edit orId+"\"]) ;",1);pare ntElm=this .targetDoc .getElemen tById(this .editorId+ '_parent') ;this.form Element=ti nyMCE.isGe cko?parent Elm.previo usSibling: parentElm. nextSiblin g;tinyMCE. setupConte nt(this.ed itorId,tru e);return  true},setB aseHREF:fu nction(u){ var h,b,d, nl;d=this. getDoc();n l=d.getEle mentsByTag Name("base ");b=nl.le ngth>0?nl[ 0]:null;if (!b){nl=d. getElement sByTagName ("head");h =nl.length >0?nl[0]:n ull;b=d.cr eateElemen t("base"); b.setAttri bute('href ',u);h.app endChild(b )}else{if( u==''||u== null)b.par entNode.re moveChild( b);else b. setAttribu te('href', u)}},getHT ML:functio n(r){var h ,d=this.ge tDoc(),b=t his.getBod y();if(r)r eturn b.in nerHTML;h= tinyMCE._c leanupHTML (this,d,th is.setting s,b,false, true,false ,true);if( tinyMCE.ge tParam("co nvert_font s_to_spans "))tinyMCE .convertSp ansToFonts (d);return  h},setHTM L:function (h){this.e xecCommand ('mceSetCo ntent',fal se,h);this .repaint() },getFocus Element:fu nction(){r eturn this .selection .getFocusE lement()}, getSel:fun ction(){re turn this. selection. getSel()}, getRng:fun ction(){re turn this. selection. getRng()}, triggerSav e:function (skip_clea nup,skip_c allback){v ar e,nl=[] ,i,s,conte nt,htm;if( !this.enab led)return ;this.swit chSettings ();s=tinyM CE.setting s;if(tinyM CE.isRealI E){e=this. iframeElem ent;do{if( e.style&&e .style.dis play=='non e'){e.styl e.display= 'block';nl [nl.length ]={elm:e,t ype:'style '}}if(e.st yle&&s.hid den_tab_cl ass.length >0&&e.clas sName.inde xOf(s.hidd en_tab_cla ss)!=-1){e .className =s.display _tab_class ;nl[nl.len gth]={elm: e,type:'cl ass'}}}whi le((e=e.pa rentNode)! =null)}tin yMCE.setti ngs.prefor matted=fal se;if(type of(skip_cl eanup)=="u ndefined") skip_clean up=false;i f(typeof(s kip_callba ck)=="unde fined")ski p_callback =false;tin yMCE._setH TML(this.g etDoc(),th is.getBody ().innerHT ML);if(thi s.settings .cleanup== false){tin yMCE.handl eVisualAid (this.getB ody(),true ,false,thi s);tinyMCE ._setEvent sEnabled(t his.getBod y(),true)} tinyMCE._c ustomClean up(this,"s ubmit_cont ent_dom",t his.conten tWindow.do cument.bod y);htm=ski p_cleanup? this.getBo dy().inner HTML:tinyM CE._cleanu pHTML(this ,this.getD oc(),this. settings,t his.getBod y(),tinyMC E.visualAi d,true,tru e);htm=tin yMCE._cust omCleanup( this,"subm it_content ",htm);if( !skip_call back&&tiny MCE.settin gs.save_ca llback!==' ')content= tinyMCE.re solveDots( tinyMCE.se ttings.sav e_callback ,window)(t his.formTa rgetElemen tId,htm,th is.getBody ());if((ty peof(conte nt)!="unde fined")&&c ontent!=nu ll)htm=con tent;htm=t inyMCE.reg expReplace (htm,"&#40 ;","(","gi ");htm=tin yMCE.regex pReplace(h tm,"&#41;" ,")","gi") ;htm=tinyM CE.regexpR eplace(htm ,"&#59;"," ;","gi");h tm=tinyMCE .regexpRep lace(htm," &#34;","&q uot;","gi" );htm=tiny MCE.regexp Replace(ht m,"&#94;", "^","gi"); if(this.fo rmElement) this.formE lement.val ue=htm;if( tinyMCE.is Safari&&th is.formEle ment)this. formElemen t.innerTex t=htm;for( i=0;i<nl.l ength;i++) {if(nl[i]. type=='sty le')nl[i]. elm.style. display='n one';else  nl[i].elm. className= s.hidden_t ab_class}} };tinyMCE. add(TinyMC E_Engine,{ cleanupHTM LCode:func tion(s){s= s.replace( new RegExp ('<p \\/>' ,'gi'),'<p >&nbsp;</p >');s=s.re place(new  RegExp('<p >\\s*<\\/p >','gi'),' <p>&nbsp;< /p>');s=s. replace(ne w RegExp(' <br>\\s*<\ \/br>','gi '),'<br /> ');s=s.rep lace(new R egExp('<(h [1-6]|p|di v|address| pre|form|t able|li|ol |ul|td|b|f ont|em|str ong|i|stri ke|u|span| a|ul|ol|li |blockquot e)([a-z]*) ([^\\\\|>] *)\\/>','g i'),'<$1$2 $3></$1$2> ');s=s.rep lace(new R egExp('\\s +></','gi' ),'></');s =s.replace (new RegEx p('<(img|b r|hr)([^>] *)><\\/(im g|br|hr)>' ,'gi'),'<$ 1$2 />');i f(tinyMCE. isIE)s=s.r eplace(new  RegExp('< p><hr \\/> <\\/p>','g i'),"<hr>" );if(tinyM CE.isIE)s= s.replace( /<!(\s*)\/ >/g,'');re turn s},pa rseStyle:f unction(st r){var ar= [],st,i,re ,pa;if(str ==null)ret urn ar;st= str.split( ';');tinyM CE.clearAr ray(ar);fo r(i=0;i<st .length;i+ +){if(st[i ]=='')cont inue;re=ne w RegExp(' ^\\s*([^:] *):\\s*(.* )\\s*$');p a=st[i].re place(re,' $1||$2').s plit('||') ;if(pa.len gth==2)ar[ pa[0].toLo werCase()] =pa[1]}ret urn ar},co mpressStyl e:function (ar,pr,sf, res){var b ox=[],i,a; box[0]=ar[ pr+'-top'+ sf];box[1] =ar[pr+'-l eft'+sf];b ox[2]=ar[p r+'-right' +sf];box[3 ]=ar[pr+'- bottom'+sf ];for(i=0; i<box.leng th;i++){if (box[i]==n ull)return ;for(a=0;a <box.lengt h;a++){if( box[a]!=bo x[i])retur n}}ar[res] =box[0];ar [pr+'-top' +sf]=null; ar[pr+'-le ft'+sf]=nu ll;ar[pr+' -right'+sf ]=null;ar[ pr+'-botto m'+sf]=nul l},seriali zeStyle:fu nction(ar) {var str=" ",key,val, m;tinyMCE. compressSt yle(ar,"bo rder",""," border");t inyMCE.com pressStyle (ar,"borde r","-width ","border- width");ti nyMCE.comp ressStyle( ar,"border ","-color" ,"border-c olor");tin yMCE.compr essStyle(a r,"border" ,"-style", "border-st yle");tiny MCE.compre ssStyle(ar ,"padding" ,"","paddi ng");tinyM CE.compres sStyle(ar, "margin"," ","margin" );for(key  in ar){val =ar[key];i f(typeof(v al)=='func tion')cont inue;if(ke y.indexOf( 'mso-')==0 )continue; if(val!=nu ll&&val!== ''){val='' +val;val=v al.replace (new RegEx p("url\\(\ \'?([^\\'] *)\\'?\\)" ,'gi'),"ur l('$1')"); if(val.ind exOf('url( ')!=-1&&ti nyMCE.getP aram('conv ert_urls') ){m=new Re gExp("url\ \('(.*?)'\ \)").exec( val);if(m. length>1)v al="url('" +eval(tiny MCE.getPar am('urlcon verter_cal lback')+"( m[1], null , true);") +"')"}if(t inyMCE.get Param("for ce_hex_sty le_colors" ))val=tiny MCE.conver tRGBToHex( val,true); val=val.re place(/\"/ g,'\'');if (val!="url ('')")str+ =key.toLow erCase()+" : "+val+";  "}}if(new  RegExp(';  $').test( str))str=s tr.substri ng(0,str.l ength-2);r eturn str} ,convertRG BToHex:fun ction(s,k) {var re,rg b;if(s.toL owerCase() .indexOf(' rgb')!=-1) {re=new Re gExp("(.*? )rgb\\s*?\ \(\\s*?([0 -9]+).*?,\ \s*?([0-9] +).*?,\\s* ?([0-9]+). *?\\)(.*?) ","gi");rg b=s.replac e(re,"$1,$ 2,$3,$4,$5 ").split(' ,');if(rgb .length==5 ){r=parseI nt(rgb[1]) .toString( 16);g=pars eInt(rgb[2 ]).toStrin g(16);b=pa rseInt(rgb [3]).toStr ing(16);r= r.length== 1?'0'+r:r; g=g.length ==1?'0'+g: g;b=b.leng th==1?'0'+ b:b;s="#"+ r+g+b;if(k )s=rgb[0]+ s+rgb[4]}} return s}, convertHex ToRGB:func tion(s){if (s.indexOf ('#')!=-1) {s=s.repla ce(new Reg Exp('[^0-9 A-F]','gi' ),'');retu rn"rgb("+p arseInt(s. substring( 0,2),16)+" ,"+parseIn t(s.substr ing(2,4),1 6)+","+par seInt(s.su bstring(4, 6),16)+")" }return s} ,convertSp ansToFonts :function( doc){var s ,i,size,fS ize,x,fFac e,fColor,s izes=tinyM CE.getPara m('font_si ze_style_v alues').re place(/\s+ /,'').spli t(',');s=t inyMCE.sel ectElement s(doc,'spa n,font');f or(i=0;i<s .length;i+ +){size=ti nyMCE.trim (s[i].styl e.fontSize ).toLowerC ase();fSiz e=0;for(x= 0;x<sizes. length;x++ ){if(sizes [x]==size) {fSize=x+1 ;break}}if (fSize>0){ tinyMCE.se tAttrib(s[ i],'size', fSize);s[i ].style.fo ntSize=''} fFace=s[i] .style.fon tFamily;if (fFace!=nu ll&&fFace! ==''){tiny MCE.setAtt rib(s[i],' face',fFac e);s[i].st yle.fontFa mily=''}fC olor=s[i]. style.colo r;if(fColo r!=null&&f Color!=='' ){tinyMCE. setAttrib( s[i],'colo r',tinyMCE .convertRG BToHex(fCo lor));s[i] .style.col or=''}}},c onvertFont sToSpans:f unction(do c){var fsC lasses,s,i ,fSize,fFa ce,fColor, sizes=tiny MCE.getPar am('font_s ize_style_ values').r eplace(/\s +/,'').spl it(',');fs Classes=ti nyMCE.getP aram('font _size_clas ses');if(f sClasses!= ='')fsClas ses=fsClas ses.replac e(/\s+/,'' ).split(', ');else fs Classes=nu ll;s=tinyM CE.selectE lements(do c,'span,fo nt');for(i =0;i<s.len gth;i++){f Size=tinyM CE.getAttr ib(s[i],'s ize');fFac e=tinyMCE. getAttrib( s[i],'face ');fColor= tinyMCE.ge tAttrib(s[ i],'color' );if(fSize !==''){fSi ze=parseIn t(fSize);i f(fSize>0& &fSize<8){ if(fsClass es!=null)t inyMCE.set Attrib(s[i ],'class', fsClasses[ fSize-1]); else s[i]. style.font Size=sizes [fSize-1]} s[i].remov eAttribute ('size')}i f(fFace!== ''){s[i].s tyle.fontF amily=fFac e;s[i].rem oveAttribu te('face') }if(fColor !==''){s[i ].style.co lor=fColor ;s[i].remo veAttribut e('color') }}},cleanu pAnchors:f unction(do c){var i,c n,x,an=doc .getElemen tsByTagNam e("a");for (i=an.leng th-1;i>=0; i--){if(ti nyMCE.getA ttrib(an[i ],"name")! ==''&&tiny MCE.getAtt rib(an[i], "href")==' '){cn=an[i ].childNod es;for(x=c n.length-1 ;x>=0;x--) tinyMCE.in sertAfter( cn[x],an[i ])}}},getC ontent:fun ction(edit or_id){if( typeof(edi tor_id)!=" undefined" )tinyMCE.g etInstance ById(edito r_id).sele ct();if(ti nyMCE.sele ctedInstan ce)return  tinyMCE.se lectedInst ance.getHT ML();retur n null},_f ixListElem ents:funct ion(d){var  nl,x,a=[' ol','ul'], i,n,p,r=ne w RegExp(' ^(OL|UL)$' ),np;for(x =0;x<a.len gth;x++){n l=d.getEle mentsByTag Name(a[x]) ;for(i=0;i <nl.length ;i++){n=nl [i];p=n.pa rentNode;i f(r.test(p .nodeName) ){np=tinyM CE.prevNod e(n,'LI'); if(!np){np =d.createE lement('li ');np.inne rHTML='&nb sp;';np.ap pendChild( n);p.inser tBefore(np ,p.firstCh ild)}else  np.appendC hild(n)}}} },_fixTabl es:functio n(d){var n l,i,n,p,np ,x,t;nl=d. getElement sByTagName ('table'); for(i=0;i< nl.length; i++){n=nl[ i];if((p=t inyMCE.get ParentElem ent(n,'p,h 1,h2,h3,h4 ,h5,h6'))! =null){np= p.cloneNod e(false);n p.removeAt tribute('i d');t=n;wh ile((n=n.n extSibling ))np.appen dChild(n); tinyMCE.in sertAfter( np,p);tiny MCE.insert After(t,p) }}},_clean upHTML:fun ction(inst ,doc,confi g,elm,visu al,on_save ,on_submit ,inn){var  h,d,t1,t2, t3,t4,t5,c ,s,nb;if(! tinyMCE.ge tParam('cl eanup'))re turn elm.i nnerHTML;o n_save=typ eof(on_sav e)=='undef ined'?fals e:on_save; c=inst.cle anup;s=ins t.settings ;d=c.setti ngs.debug; if(d)t1=ne w Date().g etTime();i nst._fixRo otBlocks() ;if(tinyMC E.getParam ("convert_ fonts_to_s pans"))tin yMCE.conve rtFontsToS pans(doc); if(tinyMCE .getParam( "fix_list_ elements") )tinyMCE._ fixListEle ments(doc) ;if(tinyMC E.getParam ("fix_tabl e_elements "))tinyMCE ._fixTable s(doc);tin yMCE._cust omCleanup( inst,on_sa ve?"get_fr om_editor_ dom":"inse rt_to_edit or_dom",do c.body);if (d)t2=new  Date().get Time();c.s ettings.on _save=on_s ave;c.idCo unt=0;c.se rializatio nId=new Da te().getTi me().toStr ing(32);c. serialized Nodes=[];c .sourceInd ex=-1;if(s .cleanup_s erializer= ="xml")h=c .serialize NodeAsXML( elm,inn);e lse h=c.se rializeNod eAsHTML(el m,inn);if( d)t3=new D ate().getT ime();nb=t inyMCE.get Param('ent ity_encodi ng')=='num eric'?'&#1 60;':'&nbs p;';h=h.re place(/<\/ ?(body|hea d|html)[^> ]*>/gi,'') ;h=h.repla ce(new Reg Exp(' (row span="1"|c olspan="1" )','g'),'' );h=h.repl ace(/<p><h r \/><\/p> /g,'<hr /> ');h=h.rep lace(/<p>( &nbsp;|&#1 60;)<\/p>< hr \/><p>( &nbsp;|&#1 60;)<\/p>/ g,'<hr />' );h=h.repl ace(/<td>\ s*<br \/>\ s*<\/td>/g ,'<td>'+nb +'</td>'); h=h.replac e(/<p>\s*< br \/>\s*< \/p>/g,'<p >'+nb+'</p >');h=h.re place(/<br  \/>$/,'') ;h=h.repla ce(/<br \/ ><\/p>/g,' </p>');h=h .replace(/ <p>\s*(&nb sp;|&#160; )\s*<br \/ >\s*(&nbsp ;|&#160;)\ s*<\/p>/g, '<p>'+nb+' </p>');h=h .replace(/ <p>\s*(&nb sp;|&#160; )\s*<br \/ >\s*<\/p>/ g,'<p>'+nb +'</p>');h =h.replace (/<p>\s*<b r \/>\s*&n bsp;\s*<\/ p>/g,'<p>' +nb+'</p>' );h=h.repl ace(new Re gExp('<a>( .*?)<\\/a> ','g'),'$1 ');h=h.rep lace(/<p([ ^>]*)>\s*< \/p>/g,'<p $1>'+nb+'< /p>');if(/ ^\s*(<br \ />|<p>&nbs p;<\/p>|<p >&#160;<\/ p>|<p><\/p >)\s*$/.te st(h))h='' ;if(s.pref ormatted){ h=h.replac e(/^<pre>/ ,'');h=h.r eplace(/<\ /pre>$/,'' );h='<pre> '+h+'</pre >'}if(tiny MCE.isGeck o){h=h.rep lace(/<br  \/>\s*<\/l i>/g,'</li >');h=h.re place(/&nb sp;\s*<\/( dd|dt)>/g, '</$1>');h =h.replace (/<o:p _mo z-userdefi ned="" \/> /g,'');h=h .replace(/ <td([^>]*) >\s*<br \/ >\s*<\/td> /g,'<td$1> '+nb+'</td >')}if(s.f orce_br_ne wlines)h=h .replace(/ <p>(&nbsp; |&#160;)<\ /p>/g,'<br  />');h=ti nyMCE._cus tomCleanup (inst,on_s ave?"get_f rom_editor ":"insert_ to_editor" ,h);if(on_ save){h=h. replace(ne w RegExp('  ?(mceItem [a-zA-Z0-9 ]*|'+s.vis ual_table_ class+')', 'g'),'');h =h.replace (new RegEx p(' ?class =""','g'), '')}if(s.r emove_line breaks&&!c .settings. indent)h=h .replace(/ \n|\r/g,'  ');if(d)t4 =new Date( ).getTime( );if(on_sa ve&&c.sett ings.inden t)h=c.form atHTML(h); if(on_subm it&&(s.enc oding=="xm l"||s.enco ding=="htm l"))h=c.xm lEncode(h) ;if(d)t5=n ew Date(). getTime(); if(c.setti ngs.debug) tinyMCE.de bug("Clean up in ms:  Pre="+(t2- t1)+", Ser ialize: "+ (t3-t2)+",  Post: "+( t4-t3)+",  Format: "+ (t5-t4)+",  Sum: "+(t 5-t1)+".") ;return h} });functio n TinyMCE_ Cleanup(){ this.isIE= (navigator .appName== "Microsoft  Internet  Explorer") ;this.rule s=tinyMCE. clearArray ([]);this. settings={ indent_ele ments:'hea d,table,tb ody,thead, tfoot,form ,tr,ul,ol, blockquote ,object',n ewline_bef ore_elemen ts:'h1,h2, h3,h4,h5,h 6,pre,addr ess,div,ul ,ol,li,met a,option,a rea,title, link,base, script,td' ,newline_a fter_eleme nts:'br,hr ,p,pre,add ress,div,u l,ol,meta, option,are a,link,bas e,script', newline_be fore_after _elements: 'html,head ,body,tabl e,thead,tb ody,tfoot, tr,form,ul ,ol,blockq uote,p,obj ect,param, hr,div',in dent_char: '\t',inden t_levels:1 ,entity_en coding:'ra w',valid_e lements:'* [*]',entit ies:'',url _converter :'',invali d_elements :'',verify _html:fals e};this.vE lements=ti nyMCE.clea rArray([]) ;this.vEle mentsRe='' ;this.clos eElementsR e=/^(IMG|B R|HR|LINK| META|BASE| INPUT|AREA )$/;this.c odeElement sRe=/^(SCR IPT|STYLE) $/;this.se rializatio nId=0;this .mceAttrib s={href:'m ce_href',s rc:'mce_sr c',type:'m ce_type'}} TinyMCE_Cl eanup.prot otype={ini t:function (s){var n, a,i,ir,or, st;for(n i n s)this.s ettings[n] =s[n];s=th is.setting s;this.inR e=this._ar rayToRe(s. indent_ele ments.spli t(','),'', '^<(',')[^ >]*');this .ouRe=this ._arrayToR e(s.indent _elements. split(',') ,'','^<\\/ (',')[^>]* ');this.nl BeforeRe=t his._array ToRe(s.new line_befor e_elements .split(',' ),'gi','<( ',')([^>]* )>');this. nlAfterRe= this._arra yToRe(s.ne wline_afte r_elements .split(',' ),'gi','<( ',')([^>]* )>');this. nlBeforeAf terRe=this ._arrayToR e(s.newlin e_before_a fter_eleme nts.split( ','),'gi', '<(\\/?)(' ,')([^>]*) >');this.s erializedN odes=[];if (s.invalid _elements! =='')this. iveRe=this ._arrayToR e(s.invali d_elements .toUpperCa se().split (','),'g', '^(',')$') ;else this .iveRe=nul l;st='';fo r(i=0;i<s. indent_lev els;i++)st +=s.indent _char;this .inStr=st; if(!s.veri fy_html){s .valid_ele ments='*[* ]';s.exten ded_valid_ elements=' '}this.fil lStr=s.ent ity_encodi ng=="named "?"&nbsp;" :"&#160;"; this.idCou nt=0;this. xmlEncodeR e=new RegE xp('[\u007 F-\uFFFF<> &"]','g')} ,addRuleSt r:function (s){var r= this.parse RuleStr(s) ,n;for(n i n r){if(r[ n])this.ru les[n]=r[n ]}this.vEl ements=tin yMCE.clear Array([]); for(n in t his.rules) {if(this.r ules[n])th is.vElemen ts[this.vE lements.le ngth]=this .rules[n]. tag}this.v ElementsRe =this._arr ayToRe(thi s.vElement s,'')},isV alid:funct ion(n){if( !this.rule sDone)this ._setupRul es();if(!n )return tr ue;n=n.rep lace(/[^a- z0-9]+/gi, '').toUppe rCase();re turn!tinyM CE.getPara m('cleanup ')||this.v ElementsRe .test(n)}, addChildRe moveRuleSt r:function (s){var x, y,p,i,t,tn ,ta,cl,r;i f(!s)retur n;ta=s.spl it(',');fo r(x=0;x<ta .length;x+ +){s=ta[x] ;p=this.sp lit(/\[|\] /,s);if(p= =null||p.l ength<1)t= s.toUpperC ase();else  t=p[0].to UpperCase( );tn=this. split('/', t);for(y=0 ;y<tn.leng th;y++){r= "^(";cl=th is.split(/ \|/,p[1]); for(i=0;i< cl.length; i++){if(cl [i]=='%ist rict')r+=t inyMCE.inl ineStrict; else if(cl [i]=='%itr ans')r+=ti nyMCE.inli neTransiti onal;else  if(cl[i]== '%istrict_ na')r+=tin yMCE.inlin eStrict.su bstring(2) ;else if(c l[i]=='%it rans_na')r +=tinyMCE. inlineTran sitional.s ubstring(2 );else if( cl[i]=='%b trans')r+= tinyMCE.bl ockElms;el se if(cl[i ]=='%stric t')r+=tiny MCE.blockS trict;else  r+=(cl[i] .charAt(0) !='#'?cl[i ].toUpperC ase():cl[i ]);r+=(i!= cl.length- 1?'|':'')} r+=')$';if (this.chil dRules==nu ll)this.ch ildRules=t inyMCE.cle arArray([] );this.chi ldRules[tn [y]]=new R egExp(r);i f(p.length >1)this.ch ildRules[t n[y]].wrap Tag=p[2]}} },parseRul eStr:funct ion(s){var  ta,p,r,a, i,x,px,t,t n,y,av,or= tinyMCE.cl earArray([ ]),dv;if(s ==null||s. length==0) return or; ta=s.split (',');for( x=0;x<ta.l ength;x++) {s=ta[x];i f(s.length ==0)contin ue;p=this. split(/\[| \]/,s);if( p==null||p .length<1) t=s.toUppe rCase();el se t=p[0]. toUpperCas e();tn=thi s.split('/ ',t);for(y =0;y<tn.le ngth;y++){ r={};r.tag =tn[y];r.f orceAttrib s=null;r.d efaultAttr ibs=null;r .validAttr ibValues=n ull;px=r.t ag.charAt( 0);r.force Open=px==' +';r.remov eEmpty=px= ='-';r.fil l=px=='#'; r.tag=r.ta g.replace( /\+|-|#/g, '');r.oTag Name=tn[0] .replace(/ \+|-|#/g,' ').toLower Case();r.i sWild=new  RegExp('\\ *|\\?|\\+' ,'g').test (r.tag);r. validRe=ne w RegExp(t his._wildc ardToRe('^ '+r.tag+'$ '));if(p.l ength>1){r .vAttribsR e='^(';a=t his.split( /\|/,p[1]) ;for(i=0;i <a.length; i++){t=a[i ];if(t.cha rAt(0)=='! '){a[i]=t= t.substrin g(1);if(!r .reqAttrib sRe)r.reqA ttribsRe=' \\s+('+t;e lse r.reqA ttribsRe+= '|'+t}av=n ew RegExp( '(=|:|<)(. *?)$').exe c(t);t=t.r eplace(new  RegExp('( =|:|<).*?$ '),'');if( av&&av.len gth>0){if( av[0].char At(0)==':' ){if(!r.fo rceAttribs )r.forceAt tribs=tiny MCE.clearA rray([]);r .forceAttr ibs[t.toLo werCase()] =av[0].sub string(1)} else if(av [0].charAt (0)=='='){ if(!r.defa ultAttribs )r.default Attribs=ti nyMCE.clea rArray([]) ;dv=av[0]. substring( 1);r.defau ltAttribs[ t.toLowerC ase()]=dv= =''?"mce_e mpty":dv}e lse if(av[ 0].charAt( 0)=='<'){i f(!r.valid AttribValu es)r.valid AttribValu es=tinyMCE .clearArra y([]);r.va lidAttribV alues[t.to LowerCase( )]=this._a rrayToRe(t his.split( '?',av[0]. substring( 1)),'i')}} r.vAttribs Re+=''+t.t oLowerCase ()+(i!=a.l ength-1?'| ':'');a[i] =t.toLower Case()}if( r.reqAttri bsRe)r.req AttribsRe= new RegExp (r.reqAttr ibsRe+')=\ "','g');r. vAttribsRe +=')$';r.v AttribsRe= this._wild cardToRe(r .vAttribsR e);r.vAttr ibsReIsWil d=new RegE xp('\\*|\\ ?|\\+','g' ).test(r.v AttribsRe) ;r.vAttrib sRe=new Re gExp(r.vAt tribsRe);r .vAttribs= a.reverse( );}else{r. vAttribsRe ='';r.vAtt ribs=tinyM CE.clearAr ray([]);r. vAttribsRe IsWild=fal se}or[r.ta g]=r}}retu rn or},ser ializeNode AsXML:func tion(n){va r s,b;if(! this.xmlDo c){if(this .isIE){try {this.xmlD oc=new Act iveXObject ('MSXML2.D OMDocument ')}catch(e ){}if(!thi s.xmlDoc)t ry{this.xm lDoc=new A ctiveXObje ct('Micros oft.XmlDom ')}catch(e ){}}else t his.xmlDoc =document. implementa tion.creat eDocument( '','',null );if(!this .xmlDoc)al ert("Error  XML Parse r could no t be found .")}if(thi s.xmlDoc.f irstChild) this.xmlDo c.removeCh ild(this.x mlDoc.firs tChild);b= this.xmlDo c.createEl ement("htm l");b=this .xmlDoc.ap pendChild( b);this._c onvertToXM L(n,b);if( this.isIE) return thi s.xmlDoc.x ml;else re turn new X MLSerializ er().seria lizeToStri ng(this.xm lDoc)},_co nvertToXML :function( n,xn){var  xd,el,i,l, cn,at,no,h c=false;if (tinyMCE.i sRealIE&&t his._isDup licate(n)) return;xd= this.xmlDo c;switch(n .nodeType) {case 1:hc =n.hasChil dNodes();e l=xd.creat eElement(n .nodeName. toLowerCas e());at=n. attributes ;for(i=at. length-1;i >-1;i--){n o=at[i];if (no.specif ied&&no.no deValue)el .setAttrib ute(no.nod eName.toLo werCase(), no.nodeVal ue)}if(!hc &&!this.cl oseElement sRe.test(n .nodeName) )el.append Child(xd.c reateTextN ode(""));x n=xn.appen dChild(el) ;break;cas e 3:xn.app endChild(x d.createTe xtNode(n.n odeValue)) ;return;ca se 8:xn.ap pendChild( xd.createC omment(n.n odeValue)) ;return}if (hc){cn=n. childNodes ;for(i=0,l =cn.length ;i<l;i++)t his._conve rtToXML(cn [i],xn)}}, serializeN odeAsHTML: function(n ,inn){var  en,no,h='' ,i,l,t,st, r,cn,va=fa lse,f=fals e,at,hc,cr ,nn;if(!th is.rulesDo ne)this._s etupRules( );if(tinyM CE.isRealI E&&this._i sDuplicate (n))return '';if(n.pa rentNode&& this.child Rules!=nul l){cr=this .childRule s[n.parent Node.nodeN ame];if(ty peof(cr)!= "undefined "&&!cr.tes t(n.nodeNa me)){st=tr ue;t=null} }switch(n. nodeType){ case 1:hc= n.hasChild Nodes();if (st)break; nn=n.nodeN ame;if(tin yMCE.isRea lIE){if(n. nodeName.i ndexOf('/' )!=-1)brea k;if(n.sco peName&&n. scopeName! ='HTML')nn =n.scopeNa me.toUpper Case()+':' +nn.toUppe rCase()}el se if(tiny MCE.isOper a&&nn.inde xOf(':')>0 )nn=nn.toU pperCase() ;if(this.s ettings.co nvert_font s_to_spans ){if(this. settings.o n_save&&nn =='FONT')n n='SPAN';i f(!this.se ttings.on_ save&&nn== 'SPAN')nn= 'FONT'}if( this.vElem entsRe.tes t(nn)&&(!t his.iveRe| |!this.ive Re.test(nn ))&&!inn){ va=true;r= this.rules [nn];if(!r ){at=this. rules;for( no in at){ if(at[no]& &at[no].va lidRe.test (nn)){r=at [no];break }}}en=r.is Wild?nn.to LowerCase( ):r.oTagNa me;f=r.fil l;if(r.rem oveEmpty&& !hc)return "";t='<'+e n;if(r.vAt tribsReIsW ild){at=n. attributes ;for(i=at. length-1;i >-1;i--){n o=at[i];if (no.specif ied&&r.vAt tribsRe.te st(no.node Name))t+=t his._seria lizeAttrib ute(n,r,no .nodeName) }}else{for (i=r.vAttr ibs.length -1;i>-1;i- -)t+=this. _serialize Attribute( n,r,r.vAtt ribs[i])}i f(!this.se ttings.on_ save){at=t his.mceAtt ribs;for(n o in at){i f(at[no])t +=this._se rializeAtt ribute(n,r ,at[no])}} if(r.reqAt tribsRe&&! t.match(r. reqAttribs Re))t=null ;if(t!=nul l&&this.cl oseElement sRe.test(n n))return  t+' />';if (t!=null)h +=t+'>';if (this.isIE &&this.cod eElementsR e.test(nn) )h+=n.inne rHTML}brea k;case 3:i f(st)break ;if(n.pare ntNode&&th is.codeEle mentsRe.te st(n.paren tNode.node Name))retu rn this.is IE?'':n.no deValue;re turn this. xmlEncode( n.nodeValu e);case 8: if(st)brea k;return"< !--"+this. _trimComme nt(n.nodeV alue)+"--> "}if(hc){c n=n.childN odes;for(i =0,l=cn.le ngth;i<l;i ++)h+=this .serialize NodeAsHTML (cn[i])}if (f&&!hc)h+ =this.fill Str;if(t!= null&&va)h +='</'+en+ '>';return  h},_seria lizeAttrib ute:functi on(n,r,an) {var av='' ,t,os=this .settings. on_save;if (os&&(an.i ndexOf('mc e_')==0||a n.indexOf( '_moz')==0 ))return'' ;if(os&&th is.mceAttr ibs[an])av =this._get Attrib(n,t his.mceAtt ribs[an]); if(av.leng th==0)av=t his._getAt trib(n,an) ;if(av.len gth==0&&r. defaultAtt ribs&&(t=r .defaultAt tribs[an]) ){av=t;if( av=="mce_e mpty")retu rn" "+an+' =""'}if(r. forceAttri bs&&(t=r.f orceAttrib s[an]))av= t;if(os&&a v.length!= 0&&/^(src| href|longd esc)$/.tes t(an))av=t his._urlCo nverter(th is,n,av);i f(av.lengt h!=0&&r.va lidAttribV alues&&r.v alidAttrib Values[an] &&!r.valid AttribValu es[an].tes t(av))retu rn"";if(av .length!=0 &&av=="{$u id}")av="u id_"+(this .idCount++ );if(av.le ngth!=0){i f(an.index Of('on')!= 0)av=this. xmlEncode( av,1);retu rn" "+an+" ="+'"'+av+ '"'}return ""},format HTML:funct ion(h){var  s=this.se ttings,p=' ',i=0,li=0 ,o='',l;h= h.replace( /<pre([^>] *)>(.*?)<\ /pre>/gi,f unction(a, b,c){c=c.r eplace(/<b r\s*\/>/gi ,'\n');ret urn'<pre'+ b+'>'+c+'< /pre>'});h =h.replace (/\r/g,'') ;h='\n'+h; h=h.replac e(new RegE xp('\\n\\s +','gi'),' \n');h=h.r eplace(thi s.nlBefore Re,'\n<$1$ 2>');h=h.r eplace(thi s.nlAfterR e,'<$1$2>\ n');h=h.re place(this .nlBeforeA fterRe,'\n <$1$2$3>\n ');h+='\n' ;while((i= h.indexOf( '\n',i+1)) !=-1){if(( l=h.substr ing(li+1,i )).length! =0){if(thi s.ouRe.tes t(l)&&p.le ngth>=s.in dent_level s)p=p.subs tring(s.in dent_level s);o+=p+l+ '\n';if(th is.inRe.te st(l))p+=t his.inStr} li=i}retur n o},xmlEn code:funct ion(s){var  cl=this,r e=this.xml EncodeRe;i f(!this.en titiesDone )this._set upEntities ();switch( this.setti ngs.entity _encoding) {case"raw" :return ti nyMCE.xmlE ncode(s);c ase"named" :return s. replace(re ,function( c){var b=c l.entities [c.charCod eAt(0)];re turn b?'&' +b+';':c}) ;case"nume ric":retur n s.replac e(re,funct ion(c){ret urn'&#'+c. charCodeAt (0)+';'})} return s}, split:func tion(re,s) {var i,l,o =[],c=s.sp lit(re);fo r(i=0,l=c. length;i<l ;i++){if(c [i]!=='')o [i]=c[i]}r eturn o},_ trimCommen t:function (s){s=s.re place(new  RegExp('\\ smce_src=\ "[^\"]*\"' ,'gi'),"") ;s=s.repla ce(new Reg Exp('\\smc e_href=\"[ ^\"]*\"',' gi'),"");r eturn s},_ getAttrib: function(e ,n,d){var  v,ex,nn;if (typeof(d) =="undefin ed")d="";i f(!e||e.no deType!=1) return d;t ry{v=e.get Attribute( n,0)}catch (ex){v=e.g etAttribut e(n,2)}if( n=="class" &&!v)v=e.c lassName;i f(this.isI E){if(n==" http-equiv ")v=e.http Equiv;nn=e .nodeName; if(nn=="FO RM"&&n=="e nctype"&&v =="applica tion/x-www -form-urle ncoded")v= "";if(nn== "INPUT"&&n =="size"&& v=="20")v= "";if(nn== "INPUT"&&n =="maxleng th"&&v=="2 147483647" )v="";if(n =="width"| |n=="heigh t")v=e.get Attribute( n,2)}if(n= ='style'&& v){if(!tin yMCE.isOpe ra)v=e.sty le.cssText ;v=tinyMCE .serialize Style(tiny MCE.parseS tyle(v))}i f(this.set tings.on_s ave&&n.ind exOf('on') !=-1&&this .settings. on_save&&v &&v!=='')v =tinyMCE.c leanupEven tStr(v);re turn(v&&v! =='')?''+v :d},_urlCo nverter:fu nction(c,n ,v){if(!c. settings.o n_save)ret urn tinyMC E.convertR elativeToA bsoluteURL (tinyMCE.s ettings.ba se_href,v) ;else if(t inyMCE.get Param('con vert_urls' )){if(!thi s.urlConve rter)this. urlConvert er=eval(ti nyMCE.sett ings.urlco nverter_ca llback);re turn this. urlConvert er(v,n,tru e)}return  v},_arrayT oRe:functi on(a,op,be ,af){var i ,r;op=type of(op)=="u ndefined"? "gi":op;be =typeof(be )=="undefi ned"?"^(": be;af=type of(af)=="u ndefined"? ")$":af;r= be;for(i=0 ;i<a.lengt h;i++)r+=t his._wildc ardToRe(a[ i])+(i!=a. length-1?" |":"");r+= af;return  new RegExp (r,op)},_w ildcardToR e:function (s){s=s.re place(/\?/ g,'(\\S?)' );s=s.repl ace(/\+/g, '(\\S+)'); s=s.replac e(/\*/g,'( \\S*)');re turn s},_s etupEntiti es:functio n(){var n, a,i,s=this .settings; if(s.entit y_encoding =="named") {n=tinyMCE .clearArra y([]);a=th is.split(' ,',s.entit ies);for(i =0;i<a.len gth;i+=2)n [a[i]]=a[i +1];this.e ntities=n} this.entit iesDone=tr ue},_setup Rules:func tion(){var  s=this.se ttings;thi s.addRuleS tr(s.valid _elements) ;this.addR uleStr(s.e xtended_va lid_elemen ts);this.a ddChildRem oveRuleStr (s.valid_c hild_eleme nts);this. rulesDone= true},_isD uplicate:f unction(n) {var i,l,s n;if(!this .settings. fix_conten t_duplicat ion)return  false;if( tinyMCE.is RealIE&&n. nodeType== 1){if(n.mc e_serializ ed==this.s erializati onId)retur n true;n.s etAttribut e('mce_ser ialized',t his.serial izationId) }else{sn=t his.serial izedNodes; for(i=0,l= sn.length; i<l;i++){i f(sn[i]==n )return tr ue}sn.push (n)}return  false}};t inyMCE.add (TinyMCE_E ngine,{cre ateTagHTML :function( tn,a,h){va r o='',f=t inyMCE.xml Encode,n;o ='<'+tn;if (a){for(n  in a){if(t ypeof(a[n] )!='functi on'&&a[n]! =null)o+='  '+f(n)+'= "'+f(''+a[ n])+'"'}}o +=!h?' />' :'>'+h+'</ '+tn+'>';r eturn o},c reateTag:f unction(d, tn,a,h){va r o=d.crea teElement( tn),n;if(a ){for(n in  a){if(typ eof(a[n])! ='function '&&a[n]!=n ull)tinyMC E.setAttri b(o,n,a[n] )}}if(h)o. innerHTML= h;return o },getEleme ntByAttrib uteValue:f unction(n, e,a,v){ret urn(n=this .getElemen tsByAttrib uteValue(n ,e,a,v)).l ength==0?n ull:n[0]}, getElement sByAttribu teValue:fu nction(n,e ,a,v){var  i,nl=n.get ElementsBy TagName(e) ,o=[];for( i=0;i<nl.l ength;i++) {if(tinyMC E.getAttri b(nl[i],a) .indexOf(v )!=-1)o[o. length]=nl [i]}return  o},isBloc kElement:f unction(n) {return n! =null&&n.n odeType==1 &&this.blo ckRegExp.t est(n.node Name)},get ParentBloc kElement:f unction(n, r){return  this.getPa rentNode(n ,function( n){return  tinyMCE.is BlockEleme nt(n)},r); return nul l},insertA fter:funct ion(n,r){i f(r.nextSi bling)r.pa rentNode.i nsertBefor e(n,r.next Sibling);e lse r.pare ntNode.app endChild(n )},setInne rHTML:func tion(e,h){ var i,nl,n ;if(tinyMC E.isGecko) {h=h.repla ce(/<embed ([^>]*)>/g i,'<tmpemb ed$1>');h= h.replace( /<em([^>]* )>/gi,'<i$ 1>');h=h.r eplace(/<t mpembed([^ >]*)>/gi,' <embed$1>' );h=h.repl ace(/<stro ng([^>]*)> /gi,'<b$1> ');h=h.rep lace(/<\/s trong>/gi, '</b>');h= h.replace( /<\/em>/gi ,'</i>')}i f(tinyMCE. isRealIE){ h=h.replac e(/\s\/>/g ,'>');h=h. replace(/< p([^>]*)>\ u00A0?<\/p >/gi,'<p$1  mce_keep= "true">&nb sp;</p>'); h=h.replac e(/<p([^>] *)>\s*&nbs p;\s*<\/p> /gi,'<p$1  mce_keep=" true">&nbs p;</p>');h =h.replace (/<p([^>]* )>\s+<\/p> /gi,'<p$1  mce_keep=" true">&nbs p;</p>');e .innerHTML =tinyMCE.u niqueTag+h ;e.firstCh ild.remove Node(true) ;nl=e.getE lementsByT agName("p" );for(i=nl .length-1; i>=0;i--){ n=nl[i];if (n.nodeNam e=='P'&&!n .hasChildN odes()&&!n .mce_keep) n.parentNo de.removeC hild(n)}}e lse{h=this .fixGeckoB aseHREFBug (1,e,h);e. innerHTML= h;this.fix GeckoBaseH REFBug(2,e ,h)}},getO uterHTML:f unction(e) {var d;if( tinyMCE.is IE)return  e.outerHTM L;d=e.owne rDocument. createElem ent("body" );d.append Child(e.cl oneNode(tr ue));retur n d.innerH TML},setOu terHTML:fu nction(e,h ,d){var d= typeof(d)= ="undefine d"?e.owner Document:d ,i,nl,t;if (tinyMCE.i sIE&&e.nod eType==1)e .outerHTML =h;else{t= d.createEl ement("bod y");t.inne rHTML=h;fo r(i=0,nl=t .childNode s;i<nl.len gth;i++)e. parentNode .insertBef ore(nl[i]. cloneNode( true),e);e .parentNod e.removeCh ild(e)}},_ getElement ById:funct ion(id,d){ var e,i,j, f;if(typeo f(d)=="und efined")d= document;e =d.getElem entById(id );if(!e){f =d.forms;f or(i=0;i<f .length;i+ +){for(j=0 ;j<f[i].el ements.len gth;j++){i f(f[i].ele ments[j].n ame==id){e =f[i].elem ents[j];br eak}}}}ret urn e},get NodeTree:f unction(n, na,t,nn){r eturn this .selectNod es(n,funct ion(n){ret urn(!t||n. nodeType== t)&&(!nn|| n.nodeName ==nn)},na? na:[])},ge tParentEle ment:funct ion(n,na,f ,r){var re =na?new Re gExp('^('+ na.toUpper Case().rep lace(/,/g, '|')+')$') :0,v;if(f& &typeof(f) =='string' )return th is.getPare ntElement( n,na,funct ion(no){re turn tinyM CE.getAttr ib(no,f)!= =''});retu rn this.ge tParentNod e(n,functi on(n){retu rn((n.node Type==1&&! re)||(re&& re.test(n. nodeName)) )&&(!f||f( n))},r)},g etParentNo de:functio n(n,f,r){w hile(n){if (n==r)retu rn null;if (f(n))retu rn n;n=n.p arentNode} return nul l},getAttr ib:functio n(elm,name ,dv){var v ;if(typeof (dv)=="und efined")dv ="";if(!el m||elm.nod eType!=1)r eturn dv;t ry{v=elm.g etAttribut e(name,0)} catch(ex){ v=elm.getA ttribute(n ame,2)}if( name=="cla ss"&&!v)v= elm.classN ame;if(tin yMCE.isGec ko){if(nam e=="src"&& elm.src!=n ull&&elm.s rc!=='')v= elm.src;if (name=="hr ef"&&elm.h ref!=null& &elm.href! =='')v=elm .href}else  if(tinyMC E.isIE){sw itch(name) {case"http -equiv":v= elm.httpEq uiv;break; case"width ":case"hei ght":v=elm .getAttrib ute(name,2 );break}}i f(name=="s tyle"&&!ti nyMCE.isOp era)v=elm. style.cssT ext;return (v&&v!=='' )?v:dv},se tAttrib:fu nction(el, name,va,fi x){if(type of(va)=="n umber"&&va !=null)va= ""+va;if(f ix){if(va= =null)va=" ";va=va.re place(/[^0 -9%]/g,'') }if(name== "style")el .style.css Text=va;if (name=="cl ass")el.cl assName=va ;if(va!=nu ll&&va!==' '&&va!=-1) el.setAttr ibute(name ,va);else  el.removeA ttribute(n ame)},setS tyleAttrib :function( e,n,v){e.s tyle[n]=v; if(tinyMCE .isIE&&v== null||v==' '){v=tinyM CE.seriali zeStyle(ti nyMCE.pars eStyle(e.s tyle.cssTe xt));e.sty le.cssText =v;e.setAt tribute("s tyle",v)}} ,switchCla ss:functio n(ei,c){va r e;if(tin yMCE.switc hClassCach e[ei])e=ti nyMCE.swit chClassCac he[ei];els e e=tinyMC E.switchCl assCache[e i]=documen t.getEleme ntById(ei) ;if(e){if( tinyMCE.se ttings.but ton_tile_m ap&&e.clas sName&&e.c lassName.i ndexOf('mc eTiledButt on')==0)c= 'mceTiledB utton '+c; e.classNam e=c}},getA bsPosition :function( n,cn){var  l=0,t=0;wh ile(n&&n!= cn){l+=n.o ffsetLeft; t+=n.offse tTop;n=n.o ffsetParen t}return{a bsLeft:l,a bsTop:t}}, prevNode:f unction(e, n){var a=n .split(',' ),i;while( (e=e.previ ousSibling )!=null){f or(i=0;i<a .length;i+ +){if(e.no deName==a[ i])return  e}}return  null},next Node:funct ion(e,n){v ar a=n.spl it(','),i; while((e=e .nextSibli ng)!=null) {for(i=0;i <a.length; i++){if(e. nodeName== a[i])retur n e}}retur n null},se lectElemen ts:functio n(n,na,f){ var i,a=[] ,nl,x;for( x=0,na=na. split(',') ;x<na.leng th;x++)for (i=0,nl=n. getElement sByTagName (na[x]);i< nl.length; i++)(!f||f (nl[i]))&& a.push(nl[ i]);return  a},select Nodes:func tion(n,f,a ){var i;if (!a)a=[];i f(f(n))a[a .length]=n ;if(n.hasC hildNodes( )){for(i=0 ;i<n.child Nodes.leng th;i++)tin yMCE.selec tNodes(n.c hildNodes[ i],f,a)}re turn a},ad dCSSClass: function(e ,c,b){var  o=this.rem oveCSSClas s(e,c);ret urn e.clas sName=b?c+ (o!==''?('  '+o):''): (o!==''?(o +' '):'')+ c},removeC SSClass:fu nction(e,c ){c=e.clas sName.repl ace(new Re gExp("(^|\ \s+)"+c+"( \\s+|$)"), ' ');retur n e.classN ame=c!=' ' ?c:''},has CSSClass:f unction(n, c){return  new RegExp ('\\b'+c+' \\b','g'). test(n.cla ssName)},r enameEleme nt:functio n(e,n,d){v ar ne,i,ar ;d=typeof( d)=="undef ined"?tiny MCE.select edInstance .getDoc(): d;if(e){ne =d.createE lement(n); ar=e.attri butes;for( i=ar.lengt h-1;i>-1;i --){if(ar[ i].specifi ed&&ar[i]. nodeValue) ne.setAttr ibute(ar[i ].nodeName .toLowerCa se(),ar[i] .nodeValue )}ar=e.chi ldNodes;fo r(i=0;i<ar .length;i+ +)ne.appen dChild(ar[ i].cloneNo de(true)); e.parentNo de.replace Child(ne,e )}},getVie wPort:func tion(w){va r d=w.docu ment,m=d.c ompatMode= ='CSS1Comp at',b=d.bo dy,de=d.do cumentElem ent;return {left:w.pa geXOffset| |(m?de.scr ollLeft:b. scrollLeft ),top:w.pa geYOffset| |(m?de.scr ollTop:b.s crollTop), width:w.in nerWidth|| (m?de.clie ntWidth:b. clientWidt h),height: w.innerHei ght||(m?de .clientHei ght:b.clie ntHeight)} },getStyle :function( n,na,d){if (!n)return  false;if( tinyMCE.is Gecko&&n.o wnerDocume nt.default View){try{ return n.o wnerDocume nt.default View.getCo mputedStyl e(n,null). getPropert yValue(na) }catch(n){ return nul l}}na=na.r eplace(/-( \D)/g,func tion(a,b){ return b.t oUpperCase ()});if(n. currentSty le)return  n.currentS tyle[na];r eturn fals e}});tinyM CE.add(Tin yMCE_Engin e,{parseUR L:function (url_str){ var urlPar ts=[],i,po s,lastPos, chr;if(url _str){pos= url_str.in dexOf(':// ');if(pos! =-1){urlPa rts.protoc ol=url_str .substring (0,pos);la stPos=pos+ 3}for(i=la stPos;i<ur l_str.leng th;i++){ch r=url_str. charAt(i); if(chr==': ')break;if (chr=='/') break}pos= i;urlParts .host=url_ str.substr ing(lastPo s,pos);url Parts.port ="";lastPo s=pos;if(u rl_str.cha rAt(pos)== ':'){pos=u rl_str.ind exOf('/',l astPos);ur lParts.por t=url_str. substring( lastPos+1, pos)}lastP os=pos;pos =url_str.i ndexOf('?' ,lastPos); if(pos==-1 )pos=url_s tr.indexOf ('#',lastP os);if(pos ==-1)pos=u rl_str.len gth;urlPar ts.path=ur l_str.subs tring(last Pos,pos);l astPos=pos ;if(url_st r.charAt(p os)=='?'){ pos=url_st r.indexOf( '#');pos=( pos==-1)?u rl_str.len gth:pos;ur lParts.que ry=url_str .substring (lastPos+1 ,pos)}last Pos=pos;if (url_str.c harAt(pos) =='#'){pos =url_str.l ength;urlP arts.ancho r=url_str. substring( lastPos+1, pos)}}retu rn urlPart s},seriali zeURL:func tion(up){v ar o="";if (up.protoc ol)o+=up.p rotocol+": //";if(up. host)o+=up .host;if(u p.port)o+= ":"+up.por t;if(up.pa th)o+=up.p ath;if(up. query)o+=" ?"+up.quer y;if(up.an chor)o+="# "+up.ancho r;return o },convertA bsoluteURL ToRelative URL:functi on(base_ur l,url_to_r elative){v ar baseURL =this.pars eURL(base_ url),targe tURL=this. parseURL(u rl_to_rela tive);var  i,strTok1, strTok2,br eakPoint=0 ,outPath=" ",forceSla sh=false;v ar fileNam e,pos;if(t argetURL.p ath=='')ta rgetURL.pa th="/";els e forceSla sh=true;ba se_url=bas eURL.path. substring( 0,baseURL. path.lastI ndexOf('/' ));strTok1 =base_url. split('/') ;strTok2=t argetURL.p ath.split( '/');if(st rTok1.leng th>=strTok 2.length){ for(i=0;i< strTok1.le ngth;i++){ if(i>=strT ok2.length ||strTok1[ i]!=strTok 2[i]){brea kPoint=i+1 ;break}}}i f(strTok1. length<str Tok2.lengt h){for(i=0 ;i<strTok2 .length;i+ +){if(i>=s trTok1.len gth||strTo k1[i]!=str Tok2[i]){b reakPoint= i+1;break} }}if(break Point==1)r eturn targ etURL.path ;for(i=0;i <(strTok1. length-(br eakPoint-1 ));i++)out Path+="../ ";for(i=br eakPoint-1 ;i<strTok2 .length;i+ +){if(i!=( breakPoint -1))outPat h+="/"+str Tok2[i];el se outPath +=strTok2[ i]}targetU RL.protoco l=null;tar getURL.hos t=null;tar getURL.por t=null;tar getURL.pat h=outPath= =''&&force Slash?"/": outPath;fi leName=bas eURL.path; if((pos=fi leName.las tIndexOf(' /'))!=-1)f ileName=fi leName.sub string(pos +1);if(fil eName==tar getURL.pat h&&targetU RL.anchor! =='')targe tURL.path= "";if(targ etURL.path ==''&&!tar getURL.anc hor)target URL.path=f ileName!== ''?fileNam e:"/";retu rn this.se rializeURL (targetURL )},convert RelativeTo AbsoluteUR L:function (base_url, relative_u rl){var ba seURL=this .parseURL( base_url), baseURLPar ts,relURLP arts,newRe lURLParts, numBack,re lURL=this. parseURL(r elative_ur l),i;var l en,absPath ,start,end ,newBaseUR LParts;if( relative_u rl==''||re lative_url .indexOf(' ://')!=-1| |/^(mailto :|javascri pt:|#|\/)/ .test(rela tive_url)) return rel ative_url; baseURLPar ts=baseURL .path.spli t('/');rel URLParts=r elURL.path .split('/' );newBaseU RLParts=[] ;for(i=bas eURLParts. length-1;i >=0;i--){i f(baseURLP arts[i].le ngth==0)co ntinue;new BaseURLPar ts[newBase URLParts.l ength]=bas eURLParts[ i]}baseURL Parts=newB aseURLPart s.reverse( );newRelUR LParts=[]; numBack=0; for(i=relU RLParts.le ngth-1;i>= 0;i--){if( relURLPart s[i].lengt h==0||relU RLParts[i] ==".")cont inue;if(re lURLParts[ i]=='..'){ numBack++; continue}i f(numBack> 0){numBack --;continu e}newRelUR LParts[new RelURLPart s.length]= relURLPart s[i]}relUR LParts=new RelURLPart s.reverse( );len=base URLParts.l ength-numB ack;absPat h=(len<=0? "":"/")+ba seURLParts .slice(0,l en).join(' /')+"/"+re lURLParts. join('/'); start="";e nd="";relU RL.protoco l=baseURL. protocol;r elURL.host =baseURL.h ost;relURL .port=base URL.port;i f(relURL.p ath.charAt (relURL.pa th.length- 1)=="/")ab sPath+="/" ;relURL.pa th=absPath ;return th is.seriali zeURL(relU RL)},conve rtURL:func tion(url,n ode,on_sav e){var dl= document.l ocation,st art,portPa rt,urlPart s,baseUrlP arts,tmpUr lParts,cur l;var prot =dl.protoc ol,host=dl .hostname, port=dl.po rt;if(prot =="file:") return url ;url=tinyM CE.regexpR eplace(url ,'(http|ht tps):///', '/');if(ur l.indexOf( 'mailto:') !=-1||url. indexOf('j avascript: ')!=-1||/^ [ \t\r\n\+ ]*[#\?]/.t est(url))r eturn url; if(!tinyMC E.isIE&&!o n_save&&ur l.indexOf( "://")==-1 &&url.char At(0)!='/' )return ti nyMCE.sett ings.base_ href+url;i f(on_save& &tinyMCE.g etParam('r elative_ur ls')){curl =tinyMCE.c onvertRela tiveToAbso luteURL(ti nyMCE.sett ings.base_ href,url); if(curl.ch arAt(0)==' /')curl=ti nyMCE.sett ings.docum ent_base_p refix+curl ;urlParts= tinyMCE.pa rseURL(cur l);tmpUrlP arts=tinyM CE.parseUR L(tinyMCE. settings.d ocument_ba se_url);if (urlParts. host==tmpU rlParts.ho st&&(urlPa rts.port== tmpUrlPart s.port))re turn tinyM CE.convert AbsoluteUR LToRelativ eURL(tinyM CE.setting s.document _base_url, curl)}if(! tinyMCE.ge tParam('re lative_url s')){urlPa rts=tinyMC E.parseURL (url);base UrlParts=t inyMCE.par seURL(tiny MCE.settin gs.base_hr ef);url=ti nyMCE.conv ertRelativ eToAbsolut eURL(tinyM CE.setting s.base_hre f,url);if( urlParts.a nchor&&url Parts.path ==baseUrlP arts.path) return"#"+ urlParts.a nchor}if(t inyMCE.get Param('rem ove_script _host')){s tart="";po rtPart=""; if(port!== '')portPar t=":"+port ;start=pro t+"//"+hos t+portPart +"/";if(ur l.indexOf( start)==0) url=url.su bstring(st art.length -1)}return  url},conv ertAllRela tiveURLs:f unction(bo dy){var i, elms,src,h ref,mhref, msrc;elms= body.getEl ementsByTa gName("img ");for(i=0 ;i<elms.le ngth;i++){ src=tinyMC E.getAttri b(elms[i], 'src');msr c=tinyMCE. getAttrib( elms[i],'m ce_src');i f(msrc!==' ')src=msrc ;if(src!== ''){src=ti nyMCE.conv ertRelativ eToAbsolut eURL(tinyM CE.setting s.base_hre f,src);elm s[i].setAt tribute("s rc",src)}} elms=body. getElement sByTagName ("a");for( i=0;i<elms .length;i+ +){href=ti nyMCE.getA ttrib(elms [i],'href' );mhref=ti nyMCE.getA ttrib(elms [i],'mce_h ref');if(m href!=='') href=mhref ;if(href&& href!=='') {href=tiny MCE.conver tRelativeT oAbsoluteU RL(tinyMCE .settings. base_href, href);elms [i].setAtt ribute("hr ef",href)} }}});tinyM CE.add(Tin yMCE_Engin e,{clearAr ray:functi on(a){var  n;for(n in  a)a[n]=nu ll;return  a},explode :function( d,s){var a r=s.split( d),oar=[], i;for(i=0; i<ar.lengt h;i++){if( ar[i]!=='' )oar[oar.l ength]=ar[ i]}return  oar}});tin yMCE.add(T inyMCE_Eng ine,{_setE ventsEnabl ed:functio n(node,sta te){var ev s,x,y,elms ,i,event;v ar events= ['onfocus' ,'onblur', 'onclick', 'ondblclic k','onmous edown','on mouseup',' onmouseove r','onmous emove','on mouseout', 'onkeypres s','onkeyd own','onke ydown','on keyup'];ev s=tinyMCE. settings.e vent_eleme nts.split( ',');for(y =0;y<evs.l ength;y++) {elms=node .getElemen tsByTagNam e(evs[y]); for(i=0;i< elms.lengt h;i++){eve nt="";for( x=0;x<even ts.length; x++){if((e vent=tinyM CE.getAttr ib(elms[i] ,events[x] ))!==''){e vent=tinyM CE.cleanup EventStr(" "+event);i f(!state)e vent="retu rn true;"+ event;else  event=eve nt.replace (/^return  true;/gi,' ');elms[i] .removeAtt ribute(eve nts[x]);el ms[i].setA ttribute(e vents[x],e vent)}}}}} ,_eventPat ch:functio n(editor_i d){var n,i nst,win,e; if(typeof( tinyMCE)== "undefined ")return t rue;try{if (tinyMCE.s electedIns tance){win =tinyMCE.s electedIns tance.getW in();if(wi n&&win.eve nt){e=win. event;if(! e.target)e .target=e. srcElement ;TinyMCE_E ngine.prot otype.hand leEvent(e) ;return}}f or(n in ti nyMCE.inst ances){ins t=tinyMCE. instances[ n];if(!tin yMCE.isIns tance(inst ))continue ;inst.sele ct();win=i nst.getWin ();if(win& &win.event ){e=win.ev ent;if(!e. target)e.t arget=e.sr cElement;T inyMCE_Eng ine.protot ype.handle Event(e);r eturn}}}ca tch(ex){}} ,findEvent :function( e){var n,i nst;if(e)r eturn e;fo r(n in tin yMCE.insta nces){inst =tinyMCE.i nstances[n ];if(tinyM CE.isInsta nce(inst)& &inst.getW in().event )return in st.getWin( ).event}re turn null} ,unloadHan dler:funct ion(){tiny MCE.trigge rSave(true ,true)},ad dEventHand lers:funct ion(inst){ this.setEv entHandler s(inst,1)} ,setEventH andlers:fu nction(ins t,s){var d oc=inst.ge tDoc(),ie, ot,i,f=s?t inyMCE.add Event:tiny MCE.remove Event;ie=[ 'keypress' ,'keyup',' keydown',' click','mo useup','mo usedown',' controlsel ect','dblc lick'];ot= ['keypress ','keyup', 'keydown', 'click','m ouseup','m ousedown', 'focus','b lur','drag drop'];ins t.switchSe ttings();i f(tinyMCE. isIE){for( i=0;i<ie.l ength;i++) f(doc,ie[i ],TinyMCE_ Engine.pro totype._ev entPatch)} else{for(i =0;i<ot.le ngth;i++)f (doc,ot[i] ,tinyMCE.h andleEvent );try{doc. designMode ="On"}catc h(e){}}},o nMouseMove :function( ){var inst ,lh;if(tin yMCE.lastH over){lh=t inyMCE.las tHover;if( lh.classNa me.indexOf ('mceMenu' )!=-1)tiny MCE._menuB uttonEvent ('out',lh) ;else lh.c lassName=l h.classNam e;tinyMCE. lastHover= null}if(!t inyMCE.has MouseMoved ){inst=tin yMCE.selec tedInstanc e;if(inst. isFocused) {inst.undo Bookmark=i nst.select ion.getBoo kmark();ti nyMCE.hasM ouseMoved= true}}},ca ncelEvent: function(e ){if(!e)re turn false ;if(tinyMC E.isIE){e. returnValu e=false;e. cancelBubb le=true}el se{e.preve ntDefault( );e.stopPr opagation& &e.stopPro pagation() }return fa lse},addEv ent:functi on(o,n,h){ if(n!='unl oad'){func tion clean (){var ex; try{tinyMC E.removeEv ent(o,n,h) ;tinyMCE.r emoveEvent (window,'u nload',cle an);o=n=h= null}catch (ex){}}tin yMCE.addEv ent(window ,'unload', clean)}if( o.attachEv ent)o.atta chEvent("o n"+n,h);el se o.addEv entListene r(n,h,fals e)},remove Event:func tion(o,n,h ){if(o.det achEvent)o .detachEve nt("on"+n, h);else o. removeEven tListener( n,h,false) },addSelec tAccessibi lity:funct ion(e,s,w) {if(!s._is Accessible ){s.onkeyd own=tinyMC E.accessib leEventHan dler;s.onb lur=tinyMC E.accessib leEventHan dler;s._is Accessible =true;s._w in=w}retur n false},a ccessibleE ventHandle r:function (e){var el m,win=this ._win;e=ti nyMCE.isIE ?win.event :e;elm=tin yMCE.isIE? e.srcEleme nt:e.targe t;if(e.typ e=="blur") {if(elm.ol donchange) {elm.oncha nge=elm.ol donchange; elm.oldonc hange=null }return tr ue}if(elm. nodeName== "SELECT"&& !elm.oldon change){el m.oldoncha nge=elm.on change;elm .onchange= null}if(e. keyCode==1 3||e.keyCo de==32){el m.onchange =elm.oldon change;elm .onchange( );elm.oldo nchange=nu ll;tinyMCE .cancelEve nt(e);retu rn false}r eturn true },_resetIf rameHeight :function( ){var ife; if(tinyMCE .isRealIE) {ife=tinyM CE.selecte dInstance. iframeElem ent;if(ife ._oldHeigh t){ife.sty le.height= ife._oldHe ight;ife.h eight=ife. _oldHeight }}}});func tion TinyM CE_Selecti on(inst){t his.instan ce=inst};T inyMCE_Sel ection.pro totype={ge tSelectedH TML:functi on(){var i nst=this.i nstance,e, r=this.get Rng(),h;if (!r)return  null;e=do cument.cre ateElement ("body");i f(r.cloneC ontents)e. appendChil d(r.cloneC ontents()) ;else if(t ypeof(r.it em)!='unde fined'||ty peof(r.htm lText)!='u ndefined') e.innerHTM L=r.item?r .item(0).o uterHTML:r .htmlText; else e.inn erHTML=r.t oString(); h=tinyMCE. _cleanupHT ML(inst,in st.content Document,i nst.settin gs,e,e,fal se,true,fa lse);retur n h},getSe lectedText :function( ){var inst =this.inst ance,d,r,s ,t;if(tiny MCE.isIE){ d=inst.get Doc();if(d .selection .type=="Te xt"){r=d.s election.c reateRange ();t=r.tex t}else t=' '}else{s=t his.getSel ();if(s&&s .toString) t=s.toStri ng();else  t=''}retur n t},getBo okmark:fun ction(simp le){var in st=this.in stance,rng =this.getR ng(),doc=i nst.getDoc (),b=inst. getBody(); var trng,s x,sy,xx=-9 99999999,v p=inst.get ViewPort() ;var sp,le ,s,e,nl,i, si,ei,w;sx =vp.left;s y=vp.top;i f(simple)r eturn{rng: rng,scroll X:sx,scrol lY:sy};if( tinyMCE.is RealIE){if (rng.item) {e=rng.ite m(0);nl=b. getElement sByTagName (e.nodeNam e);for(i=0 ;i<nl.leng th;i++){if (e==nl[i]) {sp=i;brea k}}return{ tag:e.node Name,index :sp,scroll X:sx,scrol lY:sy}}els e{trng=doc .body.crea teTextRang e();trng.m oveToEleme ntText(ins t.getBody( ));trng.co llapse(tru e);bp=Math .abs(trng. move('char acter',xx) );trng=rng .duplicate ();trng.co llapse(tru e);sp=Math .abs(trng. move('char acter',xx) );trng=rng .duplicate ();trng.co llapse(fal se);le=Mat h.abs(trng .move('cha racter',xx ))-sp;retu rn{start:s p-bp,lengt h:le,scrol lX:sx,scro llY:sy}}}e lse{s=this .getSel(); e=this.get FocusEleme nt();if(!s )return nu ll;if(e&&e .nodeName= ='IMG'){re turn{start :-1,end:-1 ,index:sp, scrollX:sx ,scrollY:s y}}if(s.an chorNode== s.focusNod e&&s.ancho rOffset==s .focusOffs et){e=this ._getPosTe xt(b,s.anc horNode,s. focusNode) ;if(!e)ret urn{scroll X:sx,scrol lY:sy};ret urn{start: e.start+s. anchorOffs et,end:e.e nd+s.focus Offset,scr ollX:sx,sc rollY:sy}} else{e=thi s._getPosT ext(b,rng. startConta iner,rng.e ndContaine r);if(!e)r eturn{scro llX:sx,scr ollY:sy};r eturn{star t:e.start+ rng.startO ffset,end: e.end+rng. endOffset, scrollX:sx ,scrollY:s y}}}return  null},mov eToBookmar k:function (bookmark) {var inst= this.insta nce,rng,nl ,i,ex,b=in st.getBody (),sd;var  doc=inst.g etDoc(),wi n=inst.get Win(),sel= this.getSe l();if(!bo okmark)ret urn false; if(tinyMCE .isSafari& &bookmark. rng){sel.s etBaseAndE xtent(book mark.rng.s tartContai ner,bookma rk.rng.sta rtOffset,b ookmark.rn g.endConta iner,bookm ark.rng.en dOffset);r eturn true }if(tinyMC E.isRealIE ){if(bookm ark.rng){t ry{bookmar k.rng.sele ct()}catch (ex){}retu rn true}wi n.focus(); if(bookmar k.tag){rng =b.createC ontrolRang e();nl=b.g etElements ByTagName( bookmark.t ag);if(nl. length>boo kmark.inde x){try{rng .addElemen t(nl[bookm ark.index] )}catch(ex ){}}}else{ try{if(boo kmark.star t<0)return  true;rng= inst.getSe l().create Range();rn g.moveToEl ementText( inst.getBo dy());rng. collapse(t rue);rng.m oveStart(' character' ,bookmark. start);rng .moveEnd(' character' ,bookmark. length)}ca tch(ex){re turn true} }rng.selec t();win.sc rollTo(boo kmark.scro llX,bookma rk.scrollY );return t rue}if(tin yMCE.isGec ko||tinyMC E.isOpera) {if(!sel)r eturn fals e;if(bookm ark.rng){s el.removeA llRanges() ;sel.addRa nge(bookma rk.rng)}if (bookmark. start!=-1& &bookmark. end!=-1){t ry{sd=this ._getTextP os(b,bookm ark.start, bookmark.e nd);rng=do c.createRa nge();rng. setStart(s d.startNod e,sd.start Offset);rn g.setEnd(s d.endNode, sd.endOffs et);sel.re moveAllRan ges();sel. addRange(r ng);if(!ti nyMCE.isOp era)win.fo cus()}catc h(ex){}}wi n.scrollTo (bookmark. scrollX,bo okmark.scr ollY);retu rn true}re turn false },_getPosT ext:functi on(r,sn,en ){var w=do cument.cre ateTreeWal ker(r,Node Filter.SHO W_TEXT,nul l,false),n ,p=0,d={}; while((n=w .nextNode( ))!=null){ if(n==sn)d .start=p;i f(n==en){d .end=p;ret urn d}p+=n .nodeValue ?n.nodeVal ue.length: 0}return n ull},_getT extPos:fun ction(r,sp ,ep){var w =document. createTree Walker(r,N odeFilter. SHOW_TEXT, null,false ),n,p=0,d= {};while(( n=w.nextNo de())!=nul l){p+=n.no deValue?n. nodeValue. length:0;i f(p>=sp&&! d.startNod e){d.start Node=n;d.s tartOffset =sp-(p-n.n odeValue.l ength)}if( p>=ep){d.e ndNode=n;d .endOffset =ep-(p-n.n odeValue.l ength);ret urn d}}ret urn null}, selectNode :function( node,colla pse,select _text_node ,to_start) {var inst= this.insta nce,sel,rn g,nodes;if (!node)ret urn;if(typ eof(collap se)=="unde fined")col lapse=true ;if(typeof (select_te xt_node)== "undefined ")select_t ext_node=f alse;if(ty peof(to_st art)=="und efined")to _start=tru e;if(inst. settings.a uto_resize )inst.resi zeToConten t();if(tin yMCE.isRea lIE){rng=i nst.getDoc ().body.cr eateTextRa nge();try{ rng.moveTo ElementTex t(node);if (collapse) rng.collap se(to_star t);rng.sel ect()}catc h(e){}}els e{sel=this .getSel(); if(!sel)re turn;if(ti nyMCE.isSa fari){sel. setBaseAnd Extent(nod e,0,node,n ode.innerT ext.length );if(colla pse){if(to _start)sel .collapseT oStart();e lse sel.co llapseToEn d()}this.s crollToNod e(node);re turn}rng=i nst.getDoc ().createR ange();if( select_tex t_node){no des=tinyMC E.getNodeT ree(node,[ ],3);if(no des.length >0)rng.sel ectNodeCon tents(node s[0]);else  rng.selec tNodeConte nts(node)} else rng.s electNode( node);if(c ollapse){i f(!to_star t&&node.no deType==3) {rng.setSt art(node,n ode.nodeVa lue.length );rng.setE nd(node,no de.nodeVal ue.length) }else rng. collapse(t o_start)}s el.removeA llRanges() ;sel.addRa nge(rng)}t his.scroll ToNode(nod e);tinyMCE .selectedE lement=nul l;if(node. nodeType== 1)tinyMCE. selectedEl ement=node },scrollTo Node:funct ion(node){ var inst=t his.instan ce,w=inst. getWin(),v p=inst.get ViewPort() ,pos=tinyM CE.getAbsP osition(no de),cvp,p, cwin;if(po s.absLeft< vp.left||p os.absLeft >vp.left+v p.width||p os.absTop< vp.top||po s.absTop>v p.top+(vp. height-25) )w.scrollT o(pos.absL eft,pos.ab sTop-vp.he ight+25);i f(inst.set tings.auto _resize){c win=inst.g etContaine rWin();cvp =tinyMCE.g etViewPort (cwin);p=t his.getAbs Position(n ode);if(p. absLeft<cv p.left||p. absLeft>cv p.left+cvp .width||p. absTop<cvp .top||p.ab sTop>cvp.t op+cvp.hei ght)cwin.s crollTo(p. absLeft,p. absTop-cvp .height+25 )}},getAbs Position:f unction(n) {var pos=t inyMCE.get AbsPositio n(n),ipos= tinyMCE.ge tAbsPositi on(this.in stance.ifr ameElement );return{a bsLeft:ipo s.absLeft+ pos.absLef t,absTop:i pos.absTop +pos.absTo p}},getSel :function( ){var inst =this.inst ance;if(ti nyMCE.isRe alIE)retur n inst.get Doc().sele ction;retu rn inst.co ntentWindo w.getSelec tion()},ge tRng:funct ion(){var  s=this.get Sel();if(s ==null)ret urn null;i f(tinyMCE. isRealIE)r eturn s.cr eateRange( );if(tinyM CE.isSafar i&&!s.getR angeAt)ret urn''+wind ow.getSele ction();if (s.rangeCo unt>0)retu rn s.getRa ngeAt(0);r eturn null },isCollap sed:functi on(){var r =this.getR ng();if(r. item)retur n false;re turn r.bou ndingWidth ==0||this. getSel().i sCollapsed },collapse :function( b){var r=t his.getRng (),s=this. getSel();i f(r.select ){r.collap se(b);r.se lect()}els e{if(b)s.c ollapseToS tart();els e s.collap seToEnd()} },getFocus Element:fu nction(){v ar inst=th is.instanc e,doc,rng, sel,elm;if (tinyMCE.i sRealIE){d oc=inst.ge tDoc();rng =doc.selec tion.creat eRange();e lm=rng.ite m?rng.item (0):rng.pa rentElemen t()}else{i f(!tinyMCE .isSafari& &inst.isHi dden())ret urn inst.g etBody();s el=this.ge tSel();rng =this.getR ng();if(!s el||!rng)r eturn null ;elm=rng.c ommonAnces torContain er;if(!rng .collapsed ){if(rng.s tartContai ner==rng.e ndContaine r){if(rng. startOffse t-rng.endO ffset<2){i f(rng.star tContainer .hasChildN odes())elm =rng.start Container. childNodes [rng.start Offset]}}} elm=tinyMC E.getParen tElement(e lm);}retur n elm}};fu nction Tin yMCE_UndoR edo(inst){ this.insta nce=inst;t his.undoLe vels=[];th is.undoInd ex=0;this. typingUndo Index=-1;t his.undoRe do=true};T inyMCE_Und oRedo.prot otype={add :function( l){var b,c ustomUndoL evels,newH TML,inst=t his.instan ce,i,ul,ur ;if(l){thi s.undoLeve ls[this.un doLevels.l ength]=l;r eturn true }if(this.t ypingUndoI ndex!=-1){ this.undoI ndex=this. typingUndo Index;if(t inyMCE.typ ingUndoInd ex!=-1)tin yMCE.undoI ndex=tinyM CE.typingU ndoIndex}n ewHTML=tin yMCE.trim( inst.getBo dy().inner HTML);if(t his.undoLe vels[this. undoIndex] &&newHTML! =this.undo Levels[thi s.undoInde x].content ){inst.isN otDirty=fa lse;tinyMC E.dispatch Callback(i nst,'oncha nge_callba ck','onCha nge',inst) ;customUnd oLevels=ti nyMCE.sett ings.custo m_undo_red o_levels;i f(customUn doLevels!= -1&&this.u ndoLevels. length>cus tomUndoLev els){for(i =0;i<this. undoLevels .length-1; i++)this.u ndoLevels[ i]=this.un doLevels[i +1];this.u ndoLevels. length--;t his.undoIn dex--;}b=i nst.undoBo okmark;if( !b)b=inst. selection. getBookmar k();this.u ndoIndex++ ;this.undo Levels[thi s.undoInde x]={conten t:newHTML, bookmark:b };ul=tinyM CE.undoLev els;for(i= tinyMCE.un doIndex+1; i<ul.lengt h;i++){ur= ul[i].undo Redo;if(ur .undoIndex ==ur.undoL evels.leng th-1)ur.un doIndex--; ur.undoLev els.length --}tinyMCE .undoLevel s[tinyMCE. undoIndex+ +]=inst;ti nyMCE.undo Levels.len gth=tinyMC E.undoInde x;this.und oLevels.le ngth=this. undoIndex+ 1;return t rue}return  false},un do:functio n(){var in st=this.in stance;if( this.undoI ndex>0){th is.undoInd ex--;tinyM CE.setInne rHTML(inst .getBody() ,this.undo Levels[thi s.undoInde x].content );inst.rep aint();if( inst.setti ngs.custom _undo_redo _restore_s election)i nst.select ion.moveTo Bookmark(t his.undoLe vels[this. undoIndex] .bookmark) }},redo:fu nction(){v ar inst=th is.instanc e;tinyMCE. execComman d("mceEndT yping");if (this.undo Index<(thi s.undoLeve ls.length- 1)){this.u ndoIndex++ ;tinyMCE.s etInnerHTM L(inst.get Body(),thi s.undoLeve ls[this.un doIndex].c ontent);in st.repaint ();if(inst .settings. custom_und o_redo_res tore_selec tion)inst. selection. moveToBook mark(this. undoLevels [this.undo Index].boo kmark)}tin yMCE.trigg erNodeChan ge()}};var  TinyMCE_F orceParagr aphs={_ins ertPara:fu nction(ins t,e){var d oc=inst.ge tDoc(),sel =inst.getS el(),body= inst.getBo dy(),win=i nst.conten tWindow,rn g=sel.getR angeAt(0); var rootEl m=doc.docu mentElemen t,blockNam e="P",star tNode,endN ode,startB lock,endBl ock;var rn gBefore,rn gAfter,dir ect,startN ode,startO ffset,endN ode,endOff set,b=tiny MCE.isOper a?inst.sel ection.get Bookmark() :null;var  paraBefore ,paraAfter ,startChop ,endChop,c ontents,i; function i sEmpty(par a){var nod es;functio n isEmptyH TML(html){ return htm l.replace( new RegExp ('[ \t\r\n ]+','g'),' ').toLower Case()=='' }if(para.g etElements ByTagName( "img").len gth>0)retu rn false;i f(para.get ElementsBy TagName("t able").len gth>0)retu rn false;i f(para.get ElementsBy TagName("h r").length >0)return  false;node s=tinyMCE. getNodeTre e(para,[], 3);for(i=0 ;i<nodes.l ength;i++) {if(!isEmp tyHTML(nod es[i].node Value))ret urn false} return tru e}rngBefor e=doc.crea teRange(); rngBefore. setStart(s el.anchorN ode,sel.an chorOffset );rngBefor e.collapse (true);rng After=doc. createRang e();rngAft er.setStar t(sel.focu sNode,sel. focusOffse t);rngAfte r.collapse (true);dir ect=rngBef ore.compar eBoundaryP oints(rngB efore.STAR T_TO_END,r ngAfter)<0 ;startNode =direct?se l.anchorNo de:sel.foc usNode;sta rtOffset=d irect?sel. anchorOffs et:sel.foc usOffset;e ndNode=dir ect?sel.fo cusNode:se l.anchorNo de;endOffs et=direct? sel.focusO ffset:sel. anchorOffs et;startNo de=startNo de.nodeNam e=="BODY"? startNode. firstChild :startNode ;endNode=e ndNode.nod eName=="BO DY"?endNod e.firstChi ld:endNode ;startBloc k=inst.get ParentBloc kElement(s tartNode); endBlock=i nst.getPar entBlockEl ement(endN ode);if(st artBlock&& (startBloc k.nodeName =='CAPTION '||/absolu te|relativ e|static/g i.test(sta rtBlock.st yle.positi on)))start Block=null ;if(endBlo ck&&(endBl ock.nodeNa me=='CAPTI ON'||/abso lute|relat ive|static /gi.test(e ndBlock.st yle.positi on)))endBl ock=null;i f(startBlo ck!=null){ blockName= startBlock .nodeName; if(/(TD|TA BLE|TH|CAP TION)/.tes t(blockNam e)||(block Name=="DIV "&&/left|r ight/gi.te st(startBl ock.style. cssFloat)) )blockName ="P"}if(ti nyMCE.getP arentEleme nt(startBl ock,"OL,UL ",null,bod y)!=null)r eturn fals e;if((star tBlock!=nu ll&&startB lock.nodeN ame=="TABL E")||(endB lock!=null &&endBlock .nodeName= ="TABLE")) startBlock =endBlock= null;paraB efore=(sta rtBlock!=n ull&&start Block.node Name==bloc kName)?sta rtBlock.cl oneNode(fa lse):doc.c reateEleme nt(blockNa me);paraAf ter=(endBl ock!=null& &endBlock. nodeName== blockName) ?endBlock. cloneNode( false):doc .createEle ment(block Name);if(/ ^(H[1-6])$ /.test(blo ckName))pa raAfter=do c.createEl ement("p") ;startChop =startNode ;endChop=e ndNode;nod e=startCho p;do{if(no de==body|| node.nodeT ype==9||ti nyMCE.isBl ockElement (node))bre ak;startCh op=node}wh ile((node= node.previ ousSibling ?node.prev iousSiblin g:node.par entNode)); node=endCh op;do{if(n ode==body| |node.node Type==9||t inyMCE.isB lockElemen t(node))br eak;endCho p=node}whi le((node=n ode.nextSi bling?node .nextSibli ng:node.pa rentNode)) ;if(startC hop.nodeNa me=="TD")s tartChop=s tartChop.f irstChild; if(endChop .nodeName= ="TD")endC hop=endCho p.lastChil d;if(start Block==nul l){rng.del eteContent s();if(!ti nyMCE.isSa fari)sel.r emoveAllRa nges();if( startChop! =rootElm&& endChop!=r ootElm){rn gBefore=rn g.cloneRan ge();if(st artChop==b ody)rngBef ore.setSta rt(startCh op,0);else  rngBefore .setStartB efore(star tChop);par aBefore.ap pendChild( rngBefore. cloneConte nts());if( endChop.pa rentNode.n odeName==b lockName)e ndChop=end Chop.paren tNode;rng. setEndAfte r(endChop) ;if(endCho p.nodeName !="#text"& &endChop.n odeName!=" BODY")rngB efore.setE ndAfter(en dChop);con tents=rng. cloneConte nts();if(c ontents.fi rstChild&& (contents. firstChild .nodeName= =blockName ||contents .firstChil d.nodeName =="BODY")) paraAfter. innerHTML= contents.f irstChild. innerHTML; else paraA fter.appen dChild(con tents);if( isEmpty(pa raBefore)) paraBefore .innerHTML ="&nbsp;"; if(isEmpty (paraAfter ))paraAfte r.innerHTM L="&nbsp;" ;rng.delet eContents( );rngAfter .deleteCon tents();rn gBefore.de leteConten ts();if(ti nyMCE.isOp era){paraB efore.norm alize();rn gBefore.in sertNode(p araBefore) ;paraAfter .normalize ();rngBefo re.insertN ode(paraAf ter)}else{ paraAfter. normalize( );rngBefor e.insertNo de(paraAft er);paraBe fore.norma lize();rng Before.ins ertNode(pa raBefore)} }else{body .innerHTML ="<"+block Name+">&nb sp;</"+blo ckName+">< "+blockNam e+">&nbsp; </"+blockN ame+">";pa raAfter=bo dy.childNo des[1]}ins t.selectio n.moveToBo okmark(b); inst.selec tion.selec tNode(para After,true ,true);ret urn true}i f(startCho p.nodeName ==blockNam e)rngBefor e.setStart (startChop ,0);else r ngBefore.s etStartBef ore(startC hop);rngBe fore.setEn d(startNod e,startOff set);paraB efore.appe ndChild(rn gBefore.cl oneContent s());rngAf ter.setEnd After(endC hop);rngAf ter.setSta rt(endNode ,endOffset );contents =rngAfter. cloneConte nts();if(c ontents.fi rstChild&& contents.f irstChild. nodeName== blockName) {paraAfter .innerHTML =contents. firstChild .innerHTML }else para After.appe ndChild(co ntents);if (isEmpty(p araBefore) )paraBefor e.innerHTM L="&nbsp;" ;if(isEmpt y(paraAfte r))paraAft er.innerHT ML="&nbsp; ";rng=doc. createRang e();if(!st artChop.pr eviousSibl ing&&start Chop.paren tNode.node Name.toUpp erCase()== blockName) {rng.setSt artBefore( startChop. parentNode )}else{if( rngBefore. startConta iner.nodeN ame.toUppe rCase()==b lockName&& rngBefore. startOffse t==0)rng.s etStartBef ore(rngBef ore.startC ontainer); else rng.s etStart(rn gBefore.st artContain er,rngBefo re.startOf fset)}if(! endChop.ne xtSibling& &endChop.p arentNode. nodeName.t oUpperCase ()==blockN ame)rng.se tEndAfter( endChop.pa rentNode); else rng.s etEnd(rngA fter.endCo ntainer,rn gAfter.end Offset);rn g.deleteCo ntents();i f(tinyMCE. isOpera){r ng.insertN ode(paraBe fore);rng. insertNode (paraAfter )}else{rng .insertNod e(paraAfte r);rng.ins ertNode(pa raBefore)} paraAfter. normalize( );paraBefo re.normali ze();inst. selection. moveToBook mark(b);in st.selecti on.selectN ode(paraAf ter,true,t rue);retur n true},_h andleBackS pace:funct ion(inst){ var r=inst .getRng(), sn=r.start Container, nv,s=false ;if(sn&&sn .nextSibli ng&&sn.nex tSibling.n odeName==" BR"&&sn.pa rentNode.n odeName!=" BODY"){nv= sn.nodeVal ue;if(nv!= null&&r.st artOffset= =nv.length )sn.nextSi bling.pare ntNode.rem oveChild(s n.nextSibl ing)}if(in st.setting s.auto_res ize)inst.r esizeToCon tent();ret urn s}};fu nction Tin yMCE_Layer (id,bm){th is.id=id;t his.blocke rElement=n ull;this.e vents=fals e;this.ele ment=null; this.block Mode=typeo f(bm)!='un defined'?b m:true;thi s.doc=docu ment};Tiny MCE_Layer. prototype= {moveRelat iveTo:func tion(re,p) {var rep=t his.getAbs Position(r e),e=this. getElement (),x,y;var  w=parseIn t(re.offse tWidth),h= parseInt(r e.offsetHe ight);var  ew=parseIn t(e.offset Width),eh= parseInt(e .offsetHei ght);switc h(p){case" tl":x=rep. absLeft;y= rep.absTop ;break;cas e"tr":x=re p.absLeft+ w;y=rep.ab sTop;break ;case"bl": x=rep.absL eft;y=rep. absTop+h;b reak;case" br":x=rep. absLeft+w; y=rep.absT op+h;break ;case"cc": x=rep.absL eft+(w/ 2)  - (ew /2) ;y=rep.abs Top+(h/ 2)  - (eh /2) ;break}thi s.moveTo(x ,y)},moveB y:function (x,y){var  e=this.get Element(); this.moveT o(parseInt (e.style.l eft)+x,par seInt(e.st yle.top)+y )},moveTo: function(x ,y){var e= this.getEl ement();e. style.left =x+"px";e. style.top= y+"px";thi s.updateBl ocker()},r esizeBy:fu nction(w,h ){var e=th is.getElem ent();this .resizeTo( parseInt(e .style.wid th)+w,pars eInt(e.sty le.height) +h)},resiz eTo:functi on(w,h){va r e=this.g etElement( );if(w!=nu ll)e.style .width=w+" px";if(h!= null)e.sty le.height= h+"px";thi s.updateBl ocker()},s how:functi on(){var e l=this.get Element(); if(el){el. style.disp lay='block ';this.upd ateBlocker ()}},hide: function() {var el=th is.getElem ent();if(e l){el.styl e.display= 'none';thi s.updateBl ocker()}}, isVisible: function() {return th is.getElem ent().styl e.display= ='block'}, getElement :function( ){if(!this .element)t his.elemen t=this.doc .getElemen tById(this .id);retur n this.ele ment},setB lockMode:f unction(s) {this.bloc kMode=s},u pdateBlock er:functio n(){var e, b,x,y,w,h; b=this.get Blocker(); if(b){if(t his.blockM ode){e=thi s.getEleme nt();x=thi s.parseInt (e.style.l eft);y=thi s.parseInt (e.style.t op);w=this .parseInt( e.offsetWi dth);h=thi s.parseInt (e.offsetH eight);b.s tyle.left= x+'px';b.s tyle.top=y +'px';b.st yle.width= w+'px';b.s tyle.heigh t=h+'px';b .style.dis play=e.sty le.display }else b.st yle.displa y='none'}} ,getBlocke r:function (){var d,b ;if(!this. blockerEle ment&&this .blockMode ){d=this.d oc;b=d.get ElementByI d(this.id+ "_blocker" );if(!b){b =d.createE lement("if rame");b.s etAttribut e('id',thi s.id+"_blo cker");b.s tyle.cssTe xt='displa y: none; p osition: a bsolute; l eft: 0; to p: 0';b.sr c='javascr ipt:false; ';b.frameB order='0'; b.scrollin g='no';d.b ody.append Child(b)}t his.blocke rElement=b }return th is.blocker Element},g etAbsPosit ion:functi on(n){var  p={absLeft :0,absTop: 0};while(n ){p.absLef t+=n.offse tLeft;p.ab sTop+=n.of fsetTop;n= n.offsetPa rent}retur n p},creat e:function (n,c,p,h){ var d=this .doc,e=d.c reateEleme nt(n);e.se tAttribute ('id',this .id);if(c) e.classNam e=c;if(!p) p=d.body;i f(h)e.inne rHTML=h;p. appendChil d(e);retur n this.ele ment=e},ex ists:funct ion(){retu rn this.do c.getEleme ntById(thi s.id)!=nul l},parseIn t:function (s){if(s== null||s==' ')return 0 ;return pa rseInt(s)} ,remove:fu nction(){v ar e=this. getElement (),b=this. getBlocker ();if(e)e. parentNode .removeChi ld(e);if(b )b.parentN ode.remove Child(b)}} ;function  TinyMCE_Me nu(){var i d;if(typeo f(tinyMCE. menuCounte r)=="undef ined")tiny MCE.menuCo unter=0;id ="mc_menu_ "+tinyMCE. menuCounte r++;TinyMC E_Layer.ca ll(this,id ,true);thi s.id=id;th is.items=[ ];this.nee dsUpdate=t rue};TinyM CE_Menu.pr ototype=ti nyMCE.exte nd(TinyMCE _Layer.pro totype,{in it:functio n(s){var n ;this.sett ings={sepa rator_clas s:'mceMenu Separator' ,title_cla ss:'mceMen uTitle',di sabled_cla ss:'mceMen uDisabled' ,menu_clas s:'mceMenu ',drop_men u:true};fo r(n in s)t his.settin gs[n]=s[n] ;this.crea te('div',t his.settin gs.menu_cl ass)},clea r:function (){this.it ems=[]},ad dTitle:fun ction(t){t his.add({t ype:'title ',text:t}) },addDisab led:functi on(t){this .add({type :'disabled ',text:t}) },addSepar ator:funct ion(){this .add({type :'separato r'})},addI tem:functi on(t,js){t his.add({t ext:t,js:j s})},add:f unction(mi ){this.ite ms[this.it ems.length ]=mi;this. needsUpdat e=true},up date:funct ion(){var  e=this.get Element(), h='',i,t,m =this.item s,s=this.s ettings;if (this.sett ings.drop_ menu)h+='< span class ="mceMenuL ine"></spa n>';h+='<t able borde r="0" cell padding="0 " cellspac ing="0">'; for(i=0;i< m.length;i ++){t=tiny MCE.xmlEnc ode(m[i].t ext);c=m[i ].class_na me?' class ="'+m[i].c lass_name+ '"':'';swi tch(m[i].t ype){case' separator' :h+='<tr c lass="'+s. separator_ class+'">< td>';break ;case'titl e':h+='<tr  class="'+ s.title_cl ass+'"><td ><span'+c+ '>'+t+'</s pan>';brea k;case'dis abled':h+= '<tr class ="'+s.disa bled_class +'"><td><s pan'+c+'>' +t+'</span >';break;d efault:h+= '<tr><td>< a href="'+ tinyMCE.xm lEncode(m[ i].js)+'"  onmousedow n="'+tinyM CE.xmlEnco de(m[i].js )+';return  tinyMCE.c ancelEvent (event);"  onclick="r eturn tiny MCE.cancel Event(even t);" onmou seup="retu rn tinyMCE .cancelEve nt(event); "><span'+c +'>'+t+'</ span></a>' }h+='</td> </tr>'}h+= '</table>' ;e.innerHT ML=h;this. needsUpdat e=false;th is.updateB locker()}, show:funct ion(){var  nl,i;if(ti nyMCE.last Menu==this )return;if (this.need sUpdate)th is.update( );if(tinyM CE.lastMen u&&tinyMCE .lastMenu! =this)tiny MCE.lastMe nu.hide(); TinyMCE_La yer.protot ype.show.c all(this); if(!tinyMC E.isOpera) {}tinyMCE. lastMenu=t his}});tin yMCE.add(T inyMCE_Eng ine,{debug :function( ){var m="" ,a,i,l=tin yMCE.log.l ength;for( i=0,a=this .debug.arg uments;i<a .length;i+ +){m+=a[i] ;if(i<a.le ngth-1)m+= ', '}if(l< 1000)tinyM CE.log[l]= "[debug] " +m}});   1   var tinymc e={majorVe rsion:'3', minorVersi on:'0.5',r eleaseDate :'2008-03- 12',_init: function() {var t=thi s,ua=navig ator.userA gent,i,nl, n,base;t.i sOpera=win dow.opera& &opera.bui ldNumber;t .isWebKit= /WebKit/.t est(ua);t. isOldWebKi t=t.isWebK it&&!windo w.getSelec tion().get RangeAt;t. isIE=!t.is WebKit&&!t .isOpera&& (/MSIE/gi) .test(ua)& &(/Explore r/gi).test (navigator .appName); t.isIE6=t. isIE&&/MSI E [56]/.te st(ua);t.i sGecko=!t. isWebKit&& /Gecko/.te st(ua);t.i sMac=ua.in dexOf('Mac ')!=-1;if( window.tin yMCEPreIni t){t.suffi x=tinyMCEP reInit.suf fix;t.base URL=tinyMC EPreInit.b ase;return ;}t.suffix ='';nl=doc ument.getE lementsByT agName('ba se');for(i =0;i<nl.le ngth;i++){ if(nl[i].h ref)base=n l[i].href; }function  getBase(n) {if(n.src& &/tiny_mce (|_dev|_sr c|_gzip|_j query|_pro totype).js /.test(n.s rc)){if(/_ (src|dev)\ .js/g.test (n.src))t. suffix='_s rc';t.base URL=n.src. substring( 0,n.src.la stIndexOf( '/'));if(b ase&&t.bas eURL.index Of('://')= =-1)t.base URL=base+t .baseURL;r eturn t.ba seURL;}ret urn null;} ;nl=docume nt.getElem entsByTagN ame('scrip t');for(i= 0;i<nl.len gth;i++){i f(getBase( nl[i]))ret urn;}n=doc ument.getE lementsByT agName('he ad')[0];if (n){nl=n.g etElements ByTagName( 'script'); for(i=0;i< nl.length; i++){if(ge tBase(nl[i ]))return; }}return;} ,is:functi on(o,t){va r n=typeof (o);if(!t) return n!= 'undefined ';if(t=='a rray'&&(o  instanceof  Array))re turn true; return n== t;},each:f unction(o, cb,s){var  n,l;if(!o) return 0;s =s||o;if(t ypeof(o.le ngth)!='un defined'){ for(n=0,l= o.length;n <l;n++){if (cb.call(s ,o[n],n,o) ===false)r eturn 0;}} else{for(n  in o){if( o.hasOwnPr operty(n)) {if(cb.cal l(s,o[n],n ,o)===fals e)return 0 ;}}}return  1;},map:f unction(a, f){var o=[ ];tinymce. each(a,fun ction(v){o .push(f(v) );});retur n o;},grep :function( a,f){var o =[];tinymc e.each(a,f unction(v) {if(!f||f( v))o.push( v);});retu rn o;},inA rray:funct ion(a,v){v ar i,l;if( a){for(i=0 ,l=a.lengt h;i<l;i++) {if(a[i]== =v)return  i;}}return -1;},exten d:function (o,e){var  i,a=argume nts;for(i= 1;i<a.leng th;i++){e= a[i];tinym ce.each(e, function(v ,n){if(typ eof(v)!==' undefined' )o[n]=v;}) ;}return o ;},trim:fu nction(s){ return(s?' '+s:'').re place(/^\s *|\s*$/g,' ');},creat e: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].repl ace(/\.\w+ $/,''));if (ns[cn])re turn;if(s[ 2]=='stati c'){ns[cn] =p;if(this .onCreate) this.onCre ate(s[2],s [3],ns[cn] );return;} if(!p[cn]) {p[cn]=fun ction(){}; de=1;}ns[c n]=p[cn];t .extend(ns [cn].proto type,p);if (s[5]){sp= t.resolve( s[5]).prot otype;scn= s[5].match (/\.(\w+)$ /i)[1];c=n s[cn];if(d e){ns[cn]= function() {return sp [scn].appl y(this,arg uments);}; }else{ns[c n]=functio n(){this.p arent=sp[s cn];return  c.apply(t his,argume nts);};}ns [cn].proto type[cn]=n s[cn];t.ea ch(sp,func tion(f,n){ ns[cn].pro totype[n]= sp[n];});t .each(p,fu nction(f,n ){if(sp[n] ){ns[cn].p rototype[n ]=function (){this.pa rent=sp[n] ;return f. apply(this ,arguments );};}else{ if(n!=cn)n s[cn].prot otype[n]=f ;}});}t.ea ch(p['stat ic'],funct ion(f,n){n s[cn][n]=f ;});if(thi s.onCreate )this.onCr eate(s[2], s[3],ns[cn ].prototyp e);},walk: function(o ,f,n,s){s= s||this;if (o){if(n)o =o[n];tiny mce.each(o ,function( o,i){if(f. call(s,o,i ,n)===fals e)return f alse;tinym ce.walk(o, f,n,s);}); }},createN S:function (n,o){var  i,v;o=o||w indow;n=n. split('.') ;for(i=0;i <n.length; i++){v=n[i ];if(!o[v] )o[v]={};o =o[v];}ret urn o;},re solve:func tion(n,o){ var i,l;o= o||window; n=n.split( '.');for(i =0,l=n.len gth;i<l;i+ +){o=o[n[i ]];if(!o)b reak;}retu rn o;},add Unload:fun ction(f,s) {var t=thi s,w=window ,unload;f= {func:f,sc ope:s||thi s};if(!t.u nloads){un load=funct ion(){var  li=t.unloa ds,o,n;for (n in li){ o=li[n];if (o&&o.func )o.func.ca ll(o.scope );}if(w.de tachEvent) w.detachEv ent('onunl oad',unloa d);else if (w.removeE ventListen er)w.remov eEventList ener('unlo ad',unload ,false);o= li=w=unloa d=null;if( window.Col lectGarbag e)window.C ollectGarb age();};if (w.attachE vent)w.att achEvent(' onunload', unload);el se if(w.ad dEventList ener)w.add EventListe ner('unloa d',unload, false);t.u nloads=[f] ;}else t.u nloads.pus h(f);retur n f;},remo veUnload:f unction(f) {var u=thi s.unloads, r=null;tin ymce.each( u,function (o,i){if(o &&o.func== f){u.splic e(i,1);r=f ;return fa lse;}});re turn r;},e xplode:fun ction(s,d) {return ti nymce.map( s.split(d| |','),tiny mce.trim); }};window. tinymce=ti nymce;tiny mce._init( );tinymce. create('ti nymce.util .Dispatche r',{scope: null,liste ners:null, Dispatcher :function( s){this.sc ope=s||thi s;this.lis teners=[]; },add:func tion(cb,s) {this.list eners.push ({cb:cb,sc ope:s||thi s.scope}); return cb; },addToTop :function( cb,s){this .listeners .unshift({ cb:cb,scop e:s||this. scope});re turn cb;}, remove:fun ction(cb){ var l=this .listeners ,o=null;ti nymce.each (l,functio n(c,i){if( cb==c.cb){ o=cb;l.spl ice(i,1);r eturn fals e;}});retu rn o;},dis patch:func tion(){var  s,a=argum ents;tinym ce.each(th is.listene rs,functio n(c){retur n s=c.cb.a pply(c.sco pe,a);});r eturn s;}} );(functio n(){var ea ch=tinymce .each;tiny mce.create ('tinymce. util.URI', {URI:funct ion(u,s){v ar t=this, o,a,b;s=t. settings=s ||{};if(/^ (mailto|ne ws|javascr ipt|about) :/i.test(u )||/^\s*#/ .test(u)){ t.source=u ;return;}i f(u.indexO f('/')===0 &&u.indexO f('//')!== 0)u=(s.bas e_uri?s.ba se_uri.pro tocol||'ht tp':'http' )+'://mce_ host'+u;if (u.indexOf ('://')=== -1&&u.inde xOf('//')! ==0)u=(s.b ase_uri.pr otocol||'h ttp')+':// mce_host'+ t.toAbsPat h(s.base_u ri.path,u) ;u=u.repla ce(/@@/g,' (mce_at)') ;u=/^(?:(? ![^:@]+:[^ :@\/]*@)([ ^:\/?#.]+) :)?(?:\/\/ )?((?:(([^ :@]*):?([^ :@]*))?@)? ([^:\/?#]* )(?::(\d*) )?)(((\/(? :[^?#](?![ ^?#\/]*\.[ ^?#\/.]+(? :[?#]|$))) *\/?)?([^? #\/]*))(?: \?([^#]*)) ?(?:#(.*)) ?)/.exec(u );each(["s ource","pr otocol","a uthority", "userInfo" ,"user","p assword"," host","por t","relati ve","path" ,"director y","file", "query","a nchor"],fu nction(v,i ){var s=u[ i];if(s)s= s.replace( /\(mce_at\ )/g,'@@'); t[v]=s;}); if(b=s.bas e_uri){if( !t.protoco l)t.protoc ol=b.proto col;if(!t. userInfo)t .userInfo= b.userInfo ;if(!t.por t&&t.host= ='mce_host ')t.port=b .port;if(! t.host||t. host=='mce _host')t.h ost=b.host ;t.source= '';}},setP ath:functi on(p){var  t=this;p=/ ^(.*?)\/?( \w+)?$/.ex ec(p);t.pa th=p[0];t. directory= p[1];t.fil e=p[2];t.s ource='';t .getURI(); },toRelati ve:functio n(u){var t =this,o;u= new tinymc e.util.URI (u,{base_u ri:t});if( (u.host!=' mce_host'& &t.host!=u .host&&u.h ost)||t.po rt!=u.port ||t.protoc ol!=u.prot ocol)retur n u.getURI ();o=t.toR elPath(t.p ath,u.path );if(u.que ry)o+='?'+ u.query;if (u.anchor) o+='#'+u.a nchor;retu rn o;},toA bsolute:fu nction(u,n h){var u=n ew tinymce .util.URI( u,{base_ur i:this});r eturn u.ge tURI(this. host==u.ho st?nh:0);} ,toRelPath :function( base,path) {var items ,bp=0,out= '',i;base= base.subst ring(0,bas e.lastInde xOf('/')); base=base. split('/') ;items=pat h.split('/ ');if(base .length>=i tems.lengt h){for(i=0 ;i<base.le ngth;i++){ if(i>=item s.length|| base[i]!=i tems[i]){b p=i+1;brea k;}}}if(ba se.length< items.leng th){for(i= 0;i<items. length;i++ ){if(i>=ba se.length| |base[i]!= items[i]){ bp=i+1;bre ak;}}}if(b p==1)retur n path;for (i=0;i<bas e.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 ou t;},toAbsP ath:functi on(base,pa th){var i, nb=0,o=[]; base=base. split('/') ;path=path .split('/' );each(bas e,function (k){if(k)o .push(k);} );base=o;f or(i=path. length-1,o =[];i>=0;i --){if(pat h[i].lengt h==0||path [i]==".")c ontinue;if (path[i]== '..'){nb++ ;continue; }if(nb>0){ nb--;conti nue;}o.pus h(path[i]) ;}i=base.l ength-nb;i f(i<=0)ret urn'/'+o.r everse().j oin('/');r eturn'/'+b ase.slice( 0,i).join( '/')+'/'+o .reverse() .join('/') ;},getURI: function(n h){var s,t =this;if(! t.source|| nh){s='';i f(!nh){if( t.protocol )s+=t.prot ocol+'://' ;if(t.user Info)s+=t. userInfo+' @';if(t.ho st)s+=t.ho st;if(t.po rt)s+=':'+ t.port;}if (t.path)s+ =t.path;if (t.query)s +='?'+t.qu ery;if(t.a nchor)s+=' #'+t.ancho r;t.source =s;}return  t.source; }});})();( function() {var each= tinymce.ea ch;tinymce .create('s tatic tiny mce.util.C ookie',{ge tHash:func tion(n){va r v=this.g et(n),h;if (v){each(v .split('&' ),function (v){v=v.sp lit('=');h =h||{};h[u nescape(v[ 0])]=unesc ape(v[1]); });}return  h;},setHa sh:functio n(n,v,e,p, d,s){var o ='';each(v ,function( v,k){o+=(! o?'':'&')+ escape(k)+ '='+escape (v);});thi s.set(n,o, e,p,d,s);} ,get:funct ion(n){var  c=documen t.cookie,e ,p=n+"=",b ;if(!c)ret urn;b=c.in dexOf("; " +p);if(b== -1){b=c.in dexOf(p);i f(b!=0)ret urn null;} else b+=2; e=c.indexO f(";",b);i f(e==-1)e= c.length;r eturn unes cape(c.sub string(b+p .length,e) );},set:fu nction(n,v ,e,p,d,s){ document.c ookie=n+"= "+escape(v )+((e)?";  expires="+ e.toGMTStr ing():"")+ ((p)?"; pa th="+escap e(p):"")+( (d)?"; dom ain="+d:"" )+((s)?";  secure":"" );},remove :function( n,p){var d =new Date( );d.setTim e(d.getTim e()-1000); this.set(n ,'',d,p,d) ;}});})(); tinymce.cr eate('stat ic tinymce .util.JSON ',{seriali ze:functio n(o){var i ,v,s=tinym ce.util.JS ON.seriali ze,t;if(o= =null)retu rn'null';t =typeof o; if(t=='str ing'){v='\ bb\tt\nn\f f\rr\""\'\ '\\\\';ret urn'"'+o.r eplace(/([ \u0080-\uF FFF\x00-\x 1f\"\'])/g ,function( a,b){i=v.i ndexOf(b); if(i+1)ret urn'\\'+v. charAt(i+1 );a=b.char CodeAt().t oString(16 );return'\ \u'+'0000' .substring (a.length) +a;})+'"'; }if(t=='ob ject'){if( o instance of Array){ for(i=0,v= '[';i<o.le ngth;i++)v +=(i>0?',' :'')+s(o[i ]);return  v+']';}v=' {';for(i i n o)v+=typ eof o[i]!= 'function' ?(v.length >1?',"':'" ')+i+'":'+ s(o[i]):'' ;return v+ '}';}retur n''+o;},pa rse:functi on(s){try{ return eva l('('+s+') ');}catch( ex){}}});t inymce.cre ate('stati c tinymce. util.XHR', {send:func tion(o){va r x,t,w=wi ndow,c=0;o .scope=o.s cope||this ;o.success _scope=o.s uccess_sco pe||o.scop e;o.error_ scope=o.er ror_scope| |o.scope;o .async=o.a sync===fal se?false:t rue;o.data =o.data||' ';function  get(s){x= 0;try{x=ne w ActiveXO bject(s);} catch(ex){ }return x; };x=w.XMLH ttpRequest ?new XMLHt tpRequest( ):get('Mic rosoft.XML HTTP')||ge t('Msxml2. XMLHTTP'); if(x){if(x .overrideM imeType)x. overrideMi meType(o.c ontent_typ e);x.open( o.type||(o .data?'POS T':'GET'), o.url,o.as ync);if(o. content_ty pe)x.setRe questHeade r('Content -Type',o.c ontent_typ e);x.send( o.data);t= w.setInter val(functi on(){if(x. readyState ==4||c++>1 0000){w.cl earInterva l(t);if(o. success&&c <10000&&x. status==20 0)o.succes s.call(o.s uccess_sco pe,''+x.re sponseText ,x,o);else  if(o.erro r)o.error. call(o.err or_scope,c >10000?'TI MED_OUT':' GENERAL',x ,o);x=null ;}},10);}} });(functi on(){var e xtend=tiny mce.extend ,JSON=tiny mce.util.J SON,XHR=ti nymce.util .XHR;tinym ce.create( 'tinymce.u til.JSONRe quest',{JS ONRequest: function(s ){this.set tings=exte nd({},s);t his.count= 0;},send:f unction(o) {var ecb=o .error,scb =o.success ;o=extend( this.setti ngs,o);o.s uccess=fun ction(c,x) {c=JSON.pa rse(c);if( typeof(c)= ='undefine d'){c={err or:'JSON P arse error .'};}if(c. error)ecb. call(o.err or_scope|| o.scope,c. error,x);e lse scb.ca ll(o.succe ss_scope|| o.scope,c. result);}; o.error=fu nction(ty, x){ecb.cal l(o.error_ scope||o.s cope,ty,x) ;};o.data= JSON.seria lize({id:o .id||'c'+( this.count ++),method :o.method, params:o.p arams});o. content_ty pe='applic ation/json ';XHR.send (o);},'sta tic':{send RPC:functi on(o){retu rn new tin ymce.util. JSONReques t().send(o );}}});}() );(functio n(){var ea ch=tinymce .each,is=t inymce.is; var isWebK it=tinymce .isWebKit, isIE=tinym ce.isIE;ti nymce.crea te('tinymc e.dom.DOMU tils',{doc :null,root :null,file s:null,lis teners:{}, pixelStyle s:/^(top|l eft|bottom |right|wid th|height| borderWidt h)$/,cache :{},idPatt ern:/^#[\w ]+$/,elmPa ttern:/^[\ w_*]+$/,el mClassPatt ern:/^([\w _]*)\.([\w _]+)$/,DOM Utils:func tion(d,s){ var t=this ;t.doc=d;t .files={}; t.cssFlick er=false;t .counter=0 ;t.boxMode l=!tinymce .isIE||d.c ompatMode= ="CSS1Comp at";t.stdM ode=d.docu mentMode== =8;this.se ttings=s=t inymce.ext end({keep_ values:fal se,hex_col ors:1,proc ess_html:1 },s);if(ti nymce.isIE 6){try{d.e xecCommand ('Backgrou ndImageCac he',false, true);}cat ch(e){t.cs sFlicker=t rue;}}tiny mce.addUnl oad(functi on(){t.doc =t.root=nu ll;});},ge tRoot:func tion(){var  t=this,s= t.settings ;return(s& &t.get(s.r oot_elemen t))||t.doc .body;},ge tViewPort: function(w ){var d,b; w=!w?windo w:w;d=w.do cument;b=t his.boxMod el?d.docum entElement :d.body;re turn{x:w.p ageXOffset ||b.scroll Left,y:w.p ageYOffset ||b.scroll Top,w:w.in nerWidth|| b.clientWi dth,h:w.in nerHeight| |b.clientH eight};},g etRect:fun ction(e){v ar p,t=thi s,w,h;e=t. get(e);p=t .getPos(e) ;w=t.getSt yle(e,'wid th');h=t.g etStyle(e, 'height'); if(w.index Of('px')== =-1)w=0;if (h.indexOf ('px')===- 1)h=0;retu rn{x:p.x,y :p.y,w:par seInt(w)|| e.offsetWi dth||e.cli entWidth,h :parseInt( h)||e.offs etHeight|| e.clientHe ight};},ge tParent:fu nction(n,f ,r){var na ,se=this.s ettings;n= this.get(n );if(se.st rict_root) r=r||this. getRoot(); if(is(f,'s tring')){n a=f.toUppe rCase();f= function(n ){var s=fa lse;if(n.n odeType==1 &&na==='*' ){s=true;r eturn fals e;}each(na .split(',' ),function (v){if(n.n odeType==1 &&((se.str ict&&n.nod eName.toUp perCase()= =v)||n.nod eName==v)) {s=true;re turn false ;}});retur n s;};}whi le(n){if(n ==r)return  null;if(f (n))return  n;n=n.par entNode;}r eturn null ;},get:fun ction(e){v ar n;if(ty peof(e)==' string'){n =e;e=this. doc.getEle mentById(e );if(e&&e. id!==n)ret urn this.d oc.getElem entsByName (n)[1];}re turn e;},s elect:func tion(pa,s) {var t=thi s,cs,c,pl, o=[],x,i,l ,n;s=t.get (s)||t.doc ;if(s.quer ySelectorA ll){if(s!= t.doc){i=s .id;s.id=' _mc_tmp';p a='#_mc_tm p '+pa;}l= tinymce.gr ep(s.query SelectorAl l(pa));if( i)s.id=i;r eturn l;}i f(t.settin gs.strict) {function  get(s,n){r eturn s.ge tElementsB yTagName(n .toLowerCa se());};}e lse{functi on get(s,n ){return s .getElemen tsByTagNam e(n);};}if (t.elmPatt ern.test(p a)){x=get( s,pa);for( i=0,l=x.le ngth;i<l;i ++)o.push( x[i]);retu rn o;}if(t .elmClassP attern.tes t(pa)){pl= t.elmClass Pattern.ex ec(pa);x=g et(s,pl[1] ||'*');c='  '+pl[2]+'  ';for(i=0 ,l=x.lengt h;i<l;i++) {n=x[i];if (n.classNa me&&(' '+n .className +' ').inde xOf(c)!==- 1)o.push(n );}return  o;}functio n collect( n){if(!n.m ce_save){n .mce_save= 1;o.push(n );}};funct ion collec tIE(n){if( !n.getAttr ibute('mce _save')){n .setAttrib ute('mce_s ave','1'); o.push(n); }};functio n find(n,f ,r){var i, l,nl=get(r ,n);for(i= 0,l=nl.len gth;i<l;i+ +)f(nl[i]) ;};each(pa .split(',' ),function (v,i){v=ti nymce.trim (v);if(t.e lmPattern. test(v)){e ach(get(s, v),functio n(n){colle ct(n);});r eturn;}if( t.elmClass Pattern.te st(v)){x=t .elmClassP attern.exe c(v);each( get(s,x[1] ),function (n){if(t.h asClass(n, x[2]))coll ect(n);}); return;}if (!(cs=t.ca che[pa])){ cs='x=(fun ction(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.classNam e + " ";'; cs+='if (' ;c='';each (p[3].spli t('.'),fun ction(v){i f(v)c+=(c? '||':'')+' c.indexOf( " '+v+' ")  === -1';} );cs+=c+')  return;'; }});cs+='c f(n);';for (i=pl.leng th-1;i>=0; i--)cs+='} , '+(i?'n' :'s')+');' ;cs+='})'; t.cache[pa ]=cs=eval( cs);}cs(is IE?collect IE:collect ,s);});eac h(o,functi on(n){if(i sIE)n.remo veAttribut e('mce_sav e');else d elete n.mc e_save;}); return o;} ,add:funct ion(p,n,a, h,c){var t =this;retu rn this.ru n(p,functi on(p){var  e,k;e=is(n ,'string') ?t.doc.cre ateElement (n):n;if(a ){for(k in  a){if(a.h asOwnPrope rty(k)&&!i s(a[k],'ob ject'))t.s etAttrib(e ,k,''+a[k] );}if(a.st yle&&!is(a .style,'st ring')){ea ch(a.style ,function( v,n){t.set Style(e,n, v);});}}if (h){if(h.n odeType)e. appendChil d(h);else  t.setHTML( e,h);}retu rn!c?p.app endChild(e ):e;});},c reate:func tion(n,a,h ){return t his.add(th is.doc.cre ateElement (n),n,a,h, 1);},creat eHTML:func tion(n,a,h ){var o='' ,t=this,k; o+='<'+n;f or(k in a) {if(a.hasO wnProperty (k))o+=' ' +k+'="'+t. encode(a[k ])+'"';}if (tinymce.i s(h))retur n o+'>'+h+ '</'+n+'>' ;return o+ ' />';},re move:funct ion(n,k){r eturn this .run(n,fun ction(n){v ar p;p=n.p arentNode; if(!p)retu rn null;if (k){each(n .childNode s,function (c){p.inse rtBefore(c .cloneNode (true),n); });}return  p.removeC hild(n);}) ;},setStyl e:function (n,na,v){v ar t=this; return t.r un(n,funct ion(e){var  s,i;s=e.s tyle;na=na .replace(/ -(\D)/g,fu nction(a,b ){return b .toUpperCa se();});if (t.pixelSt yles.test( na)&&(tiny mce.is(v,' number')|| /^[\-0-9\. ]+$/.test( v)))v+='px ';switch(n a){case'op acity':if( isIE){s.fi lter=v===' '?'':"alph a(opacity= "+(v*100)+ ")";if(!n. currentSty le||!n.cur rentStyle. hasLayout) s.display= 'inline-bl ock';}s[na ]=s['-moz- opacity']= s['-khtml- opacity']= v||'';brea k;case'flo at':isIE?s .styleFloa t=v:s.cssF loat=v;bre ak;default :s[na]=v|| '';}if(t.s ettings.up date_style s)t.setAtt rib(e,'mce _style');} );},getSty le:functio n(n,na,c){ n=this.get (n);if(!n) return fal se;if(this .doc.defau ltView&&c) {na=na.rep lace(/[A-Z ]/g,functi on(a){retu rn'-'+a;}) ;try{retur n this.doc .defaultVi ew.getComp utedStyle( n,null).ge tPropertyV alue(na);} catch(ex){ return nul l;}}na=na. replace(/- (\D)/g,fun ction(a,b) {return b. toUpperCas e();});if( na=='float ')na=isIE? 'styleFloa t':'cssFlo at';if(n.c urrentStyl e&&c)retur n n.curren tStyle[na] ;return n. style[na]; },setStyle s:function (e,o){var  t=this,s=t .settings, ol;ol=s.up date_style s;s.update _styles=0; each(o,fun ction(v,n) {t.setStyl e(e,n,v);} );s.update _styles=ol ;if(s.upda te_styles) t.setAttri b(e,s.cssT ext);},set Attrib:fun ction(e,n, v){var t=t his;if(t.s ettings.st rict)n=n.t oLowerCase ();return  this.run(e ,function( e){var s=t .settings; switch(n){ case"style ":if(s.kee p_values){ if(v)e.set Attribute( 'mce_style ',v,2);els e e.remove Attribute( 'mce_style ',2);}e.st yle.cssTex t=v;break; case"class ":e.classN ame=v||''; break;case "src":case "href":if( s.keep_val ues){if(s. url_conver ter)v=s.ur l_converte r.call(s.u rl_convert er_scope|| t,v,n,e);t .setAttrib (e,'mce_'+ n,v,2);}br eak;}if(is (v)&&v!==n ull&&v.len gth!==0)e. setAttribu te(n,''+v, 2);else e. removeAttr ibute(n,2) ;});},setA ttribs:fun ction(e,o) {var t=thi s;return t his.run(e, function(e ){each(o,f unction(v, n){t.setAt trib(e,n,v );});});}, getAttrib: function(e ,n,dv){var  v,t=this; e=t.get(e) ;if(!e)ret urn false; if(!is(dv) )dv="";if( /^(src|hre f|style|co ords)$/.te st(n)){v=e .getAttrib ute("mce_" +n);if(v)r eturn v;}v =e.getAttr ibute(n,2) ;if(!v){sw itch(n){ca se'class': v=e.classN ame;break; default:if (isIE&&n== ='name'&&e .nodeName= =='A'){v=e .name;brea k;}v=e.att ributes[n] ;v=v&&is(v .nodeValue )?v.nodeVa lue:v;}}sw itch(n){ca se'style': v=v||e.sty le.cssText ;if(v){v=t .serialize Style(t.pa rseStyle(v ));if(t.se ttings.kee p_values)e .setAttrib ute('mce_s tyle',v);} break;}if( isWebKit&& n==="class "&&v)v=v.r eplace(/(a pple|webki t)\-[a-z\- ]+/gi,''); if(isIE){s witch(n){c ase'rowspa n':case'co lspan':if( v===1)v='' ;break;cas e'size':if (v==='+0') v='';break ;case'hspa ce':if(v== =-1)v='';b reak;case' tabindex': if(v===327 68)v='';br eak;case's hape':v=v. toLowerCas e();break; default:if (n.indexOf ('on')===0 &&v)v=(''+ v).replace (/^functio n\s+anonym ous\(\)\s+ \{\s+(.*)\ s+\}$/,'$1 ');}}retur n(v&&v!='' )?''+v:dv; },getPos:f unction(n) {var t=thi s,x=0,y=0, e,d=t.doc, r;n=t.get( n);if(n&&i sIE){n=n.g etBounding ClientRect ();e=t.box Model?d.do cumentElem ent:d.body ;x=t.getSt yle(t.sele ct('html') [0],'borde rWidth');x =(x=='medi um'||t.box Model&&!t. isIE6)&&2| |x;n.top+= window.sel f!=window. top?2:0;re turn{x:n.l eft+e.scro llLeft-x,y :n.top+e.s crollTop-x };}r=n;whi le(r){x+=r .offsetLef t||0;y+=r. offsetTop| |0;r=r.off setParent; }r=n;while (r){if(!/^ table-row| inline.*/i .test(t.ge tStyle(r," display",1 ))){x-=r.s crollLeft| |0;y-=r.sc rollTop||0 ;}r=r.pare ntNode;if( r==d.body) break;}ret urn{x:x,y: y};},parse Style:func tion(st){v ar t=this, s=t.settin gs,o={};if (!st)retur n o;functi on compres s(p,s,ot){ var t,r,b, l;t=o[p+'- top'+s];if (!t)return ;r=o[p+'-r ight'+s];i f(t!=r)ret urn;b=o[p+ '-bottom'+ s];if(r!=b )return;l= o[p+'-left '+s];if(b! =l)return; o[ot]=l;de lete o[p+' -top'+s];d elete o[p+ '-right'+s ];delete o [p+'-botto m'+s];dele te o[p+'-l eft'+s];}; function c ompress2(t a,a,b,c){v ar t;t=o[a ];if(!t)re turn;t=o[b ];if(!t)re turn;t=o[c ];if(!t)re turn;o[ta] =o[a]+' '+ o[b]+' '+o [c];delete  o[a];dele te o[b];de lete o[c]; };each(st. split(';') ,function( v){var sv, ur=[];if(v ){v=v.repl ace(/url\( [^\)]+\)/g ,function( v){ur.push (v);return 'url('+ur. length+')' ;});v=v.sp lit(':');s v=tinymce. trim(v[1]) ;sv=sv.rep lace(/url\ (([^\)]+)\ )/g,functi on(a,b){re turn ur[pa rseInt(b)- 1];});sv=s v.replace( /rgb\([^\) ]+\)/g,fun ction(v){r eturn t.to Hex(v);}); if(s.url_c onverter){ sv=sv.repl ace(/url\( [\'\"]?([^ \)\'\"]+)[ \'\"]?\)/g ,function( x,c){retur n'url('+t. encode(s.u rl_convert er.call(s. url_conver ter_scope| |t,t.decod e(c),'styl e',null))+ ')';});}o[ tinymce.tr im(v[0]).t oLowerCase ()]=sv;}}) ;compress( "border"," ","border" );compress ("border", "-width"," border-wid th");compr ess("borde r","-color ","border- color");co mpress("bo rder","-st yle","bord er-style") ;compress( "padding", "","paddin g");compre ss("margin ","","marg in");compr ess2('bord er','borde r-width',' border-sty le','borde r-color'); if(isIE){i f(o.border =='medium  none')o.bo rder='';}r eturn o;}, serializeS tyle:funct ion(o){var  s='';each (o,functio n(v,k){if( k&&v){swit ch(k){case 'color':ca se'backgro und-color' :v=v.toLow erCase();b reak;}s+=( s?' ':'')+ k+': '+v+' ;';}});ret urn s;},lo adCSS:func tion(u){va r t=this,d =this.doc; if(!u)u='' ;each(u.sp lit(','),f unction(u) {if(t.file s[u])retur n;t.files[ u]=true;t. add(t.sele ct('head') [0],'link' ,{rel:'sty lesheet',h ref:u});}) ;},addClas s:function (e,c){retu rn this.ru n(e,functi on(e){var  o;if(!c)re turn 0;if( this.hasCl ass(e,c))r eturn e.cl assName;o= this.remov eClass(e,c );return e .className =(o!=''?(o +' '):'')+ c;});},rem oveClass:f unction(e, c){var t=t his,re;ret urn t.run( e,function (e){var v; if(t.hasCl ass(e,c)){ if(!re)re= new RegExp ("(^|\\s+) "+c+"(\\s+ |$)","g"); v=e.classN ame.replac e(re,' '); return e.c lassName=t inymce.tri m(v!=' '?v :'');}retu rn e.class Name;});}, hasClass:f unction(n, c){n=this. get(n);if( !n||!c)ret urn false; return(' ' +n.classNa me+' ').in dexOf(' '+ c+' ')!==- 1;},show:f unction(e) {return th is.setStyl e(e,'displ ay','block ');},hide: function(e ){return t his.setSty le(e,'disp lay','none ');},isHid den:functi on(e){e=th is.get(e); return e.s tyle.displ ay=='none' ||this.get Style(e,'d isplay')== 'none';},u niqueId:fu nction(p){ return(!p? 'mce_':p)+ (this.coun ter++);},s etHTML:fun ction(e,h) {var t=thi s;return t his.run(e, function(e ){var x,i, nl,n,p,x;h =t.process HTML(h);if (isIE){fun ction set( ){try{e.in nerHTML='< br />'+h;e .removeChi ld(e.first Child);}ca tch(ex){wh ile(e.firs tChild)e.f irstChild. removeNode ();x=t.cre ate('div') ;x.innerHT ML='<br /> '+h;each(x .childNode s,function (n,i){if(i )e.appendC hild(n);}) ;}};if(t.s ettings.fi x_ie_parag raphs)h=h. replace(/< p><\/p>|<p ([^>]+)><\ /p>|<p[^\/ +]\/>/gi,' <p$1 mce_k eep="true" >&nbsp;</p >');set(); if(t.setti ngs.fix_ie _paragraph s){nl=e.ge tElementsB yTagName(" p");for(i= nl.length- 1,x=0;i>=0 ;i--){n=nl [i];if(!n. hasChildNo des()){if( !n.mce_kee p){x=1;bre ak;}n.remo veAttribut e('mce_kee p');}}}if( x){h=h.rep lace(/<p([ ^>]+)>|<p> /g,'<div$1  mce_tmp=" 1">');h=h. replace(/< \/p>/g,'</ div>');set ();if(t.se ttings.fix _ie_paragr aphs){nl=e .getElemen tsByTagNam e("DIV");f or(i=nl.le ngth-1;i>= 0;i--){n=n l[i];if(n. mce_tmp){p =t.doc.cre ateElement ('p');n.cl oneNode(fa lse).outer HTML.repla ce(/([a-z0 -9\-_]+)=/ gi,functio n(a,b){var  v;if(b!== 'mce_tmp') {v=n.getAt tribute(b) ;if(!v&&b= =='class') v=n.classN ame;p.setA ttribute(b ,v);}});fo r(x=0;x<n. childNodes .length;x+ +)p.append Child(n.ch ildNodes[x ].cloneNod e(true));n .swapNode( p);}}}}}el se e.inner HTML=h;ret urn h;});} ,processHT ML:functio n(h){var t =this,s=t. settings;i f(!s.proce ss_html)re turn h;if( tinymce.is Gecko){h=h .replace(/ <(\/?)stro ng>|<stron g( [^>]+)> /gi,'<$1b$ 2>');h=h.r eplace(/<( \/?)em>|<e m( [^>]+)> /gi,'<$1i$ 2>');}h=h. replace(/< a( )([^>]+ )\/>|<a\/> /gi,'<a$1$ 2></a>');i f(s.keep_v alues){if( h.indexOf( '<script') !==-1){h=h .replace(/ <script>/g ,'<script  type="text /javascrip t">');h=h. replace(/< script(|[^ >]+)>(\s*< !--|\/\/\s *<\[CDATA\ [)?[\r\n]* /g,'<mce:s cript$1><! --\n');h=h .replace(/ \s*(\/\/\s *-->|\/\/\ s*]]>)?<\/ script>/g, '\n// -->< /mce:scrip t>');h=h.r eplace(/<m ce:script( |[^>]+)><! --\n\/\/ - -><\/mce:s cript>/g,' <mce:scrip t$1></mce: script>'); }h=h.repla ce(/<([\w: ]+) [^>]*( src|href|s tyle|coord s)[^>]*>/g i,function (a,n){func tion handl e(m,b,c){v ar u=c;if( a.indexOf( 'mce_'+b)! =-1)return  m;if(b==' style'){if (s.hex_col ors){u=u.r eplace(/rg b\([^\)]+\ )/g,functi on(v){retu rn t.toHex (v);});}if (s.url_con verter){u= u.replace( /url\([\'\ "]?([^\)\' \"]+)\)/g, function(x ,c){return 'url('+t.e ncode(s.ur l_converte r.call(s.u rl_convert er_scope|| t,t.decode (c),b,n))+ ')';});}}e lse if(b!= 'coords'){ if(s.url_c onverter)u =t.encode( s.url_conv erter.call (s.url_con verter_sco pe||t,t.de code(c),b, n));}retur n' '+b+'=" '+c+'" mce _'+b+'="'+ u+'"';};a= a.replace( / (src|hre f|style|co ords)=[\"] ([^\"]+)[\ "]/gi,hand le);a=a.re place(/ (s rc|href|st yle|coords )=[\']([^\ ']+)[\']/g i,handle); return a.r eplace(/ ( src|href|s tyle|coord s)=([^\s\" \'>]+)/gi, handle);}) ;}return h ;},getOute rHTML:func tion(e){va r d;e=this .get(e);if (!e)return  null;if(i sIE)return  e.outerHT ML;d=(e.ow nerDocumen t||this.do c).createE lement("bo dy");d.app endChild(e .cloneNode (true));re turn d.inn erHTML;},s etOuterHTM L:function (e,h,d){va r t=this;r eturn this .run(e,fun ction(e){v ar n,tp;e= t.get(e);d =d||e.owne rDocument| |t.doc;if( isIE&&e.no deType==1) e.outerHTM L=h;else{t p=d.create Element("b ody");tp.i nnerHTML=h ;n=tp.last Child;whil e(n){t.ins ertAfter(n .cloneNode (true),e); n=n.previo usSibling; }t.remove( e);}});},d ecode:func tion(s){va r e;if(/&[ ^;]+;/.tes t(s)){e=th is.doc.cre ateElement ("div");e. innerHTML= s;return!e .firstChil d?s:e.firs tChild.nod eValue;}re turn s;},e ncode:func tion(s){re turn s?('' +s).replac e(/[<>&\"] /g,functio n(c,b){swi tch(c){cas e'&':retur n'&amp;';c ase'"':ret urn'&quot; ';case'<': return'&lt ;';case'>' :return'&g t;';}retur n c;}):s;} ,insertAft er:functio n(n,r){var  t=this;r= t.get(r);r eturn this .run(n,fun ction(n){v ar p,ns;p= r.parentNo de;ns=r.ne xtSibling; if(ns)p.in sertBefore (n,ns);els e p.append Child(n);r eturn n;}) ;},isBlock :function( n){if(n.no deType&&n. nodeType!= =1)return  false;n=n. nodeName|| n;return/^ (H[1-6]|HR |P|DIV|ADD RESS|PRE|F ORM|TABLE| LI|OL|UL|T D|CAPTION| BLOCKQUOTE |CENTER|DL |DT|DD|DIR |FIELDSET| FORM|NOSCR IPT|NOFRAM ES|MENU|IS INDEX|SAMP )$/.test(n );},replac e:function (n,o,k){if (is(o,'arr ay'))n=n.c loneNode(t rue);retur n this.run (o,functio n(o){if(k) {each(o.ch ildNodes,f unction(c) {n.appendC hild(c.clo neNode(tru e));});}re turn o.par entNode.re placeChild (n,o);});} ,toHex:fun ction(s){v ar c=/^\s* rgb\s*?\(\ s*?([0-9]+ )\s*?,\s*? ([0-9]+)\s *?,\s*?([0 -9]+)\s*?\ )\s*$/i.ex ec(s);func tion hex(s ){s=parseI nt(s).toSt ring(16);r eturn s.le ngth>1?s:' 0'+s;};if( c){s='#'+h ex(c[1])+h ex(c[2])+h ex(c[3]);r eturn s;}r eturn s;}, getClasses :function( ){var t=th is,cl=[],i ,lo={},f=t .settings. class_filt er,ov;if(t .classes)r eturn t.cl asses;func tion addCl asses(s){e ach(s.impo rts,functi on(r){addC lasses(r); });each(s. cssRules|| s.rules,fu nction(r){ switch(r.t ype||1){ca se 1:if(r. selectorTe xt){each(r .selectorT ext.split( ','),funct ion(v){v=v .replace(/ ^\s*|\s*$| ^\s\./g,"" );if(/\.mc e/.test(v) ||!/\.[\w\ -]+$/.test (v))return ;ov=v;v=v. replace(/. *\.([a-z0- 9_\-]+).*/ i,'$1');if (f&&!(v=f( v,ov)))ret urn;if(!lo [v]){cl.pu sh({'class ':v});lo[v ]=1;}});}b reak;case  3:addClass es(r.style Sheet);bre ak;}});};t ry{each(t. doc.styleS heets,addC lasses);}c atch(ex){} if(cl.leng th>0)t.cla sses=cl;re turn cl;}, run:functi on(e,f,s){ var t=this ,o;if(type of(e)==='s tring')e=t .doc.getEl ementById( e);if(!e)r eturn fals e;s=s||thi s;if(!e.no deType&&(e .length||e .length=== 0)){o=[];e ach(e,func tion(e,i){ if(e){if(t ypeof(e)== 'string')e =t.doc.get ElementByI d(e);o.pus h(f.call(s ,e,i));}}) ;return o; }return f. call(s,e); }});tinymc e.DOM=new  tinymce.do m.DOMUtils (document, {process_h tml:0});}) ();(functi on(){var e ach=tinymc e.each,DOM =tinymce.D OM,isIE=ti nymce.isIE ,isWebKit= tinymce.is WebKit,Eve nt;tinymce .create('s tatic tiny mce.dom.Ev ent',{init s:[],event s:[],add:f unction(o, n,f,s){var  cb,t=this ,el=t.even ts,r;if(o& &o instanc eof Array) {r=[];each (o,functio n(o){o=DOM .get(o);r. push(t.add (o,n,f,s)) ;});return  r;}o=DOM. get(o);if( !o)return; cb=functio n(e){e=e|| window.eve nt;if(e&&! e.target&& isIE)e.tar get=e.srcE lement;if( !s)return  f(e);retur n f.call(s ,e);};if(n =='unload' ){tinymce. unloads.un shift({fun c:cb});ret urn cb;}if (n=='init' ){if(t.dom Loaded)cb( );else t.i nits.push( cb);return  cb;}el.pu sh({obj:o, name:n,fun c:f,cfunc: cb,scope:s });t._add( o,n,cb);re turn f;},r emove:func tion(o,n,f ){var t=th is,a=t.eve nts,s=fals e,r;if(o&& o instance of Array){ r=[];each( o,function (o){o=DOM. get(o);r.p ush(t.remo ve(o,n,f)) ;});return  r;}o=DOM. get(o);eac h(a,functi on(e,i){if (e.obj==o& &e.name==n &&(!f||(e. func==f||e .cfunc==f) )){a.splic e(i,1);t._ remove(o,n ,e.cfunc); s=true;ret urn false; }});return  s;},cance l:function (e){if(!e) return fal se;this.st op(e);retu rn this.pr event(e);} ,stop:func tion(e){if (e.stopPro pagation)e .stopPropa gation();e lse e.canc elBubble=t rue;return  false;},p revent:fun ction(e){i f(e.preven tDefault)e .preventDe fault();el se e.retur nValue=fal se;return  false;},_u nload:func tion(){var  t=Event;e ach(t.even ts,functio n(e,i){t._ remove(e.o bj,e.name, e.cfunc);e .obj=e.cfu nc=null;}) ;t.events= [];t=null; },_add:fun ction(o,n, f){if(o.at tachEvent) o.attachEv ent('on'+n ,f);else i f(o.addEve ntListener )o.addEven tListener( n,f,false) ;else o['o n'+n]=f;}, _remove:fu nction(o,n ,f){if(o.d etachEvent )o.detachE vent('on'+ n,f);else  if(o.remov eEventList ener)o.rem oveEventLi stener(n,f ,false);el se o['on'+ n]=null;}, _pageInit: function() {var e=Eve nt;e._remo ve(window, 'DOMConten tLoaded',e ._pageInit );e.domLoa ded=true;e ach(e.init s,function (c){c();}) ;e.inits=[ ];},_wait: function() {var t;if( window.tin yMCE_GZ&&t inyMCE_GZ. loaded)ret urn;if(isI E&&documen t.location .protocol! ='https:') {document. write('<sc ript id=__ ie_onload  defer src= \'javascri pt:""\';>< \/script>' );DOM.get( "__ie_onlo ad").onrea dystatecha nge=functi on(){if(th is.readySt ate=="comp lete"){Eve nt._pageIn it();DOM.g et("__ie_o nload").on readystate change=nul l;}};}else {Event._ad d(window,' DOMContent Loaded',Ev ent._pageI nit,Event) ;if(isIE|| isWebKit){ t=setInter val(functi on(){if(/l oaded|comp lete/.test (document. readyState )){clearIn terval(t); Event._pag eInit();}} ,10);}}}}) ;Event=tin ymce.dom.E vent;Event ._wait();t inymce.add Unload(Eve nt._unload );})();(fu nction(){v ar each=ti nymce.each ;tinymce.c reate('tin ymce.dom.E lement',{E lement:fun ction(id,s ){var t=th is,dom,el; s=s||{};t. id=id;t.do m=dom=s.do m||tinymce .DOM;t.set tings=s;if (!tinymce. isIE)el=t. dom.get(t. id);each([ 'getPos',' getRect',' getParent' ,'add','se tStyle','g etStyle',' setStyles' ,'setAttri b','setAtt ribs','get Attrib','a ddClass',' removeClas s','hasCla ss','getOu terHTML',' setOuterHT ML','remov e','show', 'hide','is Hidden','s etHTML','g et'],funct ion(k){t[k ]=function (){var a=a rguments,o ;if(tinymc e.isOpera) {a=[id];ea ch(argumen ts,functio n(v){a.pus h(v);});}e lse Array. prototype. unshift.ca ll(a,el||i d);o=dom[k ].apply(do m,a);t.upd ate(k);ret urn o;};}) ;},on:func tion(n,f,s ){return t inymce.dom .Event.add (this.id,n ,f,s);},ge tXY:functi on(){retur n{x:parseI nt(this.ge tStyle('le ft')),y:pa rseInt(thi s.getStyle ('top'))}; },getSize: function() {var n=thi s.dom.get( this.id);r eturn{w:pa rseInt(thi s.getStyle ('width')| |n.clientW idth),h:pa rseInt(thi s.getStyle ('height') ||n.client Height)};} ,moveTo:fu nction(x,y ){this.set Styles({le ft:x,top:y });},moveB y:function (x,y){var  p=this.get XY();this. moveTo(p.x +x,p.y+y); },resizeTo :function( w,h){this. setStyles( {width:w,h eight:h}); },resizeBy :function( w,h){var s =this.getS ize();this .resizeTo( s.w+w,s.h+ h);},updat e:function (k){var t= this,b,dom =t.dom;if( tinymce.is IE6&&t.set tings.bloc ker){k=k|| '';if(k.in dexOf('get ')===0||k. indexOf('h as')===0|| k.indexOf( 'is')===0) return;if( k=='remove '){dom.rem ove(t.bloc ker);retur n;}if(!t.b locker){t. blocker=do m.uniqueId ();b=dom.a dd(t.setti ngs.contai ner||dom.g etRoot(),' iframe',{i d:t.blocke r,style:'p osition:ab solute;',f rameBorder :0,src:'ja vascript:" "'});dom.s etStyle(b, 'opacity', 0);}else b =dom.get(t .blocker); dom.setSty le(b,'left ',t.getSty le('left', 1));dom.se tStyle(b,' top',t.get Style('top ',1));dom. setStyle(b ,'width',t .getStyle( 'width',1) );dom.setS tyle(b,'he ight',t.ge tStyle('he ight',1)); dom.setSty le(b,'disp lay',t.get Style('dis play',1)); dom.setSty le(b,'zInd ex',parseI nt(t.getSt yle('zInde x',1)||0)- 1);}}});}) ();(functi on(){var i s=tinymce. is,isIE=ti nymce.isIE ,each=tiny mce.each;t inymce.cre ate('tinym ce.dom.Sel ection',{S election:f unction(do m,win,seri alizer){va r t=this;t .dom=dom;t .win=win;t .serialize r=serializ er;tinymce .addUnload (function( ){t.win=nu ll;});},ge tContent:f unction(s) {var t=thi s,r=t.getR ng(),e=t.d om.create( "body"),se =t.getSel( ),wb,wa,n; s=s||{};wb =wa='';s.g et=true;s. format=s.f ormat||'ht ml';if(s.f ormat=='te xt')return  t.isColla psed()?'': (r.text||( se.toStrin g?se.toStr ing():'')) ;if(r.clon eContents) {n=r.clone Contents() ;if(n)e.ap pendChild( n);}else i f(is(r.ite m)||is(r.h tmlText))e .innerHTML =r.item?r. item(0).ou terHTML:r. htmlText;e lse e.inne rHTML=r.to String();i f(/^\s/.te st(e.inner HTML))wb='  ';if(/\s+ $/.test(e. innerHTML) )wa=' ';s. getInner=t rue;return  t.isColla psed()?'': wb+t.seria lizer.seri alize(e,s) +wa;},setC ontent:fun ction(h,s) {var t=thi s,r=t.getR ng(),d;s=s ||{format: 'html'};s. set=true;h =t.dom.pro cessHTML(h );if(r.ins ertNode){d =t.win.doc ument;if(t inymce.isG ecko&&h.in dexOf('<') ==-1){r.de leteConten ts();r.ins ertNode(t. getRng().c reateConte xtualFragm ent(h+'<sp an id="__c aret">_</s pan>'));t. select(t.d om.get('__ caret'));t .getRng(). deleteCont ents();ret urn;}try{i f(d.queryC ommandEnab led('Inser tHTML'))re turn d.exe cCommand(' InsertHTML ',false,h) ;}catch(ex ){r.delete Contents() ;r.insertN ode(t.getR ng().creat eContextua lFragment( h));}}else {if(r.item )r.item(0) .outerHTML =h;else r. pasteHTML( h);}},getS tart:funct ion(){var  t=this,r=t .getRng(), e;if(isIE) {if(r.item )return r. item(0);r= r.duplicat e();r.coll apse(1);e= r.parentEl ement();if (e.nodeNam e=='BODY') return e.f irstChild; return e;} else{e=r.s tartContai ner;if(e.n odeName==' BODY')retu rn e.first Child;retu rn t.dom.g etParent(e ,function( n){return  n.nodeType ==1;});}}, getEnd:fun ction(){va r t=this,r =t.getRng( ),e;if(isI E){if(r.it em)return  r.item(0); r=r.duplic ate();r.co llapse(0); e=r.parent Element(); if(e.nodeN ame=='BODY ')return e .lastChild ;return e; }else{e=r. endContain er;if(e.no deName=='B ODY')retur n e.lastCh ild;return  t.dom.get Parent(e,f unction(n) {return n. nodeType== 1;});}},ge tBookmark: function(s i){var t=t his,r=t.ge tRng(),tr, sx,sy,vp=t .dom.getVi ewPort(t.w in),e,sp,b p,le,c=-0x FFFFFF,s,r o=t.dom.ge tRoot(),wb =0,wa=0,nv ;sx=vp.x;s y=vp.y;if( si=='simpl e')return{ rng:r,scro llX:sx,scr ollY:sy};i f(isIE){if (r.item){e =r.item(0) ;each(t.do m.select(e .nodeName) ,function( n,i){if(e= =n){sp=i;r eturn fals e;}});retu rn{tag:e.n odeName,in dex:sp,scr ollX:sx,sc rollY:sy}; }tr=t.dom. doc.body.c reateTextR ange();tr. moveToElem entText(ro );tr.colla pse(true); bp=Math.ab s(tr.move( 'character ',c));tr=r .duplicate ();tr.coll apse(true) ;sp=Math.a bs(tr.move ('characte r',c));tr= r.duplicat e();tr.col lapse(fals e);le=Math .abs(tr.mo ve('charac ter',c))-s p;return{s tart:sp-bp ,length:le ,scrollX:s x,scrollY: sy};}e=t.g etNode();s =t.getSel( );if(!s)re turn null; if(e&&e.no deName=='I MG'){retur n{scrollX: sx,scrollY :sy};}func tion getPo s(r,sn,en) {var w=t.d om.doc.cre ateTreeWal ker(r,Node Filter.SHO W_TEXT,nul l,false),n ,p=0,d={}; while((n=w .nextNode( ))!=null){ if(n==sn)d .start=p;i f(n==en){d .end=p;ret urn d;}p+= tinymce.tr im(n.nodeV alue||''). length;}re turn null; };if(s.anc horNode==s .focusNode &&s.anchor Offset==s. focusOffse t){e=getPo s(ro,s.anc horNode,s. focusNode) ;if(!e)ret urn{scroll X:sx,scrol lY:sy};(s. anchorNode .nodeValue ||'').repl ace(/^\s+/ ,function( a){wb=a.le ngth;});re turn{start :Math.max( e.start+s. anchorOffs et-wb,0),e nd:Math.ma x(e.end+s. focusOffse t-wb,0),sc rollX:sx,s crollY:sy, beg:s.anch orOffset-w b==0};}els e{e=getPos (ro,r.star tContainer ,r.endCont ainer);(r. startConta iner.nodeV alue||''). replace(/^ \s+/,funct ion(a){wb= a.length;} );(r.endCo ntainer.no deValue||' ').replace (/^\s+/,fu nction(a){ wa=a.lengt h;});if(!e )return{sc rollX:sx,s crollY:sy} ;return{st art:Math.m ax(e.start +r.startOf fset-wb,0) ,end:Math. max(e.end+ r.endOffse t-wa,0),sc rollX:sx,s crollY:sy, beg:r.star tOffset-wb ==0};}},mo veToBookma rk:functio n(b){var t =this,r=t. getRng(),s =t.getSel( ),ro=t.dom .getRoot() ,sd,nvl,nv ;function  getPos(r,s p,ep){var  w=t.dom.do c.createTr eeWalker(r ,NodeFilte r.SHOW_TEX T,null,fal se),n,p=0, d={},o,v,w a,wb;while ((n=w.next Node())!=n ull){wa=wb =0;nv=n.no deValue||' ';nv.repla ce(/^\s+[^ \s]/,funct ion(a){wb= a.length-1 ;});nv.rep lace(/[^\s ]\s+$/,fun ction(a){w a=a.length -1;});nvl= tinymce.tr im(nv).len gth;p+=nvl ;if(p>=sp& &!d.startN ode){o=sp- (p-nvl);if (b.beg&&o> =nvl)conti nue;d.star tNode=n;d. startOffse t=o+wb;}if (p>=ep){d. endNode=n; d.endOffse t=ep-(p-nv l)+wb;retu rn d;}}ret urn null;} ;if(!b)ret urn false; t.win.scro llTo(b.scr ollX,b.scr ollY);if(i sIE){if(r= b.rng){try {r.select( );}catch(e x){}return  true;}t.w in.focus() ;if(b.tag) {r=ro.crea teControlR ange();eac h(t.dom.se lect(b.tag ),function (n,i){if(i ==b.index) r.addEleme nt(n);});} else{try{i f(b.start< 0)return t rue;r=s.cr eateRange( );r.moveTo ElementTex t(ro);r.co llapse(tru e);r.moveS tart('char acter',b.s tart);r.mo veEnd('cha racter',b. length);}c atch(ex2){ return tru e;}}try{r. select();} catch(ex){ }return tr ue;}if(!s) return fal se;if(b.rn g){s.remov eAllRanges ();s.addRa nge(b.rng) ;}else{if( is(b.start )&&is(b.en d)){try{sd =getPos(ro ,b.start,b .end);if(s d){r=t.dom .doc.creat eRange();r .setStart( sd.startNo de,sd.star tOffset);r .setEnd(sd .endNode,s d.endOffse t);s.remov eAllRanges ();s.addRa nge(r);}if (!tinymce. isOpera)t. win.focus( );}catch(e x){}}}},se lect:funct ion(n,c){v ar t=this, r=t.getRng (),s=t.get Sel(),b,fn ,ln,d=t.wi n.document ;function  first(n){r eturn n?d. createTree Walker(n,N odeFilter. SHOW_TEXT, null,false ).nextNode ():null;}; function l ast(n){var  c,o,w;if( !n)return  null;w=d.c reateTreeW alker(n,No deFilter.S HOW_TEXT,n ull,false) ;while(c=w .nextNode( ))o=c;retu rn o;};if( isIE){try{ b=d.body;i f(/^(IMG|T ABLE)$/.te st(n.nodeN ame)){r=b. createCont rolRange() ;r.addElem ent(n);}el se{r=b.cre ateTextRan ge();r.mov eToElement Text(n);}r .select(); }catch(ex) {}}else{if (c){fn=fir st(n);ln=l ast(n);if( fn&&ln){r= d.createRa nge();r.se tStart(fn, 0);r.setEn d(ln,ln.no deValue.le ngth);}els e r.select Node(n);}e lse r.sele ctNode(n); t.setRng(r );}return  n;},isColl apsed:func tion(){var  t=this,r= t.getRng() ,s=t.getSe l();if(!r| |r.item)re turn false ;return!s| |r.boundin gWidth==0| |s.isColla psed;},col lapse:func tion(b){va r t=this,r =t.getRng( ),n;if(r.i tem){n=r.i tem(0);r=t his.win.do cument.bod y.createTe xtRange(); r.moveToEl ementText( n);}r.coll apse(!!b); t.setRng(r );},getSel :function( ){var t=th is,w=this. win;return  w.getSele ction?w.ge tSelection ():w.docum ent.select ion;},getR ng:functio n(){var t= this,s=t.g etSel(),r; try{if(s)r =s.rangeCo unt>0?s.ge tRangeAt(0 ):(s.creat eRange?s.c reateRange ():t.win.d ocument.cr eateRange( ));}catch( ex){}if(!r )r=isIE?t. win.docume nt.body.cr eateTextRa nge():t.wi n.document .createRan ge();retur n r;},setR ng:functio n(r){var s ;if(!isIE) {s=this.ge tSel();if( s){s.remov eAllRanges ();s.addRa nge(r);}}e lse{try{r. select();} catch(ex){ }}},setNod e:function (n){var t= this;t.set Content(t. dom.getOut erHTML(n)) ;return n; },getNode: function() {var t=thi s,r=t.getR ng(),s=t.g etSel(),e; if(!isIE){ if(!r)retu rn t.dom.g etRoot();e =r.commonA ncestorCon tainer;if( !r.collaps ed){if(r.s tartContai ner==r.end Container| |(tinymce. isWebKit&& r.startCon tainer==r. endContain er.parentN ode)){if(r .startOffs et-r.endOf fset<2||ti nymce.isWe bKit){if(r .startCont ainer.hasC hildNodes( ))e=r.star tContainer .childNode s[r.startO ffset];}}} return t.d om.getPare nt(e,funct ion(n){ret urn n.node Type==1;}) ;}return r .item?r.it em(0):r.pa rentElemen t();}});}) ();(functi on(){tinym ce.create( 'tinymce.d om.XMLWrit er',{node: null,XMLWr iter:funct ion(s){fun ction getX ML(){var i =document. implementa tion;if(!i ||!i.creat eDocument) {try{retur n new Acti veXObject( 'MSXML2.DO MDocument' );}catch(e x){}try{re turn new A ctiveXObje ct('Micros oft.XmlDom ');}catch( ex){}}else  return i. createDocu ment('','' ,null);};t his.doc=ge tXML();thi s.valid=ti nymce.isOp era||tinym ce.isWebKi t;this.res et();},res et:functio n(){var t= this,d=t.d oc;if(d.fi rstChild)d .removeChi ld(d.first Child);t.n ode=d.appe ndChild(d. createElem ent("html" ));},write StartEleme nt:functio n(n){var t =this;t.no de=t.node. appendChil d(t.doc.cr eateElemen t(n));},wr iteAttribu te:functio n(n,v){if( this.valid )v=v.repla ce(/>/g,'% MCGT%');th is.node.se tAttribute (n,v);},wr iteEndElem ent:functi on(){this. node=this. node.paren tNode;},wr iteFullEnd Element:fu nction(){v ar t=this, n=t.node;n .appendChi ld(t.doc.c reateTextN ode(""));t .node=n.pa rentNode;} ,writeText :function( v){if(this .valid)v=v .replace(/ >/g,'%MCGT %');this.n ode.append Child(this .doc.creat eTextNode( v));},writ eCDATA:fun ction(v){t his.node.a ppendChild (this.doc. createCDAT A(v));},wr iteComment :function( v){this.no de.appendC hild(this. doc.create Comment(v) );},getCon tent:funct ion(){var  h;h=this.d oc.xml||ne w XMLSeria lizer().se rializeToS tring(this .doc);h=h. replace(/< \?[^?]+\?> |<html>|<\ /html>|<ht ml\/>|<!DO CTYPE[^>]+ >/g,'');h= h.replace( / ?\/>/g,'  />');if(t his.valid) h=h.replac e(/\%MCGT% /g,'&gt;') ;return h; }});})();( function() {tinymce.c reate('tin ymce.dom.S tringWrite r',{str:nu ll,tags:nu ll,count:0 ,settings: null,inden t:null,Str ingWriter: function(s ){this.set tings=tiny mce.extend ({indent_c har:' ',in dentation: 1},s);this .reset();} ,reset:fun ction(){th is.indent= '';this.st r="";this. tags=[];th is.count=0 ;},writeSt artElement :function( n){this._w riteAttrib utesEnd(); this.write Raw('<'+n) ;this.tags .push(n);t his.inAttr =true;this .count++;t his.elemen tCount=thi s.count;}, writeAttri bute:funct ion(n,v){v ar t=this; t.writeRaw (" "+t.enc ode(n)+'=" '+t.encode (v)+'"');} ,writeEndE lement:fun ction(){va r n;if(thi s.tags.len gth>0){n=t his.tags.p op();if(th is._writeA ttributesE nd(1))this .writeRaw( '</'+n+'>' );if(this. settings.i ndentation >0)this.wr iteRaw('\n ');}},writ eFullEndEl ement:func tion(){if( this.tags. length>0){ this._writ eAttribute sEnd();thi s.writeRaw ('</'+this .tags.pop( )+'>');if( this.setti ngs.indent ation>0)th is.writeRa w('\n');}} ,writeText :function( v){this._w riteAttrib utesEnd(); this.write Raw(this.e ncode(v)); this.count ++;},write CDATA:func tion(v){th is._writeA ttributesE nd();this. writeRaw(' <![CDATA[' +v+']]>'); this.count ++;},write Comment:fu nction(v){ this._writ eAttribute sEnd();thi s.writeRaw ('<!-- '+v +'-->');th is.count++ ;},writeRa w:function (v){this.s tr+=v;},en code:funct ion(s){ret urn s.repl ace(/[<>&" ]/g,functi on(v){swit ch(v){case '<':return '&lt;';cas e'>':retur n'&gt;';ca se'&':retu rn'&amp;'; case'"':re turn'&quot ;';}return  v;});},ge tContent:f unction(){ return thi s.str;},_w riteAttrib utesEnd:fu nction(s){ if(!this.i nAttr)retu rn;this.in Attr=false ;if(s&&thi s.elementC ount==this .count){th is.writeRa w(' />');r eturn fals e;}this.wr iteRaw('>' );return t rue;}});}) ();(functi on(){var e xtend=tiny mce.extend ,each=tiny mce.each,D ispatcher= tinymce.ut il.Dispatc her,isIE=t inymce.isI E;function  getIEAtts (n){var o= [];if(n.no deName=='O BJECT')ret urn n.attr ibutes;n.c loneNode(f alse).oute rHTML.repl ace(/([a-z 0-9\:\-_]+ )=/gi,func tion(a,b){ o.push({sp ecified:1, nodeName:b });});retu rn o;};fun ction wild cardToRE(s ){return s .replace(/ ([?+*])/g, '.$1');};t inymce.cre ate('tinym ce.dom.Ser ializer',{ Serializer :function( s){var t=t his;t.key= 0;t.onPreP rocess=new  Dispatche r(t);t.onP ostProcess =new Dispa tcher(t);i f(tinymce. relaxedDom ain&&tinym ce.isGecko ){t.writer =new tinym ce.dom.Str ingWriter( );}else{tr y{t.writer =new tinym ce.dom.XML Writer();} catch(ex){ t.writer=n ew tinymce .dom.Strin gWriter(); }}t.settin gs=s=exten d({dom:tin ymce.DOM,v alid_nodes :0,node_fi lter:0,att r_filter:0 ,invalid_a ttrs:/^(mc e_|_moz_)/ ,closed:/( br|hr|inpu t|meta|img |link|para m)/,entity _encoding: 'named',en tities:'16 0,nbsp,161 ,iexcl,162 ,cent,163, pound,164, curren,165 ,yen,166,b rvbar,167, sect,168,u ml,169,cop y,170,ordf ,171,laquo ,172,not,1 73,shy,174 ,reg,175,m acr,176,de g,177,plus mn,178,sup 2,179,sup3 ,180,acute ,181,micro ,182,para, 183,middot ,184,cedil ,185,sup1, 186,ordm,1 87,raquo,1 88,frac14, 189,frac12 ,190,frac3 4,191,ique st,192,Agr ave,193,Aa cute,194,A circ,195,A tilde,196, Auml,197,A ring,198,A Elig,199,C cedil,200, Egrave,201 ,Eacute,20 2,Ecirc,20 3,Euml,204 ,Igrave,20 5,Iacute,2 06,Icirc,2 07,Iuml,20 8,ETH,209, Ntilde,210 ,Ograve,21 1,Oacute,2 12,Ocirc,2 13,Otilde, 214,Ouml,2 15,times,2 16,Oslash, 217,Ugrave ,218,Uacut e,219,Ucir c,220,Uuml ,221,Yacut e,222,THOR N,223,szli g,224,agra ve,225,aac ute,226,ac irc,227,at ilde,228,a uml,229,ar ing,230,ae lig,231,cc edil,232,e grave,233, eacute,234 ,ecirc,235 ,euml,236, igrave,237 ,iacute,23 8,icirc,23 9,iuml,240 ,eth,241,n tilde,242, ograve,243 ,oacute,24 4,ocirc,24 5,otilde,2 46,ouml,24 7,divide,2 48,oslash, 249,ugrave ,250,uacut e,251,ucir c,252,uuml ,253,yacut e,254,thor n,255,yuml ,402,fnof, 913,Alpha, 914,Beta,9 15,Gamma,9 16,Delta,9 17,Epsilon ,918,Zeta, 919,Eta,92 0,Theta,92 1,Iota,922 ,Kappa,923 ,Lambda,92 4,Mu,925,N u,926,Xi,9 27,Omicron ,928,Pi,92 9,Rho,931, Sigma,932, Tau,933,Up silon,934, Phi,935,Ch i,936,Psi, 937,Omega, 945,alpha, 946,beta,9 47,gamma,9 48,delta,9 49,epsilon ,950,zeta, 951,eta,95 2,theta,95 3,iota,954 ,kappa,955 ,lambda,95 6,mu,957,n u,958,xi,9 59,omicron ,960,pi,96 1,rho,962, sigmaf,963 ,sigma,964 ,tau,965,u psilon,966 ,phi,967,c hi,968,psi ,969,omega ,977,theta sym,978,up sih,982,pi v,8226,bul l,8230,hel lip,8242,p rime,8243, Prime,8254 ,oline,826 0,frasl,84 72,weierp, 8465,image ,8476,real ,8482,trad e,8501,ale fsym,8592, larr,8593, uarr,8594, rarr,8595, darr,8596, harr,8629, crarr,8656 ,lArr,8657 ,uArr,8658 ,rArr,8659 ,dArr,8660 ,hArr,8704 ,forall,87 06,part,87 07,exist,8 709,empty, 8711,nabla ,8712,isin ,8713,noti n,8715,ni, 8719,prod, 8721,sum,8 722,minus, 8727,lowas t,8730,rad ic,8733,pr op,8734,in fin,8736,a ng,8743,an d,8744,or, 8745,cap,8 746,cup,87 47,int,875 6,there4,8 764,sim,87 73,cong,87 76,asymp,8 800,ne,880 1,equiv,88 04,le,8805 ,ge,8834,s ub,8835,su p,8836,nsu b,8838,sub e,8839,sup e,8853,opl us,8855,ot imes,8869, perp,8901, sdot,8968, lceil,8969 ,rceil,897 0,lfloor,8 971,rfloor ,9001,lang ,9002,rang ,9674,loz, 9824,spade s,9827,clu bs,9829,he arts,9830, diams,338, OElig,339, oelig,352, Scaron,353 ,scaron,37 6,Yuml,710 ,circ,732, tilde,8194 ,ensp,8195 ,emsp,8201 ,thinsp,82 04,zwnj,82 05,zwj,820 6,lrm,8207 ,rlm,8211, ndash,8212 ,mdash,821 6,lsquo,82 17,rsquo,8 218,sbquo, 8220,ldquo ,8221,rdqu o,8222,bdq uo,8224,da gger,8225, Dagger,824 0,permil,8 249,lsaquo ,8250,rsaq uo,8364,eu ro',valid_ elements:' *[*]',exte nded_valid _elements: 0,valid_ch ild_elemen ts:0,inval id_element s:0,fix_ta ble_elemen ts:0,fix_l ist_elemen ts:true,fi x_content_ duplicatio n:true,con vert_fonts _to_spans: false,font _size_clas ses:0,font _size_styl e_values:0 ,apply_sou rce_format ting:0,ind ent_mode:' simple',in dent_char: '\t',inden t_levels:1 ,remove_li nebreaks:1 },s);t.dom =s.dom;if( s.fix_list _elements) {t.onPrePr ocess.add( function(s e,o){var n l,x,a=['ol ','ul'],i, n,p,r=/^(O L|UL)$/,np ;function  prevNode(e ,n){var a= n.split(', '),i;while ((e=e.prev iousSiblin g)!=null){ for(i=0;i< a.length;i ++){if(e.n odeName==a [i])return  e;}}retur n null;};f or(x=0;x<a .length;x+ +){nl=t.do m.select(a [x],o.node );for(i=0; i<nl.lengt h;i++){n=n l[i];p=n.p arentNode; if(r.test( p.nodeName )){np=prev Node(n,'LI ');if(!np) {np=t.dom. create('li ');np.inne rHTML='&nb sp;';np.ap pendChild( n);p.inser tBefore(np ,p.firstCh ild);}else  np.append Child(n);} }}});}if(s .fix_table _elements) {t.onPrePr ocess.add( function(s e,o){each( t.dom.sele ct('table' ,o.node),f unction(e) {var pa=t. dom.getPar ent(e,'H1, H2,H3,H4,H 5,H6,P'),p a2,n,tm,pl =[],i,ns;i f(pa){pa2= pa.cloneNo de(false); pl.push(e) ;for(n=e;n =n.parentN ode;){pl.p ush(n);if( n==pa)brea k;}tm=pa2; for(i=pl.l ength-1;i> =0;i--){if (i==pl.len gth-1){whi le(ns=pl[i -1].nextSi bling)tm.a ppendChild (ns.parent Node.remov eChild(ns) );}else{n= pl[i].clon eNode(fals e);if(i!=0 ){while(ns =pl[i-1].n extSibling )n.appendC hild(ns.pa rentNode.r emoveChild (ns));}tm= tm.appendC hild(n);}} e=t.dom.in sertAfter( e.parentNo de.removeC hild(e),pa );t.dom.in sertAfter( e,pa);t.do m.insertAf ter(pa2,e) ;}});});}} ,setEntiti es:functio n(s){var t =this,a,i, l={},re='' ,v;if(t.en tityLookup )return;a= s.split(', ');for(i=0 ;i<a.lengt h;i+=2){v= a[i];if(v= =34||v==38 ||v==60||v ==62)conti nue;l[Stri ng.fromCha rCode(a[i] )]=a[i+1]; v=parseInt (a[i]).toS tring(16); re+='\\u'+ '0000'.sub string(v.l ength)+v;} if(!re){t. settings.e ntity_enco ding='raw' ;return;}t .entitiesR E=new RegE xp('['+re+ ']','g');t .entityLoo kup=l;},se tValidChil dRules:fun ction(s){t his.childR ules=null; this.addVa lidChildRu les(s);},a ddValidChi ldRules:fu nction(s){ var t=this ,inst,intr ,bloc;if(! s)return;i nst='A|BR| SPAN|BDO|M AP|OBJECT| IMG|TT|I|B |BIG|SMALL |EM|STRONG |DFN|CODE| Q|SAMP|KBD |VAR|CITE| ABBR|ACRON YM|SUB|SUP |#text|#co mment';int r='A|BR|SP AN|BDO|OBJ ECT|APPLET |IMG|MAP|I FRAME|TT|I |B|U|S|STR IKE|BIG|SM ALL|FONT|B ASEFONT|EM |STRONG|DF N|CODE|Q|S AMP|KBD|VA R|CITE|ABB R|ACRONYM| SUB|SUP|IN PUT|SELECT |TEXTAREA| LABEL|BUTT ON|#text|# comment';b loc='H[1-6 ]|P|DIV|AD DRESS|PRE| FORM|TABLE |LI|OL|UL| TD|CAPTION |BLOCKQUOT E|CENTER|D L|DT|DD|DI R|FIELDSET |FORM|NOSC RIPT|NOFRA MES|MENU|I SINDEX|SAM P';each(s. split(',') ,function( s){var p=s .split(/\[ |\]/),re;s ='';each(p [1].split( '|'),funct ion(v){if( s)s+='|';s witch(v){c ase'%itran s':v=intr; break;case '%itrans_n a':v=intr. substring( 2);break;c ase'%istri ct':v=inst ;break;cas e'%istrict _na':v=ins t.substrin g(2);break ;case'%btr ans':v=blo c;break;ca se'%bstric t':v=bloc; break;}s+= v;});re=ne w RegExp(' ^('+s.toLo werCase()+ ')$','i'); each(p[0]. split('/') ,function( s){t.child Rules=t.ch ildRules|| {};t.child Rules[s]=r e;});});s= '';each(t. childRules ,function( v,k){if(s) s+='|';s+= k;});t.par entElement sRE=new Re gExp('^('+ s.toLowerC ase()+')$' ,'i');},se tRules:fun ction(s){v ar t=this; t._setup() ;t.rules={ };t.wildRu les=[];t.v alidElemen ts={};retu rn t.addRu les(s);},a ddRules:fu nction(s){ var t=this ,dr;if(!s) return;t._ setup();ea ch(s.split (','),func tion(s){va r p=s.spli t(/\[|\]/) ,tn=p[0].s plit('/'), ra,at,wat, va=[];if(d r)at=tinym ce.extend( [],dr.attr ibs);if(p. length>1){ each(p[1]. split('|') ,function( s){var ar= {},i;at=at ||[];s=s.r eplace(/:: /g,'~');s= /^([!\-])? ([\w*.?~]+ |)([=:<])? (.+)?$/.ex ec(s);s[2] =s[2].repl ace(/~/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.spli ce(i,1);re turn;}}}sw itch(s[3]) {case'=':a r.defaultV al=s[4]||' ';break;ca se':':ar.f orcedVal=s [4];break; case'<':ar .validVals =s[4].spli t('?');bre ak;}if(/[* .?]/.test( s[2])){wat =wat||[];a r.nameRE=n ew RegExp( '^'+wildca rdToRE(s[2 ])+'$');wa t.push(ar) ;}else{ar. name=s[2]; at.push(ar );}va.push (s[2]);}); }each(tn,f unction(s, i){var pr= s.charAt(0 ),x=1,ru={ };if(dr){i f(dr.noEmp ty)ru.noEm pty=dr.noE mpty;if(dr .fullEnd)r u.fullEnd= dr.fullEnd ;if(dr.pad d)ru.padd= dr.padd;}s witch(pr){ case'-':ru .noEmpty=t rue;break; case'+':ru .fullEnd=t rue;break; case'#':ru .padd=true ;break;def ault:x=0;} tn[i]=s=s. substring( x);t.valid Elements[s ]=1;if(/[* .?]/.test( tn[0])){ru .nameRE=ne w RegExp(' ^'+wildcar dToRE(tn[0 ])+'$');t. wildRules= t.wildRule s||{};t.wi ldRules.pu sh(ru);}el se{ru.name =tn[0];if( tn[0]=='@' )dr=ru;t.r ules[s]=ru ;}ru.attri bs=at;if(r a)ru.requi redAttribs =ra;if(wat ){s='';eac h(va,funct ion(v){if( s)s+='|';s +='('+wild cardToRE(v )+')';});r u.validAtt ribsRE=new  RegExp('^ '+s.toLowe rCase()+'$ ');ru.wild Attribs=wa t;}});});s ='';each(t .validElem ents,funct ion(v,k){i f(s)s+='|' ;if(k!='@' )s+=k;});t .validElem entsRE=new  RegExp('^ ('+wildcar dToRE(s.to LowerCase( ))+')$');} ,findRule: function(n ){var t=th is,rl=t.ru les,i,r;t. _setup();r =rl[n];if( r)return r ;rl=t.wild Rules;for( i=0;i<rl.l ength;i++) {if(rl[i]. nameRE.tes t(n))retur n rl[i];}r eturn null ;},findAtt ribRule:fu nction(ru, n){var i,w a=ru.wildA ttribs;for (i=0;i<wa. length;i++ ){if(wa[i] .nameRE.te st(n))retu rn wa[i];} return nul l;},serial ize:functi on(n,o){va r h,t=this ;t._setup( );o=o||{}; o.format=o .format||' html';t.pr ocessObj=o ;n=n.clone Node(true) ;t.key=''+ (parseInt( t.key)+1); if(!o.no_e vents){o.n ode=n;t.on PreProcess .dispatch( t,o);}t.wr iter.reset ();t._seri alizeNode( n,o.getInn er);o.cont ent=t.writ er.getCont ent();if(! o.no_event s)t.onPost Process.di spatch(t,o );t._postP rocess(o); o.node=nul l;return t inymce.tri m(o.conten t);},_post Process:fu nction(o){ var t=this ,s=t.setti ngs,h=o.co ntent,sc=[ ],p,l;if(o .format==' html'){p=t ._protect( {content:h ,patterns: [/(<script [^>]*>)(.* ?)(<\/scri pt>)/g,/(< style[^>]* >)(.*?)(<\ /style>)/g ,/(<pre[^> ]*>)(.*?)( <\/pre>)/g ]});h=p.co ntent;if(s .entity_en coding!==' raw'){if(s .entity_en coding.ind exOf('name d')!=-1){t .setEntiti es(s.entit ies);l=t.e ntityLooku p;h=h.repl ace(t.enti tiesRE,fun ction(a){v ar v;if(v= l[a])a='&' +v+';';ret urn a;});} if(s.entit y_encoding .indexOf(' numeric')! =-1){h=h.r eplace(/[\ u007E-\uFF FF]/g,func tion(a){re turn'&#'+a .charCodeA t(0)+';';} );}}if(o.s et)h=h.rep lace(/<p>\ s+(&nbsp;| &#160;|\u0 0a0|<br \/ >)\s+<\/p> /g,'<p><br  /></p>'); else h=h.r eplace(/<p >\s+(&nbsp ;|&#160;|\ u00a0|<br  \/>)\s+<\/ p>/g,'<p>$ 1</p>');if (!o.set){i f(s.remove _linebreak s){h=h.rep lace(/(<[^ >]+>)\s+/g ,'$1 ');h= h.replace( /\s+(<\/[^ >]+>)/g,'  $1');h=h.r eplace(/<( p|h[1-6]|b lockquote| hr|div|tab le|tbody|t r|td|body| head|html| title|meta |style|pre |script|li nk|object)  ([^>]+)>\ s+/g,'<$1  $2>');h=h. replace(/< (p|h[1-6]| blockquote |hr|div|ta ble|tbody| tr|td|body |head|html |title|met a|style|pr e|script|l ink|object )>\s+/g,'< $1>');h=h. replace(/\ s+<\/(p|h[ 1-6]|block quote|hr|d iv|table|t body|tr|td |body|head |html|titl e|meta|sty le|pre|scr ipt|link|o bject)>/g, '</$1>');} if(s.apply _source_fo rmatting&& s.indent_m ode=='simp le'){h=h.r eplace(/<( \/?)(ul|hr |table|met a|link|tbo dy|tr|obje ct|body|he ad|html|ma p)(|[^>]+) >\s*/g,'\n <$1$2$3>\n ');h=h.rep lace(/\s*< (p|h[1-6]| blockquote |div|title |style|pre |script|td |li|area)( |[^>]+)>/g ,'\n<$1$2> ');h=h.rep lace(/<\/( p|h[1-6]|b lockquote| div|title| style|pre| script|td| li)>\s*/g, '</$1>\n') ;h=h.repla ce(/\n\n/g ,'\n');}}h =t._unprot ect(h,p);} o.content= h;},_seria lizeNode:f unction(n, inn){var t =this,s=t. settings,w =t.writer, hc,el,cn,i ,l,a,at,no ,v,nn,ru,a r,iv;if(!s .node_filt er||s.node _filter(n) ){switch(n .nodeType) {case 1:if (n.hasAttr ibute?n.ha sAttribute ('mce_bogu s'):n.getA ttribute(' mce_bogus' ))return;i v=false;hc =n.hasChil dNodes();n n=n.getAtt ribute('mc e_name')|| n.nodeName .toLowerCa se();if(is IE){if(n.s copeName!= ='HTML'&&n .scopeName !=='html') nn=n.scope Name+':'+n n;}if(nn.i ndexOf('mc e:')===0)n n=nn.subst ring(4);if (!t.validE lementsRE. test(nn)|| (t.invalid ElementsRE &&t.invali dElementsR E.test(nn) )||inn){iv =true;brea k;}if(isIE ){if(s.fix _content_d uplication ){if(n.mce _serialize d==t.key)r eturn;n.mc e_serializ ed=t.key;} if(nn.char At(0)=='/' )nn=nn.sub string(1); }if(t.chil dRules){if (t.parentE lementsRE. test(t.ele mentName)) {if(!t.chi ldRules[t. elementNam e].test(nn )){iv=true ;break;}}t .elementNa me=nn;}ru= t.findRule (nn);nn=ru .name||nn; if((!hc&&r u.noEmpty) ||(isIE&&! nn)){iv=tr ue;break;} if(ru.requ iredAttrib s){a=ru.re quiredAttr ibs;for(i= a.length-1 ;i>=0;i--) {if(this.d om.getAttr ib(n,a[i]) !=='')brea k;}if(i==- 1){iv=true ;break;}}w .writeStar tElement(n n);if(ru.a ttribs){fo r(i=0,at=r u.attribs, l=at.lengt h;i<l;i++) {a=at[i];v =t._getAtt rib(n,a);i f(v!==null )w.writeAt tribute(a. name,v);}} if(ru.vali dAttribsRE ){at=isIE? getIEAtts( n):n.attri butes;for( i=at.lengt h-1;i>-1;i --){no=at[ i];if(no.s pecified){ a=no.nodeN ame.toLowe rCase();if (s.invalid _attrs.tes t(a)||!ru. validAttri bsRE.test( a))continu e;ar=t.fin dAttribRul e(ru,a);v= t._getAttr ib(n,ar,a) ;if(v!==nu ll)w.write Attribute( a,v);}}}if (!hc&&ru.p add)w.writ eText('\u0 0a0');brea k;case 3:i f(t.childR ules&&t.pa rentElemen tsRE.test( t.elementN ame)){if(! t.childRul es[t.eleme ntName].te st(n.nodeN ame))retur n;}return  w.writeTex t(n.nodeVa lue);case  4:return w .writeCDAT A(n.nodeVa lue);case  8:return w .writeComm ent(n.node Value);}}e lse if(n.n odeType==1 )hc=n.hasC hildNodes( );if(hc){c n=n.firstC hild;while (cn){t._se rializeNod e(cn);t.el ementName= nn;cn=cn.n extSibling ;}}if(!iv) {if(hc||!s .closed.te st(nn))w.w riteFullEn dElement() ;else w.wr iteEndElem ent();}},_ protect:fu nction(o){ o.items=o. items||[]; function e nc(s){retu rn s.repla ce(/[\r\n\ \]/g,funct ion(c){if( c==='\n')r eturn'\\n' ;else if(c ==='\\')re turn'\\\\' ;return'\\ r';});};fu nction dec (s){return  s.replace (/\\[\\rn] /g,functio n(c){if(c= =='\\n')re turn'\n';e lse if(c== ='\\\\')re turn'\\';r eturn'\r'; });};each( o.patterns ,function( p){o.conte nt=dec(enc (o.content ).replace( p,function (x,a,b,c){ o.items.pu sh(dec(b)) ;return a+ '<!--mce:' +(o.items. length-1)+ '-->'+c;}) );});retur n o;},_unp rotect:fun ction(h,o) {h=h.repla ce(/\<!--m ce:([0-9]+ )--\>/g,fu nction(a,b ){return o .items[par seInt(b)]; });o.items =[];return  h;},_setu p:function (){var t=t his,s=this .settings; if(t.done) return;t.d one=1;t.se tRules(s.v alid_eleme nts);t.add Rules(s.ex tended_val id_element s);t.addVa lidChildRu les(s.vali d_child_el ements);if (s.invalid _elements) t.invalidE lementsRE= new RegExp ('^('+wild cardToRE(s .invalid_e lements.re place(',', '|').toLow erCase())+ ')$');if(s .attrib_va lue_filter )t.attribV alueFilter =s.attribV alueFilter ;},_getAtt rib:functi on(n,a,na) {var i,v;n a=na||a.na me;if(a.fo rcedVal&&( v=a.forced Val)){if(v ==='{$uid} ')return t his.dom.un iqueId();r eturn v;}v =this.dom. getAttrib( n,na);swit ch(na){cas e'rowspan' :case'cols pan':if(v= ='1')v=''; break;}if( this.attri bValueFilt er)v=this. attribValu eFilter(na ,v,n);if(a .validVals ){for(i=a. validVals. length-1;i >=0;i--){i f(v==a.val idVals[i]) break;}if( i==-1)retu rn null;}i f(v===''&& typeof(a.d efaultVal) !='undefin ed'){v=a.d efaultVal; if(v==='{$ uid}')retu rn this.do m.uniqueId ();return  v;}else{if (na=='clas s'&&this.p rocessObj. get)v=v.re place(/\s? mceItem\w+ \s?/g,''); }if(v==='' )return nu ll;return  v;}});})() ;(function (){var eac h=tinymce. each;tinym ce.create( 'tinymce.d om.ScriptL oader',{Sc riptLoader :function( s){this.se ttings=s|| {};this.qu eue=[];thi s.lookup={ };},isDone :function( u){return  this.looku p[u]?this. lookup[u]. state==2:0 ;},markDon e:function (u){this.l ookup[u]={ state:2,ur l:u};},add :function( u,cb,s,pr) {var t=thi s,lo=t.loo kup,o;if(o =lo[u]){if (cb&&o.sta te==2)cb.c all(s||thi s);return  o;}o={stat e:0,url:u, func:cb,sc ope:s||thi s};if(pr)t .queue.uns hift(o);el se t.queue .push(o);l o[u]=o;ret urn o;},lo ad:functio n(u,cb,s){ var t=this ,o;functio n loadScri pt(u){if(t inymce.dom .Event.dom Loaded||t. settings.s trict_mode ){tinymce. util.XHR.s end({url:u ,error:t.s ettings.er ror,async: false,succ ess:functi on(co){t.e val(co);}} );}else do cument.wri te('<scrip t type="te xt/javascr ipt" src=" '+u+'"></s cript>');} ;if(!tinym ce.is(u,'s tring')){e ach(u,func tion(u){lo adScript(u );});if(cb )cb.call(s ||t);}else {loadScrip t(u);if(cb )cb.call(s ||t);}},lo adQueue:fu nction(cb, s){var t=t his;if(!t. queueLoadi ng){t.queu eLoading=1 ;t.queueCa llbacks=[] ;t.loadScr ipts(t.que ue,functio n(){t.queu eLoading=0 ;if(cb)cb. call(s||t) ;each(t.qu eueCallbac ks,functio n(o){o.fun c.call(o.s cope);});} );}else if (cb)t.queu eCallbacks .push({fun c:cb,scope :s||t});}, eval:funct ion(co){va r w=window ;if(!w.exe cScript){t ry{eval.ca ll(w,co);} catch(ex){ eval(co,w) ;}}else w. execScript (co);},loa dScripts:f unction(sc ,cb,s){var  t=this,lo =t.lookup; function d one(o){o.s tate=2;if( o.func)o.f unc.call(o .scope||t) ;};functio n allDone( ){var l;l= sc.length; each(sc,fu nction(o){ o=lo[o.url ];if(o.sta te===2){do ne(o);l--; }else load (o);});if( l===0&&cb) {cb.call(s ||t);cb=0; }};functio n load(o){ if(o.state >0)return; o.state=1; tinymce.ut il.XHR.sen d({url:o.u rl,error:t .settings. error,succ ess:functi on(co){t.e val(co);do ne(o);allD one();}}); };each(sc, function(o ){var u=o. url;if(!lo [u]){lo[u] =o;t.queue .push(o);} else o=lo[ u];if(o.st ate>0)retu rn;if(!tin ymce.dom.E vent.domLo aded&&!t.s ettings.st rict_mode) {var ix,ol ='';if(cb| |o.func){o .state=1;i x=tinymce. dom.Script Loader._ad dOnLoad(fu nction(){d one(o);all Done();}); if(tinymce .isIE)ol='  onreadyst atechange= "';else ol =' onload= "';ol+='ti nymce.dom. ScriptLoad er._onLoad (this,\''+ u+'\','+ix +');"';}do cument.wri te('<scrip t type="te xt/javascr ipt" src=" '+u+'"'+ol +'></scrip t>');if(!o .func)done (o);}else  load(o);}) ;allDone() ;},'static ':{_addOnL oad:functi on(f){var  t=this;t._ funcs=t._f uncs||[];t ._funcs.pu sh(f);retu rn t._func s.length-1 ;},_onLoad :function( e,u,ix){if (!tinymce. isIE||e.re adyState== 'complete' )this._fun cs[ix].cal l(this);}} });tinymce .ScriptLoa der=new ti nymce.dom. ScriptLoad er();})(); (function( ){var DOM= tinymce.DO M,is=tinym ce.is;tiny mce.create ('tinymce. ui.Control ',{Control :function( id,s){this .id=id;thi s.settings =s=s||{};t his.render ed=false;t his.onRend er=new tin ymce.util. Dispatcher (this);thi s.classPre fix='';thi s.scope=s. scope||thi s;this.dis abled=0;th is.active= 0;},setDis abled:func tion(s){va r e;if(s!= this.disab led){e=DOM .get(this. id);if(e&& this.setti ngs.unavai lable_pref ix){if(s){ this.prevT itle=e.tit le;e.title =this.sett ings.unava ilable_pre fix+": "+e .title;}el se e.title =this.prev Title;}thi s.setState ('Disabled ',s);this. setState(' Enabled',! s);this.di sabled=s;} },isDisabl ed:functio n(){return  this.disa bled;},set Active:fun ction(s){i f(s!=this. active){th is.setStat e('Active' ,s);this.a ctive=s;}} ,isActive: function() {return th is.active; },setState :function( c,s){var n =DOM.get(t his.id);c= this.class Prefix+c;i f(s)DOM.ad dClass(n,c );else DOM .removeCla ss(n,c);}, isRendered :function( ){return t his.render ed;},rende rHTML:func tion(){},r enderTo:fu nction(n){ DOM.setHTM L(n,this.r enderHTML( ));},postR ender:func tion(){var  t=this,b; if(is(t.di sabled)){b =t.disable d;t.disabl ed=-1;t.se tDisabled( b);}if(is( t.active)) {b=t.activ e;t.active =-1;t.setA ctive(b);} },destroy: function() {DOM.remov e(this.id) ;}});})(); tinymce.cr eate('tiny mce.ui.Con tainer:tin ymce.ui.Co ntrol',{Co ntainer:fu nction(id, s){this.pa rent(id,s) ;this.cont rols=[];th is.lookup= {};},add:f unction(c) {this.look up[c.id]=c ;this.cont rols.push( c);return  c;},get:fu nction(n){ return thi s.lookup[n ];}});tiny mce.create ('tinymce. ui.Separat or:tinymce .ui.Contro l',{render HTML:funct ion(){retu rn tinymce .DOM.creat eHTML('spa n',{'class ':'mceSepa rator'});} });(functi on(){var i s=tinymce. is,DOM=tin ymce.DOM,e ach=tinymc e.each,wal k=tinymce. walk;tinym ce.create( 'tinymce.u i.MenuItem :tinymce.u i.Control' ,{MenuItem :function( id,s){this .parent(id ,s);this.c lassPrefix ='mceMenuI tem';},set Selected:f unction(s) {this.setS tate('Sele cted',s);t his.select ed=s;},isS elected:fu nction(){r eturn this .selected; },postRend er:functio n(){var t= this;t.par ent();if(i s(t.select ed))t.setS elected(t. selected); }});})();( function() {var is=ti nymce.is,D OM=tinymce .DOM,each= tinymce.ea ch,walk=ti nymce.walk ;tinymce.c reate('tin ymce.ui.Me nu:tinymce .ui.MenuIt em',{Menu: function(i d,s){var t =this;t.pa rent(id,s) ;t.items={ };t.collap sed=false; t.menuCoun t=0;t.onAd dItem=new  tinymce.ut il.Dispatc her(this); },expand:f unction(d) {var t=thi s;if(d){wa lk(t,funct ion(o){if( o.expand)o .expand(); },'items', t);}t.coll apsed=fals e;},collap se:functio n(d){var t =this;if(d ){walk(t,f unction(o) {if(o.coll apse)o.col lapse();}, 'items',t) ;}t.collap sed=true;} ,isCollaps ed:functio n(){return  this.coll apsed;},ad d:function (o){if(!o. settings)o =new tinym ce.ui.Menu Item(o.id| |DOM.uniqu eId(),o);t his.onAddI tem.dispat ch(this,o) ;return th is.items[o .id]=o;},a ddSeparato r:function (){return  this.add({ separator: true});},a ddMenu:fun ction(o){i f(!o.colla pse)o=this .createMen u(o);this. menuCount+ +;return t his.add(o) ;},hasMenu s:function (){return  this.menuC ount!==0;} ,remove:fu nction(o){ delete thi s.items[o. id];},remo veAll:func tion(){var  t=this;wa lk(t,funct ion(o){if( o.removeAl l)o.remove All();o.de stroy();}, 'items',t) ;t.items={ };},create Menu:funct ion(o){var  m=new tin ymce.ui.Me nu(o.id||D OM.uniqueI d(),o);m.o nAddItem.a dd(this.on AddItem.di spatch,thi s.onAddIte m);return  m;}});})() ;(function (){var is= tinymce.is ,DOM=tinym ce.DOM,eac h=tinymce. each,Event =tinymce.d om.Event,E lement=tin ymce.dom.E lement;tin ymce.creat e('tinymce .ui.DropMe nu:tinymce .ui.Menu', {DropMenu: function(i d,s){s=s|| {};s.conta iner=s.con tainer||do cument.bod y;s.offset _x=s.offse t_x||0;s.o ffset_y=s. offset_y|| 0;s.vp_off set_x=s.vp _offset_x| |0;s.vp_of fset_y=s.v p_offset_y ||0;if(is( s.icons)&& !s.icons)s ['class']+ =' mceNoIc ons';this. parent(id, s);this.on ShowMenu=n ew tinymce .util.Disp atcher(thi s);this.on HideMenu=n ew tinymce .util.Disp atcher(thi s);this.cl assPrefix= 'mceMenu'; this.fixIE =tinymce.i sIE&&windo w.top!=win dow;},crea teMenu:fun ction(s){v ar t=this, cs=t.setti ngs,m;s.co ntainer=s. container| |cs.contai ner;s.pare nt=t;s.con strain=s.c onstrain|| cs.constra in;s['clas s']=s['cla ss']||cs[' class'];s. vp_offset_ x=s.vp_off set_x||cs. vp_offset_ x;s.vp_off set_y=s.vp _offset_y| |cs.vp_off set_y;m=ne w tinymce. ui.DropMen u(s.id||DO M.uniqueId (),s);m.on AddItem.ad d(t.onAddI tem.dispat ch,t.onAdd Item);retu rn m;},upd ate:functi on(){var t =this,s=t. settings,t b=DOM.get( 'menu_'+t. id+'_tbl') ,co=DOM.ge t('menu_'+ t.id+'_co' ),tw,th;tw =s.max_wid th?Math.mi n(tb.clien tWidth,s.m ax_width): tb.clientW idth;th=s. max_height ?Math.min( tb.clientH eight,s.ma x_height): tb.clientH eight;if(! DOM.boxMod el)t.eleme nt.setStyl es({width: tw+2,heigh t:th+2});e lse t.elem ent.setSty les({width :tw,height :th});if(s .max_width )DOM.setSt yle(co,'wi dth',tw);i f(s.max_he ight){DOM. setStyle(c o,'height' ,th);if(tb .clientHei ght<s.max_ height)DOM .setStyle( co,'overfl ow','hidde n');}},sho wMenu:func tion(x,y,p x){var t=t his,s=t.se ttings,co, vp=DOM.get ViewPort() ,w,h,mx,my ,ot=2,dm,t b;t.collap se(1);if(t .isMenuVis ible)retur n;if(!t.re ndered){co =DOM.add(t .settings. container, t.renderNo de());each (t.items,f unction(o) {o.postRen der();});t .element=n ew Element ('menu_'+t .id,{block er:1,conta iner:s.con tainer});} else co=DO M.get('men u_'+t.id); if(!tinymc e.isOpera) DOM.setSty les(co,{le ft:-0xFFFF ,top:-0xFF FF});DOM.s how(co);t. update();x +=s.offset _x||0;y+=s .offset_y| |0;vp.w-=4 ;vp.h-=4;i f(s.constr ain){w=co. clientWidt h-ot;h=co. clientHeig ht-ot;mx=v p.x+vp.w;m y=vp.y+vp. h;if((x+s. vp_offset_ x+w)>mx)x= px?px-w:Ma th.max(0,( mx-s.vp_of fset_x)-w) ;if((y+s.v p_offset_y +h)>my)y=M ath.max(0, (my-s.vp_o ffset_y)-h );}DOM.set Styles(co, {left:x,to p:y});t.el ement.upda te();t.isM enuVisible =1;t.mouse ClickFunc= Event.add( co,t.fixIE ?'mousedow n':'click' ,function( e){var m;e =e.target; if(e&&(e=D OM.getPare nt(e,'TR') )&&!DOM.ha sClass(e,' mceMenuIte mSub')){m= t.items[e. id];if(m.i sDisabled( ))return;d m=t;while( dm){if(dm. hideMenu)d m.hideMenu ();dm=dm.s ettings.pa rent;}if(m .settings. onclick)m. settings.o nclick(e); return Eve nt.cancel( e);}});if( t.hasMenus ()){t.mous eOverFunc= Event.add( co,'mouseo ver',funct ion(e){var  m,r,mi;e= e.target;i f(e&&(e=DO M.getParen t(e,'TR')) ){m=t.item s[e.id];if (t.lastMen u)t.lastMe nu.collaps e(1);if(m. isDisabled ())return; if(e&&DOM. hasClass(e ,'mceMenuI temSub')){ r=DOM.getR ect(e);m.s howMenu((r .x+r.w-ot) ,r.y-ot,r. x);t.lastM enu=m;DOM. addClass(D OM.get(m.i d).firstCh ild,'mceMe nuItemActi ve');}}}); }t.onShowM enu.dispat ch(t);},hi deMenu:fun ction(c){v ar t=this, co=DOM.get ('menu_'+t .id),e;if( !t.isMenuV isible)ret urn;Event. remove(co, 'mouseover ',t.mouseO verFunc);E vent.remov e(co,t.fix IE?'moused own':'clic k',t.mouse ClickFunc) ;DOM.hide( co);t.isMe nuVisible= 0;if(!c)t. collapse(1 );if(t.ele ment)t.ele ment.hide( );if(e=DOM .get(t.id) )DOM.remov eClass(e.f irstChild, 'mceMenuIt emActive') ;t.onHideM enu.dispat ch(t);},ad d:function (o){var t= this,co;o= t.parent(o );if(t.isR endered&&( co=DOM.get ('menu_'+t .id)))t._a dd(DOM.sel ect('tbody ',co)[0],o );return o ;},collaps e:function (d){this.p arent(d);t his.hideMe nu(1);},re move:funct ion(o){DOM .remove(o. id);return  this.pare nt(o);},de stroy:func tion(){var  t=this,co =DOM.get(' menu_'+t.i d);Event.r emove(co,' mouseover' ,t.mouseOv erFunc);Ev ent.remove (co,'click ',t.mouseC lickFunc); if(t.eleme nt)t.eleme nt.remove( );DOM.remo ve(co);},r enderNode: function() {var t=thi s,s=t.sett ings,n,tb, co,w;w=DOM .create('d iv',{id:'m enu_'+t.id ,dir:'ltr' ,'class':s ['class'], 'style':'p osition:ab solute;lef t:0;top:0; z-index:15 0'});co=DO M.add(w,'d iv',{id:'m enu_'+t.id +'_co','cl ass':'mceM enu'+(s['c lass']?' ' +s['class' ]:'')});t. element=ne w Element( 'menu_'+t. id,{blocke r:1,contai ner:s.cont ainer});if (s.menu_li ne)DOM.add (co,'span' ,{'class': 'mceMenuLi ne'});n=DO M.add(co,' table',{id :'menu_'+t .id+'_tbl' ,border:0, cellPaddin g:0,cellSp acing:0}); tb=DOM.add (n,'tbody' );each(t.i tems,funct ion(o){t._ add(tb,o); });t.rende red=true;r eturn w;}, _add:funct ion(tb,o){ var n,s=o. settings,a ,ro,it;if( s.separato r){ro=DOM. add(tb,'tr ',{id:o.id ,'class':' mceMenuIte mSeparator '});DOM.ad d(ro,'td', {'class':' mceMenuIte mSeparator '});if(n=r o.previous Sibling)DO M.addClass (n,'mceLas t');return ;}n=ro=DOM .add(tb,'t r',{id:o.i d,'class': 'mceMenuIt em mceMenu ItemEnable d'});n=it= DOM.add(n, 'td');n=a= DOM.add(n, 'a',{href: 'javascrip t:;',oncli ck:"return  false;",o nmousedown :'return f alse;'});D OM.addClas s(it,s['cl ass']);DOM .add(n,'sp an',{'clas s':'mceIco n'+(s.icon ?' mce_'+s .icon:'')} );n=DOM.ad d(n,s.elem ent||'span ',{'class' :'mceText' ,title:o.s ettings.ti tle},o.set tings.titl e);if(o.se ttings.sty le)DOM.set Attrib(n,' style',o.s ettings.st yle);if(tb .childNode s.length== 1)DOM.addC lass(ro,'m ceFirst'); if((n=ro.p reviousSib ling)&&DOM .hasClass( n,'mceMenu ItemSepara tor'))DOM. addClass(r o,'mceFirs t');if(o.c ollapse)DO M.addClass (ro,'mceMe nuItemSub' );if(n=ro. previousSi bling)DOM. removeClas s(n,'mceLa st');DOM.a ddClass(ro ,'mceLast' );}});})() ;(function (){var DOM =tinymce.D OM;tinymce .create('t inymce.ui. Button:tin ymce.ui.Co ntrol',{Bu tton:funct ion(id,s){ this.paren t(id,s);th is.classPr efix='mceB utton';},r enderHTML: function() {var s=thi s.settings ,h='<a id= "'+this.id +'" href=" javascript :;" class= "mceButton  mceButton Enabled '+ s['class'] +'" onmous edown="ret urn false; " onclick= "return fa lse;" titl e="'+DOM.e ncode(s.ti tle)+'">'; if(s.image )h+='<img  class="mce Icon" src= "'+s.image +'" /></a> ';else h+= '<span cla ss="mceIco n '+s['cla ss']+'"></ span></a>' ;return h; },postRend er:functio n(){var t= this,s=t.s ettings;ti nymce.dom. Event.add( t.id,'clic k',functio n(e){if(!t .isDisable d())return  s.onclick .call(s.sc ope,e);}); }});})();( function() {var DOM=t inymce.DOM ,Event=tin ymce.dom.E vent,each= tinymce.ea ch,Dispatc her=tinymc e.util.Dis patcher;ti nymce.crea te('tinymc e.ui.ListB ox:tinymce .ui.Contro l',{ListBo x:function (id,s){var  t=this;t. parent(id, s);t.items =[];t.onCh ange=new D ispatcher( t);t.onPos tRender=ne w Dispatch er(t);t.on Add=new Di spatcher(t );t.onRend erMenu=new  tinymce.u til.Dispat cher(this) ;t.classPr efix='mceL istBox';}, select:fun ction(v){v ar t=this, e,fv;if(v! =t.selecte dValue){e= DOM.get(t. id+'_text' );t.select edValue=v; each(t.ite ms,functio n(o){if(o. value==v){ DOM.setHTM L(e,DOM.en code(o.tit le));fv=1; return fal se;}});if( !fv){DOM.s etHTML(e,D OM.encode( t.settings .title));D OM.addClas s(e,'mceTi tle');e=0; return;}el se DOM.rem oveClass(e ,'mceTitle ');}e=0;}, add:functi on(n,v,o){ var t=this ;o=o||{};o =tinymce.e xtend(o,{t itle:n,val ue:v});t.i tems.push( o);t.onAdd .dispatch( t,o);},get Length:fun ction(){re turn this. items.leng th;},rende rHTML:func tion(){var  h='',t=th is,s=t.set tings;h='< table id=" '+t.id+'"  cellpaddin g="0" cell spacing="0 " class="m ceListBox  mceListBox Enabled'+( s['class'] ?(' '+s['c lass']):'' )+'"><tbod y><tr>';h+ ='<td>'+DO M.createHT ML('a',{id :t.id+'_te xt',href:' javascript :;','class ':'mceText ',onclick: "return fa lse;",onmo usedown:'r eturn fals e;'},DOM.e ncode(t.se ttings.tit le))+'</td >';h+='<td >'+DOM.cre ateHTML('a ',{id:t.id +'_open',h ref:'javas cript:;',' class':'mc eOpen',onc lick:"retu rn false;" ,onmousedo wn:'return  false;'}, '<span></s pan>')+'</ td>';h+='< /tr></tbod y></table> ';return h ;},showMen u:function (){var t=t his,p1,p2, e=DOM.get( this.id),m ;if(t.isDi sabled()|| t.items.le ngth==0)re turn;if(!t .isMenuRen dered){t.r enderMenu( );t.isMenu Rendered=t rue;}p1=DO M.getPos(t his.settin gs.menu_co ntainer);p 2=DOM.getP os(e);m=t. menu;m.set tings.offs et_x=p2.x; m.settings .offset_y= p2.y;if(t. oldID)m.it ems[t.oldI D].setSele cted(0);ea ch(t.items ,function( o){if(o.va lue===t.se lectedValu e){m.items [o.id].set Selected(1 );t.oldID= o.id;}});m .showMenu( 0,e.client Height);Ev ent.add(do cument,'mo usedown',t .hideMenu, t);DOM.add Class(t.id ,'mceListB oxSelected ');},hideM enu:functi on(e){var  t=this;if( !e||!DOM.g etParent(e .target,fu nction(n){ return DOM .hasClass( n,'mceMenu ');})){DOM .removeCla ss(t.id,'m ceListBoxS elected'); Event.remo ve(documen t,'mousedo wn',t.hide Menu,t);if (t.menu)t. menu.hideM enu();}},r enderMenu: function() {var t=thi s,m;m=t.se ttings.con trol_manag er.createD ropMenu(t. id+'_menu' ,{menu_lin e:1,'class ':'mceList BoxMenu mc eNoIcons', max_width: 150,max_he ight:150}) ;m.onHideM enu.add(t. hideMenu,t );m.add({t itle:t.set tings.titl e,'class': 'mceMenuIt emTitle'}) .setDisabl ed(1);each (t.items,f unction(o) {o.id=DOM. uniqueId() ;o.onclick =function( ){if(t.set tings.onse lect(o.val ue)!==fals e)t.select (o.value); };m.add(o) ;});t.onRe nderMenu.d ispatch(t, m);t.menu= m;},postRe nder:funct ion(){var  t=this;Eve nt.add(t.i d,'click', t.showMenu ,t);if(tin ymce.isIE6 ||!DOM.box Model){Eve nt.add(t.i d,'mouseov er',functi on(){if(!D OM.hasClas s(t.id,'mc eListBoxDi sabled'))D OM.addClas s(t.id,'mc eListBoxHo ver');});E vent.add(t .id,'mouse out',funct ion(){if(! DOM.hasCla ss(t.id,'m ceListBoxD isabled')) DOM.remove Class(t.id ,'mceListB oxHover'); });}t.onPo stRender.d ispatch(t, DOM.get(t. id));}});} )();(funct ion(){var  DOM=tinymc e.DOM,Even t=tinymce. dom.Event, each=tinym ce.each,Di spatcher=t inymce.uti l.Dispatch er;tinymce .create('t inymce.ui. NativeList Box:tinymc e.ui.ListB ox',{Nativ eListBox:f unction(id ,s){this.p arent(id,s );this.cla ssPrefix=' mceNativeL istBox';}, setDisable d:function (s){DOM.ge t(this.id) .disabled= s;},isDisa bled:funct ion(){retu rn DOM.get (this.id). disabled;} ,select:fu nction(v){ var e=DOM. get(this.i d),ol=e.op tions;v='' +(v||'');e .selectedI ndex=0;eac h(ol,funct ion(o,i){i f(o.value= =v){e.sele ctedIndex= i;return f alse;}});} ,add:funct ion(n,v,a) {var o,t=t his;a=a||{ };a.value= v;if(t.isR endered()) DOM.add(DO M.get(this .id),'opti on',a,n);o ={title:n, value:v,at tribs:a};t .items.pus h(o);t.onA dd.dispatc h(t,o);},g etLength:f unction(){ return DOM .get(this. id).option s.length-1 ;},renderH TML:functi on(){var h ,t=this;h= DOM.create HTML('opti on',{value :''},'-- ' +t.setting s.title+'  --');each( t.items,fu nction(it) {h+=DOM.cr eateHTML(' option',{v alue:it.va lue},it.ti tle);});h= DOM.create HTML('sele ct',{id:t. id,'class' :'mceNativ eListBox'} ,h);return  h;},postR ender:func tion(){var  t=this,ch ;t.rendere d=true;fun ction onCh ange(e){va r v=e.targ et.options [e.target. selectedIn dex].value ;t.onChang e.dispatch (t,v);if(t .settings. onselect)t .settings. onselect(v );};Event. add(t.id,' change',on Change);Ev ent.add(t. id,'keydow n',functio n(e){var b f;Event.re move(t.id, 'change',c h);bf=Even t.add(t.id ,'blur',fu nction(){E vent.add(t .id,'chang e',onChang e);Event.r emove(t.id ,'blur',bf );});if(e. keyCode==1 3||e.keyCo de==32){on Change(e); return Eve nt.cancel( e);}});t.o nPostRende r.dispatch (t,DOM.get (t.id));}} );})();(fu nction(){v ar DOM=tin ymce.DOM,E vent=tinym ce.dom.Eve nt,each=ti nymce.each ;tinymce.c reate('tin ymce.ui.Me nuButton:t inymce.ui. Button',{M enuButton: function(i d,s){this. parent(id, s);this.on RenderMenu =new tinym ce.util.Di spatcher(t his);s.men u_containe r=s.menu_c ontainer|| document.b ody;},show Menu:funct ion(){var  t=this,p1, p2,e=DOM.g et(t.id),m ;if(t.isDi sabled())r eturn;if(! t.isMenuRe ndered){t. renderMenu ();t.isMen uRendered= true;}p1=D OM.getPos( t.settings .menu_cont ainer);p2= DOM.getPos (e);m=t.me nu;m.setti ngs.offset _x=p2.x;m. settings.o ffset_y=p2 .y;m.setti ngs.vp_off set_x=p2.x ;m.setting s.vp_offse t_y=p2.y;m .showMenu( 0,e.client Height);Ev ent.add(do cument,'mo usedown',t .hideMenu, t);t.setSt ate('Selec ted',1);}, renderMenu :function( ){var t=th is,m;m=t.s ettings.co ntrol_mana ger.create DropMenu(t .id+'_menu ',{menu_li ne:1,'clas s':this.cl assPrefix+ 'Menu',ico ns:t.setti ngs.icons} );m.onHide Menu.add(t .hideMenu, t);t.onRen derMenu.di spatch(t,m );t.menu=m ;},hideMen u:function (e){var t= this;if(!e ||!DOM.get Parent(e.t arget,func tion(n){re turn DOM.h asClass(n, 'mceMenu') ;})){t.set State('Sel ected',0); Event.remo ve(documen t,'mousedo wn',t.hide Menu,t);if (t.menu)t. menu.hideM enu();}},p ostRender: function() {var t=thi s,s=t.sett ings;Event .add(t.id, 'click',fu nction(){i f(!t.isDis abled()){i f(s.onclic k)s.onclic k(t.value) ;t.showMen u();}});}} );})();(fu nction(){v ar DOM=tin ymce.DOM,E vent=tinym ce.dom.Eve nt,each=ti nymce.each ;tinymce.c reate('tin ymce.ui.Sp litButton: tinymce.ui .MenuButto n',{SplitB utton:func tion(id,s) {this.pare nt(id,s);t his.classP refix='mce SplitButto n';},rende rHTML:func tion(){var  h,t=this, s=t.settin gs,h1;h='< tbody><tr> ';if(s.ima ge)h1=DOM. createHTML ('img ',{s rc:s.image ,'class':' mceAction  '+s['class ']});else  h1=DOM.cre ateHTML('s pan',{'cla ss':'mceAc tion '+s[' class']}); h+='<td>'+ DOM.create HTML('a',{ id:t.id+'_ action',hr ef:'javasc ript:;','c lass':'mce Action '+s ['class'], onclick:"r eturn fals e;",onmous edown:'ret urn false; ',title:s. title},h1) +'</td>';h 1=DOM.crea teHTML('sp an',{'clas s':'mceOpe n '+s['cla ss']});h+= '<td>'+DOM .createHTM L('a',{id: t.id+'_ope n',href:'j avascript: ;','class' :'mceOpen  '+s['class '],onclick :"return f alse;",onm ousedown:' return fal se;',title :s.title}, h1)+'</td> ';h+='</tr ></tbody>' ;return DO M.createHT ML('table' ,{id:t.id, 'class':'m ceSplitBut ton mceSpl itButtonEn abled '+s[ 'class'],c ellpadding :'0',cells pacing:'0' ,onmousedo wn:'return  false;',t itle:s.tit le},h);},p ostRender: function() {var t=thi s,s=t.sett ings;if(s. onclick){E vent.add(t .id+'_acti on','click ',function (){if(!t.i sDisabled( ))s.onclic k(t.value) ;});}Event .add(t.id+ '_open','c lick',t.sh owMenu,t); if(tinymce .isIE6||!D OM.boxMode l){Event.a dd(t.id,'m ouseover', function() {if(!DOM.h asClass(t. id,'mceSpl itButtonDi sabled'))D OM.addClas s(t.id,'mc eSplitButt onHover'); });Event.a dd(t.id,'m ouseout',f unction(){ if(!DOM.ha sClass(t.i d,'mceSpli tButtonDis abled'))DO M.removeCl ass(t.id,' mceSplitBu ttonHover' );});}}}); })();(func tion(){var  DOM=tinym ce.DOM,Eve nt=tinymce .dom.Event ,is=tinymc e.is,each= tinymce.ea ch;tinymce .create('t inymce.ui. ColorSplit Button:tin ymce.ui.Sp litButton' ,{ColorSpl itButton:f unction(id ,s){var t= this;t.par ent(id,s); t.settings =s=tinymce .extend({c olors:'000 000,993300 ,333300,00 3300,00336 6,000080,3 33399,3333 33,800000, FF6600,808 000,008000 ,008080,00 00FF,66669 9,808080,F F0000,FF99 00,99CC00, 339966,33C CCC,3366FF ,800080,99 9999,FF00F F,FFCC00,F FFF00,00FF 00,00FFFF, 00CCFF,993 366,C0C0C0 ,FF99CC,FF CC99,FFFF9 9,CCFFCC,C CFFFF,99CC FF,CC99FF, FFFFFF',gr id_width:8 ,default_c olor:'#888 888'},t.se ttings);t. value=s.de fault_colo r;},showMe nu:functio n(){var t= this,r,p,e ;if(t.isDi sabled())r eturn;if(! t.isMenuRe ndered){t. renderMenu ();t.isMen uRendered= true;}e=DO M.get(t.id );DOM.show (t.id+'_me nu');DOM.a ddClass(e, 'mceSplitB uttonSelec ted');p2=D OM.getPos( e);DOM.set Styles(t.i d+'_menu', {left:p2.x ,top:p2.y+ e.clientHe ight,zInde x:150});e= 0;Event.ad d(document ,'mousedow n',t.hideM enu,t);},h ideMenu:fu nction(e){ var t=this ;if(!e||!D OM.getPare nt(e.targe t,function (n){return  DOM.hasCl ass(n,'mce SplitButto nMenu');}) ){DOM.remo veClass(t. id,'mceSpl itButtonSe lected');E vent.remov e(document ,'mousedow n',t.hideM enu,t);DOM .hide(t.id +'_menu'); }},renderM enu:functi on(){var t =this,m,i= 0,s=t.sett ings,n,tb, tr,w;w=DOM .add(s.men u_containe r,'div',{i d:t.id+'_m enu',dir:' ltr','clas s':s['menu _class']+'  '+s['clas s'],style: 'position: absolute;l eft:0;top: -1000px;'} );m=DOM.ad d(w,'div', {'class':s ['class']+ ' mceSplit ButtonMenu '});DOM.ad d(m,'span' ,{'class': 'mceMenuLi ne'});n=DO M.add(m,'t able',{'cl ass':'mceC olorSplitM enu'});tb= DOM.add(n, 'tbody');i =0;each(is (s.colors, 'array')?s .colors:s. colors.spl it(','),fu nction(c){ c=c.replac e(/^#/,'') ;if(!i--){ tr=DOM.add (tb,'tr'); i=s.grid_w idth-1;}n= DOM.add(tr ,'td');n=D OM.add(n,' a',{href:' javascript :;',style: {backgroun dColor:'#' +c}});Even t.add(n,'m ousedown', function() {t.setColo r('#'+c);} );});if(s. more_color s_func){n= DOM.add(tb ,'tr');n=D OM.add(n,' td',{colsp an:s.grid_ width,'cla ss':'mceMo reColors'} );n=DOM.ad d(n,'a',{h ref:'javas cript:;',o nclick:'re turn false ;','class' :'mceMoreC olors'},s. more_color s_title);E vent.add(n ,'click',f unction(e) {s.more_co lors_func. call(s.mor e_colors_s cope||this );return E vent.cance l(e);});}D OM.addClas s(m,'mceCo lorSplitMe nu');retur n w;},setC olor:funct ion(c){var  t=this,p, s=this.set tings,co=s .menu_cont ainer,po,c p,id=t.id+ '_preview' ;if(!(p=DO M.get(id)) ){DOM.setS tyle(t.id+ '_action', 'position' ,'relative ');p=DOM.a dd(t.id+'_ action','d iv',{id:id ,'class':' mceColorPr eview'});} p.style.ba ckgroundCo lor=c;t.va lue=c;t.hi deMenu();s .onselect( c);},destr oy:functio n(){this.p arent();DO M.remove(t his.id+'_m enu');}}); })();tinym ce.create( 'tinymce.u i.Toolbar: tinymce.ui .Container ',{renderH TML:functi on(){var t =this,h='' ,c,co,dom= tinymce.DO M,s=t.sett ings,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='m ceToolbarS tart';if(c o.Button)c +=' mceToo lbarStartB utton';els e if(co.Sp litButton) c+=' mceTo olbarStart SplitButto n';else if (co.ListBo x)c+=' mce ToolbarSta rtListBox' ;h+=dom.cr eateHTML(' td',{'clas s':c},dom. createHTML ('span',nu ll,'<!-- I E -->'));} if(pr&&co. ListBox){i f(pr.Butto n||pr.Spli tButton)h+ =dom.creat eHTML('td' ,{'class': 'mceToolba rEnd'},dom .createHTM L('span',n ull,'<!--  IE -->')); }if(dom.st dMode)h+=' <td style= "position:  relative" >'+co.rend erHTML()+' </td>';els e h+='<td> '+co.rende rHTML()+'< /td>';if(n x&&co.List Box){if(nx .Button||n x.SplitBut ton)h+=dom .createHTM L('td',{'c lass':'mce ToolbarSta rt'},dom.c reateHTML( 'span',nul l,'<!-- IE  -->'));}} c='mceTool barEnd';if (co.Button )c+=' mceT oolbarEndB utton';els e if(co.Sp litButton) c+=' mceTo olbarEndSp litButton' ;else if(c o.ListBox) c+=' mceTo olbarEndLi stBox';h+= dom.create HTML('td', {'class':c },dom.crea teHTML('sp an',null,' <!-- IE -- >'));retur n dom.crea teHTML('ta ble',{id:t .id,'class ':'mceTool bar'+(s['c lass']?' ' +s['class' ]:''),cell padding:'0 ',cellspac ing:'0',al ign:t.sett ings.align ||''},'<tb ody><tr>'+ h+'</tr></ tbody>');} });(functi on(){var D ispatcher= tinymce.ut il.Dispatc her,each=t inymce.eac h;tinymce. create('ti nymce.AddO nManager', {items:[], urls:{},lo okup:{},on Add:new Di spatcher(t his),get:f unction(n) {return th is.lookup[ n];},requi reLangPack :function( n){var u,s ;if(tinymc e.EditorMa nager.sett ings){u=th is.urls[n] +'/langs/' +tinymce.E ditorManag er.setting s.language +'.js';s=t inymce.Edi torManager .settings; if(s){if(! tinymce.do m.Event.do mLoaded&&! s.strict_m ode)tinymc e.ScriptLo ader.load( u);else ti nymce.Scri ptLoader.a dd(u);}}}, add:functi on(id,o){t his.items. push(o);th is.lookup[ id]=o;this .onAdd.dis patch(this ,id,o);ret urn o;},lo ad:functio n(n,u,cb,s ){if(u.ind exOf('/')! =0&&u.inde xOf('://') ==-1)u=tin ymce.baseU RL+'/'+u;t his.urls[n ]=u.substr ing(0,u.la stIndexOf( '/'));tiny mce.Script Loader.add (u,cb,s);} });tinymce .PluginMan ager=new t inymce.Add OnManager( );tinymce. ThemeManag er=new tin ymce.AddOn Manager(); }());(func tion(){var  each=tiny mce.each,e xtend=tiny mce.extend ,DOM=tinym ce.DOM,Eve nt=tinymce .dom.Event ,ThemeMana ger=tinymc e.ThemeMan ager,Plugi nManager=t inymce.Plu ginManager ,explode=t inymce.exp lode;tinym ce.create( 'static ti nymce.Edit orManager' ,{editors: {},i18n:{} ,activeEdi tor:null,i nit:functi on(s){var  t=this,pl, sl=tinymce .ScriptLoa der,c;func tion execC allback(se ,n,s){var  f=se[n];if (!f)return ;if(tinymc e.is(f,'st ring')){s= f.replace( /\.\w+$/,' ');s=s?tin ymce.resol ve(s):0;f= tinymce.re solve(f);} return f.a pply(s||th is,Array.p rototype.s lice.call( arguments, 2));};s=ex tend({them e:"simple" ,language: "en",stric t_loading_ mode:docum ent.conten tType=='ap plication/ xhtml+xml' },s);t.set tings=s;if (!Event.do mLoaded&&! s.strict_l oading_mod e){if(s.la nguage)sl. add(tinymc e.baseURL+ '/langs/'+ s.language +'.js');if (s.theme&& s.theme.ch arAt(0)!=' -'&&!Theme Manager.ur ls[s.theme ])ThemeMan ager.load( s.theme,'t hemes/'+s. theme+'/ed itor_templ ate'+tinym ce.suffix+ '.js');if( s.plugins) {pl=explod e(s.plugin s);if(tiny mce.inArra y(pl,'comp at2x')!=-1 )PluginMan ager.load( 'compat2x' ,'plugins/ compat2x/e ditor_plug in'+tinymc e.suffix+' .js');each (pl,functi on(v){if(v &&v.charAt (0)!='-'&& !PluginMan ager.urls[ v]){if(!ti nymce.isWe bKit&&v==' safari')re turn;Plugi nManager.l oad(v,'plu gins/'+v+' /editor_pl ugin'+tiny mce.suffix +'.js');}} );}sl.load Queue();}E vent.add(d ocument,'i nit',funct ion(){var  l,co;execC allback(s, 'onpageloa d');if(s.b rowsers){l =false;eac h(explode( s.browsers ),function (v){switch (v){case'i e':case'ms ie':if(tin ymce.isIE) l=true;bre ak;case'ge cko':if(ti nymce.isGe cko)l=true ;break;cas e'safari': case'webki t':if(tiny mce.isWebK it)l=true; break;case 'opera':if (tinymce.i sOpera)l=t rue;break; }});if(!l) return;}sw itch(s.mod e){case"ex act":l=s.e lements||' ';if(l.len gth>0){eac h(explode( l),functio n(v){if(DO M.get(v))n ew tinymce .Editor(v, s).render( 1);else{c= 0;each(doc ument.form s,function (f){each(f .elements, function(e ){if(e.nam e===v){v=' mce_editor _'+c;DOM.s etAttrib(e ,'id',v);n ew tinymce .Editor(v, s).render( 1);}});}); }});}break ;case"text areas":cas e"specific _textareas ":function  hasClass( n,c){retur n new RegE xp('\\b'+c +'\\b','g' ).test(n.c lassName); };each(DOM .select('t extarea'), function(v ){if(s.edi tor_desele ctor&&hasC lass(v,s.e ditor_dese lector))re turn;if(!s .editor_se lector||ha sClass(v,s .editor_se lector))ne w tinymce. Editor(v.i d=(v.id||v .name||(v. id=DOM.uni queId())), s).render( 1);});brea k;}if(s.on init){l=co =0;each(t. editors,fu nction(ed) {co++;if(! ed.initial ized){ed.o nInit.add( function() {l++;if(l= =co)execCa llback(s,' oninit');} );}else l+ +;if(l==co )execCallb ack(s,'oni nit');});} });},get:f unction(id ){return t his.editor s[id];},ge tInstanceB yId:functi on(id){ret urn this.g et(id);},a dd:functio n(e){this. editors[e. id]=e;this ._setActiv e(e);retur n e;},remo ve:functio n(e){var t =this;if(! t.editors[ e.id])retu rn null;de lete t.edi tors[e.id] ;if(t.acti veEditor== e){each(t. editors,fu nction(e){ t._setActi ve(e);retu rn false;} );}e._dest roy();retu rn e;},exe cCommand:f unction(c, u,v){var t =this,ed=t .get(v);sw itch(c){ca se"mceFocu s":ed.focu s();return  true;case "mceAddEdi tor":case" mceAddCont rol":new t inymce.Edi tor(v,t.se ttings).re nder();ret urn true;c ase"mceAdd FrameContr ol":return  true;case "mceRemove Editor":ca se"mceRemo veControl" :ed.remove ();return  true;case' mceToggleE ditor':if( !ed){t.exe cCommand(' mceAddCont rol',0,v); return tru e;}if(ed.i sHidden()) ed.show(); else ed.hi de();retur n true;}if (t.activeE ditor)retu rn t.activ eEditor.ex ecCommand( c,u,v);ret urn false; },execInst anceComman d:function (id,c,u,v) {var ed=th is.get(id) ;if(ed)ret urn ed.exe cCommand(c ,u,v);retu rn false;} ,triggerSa ve:functio n(){each(t his.editor s,function (e){e.save ();});},ad dI18n:func tion(p,o){ var lo,i18 n=this.i18 n;if(!tiny mce.is(p,' string')){ each(p,fun ction(o,lc ){each(o,f unction(o, g){each(o, function(o ,k){if(g== ='common') i18n[lc+'. '+k]=o;els e i18n[lc+ '.'+g+'.'+ k]=o;});}) ;});}else{ each(o,fun ction(o,k) {i18n[p+'. '+k]=o;}); }},_setAct ive:functi on(e){this .selectedI nstance=th is.activeE ditor=e;}} );tinymce. documentBa seURL=wind ow.locatio n.href.rep lace(/[\?# ].*$/,''). replace(/[ \/\\][^\/] +$/,'');if (!/[\/\\]$ /.test(tin ymce.docum entBaseURL ))tinymce. documentBa seURL+='/' ;tinymce.b aseURL=new  tinymce.u til.URI(ti nymce.docu mentBaseUR L).toAbsol ute(tinymc e.baseURL) ;tinymce.E ditorManag er.baseURI =new tinym ce.util.UR I(tinymce. baseURL);i f(tinymce. EditorMana ger.baseUR I.host!=wi ndow.locat ion.hostna me&&window .location. hostname)d ocument.do main=tinym ce.relaxed Domain=win dow.locati on.hostnam e.replace( /.*\.(.+\. .+)$/,'$1' );})();var  tinyMCE=w indow.tiny MCE=tinymc e.EditorMa nager;(fun ction(){va r DOM=tiny mce.DOM,Ev ent=tinymc e.dom.Even t,extend=t inymce.ext end,Dispat cher=tinym ce.util.Di spatcher;v ar each=ti nymce.each ,isGecko=t inymce.isG ecko,isIE= tinymce.is IE,isWebKi t=tinymce. isWebKit;v ar is=tiny mce.is,The meManager= tinymce.Th emeManager ,PluginMan ager=tinym ce.PluginM anager,Edi torManager =tinymce.E ditorManag er;var inA rray=tinym ce.inArray ,grep=tiny mce.grep,e xplode=tin ymce.explo de;tinymce .create('t inymce.Edi tor',{Edit or:functio n(id,s){va r t=this;t .id=t.edit orId=id;t. execComman ds={};t.qu eryStateCo mmands={}; t.queryVal ueCommands ={};t.plug ins={};eac h(['onPreI nit','onBe foreRender UI','onPos tRender',' onInit','o nRemove',' onActivate ','onDeact ivate','on Click','on Event','on MouseUp',' onMouseDow n','onDblC lick','onK eyDown','o nKeyUp','o nKeyPress' ,'onContex tMenu','on Submit','o nReset','o nPaste','o nPreProces s','onPost Process',' onBeforeSe tContent', 'onBeforeG etContent' ,'onSetCon tent','onG etContent' ,'onLoadCo ntent','on SaveConten t','onNode Change','o nChange',' onBeforeEx ecCommand' ,'onExecCo mmand','on Undo','onR edo','onVi sualAid',' onSetProgr essState'] ,function( e){t[e]=ne w Dispatch er(t);});t .settings= s=extend({ id:id,lang uage:'en', docs_langu age:'en',t heme:'simp le',skin:' default',d elta_width :0,delta_h eight:0,po pup_css:'' ,plugins:' ',document _base_url: tinymce.do cumentBase URL,add_fo rm_submit_ trigger:1, submit_pat ch:1,add_u nload_trig ger:1,conv ert_urls:1 ,relative_ urls:1,rem ove_script _host:1,ta ble_inline _editing:0 ,object_re sizing:1,c leanup:1,a ccessibili ty_focus:1 ,custom_sh ortcuts:1, custom_und o_redo_key board_shor tcuts:1,cu stom_undo_ redo_resto re_selecti on:1,custo m_undo_red o:1,doctyp e:'<!DOCTY PE HTML PU BLIC "-//W 3C//DTD HT ML 4.01 Tr ansitional //EN">',vi sual_table _class:'mc eItemTable ',visual:1 ,inline_st yles:true, convert_fo nts_to_spa ns:true,fo nt_size_st yle_values :'xx-small ,x-small,s mall,mediu m,large,x- large,xx-l arge',appl y_source_f ormatting: 1,directio nality:'lt r',forced_ root_block :'p',valid _elements: '@[id|clas s|style|ti tle|dir<lt r?rtl|lang |xml::lang |onclick|o ndblclick| onmousedow n|onmouseu p|onmouseo ver|onmous emove|onmo useout|onk eypress|on keydown|on keyup],a[r el|rev|cha rset|hrefl ang|tabind ex|accessk ey|type|na me|href|ta rget|title |class|onf ocus|onblu r],strong/ b,em/i,str ike,u,#p[a lign],-ol[ type|compa ct],-ul[ty pe|compact ],-li,br,i mg[longdes c|usemap|s rc|border| alt=|title |hspace|vs pace|width |height|al ign],-sub, -sup,-bloc kquote,-ta ble[border =0|cellspa cing|cellp adding|wid th|frame|r ules|heigh t|align|su mmary|bgco lor|backgr ound|borde rcolor],-t r[rowspan| width|heig ht|align|v align|bgco lor|backgr ound|borde rcolor],tb ody,thead, tfoot,#td[ colspan|ro wspan|widt h|height|a lign|valig n|bgcolor| background |bordercol or|scope], #th[colspa n|rowspan| width|heig ht|align|v align|scop e],caption ,-div,-spa n,-pre,add ress,-h1,- h2,-h3,-h4 ,-h5,-h6,h r[size|nos hade],-fon t[face|siz e|color],d d,dl,dt,ci te,abbr,ac ronym,del[ datetime|c ite],ins[d atetime|ci te],object [classid|w idth|heigh t|codebase |*],param[ name|value |_value],e mbed[type| width|heig ht|src|*], script[src |type],map [name],are a[shape|co ords|href| alt|target ]',hidden_ input:1,pa dd_empty_e ditor:1,re nder_ui:1, init_theme :1,force_p _newlines: 1,indentat ion:'30px' },s);t.doc umentBaseU RI=new tin ymce.util. URI(s.docu ment_base_ url||tinym ce.documen tBaseURL,{ base_uri:t inyMCE.bas eURI});t.b aseURI=Edi torManager .baseURI;t .execCallb ack('setup ',t);},ren der:functi on(nst){va r t=this,s =t.setting s,id=t.id, sl=tinymce .ScriptLoa der;if(!Ev ent.domLoa ded){Event .add(docum ent,'init' ,function( ){t.render ();});retu rn;}if(!ns t){s.stric t_loading_ mode=1;tin yMCE.setti ngs=s;}if( !t.getElem ent())retu rn;if(s.st rict_loadi ng_mode){s l.settings .strict_mo de=s.stric t_loading_ mode;tinym ce.DOM.set tings.stri ct=1;}if(! /TEXTAREA| INPUT/i.te st(t.getEl ement().no deName)&&s .hidden_in put&&DOM.g etParent(i d,'form')) DOM.insert After(DOM. create('in put',{type :'hidden', name:id}), id);t.wind owManager= new tinymc e.WindowMa nager(t);i f(s.encodi ng=='xml') {t.onGetCo ntent.add( function(e d,o){if(o. get)o.cont ent=DOM.en code(o.con tent);});} if(s.add_f orm_submit _trigger){ t.onSubmit .addToTop( function() {if(t.init ialized){t .save();t. isNotDirty =1;}});}if (s.add_unl oad_trigge r){Event.a dd(documen t,'beforeu nload',fun ction(){if (t.initial ized&&!t.d estroyed)t .save({for mat:'raw', no_events: true});}); }tinymce.a ddUnload(t ._destroy, t);if(s.su bmit_patch ){t.onBefo reRenderUI .add(funct ion(){var  n=t.getEle ment().for m;if(!n)re turn;if(n. _mceOldSub mit)return ;if(!n.sub mit.nodeTy pe&&!n.sub mit.length ){t.formEl ement=n;n. _mceOldSub mit=n.subm it;n.submi t=function (){EditorM anager.tri ggerSave() ;t.isNotDi rty=1;retu rn this._m ceOldSubmi t(this);}; }n=null;}) ;}function  loadScrip ts(){if(s. language)s l.add(tiny mce.baseUR L+'/langs/ '+s.langua ge+'.js'); if(s.theme .charAt(0) !='-'&&!Th emeManager .urls[s.th eme])Theme Manager.lo ad(s.theme ,'themes/' +s.theme+' /editor_te mplate'+ti nymce.suff ix+'.js'); each(explo de(s.plugi ns),functi on(p){if(p &&p.charAt (0)!='-'&& !PluginMan ager.urls[ p]){if(!is WebKit&&p= ='safari') return;Plu ginManager .load(p,'p lugins/'+p +'/editor_ plugin'+ti nymce.suff ix+'.js'); }});sl.loa dQueue(fun ction(){if (s.ask){fu nction ask (){t.windo wManager.c onfirm(t.g etLang('ed it_confirm '),functio n(s){if(s) t.init();e lse Event. remove(t.i d,'focus', ask);});}; Event.add( t.id,'focu s',ask);re turn;}if(! t.removed) t.init();} );};if(s.p lugins.ind exOf('comp at2x')!=-1 ){PluginMa nager.load ('compat2x ','plugins /compat2x/ editor_plu gin'+tinym ce.suffix+ '.js');sl. loadQueue( loadScript s);}else l oadScripts ();},init: function() {var n,t=t his,s=t.se ttings,w,h ,e=t.getEl ement(),o, ti,u,bi,bc ,re;Editor Manager.ad d(t);s.the me=s.theme .replace(/ -/,'');o=T hemeManage r.get(s.th eme);t.the me=new o() ;if(t.them e.init&&s. init_theme )t.theme.i nit(t,Them eManager.u rls[s.them e]||tinymc e.document BaseURL.re place(/\/$ /,''));eac h(explode( s.plugins. replace(/\ -/g,'')),f unction(p) {var c=Plu ginManager .get(p),u= PluginMana ger.urls[p ]||tinymce .documentB aseURL.rep lace(/\/$/ ,''),po;if (c){po=new  c(t,u);t. plugins[p] =po;if(po. init)po.in it(t,u);}} );if(s.pop up_css)s.p opup_css=t .documentB aseURI.toA bsolute(s. popup_css) ;else s.po pup_css=t. baseURI.to Absolute(" themes/"+s .theme+"/s kins/"+s.s kin+"/dial og.css");i f(s.popup_ css_add)s. popup_css+ =','+t.doc umentBaseU RI.toAbsol ute(s.popu p_css_add) ;t.control Manager=ne w tinymce. ControlMan ager(t);t. undoManage r=new tiny mce.UndoMa nager(t);t .undoManag er.onAdd.a dd(functio n(um,l){re turn t.onC hange.disp atch(t,l,u m);});t.un doManager. onUndo.add (function( um,l){retu rn t.onUnd o.dispatch (t,l,um);} );t.undoMa nager.onRe do.add(fun ction(um,l ){return t .onRedo.di spatch(t,l ,um);});if (s.custom_ undo_redo) {t.onExecC ommand.add (function( ed,cmd,ui, val,a){if( cmd!='Undo '&&cmd!='R edo'&&cmd! ='mceRepai nt'&&(!a|| !a.skip_un do))t.undo Manager.ad d();});}t. onExecComm and.add(fu nction(ed, c){if(!/^( FontName|F ontSize)$/ .test(c))t .nodeChang ed();});if (isGecko){ function r epaint(a,o ){if(!o||! o.initial) t.execComm and('mceRe paint');}; t.onUndo.a dd(repaint );t.onRedo .add(repai nt);t.onSe tContent.a dd(repaint );}t.onBef oreRenderU I.dispatch (t,t.contr olManager) ;if(s.rend er_ui){w=s .width||e. style.widt h||e.clien tWidth;h=s .height||e .style.hei ght||e.cli entHeight; t.orgDispl ay=e.style .display;r e=/^[0-9\. ]+(|px)$/i ;if(re.tes t(''+w))w= Math.max(p arseInt(w) +(o.deltaW idth||0),1 00);if(re. test(''+h) )h=Math.ma x(parseInt (h)+(o.del taHeight|| 0),100);o= t.theme.re nderUI({ta rgetNode:e ,width:w,h eight:h,de ltaWidth:s .delta_wid th,deltaHe ight:s.del ta_height} );t.editor Container= o.editorCo ntainer;}D OM.setStyl es(o.sizeC ontainer|| o.editorCo ntainer,{w idth:w,hei ght:h});h= (o.iframeH eight||h)+ ((h+'').in dexOf('%') ==-1?(o.de ltaHeight| |0):'');if (h<100)h=1 00;t.ifram eHTML=s.do ctype+'<ht ml><head x mlns="http ://www.w3. org/1999/x html"><bas e href="'+ t.document BaseURI.ge tURI()+'"> </base>';t .iframeHTM L+='<meta  http-equiv ="Content- Type" cont ent="text/ html; char set=UTF-8"  />';if(ti nymce.rela xedDomain) t.iframeHT ML+='<scri pt type="t ext/javasc ript">docu ment.domai n = "'+tin ymce.relax edDomain+' ";</script >';bi=s.bo dy_id||'ti nymce';if( bi.indexOf ('=')!=-1) {bi=t.getP aram('body _id','','h ash');bi=b i[t.id]||b i;}bc=s.bo dy_class|| '';if(bc.i ndexOf('=' )!=-1){bc= t.getParam ('body_cla ss','','ha sh');bc=bc [t.id]||'' ;}t.iframe HTML+='</h ead><body  id="'+bi+' " class="m ceContentB ody '+bc+' "></body>< /html>';if (tinymce.r elaxedDoma in){if(isI E)u='javas cript:(fun ction(){do cument.ope n();docume nt.domain= "'+documen t.domain+' ";var ed =  window.pa rent.tinyM CE.get("'+ t.id+'");d ocument.wr ite(ed.ifr ameHTML);d ocument.cl ose();ed.s etupIframe ();})()';e lse if(tin ymce.isOpe ra)u='java script:(fu nction(){d ocument.op en();docum ent.domain ="'+docume nt.domain+ '";documen t.close(); ed.setupIf rame();})( )';}n=DOM. add(o.ifra meContaine r,'iframe' ,{id:t.id+ "_ifr",src :u||'javas cript:""', frameBorde r:'0',styl e:{width:' 100%',heig ht:h}});t. contentAre aContainer =o.iframeC ontainer;D OM.get(o.e ditorConta iner).styl e.display= t.orgDispl ay;DOM.get (t.id).sty le.display ='none';if (tinymce.i sOldWebKit ){Event.ad d(n,'load' ,t.setupIf rame,t);n. src=tinymc e.baseURL+ '/plugins/ safari/bla nk.htm';}e lse{if(!is IE||!tinym ce.relaxed Domain)t.s etupIframe ();e=n=o=n ull;}},set upIframe:f unction(){ var t=this ,s=t.setti ngs,e=DOM. get(t.id), d=t.getDoc (),h;if(!i sIE||!tiny mce.relaxe dDomain){d .open();d. write(t.if rameHTML); d.close(); }if(!isIE) {try{d.des ignMode='O n';}catch( ex){}}if(i sIE)t.getB ody().cont entEditabl e=true;t.d om=new tin ymce.DOM.D OMUtils(t. getDoc(),{ keep_value s:true,url _converter :t.convert URL,url_co nverter_sc ope:t,hex_ colors:s.f orce_hex_s tyle_color s,class_fi lter:s.cla ss_filter, update_sty les:1,fix_ ie_paragra phs:1});t. serializer =new tinym ce.dom.Ser ializer({e ntity_enco ding:s.ent ity_encodi ng,entitie s:s.entiti es,valid_e lements:s. verify_htm l===false? '*[*]':s.v alid_eleme nts,extend ed_valid_e lements:s. extended_v alid_eleme nts,valid_ child_elem ents:s.val id_child_e lements,in valid_elem ents:s.inv alid_eleme nts,fix_ta ble_elemen ts:s.fix_t able_eleme nts,fix_li st_element s:s.fix_li st_element s,fix_cont ent_duplic ation:s.fi x_content_ duplicatio n,convert_ fonts_to_s pans:s.con vert_fonts _to_spans, font_size_ classes:s. font_size_ classes,fo nt_size_st yle_values :s.font_si ze_style_v alues,appl y_source_f ormatting: s.apply_so urce_forma tting,remo ve_linebre aks:s.remo ve_linebre aks,dom:t. dom});t.se lection=ne w tinymce. dom.Select ion(t.dom, t.getWin() ,t.seriali zer);t.for ceBlocks=n ew tinymce .ForceBloc ks(t,{forc ed_root_bl ock:s.forc ed_root_bl ock});t.ed itorComman ds=new tin ymce.Edito rCommands( t);t.seria lizer.onPr eProcess.a dd(functio n(se,o){re turn t.onP reProcess. dispatch(t ,o,se);}); t.serializ er.onPostP rocess.add (function( se,o){retu rn t.onPos tProcess.d ispatch(t, o,se);});t .onPreInit .dispatch( t);if(!s.g ecko_spell check)t.ge tBody().sp ellcheck=0 ;t._addEve nts();t.co ntrolManag er.onPostR ender.disp atch(t,t.c ontrolMana ger);t.onP ostRender. dispatch(t );if(s.dir ectionalit y)t.getBod y().dir=s. directiona lity;if(s. nowrap)t.g etBody().s tyle.white Space="now rap";if(s. auto_resiz e)t.onNode Change.add (t.resizeT oContent,t );if(s.cus tom_elemen ts){functi on handleC ustom(ed,o ){each(exp lode(s.cus tom_elemen ts),functi on(v){var  n;if(v.ind exOf('~')= ==0){v=v.s ubstring(1 );n='span' ;}else n=' div';o.con tent=o.con tent.repla ce(new Reg Exp('<('+v +')([^>]*) >','g'),'< '+n+' mce_ name="$1"$ 2>');o.con tent=o.con tent.repla ce(new Reg Exp('</('+ v+')>','g' ),'</'+n+' >');});};t .onBeforeS etContent. add(handle Custom);t. onPostProc ess.add(fu nction(ed, o){if(o.se t)handleCu stom(ed,o) });}if(s.h andle_node _change_ca llback){t. onNodeChan ge.add(fun ction(ed,c m,n){t.exe cCallback( 'handle_no de_change_ callback', t.id,n,-1, -1,true,t. selection. isCollapse d());});}i f(s.save_c allback){t .onSaveCon tent.add(f unction(ed ,o){var h= t.execCall back('save _callback' ,t.id,o.co ntent,t.ge tBody());i f(h)o.cont ent=h;});} if(s.oncha nge_callba ck){t.onCh ange.add(f unction(ed ,l){t.exec Callback(' onchange_c allback',t ,l);});}if (s.convert _newlines_ to_brs){t. onBeforeSe tContent.a dd(functio n(ed,o){if (o.initial )o.content =o.content .replace(/ \r?\n/g,'< br />');}) ;}if(s.fix _nesting&& isIE){t.on BeforeSetC ontent.add (function( ed,o){o.co ntent=t._f ixNesting( o.content) ;});}if(s. preformatt ed){t.onPo stProcess. add(functi on(ed,o){o .content=o .content.r eplace(/^\ s*<pre.*?> /,'');o.co ntent=o.co ntent.repl ace(/<\/pr e>\s*$/,'' );if(o.set )o.content ='<pre cla ss="mceIte mHidden">' +o.content +'</pre>'; });}if(s.v erify_css_ classes){t .serialize r.attribVa lueFilter= function(n ,v){var s, cl;if(n==' class'){if (!t.classe sRE){cl=t. dom.getCla sses();if( cl.length> 0){s='';ea ch(cl,func tion(o){s+ =(s?'|':'' )+o['class '];});t.cl assesRE=ne w RegExp(' ('+s+')',' gi');}}ret urn!t.clas sesRE||/(\ bmceItem\w +\b|\bmceT emp\w+\b)/ g.test(v)| |t.classes RE.test(v) ?v:'';}ret urn v;};}i f(s.conver t_fonts_to _spans)t._ convertFon ts();if(s. inline_sty les)t._con vertInline Elements() ;if(s.clea nup_callba ck){t.onBe foreSetCon tent.add(f unction(ed ,o){o.cont ent=t.exec Callback(' cleanup_ca llback','i nsert_to_e ditor',o.c ontent,o); });t.onPre Process.ad d(function (ed,o){if( o.set)t.ex ecCallback ('cleanup_ callback', 'insert_to _editor_do m',o.node, o);if(o.ge t)t.execCa llback('cl eanup_call back','get _from_edit or_dom',o. node,o);}) ;t.onPostP rocess.add (function( ed,o){if(o .set)o.con tent=t.exe cCallback( 'cleanup_c allback',' insert_to_ editor',o. content,o) ;if(o.get) o.content= t.execCall back('clea nup_callba ck','get_f rom_editor ',o.conten t,o);});}i f(s.save_c allback){t .onGetCont ent.add(fu nction(ed, o){if(o.sa ve)o.conte nt=t.execC allback('s ave_callba ck',t.id,o .content,t .getBody() );});}if(s .handle_ev ent_callba ck){t.onEv ent.add(fu nction(ed, e,o){if(t. execCallba ck('handle _event_cal lback',e,e d,o)===fal se)Event.c ancel(e);} );}t.onSet Content.ad d(function (){t.addVi sual(t.get Body());}) ;if(s.padd _empty_edi tor){t.onP ostProcess .add(funct ion(ed,o){ o.content= o.content. replace(/^ <p>(&nbsp; |#160;|\s) <\/p>$/,'' );});}if(i sGecko){tr y{d.design Mode='Off' ;d.designM ode='On';} catch(ex){ }}setTimeo ut(functio n(){if(t.r emoved)ret urn;t.load ({initial: true,forma t:(s.clean up_on_star tup?'html' :'raw')}); t.startCon tent=t.get Content({f ormat:'raw '});t.undo Manager.ad d({initial :true});t. initialize d=true;t.o nInit.disp atch(t);t. execCallba ck('setupc ontent_cal lback',t.i d,t.getBod y(),t.getD oc());t.ex ecCallback ('init_ins tance_call back',t);t .focus(tru e);t.nodeC hanged({in itial:1}); if(s.conte nt_css){ti nymce.each (explode(s .content_c ss),functi on(u){t.do m.loadCSS( t.document BaseURI.to Absolute(u ));});}if( s.auto_foc us){setTim eout(funct ion(){var  ed=EditorM anager.get (s.auto_fo cus);ed.se lection.se lect(ed.ge tBody(),1) ;ed.select ion.collap se(1);ed.g etWin().fo cus();},10 0);}},1);e =null;},fo cus:functi on(sf){var  oed,t=thi s;if(!sf){ t.getWin() .focus();} if(EditorM anager.act iveEditor! =t){if((oe d=EditorMa nager.acti veEditor)! =null)oed. onDeactiva te.dispatc h(oed,t);t .onActivat e.dispatch (t,oed);}E ditorManag er._setAct ive(t);},e xecCallbac k:function (n){var t= this,f=t.s ettings[n] ,s;if(!f)r eturn;if(t .callbackL ookup&&(s= t.callback Lookup[n]) ){f=s.func ;s=s.scope ;}if(is(f, 'string')) {s=f.repla ce(/\.\w+$ /,'');s=s? tinymce.re solve(s):0 ;f=tinymce .resolve(f );t.callba ckLookup=t .callbackL ookup||{}; t.callback Lookup[n]= {func:f,sc ope:s};}re turn f.app ly(s||t,Ar ray.protot ype.slice. call(argum ents,1));} ,translate :function( s){var c=t his.settin gs.languag e,i18n=Edi torManager .i18n;if(! s)return'' ;return i1 8n[c+'.'+s ]||s.repla ce(/{\#([^ }]+)\}/g,f unction(a, b){return  i18n[c+'.' +b]||'{#'+ b+'}';});} ,getLang:f unction(n, dv){return  EditorMan ager.i18n[ this.setti ngs.langua ge+'.'+n]| |(is(dv)?d v:'{#'+n+' }');},getP aram:funct ion(n,dv,t y){var tr= tinymce.tr im,v=is(th is.setting s[n])?this .settings[ n]:dv,o;if (ty==='has h'){o={};i f(is(v,'st ring')){ea ch(v.split (/[;,]/),f unction(v) {v=v.split ('=');if(v .length>1) o[tr(v[0]) ]=tr(v[1]) ;else o[tr (v[0])]=tr (v);});}el se o=v;ret urn o;}ret urn v;},no deChanged: function(o ){var t=th is,s=t.sel ection,n=s .getNode() ||t.getBod y();if(t.i nitialized ){t.onNode Change.dis patch(t,o? o.controlM anager||t. controlMan ager:t.con trolManage r,isIE&&n. ownerDocum ent!=t.get Doc()?t.ge tBody():n, s.isCollap sed(),o);} },addButto n:function (n,s){var  t=this;t.b uttons=t.b uttons||{} ;t.buttons [n]=s;},ad dCommand:f unction(n, f,s){this. execComman ds[n]={fun c:f,scope: s||this};} ,addQueryS tateHandle r:function (n,f,s){th is.querySt ateCommand s[n]={func :f,scope:s ||this};}, addQueryVa lueHandler :function( n,f,s){thi s.queryVal ueCommands [n]={func: f,scope:s| |this};},a ddShortcut :function( pa,desc,cm d_func,sc) {var t=thi s,c;if(!t. settings.c ustom_shor tcuts)retu rn false;t .shortcuts =t.shortcu ts||{};if( is(cmd_fun c,'string' )){c=cmd_f unc;cmd_fu nc=functio n(){t.exec Command(c, false,null );};}if(is (cmd_func, 'object')) {c=cmd_fun c;cmd_func =function( ){t.execCo mmand(c[0] ,c[1],c[2] );};}each( explode(pa ),function (pa){var o ={func:cmd _func,scop e:sc||this ,desc:desc ,alt:false ,ctrl:fals e,shift:fa lse};each( explode(pa ,'+'),func tion(v){sw itch(v){ca se'alt':ca se'ctrl':c ase'shift' :o[v]=true ;break;def ault:o.cha rCode=v.ch arCodeAt(0 );o.keyCod e=v.toUppe rCase().ch arCodeAt(0 );}});t.sh ortcuts[(o .ctrl?'ctr l':'')+',' +(o.alt?'a lt':'')+', '+(o.shift ?'shift':' ')+','+o.k eyCode]=o; });return  true;},exe cCommand:f unction(cm d,ui,val,a ){var t=th is,s=0,o;i f(!/^(mceA ddUndoLeve l|mceEndUn doLevel|mc eBeginUndo Level|mceR epaint|Sel ectAll)$/. test(cmd)& &(!a||!a.s kip_focus) )t.focus() ;o={};t.on BeforeExec Command.di spatch(t,c md,ui,val, o);if(o.te rminate)re turn false ;if(t.exec Callback(' execcomman d_callback ',t.id,t.s election.g etNode(),c md,ui,val) ){t.onExec Command.di spatch(t,c md,ui,val, a);return  true;}if(o =t.execCom mands[cmd] ){s=o.func .call(o.sc ope,ui,val );t.onExec Command.di spatch(t,c md,ui,val, a);return  s;}each(t. plugins,fu nction(p){ if(p.execC ommand&&p. execComman d(cmd,ui,v al)){t.onE xecCommand .dispatch( t,cmd,ui,v al,a);s=1; return fal se;}});if( s)return t rue;if(t.t heme.execC ommand&&t. theme.exec Command(cm d,ui,val)) {t.onExecC ommand.dis patch(t,cm d,ui,val,a );return t rue;}if(t. editorComm ands.execC ommand(cmd ,ui,val)){ t.onExecCo mmand.disp atch(t,cmd ,ui,val,a) ;return tr ue;}t.getD oc().execC ommand(cmd ,ui,val);t .onExecCom mand.dispa tch(t,cmd, ui,val,a); },queryCom mandState: function(c ){var t=th is,o;if(t. _isHidden( ))return;i f(o=t.quer yStateComm ands[c])re turn o.fun c.call(o.s cope);o=t. editorComm ands.query CommandSta te(c);if(o !==-1)retu rn o;try{r eturn this .getDoc(). queryComma ndState(c) ;}catch(ex ){}},query CommandVal ue:functio n(c){var t =this,o;if (t._isHidd en())retur n;if(o=t.q ueryValueC ommands[c] )return o. func.call( o.scope);o =t.editorC ommands.qu eryCommand Value(c);i f(is(o))re turn o;try {return th is.getDoc( ).queryCom mandValue( c);}catch( ex){}},sho w:function (){var t=t his;DOM.sh ow(t.getCo ntainer()) ;DOM.hide( t.id);t.lo ad();},hid e:function (){var t=t his,d=t.ge tDoc();if( isIE&&d)d. execComman d('SelectA ll');t.sav e();DOM.hi de(t.getCo ntainer()) ;DOM.setSt yle(t.id,' display',t .orgDispla y);},isHid den:functi on(){retur n!DOM.isHi dden(this. id);},setP rogressSta te:functio n(b,ti,o){ this.onSet ProgressSt ate.dispat ch(this,b, ti,o);retu rn b;},rem ove:functi on(){var t =this;t.re moved=1;t. hide();DOM .remove(t. getContain er());t.ex ecCallback ('remove_i nstance_ca llback',t) ;t.onRemov e.dispatch (t);t.onEx ecCommand. listeners= [];EditorM anager.rem ove(t);},r esizeToCon tent:funct ion(){var  t=this;DOM .setStyle( t.id+"_ifr ",'height' ,t.getBody ().scrollH eight);},l oad:functi on(o){var  t=this,e=t .getElemen t(),h;o=o| |{};o.load =true;h=t. setContent (is(e.valu e)?e.value :e.innerHT ML,o);o.el ement=e;if (!o.no_eve nts)t.onLo adContent. dispatch(t ,o);o.elem ent=e=null ;return h; },save:fun ction(o){v ar t=this, e=t.getEle ment(),h,f ;if(!t.ini tialized)r eturn;o=o| |{};o.save =true;o.el ement=e;h= o.content= t.getConte nt(o);if(! o.no_event s)t.onSave Content.di spatch(t,o );h=o.cont ent;if(!/T EXTAREA|IN PUT/i.test (e.nodeNam e)){e.inne rHTML=h;if (f=DOM.get Parent(t.i d,'form')) {each(f.el ements,fun ction(e){i f(e.name== t.id){e.va lue=h;retu rn false;} });}}else  e.value=h; o.element= e=null;ret urn h;},se tContent:f unction(h, o){var t=t his;o=o||{ };o.format =o.format| |'html';o. set=true;o .content=h ;if(!o.no_ events)t.o nBeforeSet Content.di spatch(t,o );if(!tiny mce.isIE&& (h.length= ==0||/^\s+ $/.test(h) )){o.conte nt=t.dom.s etHTML(t.g etBody(),' <br mce_bo gus="1" /> ',1);o.for mat='raw'; }o.content =t.dom.set HTML(t.get Body(),tin ymce.trim( o.content) );if(o.for mat!='raw' &&t.settin gs.cleanup ){o.getInn er=true;o. content=t. dom.setHTM L(t.getBod y(),t.seri alizer.ser ialize(t.g etBody(),o ));}if(!o. no_events) t.onSetCon tent.dispa tch(t,o);r eturn o.co ntent;},ge tContent:f unction(o) {var t=thi s,h;o=o||{ };o.format =o.format| |'html';o. get=true;i f(!o.no_ev ents)t.onB eforeGetCo ntent.disp atch(t,o); if(o.forma t!='raw'&& t.settings .cleanup){ o.getInner =true;h=t. serializer .serialize (t.getBody (),o);}els e h=t.getB ody().inne rHTML;h=h. replace(/^ \s*|\s*$/g ,'');o={co ntent:h};t .onGetCont ent.dispat ch(t,o);re turn o.con tent;},isD irty:funct ion(){var  t=this;ret urn tinymc e.trim(t.s tartConten t)!=tinymc e.trim(t.g etContent( {format:'r aw',no_eve nts:1}))&& !t.isNotDi rty;},getC ontainer:f unction(){ var t=this ;if(!t.con tainer)t.c ontainer=D OM.get(t.e ditorConta iner||t.id +'_parent' );return t .container ;},getCont entAreaCon tainer:fun ction(){re turn this. contentAre aContainer ;},getElem ent:functi on(){retur n DOM.get( this.setti ngs.conten t_element| |this.id); },getWin:f unction(){ var t=this ,e;if(!t.c ontentWind ow){e=DOM. get(t.id+" _ifr");if( e)t.conten tWindow=e. contentWin dow;}retur n t.conten tWindow;}, getDoc:fun ction(){va r t=this,w ;if(!t.con tentDocume nt){w=t.ge tWin();if( w)t.conten tDocument= w.document ;}return t .contentDo cument;},g etBody:fun ction(){re turn this. bodyElemen t||this.ge tDoc().bod y;},conver tURL:funct ion(u,n,e) {var t=thi s,s=t.sett ings;if(s. urlconvert er_callbac k)return t .execCallb ack('urlco nverter_ca llback',u, e,true,n); if(!s.conv ert_urls|| (e&&e.node Name=='LIN K')||u.ind exOf('file :')===0)re turn u;if( s.relative _urls)retu rn t.docum entBaseURI .toRelativ e(u);u=t.d ocumentBas eURI.toAbs olute(u,s. remove_scr ipt_host); return u;} ,addVisual :function( e){var t=t his,s=t.se ttings;e=e ||t.getBod y();if(!is (t.hasVisu al))t.hasV isual=s.vi sual;each( t.dom.sele ct('table, a',e),func tion(e){va r v;switch (e.nodeNam e){case'TA BLE':v=t.d om.getAttr ib(e,'bord er');if(!v ||v=='0'){ if(t.hasVi sual)t.dom .addClass( e,s.visual _table_cla ss);else t .dom.remov eClass(e,s .visual_ta ble_class) ;}return;c ase'A':v=t .dom.getAt trib(e,'na me');if(v) {if(t.hasV isual)t.do m.addClass (e,'mceIte mAnchor'); else t.dom .removeCla ss(e,'mceI temAnchor' );}return; }});t.onVi sualAid.di spatch(t,e ,t.hasVisu al);},_add Events:fun ction(){va r t=this,i ,s=t.setti ngs,lo={mo useup:'onM ouseUp',mo usedown:'o nMouseDown ',click:'o nClick',ke yup:'onKey Up',keydow n:'onKeyDo wn',keypre ss:'onKeyP ress',subm it:'onSubm it',reset: 'onReset', contextmen u:'onConte xtMenu',db lclick:'on DblClick', paste:'onP aste'};fun ction even tHandler(e ,o){var ty =e.type;if (t.removed )return;if (t.onEvent .dispatch( t,e,o)!==f alse){t[lo [e.fakeTyp e||e.type] ].dispatch (t,e,o);}} ;each(lo,f unction(v, k){switch( k){case'co ntextmenu' :if(tinymc e.isOpera) {Event.add (t.getDoc( ),'mousedo wn',functi on(e){if(e .ctrlKey){ e.fakeType ='contextm enu';event Handler(e) ;}});}else  Event.add (t.getDoc( ),k,eventH andler);br eak;case'p aste':Even t.add(t.ge tBody(),k, function(e ){var tx,h ,el,r;if(e .clipboard Data)tx=e. clipboardD ata.getDat a('text/pl ain');else  if(tinymc e.isIE)tx= t.getWin() .clipboard Data.getDa ta('Text') ;eventHand ler(e,{tex t:tx,html: h});});bre ak;case'su bmit':case 'reset':Ev ent.add(t. getElement ().form||D OM.getPare nt(t.id,'f orm'),k,ev entHandler );break;de fault:Even t.add(s.co ntent_edit able?t.get Body():t.g etDoc(),k, eventHandl er);}});Ev ent.add(s. content_ed itable?t.g etBody():( isGecko?t. getDoc():t .getWin()) ,'focus',f unction(e) {t.focus(t rue);});if (tinymce.i sGecko){Ev ent.add(t. getDoc(),' DOMNodeIns erted',fun ction(e){v ar v;e=e.t arget;if(e .nodeType= ==1&&e.nod eName==='I MG'&&(v=e. getAttribu te('mce_sr c')))e.src =t.documen tBaseURI.t oAbsolute( v);});}if( isGecko){f unction se tOpts(){va r t=this,d =t.getDoc( ),s=t.sett ings;if(is Gecko){if( t._isHidde n()){try{i f(!s.conte nt_editabl e)d.design Mode='On'; }catch(ex) {}}try{d.e xecCommand ("styleWit hCSS",0,fa lse);}catc h(ex){if(! t._isHidde n())d.exec Command("u seCSS",0,t rue);}if(! s.table_in line_editi ng)try{d.e xecCommand ('enableIn lineTableE diting',fa lse,false) ;}catch(ex ){}if(!s.o bject_resi zing)try{d .execComma nd('enable ObjectResi zing',fals e,false);} catch(ex){ }}};t.onBe foreExecCo mmand.add( setOpts);t .onMouseDo wn.add(set Opts);}t.o nMouseUp.a dd(t.nodeC hanged);t. onClick.ad d(t.nodeCh anged);t.o nKeyUp.add (function( ed,e){if(( e.keyCode> =33&&e.key Code<=36)| |(e.keyCod e>=37&&e.k eyCode<=40 )||e.keyCo de==13||e. keyCode==4 5||e.keyCo de==46||e. keyCode==8 ||e.ctrlKe y)t.nodeCh anged();}) ;t.onReset .add(funct ion(){t.se tContent(t .startCont ent,{forma t:'raw'}); });if(t.ge tParam('ta b_focus')) {function  tabCancel( ed,e){if(e .keyCode== =9)return  Event.canc el(e);};fu nction tab Handler(ed ,e){var x, i,f,el,v;f unction fi nd(d){f=DO M.getParen t(ed.id,'f orm');el=f .elements; if(f){each (el,functi on(e,i){if (e.id==ed. id){x=i;re turn false ;}});if(d> 0){for(i=x +1;i<el.le ngth;i++){ if(el[i].t ype!='hidd en')return  el[i];}}e lse{for(i= x-1;i>=0;i --){if(el[ i].type!=' hidden')re turn el[i] ;}}}return  null;};if (e.keyCode ===9){v=ex plode(ed.g etParam('t ab_focus') );if(v.len gth==1){v[ 1]=v[0];v[ 0]=':prev' ;}if(e.shi ftKey){if( v[0]==':pr ev')el=fin d(-1);else  el=DOM.ge t(v[0]);}e lse{if(v[1 ]==':next' )el=find(1 );else el= DOM.get(v[ 1]);}if(el ){if(ed=Ed itorManage r.get(el.i d||el.name ))ed.focus ();else wi ndow.setTi meout(func tion(){win dow.focus( );el.focus ();},10);r eturn Even t.cancel(e );}}};t.on KeyUp.add( tabCancel) ;if(isGeck o){t.onKey Press.add( tabHandler );t.onKeyD own.add(ta bCancel);} else t.onK eyDown.add (tabHandle r);}if(s.c ustom_shor tcuts){if( s.custom_u ndo_redo_k eyboard_sh ortcuts){t .addShortc ut('ctrl+z ',t.getLan g('undo_de sc'),'Undo ');t.addSh ortcut('ct rl+y',t.ge tLang('red o_desc'),' Redo');}if (isGecko){ t.addShort cut('ctrl+ b',t.getLa ng('bold_d esc'),'Bol d');t.addS hortcut('c trl+i',t.g etLang('it alic_desc' ),'Italic' );t.addSho rtcut('ctr l+u',t.get Lang('unde rline_desc '),'Underl ine');}for (i=1;i<=6; i++)t.addS hortcut('c trl+'+i,'' ,['FormatB lock',fals e,'<h'+i+' >']);t.add Shortcut(' ctrl+7','' ,['FormatB lock',fals e,'<p>']); t.addShort cut('ctrl+ 8','',['Fo rmatBlock' ,false,'<d iv>']);t.a ddShortcut ('ctrl+9', '',['Forma tBlock',fa lse,'<addr ess>']);fu nction fin d(e){var v =null;if(! e.altKey&& !e.ctrlKey &&!e.metaK ey)return  v;each(t.s hortcuts,f unction(o) {if(o.ctrl !=e.ctrlKe y&&(!tinym ce.isMac|| o.ctrl==e. metaKey))r eturn;if(o .alt!=e.al tKey)retur n;if(o.shi ft!=e.shif tKey)retur n;if(e.key Code==o.ke yCode||(e. charCode&& e.charCode ==o.charCo de)){v=o;r eturn fals e;}});retu rn v;};t.o nKeyUp.add (function( ed,e){var  o=find(e); if(o)retur n Event.ca ncel(e);}) ;t.onKeyPr ess.add(fu nction(ed, e){var o=f ind(e);if( o)return E vent.cance l(e);});t. onKeyDown. add(functi on(ed,e){v ar o=find( e);if(o){o .func.call (o.scope); return Eve nt.cancel( e);}});}if (tinymce.i sIE){Event .add(t.get Doc(),'con trolselect ',function (e){var re =t.resizeI nfo,cb;e=e .target;if (re)Event. remove(re. node,re.ev ,re.cb);if (!t.dom.ha sClass(e,' mceItemNoR esize')){e v='resizee nd';cb=Eve nt.add(e,e v,function (e){var v; e=e.target ;if(v=t.do m.getStyle (e,'width' )){t.dom.s etAttrib(e ,'width',v .replace(/ [^0-9%]+/g ,''));t.do m.setStyle (e,'width' ,'');}if(v =t.dom.get Style(e,'h eight')){t .dom.setAt trib(e,'he ight',v.re place(/[^0 -9%]+/g,'' ));t.dom.s etStyle(e, 'height',' ');}});}el se{ev='res izestart'; cb=Event.a dd(e,'resi zestart',E vent.cance l,Event);} re=t.resiz eInfo={nod e:e,ev:ev, cb:cb};}); t.onKeyDow n.add(func tion(ed,e) {switch(e. keyCode){c ase 8:if(t .selection .getRng(). item){t.se lection.ge tRng().ite m(0).remov eNode();re turn Event .cancel(e) ;}}});}if( tinymce.is Opera){t.o nClick.add (function( ed,e){Even t.prevent( e);});}if( s.custom_u ndo_redo){ function a ddUndo(){t .undoManag er.typing= 0;t.undoMa nager.add( );};if(tin ymce.isIE) {Event.add (t.getWin( ),'blur',f unction(e) {var n;if( t.selectio n){n=t.sel ection.get Node();if( !t.removed &&n.ownerD ocument&&n .ownerDocu ment!=t.ge tDoc())add Undo();}}) ;}else{Eve nt.add(t.g etDoc(),'b lur',funct ion(){if(t .selection &&!t.remov ed)addUndo ();});}t.o nMouseDown .add(addUn do);t.onKe yUp.add(fu nction(ed, e){if((e.k eyCode>=33 &&e.keyCod e<=36)||(e .keyCode>= 37&&e.keyC ode<=40)|| e.keyCode= =13||e.key Code==45|| e.ctrlKey) {t.undoMan ager.typin g=0;t.undo Manager.ad d();}});t. onKeyDown. add(functi on(ed,e){i f((e.keyCo de>=33&&e. keyCode<=3 6)||(e.key Code>=37&& e.keyCode< =40)||e.ke yCode==13| |e.keyCode ==45){if(t .undoManag er.typing) {t.undoMan ager.add() ;t.undoMan ager.typin g=0;}retur n;}if(!t.u ndoManager .typing){t .undoManag er.add();t .undoManag er.typing= 1;}});}},_ destroy:fu nction(){v ar t=this; if(t.formE lement){t. formElemen t.submit=t .formEleme nt._mceOld Submit;t.f ormElement ._mceOldSu bmit=null; }t.content AreaContai ner=t.form Element=t. container= t.settings .content_e lement=t.b odyElement =t.content Document=t .contentWi ndow=null; if(t.selec tion)t.sel ection=t.s election.w in=t.selec tion.dom=t .selection .dom.doc=n ull;t.dest royed=1;}, _convertIn lineElemen ts:functio n(){var t= this,s=t.s ettings,do m=t.dom,v, e,na,st,sp ;function  convert(ed ,o){if(!s. inline_sty les)return ;if(o.get) {each(t.do m.select(' table,u,st rike',o.no de),functi on(n){swit ch(n.nodeN ame){case' TABLE':if( v=dom.getA ttrib(n,'h eight')){d om.setStyl e(n,'heigh t',v);dom. setAttrib( n,'height' ,'');}brea k;case'U': case'STRIK E':sp=dom. create('sp an',{style :dom.getAt trib(n,'st yle')});sp .style.tex tDecoratio n=n.nodeNa me=='U'?'u nderline': 'line-thro ugh';dom.s etAttrib(s p,'mce_sty le','');do m.replace( sp,n,1);br eak;}});}e lse if(o.s et){each(t .dom.selec t('table,s pan',o.nod e),functio n(n){if(n. nodeName== 'TABLE'){i f(v=dom.ge tStyle(n,' height'))d om.setAttr ib(n,'heig ht',v.repl ace(/[^0-9 %]+/g,'')) ;}else{if( n.style.te xtDecorati on=='under line')na=' u';else if (n.style.t extDecorat ion=='line -through') na='strike ';else na= '';if(na){ n.style.te xtDecorati on='';dom. setAttrib( n,'mce_sty le','');e= dom.create (na,{style :dom.getAt trib(n,'st yle')});do m.replace( e,n,1);}}} );}};t.onP reProcess. add(conver t);if(!s.c leanup_on_ startup){t .onInit.ad d(function (){convert (t,{node:t .getBody() ,set:1});} );}},_conv ertFonts:f unction(){ var t=this ,s=t.setti ngs,dom=t. dom,sl,cl, fz,fzn,v,i ,st,x,nl,s p,f,n;if(! s.inline_s tyles)retu rn;fz=[8,1 0,12,14,18 ,24,36];fz n=['xx-sma ll','x-sma ll','small ','medium' ,'large',' x-large',' xx-large'] ;if(sl=s.f ont_size_s tyle_value s)sl=explo de(sl);if( cl=s.font_ size_class es)cl=expl ode(cl);fu nction con vertToFont s(no){if(t inymce.isW ebKit||!s. inline_sty les)return ;nl=t.dom. select('sp an',no);fo r(x=nl.len gth-1;x>=0 ;x--){n=nl [x];f=dom. create('fo nt',{color :dom.toHex (dom.getSt yle(n,'col or')),face :dom.getSt yle(n,'fon tFamily'), style:dom. getAttrib( n,'style') });st=f.st yle;if(st. color||st. fontFamily ){st.color =st.fontFa mily='';do m.setAttri b(f,'mce_s tyle',''); }if(sl){i= inArray(sl ,dom.getSt yle(n,'fon tSize'));i f(i!=-1){d om.setAttr ib(f,'size ',''+(i+1| |1));f.sty le.fontSiz e='';}}els e if(cl){i =inArray(c l,dom.getA ttrib(n,'c lass'));v= dom.getSty le(n,'font Size');if( i==-1&&v.i ndexOf('pt ')>0)i=inA rray(fz,pa rseInt(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.f ace||f.siz e){f.style .fontFamil y='';dom.s etAttrib(f ,'mce_styl e','');dom .replace(f ,n,1);}}}; t.onSetCon tent.add(f unction(ed ,o){conver tToFonts(e d.getBody( ));});t.on PreProcess .add(funct ion(ed,o){ if(!s.inli ne_styles) return;if( o.get){nl= t.dom.sele ct('font', o.node);fo r(x=nl.len gth-1;x>=0 ;x--){n=nl [x];sp=dom .create('s pan',{styl e:dom.getA ttrib(n,'s tyle')});d om.setStyl es(sp,{fon tFamily:do m.getAttri b(n,'face' ),color:do m.getAttri b(n,'color '),backgro undColor:n .style.bac kgroundCol or});if(n. size){if(s l)dom.setS tyle(sp,'f ontSize',s l[parseInt (n.size)-1 ]);else do m.setAttri b(sp,'clas s',cl[pars eInt(n.siz e)-1]);}do m.setAttri b(sp,'mce_ style','') ;dom.repla ce(sp,n,1) ;}}});},_i sHidden:fu nction(){v ar s;if(!i sGecko)ret urn 0;s=th is.selecti on.getSel( );return(! s||!s.rang eCount||s. rangeCount ==0);},_fi xNesting:f unction(s) {var d=[], i;s=s.repl ace(/<(\/) ?([^\s>]+) [^>]*?>/g, function(a ,b,c){var  e;if(b===' /'){if(!d. length)ret urn'';if(c !==d[d.len gth-1].tag ){for(i=d. length-1;i >=0;i--){i f(d[i].tag ===c){d[i] .close=1;b reak;}}ret urn'';}els e{d.pop(); if(d.lengt h&&d[d.len gth-1].clo se){a=a+'< /'+d[d.len gth-1].tag +'>';d.pop ();}}}else {if(/^(br| hr|input|m eta|img|li nk|param)$ /i.test(c) )return a; if(/\/>$/. test(a))re turn a;d.p ush({tag:c });}return  a;});for( i=d.length -1;i>=0;i- -)s+='</'+ d[i].tag+' >';return  s;}});})() ;(function (){var eac h=tinymce. each,isIE= tinymce.is IE,isGecko =tinymce.i sGecko,isO pera=tinym ce.isOpera ,isWebKit= tinymce.is WebKit;tin ymce.creat e('tinymce .EditorCom mands',{Ed itorComman ds:functio n(ed){this .editor=ed ;},execCom mand:funct ion(cmd,ui ,val){var  t=this,ed= t.editor,f ;switch(cm d){case'Cu t':case'Co py':case'P aste':try{ ed.getDoc( ).execComm and(cmd,ui ,val);}cat ch(ex){if( isGecko){e d.windowMa nager.conf irm(ed.get Lang('clip board_msg' ),function (s){if(s)w indow.open ('http://w ww.mozilla .org/edito r/midasdem o/security prefs.html ','mceExte rnal');}); }else ed.w indowManag er.alert(e d.getLang( 'clipboard _no_suppor t'));}retu rn true;ca se'mceRese tDesignMod e':case'mc eBeginUndo Level':ret urn true;c ase'unlink ':t.UnLink ();return  true;case' JustifyLef t':case'Ju stifyCente r':case'Ju stifyRight ':case'Jus tifyFull': t.mceJusti fy(cmd,cmd .substring (7).toLowe rCase());r eturn true ;case'mceE ndUndoLeve l':case'mc eAddUndoLe vel':ed.un doManager. add();retu rn true;de fault:f=th is[cmd];if (f){f.call (this,ui,v al);return  true;}}re turn false ;},Indent: function() {var ed=th is.editor, d=ed.dom,s =ed.select ion,e,iv,i u;iv=ed.se ttings.ind entation;i u=/[a-z%]+ $/i.exec(i v);iv=pars eInt(iv);i f(ed.setti ngs.inline _styles&&( !this.quer yStateInse rtUnordere dList()&&! this.query StateInser tOrderedLi st())){eac h(this._ge tSelectedB locks(),fu nction(e){ d.setStyle (e,'paddin gLeft',(pa rseInt(e.s tyle.paddi ngLeft||0) +iv)+iu);} );return;} ed.getDoc( ).execComm and('Inden t',false,n ull);if(is IE){d.getP arent(s.ge tNode(),fu nction(n){ if(n.nodeN ame=='BLOC KQUOTE'){n .dir=n.sty le.cssText ='';}});}} ,Outdent:f unction(){ var ed=thi s.editor,d =ed.dom,s= ed.selecti on,e,v,iv, iu;iv=ed.s ettings.in dentation; iu=/[a-z%] +$/i.exec( iv);iv=par seInt(iv); if(ed.sett ings.inlin e_styles&& (!this.que ryStateIns ertUnorder edList()&& !this.quer yStateInse rtOrderedL ist())){ea ch(this._g etSelected Blocks(),f unction(e) {v=Math.ma x(0,parseI nt(e.style .paddingLe ft||0)-iv) ;d.setStyl e(e,'paddi ngLeft',v? v+iu:'');} );return;} ed.getDoc( ).execComm and('Outde nt',false, null);},mc eSetAttrib ute:functi on(u,v){va r ed=this. editor,d=e d.dom,e;if (e=d.getPa rent(ed.se lection.ge tNode(),d. isBlock))d .setAttrib (e,v.name, v.value);} ,mceSetCon tent:funct ion(u,v){t his.editor .setConten t(v);},mce ToggleVisu alAid:func tion(){var  ed=this.e ditor;ed.h asVisual=! ed.hasVisu al;ed.addV isual();}, mceReplace Content:fu nction(u,v ){var s=th is.editor. selection; s.setConte nt(v.repla ce(/\{\$se lection\}/ g,s.getCon tent({form at:'text'} )));},mceI nsertLink: function(u ,v){var ed =this.edit or,e=ed.do m.getParen t(ed.selec tion.getNo de(),'A'); if(tinymce .is(v,'str ing'))v={h ref:v};fun ction set( e){each(v, function(v ,k){ed.dom .setAttrib (e,k,v);}) ;};if(!e){ ed.execCom mand('Crea teLink',fa lse,'javas cript:mctm p(0);');ea ch(ed.dom. select('a' ),function (e){if(e.h ref=='java script:mct mp(0);')se t(e);});}e lse{if(v.h ref)set(e) ;else ed.d om.remove( e,1);}},Un Link:funct ion(){var  ed=this.ed itor,s=ed. selection; if(s.isCol lapsed())s .select(s. getNode()) ;ed.getDoc ().execCom mand('unli nk',false, null);s.co llapse(0); },FontName :function( u,v){var t =this,ed=t .editor,s= ed.selecti on,e;if(!v ){if(s.isC ollapsed() )s.select( s.getNode( ));t.Remov eFormat(); }else ed.g etDoc().ex ecCommand( 'FontName' ,false,v); },queryCom mandValue: function(c ){var f=th is['queryV alue'+c];i f(f)return  f.call(th is,c);retu rn false;} ,queryComm andState:f unction(cm d){var f;s witch(cmd) {case'Just ifyLeft':c ase'Justif yCenter':c ase'Justif yRight':ca se'Justify Full':retu rn this.qu eryStateJu stify(cmd, cmd.substr ing(7).toL owerCase() );default: if(f=this[ 'queryStat e'+cmd])re turn f.cal l(this,cmd );}return- 1;},queryV alueFontSi ze:functio n(){var ed =this.edit or,v=0,p;i f(isOpera| |isWebKit) {if(p=ed.d om.getPare nt(ed.sele ction.getN ode(),'FON T'))v=p.si ze;return  v;}return  ed.getDoc( ).queryCom mandValue( 'FontSize' );},queryV alueFontNa me:functio n(){var ed =this.edit or,v=0,p;i f(p=ed.dom .getParent (ed.select ion.getNod e(),'FONT' ))v=p.face ;if(!v)v=e d.getDoc() .queryComm andValue(' FontName') ;return v; },mceJusti fy:functio n(c,v){var  ed=this.e ditor,se=e d.selectio n,n=se.get Node(),nn= n.nodeName ,bl,nb,dom =ed.dom,rm ;if(ed.set tings.inli ne_styles& &this.quer yStateJust ify(c,v))r m=1;bl=dom .getParent (n,ed.dom. isBlock);i f(nn=='IMG '){if(v==' full')retu rn;if(rm){ if(v=='cen ter')dom.s etStyle(n. parentNode ,'textAlig n','');dom .setStyle( n,'float', '');this.m ceRepaint( );return;} if(v=='cen ter'){if(/ ^(TD|TH)$/ .test(bl.n odeName))b l=0;if(!bl ||bl.child Nodes.leng th>1){nb=d om.create( 'p');nb.ap pendChild( n.cloneNod e(false)); if(bl)dom. insertAfte r(nb,bl);e lse dom.in sertAfter( nb,n);dom. remove(n); n=nb.first Child;bl=n b;}dom.set Style(bl,' textAlign' ,v);dom.se tStyle(n,' float','') ;}else{dom .setStyle( n,'float', v);dom.set Style(n.pa rentNode,' textAlign' ,'');}this .mceRepain t();return ;}if(ed.se ttings.inl ine_styles &&ed.setti ngs.forced _root_bloc k){if(rm)v ='';each(t his._getSe lectedBloc ks(dom.get Parent(se. getStart() ,dom.isBlo ck),dom.ge tParent(se .getEnd(), dom.isBloc k)),functi on(e){dom. setAttrib( e,'align', '');dom.se tStyle(e,' textAlign' ,v=='full' ?'justify' :v);});ret urn;}else  if(!rm)ed. getDoc().e xecCommand (c,false,n ull);if(ed .settings. inline_sty les){if(rm ){dom.getP arent(ed.s election.g etNode(),f unction(n) {if(n.styl e&&n.style .textAlign )dom.setSt yle(n,'tex tAlign','' );});retur n;}each(do m.select(' *'),functi on(n){var  v=n.align; if(v){if(v =='full')v ='justify' ;dom.setSt yle(n,'tex tAlign',v) ;dom.setAt trib(n,'al ign','');} });}},mceS etCSSClass :function( u,v){this. mceSetStyl eInfo(0,{c ommand:'se tattrib',n ame:'class ',value:v} );},getSel ectedEleme nt:functio n(){var t= this,ed=t. editor,dom =ed.dom,se =ed.select ion,r=se.g etRng(),r1 ,r2,sc,ec, so,eo,e,sp ,ep,re;if( se.isColla psed()||r. item)retur n se.getNo de();re=ed .settings. merge_styl es_invalid _parents;i f(tinymce. is(re,'str ing'))re=n ew RegExp( re,'i');if (isIE){r1= r.duplicat e();r1.col lapse(true );sc=r1.pa rentElemen t();r2=r.d uplicate() ;r2.collap se(false); ec=r2.pare ntElement( );if(sc!=e c){r1.move ('characte r',1);sc=r 1.parentEl ement();}i f(sc==ec){ r1=r.dupli cate();r1. moveToElem entText(sc );if(r1.co mpareEndPo ints('Star tToStart', r)==0&&r1. compareEnd Points('En dToEnd',r) ==0)return  re&&re.te st(sc.node Name)?null :sc;}}else {function  getParent( n){return  dom.getPar ent(n,func tion(n){re turn n.nod eType==1;} );};sc=r.s tartContai ner;ec=r.e ndContaine r;so=r.sta rtOffset;e o=r.endOff set;if(!r. collapsed) {if(sc==ec ){if(so-eo <2){if(sc. hasChildNo des()){sp= sc.childNo des[so];re turn re&&r e.test(sp. nodeName)? null:sp;}} }}if(sc.no deType!=3| |ec.nodeTy pe!=3)retu rn null;if (so==0){sp =getParent (sc);if(sp &&sp.first Child!=sc) sp=null;}i f(so==sc.n odeValue.l ength){e=s c.nextSibl ing;if(e&& e.nodeType ==1)sp=sc. nextSiblin g;}if(eo== 0){e=ec.pr eviousSibl ing;if(e&& e.nodeType ==1)ep=e;} if(eo==ec. nodeValue. length){ep =getParent (ec);if(ep &&ep.lastC hild!=ec)e p=null;}if (sp==ep)re turn re&&s p&&re.test (sp.nodeNa me)?null:s p;}return  null;},Ins ertHorizon talRule:fu nction(){i f(isGecko| |isIE)this .editor.se lection.se tContent(' <hr />');e lse this.e ditor.getD oc().execC ommand('In sertHorizo ntalRule', false,''); },RemoveFo rmat:funct ion(){var  t=this,ed= t.editor,s =ed.select ion,b;if(i sWebKit)s. setContent (s.getCont ent({forma t:'raw'}). replace(/( <(span|b|i |strong|em |strike) [ ^>]+>|<(sp an|b|i|str ong|em|str ike)>|<\/( span|b|i|s trong|em|s trike)>|)/ g,''),{for mat:'raw'} );else ed. getDoc().e xecCommand ('RemoveFo rmat',fals e,null);t. mceSetStyl eInfo(0,{c ommand:'re moveformat '});ed.add Visual();} ,mceSetSty leInfo:fun ction(u,v) {var t=thi s,ed=t.edi tor,d=ed.g etDoc(),do m=ed.dom,e ,b,s=ed.se lection,nn =v.wrapper ||'span',b =s.getBook mark(),re; function s et(n,e){if (n.nodeTyp e==1){swit ch(v.comma nd){case's etattrib': return dom .setAttrib (n,v.name, v.value);c ase'setsty le':return  dom.setSt yle(n,v.na me,v.value );case'rem oveformat' :return do m.setAttri b(n,'class ','');}}}; re=ed.sett ings.merge _styles_in valid_pare nts;if(tin ymce.is(re ,'string') )re=new Re gExp(re,'i ');if(e=t. getSelecte dElement() )set(e,1); else{d.exe cCommand(' FontName', false,'__' );each(isW ebKit?dom. select('sp an'):dom.s elect('fon t'),functi on(n){var  sp,e;if(do m.getAttri b(n,'face' )=='__'||n .style.fon tFamily=== '__'){sp=d om.create( nn,{mce_ne w:'1'});se t(sp);each (n.childNo des,functi on(n){sp.a ppendChild (n.cloneNo de(true)); });dom.rep lace(sp,n) ;}});}each (dom.selec t(nn).reve rse(),func tion(n){va r p=n.pare ntNode;dom .setAttrib (n,'mce_ne w','');if( !dom.getAt trib(n,'mc e_new')){p =dom.getPa rent(n,fun ction(n){r eturn n.no deType==1& &dom.getAt trib(n,'mc e_new');}) ;if(p)dom. remove(n,1 );}});each (dom.selec t(nn).reve rse(),func tion(n){va r p=n.pare ntNode;if( !p)return; if(p.nodeN ame==nn.to UpperCase( )&&p.child Nodes.leng th==1)retu rn dom.rem ove(p,1);i f(n.nodeTy pe==1&&(!r e||!re.tes t(p.nodeNa me))&&p.ch ildNodes.l ength==1){ set(p);dom .setAttrib (n,'class' ,'');}});e ach(dom.se lect(nn).r everse(),f unction(n) {if(!dom.g etAttrib(n ,'class')& &!dom.getA ttrib(n,'s tyle'))ret urn dom.re move(n,1); });s.moveT oBookmark( b);},query StateJusti fy:functio n(c,v){var  ed=this.e ditor,n=ed .selection .getNode() ,dom=ed.do m;if(n&&n. nodeName== 'IMG'){if( dom.getSty le(n,'floa t')==v)ret urn 1;retu rn n.paren tNode.styl e.textAlig n==v;}n=do m.getParen t(ed.selec tion.getSt art(),func tion(n){re turn n.nod eType==1&& n.style.te xtAlign;}) ;if(v=='fu ll')v='jus tify';if(e d.settings .inline_st yles)retur n(n&&n.sty le.textAli gn==v);ret urn ed.get Doc().quer yCommandSt ate(c);},H iliteColor :function( ui,val){va r t=this,e d=t.editor ,d=ed.getD oc();funct ion set(s) {if(!isGec ko)return; try{d.exec Command("s tyleWithCS S",0,s);}c atch(ex){d .execComma nd("useCSS ",0,!s);}} ;if(isGeck o||isOpera ){set(true );d.execCo mmand('hil itecolor', false,val) ;set(false );}else d. execComman d('BackCol or',false, val);},Und o:function (){var ed= this.edito r;if(ed.se ttings.cus tom_undo_r edo){ed.un doManager. undo();ed. nodeChange d();}else  ed.getDoc( ).execComm and('Undo' ,false,nul l);},Redo: function() {var ed=th is.editor; if(ed.sett ings.custo m_undo_red o){ed.undo Manager.re do();ed.no deChanged( );}else ed .getDoc(). execComman d('Redo',f alse,null) ;},FormatB lock:funct ion(ui,val ){var t=th is,ed=t.ed itor;val=e d.settings .forced_ro ot_block?( val||'<p>' ):val;if(/ ^(P|DIV|H[ 1-6]|ADDRE SS|BLOCKQU OTE|PRE)$/ .test(ed.s election.g etNode().n odeName))t .mceRemove Node();if( val.indexO f('<')==-1 )val='<'+v al+'>';if( tinymce.is Gecko)val= val.replac e(/<(div|b lockquote| code|dt|dd |dl|samp)> /gi,'$1'); ed.getDoc( ).execComm and('Forma tBlock',fa lse,val);} ,mceCleanu p:function (){var ed= this.edito r,s=ed.sel ection,b=s .getBookma rk();ed.se tContent(e d.getConte nt());s.mo veToBookma rk(b);},mc eRemoveNod e:function (ui,val){v ar ed=this .editor,s= ed.selecti on,b,n=val ||s.getNod e();if(n== ed.getBody ())return; b=s.getBoo kmark();ed .dom.remov e(n,1);s.m oveToBookm ark(b);ed. nodeChange d();},mceS electNodeD epth:funct ion(ui,val ){var ed=t his.editor ,s=ed.sele ction,c=0; ed.dom.get Parent(s.g etNode(),f unction(n) {if(n.node Type==1&&c ++==val){s .select(n) ;ed.nodeCh anged();re turn false ;}},ed.get Body());}, mceSelectN ode:functi on(u,v){th is.editor. selection. select(v); },mceInser tContent:f unction(ui ,val){this .editor.se lection.se tContent(v al);},mceI nsertRawHT ML:functio n(ui,val){ var ed=thi s.editor;e d.selectio n.setConte nt('tiny_m ce_marker' );ed.setCo ntent(ed.g etContent( ).replace( /tiny_mce_ marker/g,v al));},mce Repaint:fu nction(){v ar s,b,e=t his.editor ;if(tinymc e.isGecko) {try{s=e.s election;b =s.getBook mark(true) ;if(s.getS el())s.get Sel().sele ctAllChild ren(e.getB ody());s.c ollapse(tr ue);s.move ToBookmark (b);}catch (ex){}}},q ueryStateU nderline:f unction(){ var ed=thi s.editor,n ;if(n&&n.n odeName==' A')return  false;retu rn ed.getD oc().query CommandSta te('Underl ine');},qu eryStateOu tdent:func tion(){var  ed=this.e ditor,n;if (ed.settin gs.inline_ styles){if ((n=ed.dom .getParent (ed.select ion.getSta rt(),ed.do m.isBlock) )&&parseIn t(n.style. paddingLef t)>0)retur n true;if( (n=ed.dom. getParent( ed.selecti on.getEnd( ),ed.dom.i sBlock))&& parseInt(n .style.pad dingLeft)> 0)return t rue;}else  return!!ed .dom.getPa rent(ed.se lection.ge tNode(),'B LOCKQUOTE' );return t his.queryS tateInsert UnorderedL ist()||thi s.querySta teInsertOr deredList( );},queryS tateInsert UnorderedL ist:functi on(){retur n this.edi tor.dom.ge tParent(th is.editor. selection. getNode(), 'UL');},qu eryStateIn sertOrdere dList:func tion(){ret urn this.e ditor.dom. getParent( this.edito r.selectio n.getNode( ),'OL');}, queryState mceBlockQu ote:functi on(){retur n!!this.ed itor.dom.g etParent(t his.editor .selection .getStart( ),function (n){return  n.nodeNam e==='BLOCK QUOTE';}); },mceBlock Quote:func tion(){var  t=this,ed =t.editor, s=ed.selec tion,dom=e d.dom,sb,e b,n,bm,bq, r,bq2,i,nl ;function  getBQ(e){r eturn dom. getParent( e,function (n){return  n.nodeNam e==='BLOCK QUOTE';}); };sb=dom.g etParent(s .getStart( ),dom.isBl ock);eb=do m.getParen t(s.getEnd (),dom.isB lock);if(b q=getBQ(sb )){if(sb!= eb||sb.chi ldNodes.le ngth>1||(s b.childNod es.length= =1&&sb.fir stChild.no deName!='B R'))bm=s.g etBookmark ();if(getB Q(eb)){bq2 =bq.cloneN ode(false) ;while(n=e b.nextSibl ing)bq2.ap pendChild( n.parentNo de.removeC hild(n));} if(bq2)dom .insertAft er(bq2,bq) ;nl=t._get SelectedBl ocks(sb,eb );for(i=nl .length-1; i>=0;i--){ dom.insert After(nl[i ],bq);}if( /^\s*$/.te st(bq.inne rHTML))dom .remove(bq ,1);if(bq2 &&/^\s*$/. test(bq2.i nnerHTML)) dom.remove (bq2,1);if (!bm){if(! isIE){r=ed .getDoc(). createRang e();r.setS tart(sb,0) ;r.setEnd( sb,0);s.se tRng(r);}e lse{s.sele ct(sb);s.c ollapse(0) ;if(dom.ge tParent(s. getStart() ,dom.isBlo ck)!=sb){r =s.getRng( );r.move(' character' ,-1);r.sel ect();}}}e lse t.edit or.selecti on.moveToB ookmark(bm );return;} if(isIE&&! sb&&!eb){t .editor.ge tDoc().exe cCommand(' Indent');n =getBQ(s.g etNode()); n.style.ma rgin=n.dir ='';return ;}if(!sb|| !eb)return ;if(sb!=eb ||sb.child Nodes.leng th>1||(sb. childNodes .length==1 &&sb.first Child.node Name!='BR' ))bm=s.get Bookmark() ;each(t._g etSelected Blocks(get BQ(s.getSt art()),get BQ(s.getEn d())),func tion(e){if (e.nodeNam e=='BLOCKQ UOTE'&&!bq ){bq=e;ret urn;}if(!b q){bq=dom. create('bl ockquote') ;e.parentN ode.insert Before(bq, e);}if(e.n odeName==' BLOCKQUOTE '&&bq){n=e .firstChil d;while(n) {bq.append Child(n.cl oneNode(tr ue));n=n.n extSibling ;}dom.remo ve(e);retu rn;}bq.app endChild(d om.remove( e));});if( !bm){if(!i sIE){r=ed. getDoc().c reateRange ();r.setSt art(sb,0); r.setEnd(s b,0);s.set Rng(r);}el se{s.selec t(sb);s.co llapse(1); }}else s.m oveToBookm ark(bm);}, _getSelect edBlocks:f unction(st ,en){var e d=this.edi tor,dom=ed .dom,s=ed. selection, sb,eb,n,bl =[];sb=dom .getParent (st||s.get Start(),do m.isBlock) ;eb=dom.ge tParent(en ||s.getEnd (),dom.isB lock);if(s b)bl.push( sb);if(sb& &eb&&sb!=e b){n=sb;wh ile((n=n.n extSibling )&&n!=eb){ if(dom.isB lock(n))bl .push(n);} }if(eb&&sb !=eb)bl.pu sh(eb);ret urn bl;}}) ;})();tiny mce.create ('tinymce. UndoManage r',{index: 0,data:nul l,typing:0 ,UndoManag er:functio n(ed){var  t=this,Dis patcher=ti nymce.util .Dispatche r;t.editor =ed;t.data =[];t.onAd d=new Disp atcher(thi s);t.onUnd o=new Disp atcher(thi s);t.onRed o=new Disp atcher(thi s);},add:f unction(l) {var t=thi s,i,ed=t.e ditor,b,s= ed.setting s,la;l=l|| {};l.conte nt=l.conte nt||ed.get Content({f ormat:'raw ',no_event s:1});l.co ntent=l.co ntent.repl ace(/^\s*| \s*$/g,'') ;la=t.data [t.index>0 ?t.index-1 :0];if(!l. initial&&l a&&l.conte nt==la.con tent)retur n null;if( s.custom_u ndo_redo_l evels){if( t.data.len gth>s.cust om_undo_re do_levels) {for(i=0;i <t.data.le ngth-1;i++ )t.data[i] =t.data[i+ 1];t.data. length--;t .index=t.d ata.length ;}}if(s.cu stom_undo_ redo_resto re_selecti on&&!l.ini tial)l.boo kmark=b=l. bookmark|| ed.selecti on.getBook mark();if( t.index<t. data.lengt h&&t.data[ t.index].i nitial)t.i ndex++;t.d ata.length =t.index+1 ;t.data[t. index++]=l ;if(l.init ial)t.inde x=0;if(t.d ata.length ==2&&t.dat a[0].initi al)t.data[ 0].bookmar k=b;t.onAd d.dispatch (t,l);ed.i sNotDirty= 0;return l ;},undo:fu nction(){v ar t=this, ed=t.edito r,l=l,i;if (t.typing) {t.add();t .typing=0; }if(t.inde x>0){if(t. index==t.d ata.length &&t.index> 1){i=t.ind ex;t.typin g=0;if(!t. add())t.in dex=i;--t. index;}l=t .data[--t. index];ed. setContent (l.content ,{format:' raw'});ed. selection. moveToBook mark(l.boo kmark);t.o nUndo.disp atch(t,l); }return l; },redo:fun ction(){va r t=this,e d=t.editor ,l=null;if (t.index<t .data.leng th-1){l=t. data[++t.i ndex];ed.s etContent( l.content, {format:'r aw'});ed.s election.m oveToBookm ark(l.book mark);t.on Redo.dispa tch(t,l);} return l;} ,clear:fun ction(){va r t=this;t .data=[];t .index=0;t .typing=0; t.add({ini tial:true} );},hasUnd o:function (){return  this.index !=0||this. typing;},h asRedo:fun ction(){re turn this. index<this .data.leng th-1;}});( function() {var Event ,isIE,isGe cko,isOper a,each,ext end;Event= tinymce.do m.Event;is IE=tinymce .isIE;isGe cko=tinymc e.isGecko; isOpera=ti nymce.isOp era;each=t inymce.eac h;extend=t inymce.ext end;tinymc e.create(' tinymce.Fo rceBlocks' ,{ForceBlo cks:functi on(ed){var  t=this,s= ed.setting s,elm;t.ed itor=ed;t. dom=ed.dom ;elm=(s.fo rced_root_ block||'p' ).toLowerC ase();s.el ement=elm. toUpperCas e();ed.onP reInit.add (t.setup,t );t.reOper a=new RegE xp('(\u00a 0|&#160;|& nbsp;)<\/' +elm+'>',' gi');t.reP add=new Re gExp('<p(  )([^>]+)>< \/p>|<p( ) ([^>]+)\/> |<p( )([^> ]+)>\s+<\/ p>|<p><\/p >|<p\/>|<p >\s+<\/p>' .replace(/ p/g,elm),' gi');t.reN bsp2BR=new  RegExp('< p( )([^>]+ )>[\s\u00a 0]+<\/p>|< p>[\s\u00a 0]+<\/p>'. replace(/p /g,elm),'g i');t.reBR 2Nbsp=new  RegExp('<p ( )([^>]+) >\s*<br \/ >\s*<\/p>| <p>\s*<br  \/>\s*<\/p >'.replace (/p/g,elm) ,'gi');t.r eTrailBr=n ew RegExp( '\s*<br \/ >\s*<\/p>' .replace(/ p/g,elm),' gi');funct ion padd(e d,o){if(is Opera)o.co ntent=o.co ntent.repl ace(t.reOp era,'</'+e lm+'>');o. content=o. content.re place(t.re Padd,'<'+e lm+'$1$2$3 $4$5$6>\u0 0a0</'+elm +'>');if(! isIE&&o.se t){o.conte nt=o.conte nt.replace (t.reNbsp2 BR,'<'+elm +'$1$2><br  /></'+elm +'>');}els e{o.conten t=o.conten t.replace( t.reBR2Nbs p,'<'+elm+ '$1$2>\u00 a0</'+elm+ '>');o.con tent=o.con tent.repla ce(t.reTra ilBr,'</'+ elm+'>');} };ed.onBef oreSetCont ent.add(pa dd);ed.onP ostProcess .add(padd) ;if(s.forc ed_root_bl ock){ed.on Init.add(t .forceRoot s,t);ed.on SetContent .add(t.for ceRoots,t) ;ed.onBefo reGetConte nt.add(t.f orceRoots, t);}},setu p:function (){var t=t his,ed=t.e ditor,s=ed .settings; if(s.force d_root_blo ck){ed.onK eyUp.add(t .forceRoot s,t);ed.on PreProcess .add(t.for ceRoots,t) ;}if(s.for ce_br_newl ines){if(i sIE){ed.on KeyPress.a dd(functio n(ed,e){va r n,s=ed.s election;i f(e.keyCod e==13&&s.g etNode().n odeName!=' LI'){s.set Content('< br id="__"  /> ',{for mat:'raw'} );n=ed.dom .get('__') ;n.removeA ttribute(' id');s.sel ect(n);s.c ollapse(); return Eve nt.cancel( e);}});}re turn;}if(! isIE&&s.fo rce_p_newl ines){ed.o nKeyPress. add(functi on(ed,e){i f(e.keyCod e==13&&!e. shiftKey){ if(!t.inse rtPara(e)) Event.canc el(e);}}); if(isGecko ){ed.onKey Down.add(f unction(ed ,e){if((e. keyCode==8 ||e.keyCod e==46)&&!e .shiftKey) t.backspac eDelete(e, e.keyCode= =8);});}}f unction re n(rn,na){v ar ne=ed.d om.create( na);each(r n.attribut es,functio n(a){if(a. specified& &a.nodeVal ue)ne.setA ttribute(a .nodeName. toLowerCas e(),a.node Value);}); each(rn.ch ildNodes,f unction(n) {ne.append Child(n.cl oneNode(tr ue));});rn .parentNod e.replaceC hild(ne,rn );return n e;};if(isI E&&s.eleme nt!='P'){e d.onKeyPre ss.add(fun ction(ed,e ){t.lastEl m=ed.selec tion.getNo de().nodeN ame;});ed. onKeyUp.ad d(function (ed,e){var  bl,sel=ed .selection ,n=sel.get Node(),b=e d.getBody( );if(b.chi ldNodes.le ngth===1&& n.nodeName =='P'){n=r en(n,s.ele ment);sel. select(n); sel.collap se();ed.no deChanged( );}else if (e.keyCode ==13&&!e.s hiftKey&&t .lastElm!= 'P'){bl=ed .dom.getPa rent(n,'P' );if(bl){r en(bl,s.el ement);ed. nodeChange d();}}});} },find:fun ction(n,t, s){var ed= this.edito r,w=ed.get Doc().crea teTreeWalk er(n,4,nul l,false),c =-1;while( n=w.nextNo de()){c++; if(t==0&&n ==s)return  c;if(t==1 &&c==s)ret urn n;}ret urn-1;},fo rceRoots:f unction(ed ,e){var t= this,ed=t. editor,b=e d.getBody( ),d=ed.get Doc(),se=e d.selectio n,s=se.get Sel(),r=se .getRng(), si=-2,ei,s o,eo,tr,c= -0xFFFFFF; var nx,bl, bp,sp,le,n l=b.childN odes,i;if( e&&e.keyCo de==13)ret urn true;f or(i=nl.le ngth-1;i>= 0;i--){nx= nl[i];if(n x.nodeType ==3||!t.do m.isBlock( nx)){if(!b l){if(nx.n odeType!=3 ||/[^\s]/g .test(nx.n odeValue)) {if(si==-2 &&r){if(!i sIE){so=r. startOffse t;eo=r.end Offset;si= t.find(b,0 ,r.startCo ntainer);e i=t.find(b ,0,r.endCo ntainer);} else{tr=d. body.creat eTextRange ();tr.move ToElementT ext(b);tr. collapse(1 );bp=tr.mo ve('charac ter',c)*-1 ;tr=r.dupl icate();tr .collapse( 1);sp=tr.m ove('chara cter',c)*- 1;tr=r.dup licate();t r.collapse (0);le=(tr .move('cha racter',c) *-1)-sp;si =sp-bp;ei= le;}}bl=ed .dom.creat e(ed.setti ngs.forced _root_bloc k);bl.appe ndChild(nx .cloneNode (1));nx.pa rentNode.r eplaceChil d(bl,nx);} }else{if(b l.hasChild Nodes())bl .insertBef ore(nx,bl. firstChild );else bl. appendChil d(nx);}}el se bl=null ;}if(si!=- 2){if(!isI E){bl=d.ge tElementsB yTagName(e d.settings .element)[ 0];r=d.cre ateRange() ;if(si!=-1 )r.setStar t(t.find(b ,1,si),so) ;else r.se tStart(bl, 0);if(ei!= -1)r.setEn d(t.find(b ,1,ei),eo) ;else r.se tEnd(bl,0) ;if(s){s.r emoveAllRa nges();s.a ddRange(r) ;}}else{tr y{r=s.crea teRange(); r.moveToEl ementText( b);r.colla pse(1);r.m oveStart(' character' ,si);r.mov eEnd('char acter',ei) ;r.select( );}catch(e x){}}}},ge tParentBlo ck:functio n(n){var d =this.dom; return d.g etParent(n ,d.isBlock );},insert Para:funct ion(e){var  t=this,ed =t.editor, d=ed.getDo c(),se=ed. settings,s =ed.select ion.getSel (),r=s.get RangeAt(0) ,b=d.body; var rb,ra, dir,sn,so, en,eo,sb,e b,bn,bef,a ft,sc,ec,n ;function  isEmpty(n) {n=n.inner HTML;n=n.r eplace(/<( img|hr|tab le)/gi,'-' );n=n.repl ace(/<[^>] +>/g,'');r eturn n.re place(/[ \ t\r\n]+/g, '')=='';}; rb=d.creat eRange();r b.setStart (s.anchorN ode,s.anch orOffset); rb.collaps e(true);ra =d.createR ange();ra. setStart(s .focusNode ,s.focusOf fset);ra.c ollapse(tr ue);dir=rb .compareBo undaryPoin ts(rb.STAR T_TO_END,r a)<0;sn=di r?s.anchor Node:s.foc usNode;so= dir?s.anch orOffset:s .focusOffs et;en=dir? s.focusNod e:s.anchor Node;eo=di r?s.focusO ffset:s.an chorOffset ;if(sn==b& &en==b&&b. firstChild &&ed.dom.i sBlock(b.f irstChild) ){sn=en=sn .firstChil d;so=eo=0; rb=d.creat eRange();r b.setStart (sn,0);ra= d.createRa nge();ra.s etStart(en ,0);}sn=sn .nodeName= ="HTML"?d. body:sn;sn =sn.nodeNa me=="BODY" ?sn.firstC hild:sn;en =en.nodeNa me=="HTML" ?d.body:en ;en=en.nod eName=="BO DY"?en.fir stChild:en ;sb=t.getP arentBlock (sn);eb=t. getParentB lock(en);b n=sb?sb.no deName:se. element;if (t.dom.get Parent(sb, function(n ){return/O L|UL|PRE/. test(n.nod eName);})) return tru e;if(sb&&( sb.nodeNam e=='CAPTIO N'||/absol ute|relati ve|static/ gi.test(sb .style.pos ition))){b n=se.eleme nt;sb=null ;}if(eb&&( eb.nodeNam e=='CAPTIO N'||/absol ute|relati ve|static/ gi.test(eb .style.pos ition))){b n=se.eleme nt;eb=null ;}if(/(TD| TABLE|TH|C APTION)/.t est(bn)||( sb&&bn=="D IV"&&/left |right/gi. test(sb.st yle.cssFlo at))){bn=s e.element; sb=eb=null ;}bef=(sb& &sb.nodeNa me==bn)?sb .cloneNode (0):ed.dom .create(bn );aft=(eb& &eb.nodeNa me==bn)?eb .cloneNode (0):ed.dom .create(bn );aft.remo veAttribut e('id');if (/^(H[1-6] )$/.test(b n)&&sn.nod eValue&&so ==sn.nodeV alue.lengt h)aft=ed.d om.create( se.element );n=sc=sn; do{if(n==b ||n.nodeTy pe==9||t.d om.isBlock (n)||/(TD| TABLE|TH|C APTION)/.t est(n.node Name))brea k;sc=n;}wh ile((n=n.p reviousSib ling?n.pre viousSibli ng:n.paren tNode));n= ec=en;do{i f(n==b||n. nodeType== 9||t.dom.i sBlock(n)| |/(TD|TABL E|TH|CAPTI ON)/.test( n.nodeName ))break;ec =n;}while( (n=n.nextS ibling?n.n extSibling :n.parentN ode));if(s c.nodeName ==bn)rb.se tStart(sc, 0);else rb .setStartB efore(sc); rb.setEnd( sn,so);bef .appendChi ld(rb.clon eContents( )||d.creat eTextNode( ''));try{r a.setEndAf ter(ec);}c atch(ex){} ra.setStar t(en,eo);a ft.appendC hild(ra.cl oneContent s()||d.cre ateTextNod e(''));r=d .createRan ge();if(!s c.previous Sibling&&s c.parentNo de.nodeNam e==bn){r.s etStartBef ore(sc.par entNode);} else{if(rb .startCont ainer.node Name==bn&& rb.startOf fset==0)r. setStartBe fore(rb.st artContain er);else r .setStart( rb.startCo ntainer,rb .startOffs et);}if(!e c.nextSibl ing&&ec.pa rentNode.n odeName==b n)r.setEnd After(ec.p arentNode) ;else r.se tEnd(ra.en dContainer ,ra.endOff set);r.del eteContent s();if(bef .firstChil d&&bef.fir stChild.no deName==bn )bef.inner HTML=bef.f irstChild. innerHTML; if(aft.fir stChild&&a ft.firstCh ild.nodeNa me==bn)aft .innerHTML =aft.first Child.inne rHTML;if(i sEmpty(bef ))bef.inne rHTML='<br  />';if(is Empty(aft) )aft.inner HTML=isOpe ra?'&nbsp; ':'<br />' ;if(isOper a){r.inser tNode(bef) ;r.insertN ode(aft);} else{r.ins ertNode(af t);r.inser tNode(bef) ;}aft.norm alize();be f.normaliz e();r=d.cr eateRange( );r.select NodeConten ts(aft);r. collapse(1 );s.remove AllRanges( );s.addRan ge(r);if(t inymce.isW ebKit)ed.g etWin().sc rollTo(0,e d.dom.getP os(aft).y) ;else aft. scrollInto View(0);re turn false ;},backspa ceDelete:f unction(e, bs){var t= this,ed=t. editor,b=e d.getBody( ),n,se=ed. selection, r=se.getRn g(),sc=r.s tartContai ner,n;if(s c&&ed.dom. isBlock(sc )&&bs){if( sc.childNo des.length ==1&&sc.fi rstChild.n odeName==' BR'){n=sc. previousSi bling;if(n ){ed.dom.r emove(sc); se.select( n.firstChi ld);se.col lapse(0);r eturn Even t.cancel(e );}}}funct ion handle r(e){e=e.t arget;if(e &&e.parent Node&&e.no deName=='B R'&&t.getP arentBlock (e)){ed.do m.remove(e );Event.re move(b,'DO MNodeInser ted',handl er);}};Eve nt._add(b, 'DOMNodeIn serted',ha ndler);win dow.setTim eout(funct ion(){Even t._remove( b,'DOMNode Inserted', handler);} ,1);}});}) ();(functi on(){var D OM=tinymce .DOM,Event =tinymce.d om.Event,e ach=tinymc e.each,ext end=tinymc e.extend;t inymce.cre ate('tinym ce.Control Manager',{ ControlMan ager:funct ion(ed,s){ var t=this ,i;s=s||{} ;t.editor= ed;t.contr ols={};t.o nAdd=new t inymce.uti l.Dispatch er(t);t.on PostRender =new tinym ce.util.Di spatcher(t );t.prefix =s.prefix| |ed.id+'_' ;t.onPostR ender.add( function() {each(t.co ntrols,fun ction(c){c .postRende r();});}); },get:func tion(id){r eturn this .controls[ this.prefi x+id]||thi s.controls [id];},set Active:fun ction(id,s ){var c=nu ll;if(c=th is.get(id) )c.setActi ve(s);retu rn c;},set Disabled:f unction(id ,s){var c= null;if(c= this.get(i d))c.setDi sabled(s); return c;} ,add:funct ion(c){var  t=this;if (c){t.cont rols[c.id] =c;t.onAdd .dispatch( c,t);}retu rn c;},cre ateControl :function( n){var c,t =this,ed=t .editor;ea ch(ed.plug ins,functi on(p){if(p .createCon trol){c=p. createCont rol(n,t);i f(c)return  false;}}) ;switch(n) {case"|":c ase"separa tor":retur n t.create Separator( );}if(!c&& ed.buttons &&(c=ed.bu ttons[n])) return t.c reateButto n(n,c);ret urn t.add( c);},creat eDropMenu: function(i d,s){var t =this,ed=t .editor,c, bm,v;s=ext end({'clas s':'mceDro pDown',con strain:ed. settings.c onstrain_m enus},s);s ['class']= s['class'] +' '+ed.ge tParam('sk in')+'Skin ';if(v=ed. getParam(' skin_varia nt'))s['cl ass']+=' ' +ed.getPar am('skin') +'Skin'+v. substring( 0,1).toUpp erCase()+v .substring (1);id=t.p refix+id;c =t.control s[id]=new  tinymce.ui .DropMenu( id,s);c.on AddItem.ad d(function (c,o){var  s=o.settin gs;s.title =ed.getLan g(s.title, s.title);i f(!s.oncli ck){s.oncl ick=functi on(v){ed.e xecCommand (s.cmd,s.u i||false,s .value);}; }});ed.onR emove.add( function() {c.destroy ();});if(t inymce.isI E){c.onSho wMenu.add( function() {var s=ed. selection, n=s.getNod e();if(n.n odeName==' IMG')bm=s. getBookmar k();else b m=0;});c.o nHideMenu. add(functi on(){if(bm )ed.select ion.moveTo Bookmark(b m);});}ret urn t.add( c);},creat eListBox:f unction(id ,s){var t= this,ed=t. editor,cmd ,c;if(t.ge t(id))retu rn null;s. title=ed.t ranslate(s .title);s. scope=s.sc ope||ed;if (!s.onsele ct){s.onse lect=funct ion(v){ed. execComman d(s.cmd,s. ui||false, v||s.value );};}s=ext end({title :s.title,' class':'mc e_'+id,sco pe:s.scope ,control_m anager:t}, s);id=t.pr efix+id;if (ed.settin gs.use_nat ive_select s)c=new ti nymce.ui.N ativeListB ox(id,s);e lse c=new  tinymce.ui .ListBox(i d,s);t.con trols[id]= c;if(tinym ce.isWebKi t){c.onPos tRender.ad d(function (c,n){Even t.add(n,'m ousedown', function() {ed.bookma rk=ed.sele ction.getB ookmark('s imple');}) ;Event.add (n,'focus' ,function( ){ed.selec tion.moveT oBookmark( ed.bookmar k);ed.book mark=null; });});}if( c.hideMenu )ed.onMous eDown.add( c.hideMenu ,c);return  t.add(c); },createBu tton:funct ion(id,s){ var t=this ,ed=t.edit or,o,c;if( t.get(id)) return nul l;s.title= ed.transla te(s.title );s.scope= s.scope||e d;if(!s.on click&&!s. menu_butto n){s.oncli ck=functio n(){ed.exe cCommand(s .cmd,s.ui| |false,s.v alue);};}s =extend({t itle:s.tit le,'class' :'mce_'+id ,unavailab le_prefix: ed.getLang ('unavaila ble',''),s cope:s.sco pe,control _manager:t },s);id=t. prefix+id; if(s.menu_ button){c= new tinymc e.ui.MenuB utton(id,s );ed.onMou seDown.add (c.hideMen u,c);}else  c=new tin ymce.ui.Bu tton(id,s) ;return t. add(c);},c reateMenuB utton:func tion(id,s) {s=s||{};s .menu_butt on=1;retur n this.cre ateButton( id,s);},cr eateSplitB utton:func tion(id,s) {var t=thi s,ed=t.edi tor,cmd,c; if(t.get(i d))return  null;s.tit le=ed.tran slate(s.ti tle);s.sco pe=s.scope ||ed;if(!s .onclick){ s.onclick= function(v ){ed.execC ommand(s.c md,s.ui||f alse,v||s. value);};} if(!s.onse lect){s.on select=fun ction(v){e d.execComm and(s.cmd, s.ui||fals e,v||s.val ue);};}s=e xtend({tit le:s.title ,'class':' mce_'+id,s cope:s.sco pe,control _manager:t },s);id=t. prefix+id; c=t.add(ne w tinymce. ui.SplitBu tton(id,s) );ed.onMou seDown.add (c.hideMen u,c);retur n c;},crea teColorSpl itButton:f unction(id ,s){var t= this,ed=t. editor,cmd ,c;if(t.ge t(id))retu rn null;s. title=ed.t ranslate(s .title);s. scope=s.sc ope||ed;if (!s.onclic k){s.oncli ck=functio n(v){ed.ex ecCommand( s.cmd,s.ui ||false,v| |s.value); };}if(!s.o nselect){s .onselect= function(v ){ed.execC ommand(s.c md,s.ui||f alse,v||s. value);};} s=extend({ title:s.ti tle,'class ':'mce_'+i d,'menu_cl ass':ed.ge tParam('sk in')+'Skin ',scope:s. scope,more _colors_ti tle:ed.get Lang('more _colors')} ,s);id=t.p refix+id;c =new tinym ce.ui.Colo rSplitButt on(id,s);e d.onMouseD own.add(c. hideMenu,c );ed.onRem ove.add(fu nction(){c .destroy() ;});return  t.add(c); },createTo olbar:func tion(id,s) {var c,t=t his;id=t.p refix+id;c =new tinym ce.ui.Tool bar(id,s); if(t.get(i d))return  null;retur n t.add(c) ;},createS eparator:f unction(){ return new  tinymce.u i.Separato r();}});}) ();(functi on(){var D ispatcher= tinymce.ut il.Dispatc her,each=t inymce.eac h,isIE=tin ymce.isIE, isOpera=ti nymce.isOp era;tinymc e.create(' tinymce.Wi ndowManage r',{Window Manager:fu nction(ed) {var t=thi s;t.editor =ed;t.onOp en=new Dis patcher(t) ;t.onClose =new Dispa tcher(t);t .params={} ;t.feature s={};},ope n:function (s,p){var  t=this,f=' ',x,y,mo=t .editor.se ttings.dia log_type== 'modal',w, sw,sh,vp=t inymce.DOM .getViewPo rt(),u;s=s ||{};p=p|| {};sw=isOp era?vp.w:s creen.widt h;sh=isOpe ra?vp.h:sc reen.heigh t;s.name=s .name||'mc _'+new Dat e().getTim e();s.widt h=parseInt (s.width|| 320);s.hei ght=parseI nt(s.heigh t||240);s. resizable= true;s.lef t=s.left|| parseInt(s w/ 2.0) -  (s.width / 2.0);s.top =s.top||pa rseInt(sh/  2.0) - (s .height /2 .0);p.inli ne=false;p .mce_width =s.width;p .mce_heigh t=s.height ;p.mce_aut o_focus=s. auto_focus ;if(mo){if (isIE){s.c enter=true ;s.help=fa lse;s.dial ogWidth=s. width+'px' ;s.dialogH eight=s.he ight+'px'; s.scroll=s .scrollbar s||false;} else s.mod al=s.alway sRaised=s. dialog=s.c enterscree n=s.depend ent=true;} each(s,fun ction(v,k) {if(tinymc e.is(v,'bo olean'))v= v?'yes':'n o';if(!/^( name|url)$ /.test(k)) {if(isIE&& mo)f+=(f?' ;':'')+k+' :'+v;else  f+=(f?',': '')+k+'='+ v;}});t.fe atures=s;t .params=p; t.onOpen.d ispatch(t, s,p);u=s.u rl||s.file ;if(tinymc e.relaxedD omain)u+=( u.indexOf( '?')==-1?' ?':'&')+'m ce_rdomain ='+tinymce .relaxedDo main;try{i f(isIE&&mo ){w=1;wind ow.showMod alDialog(s .url||s.fi le,window, f);}else w =window.op en(u,s.nam e,f);}catc h(ex){}if( !w)alert(t .editor.ge tLang('pop up_blocked '));},clos e:function (w){w.clos e();this.o nClose.dis patch(this );},create Instance:f unction(cl ,a,b,c,d,e ){var f=ti nymce.reso lve(cl);re turn new f (a,b,c,d,e );},confir m:function (t,cb,s){c b.call(s|| this,confi rm(this._d ecode(this .editor.ge tLang(t,t) )));},aler t:function (t,cb,s){a lert(this. _decode(t) );if(cb)cb .call(s||t his);},_de code:funct ion(s){ret urn tinymc e.DOM.deco de(s).repl ace(/\\n/g ,'\n');}}) ;}());