Changeset 3137 for trunk


Ignore:
Timestamp:
01/16/11 18:58:48 (9 years ago)
Author:
jukka
Message:

Enhanced tinymce and rewrote parser. Better latex support and nicer code.

Location:
trunk
Files:
4 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LatexTool.py

    r3136 r3137  
    157157    # This is the method you should call.  
    158158 
    159     def getImageFor(self, latexCode, charheightpx=17): 
     159    def getImageFor(self, latexCode, charheightpx=17, delim=True): 
    160160        if LATEX_IMAGES_STORAGE_PATH: 
    161161            try: 
    162162            #print latexCode 
    163                 return self.getLocalImageFor(latexCode, charheightpx) 
     163                return self.getLocalImageFor(latexCode, charheightpx, delim) 
    164164            except (IOError, LatexSyntaxError), data: 
    165165            #    print data 
     
    167167                self.log(errors, 'LatexSyntaxError') 
    168168        if EXTERNAL_LATEX_SERVICE: 
    169             return self.getRemoteImageFor(latexCode)             
     169            return self.getRemoteImageFor(latexCode, delim)             
    170170        else: 
    171171            return latexCode             
    172172 
    173     def getLocalImageFor(self, latexCode, charheightpx=17):     
     173    def getLocalImageFor(self, latexCode, charheightpx=17, delim=True):     
    174174        print 'using local latex' 
    175175        portal_url = getToolByName(self, 'portal_url') 
     
    181181        imageUrl = '%s/%s/%s' % (portal_url(), LATEX_IMAGES_STORAGE_PATH, imageFile) 
    182182        width, height = self.getPngSize(os.path.join(workingDir, imageFile)) 
    183         alt = html_quote(latexRemoveDelim.match(latexCode).group(2)) 
     183        if delim: 
     184            alt = html_quote(latexRemoveDelim.match(latexCode).group(2)) 
     185        else: 
     186            alt=html_quote(latexCode) 
    184187        return '%s<img alt="%s" class="equation" src="%s" width="%s" height="%s"/>%s' %(preamble, 
    185188                                                                alt, 
     
    189192                                                                postamble) 
    190193 
    191     def getRemoteImageFor(self, latexCode): 
     194    def getRemoteImageFor(self, latexCode, delim=True): 
    192195        print 'using remote latex' 
    193196        code=unescape(latexCode) 
    194         code=latexRemoveDelim.match(code).group(2) 
     197        if delim: 
     198            code=latexRemoveDelim.match(code).group(2) 
    195199        alt= html_quote(code) 
    196200        src=''.join((EXTERNAL_LATEX_SERVICE,quote_plus(code))) 
  • trunk/LeMillTool.py

    r3107 r3137  
    4343import calendar 
    4444from Products.ZCatalog.Lazy import LazyCat 
    45 from HTMLParser import HTMLParser 
     45from HTMLParser import HTMLParser, HTMLParseError 
    4646from messagefactory_ import i18nme as _ 
    4747 
     
    6464urlfinder=re.compile(r"(http://\S*)", re.IGNORECASE) 
    6565 
    66 pattern=re.compile(r""" 
    67     (?P<html_open><\s*?(?P<html_tag>[a-z!][^\s>]*).*?>) # opening html tags, those that begin with '<x', where x is a letter  
    68     |(?P<html_block_close></(?P<closing_tag>[^<]*?)>\ *?(?P<linebreaks>\r\n|\r|\n{1,4})) # closing html tags and also collect immediate linebreaks.  
    69     |(?P<html_close></(?P<close_tag>.*?)>) # closing html tags 
    70     |(?P<url>(?<!"|'|=)http://[^\s'"<]*) # http://something, where http is not preceded with " or ' 
    71     |(?P<bracket>\[.*?\]) # everything that is put inside brackets 
    72     |(?P<tex>\\\(.*?\\\)) # tex should be written inside \( ... \)  
    73     |(?P<tex_equation>\\begin\{(?P<tex_tag>.*?)\}(?P<tex_string>.*?)\\end\{(?P=tex_tag)\}) # detect \begin{smthing}...\end{smthing} 
    74     |(?P<paragraph>\r\n\r\n|\r\r|\n\n) # two linebreaks in a row make a paragraph. 
    75     |(?P<linebreak>\r\n|\r|\n) # detect linebreaks  
    76     |(?P<awordtoolong>[^ \t\n\r\f\v<>]{61}) # detect >40 char words,     
    77     """, re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL) 
    78  
    79  
    80  
    81 # These tags are allowed 
    82 whitelist=re.compile(r""" 
    83     ^(p 
    84     |a 
    85     |br 
    86     |strong 
    87     |b 
    88     |i 
    89     |em 
    90     |h2 
    91     |pre 
    92     |li 
    93     |ul 
    94     |ol 
    95     |table 
    96     |tr 
    97     |th 
    98     |td 
    99     |sub 
    100     |sup 
    101     |dt 
    102     |dd)$""", re.IGNORECASE | re.VERBOSE) 
    103  
    104 # These tags create line-endings by themselves and should not have <br/>:s after them. 
    105 BLOCK_TAGS=['p','h2','pre','li','ul','ol','table','dt','dd'] 
    106  
    107 # These tags get special treatment 
    108 restricted=re.compile(r""" 
    109     (?P<img>img) 
    110     |(?P<embed>embed) 
    111     |(?P<object>object) 
    112     |(?P<iframe>iframe) 
    113     |(?P<script>script) 
    114     |(?P<applet>applet) 
    115     """, re.IGNORECASE | re.VERBOSE) 
    116  
    117 attribute_whitelist=re.compile(r""" 
    118     (href 
    119     |name 
    120     |colspan 
    121     |rowspan 
    122     |align 
    123     |valign 
    124     |alt 
    125     |border 
    126     |type 
    127     |start 
    128     |target) 
    129     """, re.IGNORECASE | re.VERBOSE) 
    130      
    131 attribute_finder=re.compile(r""" 
    132     \b(?P<attribute>(?P<attrib_name>\w*?) # detect attribute name: [space]attrib_name[word_end] 
    133     \s*?=\s*?['"]?                        # [spaces?]=[spaces?][stringquotes?] 
    134     (?P<attrib_value>[^'">]*?)['">]    # match until stringquotes, space or '>'. Bad thing is that '>' gets eaten. (Modified by Gabor: there can be spaces in attributes so I removed this.) 
    135     )""", re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL) 
    136  
    137 attribute_javascript=re.compile(r"script:", re.IGNORECASE | re.MULTILINE) 
    13866 
    13967html_strip=re.compile(r""" 
     
    16088EXTRA_DASHES_REGEX = re.compile(r"(^\-+)|(\-+$)") 
    16189 
     90################## 
     91## LeMillParser ## 
     92 
     93# whitelist   
     94attribs={"p":[],"a":["href","target","name", "title"],"br":[],"strong":[],"b":[],"i":[],"em":[],"h2":[],"code":["class"],"pre":[],"li":[],"ul":[],"ol":[],"table":["width", "height", "border", "padding", "margin"],"tbody":["width", "height", "border", "padding", "margin"], "tr":["width","height","rowspan"],"th":["width","height","colspan","rowspan"],"td":["width","height","colspan"],"sub":[],"sup":[],"dt":[],"dd":[]} 
     95good_tags=attribs.keys() 
     96 
     97# block tags -- when one of these is encountered, don't change linebreaks to </br>:s anymore. 
     98block_tags=['p','table','ul','ol','h2']  
     99 
     100# search pattern 
     101parser_pattern=re.compile(r""" 
     102    (?P<bracket>\[.*?\]) # everything that is put inside brackets 
     103    |(?P<url>https?://[^\s]*) # http://something, where http is not preceded with " or ' 
     104    |(?P<tex>\\\(.*?\\\)) # tex should be written inside \( ... \)  
     105    |(?P<tex_equation>\\begin\{(?P<tex_tag>.*?)\}(?P<tex_string>.*?)\\end\{(?P=tex_tag)\}) # maybe we should get rid of this 
     106    """, re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL) 
     107 
     108linebreak_pattern=re.compile(r"\r\n|\n|\r")          
     109 
     110 
     111class LeMillParser(HTMLParser): 
     112    def __init__(self, latex_tool, portal_catalog, **kwargs): 
     113        self.no_tags=True 
     114        self.open_tags=[] 
     115        self.resdata=[] 
     116        self.latex=False 
     117        self.latex_code=[] 
     118        self.pre=False 
     119        self.lt=latex_tool 
     120        self.pc=portal_catalog 
     121        HTMLParser.__init__(self, **kwargs) 
     122 
     123    def handle_starttag(self, tag, attrs): 
     124        if self.pre or self.latex:  
     125            # add tags as they are if we are inside code or preformatted text 
     126            self.resdata.append(self.get_starttag_text()) 
     127            return 
     128        if self.no_tags: 
     129            if tag in block_tags: 
     130                self.no_tags=False 
     131        if tag in good_tags: 
     132            self.open_tags.append(tag) 
     133            if tag=='code':  
     134                if ('class','latex') in attrs: # don't add the <code class="latex">, instead start a new latex build  
     135                    self.latex=True 
     136                    self.latex_code=[] 
     137                    return 
     138                else: 
     139                    self.pre=True 
     140            good_attrs=attribs[tag] 
     141            adats=[] 
     142            for key,value in attrs: 
     143                if key in good_attrs: 
     144                    adats.append(''.join((' ',key,'="',value,'"')))                 
     145            self.resdata.append(''.join(('<',tag,''.join(adats),'>'))) 
     146            if tag=='pre':  
     147                self.pre=True 
     148 
     149    def handle_endtag(self, tag):         
     150        if self.pre: 
     151            if tag=='pre' or (tag=='code' and not self.latex): 
     152                self.resdata.append(''.join(('</',tag,'>\n'))) 
     153                self.pre=False              
     154        elif self.latex: 
     155            if tag=='code': 
     156                self.latex=False 
     157                self.open_tags.remove('code') 
     158                self.resdata.append(self.handle_tex(''.join(self.latex_code), delim=False))                 
     159                return 
     160            else: 
     161                self.latex_code.append(''.join(('</',tag,'>\n'))) 
     162 
     163        if tag in self.open_tags: 
     164            self.open_tags.remove(tag) 
     165            self.resdata.append(''.join(('</',tag,'>\n'))) 
     166 
     167    def handle_bracket(self, full_tag): 
     168        # Separate link and links title, if given 
     169        link=full_tag[1:-1].split(' ',1) # [1:-1]: '[linky dinky tinky]'->'linky dinky tinky',  
     170        # split(' ',1): 'linky dinky tinky' -> ['linky','dinky tinky'] 
     171        if len(link)==1: 
     172            link_name=link[0] 
     173        else: 
     174            link_name=link[1] 
     175        # Check link validity     
     176        if link[0].startswith("http://"): # external links won't need any processing 
     177            link=link[0] 
     178        elif link[0] and not bad_link_chars.search(link[0]): 
     179            matches=self.pc({'getId':link[0].lower()}) # find things with this id 
     180            if matches: 
     181                # one match 
     182                if len(matches)==1:                     
     183                    link=matches[0].getURL() 
     184                    if len(link)==1: 
     185                        link_name = matches[0].Title 
     186                else: 
     187                    # multiple matches, probably some of these are discussion objects, ignore these 
     188                    for m in matches: 
     189                        if m.portal_type!='BlogPost': 
     190                            link=m.getURL() 
     191                            if len(link)==1: 
     192                                link_name = m.Title 
     193                            continue 
     194            else: 
     195                # bad search, let's not try this again 
     196                link='' 
     197        else: 
     198            # not a valid link 
     199            link='' 
     200        if link: 
     201            return '<a href="%s">%s</a>' % (link, link_name) 
     202        else: 
     203            return full_tag 
     204 
     205    def handle_url(self, url): 
     206        return '<a href="%s">%s</a>' % (url, url) 
     207 
     208    def handle_tex_equation(self, tex, tag): 
     209        if tag[-1]!='*':  # adding * will remove equation numbering 
     210            full_tag='\\begin{%s*}%s\\end{%s*}' % (tag, tex, tag) 
     211        img=''' 
     212        <table width="100%%"> 
     213            <tr> 
     214                <td align="center"> 
     215                    %s 
     216                </td> 
     217            </tr> 
     218        </table> 
     219        ''' % self.lt.getImageFor(full_tag, 17) 
     220        return img        
     221         
     222    def handle_tex(self, tex, delim=True): 
     223        img=self.lt.getImageFor(tex, 17, delim)     
     224        return img 
     225 
     226    def replaceMethod(self, groups): 
     227        if groups.group('bracket'): 
     228            return self.handle_bracket(groups.group('bracket')) 
     229        elif groups.group('url'): 
     230            return self.handle_url(groups.group('url')) 
     231        elif groups.group('tex_equation'): 
     232            return self.handle_tex_equation(groups.group('tex_string'),groups.group('tex_tag')) 
     233        elif groups.group('tex'): 
     234            return self.handle_tex(groups.group('tex'))         
     235 
     236    def handle_data(self, data): 
     237        if self.pre: 
     238            self.resdata.append(data) 
     239            return 
     240        elif self.latex: 
     241            self.latex_code.append(data) 
     242            return 
     243        if data: 
     244            if self.no_tags:            
     245                data=linebreak_pattern.sub(lambda x: '<br/>', data)                 
     246            data=parser_pattern.sub(self.replaceMethod, data) 
     247            self.resdata.append(data) 
    162248 
    163249class MLStripper(HTMLParser): 
     
    208294        request.RESPONSE.setCookie('statusmessages', value, path='/') 
    209295 
    210      
     296 
    211297    def parse_text(self, text, start_with_p=True): 
    212         """ Parses all tags and other strings of interest in text, replaces them with displayable version """ 
    213  
    214         #if type(text)==ImplicitAcquirer 
    215         if not text: 
    216             return text 
    217  
    218         if type(text)==list: 
    219             return [self.parse_text(t, start_with_p=start_with_p) for t in text] # recursion! 
    220  
    221         if type(text)==tuple and len(text)==2: # Chapters from exercise template 
    222             if text[1] in ['media_piece','image_piece','audio_piece']: 
    223                 return text 
    224             else: 
    225                 return (self.parse_text(text[0], start_with_p=start_with_p), text[1]) # ('chaptertext', 'type') 
    226      
    227         # global regex 'pattern' contains expressions to find these cases and groups them by type         
    228         # These are the methods to replace matched cases of certain type 
    229  
    230         def replace_attributes(match): 
    231             attrib_name=match.group('attrib_name') 
    232             attrib_value=match.group('attrib_value') 
    233             if attrib_name and attrib_value: 
    234                 if attribute_whitelist.match(attrib_name) and not attribute_javascript.match(attrib_value): 
    235                     return match.group('attribute')             
    236             return '' 
    237  
    238         def html_open(match):             
    239             full_tag=match.group('html_open') 
    240             tag=match.group('html_tag') 
    241             if tag: 
    242                 tag_match=re.match(whitelist,tag) 
    243             else: 
    244                 pass 
    245                 #print full_tag 
    246                 pass 
    247             if tag and tag_match: 
    248                 tag=tag_match.group()                 
    249                 if len(tag)+5 < len(full_tag): # if tag is very short it can't have attributes so don't bother searching 
    250                     full_tag=attribute_finder.sub(replace_attributes, full_tag) 
    251                     if not full_tag.endswith('>'): 
    252                         full_tag='%s>' % full_tag 
    253                 if not full_tag.endswith('/>'): # also deals with self-closing tags like <br/> 
    254                     open_user_tags.append(tag.lower()) 
    255                 #print 'accepted:%s###' % tag 
    256                 return full_tag 
    257             if tag:     
    258                 tag_match=re.match(restricted, tag)             
    259             if tag and tag_match: 
    260                 if self.isGoodEmbed(full_tag): 
    261                     if not full_tag.endswith('/>'): # also deals with self-closing tags like <br/> 
    262                        open_user_tags.append(tag_match.group().lower())                     
    263                     return full_tag 
    264                 return '' 
    265             #print 'discarded:%s###'% tag 
    266             return '' 
    267      
    268         def html_block_close(match): 
    269             full_tag=match.group('html_block_close') 
    270             tag=match.group('closing_tag').lower()   
    271             linebreaks=match.group('linebreaks') 
    272             if tag in open_user_tags: 
    273                 open_user_tags.remove(tag) 
    274                 if tag in BLOCK_TAGS:  
    275                     return '</%s>' % tag  
    276                 elif len(linebreaks) == 1 or linebreaks=='\r\n': 
    277                     return '</%s>' % tag#no additional <br /> tag here, as it was generating a long space before the table 
    278                 elif open_tags: 
    279                     if open_tags[-1]=='p': 
    280                         open_tags.remove('p') 
    281                         open_tags.append('p') 
    282                         return '</%s></p><p>' % tag 
    283                     else: 
    284                         open_tags.append('p') 
    285                         return '</%s><p>' % tag 
    286             else: 
    287                 return '' 
    288  
    289         def html_close(match): 
    290             full_tag=match.group('html_close') 
    291             tag=match.group('close_tag').lower() 
    292             if tag in open_user_tags: 
    293                 open_user_tags.remove(tag) 
    294                 return full_tag 
    295             else: 
    296                 return '' 
    297      
    298         def url(match): 
    299             url=match.group('url') 
    300             if 'a' in open_tags+open_user_tags: 
    301                 return self.shorten_url(url) 
    302             elif 'pre' in open_user_tags: 
    303                 return self.shorten_url(url, linebreak='\n') 
    304             if len(url)>50: 
    305                 link_text=self.shorten_url(url) 
    306             else: 
    307                 link_text=url 
    308             return '<a href="%s">%s</a>' % (url,link_text) 
    309      
    310         def bracket(match): 
    311             full_tag=match.group('bracket') 
    312             if not use_bracket_notation: 
    313                 return full_tag 
    314             if 'pre' in open_user_tags: 
    315                 return full_tag 
    316             pc=getToolByName(self, 'portal_catalog') 
    317             # Separate link and links title, if given 
    318             link=full_tag[1:-1].split(' ',1) # [1:-1]: '[linky dinky tinky]'->'linky dinky tinky',  
    319             # split(' ',1): 'linky dinky tinky' -> ['linky','dinky tinky'] 
    320             if len(link)==1: 
    321                 link_name=link[0] 
    322             else: 
    323                 link_name=link[1] 
    324             # Check link validity     
    325             if link[0].startswith("http://"): # external links won't need any processing 
    326                 link=link[0] 
    327             elif link[0] and not bad_link_chars.search(link[0]): 
    328                 matches=pc({'getId':link[0].lower()}) # find things with this id 
    329                 if matches: 
    330                     # one match 
    331                     if len(matches)==1:                     
    332                         link=matches[0].getURL() 
    333                         if len(link)==1: 
    334                             link_name = matches[0].Title 
    335                     else: 
    336                         # multiple matches, probably some of these are discussion objects, ignore these 
    337                         for m in matches: 
    338                             if m.portal_type!='BlogPost': 
    339                                 link=m.getURL() 
    340                                 if len(link)==1: 
    341                                     link_name = m.Title 
    342                                 continue 
    343                 else: 
    344                     # bad search, let's not try this again 
    345                     link='' 
    346                     use_bracket_notation.pop() 
    347             else: 
    348                 # not a valid link 
    349                 link='' 
    350             if link: 
    351                 return '<a href="%s">%s</a>' % (link, link_name) 
    352             else: 
    353                 return full_tag 
    354              
    355         def tex(match): 
    356             code=match.group('tex') 
    357             if 'pre' in open_user_tags: 
    358                 return code 
    359             lt=getToolByName(self, 'latex_tool') 
    360             img=lt.getImageFor(code, 17)     
    361             return img 
    362  
    363         def tex_equation(match): 
    364             full_tag=match.group('tex_equation') 
    365             if 'pre' in open_user_tags: 
    366                 return full_tag 
    367             tex_tag=match.group('tex_tag') 
    368             if tex_tag[-1]!='*':  # adding * will remove equation numbering 
    369                 tex_string=match.group('tex_string') 
    370                 full_tag='\\begin{%s*}%s\\end{%s*}' % (tex_tag, tex_string, tex_tag) 
    371             lt=getToolByName(self, 'latex_tool') 
    372             img=''' 
    373             <table width="100%%"> 
    374                 <tr> 
    375                     <td align="center"> 
    376                         %s 
    377                     </td> 
    378                 </tr> 
    379             </table> 
    380             ''' % lt.getImageFor(full_tag, 17) 
    381             return img        
    382  
    383  
    384         def paragraph(match): 
    385             full_tag=match.group('paragraph') 
    386             if open_user_tags: 
    387                 return full_tag 
    388             taggy='' 
    389             if open_tags and open_tags[-1]=='p': 
    390                 open_tags.remove('p') 
    391                 taggy='</p>' 
    392             if not open_tags: 
    393                 open_tags.append('p') 
    394                 taggy='%s<p>' % taggy                 
    395             return taggy 
    396              
    397      
    398         def linebreak(match): 
    399             full_tag=match.group('linebreak') 
    400             if open_user_tags or match.group('tex') or match.group('tex_equation'): 
    401                 return full_tag 
    402             else: 
    403                 return '<br/>' 
    404  
    405         def awordtoolong(match): 
    406             full_tag=match.group('awordtoolong') 
    407             return self.shorten_url(full_tag)             
    408  
    409         def close_all_tags(): 
    410             """ close tags that are left open """ 
    411             closed_tags=''  
    412             for tag in open_tags+open_user_tags: 
    413                 closed_tags='</%s>%s' % (tag, closed_tags) # </b> -> </p></b> 
    414             return closed_tags 
    415  
    416         def start_p(text): 
    417             """ add <p> if text doesn't start with a tag """ 
    418             # changed re.compile('\A\w') to not re.compile('\A\<'), because text can also start with special unicode characters 
    419             if start_with_p and not re.compile('\A\<').match(text.lstrip()): 
    420                 open_tags.append('p') 
    421                 return '<p>' 
    422             else: 
    423                 return '' 
    424  
    425         # this method gets called for every string-of-interest and forwards to correct replacer-method 
    426         def replacements(match):     
    427             # here the order of ifs affects the results: for example the 'linebreak' case shouldn't happen 
    428             # if we're inside tags. I'm not sure, must test this theory. 
    429             if match.group('html_open'): 
    430                 return html_open(match) 
    431             elif match.group('html_block_close'): 
    432                 return html_block_close(match) 
    433             elif match.group('html_close'): 
    434                 return html_close(match) 
    435             elif match.group('url'): 
    436                 return url(match) 
    437             elif match.group('bracket'): 
    438                 return bracket(match) 
    439             elif match.group('tex'): 
    440                 return tex(match) 
    441             elif match.group('tex_equation'): 
    442                 return tex_equation(match) 
    443             elif match.group('paragraph'): 
    444                 return paragraph(match) 
    445             elif match.group('linebreak'): 
    446                 return linebreak(match) 
    447             elif match.group('awordtoolong'): 
    448                 return awordtoolong(match) 
    449                      
    450         # Defect #1722, if chapter contains javascript or other code that uses brackets, 
    451         # disable bracket parsing  
    452         use_bracket_notation=[True] 
    453  
    454         open_tags=[] 
    455         open_user_tags=[] 
    456         return '%s%s%s' %(start_p(text), pattern.sub(replacements, text), close_all_tags()) 
     298        """ A simple parser, will stop if encounters bad html """ 
     299        t=time.time() 
     300        lt=getToolByName(self, 'latex_tool') 
     301        pc=getToolByName(self, 'portal_catalog') 
     302        parser=LeMillParser(lt,pc) 
     303        try: 
     304            parser.feed(text) 
     305        except HTMLParseError: 
     306            print '* error at ', parser.getpos() 
     307        # close open tags 
     308        parser.open_tags.reverse() 
     309        for tag in parser.open_tags: 
     310            parser.resdata.append('</'+tag+'>') 
     311        d=''.join(parser.resdata) 
     312        return d 
     313         
    457314 
    458315    def isGoodEmbed(self, code): 
  • trunk/skins/lemill/lemill_grid.css

    r3130 r3137  
    99} 
    1010 
     11body.mceContentBody { 
     12    padding: 0.5em; 
     13    width: 95%; 
     14} 
     15 
    1116img { 
    1217    border:0; 
     
    4146    font-weight: bold; 
    4247} 
     48 
     49code.latex { 
     50    border: 1px dotted #77BB22; 
     51    background-color: #d2f7dc; 
     52} 
     53 
     54pre { 
     55    font-family: Monaco, "Courier New", Courier, monospace; 
     56    padding: 1em; 
     57    border: 1px solid #8cacbb; 
     58    color: black; 
     59    background-color: #dee7ec; 
     60    max-width: 720px; 
     61    overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ 
     62    white-space: pre-wrap; /* css-3 */ 
     63    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ 
     64    white-space: -pre-wrap; /* Opera 4-6 */ 
     65    white-space: -o-pre-wrap; /* Opera 7 */ /* 
     66    width: 99%; */ 
     67    word-wrap: break-word; /* Internet Explorer 5.5+ */ 
     68} 
     69 
    4370 
    4471/* Visual adjustments */ 
     
    603630} 
    604631 
    605 .form_submit input[type='submit'] { 
     632.form_submit input[type='submit'], .form_submit input[type='button'] { 
    606633    font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif;    
    607634    font-size: 16px; 
     
    613640    -moz-border-radius: 5px; 
    614641} 
    615 .form_submit input[type='submit'].save { 
     642.form_submit input.save { 
    616643    background-color:#77BB22; 
    617644} 
    618 .form_submit input[type='submit'].save:hover { 
     645.form_submit input.save:hover { 
    619646    background-color:#99dd44; 
    620647} 
    621 .form_submit input[type='submit'].save:disabled { 
     648.form_submit input.save:disabled { 
    622649    background-color:#dddddd; 
    623650} 
    624651 
    625652 
    626 .form_submit input[type='submit'].cancel { 
     653.form_submit input.cancel { 
    627654    background-color:#ccdd77; 
    628655} 
    629 .form_submit input[type='submit'].cancel:hover { 
     656.form_submit input.cancel:hover { 
    630657    background-color:#ddee88; 
    631658} 
     
    955982.defaultSkin span.mce_table {background-position:-240px 0} 
    956983.defaultSkin span.mce_html {background-position:-260px 0} 
     984.defaultSkin span.mce_charmap {background-position:-300px 0} 
     985.defaultSkin span.mce_latex {background-position:-320px 0} 
    957986 
    958987/* ListBox */ 
    959988.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} 
    960 .defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} 
    961 .defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(images/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} 
     989.defaultSkin .mceListBox .mceText {padding-left:4px; width:110px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} 
     990.defaultSkin .mceListBox .mceOpen {width:11px; height:20px; background:url(images/icons.gif) -288px 0; margin-right:2px; border:1px solid #CCC;} 
    962991.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} 
    963992.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} 
    964993.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} 
    965 .defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} 
     994.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden;} 
    966995.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} 
    967996.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} 
     
    969998 
    970999/* Menu */ 
     1000 
    9711001.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} 
    9721002.defaultSkin .mceNoIcons span.mceIcon {width:0;} 
     
    9911021 
    9921022 
     1023 
    9931024.defaultSkin span.mceText {color: black; text-decoration: none; font-size: 13px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;} 
    9941025.defaultSkin .preview_heading span.mceText {font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;font-size: 21px;font-weight: bold;} 
  • trunk/skins/lemill/master.js

    r3114 r3137  
    11491149       script_url : portal_url+'/tiny_mce/tiny_mce.js', 
    11501150       theme : "lemill", 
    1151        content_css : portal_url+"/master.css", 
    1152        plugins : "table",//inlinepopups", 
     1151       content_css : portal_url+"/lemill_grid.css", 
     1152       plugins : "table",//inlinepopups, contextmenu", 
    11531153       convert_newlines_to_brs : false, 
    11541154       cleanup_on_startup : true, 
    11551155       entity_encoding : "raw", 
     1156       lrurl : "http://chart.apis.google.com/chart?cht=tx&chl=", 
    11561157    }); 
    11571158}); 
  • trunk/skins/lemill/tiny_mce/jquery.tinymce.js

    r3112 r3137  
    1 (function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);if(v){s.onInit.add(function(){var x,y=v;if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}})}});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); 
     1(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); 
  • trunk/skins/lemill/tiny_mce/langs/en.js

    r3015 r3137  
    9191paste_text_desc:"Paste as Plain Text", 
    9292paste_word_desc:"Paste from Word", 
    93 selectall_desc:"Select All" 
     93selectall_desc:"Select All", 
     94plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", 
     95plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." 
    9496}, 
    9597paste_dlg:{ 
     
    122124autosave:{ 
    123125unload_msg:"The changes you made will be lost if you navigate away from this page.", 
    124 restore_content: "Restore auto-saved content", 
    125 warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" 
     126restore_content:"Restore auto-saved content.", 
     127warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." 
    126128}, 
    127129fullscreen:{ 
     
    155157desc:"Insert page break." 
    156158}, 
    157 advlist : { 
    158     types : 'Types', 
    159     def : 'Default', 
    160     lower_alpha : "Lower alpha", 
    161     lower_greek : "Lower greek", 
    162     lower_roman : "Lower roman", 
    163     upper_alpha : "Upper alpha", 
    164     upper_roman : "Upper roman", 
    165     circle : "Circle", 
    166     disc : "Disc", 
    167     square : "Square" 
    168 } 
    169 }}); 
     159advlist:{ 
     160types:"Types", 
     161def:"Default", 
     162lower_alpha:"Lower alpha", 
     163lower_greek:"Lower greek", 
     164lower_roman:"Lower roman", 
     165upper_alpha:"Upper alpha", 
     166upper_roman:"Upper roman", 
     167circle:"Circle", 
     168disc:"Disc", 
     169square:"Square" 
     170}}}); 
  • trunk/skins/lemill/tiny_mce/plugins/table/editor_plugin.js

    r3015 r3137  
    1 (function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q<N+R;Q++){if(!e[Q]){e[Q]=[]}for(P=O;P<O+S;P++){e[Q][P]={part:K,real:Q==N&&P==O,elm:T,rowspan:R,colspan:S}}}})});J+=L.length})}function v(J,L){var K;K=e[L];if(K){return K[J]}}function g(K,J){return parseInt(K.getAttribute(J)||1)}function h(J){return D.hasClass(J.elm,"mceSelected")||J==n}function j(){var J=[];c(E.rows,function(K){c(K.cells,function(L){if(D.hasClass(L,"mceSelected")||L==n.elm){J.push(K);return false}})});return J}function q(){var J=D.createRng();J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E)}function d(J){var K;b.walk(J,function(M){var L;if(M.nodeType==3){c(D.getParents(M.parentNode,null,J).reverse(),function(N){N=N.cloneNode(false);if(!K){K=L=N}else{if(L){L.appendChild(N)}}L=N});if(L){L.innerHTML=b.isIE?"&nbsp;":'<br _mce_bogus="1" />'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='<br _mce_bogus="1" />'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N<P-1;N++){D.insertAfter(d(M),M)}s(L,K,O-1,P)}}})})}function o(R,O,U){var M,L,T,S,Q,N,P,J,R,K;if(R){pos=C(R);M=pos.x;L=pos.y;T=M+(O-1);S=L+(U-1)}else{M=I.x;L=I.y;T=A.x;S=A.y}P=v(M,L);J=v(T,S);if(P&&J&&P.part==J.part){z();r();P=v(M,L).elm;P.colSpan=(T-M)+1;P.rowSpan=(S-L)+1;for(N=L;N<=S;N++){for(Q=M;Q<=T;Q++){R=e[N][Q].elm;if(R!=P){K=b.grep(R.childNodes);c(K,function(W,V){if(W.nodeName!="BR"||V!=K.length-1){P.appendChild(W)}});D.remove(R)}}}p()}}function k(M){var J,O,L,N,P,Q,K,R;c(e,function(S,T){c(S,function(V,U){if(h(V)){V=V.elm;P=V.parentNode;Q=P.cloneNode(false);J=T;if(M){return false}}});if(M){return !J}});for(N=0;N<e[0].length;N++){O=e[J][N].elm;if(O!=L){if(!M){rowSpan=g(O,"rowspan");if(rowSpan>1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;i<P;i++){O=Q.cells[i];O.colSpan=O.rowSpan=1}for(i=P;i<N;i++){Q.appendChild(d(Q.cells[P-1]))}for(i=N;i<P;i++){D.remove(Q.cells[i])}if(K){J.parentNode.insertBefore(Q,J)}else{D.insertAfter(Q,J)}})}function C(J){var K;c(e,function(L,M){c(L,function(O,N){if(O.elm==J){K={x:N,y:M};return false}});return !K});return K}function u(J){I=C(J)}function F(){var L,K,J;K=J=0;c(e,function(M,N){c(M,function(P,O){var R,Q;if(h(P)){P=e[N][O];if(O>K){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)<M){M-=P.colspan-1}}}for(x=M;x<=K;x++){P=e[L][x];if(!P.real){if(L-(P.rowspan-1)<L){L-=P.rowspan-1}}}for(y=L;y<=Q;y++){for(x=M;x<=R;x++){P=e[y][x];if(P.real){N=P.colspan-1;O=P.rowspan-1;if(N){if(x+N>K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'<br mce_bogus="1" />')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce); 
     1(function(c){var d=c.each;function b(f,g){var h=g.ownerDocument,e=h.createRange(),j;e.setStartBefore(g);e.setEnd(f.endContainer,f.endOffset);j=h.createElement("body");j.appendChild(e.cloneContents());return j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(G,F,J){var f,K,C,o;s();o=F.getParent(J.getStart(),"th,td");if(o){K=E(o);C=H();o=w(K.x,K.y)}function z(M,L){M=M.cloneNode(L);M.removeAttribute("id");return M}function s(){var L=0;f=[];d(["thead","tbody","tfoot"],function(M){var N=F.select("> "+M+" tr",G);d(N,function(O,P){P+=L;d(F.select("> td, > th",O),function(V,Q){var R,S,T,U;if(f[P]){while(f[P][Q]){Q++}}T=h(V,"rowspan");U=h(V,"colspan");for(S=P;S<P+T;S++){if(!f[S]){f[S]=[]}for(R=Q;R<Q+U;R++){f[S][R]={part:M,real:S==P&&R==Q,elm:V,rowspan:T,colspan:U}}}})});L+=N.length})}function w(L,N){var M;M=f[N];if(M){return M[L]}}function h(M,L){return parseInt(M.getAttribute(L)||1)}function j(L){return F.hasClass(L.elm,"mceSelected")||L==o}function k(){var L=[];d(G.rows,function(M){d(M.cells,function(N){if(F.hasClass(N,"mceSelected")||N==o.elm){L.push(M);return false}})});return L}function r(){var L=F.createRng();L.setStartAfter(G);L.setEndAfter(G);J.setRng(L);F.remove(G)}function e(L){var M;c.walk(L,function(O){var N;if(O.nodeType==3){d(F.getParents(O.parentNode,null,L).reverse(),function(P){P=z(P,false);if(!M){M=N=P}else{if(N){N.appendChild(P)}}N=P});if(N){N.innerHTML=c.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");L=z(L,false);L.rowSpan=L.colSpan=1;if(M){L.appendChild(M)}else{if(!c.isIE){L.innerHTML='<br data-mce-bogus="1" />'}}return L}function q(){var L=F.createRng();d(F.select("tr",G),function(M){if(M.cells.length==0){F.remove(M)}});if(F.select("tr",G).length==0){L.setStartAfter(G);L.setEndAfter(G);J.setRng(L);F.remove(G);return}d(F.select("thead,tbody,tfoot",G),function(M){if(M.rows.length==0){F.remove(M)}});s();row=f[Math.min(f.length-1,K.y)];if(row){J.select(row[Math.min(row.length-1,K.x)].elm,true);J.collapse(true)}}function t(R,P,T,Q){var O,M,L,N,S;O=f[P][R].elm.parentNode;for(L=1;L<=T;L++){O=F.getNext(O,"tr");if(O){for(M=R;M>=0;M--){S=f[P+L][M].elm;if(S.parentNode==O){for(N=1;N<=Q;N++){F.insertAfter(e(S),S)}break}}if(M==-1){for(N=1;N<=Q;N++){O.insertBefore(e(O.cells[0]),O.cells[0])}}}}}function B(){d(f,function(L,M){d(L,function(O,N){var R,Q,S,P;if(j(O)){O=O.elm;R=h(O,"colspan");Q=h(O,"rowspan");if(R>1||Q>1){O.colSpan=O.rowSpan=1;for(P=0;P<R-1;P++){F.insertAfter(e(O),O)}t(N,M,Q-1,R)}}})})}function p(T,Q,W){var O,N,V,U,S,P,R,L,T,M;if(T){pos=E(T);O=pos.x;N=pos.y;V=O+(Q-1);U=N+(W-1)}else{O=K.x;N=K.y;V=C.x;U=C.y}R=w(O,N);L=w(V,U);if(R&&L&&R.part==L.part){B();s();R=w(O,N).elm;R.colSpan=(V-O)+1;R.rowSpan=(U-N)+1;for(P=N;P<=U;P++){for(S=O;S<=V;S++){T=f[P][S].elm;if(T!=R){M=c.grep(T.childNodes);d(M,function(Y,X){if(Y.nodeName!="BR"||X!=M.length-1){R.appendChild(Y)}});F.remove(T)}}}q()}}function l(O){var L,Q,N,P,R,S,M,T;d(f,function(U,V){d(U,function(X,W){if(j(X)){X=X.elm;R=X.parentNode;S=z(R,false);L=V;if(O){return false}}});if(O){return !L}});for(P=0;P<f[0].length;P++){Q=f[L][P].elm;if(Q!=N){if(!O){rowSpan=h(Q,"rowspan");if(rowSpan>1){Q.rowSpan=rowSpan+1;continue}}else{if(L>0&&f[L-1][P]){T=f[L-1][P].elm;rowSpan=h(T,"rowspan");if(rowSpan>1){T.rowSpan=rowSpan+1;continue}}}M=e(Q);M.colSpan=Q.colSpan;S.appendChild(M);N=Q}}if(S.hasChildNodes()){if(!O){F.insertAfter(S,R)}else{R.parentNode.insertBefore(S,R)}}}function g(M){var N,L;d(f,function(O,P){d(O,function(R,Q){if(j(R)){N=Q;if(M){return false}}});if(M){return !N}});d(f,function(R,S){var O=R[N].elm,P,Q;if(O!=L){Q=h(O,"colspan");P=h(O,"rowspan");if(Q==1){if(!M){F.insertAfter(e(O),O);t(N,S,P-1,Q)}else{O.parentNode.insertBefore(e(O),O);t(N,S,P-1,Q)}}else{O.colSpan++}L=O}})}function n(){var L=[];d(f,function(M,N){d(M,function(P,O){if(j(P)&&c.inArray(L,O)===-1){d(f,function(S){var Q=S[O].elm,R;R=h(Q,"colspan");if(R>1){Q.colSpan=R-1}else{F.remove(Q)}});L.push(O)}})});q()}function m(){var M;function L(P){var O,Q,N;O=F.getNext(P,"tr");d(P.cells,function(R){var S=h(R,"rowspan");if(S>1){R.rowSpan=S-1;Q=E(R);t(Q.x,Q.y,1,1)}});Q=E(P.cells[0]);d(f[Q.y],function(R){var S;R=R.elm;if(R!=N){S=h(R,"rowspan");if(S<=1){F.remove(R)}else{R.rowSpan=S-1}N=R}})}M=k();d(M.reverse(),function(N){L(N)});q()}function D(){var L=k();F.remove(L);q();return L}function I(){var L=k();d(L,function(N,M){L[M]=z(N,true)});return L}function A(N,M){var O=k(),L=O[M?0:O.length-1],P=L.cells.length;d(f,function(R){var Q;P=0;d(R,function(T,S){if(T.real){P+=T.colspan}if(T.elm.parentNode==L){Q=1}});if(Q){return false}});if(!M){N.reverse()}d(N,function(S){var R=S.cells.length,Q;for(i=0;i<R;i++){Q=S.cells[i];Q.colSpan=Q.rowSpan=1}for(i=R;i<P;i++){S.appendChild(e(S.cells[R-1]))}for(i=P;i<R;i++){F.remove(S.cells[i])}if(M){L.parentNode.insertBefore(S,L)}else{F.insertAfter(S,L)}})}function E(L){var M;d(f,function(N,O){d(N,function(Q,P){if(Q.elm==L){M={x:P,y:O};return false}});return !M});return M}function v(L){K=E(L)}function H(){var N,M,L;M=L=0;d(f,function(O,P){d(O,function(R,Q){var T,S;if(j(R)){R=f[P][Q];if(Q>M){M=Q}if(P>L){L=P}if(R.real){T=R.colspan-1;S=R.rowspan-1;if(T){if(Q+T>M){M=Q+T}}if(S){if(P+S>L){L=P+S}}}}})});return{x:M,y:L}}function u(R){var O,N,T,S,M,L,P,Q;C=E(R);if(K&&C){O=Math.min(K.x,C.x);N=Math.min(K.y,C.y);T=Math.max(K.x,C.x);S=Math.max(K.y,C.y);M=T;L=S;for(y=N;y<=L;y++){R=f[y][O];if(!R.real){if(O-(R.colspan-1)<O){O-=R.colspan-1}}}for(x=O;x<=M;x++){R=f[N][x];if(!R.real){if(N-(R.rowspan-1)<N){N-=R.rowspan-1}}}for(y=N;y<=S;y++){for(x=O;x<=T;x++){R=f[y][x];if(R.real){P=R.colspan-1;Q=R.rowspan-1;if(P){if(x+P>M){M=x+P}}if(Q){if(y+Q>L){L=y+Q}}}}}F.removeClass(F.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=N;y<=L;y++){for(x=O;x<=M;x++){F.addClass(f[y][x].elm,"mceSelected")}}}}c.extend(this,{deleteTable:r,split:B,merge:p,insertRow:l,insertCol:g,deleteCols:n,deleteRows:m,cutRows:D,copyRows:I,pasteRows:A,getPos:E,setStartCell:v,setEndCell:u})}c.create("tinymce.plugins.TablePlugin",{init:function(f,g){var e,k;function j(n){var m=f.selection,l=f.dom.getParent(n||m.getNode(),"table");if(l){return new a(l,f.dom,m)}}function h(){f.getBody().style.webkitUserSelect="";f.dom.removeClass(f.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}d([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(l){f.addButton(l[0],{title:l[1],cmd:l[2],ui:l[3]})});if(!c.isIE){f.onClick.add(function(l,m){m=m.target;if(m.nodeName==="TABLE"){l.selection.select(m)}})}f.onNodeChange.add(function(m,l,q){var o;q=m.selection.getStart();o=m.dom.getParent(q,"td,th,caption");l.setActive("table",q.nodeName==="TABLE"||!!o);if(o&&o.nodeName==="CAPTION"){o=0}l.setDisabled("delete_table",!o);l.setDisabled("delete_col",!o);l.setDisabled("delete_table",!o);l.setDisabled("delete_row",!o);l.setDisabled("col_after",!o);l.setDisabled("col_before",!o);l.setDisabled("row_after",!o);l.setDisabled("row_before",!o);l.setDisabled("row_props",!o);l.setDisabled("cell_props",!o);l.setDisabled("split_cells",!o);l.setDisabled("merge_cells",!o)});f.onInit.add(function(m){var l,p,q=m.dom,n;e=m.windowManager;m.onMouseDown.add(function(r,s){if(s.button!=2){h();p=q.getParent(s.target,"td,th");l=q.getParent(p,"table")}});q.bind(m.getDoc(),"mouseover",function(u){var s,r,t=u.target;if(p&&(n||t!=p)&&(t.nodeName=="TD"||t.nodeName=="TH")){r=q.getParent(t,"table");if(r==l){if(!n){n=j(r);n.setStartCell(p);m.getBody().style.webkitUserSelect="none"}n.setEndCell(t)}s=m.selection.getSel();if(s.removeAllRanges){s.removeAllRanges()}else{s.empty()}u.preventDefault()}});m.onMouseUp.add(function(A,B){var s,u=A.selection,C,D=u.getSel(),r,v,t,z;if(p){if(n){A.getBody().style.webkitUserSelect=""}function w(E,G){var F=new c.dom.TreeWalker(E,E);do{if(E.nodeType==3&&c.trim(E.nodeValue).length!=0){if(G){s.setStart(E,0)}else{s.setEnd(E,E.nodeValue.length)}return}if(E.nodeName=="BR"){if(G){s.setStartBefore(E)}else{s.setEndBefore(E)}return}}while(E=(G?F.next():F.prev()))}C=q.select("td.mceSelected,th.mceSelected");if(C.length>0){s=q.createRng();v=C[0];z=C[C.length-1];w(v,1);r=new c.dom.TreeWalker(v,q.getParent(C[0],"table"));do{if(v.nodeName=="TD"||v.nodeName=="TH"){if(!q.hasClass(v,"mceSelected")){break}t=v}}while(v=r.next());w(t);u.setRng(s)}A.nodeChanged();p=n=l=null}});m.onKeyUp.add(function(r,s){h()});if(m&&m.plugins.contextmenu){m.plugins.contextmenu.onContextMenu.add(function(t,r,v){var w,u=m.selection,s=u.getNode()||m.getBody();if(m.dom.getParent(v,"td")||m.dom.getParent(v,"th")||m.dom.select("td.mceSelected,th.mceSelected").length){r.removeAll();if(s.nodeName=="A"&&!m.dom.getAttrib(s,"name")){r.add({title:"advanced.link_desc",icon:"link",cmd:m.plugins.advlink?"mceAdvLink":"mceLink",ui:true});r.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});r.addSeparator()}if(s.nodeName=="IMG"&&s.className.indexOf("mceItem")==-1){r.add({title:"advanced.image_desc",icon:"image",cmd:m.plugins.advimage?"mceAdvImage":"mceImage",ui:true});r.addSeparator()}r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});r.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});r.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});r.addSeparator();w=r.addMenu({title:"table.cell"});w.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});w.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});w.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});w=r.addMenu({title:"table.row"});w.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});w.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});w.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});w.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});w.addSeparator();w.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});w.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});w.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!k);w.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!k);w=r.addMenu({title:"table.col"});w.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});w.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});w.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!c.isIE){function o(){var r;for(r=m.getBody().lastChild;r&&r.nodeType==3&&!r.nodeValue.length;r=r.previousSibling){}if(r&&r.nodeName=="TABLE"){m.dom.add(m.getBody(),"p",null,'<br mce_bogus="1" />')}}if(c.isGecko){m.onKeyDown.add(function(s,u){var r,t,v=s.dom;if(u.keyCode==37||u.keyCode==38){r=s.selection.getRng();t=v.getParent(r.startContainer,"table");if(t&&s.getBody().firstChild==t){if(b(r,t)){r=v.createRng();r.setStartBefore(t);r.setEndBefore(t);s.selection.setRng(r);u.preventDefault()}}}})}m.onKeyUp.add(o);m.onSetContent.add(o);m.onVisualAid.add(o);m.onPreProcess.add(function(r,t){var s=t.node.lastChild;if(s&&s.childNodes.length==1&&s.firstChild.nodeName=="BR"){r.dom.remove(s)}});o()}});d({mceTableSplitCells:function(l){l.split()},mceTableMergeCells:function(m){var n,o,l;l=f.dom.getParent(f.selection.getNode(),"th,td");if(l){n=l.rowSpan;o=l.colSpan}if(!f.dom.select("td.mceSelected,th.mceSelected").length){e.open({url:g+"/merge_cells",width:240+parseInt(f.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(f.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:n,cols:o,onaction:function(p){m.merge(l,p.cols,p.rows)},plugin_url:g})}else{m.merge()}},mceTableInsertRowBefore:function(l){l.insertRow(true)},mceTableInsertRowAfter:function(l){l.insertRow()},mceTableInsertColBefore:function(l){l.insertCol(true)},mceTableInsertColAfter:function(l){l.insertCol()},mceTableDeleteCol:function(l){l.deleteCols()},mceTableDeleteRow:function(l){l.deleteRows()},mceTableCutRow:function(l){k=l.cutRows()},mceTableCopyRow:function(l){k=l.copyRows()},mceTablePasteRowBefore:function(l){l.pasteRows(k,true)},mceTablePasteRowAfter:function(l){l.pasteRows(k)},mceTableDelete:function(l){l.deleteTable()}},function(m,l){f.addCommand(l,function(){var n=j();if(n){m(n);f.execCommand("mceRepaint");h()}})});d({mceInsertTable:function(l){e.open({url:g+"/table",width:400+parseInt(f.getLang("table.table_delta_width",0)),height:320+parseInt(f.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:l?l.action:0})},mceTableRowProps:function(){e.open({url:g+"/row",width:400+parseInt(f.getLang("table.rowprops_delta_width",0)),height:295+parseInt(f.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})},mceTableCellProps:function(){e.open({url:g+"/cell",width:400+parseInt(f.getLang("table.cellprops_delta_width",0)),height:295+parseInt(f.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}},function(m,l){f.addCommand(l,function(n,o){m(o)})})}});c.PluginManager.add("table",c.plugins.TablePlugin)})(tinymce); 
  • trunk/skins/lemill/tiny_mce/plugins/table/editor_plugin_src.js

    r3015 r3137  
    1212    var each = tinymce.each; 
    1313 
     14    // Checks if the selection/caret is at the start of the specified block element 
     15    function isAtStart(rng, par) { 
     16        var doc = par.ownerDocument, rng2 = doc.createRange(), elm; 
     17 
     18        rng2.setStartBefore(par); 
     19        rng2.setEnd(rng.endContainer, rng.endOffset); 
     20 
     21        elm = doc.createElement('body'); 
     22        elm.appendChild(rng2.cloneContents()); 
     23 
     24        // Check for text characters of other elements that should be treated as content 
     25        return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; 
     26    }; 
     27 
    1428    /** 
    1529     * Table Grid class. 
     
    2640        } 
    2741 
     42        function cloneNode(node, children) { 
     43            node = node.cloneNode(children); 
     44            node.removeAttribute('id'); 
     45 
     46            return node; 
     47        } 
     48 
    2849        function buildGrid() { 
    2950            var startY = 0; 
     
    3253 
    3354            each(['thead', 'tbody', 'tfoot'], function(part) { 
    34                 var rows = dom.select(part + ' tr', table); 
     55                var rows = dom.select('> ' + part + ' tr', table); 
    3556 
    3657                each(rows, function(tr, y) { 
    3758                    y += startY; 
    3859 
    39                     each(dom.select('td,th', tr), function(td, x) { 
     60                    each(dom.select('> td, > th', tr), function(td, x) { 
    4061                        var x2, y2, rowspan, colspan; 
    4162 
     
    123144                if (node.nodeType == 3) { 
    124145                    each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { 
    125                         node = node.cloneNode(false); 
     146                        node = cloneNode(node, false); 
    126147 
    127148                        if (!formatNode) 
     
    135156                    // Add something to the inner node 
    136157                    if (curNode) 
    137                         curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br _mce_bogus="1" />'; 
     158                        curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />'; 
    138159 
    139160                    return false; 
     
    141162            }, 'childNodes'); 
    142163 
    143             cell = cell.cloneNode(false); 
     164            cell = cloneNode(cell, false); 
    144165            cell.rowSpan = cell.colSpan = 1; 
    145166 
     
    148169            } else { 
    149170                if (!tinymce.isIE) 
    150                     cell.innerHTML = '<br _mce_bogus="1" />'; 
     171                    cell.innerHTML = '<br data-mce-bogus="1" />'; 
    151172            } 
    152173 
     
    310331                        cell = cell.elm; 
    311332                        rowElm = cell.parentNode; 
    312                         newRow = rowElm.cloneNode(false); 
     333                        newRow = cloneNode(rowElm, false); 
    313334                        posY = y; 
    314335 
     
    491512 
    492513            each(rows, function(row, i) { 
    493                 rows[i] = row.cloneNode(true); 
     514                rows[i] = cloneNode(row, true); 
    494515            }); 
    495516 
     
    880901                        var sm, se = ed.selection, el = se.getNode() || ed.getBody(); 
    881902 
    882                         if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) { 
     903                        if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { 
    883904                            m.removeAll(); 
    884905 
     
    10001021                    if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { 
    10011022                        winMan.open({ 
    1002                             url : url + '/merge_cells.htm', 
     1023                            url : url + '/merge_cells', //<-- changed (Jukka) 
    10031024                            width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), 
    10041025                            height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), 
     
    10751096                mceInsertTable : function(val) { 
    10761097                    winMan.open({ 
    1077                         url : url + '/table.htm', 
     1098                        url : url + '/table', //<-- changed (Jukka) 
    10781099                        width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), 
    10791100                        height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), 
     
    10871108                mceTableRowProps : function() { 
    10881109                    winMan.open({ 
    1089                         url : url + '/row.htm', 
     1110                        url : url + '/row', //<-- changed (Jukka) 
    10901111                        width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), 
    10911112                        height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), 
     
    10981119                mceTableCellProps : function() { 
    10991120                    winMan.open({ 
    1100                         url : url + '/cell.htm', 
     1121                        url : url + '/cell', //<-- changed (Jukka) 
    11011122                        width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), 
    11021123                        height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), 
  • trunk/skins/lemill/tiny_mce/plugins/table/js/cell.js

    r3015 r3137  
    2525    var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); 
    2626    var className = ed.dom.getAttrib(tdElm, 'class'); 
    27     var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; 
     27    var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); 
    2828    var id = ed.dom.getAttrib(tdElm, 'id'); 
    2929    var lang = ed.dom.getAttrib(tdElm, 'lang'); 
  • trunk/skins/lemill/tiny_mce/plugins/table/js/row.js

    r3015 r3137  
    2020    var className = dom.getAttrib(trElm, 'class'); 
    2121    var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor')); 
    22     var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; 
     22    var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); 
    2323    var id = dom.getAttrib(trElm, 'id'); 
    2424    var lang = dom.getAttrib(trElm, 'lang'); 
  • trunk/skins/lemill/tiny_mce/plugins/table/js/table.js

    r3015 r3137  
    8383 
    8484            if (!tinymce.isIE) 
    85                 capEl.innerHTML = '<br _mce_bogus="1"/>'; 
     85                capEl.innerHTML = '<br data-mce-bogus="1"/>'; 
    8686 
    8787            elm.insertBefore(capEl, elm.firstChild); 
     
    152152    html += makeAttrib('cellpadding', cellpadding); 
    153153    html += makeAttrib('cellspacing', cellspacing); 
    154     html += makeAttrib('_mce_new', '1'); 
     154    html += makeAttrib('data-mce-new', '1'); 
    155155 
    156156    if (width && inst.settings.inline_styles) { 
     
    188188    if (caption) { 
    189189        if (!tinymce.isIE) 
    190             html += '<caption><br _mce_bogus="1"/></caption>'; 
     190            html += '<caption><br data-mce-bogus="1"/></caption>'; 
    191191        else 
    192192            html += '<caption></caption>'; 
     
    198198        for (var x=0; x<cols; x++) { 
    199199            if (!tinymce.isIE) 
    200                 html += '<td><br _mce_bogus="1"/></td>'; 
     200                html += '<td><br data-mce-bogus="1"/></td>'; 
    201201            else 
    202202                html += '<td></td>'; 
     
    232232        inst.execCommand('mceInsertContent', false, html); 
    233233 
    234     tinymce.each(dom.select('table[_mce_new]'), function(node) { 
     234    tinymce.each(dom.select('table[data-mce-new]'), function(node) { 
    235235        var td = dom.select('td', node); 
    236236 
    237         inst.selection.select(td[0], true); 
    238         inst.selection.collapse(); 
    239  
    240         dom.setAttrib(node, '_mce_new', ''); 
     237        try { 
     238            // IE9 might fail to do this selection 
     239            inst.selection.select(td[0], true); 
     240            inst.selection.collapse(); 
     241        } catch (ex) { 
     242            // Ignore 
     243        } 
     244 
     245        dom.setAttrib(node, 'data-mce-new', ''); 
    241246    }); 
    242247 
     
    280285    var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); 
    281286    var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; 
    282     var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; 
     287    var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; 
    283288    var inst = tinyMCEPopup.editor, dom = inst.dom; 
    284289    var formObj = document.forms[0]; 
     
    317322        dir = dom.getAttrib(elm, 'dir'); 
    318323        lang = dom.getAttrib(elm, 'lang'); 
    319         background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); 
     324        background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); 
    320325        formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; 
    321326 
     
    426431 
    427432    if (st['background-image']) 
    428         formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); 
     433        formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); 
    429434    else 
    430435        formObj.backgroundimage.value = ''; 
  • trunk/skins/lemill/tiny_mce/plugins/table/table.htm

    r3015 r3137  
    1111    <link href="css/table.css" rel="stylesheet" type="text/css" /> 
    1212</head> 
    13 <body id="table" style="display: none"> 
     13<body id="table" style="display: none;width:400px;"> 
    1414    <form onsubmit="insertTable();return false;" action="#"> 
    15         <div class="panel_wrapper"> 
    16             <div id="general_panel" class="panel current"> 
    17                 <fieldset> 
    18                     <legend>{#table_dlg.general_props}</legend> 
    19                       <table border="0" cellpadding="4" cellspacing="0" width="100%"> 
    20                               <tr> 
    21                                 <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td> 
    22                                 <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td> 
    23                                 <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td> 
    24                                 <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td> 
    25                               </tr> 
    26                               <tr> 
    27                                 <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td> 
    28                                 <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td> 
    29                                 <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td> 
    30                                 <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td> 
    31                               </tr> 
    32                               <tr> 
    33                                 <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td> 
    34                                 <td><select id="align" name="align"> 
    35                                     <option value="">{#not_set}</option> 
    36                                     <option value="center">{#table_dlg.align_middle}</option> 
    37                                     <option value="left">{#table_dlg.align_left}</option> 
    38                                     <option value="right">{#table_dlg.align_right}</option> 
    39                                   </select></td> 
    40                                 <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td> 
    41                                 <td><input id="border" name="border" type="text" value="1" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td> 
    42                               </tr> 
    43                               <tr id="width_row"> 
    44                                 <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td> 
    45                                 <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> 
    46                                 <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td> 
    47                                 <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> 
    48                               </tr> 
    49                               <tr style="display:none" id="styleSelectRow"> 
    50                                 <td><label id="classlabel" for="class">{#class_name}</label></td> 
    51                                 <td colspan="3"> 
    52                                  <select id="class" name="class" class="mceEditableSelect"> 
    53                                     <option value="" selected="selected">{#not_set}</option> 
    54                                  </select></td> 
    55                               </tr> 
    56                               <tr> 
    57                                 <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>  
    58                                 <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>  
    59                               </tr> 
    60                             </table> 
    61                 </fieldset> 
    62             </div> 
    6315 
    64             <div id="advanced_panel" class="panel"> 
     16    <fieldset> 
     17          <table border="0" cellpadding="4" cellspacing="0" width="100%"> 
     18              <tr> 
     19                <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td> 
     20                <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td> 
     21                <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td> 
     22                <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td> 
     23              </tr> 
     24              <tr> 
     25                <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td> 
     26                <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td> 
     27                <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td> 
     28                <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td> 
     29              </tr> 
     30              <tr> 
     31                <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td> 
     32                <td><select id="align" name="align"> 
     33                    <option value="">{#not_set}</option> 
     34                    <option value="center">{#table_dlg.align_middle}</option> 
     35                    <option value="left">{#table_dlg.align_left}</option> 
     36                    <option value="right">{#table_dlg.align_right}</option> 
     37                  </select></td> 
     38                <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td> 
     39                <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td> 
     40              </tr> 
     41              <tr id="width_row"> 
     42                <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td> 
     43                <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> 
     44                <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td> 
     45                <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> 
     46              </tr> 
     47              <tr style="display:none" id="styleSelectRow"> 
     48                <td><label id="classlabel" for="class">{#class_name}</label></td> 
     49                <td colspan="3"> 
     50                 <select id="class" name="class" class="mceEditableSelect"> 
     51                    <option value="" selected="selected">{#not_set}</option> 
     52                 </select></td> 
     53              </tr> 
     54              <tr> 
     55                <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>  
     56                <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>  
     57              </tr> 
     58            </table> 
     59    </fieldset> 
     60 
     61            <div id="advanced_panel" class="panel" style="display:none"> 
    6562                <fieldset> 
    6663                    <legend>{#table_dlg.advanced_props}</legend> 
     
    170167                </fieldset> 
    171168            </div> 
    172         </div> 
    173169 
    174170        <div class="mceActionPanel"> 
    175             <input type="submit" id="insert" name="insert" value="{#insert}" /> 
    176             <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> 
     171         <div class="form_submit" style="float: left;padding-left:1em; "> 
     172            <input type="submit" class="save" id="insert" name="insert" value="{#insert}" /> 
     173         </div> 
     174         <div class="form_submit" style="float: right;padding-right:1em;"> 
     175            <input type="button" class="cancel" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> 
     176         </div> 
    177177        </div> 
    178178    </form> 
  • trunk/skins/lemill/tiny_mce/themes/lemill/editor_template.js

    r3113 r3137  
    2222 
    2323            ed.onInit.add(function() { 
     24                ed.settings.popup_css=ed.settings.content_css; 
    2425                ed.onNodeChange.add(function(ed, cm, n, co, ob) { 
    2526                    tinymce.each(states, function(c) { 
     
    2728                    }); 
    2829 
    29                 function getParent(name) { 
    30                     var i, parents = ob.parents, func = name; 
    31      
    32                     if (typeof(name) == 'string') { 
    33                         func = function(node) { 
    34                             return node.nodeName == name; 
    35                         }; 
    36                     } 
    37      
    38                     for (i = 0; i < parents.length; i++) { 
    39                         if (func(parents[i])) 
    40                             return parents[i]; 
    41                     } 
    42                 }; 
    43      
    44                 cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); 
    45                 cm.setDisabled('redo', !ed.undoManager.hasRedo()); 
    46      
    47                 p = getParent('A'); 
    48                 if (c = cm.get('link')) { 
    49                     if (!p || !p.name) { 
    50                         c.setDisabled(!p && co); 
    51                         c.setActive(!!p); 
    52                     } 
    53                 } 
    54      
    55                 if (c = cm.get('unlink')) { 
    56                     c.setDisabled(!p && co); 
    57                     c.setActive(!!p && !p.name); 
    58                 } 
    59  
     30                    function getParent(name) { 
     31                        var i, parents = ob.parents, func = name; 
     32         
     33                        if (typeof(name) == 'string') { 
     34                            func = function(node) { 
     35                                return node.nodeName == name; 
     36                            }; 
     37                        } 
     38         
     39                        for (i = 0; i < parents.length; i++) { 
     40                            if (func(parents[i])) 
     41                                return parents[i]; 
     42                        } 
     43                    }; 
     44         
     45                    cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); 
     46                    cm.setDisabled('redo', !ed.undoManager.hasRedo()); 
     47                     
     48                    //alert(ed.documentBaseURI.getURI()); 
     49         
     50                    p = getParent('A'); 
     51                    if (c = cm.get('link')) { 
     52                        if (!p || !p.name) { 
     53                            c.setDisabled(!p && co); 
     54                            c.setActive(!!p); 
     55                        } 
     56                    } 
     57         
     58                    if (c = cm.get('unlink')) { 
     59                        c.setDisabled(!p && co); 
     60                        c.setActive(!!p && !p.name); 
     61                    } 
     62 
     63                    if (c = cm.get('formatselect')) { 
     64                        p = getParent(DOM.isBlock); 
     65         
     66                        if (p) 
     67                            c.select(p.nodeName.toLowerCase()); 
     68                    } 
     69 
     70                     
     71                    nc= n.nodeName=='CODE'; 
     72                    if (c=cm.get('latex')) { 
     73                        //c.setDisabled(!nc && co); 
     74                        c.setActive(nc); 
     75                    }                     
    6076                }); 
    6177 
     
    98114            tb.add(cf.createButton('link', {title : 'lemill.link_desc', cmd : 'mceLink'})); 
    99115            tb.add(cf.createButton('unlink', {title : 'lemill.unlink_desc', cmd : 'unlink'})); 
    100             tb.add(cf.createButton('table', {title : 'lemill.table_desc', cmd : 'myInsertTable'})); 
     116            tb.add(cf.createButton('table', {title : 'lemill.table_desc', cmd : 'mceInsertTable'})); 
     117            tb.add(cf.createButton('charmap', {title : 'lemill.charmap_desc', cmd : 'mceCharMap'})); 
     118            tb.add(cf.createButton('latex', {title : 'lemill.latex_desc', cmd : 'mceInsertLatex'})); 
     119             
    101120            //tb.add(cf.createButton('html', {title : 'lemill.html_desc', cmd : 'html'})); 
    102121 
     
    124143                author : 'Jukka Purma, LeMill team', 
    125144                authorurl : 'http://lemill.org/', 
    126                 version : '0.4' 
     145                version : '0.6' 
    127146            } 
    128147        }, 
     
    139158        _mceLink : function(ui, val) { 
    140159            var ed = this.editor; 
    141  
    142160            ed.windowManager.open({ 
    143161                url : tinymce.baseURL + '/themes/lemill/link', // inside Zope 'link.html' -> 'link' 
     
    149167            }); 
    150168        }, 
    151         _myInsertTable : function(ui, val) { 
    152             var ed = this.editor; 
    153             ed.windowManager.open({ 
    154                 url : tinymce.baseURL + '/plugins/table/table', 
    155                 width : 400, 
    156                 height : 320, 
     169 
     170        _mceCharMap : function() { 
     171            var ed = this.editor; 
     172 
     173            ed.windowManager.open({ 
     174                url : tinymce.baseURL + '/themes/lemill/charmap', 
     175                width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), 
     176                height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), 
     177                inline : true 
     178            }, { 
     179                theme_url : this.url 
     180            }); 
     181        }, 
     182 
     183        _mceInsertLatex: function() { 
     184            var ed= this.editor; 
     185             
     186            ed.windowManager.open({ 
     187                url : tinymce.baseURL + '/themes/lemill/latex', 
     188                width : 600, 
     189                height : 440, 
    157190                inline : 1 
    158191            }, { 
    159                 plugin_url : tinymce.baseURL + '/plugins/table', 
    160                 action : val ? val.action : 0 
    161             }); 
    162         }, 
    163  
    164  
    165         //_html : function(ui, val) { 
    166         //    $('.visual_toggle').show();             
    167         //    $('.mceEditor').tinymce().hide();             
    168         //}, 
     192                theme_url : this.url 
     193            }); 
     194        },           
     195 
     196        //} // end init      
    169197 
    170198 
  • trunk/skins/lemill/tiny_mce/themes/lemill/langs/en.js

    r3015 r3137  
    77unlink_desc:"Remove link", 
    88table_desc:"Insert table", 
     9latex_desc:"Insert math formula", 
    910bullist_desc:"Unordered list", 
    1011numlist_desc:"Ordered list", 
     
    1213redo_desc:"Redo (Ctrl+Y)", 
    1314cleanup_desc:"Cleanup messy code", 
    14 html_desc:"Edit HTML source", 
    15 format:"Format", 
     15format:"Style", 
    1616paragraph:"Normal paragraph", 
    1717heading:"Heading", 
    1818code:"Code", 
     19charmap_desc:"Symbol map", 
    1920link_title:"Insert/edit link", 
    2021link_url:"Link URL", 
     
    2223link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", 
    2324link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", 
     25insert_latex_desc : 'Insert latex formula', 
     26insert_latex_explain : 'Enter only your latex mathmode code. Example : \\sqrt{a+b} <br /><a href="http://www.andy-roberts.net/misc/latex/latextutorial9.html" target="_blank">More information</a>, <a href="http://detexify.kirelabs.org/classify.html" target="_blank">LaTeX symbol finder</a>', 
     27insert_latex_formula : 'Latex formula', 
     28insert_latex_preview_verb : 'Preview', 
     29insert_latex_preview_noun : 'Preview', 
     30insert_latex_in_text : 'Insert within text', 
     31insert_latex_block_text : 'Insert as a separate paragraph', 
    2432}); 
  • trunk/skins/lemill/tiny_mce/themes/lemill/langs/fi.js

    r3015 r3137  
    77unlink_desc:"Poista linkitys", 
    88table_desc:"PiirrÀ taulukko", 
     9latex_desc:"PiirrÀ kaava", 
    910bullist_desc:"Luo lista", 
    1011numlist_desc:"Luo numeroitu lista", 
     
    1516paragraph:"LeipÀteksti", 
    1617heading:"Otsikko", 
    17 code:"Muotoilematon" 
     18code:"Muotoilematon", 
     19charmap_desc:"Symboleja", 
    1820link_title:"Luo linkki / muokkaa linkkiÀ", 
    1921link_url:"Linkin osoite", 
  • trunk/skins/lemill/tiny_mce/themes/lemill/skins/default/dialog.css

    r3015 r3137  
    22body { 
    33font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; 
    4 scrollbar-3dlight-color:#F0F0EE; 
    5 scrollbar-arrow-color:#676662; 
    6 scrollbar-base-color:#F0F0EE; 
    7 scrollbar-darkshadow-color:#DDDDDD; 
    8 scrollbar-face-color:#E0E0DD; 
    9 scrollbar-highlight-color:#F0F0EE; 
    10 scrollbar-shadow-color:#F0F0EE; 
    11 scrollbar-track-color:#F5F5F5; 
    124background:#F0F0EE; 
    135padding:0; 
     
    3527.input_noborder {border:0;} 
    3628 
    37 /* Buttons */ 
    38 #insert, #cancel, input.button, .updateButton { 
    39 border:0; margin:0; padding:0; 
    40 font-weight:bold; 
    41 width:94px; height:26px; 
    42 background:url(img/buttons.png) 0 -26px; 
    43 cursor:pointer; 
    44 padding-bottom:2px; 
    45 float:left; 
    46 } 
    47  
    48 #insert {background:url(img/buttons.png) 0 -52px} 
    49 #cancel {background:url(img/buttons.png) 0 0; float:right} 
    5029 
    5130/* Browse */ 
     
    5433.mceOldBoxModel a.browse span {width:22px; height:20px;} 
    5534a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} 
    56 a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} 
     35a.browse span.disabled {border:1px solid white; opacity:0.3;} 
    5736a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} 
    5837a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} 
  • trunk/skins/lemill/tiny_mce/tiny_mce.js

    r3113 r3137  
    1 (function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"3.9.2",releaseDate:"2010-09-29",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==e){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(n,f){var m=this,g,i,j,k,h,l=0;n=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(n);j=n[3].match(/(^|\.)(\w+)$/i)[2];i=m.createNS(n[3].replace(/\.\w+$/,""));if(i[j]){return}if(n[2]=="static"){i[j]=f;if(this.onCreate){this.onCreate(n[2],n[3],i[j])}return}if(!f[j]){f[j]=function(){};l=1}i[j]=f[j];m.extend(i[j].prototype,f);if(n[5]){g=m.resolve(n[5]).prototype;k=n[5].match(/\.(\w+)$/i)[1];h=i[j];if(l){i[j]=function(){return g[k].apply(this,arguments)}}else{i[j]=function(){this.parent=g[k];return h.apply(this,arguments)}}i[j].prototype[j]=i[j];m.each(g,function(o,p){i[j].prototype[p]=g[p]});m.each(f,function(o,p){if(g[p]){i[j].prototype[p]=function(){this.parent=g[p];return o.apply(this,arguments)}}else{if(p!=j){i[j].prototype[p]=o}}})}m.each(f["static"],function(o,p){i[j][p]=o});if(this.onCreate){this.onCreate(n[2],n[3],i[j].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}b.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}b.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this;j={func:j,scope:i||this};if(!h.unloads){function g(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",k);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function k(){var l=document;if(l.readyState=="interactive"){function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l){l.attachEvent("onstop",f)}d.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",k)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;b.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);(function(e,d){var c=d.is,b=/^(href|src|style)$/i,f;if(!e){return alert("Load jQuery first!")}d.$=e;d.adapter={patchEditor:function(j){var i=e.fn;function h(n,o){var m=this;if(o){m.removeAttr("_mce_style")}return i.css.apply(m,arguments)}function g(n,o){var m=this;if(b.test(n)){if(o!==f){m.each(function(p,q){j.dom.setAttrib(q,n,o)});return m}else{return m.attr("_mce_"+n)}}return i.attr.apply(m,arguments)}function k(m){return function(n){if(n){n=j.dom.processHTML(n)}return m.call(this,n)}}function l(m){if(m.css!==h){m.css=h;m.attr=g;m.html=k(i.html);m.append=k(i.append);m.prepend=k(i.prepend);m.after=k(i.after);m.before=k(i.before);m.replaceWith=k(i.replaceWith);m.tinymce=j;m.pushStack=function(){return l(i.pushStack.apply(this,arguments))}}return m}j.$=function(m,n){var o=j.getDoc();return l(e(m||o,o||n))}}};d.extend=e.extend;d.extend(d,{map:e.map,grep:function(g,h){return e.grep(g,h||function(){return 1})},inArray:function(g,h){return e.inArray(h,g||[])}});var a={"tinymce.dom.DOMUtils":{select:function(i,h){var g=this;return e.find(i,g.get(h)||g.get(g.settings.root_element)||g.doc,[])},is:function(h,g){return e(this.get(h)).is(g)}}};d.onCreate=function(g,i,h){d.extend(h,a[i])}})(window.jQuery,tinymce);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.stdMode=u.documentMode>=8;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat"||p.stdMode;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(typeof(s)!="undefined"){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=m._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+o)}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode&&r.recalc){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true">&nbsp;</p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/gi,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/&apos;/g,"&#39;");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=m._replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>",r);if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}r=m._replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->",r);function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=m._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",z);if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){if(!z.isBlock(A.parentNode)||m.trim(A.nodeValue).length>0){return}}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.endContainer;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();n.scrollIntoView();return}catch(q){}}}l(true);l();p.select();p.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null}}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&i.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(j,i){var g=this,k=g.getRng(),n,l=g.win.document;i=i||{format:"html"};i.set=true;j=i.content=g.dom.processHTML(j);g.onBeforeSetContent.dispatch(g,i);j=i.content;if(k.insertNode){j+='<span id="__caret">_</span>';if(k.startContainer==l&&k.endContainer==l){l.body.innerHTML=j}else{k.deleteContents();if(l.body.childNodes.length==0){l.body.innerHTML=j}else{if(k.createContextualFragment){k.insertNode(k.createContextualFragment(j))}else{var m=l.createDocumentFragment(),f=l.createElement("div");m.appendChild(f);f.outerHTML=j;k.insertNode(m)}}}n=g.dom.get("__caret");k=l.createRange();k.setStartBefore(n);k.setEndBefore(n);g.setRng(k);g.dom.remove("__caret")}else{if(k.item){l.execCommand("Delete",false,null);k=g.getRng()}k.pasteHTML(j)}g.onSetContent.dispatch(g,i)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='<br _mce_bogus="1" />'}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var m=this.dom,l=m.doc,g=l.body,i,j;l.documentElement.unselectable=true;function k(n,q){var o=g.createTextRange();try{o.moveToPoint(n,q)}catch(p){o=null}return o}function h(o){var n;if(o.button){n=k(o.x,o.y);if(n){if(n.compareEndPoints("StartToStart",j)>0){n.setEndPoint("StartToStart",j)}else{n.setEndPoint("EndToEnd",j)}n.select()}}else{f()}}function f(){m.unbind(l,"mouseup",f);m.unbind(l,"mousemove",h);i=0}m.bind(l,"mousedown",function(n){if(n.target.nodeName==="HTML"){if(i){f()}i=1;j=k(n.x,n.y);if(j){m.bind(l,"mouseup",f);m.bind(l,"mousemove",h);m.win.focus();j.select()}}})}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html[^>]*>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}return b}})})(tinymce);(function(c){var d=/[&\"<>]/g,b=/[<>&]/g,a={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};c.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(e){this.settings=c.extend({indent_char:" ",indentation:0},e);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(e){this._writeAttributesEnd();this.writeRaw("<"+e);this.tags.push(e);this.inAttr=true;this.count++;this.elementCount=this.count;this.attrs={}},writeAttribute:function(g,e){var f=this;if(!f.attrs[g]){f.writeRaw(" "+f.encode(g,true)+'="'+f.encode(e,true)+'"');f.attrs[g]=e}},writeEndElement:function(){var e;if(this.tags.length>0){e=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+e+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(e){this._writeAttributesEnd();this.writeRaw(this.encode(e));this.count++},writeCDATA:function(e){this._writeAttributesEnd();this.writeRaw("<![CDATA["+e+"]]>");this.count++},writeComment:function(e){this._writeAttributesEnd();this.writeRaw("<!--"+e+"-->");this.count++},writeRaw:function(e){this.str+=e},encode:function(f,e){return f.replace(e?d:b,function(g){return a[g]})},getContent:function(){return this.str},_writeAttributesEnd:function(e){if(!this.inAttr){return}this.inAttr=false;if(e&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}if(e.isIE&&document.documentMode>8){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML="&nbsp;";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=e._replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>",j);if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=e._replace(/(<[^>]+>)\s+/g,"$1 ",j);j=e._replace(/\s+(<\/[^>]+>)/g," $1",j);j=e._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>",j);j=e._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>",j);j=e._replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>",j)}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=e._replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n",j);j=e._replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>",j);j=e._replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n",j);j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=e._replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>",j);if(k.entity_encoding=="raw"){j=e._replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>",j)}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(E,J){var A=this,B=A.settings,y=A.writer,q,j,u,G,F,I,C,h,z,k,r,D,p,m,H,o,x;if(!B.node_filter||B.node_filter(E)){switch(E.nodeType){case 1:if(E.hasAttribute?E.hasAttribute("_mce_bogus"):E.getAttribute("_mce_bogus")){return}p=H=false;q=E.hasChildNodes();k=E.getAttribute("_mce_name")||E.nodeName.toLowerCase();o=E.getAttribute("_mce_type");if(o){if(!A._info.cleanup){p=true;return}else{H=1}}if(d){x=E.scopeName;if(x&&x!=="HTML"&&x!=="html"){k=x+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!H){if(!A.validElementsRE||!A.validElementsRE.test(k)||(A.invalidElementsRE&&A.invalidElementsRE.test(k))||J){p=true;break}}if(d){if(B.fix_content_duplication){if(E._mce_serialized==A.key){return}E._mce_serialized=A.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(E.nodeName==="BR"&&E.getAttribute("type")=="_moz"){return}}}if(B.validate_children){if(A.elementName&&!A.schema.isValid(A.elementName,k)){p=true;break}A.elementName=k}r=A.findRule(k);if(!r){p=true;break}k=r.name||k;m=B.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){I=r.requiredAttribs;for(G=I.length-1;G>=0;G--){if(this.dom.getAttrib(E,I[G])!==""){break}}if(G==-1){p=true;break}}y.writeStartElement(k);if(r.attribs){for(G=0,C=r.attribs,F=C.length;G<F;G++){I=C[G];z=A._getAttrib(E,I);if(z!==null){y.writeAttribute(I.name,z)}}}if(r.validAttribsRE){C=A.dom.getAttribs(E);for(G=C.length-1;G>-1;G--){h=C[G];if(h.specified){I=h.nodeName.toLowerCase();if(B.invalid_attrs.test(I)||!r.validAttribsRE.test(I)){continue}D=A.findAttribRule(r,I);z=A._getAttrib(E,D,I);if(z!==null){y.writeAttribute(I,z)}}}}if(o&&H){y.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(E.innerHTML)){y.writeText("// ");y.writeCDATA(E.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=E.firstChild)&&u.nodeType===1&&E.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){y.writeText("\u00a0")}}else{if(!q){y.writeText("\u00a0")}}}break;case 3:if(B.validate_children&&A.elementName&&!A.schema.isValid(A.elementName,"#text")){return}return y.writeText(E.nodeValue);case 4:return y.writeCDATA(E.nodeValue);case 8:return y.writeComment(E.nodeValue)}}else{if(E.nodeType==1){q=E.hasChildNodes()}}if(q&&!m){u=E.firstChild;while(u){A._serializeNode(u);A.elementName=k;u=u.nextSibling}}if(!p){if(!m){y.writeFullEndElement()}else{y.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(k){var h=-1,i,j=k.keyCode;e(f.items,function(l,m){if(f.selectedValue==l.value){h=m}});if(j==38){i=f.items[h-1]}else{if(j==40){i=f.items[h+1]}else{if(j==13){i=f.selectedValue;f.selectedValue=null;f.settings.onselect(i);return b.cancel(k)}}}if(i){f.hideMenu();f.select(i.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){if(u.isHidden())u.load();u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s,remove:"all"})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(s){var x,q=this,v=q.settings.content_editable,r,p,u=q.getDoc();if(!s){r=q.selection.getRng();if(r.item){p=r.item(0)}if(!v){q.getWin().focus()}if(p&&p.ownerDocument==u){r=u.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((x=m.activeEditor)!=null){x.onDeactivate.dispatch(x,q)}q.onActivate.dispatch(q,x)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=(b?q.getNode():q.getStart())||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var z=this,r,A=z.settings,q=z.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,B){var s=t.type;if(z.removed){return}if(z.onEvent.dispatch(z,t,B)!==false){z[x[t.fakeType||t.type]].dispatch(z,t,B)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){q.bind(z.getBody(),"mousedown",function(B){if(B.ctrlKey){B.fakeType="contextmenu";p(B)}})}else{q.bind(z.getBody(),s,p)}break;case"paste":q.bind(z.getBody(),s,function(B){p(B)});break;case"submit":case"reset":q.bind(z.getElement().form||n.getParent(z.id,"form"),s,p);break;default:q.bind(A.content_editable?z.getBody():z.getDoc(),s,p)}});q.bind(A.content_editable?z.getBody():(a?z.getDoc():z.getWin()),"focus",function(s){z.focus(true)});if(m.isGecko){q.bind(z.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=z.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var C=this,E=C.getDoc(),D=C.settings;if(a&&!D.readonly){if(C._isHidden()){try{if(!D.content_editable){E.designMode="On"}}catch(B){}}try{E.execCommand("styleWithCSS",0,false)}catch(B){if(!C._isHidden()){try{E.execCommand("useCSS",0,true)}catch(B){}}}if(!D.table_inline_editing){try{E.execCommand("enableInlineTableEditing",false,false)}catch(B){}}if(!D.object_resizing){try{E.execCommand("enableObjectResizing",false,false)}catch(B){}}}}z.onBeforeExecCommand.add(u);z.onMouseDown.add(u)}if(m.isWebKit){z.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&q.hasClass(t,"mceItemAnchor"))){z.selection.getSel().setBaseAndExtent(t,0,t,1);z.nodeChanged()}})}z.onMouseUp.add(z.nodeChanged);z.onKeyUp.add(function(s,t){var B=t.keyCode;if((B>=33&&B<=36)||(B>=37&&B<=40)||B==13||B==45||B==46||B==8||(m.isMac&&(B==91||B==93))||t.ctrlKey){z.nodeChanged()}});z.onReset.add(function(){z.setContent(z.startContent,{format:"raw"})});if(A.custom_shortcuts){if(A.custom_undo_redo_keyboard_shortcuts){z.addShortcut("ctrl+z",z.getLang("undo_desc"),"Undo");z.addShortcut("ctrl+y",z.getLang("redo_desc"),"Redo")}z.addShortcut("ctrl+b",z.getLang("bold_desc"),"Bold");z.addShortcut("ctrl+i",z.getLang("italic_desc"),"Italic");z.addShortcut("ctrl+u",z.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){z.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}z.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);z.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);z.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(z.shortcuts,function(B){if(m.isMac&&B.ctrl!=t.metaKey){return}else{if(!m.isMac&&B.ctrl!=t.ctrlKey){return}}if(B.alt!=t.altKey){return}if(B.shift!=t.shiftKey){return}if(t.keyCode==B.keyCode||(t.charCode&&t.charCode==B.charCode)){s=B;return false}});return s}z.onKeyUp.add(function(s,t){var B=v(t);if(B){return j.cancel(t)}});z.onKeyPress.add(function(s,t){var B=v(t);if(B){return j.cancel(t)}});z.onKeyDown.add(function(s,t){var B=v(t);if(B){B.func.call(B.scope);return j.cancel(t)}})}if(m.isIE){q.bind(z.getDoc(),"controlselect",function(B){var t=z.resizeInfo,s;B=B.target;if(B.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(B,"mceItemNoResize")){ev="resizeend";s=q.bind(B,ev,function(D){var C;D=D.target;if(C=q.getStyle(D,"width")){q.setAttrib(D,"width",C.replace(/[^0-9%]+/g,""));q.setStyle(D,"width","")}if(C=q.getStyle(D,"height")){q.setAttrib(D,"height",C.replace(/[^0-9%]+/g,""));q.setStyle(D,"height","")}})}else{ev="resizestart";s=q.bind(B,"resizestart",j.cancel,j)}t=z.resizeInfo={node:B,ev:ev,cb:s}});z.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(z.selection.getRng().item){s.dom.remove(z.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){z.onClick.add(function(s,t){j.prevent(t)})}if(A.custom_undo_redo){function y(){z.undoManager.typing=0;z.undoManager.add()}q.bind(z.getDoc(),"focusout",function(s){if(!z.removed&&z.undoManager.typing){y()}});z.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){y()}});z.onKeyDown.add(function(t,E){var s,D,C;if(b&&E.keyCode==46){s=z.selection.getRng();if(s.parentElement){D=s.parentElement();if(E.ctrlKey){s.moveEnd("word",1);s.select()}z.selection.getSel().clear();if(s.parentElement()==D){C=z.selection.getBookmark();try{D.innerHTML=D.innerHTML}catch(B){}z.selection.moveToBookmark(C)}E.preventDefault();return}}if((E.keyCode>=33&&E.keyCode<=36)||(E.keyCode>=37&&E.keyCode<=40)||E.keyCode==13||E.keyCode==45){if(z.undoManager.typing){y()}return}if(!z.undoManager.typing){z.undoManager.add();z.undoManager.typing=1}});z.onMouseDown.add(function(){if(z.undoManager.typing){y()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return u}))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},mceToggleFormat:function(x,v,u){n.formatter.toggle(u)},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{n.dom.remove(u,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:0,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){if(d>0||g.length==1){return null}}if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){if(d==0){g=[]}else{g.length=d+1}}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=0}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.bookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=c.typing=0},hasUndo:function(){return d>0||c.typing},hasRedo:function(){return d<g.length-1}}}})(tinymce);(function(m){var k=m.dom.Event,c=m.isIE,a=m.isGecko,b=m.isOpera,j=m.each,i=m.extend,d=true,h=false;function l(p){var q,o,n;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(p.nodeName)){if(q){o=p.cloneNode(false);o.appendChild(q);q=o}else{q=n=p.cloneNode(false)}q.removeAttribute("id")}}while(p=p.parentNode);if(q){return{wrapper:q,inner:n}}}function g(o,p){var n=p.ownerDocument.createRange();n.setStart(o.endContainer,o.endOffset);n.setEndAfter(p);return n.cloneContents().textContent.length==0}function f(o){o=o.innerHTML;o=o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");o=o.replace(/<[^>]+>/g,"");return o.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(p,r,n){var o,q;if(f(n)){o=r.getParent(n,"ul,ol");if(!r.getParent(o.parentNode,"ul,ol")){r.split(o,n);q=r.create("p",0,'<br _mce_bogus="1" />');r.replace(q,n);p.select(q,1)}return h}return d}m.create("tinymce.ForceBlocks",{ForceBlocks:function(o){var p=this,q=o.settings,r;p.editor=o;p.dom=o.dom;r=(q.forced_root_block||"p").toLowerCase();q.element=r.toUpperCase();o.onPreInit.add(p.setup,p);p.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+r+">","gi");p.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,r),"gi");p.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,r),"gi");function n(s,t){if(b){t.content=t.content.replace(p.reOpera,"</"+r+">")}t.content=m._replace(p.rePadd,"<"+r+"$1$2$3$4$5$6>\u00a0</"+r+">",t.content);if(!c&&!b&&t.set){t.content=t.content.replace(p.reNbsp2BR1,"<"+r+"$1$2><br /></"+r+">");t.content=t.content.replace(p.reNbsp2BR2,"<"+r+"$1$2><br /></"+r+">")}else{t.content=m._replace(p.reBR2Nbsp,"<"+r+"$1$2>\u00a0</"+r+">",t.content)}}o.onBeforeSetContent.add(n);o.onPostProcess.add(n);if(q.forced_root_block){o.onInit.add(p.forceRoots,p);o.onSetContent.add(p.forceRoots,p);o.onBeforeGetContent.add(p.forceRoots,p)}},setup:function(){var o=this,n=o.editor,q=n.settings,u=n.dom,p=n.selection;if(q.forced_root_block){n.onBeforeExecCommand.add(o.forceRoots,o);n.onKeyUp.add(o.forceRoots,o);n.onPreProcess.add(o.forceRoots,o)}if(q.force_br_newlines){if(c){n.onKeyPress.add(function(s,t){var v;if(t.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});v=u.get("__");v.removeAttribute("id");p.select(v);p.collapse();return k.cancel(t)}})}}if(q.force_p_newlines){if(!c){n.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!o.insertPara(t)){k.cancel(t)}})}else{m.addUnload(function(){o._previousFormats=0});n.onKeyPress.add(function(s,t){o._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&q.keep_styles){o._previousFormats=l(s.selection.getStart())}});n.onKeyUp.add(function(t,x){if(x.keyCode==13&&!x.shiftKey){var v=t.selection.getStart(),s=o._previousFormats;if(!v.hasChildNodes()&&s){v=u.getParent(v,u.isBlock);if(v&&v.nodeName!="LI"){v.innerHTML="";if(o._previousFormats){v.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{v.innerHTML="\uFEFF"}p.select(v,1);t.getDoc().execCommand("Delete",false,null);o._previousFormats=0}}}})}if(a){n.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){o.backspaceDelete(t,t.keyCode==8)}})}}if(m.isWebKit){function r(t){var s=p.getRng(),v,z=u.create("div",null," "),y,x=u.getViewPort(t.getWin()).h;s.insertNode(v=u.create("br"));s.setStartAfter(v);s.setEndAfter(v);p.setRng(s);if(p.getSel().focusNode==v.previousSibling){p.select(u.insertAfter(u.doc.createTextNode("\u00a0"),v));p.collapse(d)}u.insertAfter(z,v);y=u.getPos(z).y;u.remove(z);if(y>x){t.getWin().scrollTo(0,y)}}n.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(q.force_br_newlines&&!u.getParent(p.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);k.cancel(t)}})}n.onPreProcess.add(function(s,t){j(u.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(v){if(f(v)){j(u.select("span,em,strong,b,i",t.node),function(x){if(!x.hasChildNodes()){x.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(q.element!="P"){n.onKeyPress.add(function(s,t){o.lastElm=p.getNode().nodeName});n.onKeyUp.add(function(t,v){var y,x=p.getNode(),s=t.getBody();if(s.childNodes.length===1&&x.nodeName=="P"){x=u.rename(x,q.element);p.select(x);p.collapse();t.nodeChanged()}else{if(v.keyCode==13&&!v.shiftKey&&o.lastElm!="P"){y=u.getParent(x,"p");if(y){u.rename(y,q.element);t.nodeChanged()}}}})}}},find:function(v,q,r){var p=this.editor,o=p.getDoc().createTreeWalker(v,4,null,h),u=-1;while(v=o.nextNode()){u++;if(q==0&&v==r){return u}if(q==1&&u==r){return v}}return -1},forceRoots:function(x,I){var z=this,x=z.editor,M=x.getBody(),J=x.getDoc(),P=x.selection,A=P.getSel(),B=P.getRng(),N=-2,v,G,o,p,K=-16777215;var L,q,O,F,C,u=M.childNodes,E,D,y;for(E=u.length-1;E>=0;E--){L=u[E];if(L.nodeType===1&&L.getAttribute("_mce_type")){q=null;continue}if(L.nodeType===3||(!z.dom.isBlock(L)&&L.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(L.nodeName))){if(!q){if(L.nodeType!=3||/[^\s]/g.test(L.nodeValue)){if(N==-2&&B){if(!c||B.setStart){if(B.startContainer.nodeType==1&&(D=B.startContainer.childNodes[B.startOffset])&&D.nodeType==1){y=D.getAttribute("id");D.setAttribute("id","__mce")}else{if(x.dom.getParent(B.startContainer,function(n){return n===M})){G=B.startOffset;o=B.endOffset;N=z.find(M,0,B.startContainer);v=z.find(M,0,B.endContainer)}}}else{if(B.item){p=J.body.createTextRange();p.moveToElementText(B.item(0));B=p}p=J.body.createTextRange();p.moveToElementText(M);p.collapse(1);O=p.move("character",K)*-1;p=B.duplicate();p.collapse(1);F=p.move("character",K)*-1;p=B.duplicate();p.collapse(0);C=(p.move("character",K)*-1)-F;N=F-O;v=C}}q=x.dom.create(x.settings.forced_root_block);L.parentNode.replaceChild(q,L);q.appendChild(L)}}else{if(q.hasChildNodes()){q.insertBefore(L,q.firstChild)}else{q.appendChild(L)}}}else{q=null}}if(N!=-2){if(!c||B.setStart){q=M.getElementsByTagName(x.settings.element)[0];B=J.createRange();if(N!=-1){B.setStart(z.find(M,1,N),G)}else{B.setStart(q,0)}if(v!=-1){B.setEnd(z.find(M,1,v),o)}else{B.setEnd(q,0)}if(A){A.removeAllRanges();A.addRange(B)}}else{try{B=A.createRange();B.moveToElementText(M);B.collapse(1);B.moveStart("character",N);B.moveEnd("character",v);B.select()}catch(H){}}}else{if((!c||B.setStart)&&(D=x.dom.get("__mce"))){if(y){D.setAttribute("id",y)}else{D.removeAttribute("id")}B=J.createRange();B.setStartBefore(D);B.setEndBefore(D);P.setRng(B)}}},getParentBlock:function(p){var o=this.dom;return o.getParent(p,o.isBlock)},insertPara:function(S){var G=this,x=G.editor,O=x.dom,T=x.getDoc(),X=x.settings,H=x.selection.getSel(),I=H.getRangeAt(0),W=T.body;var L,M,J,Q,P,u,p,v,A,o,E,V,q,z,K,N=O.getViewPort(x.getWin()),D,F,C;L=T.createRange();L.setStart(H.anchorNode,H.anchorOffset);L.collapse(d);M=T.createRange();M.setStart(H.focusNode,H.focusOffset);M.collapse(d);J=L.compareBoundaryPoints(L.START_TO_END,M)<0;Q=J?H.anchorNode:H.focusNode;P=J?H.anchorOffset:H.focusOffset;u=J?H.focusNode:H.anchorNode;p=J?H.focusOffset:H.anchorOffset;if(Q===u&&/^(TD|TH)$/.test(Q.nodeName)){if(Q.firstChild.nodeName=="BR"){O.remove(Q.firstChild)}if(Q.childNodes.length==0){x.dom.add(Q,X.element,null,"<br />");V=x.dom.add(Q,X.element,null,"<br />")}else{K=Q.innerHTML;Q.innerHTML="";x.dom.add(Q,X.element,null,K);V=x.dom.add(Q,X.element,null,"<br />")}I=T.createRange();I.selectNodeContents(V);I.collapse(1);x.selection.setRng(I);return h}if(Q==W&&u==W&&W.firstChild&&x.dom.isBlock(W.firstChild)){Q=u=Q.firstChild;P=p=0;L=T.createRange();L.setStart(Q,0);M=T.createRange();M.setStart(u,0)}Q=Q.nodeName=="HTML"?T.body:Q;Q=Q.nodeName=="BODY"?Q.firstChild:Q;u=u.nodeName=="HTML"?T.body:u;u=u.nodeName=="BODY"?u.firstChild:u;v=G.getParentBlock(Q);A=G.getParentBlock(u);o=v?v.nodeName:X.element;if(K=G.dom.getParent(v,"li,pre")){if(K.nodeName=="LI"){return e(x.selection,G.dom,K)}return d}if(v&&(v.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;v=null}if(A&&(A.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;A=null}if(/(TD|TABLE|TH|CAPTION)/.test(o)||(v&&o=="DIV"&&/left|right/gi.test(O.getStyle(v,"float",1)))){o=X.element;v=A=null}E=(v&&v.nodeName==o)?v.cloneNode(0):x.dom.create(o);V=(A&&A.nodeName==o)?A.cloneNode(0):x.dom.create(o);V.removeAttribute("id");if(/^(H[1-6])$/.test(o)&&g(I,v)){V=x.dom.create(X.element)}K=q=Q;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}q=K}while((K=K.previousSibling?K.previousSibling:K.parentNode));K=z=u;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}z=K}while((K=K.nextSibling?K.nextSibling:K.parentNode));if(q.nodeName==o){L.setStart(q,0)}else{L.setStartBefore(q)}L.setEnd(Q,P);E.appendChild(L.cloneContents()||T.createTextNode(""));try{M.setEndAfter(z)}catch(R){}M.setStart(u,p);V.appendChild(M.cloneContents()||T.createTextNode(""));I=T.createRange();if(!q.previousSibling&&q.parentNode.nodeName==o){I.setStartBefore(q.parentNode)}else{if(L.startContainer.nodeName==o&&L.startOffset==0){I.setStartBefore(L.startContainer)}else{I.setStart(L.startContainer,L.startOffset)}}if(!z.nextSibling&&z.parentNode.nodeName==o){I.setEndAfter(z.parentNode)}else{I.setEnd(M.endContainer,M.endOffset)}I.deleteContents();if(b){x.getWin().scrollTo(0,N.y)}if(E.firstChild&&E.firstChild.nodeName==o){E.innerHTML=E.firstChild.innerHTML}if(V.firstChild&&V.firstChild.nodeName==o){V.innerHTML=V.firstChild.innerHTML}if(f(E)){E.innerHTML="<br />"}function U(y,s){var r=[],Z,Y,t;y.innerHTML="";if(X.keep_styles){Y=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)){Z=Y.cloneNode(h);O.setAttrib(Z,"id","");r.push(Z)}}while(Y=Y.parentNode)}if(r.length>0){for(t=r.length-1,Z=y;t>=0;t--){Z=Z.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(V)){C=U(V,u)}if(b&&parseFloat(opera.version())<9.5){I.insertNode(E);I.insertNode(V)}else{I.insertNode(V);I.insertNode(E)}V.normalize();E.normalize();function B(r){return T.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}I=T.createRange();I.selectNodeContents(a?B(C||V):C||V);I.collapse(1);H.removeAllRanges();H.addRange(I);D=x.dom.getPos(V).y;F=V.clientHeight;if(D<N.y||D+F>N.y+N.h){x.getWin().scrollTo(0,D<N.y?D:D-N.h+25)}return h},backspaceDelete:function(v,C){var D=this,u=D.editor,z=u.getBody(),s=u.dom,q,x=u.selection,p=x.getRng(),y=p.startContainer,q,A,B,o;if(!C&&p.collapsed&&y.nodeType==1&&p.startOffset==y.childNodes.length){o=new m.dom.TreeWalker(y.lastChild,y);for(q=y.lastChild;q;q=o.prev()){if(q.nodeType==3){p.setStart(q,q.nodeValue.length);p.collapse(true);x.setRng(p);return}}}if(y&&u.dom.isBlock(y)&&!/^(TD|TH)$/.test(y.nodeName)&&C){if(y.childNodes.length==0||(y.childNodes.length==1&&y.firstChild.nodeName=="BR")){q=y;while((q=q.previousSibling)&&!u.dom.isBlock(q)){}if(q){if(y!=z.firstChild){A=u.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,h);while(B=A.nextNode()){q=B}p=u.getDoc().createRange();p.setStart(q,q.nodeValue?q.nodeValue.length:0);p.setEnd(q,q.nodeValue?q.nodeValue.length:0);x.setRng(p);u.dom.remove(y)}return k.cancel(v)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(T){var K={},M=a.each,c=T.dom,p=T.selection,s=a.dom.TreeWalker,I=new a.dom.RangeUtils(c),d=T.schema.isValid,E=c.isBlock,k=T.settings.forced_root_block,r=c.nodeIndex,D="\uFEFF",e=/^(src|href|style)$/,Q=false,A=true,o,N={apply:[],remove:[]};function y(U){return U instanceof Array}function l(V,U){return c.getParents(V,U,c.getRoot())}function b(U){return U.nodeType===1&&(U.face==="mceinline"||U.style.fontFamily==="mceinline")}function P(U){return U?K[U]:K}function j(U,V){if(U){if(typeof(U)!=="string"){M(U,function(X,W){j(W,X)})}else{V=V.length?V:[V];M(V,function(W){if(W.deep===o){W.deep=!W.selector}if(W.split===o){W.split=!W.selector||W.inline}if(W.remove===o&&W.selector&&!W.inline){W.remove="none"}if(W.selector&&W.inline){W.mixed=true;W.block_expand=true}if(typeof(W.classes)==="string"){W.classes=W.classes.split(/\s+/)}});K[U]=V}}}function R(W,ac,Y){var Z=P(W),ad=Z[0],ab,V,aa;function X(ag){var af=ag.startContainer,aj=ag.startOffset,ai,ah;if(af.nodeType==1||af.nodeValue===""){af=af.nodeType==1?af.childNodes[aj]:af;if(af){ai=new s(af,af.parentNode);for(ah=ai.current();ah;ah=ai.next()){if(ah.nodeType==3&&!f(ah)){ag.setStart(ah,0);break}}}}return ag}function U(ag,af){af=af||ad;if(ag){M(af.styles,function(ai,ah){c.setStyle(ag,ah,q(ai,ac))});M(af.attributes,function(ai,ah){c.setAttrib(ag,ah,q(ai,ac))});M(af.classes,function(ah){ah=q(ah,ac);if(!c.hasClass(ag,ah)){c.addClass(ag,ah)}})}}function ae(ag){var af=[],ai,ah;ai=ad.inline||ad.block;ah=c.create(ai);U(ah);I.walk(ag,function(aj){var ak;function al(am){var ap=am.nodeName.toLowerCase(),ao=am.parentNode.nodeName.toLowerCase(),an;if(g(ap,"br")){ak=0;if(ad.block){c.remove(am)}return}if(ad.wrapper&&v(am,W,ac)){ak=0;return}if(ad.block&&!ad.wrapper&&F(ap)){am=c.rename(am,ai);U(am);af.push(am);ak=0;return}if(ad.selector){M(Z,function(aq){if(c.is(am,aq.selector)&&!b(am)){U(am,aq);an=true}});if(!ad.inline||an){ak=0;return}}if(d(ai,ap)&&d(ao,ai)){if(!ak){ak=ah.cloneNode(Q);am.parentNode.insertBefore(ak,am);af.push(ak)}ak.appendChild(am)}else{ak=0;M(a.grep(am.childNodes),al);ak=0}}M(aj,al)});M(af,function(al){var aj;function am(ao){var an=0;M(ao.childNodes,function(ap){if(!f(ap)&&!G(ap)){an++}});return an}function ak(an){var ap,ao;M(an.childNodes,function(aq){if(aq.nodeType==1&&!G(aq)&&!b(aq)){ap=aq;return Q}});if(ap&&h(ap,ad)){ao=ap.cloneNode(Q);U(ao);c.replace(ao,an,A);c.remove(ap,1)}return ao||an}aj=am(al);if(aj===0){c.remove(al,1);return}if(ad.inline||ad.wrapper){if(!ad.exact&&aj===1){al=ak(al)}M(Z,function(an){M(c.select(an.inline,al),function(ao){S(an,ac,ao,an.exact?ao:null)})});if(v(al.parentNode,W,ac)){c.remove(al,1);al=0;return A}if(ad.merge_with_parents){c.getParent(al.parentNode,function(an){if(v(an,W,ac)){c.remove(al,1);al=0;return A}})}if(al){al=t(B(al),al);al=t(al,B(al,A))}}})}if(ad){if(Y){V=c.createRng();V.setStartBefore(Y);V.setEndAfter(Y);ae(n(V,Z))}else{if(!p.isCollapsed()||!ad.inline){ab=p.getBookmark();ae(n(p.getRng(A),Z));p.moveToBookmark(ab);p.setRng(X(p.getRng(A)));T.nodeChanged()}else{O("apply",W,ac)}}}}function z(W,af,Z){var aa=P(W),ah=aa[0],ae,ad,V;function Y(ak){var aj=ak.startContainer,ap=ak.startOffset,ao,an,al,am;if(aj.nodeType==3&&ap>=aj.nodeValue.length-1){aj=aj.parentNode;ap=r(aj)+1}if(aj.nodeType==1){al=aj.childNodes;aj=al[Math.min(ap,al.length-1)];ao=new s(aj);if(ap>al.length-1){ao.next()}for(an=ao.current();an;an=ao.next()){if(an.nodeType==3&&!f(an)){am=c.create("a",null,D);an.parentNode.insertBefore(am,an);ak.setStart(an,0);p.setRng(ak);c.remove(am);return}}}}function X(am){var al,ak,aj;al=a.grep(am.childNodes);for(ak=0,aj=aa.length;ak<aj;ak++){if(S(aa[ak],af,am,am)){break}}if(ah.deep){for(ak=0,aj=al.length;ak<aj;ak++){X(al[ak])}}}function ab(aj){var ak;M(l(aj.parentNode).reverse(),function(al){var am;if(!ak&&al.id!="_start"&&al.id!="_end"){am=v(al,W,af);if(am&&am.split!==false){ak=al}}});return ak}function U(am,aj,ao,ar){var at,aq,ap,al,an,ak;if(am){ak=am.parentNode;for(at=aj.parentNode;at&&at!=ak;at=at.parentNode){aq=at.cloneNode(Q);for(an=0;an<aa.length;an++){if(S(aa[an],af,aq,aq)){aq=0;break}}if(aq){if(ap){aq.appendChild(ap)}if(!al){al=aq}ap=aq}}if(ar&&(!ah.mixed||!E(am))){aj=c.split(am,aj)}if(ap){ao.parentNode.insertBefore(ap,ao);al.appendChild(ao)}}return aj}function ag(aj){return U(ab(aj),aj,aj,true)}function ac(al){var ak=c.get(al?"_start":"_end"),aj=ak[al?"firstChild":"lastChild"];if(G(aj)){aj=aj[al?"firstChild":"lastChild"]}c.remove(ak,true);return aj}function ai(aj){var ak,al;aj=n(aj,aa,A);if(ah.split){ak=H(aj,A);al=H(aj);if(ak!=al){ak=L(ak,"span",{id:"_start",_mce_type:"bookmark"});al=L(al,"span",{id:"_end",_mce_type:"bookmark"});ag(ak);ag(al);ak=ac(A);al=ac()}else{ak=al=ag(ak)}aj.startContainer=ak.parentNode;aj.startOffset=r(ak);aj.endContainer=al.parentNode;aj.endOffset=r(al)+1}I.walk(aj,function(am){M(am,function(an){X(an)})})}if(Z){V=c.createRng();V.setStartBefore(Z);V.setEndAfter(Z);ai(V);return}if(!p.isCollapsed()||!ah.inline){ae=p.getBookmark();ai(p.getRng(A));p.moveToBookmark(ae);if(i(W,af,p.getStart())){Y(p.getRng(true))}T.nodeChanged()}else{O("remove",W,af)}}function C(U,W,V){if(i(U,W,V)){z(U,W,V)}else{R(U,W,V)}}function v(V,U,aa,Y){var W=P(U),ab,Z,X;function ac(ag,ai,aj){var af,ah,ad=ai[aj],ae;if(ad){if(ad.length===o){for(af in ad){if(ad.hasOwnProperty(af)){if(aj==="attributes"){ah=c.getAttrib(ag,af)}else{ah=J(ag,af)}if(Y&&!ah&&!ai.exact){return}if((!Y||ai.exact)&&!g(ah,q(ad[af],aa))){return}}}}else{for(ae=0;ae<ad.length;ae++){if(aj==="attributes"?c.getAttrib(ag,ad[ae]):J(ag,ad[ae])){return ai}}}}return ai}if(W&&V){for(Z=0;Z<W.length;Z++){ab=W[Z];if(h(V,ab)&&ac(V,ab,"attributes")&&ac(V,ab,"styles")){if(X=ab.classes){for(Z=0;Z<X.length;Z++){if(!c.hasClass(V,X[Z])){return}}}return ab}}}}function i(W,Z,Y){var V,X;function U(aa){aa=c.getParent(aa,function(ab){return !!v(ab,W,Z,true)});return v(aa,W,Z)}if(Y){return U(Y)}if(p.isCollapsed()){for(X=N.apply.length-1;X>=0;X--){if(N.apply[X].name==W){return true}}for(X=N.remove.length-1;X>=0;X--){if(N.remove[X].name==W){return false}}return U(p.getNode())}Y=p.getNode();if(U(Y)){return A}V=p.getStart();if(V!=Y){if(U(V)){return A}}return Q}function u(ab,aa){var Y,Z=[],X={},W,V,U;if(p.isCollapsed()){for(V=0;V<ab.length;V++){for(W=N.remove.length-1;W>=0;W--){U=ab[V];if(N.remove[W].name==U){X[U]=true;break}}}for(W=N.apply.length-1;W>=0;W--){for(V=0;V<ab.length;V++){U=ab[V];if(!X[U]&&N.apply[W].name==U){X[U]=true;Z.push(U)}}}}Y=p.getStart();c.getParent(Y,function(ae){var ad,ac;for(ad=0;ad<ab.length;ad++){ac=ab[ad];if(!X[ac]&&v(ae,ac,aa)){X[ac]=true;Z.push(ac)}}});return Z}function x(Y){var aa=P(Y),X,W,Z,V,U;if(aa){X=p.getStart();W=l(X);for(V=aa.length-1;V>=0;V--){U=aa[V].selector;if(!U){return A}for(Z=W.length-1;Z>=0;Z--){if(c.is(W[Z],U)){return A}}}}return Q}a.extend(this,{get:P,register:j,apply:R,remove:z,toggle:C,match:i,matchAll:u,matchNode:v,canApply:x});function h(U,V){if(g(U,V.inline)){return A}if(g(U,V.block)){return A}if(V.selector){return c.is(U,V.selector)}}function g(V,U){V=V||"";U=U||"";V=""+(V.nodeName||V);U=""+(U.nodeName||U);return V.toLowerCase()==U.toLowerCase()}function J(V,U){var W=c.getStyle(V,U);if(U=="color"||U=="backgroundColor"){W=c.toHex(W)}if(U=="fontWeight"&&W==700){W="bold"}return""+W}function q(U,V){if(typeof(U)!="string"){U=U(V)}else{if(V){U=U.replace(/%(\w+)/g,function(X,W){return V[W]||X})}}return U}function f(U){return U&&U.nodeType===3&&/^([\s\r\n]+|)$/.test(U.nodeValue)}function L(W,V,U){var X=c.create(V,U);W.parentNode.insertBefore(X,W);X.appendChild(W);return X}function n(U,ac,X){var W=U.startContainer,Z=U.startOffset,af=U.endContainer,aa=U.endOffset,ae,ab;function ad(ai,aj,ag,ah){var ak,al;ah=ah||c.getRoot();for(;;){ak=ai.parentNode;if(ak==ah||(!ac[0].block_expand&&E(ak))){return ai}for(ae=ak[aj];ae&&ae!=ai;ae=ae[ag]){if(ae.nodeType==1&&!G(ae)){return ai}if(ae.nodeType==3&&!f(ae)){return ai}}ai=ai.parentNode}return ai}if(W.nodeType==1&&W.hasChildNodes()){ab=W.childNodes.length-1;W=W.childNodes[Z>ab?ab:Z];if(W.nodeType==3){Z=0}}if(af.nodeType==1&&af.hasChildNodes()){ab=af.childNodes.length-1;af=af.childNodes[aa>ab?ab:aa-1];if(af.nodeType==3){aa=af.nodeValue.length}}if(G(W.parentNode)){W=W.parentNode}if(G(W)){W=W.nextSibling||W}if(G(af.parentNode)){af=af.parentNode}if(G(af)){af=af.previousSibling||af}if(ac[0].inline||ac[0].block_expand){W=ad(W,"firstChild","nextSibling");af=ad(af,"lastChild","previousSibling")}if(ac[0].selector&&ac[0].expand!==Q&&!ac[0].inline){function Y(ah,ag){var ai,aj,ak;if(ah.nodeType==3&&ah.nodeValue.length==0&&ah[ag]){ah=ah[ag]}ai=l(ah);for(aj=0;aj<ai.length;aj++){for(ak=0;ak<ac.length;ak++){if(c.is(ai[aj],ac[ak].selector)){return ai[aj]}}}return ah}W=Y(W,"previousSibling");af=Y(af,"nextSibling")}if(ac[0].block||ac[0].selector){function V(ah,ag,aj){var ai;if(!ac[0].wrapper){ai=c.getParent(ah,ac[0].block)}if(!ai){ai=c.getParent(ah.nodeType==3?ah.parentNode:ah,E)}if(ai&&ac[0].wrapper){ai=l(ai,"ul,ol").reverse()[0]||ai}if(!ai){ai=ah;while(ai[ag]&&!E(ai[ag])){ai=ai[ag];if(g(ai,"br")){break}}}return ai||ah}W=V(W,"previousSibling");af=V(af,"nextSibling");if(ac[0].block){if(!E(W)){W=ad(W,"firstChild","nextSibling")}if(!E(af)){af=ad(af,"lastChild","previousSibling")}}}if(W.nodeType==1){Z=r(W);W=W.parentNode}if(af.nodeType==1){aa=r(af)+1;af=af.parentNode}return{startContainer:W,startOffset:Z,endContainer:af,endOffset:aa}}function S(aa,Z,X,U){var W,V,Y;if(!h(X,aa)){return Q}if(aa.remove!="all"){M(aa.styles,function(ac,ab){ac=q(ac,Z);if(typeof(ab)==="number"){ab=ac;U=0}if(!U||g(J(U,ab),ac)){c.setStyle(X,ab,"")}Y=1});if(Y&&c.getAttrib(X,"style")==""){X.removeAttribute("style");X.removeAttribute("_mce_style")}M(aa.attributes,function(ad,ab){var ac;ad=q(ad,Z);if(typeof(ab)==="number"){ab=ad;U=0}if(!U||g(c.getAttrib(U,ab),ad)){if(ab=="class"){ad=c.getAttrib(X,ab);if(ad){ac="";M(ad.split(/\s+/),function(ae){if(/mce\w+/.test(ae)){ac+=(ac?" ":"")+ae}});if(ac){c.setAttrib(X,ab,ac);return}}}if(ab=="class"){X.removeAttribute("className")}if(e.test(ab)){X.removeAttribute("_mce_"+ab)}X.removeAttribute(ab)}});M(aa.classes,function(ab){ab=q(ab,Z);if(!U||c.hasClass(U,ab)){c.removeClass(X,ab)}});V=c.getAttribs(X);for(W=0;W<V.length;W++){if(V[W].nodeName.indexOf("_")!==0){return Q}}}if(aa.remove!="none"){m(X,aa);return A}}function m(W,X){var U=W.parentNode,V;if(X.block){if(!k){function Y(aa,Z,ab){aa=B(aa,Z,ab);return !aa||(aa.nodeName=="BR"||E(aa))}if(E(W)&&!E(U)){if(!Y(W,Q)&&!Y(W.firstChild,A,1)){W.insertBefore(c.create("br"),W.firstChild)}if(!Y(W,A)&&!Y(W.lastChild,Q,1)){W.appendChild(c.create("br"))}}}else{if(U==c.getRoot()){if(!X.list_block||!g(W,X.list_block)){M(a.grep(W.childNodes),function(Z){if(d(k,Z.nodeName.toLowerCase())){if(!V){V=L(Z,k)}else{V.appendChild(Z)}}else{V=0}})}}}}if(X.selector&&X.inline&&!g(X.inline,W)){return}c.remove(W,1)}function B(V,U,W){if(V){U=U?"nextSibling":"previousSibling";for(V=W?V:V[U];V;V=V[U]){if(V.nodeType==1||!f(V)){return V}}}}function G(U){return U&&U.nodeType==1&&U.getAttribute("_mce_type")=="bookmark"}function t(Y,X){var U,W,V;function aa(ad,ac){if(ad.nodeName!=ac.nodeName){return Q}function ab(af){var ag={};M(c.getAttribs(af),function(ah){var ai=ah.nodeName.toLowerCase();if(ai.indexOf("_")!==0&&ai!=="style"){ag[ai]=c.getAttrib(af,ai)}});return ag}function ae(ai,ah){var ag,af;for(af in ai){if(ai.hasOwnProperty(af)){ag=ah[af];if(ag===o){return Q}if(ai[af]!=ag){return Q}delete ah[af]}}for(af in ah){if(ah.hasOwnProperty(af)){return Q}}return A}if(!ae(ab(ad),ab(ac))){return Q}if(!ae(c.parseStyle(c.getAttrib(ad,"style")),c.parseStyle(c.getAttrib(ac,"style")))){return Q}return A}if(Y&&X){function Z(ac,ab){for(W=ac;W;W=W[ab]){if(W.nodeType==3&&!f(W)){return ac}if(W.nodeType==1&&!G(W)){return W}}return ac}Y=Z(Y,"previousSibling");X=Z(X,"nextSibling");if(aa(Y,X)){for(W=Y.nextSibling;W&&W!=X;){V=W;W=W.nextSibling;Y.appendChild(V)}c.remove(X);M(a.grep(X.childNodes),function(ab){Y.appendChild(ab)});return Y}}return X}function F(U){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(U)}function H(V,Y){var U,X,W;U=V[Y?"startContainer":"endContainer"];X=V[Y?"startOffset":"endOffset"];if(U.nodeType==1){W=U.childNodes.length-1;if(!Y&&X){X--}U=U.childNodes[X>W?W:X]}return U}function O(Z,V,Y){var W,U=N[Z],aa=N[Z=="apply"?"remove":"apply"];function ab(){return N.apply.length||N.remove.length}function X(){N.apply=[];N.remove=[]}function ac(ad){M(N.apply.reverse(),function(ae){R(ae.name,ae.vars,ad)});M(N.remove.reverse(),function(ae){z(ae.name,ae.vars,ad)});c.remove(ad,1);X()}for(W=U.length-1;W>=0;W--){if(U[W].name==V){return}}U.push({name:V,vars:Y});for(W=aa.length-1;W>=0;W--){if(aa[W].name==V){aa.splice(W,1)}}if(ab()){T.getDoc().execCommand("FontName",false,"mceinline");N.lastRng=p.getRng();M(c.select("font,span"),function(ae){var ad;if(b(ae)){ad=p.getBookmark();ac(ae);p.moveToBookmark(ad);T.nodeChanged()}});if(!N.isListening&&ab()){N.isListening=true;M("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(ad){T[ad].addToTop(function(ae,af){if(ab()&&!a.dom.RangeUtils.compareRanges(N.lastRng,p.getRng())){M(c.select("font,span"),function(ah){var ai,ag;if(b(ah)){ai=ah.firstChild;if(ai){ac(ah);ag=c.createRng();ag.setStart(ai,ai.nodeValue.length);ag.setEnd(ai,ai.nodeValue.length);p.setRng(ag);ae.nodeChanged()}else{c.remove(ah)}}});if(af.type=="keyup"||af.type=="mouseup"){X()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}}); 
     1(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4b1",releaseDate:"2010-12-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(p){if(p.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(p.src)){if(/_(src|dev)\.js/g.test(p.src)){s.suffix="_src"}if((j=p.src.indexOf("?"))!=-1){s.query=p.src.substring(j+1)}s.baseURL=p.src.substring(0,p.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(j,f,h){var k,g;if(!j){return 0}h=h||j;if(j.length!==e){for(k=0,g=j.length;k<g;k++){if(f.call(h,j[k],k,j)===false){return 0}}}else{for(k in j){if(j.hasOwnProperty(k)){if(f.call(h,j[k],k,j)===false){return 0}}}}return 1},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(q,f,k){var o=this,g,j,l,m,h,n=0;q=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(q);l=q[3].match(/(^|\.)(\w+)$/i)[2];j=o.createNS(q[3].replace(/\.\w+$/,""),k);if(j[l]){return}if(q[2]=="static"){j[l]=f;if(this.onCreate){this.onCreate(q[2],q[3],j[l])}return}if(!f[l]){f[l]=function(){};n=1}j[l]=f[l];o.extend(j[l].prototype,f);if(q[5]){g=o.resolve(q[5]).prototype;m=q[5].match(/\.(\w+)$/i)[1];h=j[l];if(n){j[l]=function(){return g[m].apply(this,arguments)}}else{j[l]=function(){this.parent=g[m];return h.apply(this,arguments)}}j[l].prototype[l]=j[l];o.each(g,function(p,r){j[l].prototype[r]=g[r]});o.each(f,function(p,r){if(g[r]){j[l].prototype[r]=function(){this.parent=g[r];return p.apply(this,arguments)}}else{if(r!=l){j[l].prototype[r]=p}}})}o.each(f["static"],function(p,r){j[l][r]=p});if(this.onCreate){this.onCreate(q[2],q[3],j[l].prototype)}},walk:function(j,h,k,g){g=g||this;if(j){if(k){j=j[k]}b.each(j,function(l,f){if(h.call(g,l,f,k)===false){return false}b.walk(l,h,k,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(k,j){var h=this;k={func:k,scope:j||this};if(!h.unloads){function g(){var f=h.unloads,m,p;if(f){for(p in f){m=f[p];if(m&&m.func){m.func.call(m.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",l);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=m=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function l(){var m=document;if(m.readyState=="interactive"){function f(){m.detachEvent("onstop",f);if(g){g()}m=0}if(m){m.attachEvent("onstop",f)}d.setTimeout(function(){if(m){m.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",l)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[k]}else{h.unloads.push(k)}return k},removeUnload:function(j){var g=this.unloads,h=null;b.each(g,function(k,f){if(k&&k.func==j){g.splice(f,1);h=j;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);(function(e,d){var c=d.is,b=/^(href|src|style)$/i,f;if(!e){return alert("Load jQuery first!")}d.$=e;d.adapter={patchEditor:function(k){var j=e.fn;function h(o,p){var n=this;if(p){n.removeAttr("data-mce-style")}return j.css.apply(n,arguments)}function g(o,p){var n=this;if(b.test(o)){if(p!==f){n.each(function(q,r){k.dom.setAttrib(r,o,p)});return n}else{return n.attr("data-mce-"+o)}}return j.attr.apply(n,arguments)}function l(n){return function(o){if(o){o=k.dom.processHTML(o)}return n.call(this,o)}}function m(n){if(n.css!==h){n.css=h;n.attr=g;n.html=l(j.html);n.append=l(j.append);n.prepend=l(j.prepend);n.after=l(j.after);n.before=l(j.before);n.replaceWith=l(j.replaceWith);n.tinymce=k;n.pushStack=function(){return m(j.pushStack.apply(this,arguments))}}return n}k.$=function(n,o){var p=k.getDoc();return m(e(n||p,p||o))}}};d.extend=e.extend;d.extend(d,{map:e.map,grep:function(g,h){return e.grep(g,h||function(){return 1})},inArray:function(g,h){return e.inArray(h,g||[])}});var a={"tinymce.dom.DOMUtils":{select:function(j,h){var g=this;return e.find(j,g.get(h)||g.get(g.settings.root_element)||g.doc,[])},is:function(h,g){return e(this.get(h)).is(g)}}};d.onCreate=function(g,j,h){d.extend(h,a[j])}})(window.jQuery,tinymce);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(j){if(j){h.push(j)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(k,b,g,f,j,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(k,h,g,f,j,c)},get:function(j){var h=document.cookie,g,f=j+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(j,b,g,f,h,c){document.cookie=j+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(a,b){i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(j){a=0;try{a=new ActiveXObject(j)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(j){var a,g,d,k=/[&\"\u007E-\uFFFF]/g,b=/[<>&\u007E-\uFFFF]/g,f=/[<>&\"\']/g,c=/&(#)?([\w]+);/g;g={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};d={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){return String.fromCharCode(o)}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : _".split(" ");for(g=0;g<j.length;g++){a[j[g]]="_"+g;a["_"+g]=j[g]}function c(o,s,q,n){function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+p(s)+p(q)+p(n)}return{toHex:function(n){return n.replace(k,c)},parse:function(s){var y={},q,o,x,r,v=d.url_converter;function p(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function u(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!u(B)){return}if(!u(A)){return}if(!u(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function t(A){r=true;return a[A]}function n(B,A){if(r){B=B.replace(/_[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(s){s=s.replace(/\\[\"\';:_]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,t)});while(q=b.exec(s)){o=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(o&&x.length>0){if(o==="font-weight"&&x==="700"){x="bold"}else{if(o==="color"||o==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=n(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=n(A||E||D);if(v){A=v(A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[o]=r?n(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(q,r){var p="",o;function n(t){var x,u,s,t,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=q[t];if(v!==e){p+=(p.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){n("*");n(o)}else{for(o in q){p+=(p.length>0?" ":"")+o+": "+q[o]+";"}}return p}}};(function(k){var e={},g,j,a,c,d=k.makeMap,h=k.each;function f(m,l){return m.split(l||",")}function b(p,o){var m,n={};function l(q){return q.replace(/[A-Z]+/g,function(r){return l(p[r])})}for(m in p){if(p.hasOwnProperty(m)){p[m]=l(p[m])}}l(o).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(t,r,q,s){q=f(q,"|");n[r]={attributes:d(q),attributesOrder:q,children:d(s,"|",{"#comment":{}})}});return n}j="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";j=d(j,",",d(j.toUpperCase()));e=b({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|height|width|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|height|width|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|height|width][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");g=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls");a=d("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");c=d("pre,script,style");k.html.Schema=function(o){var v=this,l={},m={},t=[],n;o=o||{};if(o.valid_styles){n={};h(o.valid_styles,function(y,x){n[x]=k.explode(y)})}function u(x){return new RegExp("^"+x.replace(/([?+*])/g,".$1")+"$")}function q(E){var D,z,S,O,T,y,B,N,Q,J,R,V,H,C,P,x,L,A,U,W,I,M,G=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,K=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,F=/[*?+]/;if(E){E=f(E);if(l["@"]){L=l["@"].attributes;A=l["@"].attributesOrder}for(D=0,z=E.length;D<z;D++){y=G.exec(E[D]);if(y){P=y[1];J=y[2];x=y[3];Q=y[4];H={};C=[];B={attributes:H,attributesOrder:C};if(P==="#"){B.paddEmpty=true}if(P==="-"){B.removeEmpty=true}if(L){for(W in L){H[W]=L[W]}C.push.apply(C,A)}if(Q){Q=f(Q,"|");for(S=0,O=Q.length;S<O;S++){y=K.exec(Q[S]);if(y){N={};V=y[1];R=y[2].replace(/::/g,":");P=y[3];M=y[4];if(V==="!"){B.attributesRequired=B.attributesRequired||[];B.attributesRequired.push(R);N.required=true}if(V==="-"){delete H[R];C.splice(k.inArray(C,R),1);continue}if(P){if(P==="="){B.attributesDefault=B.attributesDefault||[];B.attributesDefault.push({name:R,value:M});N.defaultValue=M}if(P===":"){B.attributesForced=B.attributesForced||[];B.attributesForced.push({name:R,value:M});N.forcedValue=M}if(P==="<"){N.validValues=d(M,"?")}}if(F.test(R)){B.attributePatterns=B.attributePatterns||[];N.pattern=u(R);B.attributePatterns.push(N)}else{if(!H[R]){C.push(R)}H[R]=N}}}}if(!L&&J=="@"){L=H;A=C}if(x){B.outputName=J;l[x]=B}if(F.test(J)){B.pattern=u(J);t.push(B)}else{l[J]=B}}}}}function s(x){l={};t=[];q(x);h(e,function(z,y){m[y]=z.children})}function p(y){var x=/^(~)?(.+)$/;if(y){h(f(y),function(B){var A=x.exec(B),C=A[1]==="~"?"span":"div",z=A[2];m[z]=m[C];h(m,function(D,E){if(D[C]){D[z]=D[C]}})})}}function r(y){var x=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(y){h(f(y),function(C){var B=x.exec(C),z,A;if(B){A=B[1];if(A){z=m[B[2]]}else{z=m[B[2]]={"#comment":{}}}z=m[B[2]];h(f(B[3],"|"),function(D){if(A==="-"){delete z[D]}else{z[D]={}}})}})}}if(!o.valid_elements){h(e,function(y,x){l[x]={attributes:y.attributes,attributesOrder:y.attributesOrder};m[x]=y.children});h(f("strong/b,em/i"),function(x){x=f(x,"/");l[x[1]].outputName=x[0]});l.img.attributesDefault=[{name:"alt",value:""}];h(f("ol,ul,li,sub,sup,blockquote,tr,div,span,font,a,table,tbody"),function(x){l[x].removeEmpty=true});h(f("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(x){l[x].paddEmpty=true})}else{s(o.valid_elements)}p(o.custom_elements);r(o.valid_children);q(o.extended_valid_elements);r("+ol[ul|ol],+ul[ul|ol]");if(o.invalid_elements){k.each(k.explode(o.invalid_elements),function(x){if(l[x]){delete l[x]}})}v.children=m;v.styles=n;v.getBoolAttrs=function(){return g};v.getBlockElements=function(){return j};v.getEmptyElements=function(){return a};v.getWhiteSpaceElements=function(){return c};v.isValidChild=function(x,z){var y=m[x];return !!(y&&y[z])};v.getElementRule=function(x){var z=l[x],y;if(z){return z}y=t.length;while(y--){z=t[y];if(z.pattern.test(x)){return z}}};v.addValidElements=q;v.setValidElements=s;v.addCustomElements=p;v.addValidChildren=r};k.html.Schema.boolAttrMap=g;k.html.Schema.blockElementsMap=j})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(r){var A=this,f,n=0,E,j,m=[],B,l,I,u,q,k,x,z,G,s,D,p,H,o,F,K,J,C,h,g,v,t=0,y=a.html.Entities.decode;C=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)\\s*((?:[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]+))*)>))","g");h=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;g={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};q=e.getEmptyElements();k=e.getBoolAttrs();z=c.validate;while(f=C.exec(r)){if(n<f.index){A.text(y(r.substr(n,f.index-n)))}if(E=f[6]){E=E.toLowerCase();l=m.length;while(l--){if(m[l].name===E){break}}if(l>=0){for(I=m.length-1;I>=l;I--){E=m[I];if(E.valid){A.end(E.name)}}m.length=l}}else{if(E=f[7]){E=E.toLowerCase();x=E in q;if(!z||(G=e.getElementRule(E))){s=true;if(z){H=G.attributes;o=G.attributePatterns}if(p=f[8]){B=[];B.map={};p.replace(h,function(M,L,Q,P,O){var R,N;L=L.toLowerCase();Q=L in k?L:y(Q||P||O||"");if(z&&L.indexOf("data-")!==0){R=H[L];if(!R&&o){N=o.length;while(N--){R=o[N];if(R.pattern.test(L)){break}}if(N===-1){R=null}}if(!R){return}if(R.validValues&&!(Q in R.validValues)){return}}B.map[L]=Q;B.push({name:L,value:Q})})}else{B=[];B.map={}}if(z){F=G.attributesRequired;K=G.attributesDefault;J=G.attributesForced;if(J){I=J.length;while(I--){D=J[I];name=D.name;v=D.value;if(v==="{$uid}"){v="mce_"+t++}B.map[name]=v;B.push({name:name,value:v})}}if(K){I=K.length;while(I--){D=K[I];name=D.name;if(!(name in B.map)){v=D.value;if(v==="{$uid}"){v="mce_"+t++}B.map[name]=v;B.push({name:name,value:v})}}}if(F){I=F.length;while(I--){if(F[I] in B.map){break}}if(I===-1){s=false}}}if(s){A.start(E,B,x)}}else{s=false}if(j=g[E]){j.lastIndex=n=f.index+f[0].length;if(f=j.exec(r)){if(s){u=r.substr(n,f.index-n)}n=f.index+f[0].length}else{u=r.substr(n);n=r.length}if(s&&u.length>0){A.text(u,true)}if(s){A.end(E)}C.lastIndex=n;continue}if(!x){if(!p||p.indexOf("/")!=p.length-1){m.push({name:E,valid:s})}else{if(s){A.end(E)}}}}else{if(E=f[1]){A.comment(E)}else{if(E=f[2]){A.cdata(E)}else{if(E=f[3]){A.doctype(E)}else{if(E=f[4]){A.pi(E,f[5])}}}}}}n=f.index+f[0].length}if(n<r.length){A.text(y(r.substr(n)))}for(I=m.length-1;I>=0;I--){E=m[I];if(E.valid){A.end(E.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(l,m,k){var j,h,f=k?"lastChild":"firstChild",g=k?"prev":"next";if(l[f]){return l[f]}if(l!==m){j=l[g];if(j){return j}for(h=l.parent;h&&h!==m;h=h.parent){j=h[g];if(j){return j}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.empty=g.empty;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,j=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{j.next=g}if(h.lastChild===f){h.lastChild=j;if(j){j.next=null}}else{g.prev=j}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,j){var g;if(h.parent){h.remove()}g=f.parent||this;if(j){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,j=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){j.push(h)}}return j},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(j){var f=this,h=f,g;do{if(h.type===1){if(j[h.name]){return false}g=h.attributes.length;while(g--){if(h.attributes[g].name.indexOf("data-")===0){return false}}}if((h.type===3&&!c.test(h.value))){return false}}while(h=a(h,f));return true}});d.extend(b,{create:function(g,f){var j,h;j=new b(g,e[g]||1);if(f){for(h in f){j.attr(h,f[h])}}return j}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(f,g){var e=this,d={},c=[];f=f||{};f.root_name=f.root_name||"body";e.schema=g=g||new b.html.Schema();function h(j){var l,m,s,r,u,k,n,p,q=g.getEmptyElements(),o,t;o=b.makeMap("tr,td,th,tbody,thead,tfoot,table");for(l=0;l<j.length;l++){m=j[l];if(!m.parent){continue}r=[m];for(s=m.parent;s&&!g.isValidChild(s.name,m.name)&&!o[s.name];s=s.parent){r.push(s)}if(s&&r.length>1){r.reverse();u=k=r[0].clone();for(i=0;i<r.length-1;i++){if(g.isValidChild(k.name,r[i].name)){n=r[i].clone();k.append(n)}else{n=k}for(childNode=r[i].firstChild;childNode&&childNode!=r[i+1];childNode=childNode.next){n.append(childNode)}k=n}if(!u.isEmpty(q)){s.insert(u,r[0],true);s.insert(m,u)}else{s.insert(m,r[0],true)}if(r[0].isEmpty(q)){r[0].empty().remove()}}else{if(m.parent){if(m.name==="li"){t=m.prev;if(t&&(t.name==="ul"||t.name==="ul")){t.append(m);continue}t=m.next;if(t&&(t.name==="ul"||t.name==="ul")){t.insert(m,t.firstChild,true);continue}m.wrap(new a("ul",1));continue}if(g.isValidChild(m.parent.name,"div")&&g.isValidChild("div",m.name)){m.wrap(new a("div",1))}else{if(m.name==="style"||m.name==="script"){m.empty().remove()}else{m.unwrap()}}}}}}e.addNodeFilter=function(j,k){b.each(b.explode(j),function(l){var m=d[l];if(!m){d[l]=m=[]}m.push(k)})};e.addAttributeFilter=function(j,k){b.each(b.explode(j),function(l){var m;for(m=0;m<c.length;m++){if(c[m].name===l){c[m].callbacks.push(k);return}}c.push({name:l,callbacks:[k]})})};e.parse=function(u,m){var n,D,y,x,k={},p={},A,z,v,r,C,G,o,B,F=[],t,j,s,q;m=m||{};o=b.extend(b.makeMap("script,style,head,title,meta,param"),g.getBlockElements());q=g.children;s=g.getWhiteSpaceElements();B=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;j=/[ \t\r\n]+/g;function E(l,H){var I=new a(l,H),J;if(l in d){J=k[l];if(J){J.push(I)}else{k[l]=[I]}}return I}n=new b.html.SaxParser({validate:f.validate,cdata:function(l){y.append(E("#cdata",4)).value=l},text:function(I,l){var H;if(!s[y.name]){I=I.replace(j," ");if(y.lastChild&&o[y.lastChild.name]){I=I.replace(B,"")}}if(I.length!==0){H=E("#text",3);H.raw=!!l;y.append(H).value=I}},comment:function(l){y.append(E("#comment",8)).value=l},pi:function(l,H){y.append(E(l,7)).value=H},doctype:function(l){y.append(E("#doctype",10)).value=l},start:function(l,P,I){var N,K,J,H,L,Q,O,M;J=g.getElementRule(l);if(J){N=E(J.outputName||l,1);N.attributes=P;N.shortEnded=I;y.append(N);M=q[y.name];if(M&&q[N.name]&&!M[N.name]){F.push(N)}K=c.length;while(K--){L=c[K].name;if(L in P.map){C=p[L];if(C){C.push(N)}else{p[L]=[N]}}}if(o[l]){for(H=N.prev;H&&H.type===3;){Q=H.value.replace(t,"");if(Q.length>0){H.value=Q;H=H.prev}else{O=H.prev;H.remove();H=O}}}if(!I){y=N}}},end:function(l){var L,I,K,H,J;I=g.getElementRule(l);if(I){if(o[l]){if(!s[y.name]){for(L=y.firstChild;L&&L.type===3;){K=L.value.replace(B,"");if(K.length>0){L.value=K;L=L.next}else{H=L.next;L.remove();L=H}}for(L=y.lastChild;L&&L.type===3;){K=L.value.replace(t,"");if(K.length>0){L.value=K;L=L.prev}else{H=L.prev;L.remove();L=H}}}L=y.prev;if(L&&L.type===3){K=L.value.replace(B,"");if(K.length>0){L.value=K}else{L.remove()}}}if(I.removeEmpty||I.paddEmpty){if(y.isEmpty(g.getEmptyElements())){if(I.paddEmpty){y.empty().append(new a("#text","3")).value="\u00a0"}else{J=y.parent;y.empty().remove();y=J;return}}}y=y.parent}}},g);D=y=new a(f.root_name,11);n.parse(u);h(F);for(G in k){C=d[G];x=k[G];v=x.length;while(v--){if(!x[v].parent){x.splice(v,1)}}for(A=0,z=C.length;A<z;A++){C[A](x,G,m)}}for(A=0,z=c.length;A<z;A++){C=c[A];if(C.name in p){x=p[C.name];v=x.length;while(v--){if(!x[v].parent){x.splice(v,1)}}for(v=0,r=C.callbacks.length;v<r;v++){C.callbacks[v](x,C.name,m)}}}return D}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);return{start:function(k,j,o){var m,h,g,n;if(a&&b[k]&&c.length>0){n=c[c.length-1];if(n.length>0&&n!=="\n"){c.push("\n")}}c.push("<",k);if(j){for(m=0,h=j.length;m<h;m++){g=j[m];c.push(" ",g.name,'="',f(g.value,true),'"')}}if(!o){c[c.length]=">"}else{c[c.length]=" />"}},end:function(g){var h;c.push("</",g,">");if(a&&d[g]&&c.length>0){h=c[c.length-1];if(h.length>0&&h!=="\n"){c.push("\n")}}},text:function(h,g){if(h.length>0){c[c.length]=g?h:f(h)}},cdata:function(g){c.push("<![CDATA[",g,"]]>")},comment:function(g){c.push("<!--",g,"-->")},pi:function(g,h){if(h){c.push("<?",g," ",h,"?>")}else{c.push("<?",g,"?>")}},doctype:function(g){c.push("<!DOCTYPE",g,">")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,j;j=c.validate;g={3:function(l,k){e.text(l.value,l.raw)},8:function(k){e.comment(k.value)},7:function(k){e.pi(k.name,k.value)},10:function(k){e.doctype(k.value)},4:function(k){e.cdata(k.value)},11:function(k){if((k=k.firstChild)){do{f(k)}while(k=k.next)}}};e.reset();function f(m){var u=g[m.type],k,p,t,s,q,v,o,n,r;if(!u){k=m.name;p=m.shortEnded;t=m.attributes;if(j&&t&&t.length>1){v=[];v.map={};r=d.getElementRule(m.name);for(o=0,n=r.attributesOrder.length;o<n;o++){s=r.attributesOrder[o];if(s in t.map){q=t.map[s];v.map[s]=q;v.push({name:s,value:q})}}for(o=0,n=t.length;o<n;o++){s=t[o].name;if(!(s in v.map)){q=t.map[s];v.map[s]=q;v.push({name:s,value:q})}}t=v}e.start(m.name,t,p);if(!p){if((m=m.firstChild)){do{f(m)}while(m=m.next)}e.end(k)}}else{u(m)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);(function(d){var f=d.each,c=d.is,e=d.isWebKit,a=d.isIE,h=d.html.Entities,b=/^([a-z0-9],?)+$/i,g=d.html.Schema.blockElementsMap;d.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(n,l){var k=this,j;k.doc=n;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!d.isIE||n.documentMode>=8;k.boxModel=!d.isIE||n.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in n.createElement("a");k.settings=l=d.extend({keep_values:false,hex_colors:1},l);k.styles=new d.html.Styles({url_converter:l.url_converter},l.schema);if(d.isIE6){try{n.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}if(a){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(o){n.createElement(o)})}d.addUnload(k.destroy,k)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(c(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=c(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+"</"+r+">"}return q+" />"},remove:function(j,k){return this.run(j,function(m){var l,n;l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!d.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(d.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(a){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":a?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return false}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=a?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style[j]},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var k=m.attributes;for(var l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;switch(m){case"style":if(!c(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}if(c(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(m,o,l){var j,k=this;m=k.get(m);if(!m||m.nodeType!==1){return false}if(!c(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(o)){j=m.getAttribute("data-mce-"+o);if(j){return j}}if(a&&k.props[o]){j=m[k.props[o]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[k.props[o]]===true&&j===""){return o}return j?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){j=j||m.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),m.nodeName);if(k.settings.keep_values&&!k._isRes(j)){m.setAttribute("data-mce-style",j)}}}if(e&&o==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(o){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return o}return l;case"shape":j=j.toLowerCase();break;default:if(o.indexOf("on")===0&&j){j=d._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==undefined&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(a&&!k.stdMode){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=k.getStyle(k.select("html")[0],"borderWidth");j=(j=="medium"||k.boxModel&&!k.isIE6)&&2||j;return{x:s.left+o.scrollLeft-j,y:s.top+o.scrollTop-j}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:d._addVer(n)});if(a&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=d.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(a){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="<br />"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="<br />"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(a){try{if(a&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(c(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(d.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=d._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(a){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){d.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new d.dom.Range(this)},nodeIndex:function(n,o){var j=0,l,m,k;if(n){for(l=n.nodeType,n=n.previousSibling,m=n;n;n=n.previousSibling){k=n.nodeType;if(o&&k==3){if(k==l||!n.nodeValue.length){continue}}j++;l=k}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(u){var t,r=u.childNodes;if(u.nodeType==1&&u.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u.nodeType!=9){if(u.nodeType==3&&u.nodeValue.length>0){if(!s.isBlock(u.parentNode)||d.trim(u.nodeValue).length>0){return}}if(u.nodeType==1){r=u.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){u.parentNode.insertBefore(r[0],u)}if(r.length||/^(br|hr|input|img)$/i.test(u.nodeName)){return}}s.remove(u)}return u}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new d.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new d.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(c(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});d.DOM=new d.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,k=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",l=tinymce.extend,o=c.nodeIndex;l(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:r,setEnd:u,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:v,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:x,deleteContents:q,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function r(W,t){C(E,W,t)}function u(W,t){C(S,W,t)}function g(t){r(t.parentNode,o(t))}function J(t){r(t.parentNode,o(t)+1)}function K(t){u(t.parentNode,o(t))}function v(t){u(t.parentNode,o(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);v(t)}function G(t){r(t,0);u(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function x(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function q(){n(k)}function I(){return n(T)}function d(){return n(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return l(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa<Z){return -1}return 1}ab=W;while(ab&&ab.parentNode!=Y){ab=ab.parentNode}if(ab){X=0;t=Y.firstChild;while(t!=ab&&X<aa){X++;t=t.nextSibling}if(aa<=X){return -1}return 1}ab=Y;while(ab&&ab.parentNode!=W){ab=ab.parentNode}if(ab){X=0;t=W.firstChild;while(t!=ab&&X<Z){X++;t=t.nextSibling}if(X<Z){return -1}return 1}ac=c.findCommonAncestor(Y,W);ae=Y;while(ae&&ae.parentNode!=ac){ae=ae.parentNode}if(!ae){ae=ac}ad=W;while(ad&&ad.parentNode!=ac){ad=ad.parentNode}if(!ad){ad=ac}if(ae==ad){return 0}t=ac.firstChild;while(t){if(t==ae){return -1}if(t==ad){return 1}t=t.nextSibling}}function C(W,Z,Y){var t,X;if(W){O[h]=Z;O[V]=Y}else{O[Q]=Z;O[A]=Y}t=O[Q];while(t.parentNode){t=t.parentNode}X=O[h];while(X.parentNode){X=X.parentNode}if(X==t){if(H(O[h],O[V],O[Q],O[A])>0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function n(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return s(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return p(X,Z,ac)}function f(aa){var ac,Z,Y,ab,t,X,W;if(aa!=k){ac=e.createDocumentFragment()}if(O[V]==O[A]){return ac}if(O[h].nodeType==3){Z=O[h].nodeValue;Y=Z.substring(O[V],O[A]);if(aa!=F){O[h].deleteData(O[V],O[A]-O[V]);O.collapse(E)}if(aa==k){return}ac.appendChild(e.createTextNode(Y));return ac}ab=P(O[h],O[V]);t=O[A]-O[V];while(t>0){X=ab.nextSibling;W=z(ab,aa);if(ac){ac.appendChild(W)}--t;ab=X}if(aa!=F){O.collapse(E)}return ac}function s(ac,Z){var ab,aa,W,t,Y,X;if(Z!=k){ab=e.createDocumentFragment()}aa=j(ac,Z);if(ab){ab.appendChild(aa)}W=o(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=k){ac=e.createDocumentFragment()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=o(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function p(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=k){af=e.createDocumentFragment()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=o(aa);ac=o(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=j(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function j(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=k){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=k){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=k){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=k){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==k){return}ab=t.cloneNode(S);ab.nodeValue=X;return ab}if(ad==k){return}return t.cloneNode(S)}function z(W,t){if(t!=k){return t==F?W.cloneNode(E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(g){var j=this,k="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var o=g.getRng(),l=d.createRng(),n,p;n=o.item?o.item(0):o.parentElement();if(n.ownerDocument!=d.doc){return l}p=g.isCollapsed();if(o.item||!n.hasChildNodes()){if(p){l.setStart(n,0);l.setEnd(n,0)}else{l.setStart(n.parentNode,d.nodeIndex(n));l.setEnd(l.startContainer,l.startOffset+1)}return l}function m(t){var v,r,u,q,B=0,y,z,A,s,x;s=o.duplicate();s.collapse(t);v=d.create("a");A=s.parentElement();if(!A.hasChildNodes()){l[t?"setStart":"setEnd"](A,0);return}A.appendChild(v);s.moveToElementText(v);x=o.compareEndPoints(t?"StartToStart":"EndToEnd",s);if(x>0){l[t?"setStartAfter":"setEndAfter"](A);d.remove(v);return}q=tinymce.grep(A.childNodes);y=q.length-1;while(B<=y){z=Math.floor((B+y)/2);A.insertBefore(v,q[z]);s.moveToElementText(v);x=o.compareEndPoints(t?"StartToStart":"EndToEnd",s);if(x>0){B=z+1}else{if(x<0){y=z-1}else{found=true;break}}}r=x>0||z==0?v.nextSibling:v.previousSibling;if(r.nodeType==1){d.remove(v);u=d.nodeIndex(r);r=r.parentNode;if(!t||z>0){u++}}else{if(x>0||z==0){s.setEndPoint(t?"StartToStart":"EndToEnd",o);u=s.text.length}else{s.setEndPoint(t?"StartToStart":"EndToEnd",o);u=r.nodeValue.length-s.text.length}d.remove(v)}l[t?"setStart":"setEnd"](r,u)}m(true);if(!p){m()}return l}this.addRange=function(l){var q,o,n,s,v,t,u=g.dom.doc,p=u.body;function m(C){var y,B,x,A,z;x=d.create("a");y=C?n:v;B=C?s:t;A=q.duplicate();if(y==u){y=p;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);d.remove(x);q.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){d.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{x=u.createTextNode(k);y.appendChild(x);A.moveToElementText(x.parentNode);A.collapse(c)}q.setEndPoint(C?"StartToStart":"EndToEnd",A);d.remove(x)}}this.destroy();n=l.startContainer;s=l.startOffset;v=l.endContainer;t=l.endOffset;q=p.createTextRange();if(n==v&&n.nodeType==1&&s==t-1){if(s==t-1){try{o=p.createControlRange();o.addElement(n.childNodes[s]);o.select();return}catch(r){}}}m(true);m();q.select()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(l){e=b();h=null}return e};this.destroy=function(){h=e=null}}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(p,q,m,k){var g,h=this,j=h.events,l;if(q instanceof Array){l=[];f(q,function(o){l.push(h.add(p,o,m,k))});return l}if(p&&p.hasOwnProperty&&p instanceof Array){l=[];f(p,function(n){n=c.get(n);l.push(h.add(n,q,m,k))});return l}p=c.get(p);if(!p){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!k){return m(n)}return m.call(k,n)};if(q=="unload"){d.unloads.unshift({func:g});return g}if(q=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}j.push({obj:p,name:q,func:m,cfunc:g,scope:k});h._add(p,q,g);return m},remove:function(m,p,l){var h=this,g=h.events,j=false,k;if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.remove(n,p,l))});return k}m=c.get(m);f(g,function(o,n){if(o.obj==m&&o.name==p&&(!l||(o.func==l||o.cfunc==l))){g.splice(n,1);h._remove(m,p,o.cfunc);j=true;return false}});return j},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,j,g){if(h.attachEvent){h.attachEvent("on"+j,g)}else{if(h.addEventListener){h.addEventListener(j,g,false)}else{h["on"+j]=g}}},_remove:function(j,k,h){if(j){try{if(j.detachEvent){j.detachEvent("on"+k,h)}else{if(j.removeEventListener){j.removeEventListener(k,h,false)}else{j["on"+k]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(j){j()});g.inits=[]},_wait:function(j){var g=this,h=j.document;if(j.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(j)}});if(h.documentElement.doScroll&&j==j.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(k){setTimeout(arguments.callee,0);return}g._pageInit(j)})()}}else{if(h.addEventListener){g._add(j,"DOMContentLoaded",function(){g._pageInit(j)})}}g._add(j,"load",function(){g._pageInit(j)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(j,h,g){return a.dom.Event.add(b.id,j,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,j){var h=b.getXY();b.moveTo(h.x+g,h.y+j)},resizeTo:function(g,j){b.setStyles({width:g,height:j})},resizeBy:function(g,k){var j=b.getSize();b.resizeTo(j.w+g,j.h+k)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(j,h,g){var f=this;f.dom=j;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(k){f[k]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&j.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),m=f.dom.create("body"),k=f.getSel(),j,l,o;g=g||{};j=l="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(k.toString?k.toString():""))}if(h.cloneContents){o=h.cloneContents();if(o){m.appendChild(o)}}else{if(b(h.item)||b(h.htmlText)){m.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{m.innerHTML=h.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}g.getInner=true;g.content=f.isCollapsed()?"":j+f.serializer.serialize(m,g)+l;f.onGetContent.dispatch(f,g);return g.content},setContent:function(k,j){var g=this,l=g.getRng(),o,m=g.win.document;j=j||{format:"html"};j.set=true;k=j.content=k;g.onBeforeSetContent.dispatch(g,j);k=j.content;if(l.insertNode){k+='<span id="__caret">_</span>';if(l.startContainer==m&&l.endContainer==m){m.body.innerHTML=k}else{l.deleteContents();if(m.body.childNodes.length==0){m.body.innerHTML=k}else{if(l.createContextualFragment){l.insertNode(l.createContextualFragment(k))}else{var n=m.createDocumentFragment(),f=m.createElement("div");n.appendChild(f);f.outerHTML=k;l.insertNode(n)}}}o=g.dom.get("__caret");l=m.createRange();l.setStartBefore(o);l.setEndBefore(o);g.setRng(l);g.dom.remove("__caret");g.setRng(l)}else{if(l.item){m.execCommand("Delete",false,null);l=g.getRng()}l.pasteHTML(k)}g.onSetContent.dispatch(g,j)},getStart:function(){var g=this.getRng(),h,f,k,j;if(g.duplicate||g.item){if(g.item){return g.item(0)}k=g.duplicate();k.collapse(1);h=k.parentElement();f=j=g.parentElement();while(j=j.parentNode){if(j==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),j,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);j=h.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=h.endContainer;f=h.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[f>0?f-1:f]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(r,s){var v=this,n=v.dom,g,k,j,o,h,p,q,m="\uFEFF",u;function f(x,y){var t=0;d(n.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function l(){var x=v.getRng(true),t=n.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}return l()}if(r){return{rng:v.getRng()}}g=v.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){k=g.duplicate();g.collapse();g.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+u+'">'+m+"</span>");if(!o){k.collapse(false);k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end" style="'+u+'">'+m+"</span>")}}else{p=g.item(0);h=p.nodeName;return{name:h,index:f(h,p)}}}else{p=v.getNode();h=p.nodeName;if(h=="IMG"){return{name:h,index:f(h,p)}}k=g.cloneRange();if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:u},m))}g.collapse(true);g.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:u},m))}v.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,h,f,r,k,u,p,q;if(s.tridentSel){s.tridentSel.destroy()}if(o){if(o.start){f=m.createRng();r=m.getRoot();function g(A){var t=o[A?"start":"end"],x,y,z,v;if(t){for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(v.length){y=v[t[x]]}}if(A){f.setStart(y,t[0])}else{f.setEnd(y,t[0])}}}g(true);g();s.setRng(f)}else{if(o.id){function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;d(c.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!c.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'<br data-mce-bogus="1" />':" "}return t}l("start");l("end");if(k){f=m.createRng();f.setStart(n(k),p);f.setEnd(n(u),q);s.setRng(f)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,g=m.createRng(),f;f=m.nodeIndex(l);g.setStart(l.parentNode,f);g.setEnd(l.parentNode,f+1);if(k){function h(n,p){var o=new c.dom.TreeWalker(n,n);do{if(n.nodeType==3&&c.trim(n.nodeValue).length!=0){if(p){g.setStart(n,0)}else{g.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){g.setStartBefore(n)}else{g.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}h(l,1);h(l)}j.setRng(g);return l},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),j;if(h.item){j=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(m){var g=this,h,j,l,k=g.win.document;if(m&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){j=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():k.createRange())}}catch(f){}if(c.isIE&&j.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);j=k.createRange();j.setStartBefore(l);j.setEndAfter(l)}if(!j){j=k.createRange?k.createRange():k.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(j.compareBoundaryPoints(j.START_TO_START,g.selectedRange)===0&&j.compareBoundaryPoints(j.END_TO_END,g.selectedRange)===0){j=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return j},setRng:function(j){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=j;h.removeAllRanges();h.addRange(j);g.selectedRange=h.getRangeAt(0)}}else{if(j.cloneRange){g.tridentSel.addRange(j);return}try{j.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),j=h.getSel(),m,l=g.startContainer,f=g.endContainer;if(g.setStart){if(!g){return h.dom.getRoot()}m=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.startOffset-g.endOffset<2){if(g.startContainer.hasChildNodes()){m=g.startContainer.childNodes[g.startOffset]}}}if(c.isWebKit&&j.anchorNode&&j.anchorNode.nodeType==1){return j.anchorNode.childNodes[j.anchorOffset]}if(l.nodeType===3&&f.nodeType===3){function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(l.length===g.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(g.endOffset===0){f=k(f.previousSibling,false)}else{f=f.parentNode}if(l&&l===f){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(g,f){var j=this,k=j.dom,o,h,m,l=[];o=k.getParent(g||j.getStart(),k.isBlock);h=k.getParent(f||j.getEnd(),k.isBlock);if(o){l.push(o)}if(o&&h&&o!=h){m=o;while((m=m.nextSibling)&&m!=h){if(k.isBlock(m)){l.push(m)}}}if(h&&o!=h){l.push(h)}return l},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var n=this.dom,m=n.doc,g=m.body,j,k;m.documentElement.unselectable=true;function l(o,r){var p=g.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function h(p){var o;if(p.button){o=l(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",k)>0){o.setEndPoint("StartToStart",k)}else{o.setEndPoint("EndToEnd",k)}o.select()}}else{f()}}function f(){n.unbind(m,"mouseup",f);n.unbind(m,"mousemove",h);j=0}n.bind(m,"mousedown",function(o){if(o.target.nodeName==="HTML"){if(j){f()}j=1;k=l(o.x,o.y);if(k){n.bind(m,"mouseup",f);n.bind(m,"mousemove",h);n.win.focus();k.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,j,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}j=j||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(l,k){var p=l.length,m,r,o="data-mce-"+k,q=e.url_converter,s=e.url_converter_scope,n;while(p--){m=l[p];r=m.attributes.map[o];if(r!==n){m.attr(k,r.length>0?r:null);m.attr(o,null)}else{r=m.attributes.map[k];if(k==="style"){r=j.serializeStyle(j.parseStyle(r),m.name)}else{if(q){r=q.call(s,r,k,m.name)}}m.attr(k,r.length>0?r:null)}}});c.addAttributeFilter("class",function(k,l){var m=k.length,n,o;while(m--){n=k[m];o=n.attr("class").replace(/\s*mceItem\w+\s*/g,"");n.attr("class",o.length>0?o:null)}});c.addAttributeFilter("data-mce-type",function(k,m,l){var n=k.length,o;while(n--){o=k[n];if(o.attributes.map["data-mce-type"]==="bookmark"&&!l.cleanup){o.remove()}}});c.addNodeFilter("script,style",function(l,m){var n=l.length,o,p;function k(q){return q.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"").replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"")}while(n--){o=l[n];p=o.firstChild?o.firstChild.value:"";if(m==="script"){o.attr("type",(o.attr("type")||"text/javascript").replace(/^mce\-/,""));if(p.length>0){o.firstChild.value="// <![CDATA[\n"+k(p)+"\n// ]]>"}}else{if(p.length>0){o.firstChild.value="<!--\n"+k(p)+"\n-->"}}}});c.addNodeFilter("br",function(k,l){var n=k.length,q,p=f.getBlockElements(),m=f.getEmptyElements(),o;while(n--){q=k[n];o=q.parent;if(p[q.parent.name]&&q===o.lastChild){q.remove();if(o.isEmpty(m)){o.empty().append(new a.html.Node("#text",3)).value="\u00a0"}}}});c.addNodeFilter("#comment",function(k,l){var m=k.length,n;while(m--){n=k[m];if(n.value.indexOf("[CDATA[")===0){n.name="#cdata";n.type=4;n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(n.value.indexOf("mce:protected ")===0){n.name="#text";n.type=3;n.raw=true;n.value=unescape(n.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(k,l){var m=k.length,n;while(m--){n=k[m];if(n.type===7){n.remove()}else{if(n.type===1){if(l==="input"&&!("type" in n.attributes.map)){n.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(l,m){var n=l.length,o,k;while(n--){o=l[n];k=o.parent;if(k.name==="ul"||k.name==="ol"){if(o.prev&&o.prev.name==="li"){o.prev.append(o)}}}})}return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(p,n){var m,q,l,k,o;if(d&&j.select("script,style,select").length>0){o=p.innerHTML;p=p.cloneNode(false);j.setHTML(p,o)}else{p=p.cloneNode(true)}m=p.ownerDocument.implementation;if(m.createHTMLDocument){q=m.createHTMLDocument("");g(p.nodeName=="BODY"?p.childNodes:[p],function(r){q.body.appendChild(q.importNode(r,true))});if(p.nodeName!="BODY"){p=q.body.firstChild}else{p=q.body}l=j.doc;j.doc=q}n=n||{};n.format=n.format||"html";if(!n.no_events){n.node=p;h.dispatch(self,n)}k=new a.html.Serializer(e,f);n.content=k.serialize(c.parse(n.getInner?p.innerHTML:a.trim(j.getOuterHTML(p),n),n));if(!n.no_events){b.dispatch(self,n)}if(l){j.doc=l}n.node=null;return n.content},addRules:function(k){f.addValidElements(k)},setRules:function(k){f.setValidElements(k)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,l=1,j=2,m={},k=[],f={},d=[],g=0,e;function b(n,v){var x=this,r=a.DOM,u,p,s,o;function q(){r.remove(o);if(u){u.onreadystatechange=u.onload=u=null}v()}o=r.uniqueId();if(a.isIE6){p=new a.util.URI(n);s=location;if(p.host==s.hostname&&p.port==s.port&&(p.protocol+":")==s.protocol){a.util.XHR.send({url:a._addVer(p.getURI()),success:function(y){var t=r.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);r.remove(t);q()}});return}}u=r.create("script",{id:o,type:"text/javascript",src:a._addVer(n)});if(!a.isIE){u.onload=q}if(!a.isOpera){u.onreadystatechange=function(){var t=u.readyState;if(t=="complete"||t=="loaded"){q()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(u)}this.isDone=function(n){return m[n]==j};this.markDone=function(n){m[n]=j};this.add=this.load=function(n,r,o){var p,q=m[n];if(q==e){k.push(n);m[n]=c}if(r){if(!f[n]){f[n]=[]}f[n].push({func:r,scope:o||this})}};this.loadQueue=function(o,n){this.loadScripts(k,o,n)};this.loadScripts=function(n,r,q){var p;function o(s){a.each(f[s],function(t){t.func.call(t.scope)});f[s]=e}d.push({func:r,scope:q||this});p=function(){var s=a.grep(n);n.length=0;a.each(s,function(t){if(m[t]==j){o(t);return}if(m[t]!=l){m[t]=l;g++;b(t,function(){m[t]=j;g--;o(t);p()})}});if(!g){a.each(d,function(t){t.func.call(t.scope)});d.length=0}};p()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(j,f,e,k){var h,g;if(j){if(!k&&j[f]){return j[f]}if(j!=c){h=j[e];if(h){return h}for(g=j.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var h=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,f,o,g,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(g=x,r=g.parentNode;g&&g!=v;g=r){r=g.parentNode;q=p(g==x?g:g[u],u);if(q.length){if(!y){q.reverse()}s(q)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}j=c.findCommonAncestor(h,t);if(h==t){return s([h])}for(g=h;g;g=g.parentNode){if(g==t){return k(h,j,true)}if(g==j){break}}for(g=t;g;g=g.parentNode){if(g==h){return k(t,j)}if(g==j){break}}f=n(h,j)||h;o=n(t,j)||t;k(h,f,true);q=p(f==h?f:f.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(q)}k(t,o)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(k){var h=this,j=h.settings,g;k.container=k.container||j.container;k.parent=h;k.constrain=k.constrain||j.constrain;k["class"]=k["class"]||j["class"];k.vp_offset_x=k.vp_offset_x||j.vp_offset_x;k.vp_offset_y=k.vp_offset_y||j.vp_offset_y;g=new e.ui.DropMenu(k.id||c.uniqueId(),k);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var j=this,k=j.settings,g=c.get("menu_"+j.id+"_tbl"),m=c.get("menu_"+j.id+"_co"),h,l;h=k.max_width?Math.min(g.clientWidth,k.max_width):g.clientWidth;l=k.max_height?Math.min(g.clientHeight,k.max_height):g.clientHeight;if(!c.boxModel){j.element.setStyles({width:h+2,height:l+2})}else{j.element.setStyles({width:h,height:l})}if(k.max_width){c.setStyle(m,"width",h)}if(k.max_height){c.setStyle(m,"height",l);if(g.clientHeight<k.max_height){c.setStyle(m,"overflow","hidden")}}},showMenu:function(q,o,u){var A=this,B=A.settings,p,g=c.getViewPort(),v,m,z,r,j=2,l,k,n=A.classPrefix;A.collapse(1);if(A.isMenuVisible){return}if(!A.rendered){p=c.add(A.settings.container,A.renderNode());f(A.items,function(h){h.postRender()});A.element=new b("menu_"+A.id,{blocker:1,container:B.container})}else{p=c.get("menu_"+A.id)}if(!e.isOpera){c.setStyles(p,{left:-65535,top:-65535})}c.show(p);A.update();q+=B.offset_x||0;o+=B.offset_y||0;g.w-=4;g.h-=4;if(B.constrain){v=p.clientWidth-j;m=p.clientHeight-j;z=g.x+g.w;r=g.y+g.h;if((q+B.vp_offset_x+v)>z){q=u?u-v:Math.max(0,(z-B.vp_offset_x)-v)}if((o+B.vp_offset_y+m)>r){o=Math.max(0,(r-B.vp_offset_y)-m)}}c.setStyles(p,{left:q,top:o});A.element.update();A.isMenuVisible=1;A.mouseClickFunc=a.add(p,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,n+"ItemSub")){h=A.items[s.id];if(h.isDisabled()){return}l=A;while(l){if(l.hideMenu){l.hideMenu()}l=l.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(A.hasMenus()){A.mouseOverFunc=a.add(p,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=A.items[x.id];if(A.lastMenu){A.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,n+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-j),t.y-j,t.x);A.lastMenu=h;c.addClass(c.get(h.id).firstChild,n+"ItemActive")}}})}A.onShowMenu.dispatch(A);if(B.keyboard_focus){a.add(p,"keydown",A._keyHandler,A);c.select("a","menu_"+A.id)[0].focus();A._focusIdx=0}},hideMenu:function(k){var g=this,j=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(j,"mouseover",g.mouseOverFunc);a.remove(j,"click",g.mouseClickFunc);a.remove(j,"keydown",g._keyHandler);c.hide(j);g.isMenuVisible=0;if(!k){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(j){var g=this,h;j=g.parent(j);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],j)}return j},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var j=this,k=j.settings,m,h,l,g;g=c.create("div",{id:"menu_"+j.id,"class":k["class"],style:"position:absolute;left:0;top:0;z-index:200000"});l=c.add(g,"div",{id:"menu_"+j.id+"_co","class":j.classPrefix+(k["class"]?" "+k["class"]:"")});j.element=new b("menu_"+j.id,{blocker:1,container:k.container});if(k.menu_line){c.add(l,"span",{"class":j.classPrefix+"Line"})}m=c.add(l,"table",{id:"menu_"+j.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(m,"tbody");f(j.items,function(n){j._add(h,n)});j.rendered=true;return g},_keyHandler:function(k){var j=this,h=k.keyCode;function g(n){var l=j._focusIdx+n,m=c.select("a","menu_"+j.id)[l];if(m){j._focusIdx=l;m.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(k,h){var j,r=h.settings,q,m,l,p=this.classPrefix,g;if(r.separator){m=c.add(k,"tr",{id:h.id,"class":p+"ItemSeparator"});c.add(m,"td",{"class":p+"ItemSeparator"});if(j=m.previousSibling){c.addClass(j,"mceLast")}return}j=m=c.add(k,"tr",{id:h.id,"class":p+"Item "+p+"ItemEnabled"});j=l=c.add(j,"td");j=q=c.add(j,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(l,r["class"]);g=c.add(j,"span",{"class":"mceIcon"+(r.icon?" mce_"+r.icon:"")});if(r.icon_src){c.add(g,"img",{src:r.icon_src})}j=c.add(j,r.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(j,"style",h.settings.style)}if(k.childNodes.length==1){c.addClass(m,"mceFirst")}if((j=m.previousSibling)&&c.hasClass(j,p+"ItemSeparator")){c.addClass(m,"mceFirst")}if(h.collapse){c.addClass(m,p+"ItemSub")}if(j=m.previousSibling){c.removeClass(j,"mceLast")}c.addClass(m,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,k,j;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){j=h}else{j=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(l,f){if(j(l.value)){k=1;g.selectByIndex(f);return false}});if(!k){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,j;if(f!=g.selectedIndex){h=c.get(g.id+"_text");j=g.items[f];if(j){g.selectedValue=j.value;g.selectedIndex=f;c.setHTML(h,c.encode(j.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(j,f,h){var g=this;h=h||{};h=d.extend(h,{title:j,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var j="",f=this,g=f.settings,k=f.classPrefix;j='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';j+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";j+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";j+="</tr></tbody></table>";return j},showMenu:function(){var g=this,k,j,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}k=c.getPos(this.settings.menu_container);j=c.getPos(h);f=g.menu;f.settings.offset_x=j.x;f.settings.offset_y=j.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(l){if(l.value===g.selectedValue){f.items[l.id].setSelected(1);g.oldID=l.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var h=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){h=n}});if(k==38){j=f.items[h-1]}else{if(k==40){j=f.items[h+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,k,j;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){j=h}else{j=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(l,f){if(j(l.value)){k=1;g.selectByIndex(f);return false}});if(!k){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(k,g,f){var j,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,k)}j={title:k,value:g,attribs:f};h.items.push(j);h.onAdd.dispatch(h,j)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);j=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,k,j,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}k=b.getPos(g.settings.menu_container);j=b.getPos(h);f=g.menu;f.settings.offset_x=j.x;f.settings.offset_y=j.y;f.settings.vp_offset_x=j.x;f.settings.vp_offset_y=j.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var j,f=this,g=f.settings,e;j="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}j+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});j+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";j+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},j)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,k,j,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}j=c.get(f.id);c.show(f.id+"_menu");c.addClass(j,"mceSplitButtonSelected");h=c.getPos(j);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+j.clientHeight,zIndex:200000});j=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(l){if(l.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(m){m=m.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+m},"data-mce-color":"#"+m})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(m){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(m)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(m){var n;m=m.target;if(m.nodeName=="A"&&(n=m.getAttribute("data-mce-color"))){k.setColor(n)}return a.cancel(m)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(k){var g=k.each,d=k.extend,l=k.DOM,j=k.dom.Event,f=k.ThemeManager,b=k.PluginManager,e=k.explode,h=k.util.Dispatcher,a,c=0;k.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(k.documentBaseURL)){k.documentBaseURL+="/"}k.baseURL=new k.util.URI(k.documentBaseURL).toAbsolute(k.baseURL);k.baseURI=new k.util.URI(k.baseURL);k.onBeforeUnload=new h(k);j.add(window,"beforeunload",function(m){k.onBeforeUnload.dispatch(k,m)});k.onAddEditor=new h(k);k.onRemoveEditor=new h(k);k.EditorManager=d(k,{editors:[],i18n:{},activeEditor:null,init:function(r){var o=this,q,m=k.ScriptLoader,v,p=[],n;function u(y,z,t){var x=y[z];if(!x){return}if(k.is(x,"string")){t=x.replace(/\.\w+$/,"");t=t?k.resolve(t):0;x=k.resolve(x)}return x.apply(t||this,Array.prototype.slice.call(arguments,2))}r=d({theme:"simple",language:"en"},r);o.settings=r;j.add(document,"init",function(){var s,x;u(r,"onpageload");switch(r.mode){case"exact":s=r.elements||"";if(s.length>0){g(e(s),function(y){if(l.get(y)){n=new k.Editor(y,r);p.push(n);n.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;l.setAttrib(A,"id",y);n=new k.Editor(y,r);p.push(n);n.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(z,y){return y.constructor===RegExp?y.test(z.className):l.hasClass(z,y)}g(l.select("textarea"),function(y){if(r.editor_deselector&&t(y,r.editor_deselector)){return}if(!r.editor_selector||t(y,r.editor_selector)){v=l.get(y.name);if(!y.id&&!v){y.id=y.name}if(!y.id||o.get(y.id)){y.id=l.uniqueId()}n=new k.Editor(y.id,r);p.push(n);n.render(1)}});break}if(r.oninit){s=x=0;g(p,function(y){x++;if(!y.initialized){y.onInit.add(function(){s++;if(s==x){u(r,"oninit")}})}else{s++}if(s==x){u(r,"oninit")}})}})},get:function(m){if(m===a){return this.editors}return this.editors[m]},getInstanceById:function(m){return this.get(m)},add:function(n){var m=this,o=m.editors;o[n.id]=n;o.push(n);m._setActive(n);m.onAddEditor.dispatch(m,n);if(k.adapter){k.adapter.patchEditor(n)}return n},remove:function(o){var n=this,m,p=n.editors;if(!p[o.id]){return null}delete p[o.id];for(m=0;m<p.length;m++){if(p[m]==o){p.splice(m,1);break}}if(n.activeEditor==o){n._setActive(p[0])}o.destroy();n.onRemoveEditor.dispatch(n,o);return o},execCommand:function(s,q,p){var r=this,o=r.get(p),m;switch(s){case"mceFocus":o.focus();return true;case"mceAddEditor":case"mceAddControl":if(!r.get(p)){new k.Editor(p,r.settings).render()}return true;case"mceAddFrameControl":m=p.window;m.tinyMCE=tinyMCE;m.tinymce=k;k.DOM.doc=m.document;k.DOM.win=m;o=new k.Editor(p.element_id,p);o.render();if(k.isIE){function n(){o.destroy();m.detachEvent("onunload",n);m=m.tinyMCE=m.tinymce=null}m.attachEvent("onunload",n)}p.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(o){o.remove()}return true;case"mceToggleEditor":if(!o){r.execCommand("mceAddControl",0,p);return true}if(o.isHidden()){o.show()}else{o.hide()}return true}if(r.activeEditor){return r.activeEditor.execCommand(s,q,p)}return false},execInstanceCommand:function(q,p,o,n){var m=this.get(q);if(m){return m.execCommand(p,o,n)}return false},triggerSave:function(){g(this.editors,function(m){m.save()})},addI18n:function(q,r){var m,n=this.i18n;if(!k.is(q,"string")){g(q,function(s,p){g(s,function(u,t){g(u,function(x,v){if(t==="common"){n[p+"."+v]=x}else{n[p+"."+t+"."+v]=x}})})})}else{g(r,function(s,p){n[q+"."+p]=s})}},_setActive:function(m){this.selectedInstance=this.activeEditor=m}})})(tinymce);(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher,j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit,d=n.is,h=n.ThemeManager,c=n.PluginManager,p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:n.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area",validate:true,entity_encoding:"named",url_converter:q.convertURL,url_converter_scope:q},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=n.baseURI;q.contentCSS=[];q.execCallback("setup",q)},render:function(u){var v=this,x=v.settings,y=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}tinyMCE.settings=x;if(!v.getElement()){return}if(n.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&x.hidden_input&&o.getParent(y,"form")){o.insertAfter(o.create("input",{type:"hidden",name:y}),y)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(x.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(x.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(x.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(x.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){n.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(x.language&&x.language_load!==false){q.add(n.baseURL+"/langs/"+x.language+".js")}if(x.theme&&x.theme.charAt(0)!="-"&&!h.urls[x.theme]){h.load(x.theme,"themes/"+x.theme+"/editor_template"+n.suffix+".js")}j(g(x.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,G=this,H=G.settings,D,A,C=G.getElement(),r,q,E,y,B,F,z;n.add(G);if(H.theme){H.theme=H.theme.replace(/-/,"");r=h.get(H.theme);G.theme=new r();if(G.theme.init&&H.init_theme){G.theme.init(G,h.urls[H.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(H.plugins.replace(/\-/g,"")),function(I){var J=c.get(I),t=c.urls[I]||n.documentBaseURL.replace(/\/$/,""),s;if(J){s=new J(G,t);G.plugins[I]=s;if(s.init){s.init(G,t)}}});if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new n.ControlManager(G);if(H.custom_undo_redo){G.onExecCommand.add(function(t,I,u,J,s){if(I!="Undo"&&I!="Redo"&&I!="mceRepaint"&&(!s||!s.skip_undo)){G.undoManager.add()}})}G.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){G.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){G.execCommand("mceRepaint")}}G.onUndo.add(x);G.onRedo.add(x);G.onSetContent.add(x)}G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui){D=H.width||C.style.width||C.offsetWidth;A=H.height||C.style.height||C.offsetHeight;G.orgDisplay=C.style.display;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D)+(r.deltaWidth||0),100)}if(F.test(""+A)){A=Math.max(parseInt(A)+(r.deltaHeight||0),100)}r=G.theme.renderUI({targetNode:C,width:D,height:A,deltaWidth:H.delta_width,deltaHeight:H.delta_height});G.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:D,height:A});if(H.content_css){n.each(g(H.content_css),function(s){G.contentCSS.push(G.documentBaseURI.toAbsolute(s))})}A=(r.iframeHeight||A)+(typeof(A)=="number"?(r.deltaHeight||0):"");if(A<100){A=100}G.iframeHTML=H.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(H.document_base_url!=n.documentBaseURL){G.iframeHTML+='<base href="'+G.documentBaseURI.getURI()+'" />'}G.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(!a||!/Firefox\/2/.test(navigator.userAgent)){for(z=0;z<G.contentCSS.length;z++){G.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+G.contentCSS[z]+'" />'}G.contentCSS=[]}y=H.body_id||"tinymce";if(y.indexOf("=")!=-1){y=G.getParam("body_id","","hash");y=y[G.id]||y}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+B+'"></body></html>';if(n.relaxedDomain&&(b||(n.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}v=o.add(r.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",style:{width:"100%",height:A}});G.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=G.orgDisplay;o.get(G.id).style.display="none";if(!n.relaxedDomain||!E){G.setupIframe()}C=v=r=null},setupIframe:function(){var u=this,y=u.settings,z=o.get(u.id),A=u.getDoc(),x,q;if(!b||!n.relaxedDomain){A.open();A.write(u.iframeHTML);A.close();if(n.relaxedDomain){A.domain=n.relaxedDomain}}if(!b){try{if(!y.readonly){A.designMode="On"}}catch(r){}}if(b){q=u.getBody();o.hide(q);if(!y.readonly){q.contentEditable=true}o.show(q)}u.schema=new n.html.Schema(y);u.dom=new n.dom.DOMUtils(u.getDoc(),{keep_values:true,url_converter:u.convertURL,url_converter_scope:u,hex_colors:y.force_hex_style_colors,class_filter:y.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:u.schema});u.parser=new n.html.DomParser(y,u.schema);u.parser.addAttributeFilter("src,href,style",function(s,t){var B=s.length,C,E=u.dom,D;while(B--){C=s[B];D=C.attr(t);if(t==="style"){C.attr("data-mce-style",E.serializeStyle(E.parseStyle(D),C.name))}else{C.attr("data-mce-"+t,u.convertURL(D,t,C.name))}}});u.parser.addNodeFilter("script",function(s,t){var B=s.length;while(B--){s[B].attr("type","mce-text/javascript")}});u.parser.addNodeFilter("#cdata",function(s,t){var B=s.length,C;while(B--){C=s[B];C.type=8;C.name="#comment";C.value="[CDATA["+C.value+"]]"}});u.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(s,t){var C=s.length,D,B=u.schema.getEmptyElements();while(C--){D=s[C];if(D.isEmpty(B)){D.empty().append(new n.html.Node("br",1)).empty=true}}});u.serializer=new n.dom.Serializer(y,u.dom,u.schema);u.selection=new n.dom.Selection(u.dom,u.getWin(),u.serializer);u.formatter=new n.Formatter(this);u.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});j("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){u.formatter.register(s,{block:s,remove:"all"})});u.formatter.register(u.settings.formats);u.undoManager=new n.UndoManager(u);u.undoManager.onAdd.add(function(t,s){if(!s.initial){return u.onChange.dispatch(u,s,t)}});u.undoManager.onUndo.add(function(t,s){return u.onUndo.dispatch(u,s,t)});u.undoManager.onRedo.add(function(t,s){return u.onRedo.dispatch(u,s,t)});u.forceBlocks=new n.ForceBlocks(u,{forced_root_block:y.forced_root_block});u.editorCommands=new n.EditorCommands(u);u.serializer.onPreProcess.add(function(s,t){return u.onPreProcess.dispatch(u,t,s)});u.serializer.onPostProcess.add(function(s,t){return u.onPostProcess.dispatch(u,t,s)});u.onPreInit.dispatch(u);if(!y.gecko_spellcheck){u.getBody().spellcheck=0}if(!y.readonly){u._addEvents()}u.controlManager.onPostRender.dispatch(u,u.controlManager);u.onPostRender.dispatch(u);if(y.directionality){u.getBody().dir=y.directionality}if(y.nowrap){u.getBody().style.whiteSpace="nowrap"}if(y.handle_node_change_callback){u.onNodeChange.add(function(t,s,B){u.execCallback("handle_node_change_callback",u.id,B,-1,-1,true,u.selection.isCollapsed())})}if(y.save_callback){u.onSaveContent.add(function(s,B){var t=u.execCallback("save_callback",u.id,B.content,u.getBody());if(t){B.content=t}})}if(y.onchange_callback){u.onChange.add(function(t,s){u.execCallback("onchange_callback",u,s)})}if(y.protect){u.onBeforeSetContent.add(function(s,t){if(y.protect){j(y.protect,function(B){t.content=t.content.replace(B,function(C){return"<!--mce:protected "+escape(C)+"-->"})})}})}if(y.convert_newlines_to_brs){u.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(y.preformatted){u.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(y.verify_css_classes){u.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!u.classesRE){t=u.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});u.classesRE=new RegExp("("+C+")","gi")}}return !u.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||u.classesRE.test(B)?B:""}return B}}if(y.cleanup_callback){u.onBeforeSetContent.add(function(s,t){t.content=u.execCallback("cleanup_callback","insert_to_editor",t.content,t)});u.onPreProcess.add(function(s,t){if(t.set){u.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){u.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});u.onPostProcess.add(function(s,t){if(t.set){t.content=u.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=u.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(y.save_callback){u.onGetContent.add(function(s,t){if(t.save){t.content=u.execCallback("save_callback",u.id,t.content,u.getBody())}})}if(y.handle_event_callback){u.onEvent.add(function(s,t,B){if(u.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}u.onSetContent.add(function(){u.addVisual(u.getBody())});if(y.padd_empty_editor){u.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function v(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{"data-mce-bogus":1})}})}u.onExecCommand.add(function(s,t){if(t==="CreateLink"){v(s)}});u.onSetContent.add(u.selection.onSetContent.add(v));if(!y.readonly){try{A.designMode="Off";A.designMode="On"}catch(r){}}}setTimeout(function(){if(u.removed){return}u.load({initial:true,format:"html"});u.startContent=u.getContent({format:"raw"});u.undoManager.add();u.initialized=true;u.onInit.dispatch(u);u.execCallback("setupcontent_callback",u.id,u.getBody(),u.getDoc());u.execCallback("init_instance_callback",u);u.focus(true);u.nodeChanged({initial:1});j(u.contentCSS,function(s){u.dom.loadCSS(s)});if(y.auto_focus){setTimeout(function(){var s=n.get(y.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);z=null},focus:function(u){var y,r=this,x=r.settings.content_editable,s,q,v=r.getDoc();if(!u){s=r.selection.getRng();if(s.item){q=s.item(0)}if(!x){r.getWin().focus()}if(q&&q.ownerDocument==v){s=v.body.createControlRange();s.addElement(q);s.select()}}if(n.activeEditor!=r){if((y=n.activeEditor)!=null){y.onDeactivate.dispatch(y,r)}r.onActivate.dispatch(r,y)}n._setActive(r)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=n.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return n.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(x,s,q){var t=n.trim,r=d(this.settings[x])?this.settings[x]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(y){y=y.split("=");if(y.length>1){u[t(y[0])]=t(y[1])}else{u[t(y[0])]=t(y)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=(b?r.getNode():r.getStart())||q.getBody();if(q.initialized){u=u||{};v=b&&v.ownerDocument!=q.getDoc()?q.getBody():v;u.parents=[];q.dom.getParent(v,function(s){if(s.nodeName=="BODY"){return true}u.parents.push(s)});q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(q,s,r){this.execCommands[q]={func:s,scope:r||this}},addQueryStateHandler:function(q,s,r){this.queryStateCommands[q]={func:s,scope:r||this}},addQueryValueHandler:function(q,s,r){this.queryValueCommands[q]={func:s,scope:r||this}},addShortcut:function(s,v,q,u){var r=this,x;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){x=q;q=function(){r.execCommand(x,false,null)}}if(d(q,"object")){x=q;q=function(){r.execCommand(x[0],x[1],x[2])}}j(g(s),function(t){var y={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(z){switch(z){case"alt":case"ctrl":case"shift":y[z]=true;break;default:y.charCode=z.charCodeAt(0);y.keyCode=z.toUpperCase().charCodeAt(0)}});r.shortcuts[(y.ctrl?"ctrl":"")+","+(y.alt?"alt":"")+","+(y.shift?"shift":"")+","+y.keyCode]=y});return true},execCommand:function(y,x,A,q){var u=this,v=0,z,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(y)&&(!q||!q.skip_focus)){u.focus()}z={};u.onBeforeExecCommand.dispatch(u,y,x,A,z);if(z.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(z=u.execCommands[y]){r=z.func.call(z.scope,x,A);if(r!==true){u.onExecCommand.dispatch(u,y,x,A,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(u.editorCommands.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}u.getDoc().execCommand(y,x,A);u.onExecCommand.dispatch(u,y,x,A,q)},queryCommandState:function(v){var r=this,x,u;if(r._isHidden()){return}if(x=r.queryStateCommands[v]){u=x.func.call(x.scope);if(u!==true){return u}}x=r.editorCommands.queryCommandState(v);if(x!==-1){return x}try{return this.getDoc().queryCommandState(v)}catch(q){}},queryCommandValue:function(x){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[x]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(x);if(d(v)){return v}try{return this.getDoc().queryCommandValue(x)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=false;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(u,t){var s=this,r,q=s.getBody();t=t||{};t.format=t.format||"html";t.set=true;t.content=u;if(!t.no_events){s.onBeforeSetContent.dispatch(s,t)}if(!n.isIE&&(u.length===0||/^\s+$/.test(u))){q.innerHTML='<br data-mce-bogus="1" />';return}if(t.format!=="raw"){t.content=new n.html.Serializer({},s.schema).serialize(s.parser.parse(t.content))}q.innerHTML=n.trim(t.content);if(!t.no_events){s.onSetContent.dispatch(s,t)}return t.content},getContent:function(r){var q=this,s;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){q.onBeforeGetContent.dispatch(q,r)}if(r.format=="raw"){s=q.getBody().innerHTML}else{s=q.serializer.serialize(q.getBody(),r)}r.content=n.trim(s);if(!r.no_events){q.onGetContent.dispatch(q,r)}return r.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,y,x){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,x,true,y)}if(!v.convert_urls||(x&&x.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];n.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var C=this,u,D=C.settings,r=C.dom,y={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function q(t,E){var s=t.type;if(C.removed){return}if(C.onEvent.dispatch(C,t,E)!==false){C[y[t.fakeType||t.type]].dispatch(C,t,E)}}j(y,function(t,s){switch(s){case"contextmenu":if(n.isOpera){r.bind(C.getBody(),"mousedown",function(E){if(E.ctrlKey){E.fakeType="contextmenu";q(E)}})}else{r.bind(C.getBody(),s,q)}break;case"paste":r.bind(C.getBody(),s,function(E){q(E)});break;case"submit":case"reset":r.bind(C.getElement().form||o.getParent(C.id,"form"),s,q);break;default:r.bind(D.content_editable?C.getBody():C.getDoc(),s,q)}});r.bind(D.content_editable?C.getBody():(a?C.getDoc():C.getWin()),"focus",function(s){C.focus(true)});if(n.isGecko){r.bind(C.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=C.documentBaseURI.toAbsolute(s)}})}if(a){function v(){var F=this,H=F.getDoc(),G=F.settings;if(a&&!G.readonly){if(F._isHidden()){try{if(!G.content_editable){H.designMode="On"}}catch(E){}}try{H.execCommand("styleWithCSS",0,false)}catch(E){if(!F._isHidden()){try{H.execCommand("useCSS",0,true)}catch(E){}}}if(!G.table_inline_editing){try{H.execCommand("enableInlineTableEditing",false,false)}catch(E){}}if(!G.object_resizing){try{H.execCommand("enableObjectResizing",false,false)}catch(E){}}}}C.onBeforeExecCommand.add(v);C.onMouseDown.add(v)}if(n.isWebKit){C.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&r.hasClass(t,"mceItemAnchor"))){C.selection.getSel().setBaseAndExtent(t,0,t,1);C.nodeChanged()}})}C.onMouseUp.add(C.nodeChanged);C.onKeyUp.add(function(s,t){var E=t.keyCode;if((E>=33&&E<=36)||(E>=37&&E<=40)||E==13||E==45||E==46||E==8||(n.isMac&&(E==91||E==93))||t.ctrlKey){C.nodeChanged()}});C.onReset.add(function(){C.setContent(C.startContent,{format:"raw"})});if(D.custom_shortcuts){if(D.custom_undo_redo_keyboard_shortcuts){C.addShortcut("ctrl+z",C.getLang("undo_desc"),"Undo");C.addShortcut("ctrl+y",C.getLang("redo_desc"),"Redo")}C.addShortcut("ctrl+b",C.getLang("bold_desc"),"Bold");C.addShortcut("ctrl+i",C.getLang("italic_desc"),"Italic");C.addShortcut("ctrl+u",C.getLang("underline_desc"),"Underline");for(u=1;u<=6;u++){C.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}C.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);C.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);C.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function x(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(C.shortcuts,function(E){if(n.isMac&&E.ctrl!=t.metaKey){return}else{if(!n.isMac&&E.ctrl!=t.ctrlKey){return}}if(E.alt!=t.altKey){return}if(E.shift!=t.shiftKey){return}if(t.keyCode==E.keyCode||(t.charCode&&t.charCode==E.charCode)){s=E;return false}});return s}C.onKeyUp.add(function(s,t){var E=x(t);if(E){return k.cancel(t)}});C.onKeyPress.add(function(s,t){var E=x(t);if(E){return k.cancel(t)}});C.onKeyDown.add(function(s,t){var E=x(t);if(E){E.func.call(E.scope);return k.cancel(t)}})}if(n.isIE){r.bind(C.getDoc(),"controlselect",function(E){var t=C.resizeInfo,s;E=E.target;if(E.nodeName!=="IMG"){return}if(t){r.unbind(t.node,t.ev,t.cb)}if(!r.hasClass(E,"mceItemNoResize")){ev="resizeend";s=r.bind(E,ev,function(G){var F;G=G.target;if(F=r.getStyle(G,"width")){r.setAttrib(G,"width",F.replace(/[^0-9%]+/g,""));r.setStyle(G,"width","")}if(F=r.getStyle(G,"height")){r.setAttrib(G,"height",F.replace(/[^0-9%]+/g,""));r.setStyle(G,"height","")}})}else{ev="resizestart";s=r.bind(E,"resizestart",k.cancel,k)}t=C.resizeInfo={node:E,ev:ev,cb:s}});C.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(C.selection.getRng().item){s.dom.remove(C.selection.getRng().item(0));return k.cancel(t)}}})}if(n.isOpera){C.onClick.add(function(s,t){k.prevent(t)})}if(D.custom_undo_redo){function z(){C.undoManager.typing=false;C.undoManager.add()}r.bind(C.getDoc(),"focusout",function(s){if(!C.removed&&C.undoManager.typing){z()}});C.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){z()}});C.onKeyDown.add(function(t,H){var s,G,F;if(b&&H.keyCode==46){s=C.selection.getRng();if(s.parentElement){G=s.parentElement();if(H.ctrlKey){s.moveEnd("word",1);s.select()}C.selection.getSel().clear();if(s.parentElement()==G){F=C.selection.getBookmark();try{G.innerHTML=G.innerHTML}catch(E){}C.selection.moveToBookmark(F)}H.preventDefault();return}}if((H.keyCode>=33&&H.keyCode<=36)||(H.keyCode>=37&&H.keyCode<=40)||H.keyCode==13||H.keyCode==45){if(C.undoManager.typing){z()}return}if(!C.undoManager.typing){C.undoManager.add();C.undoManager.typing=true}});C.onMouseDown.add(function(){if(C.undoManager.typing){z()}})}if(n.isGecko){function B(){C.undoManager.typing=false;C.undoManager.add();var s=C.dom.getAttribs(C.selection.getStart().cloneNode(false));return function(){var t=C.selection.getStart();C.dom.removeAllAttribs(t);j(s,function(E){t.setAttributeNode(E.cloneNode(true))});C.undoManager.typing=false;C.undoManager.add()}}function A(){var t=C.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}C.onKeyPress.add(function(s,E){if((E.keyCode==8||E.keyCode==46)&&A()){var t=B();C.getDoc().execCommand("delete",false,null);t();return k.cancel(E)}});C.dom.bind(C.getDoc(),"cut",function(t){if(A()){var s=B();C.onKeyUp.addToTop(k.cancel,k);setTimeout(function(){s();C.onKeyUp.remove(k.cancel,k)},0)}})}},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(o){var m=o.dom,q=o.selection,k={state:{},exec:{},value:{}},l=o.settings,p;function r(z,y,x){var v;z=z.toLowerCase();if(v=k.exec[z]){v(z,y,x);return a}return b}function n(x){var v;x=x.toLowerCase();if(v=k.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=k.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){k[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:n,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return o.getDoc().execCommand(y,x,v)}function t(v){return o.formatter.match(v)}function s(v,x){o.formatter.toggle(v,x?{value:x}:e)}function j(v){p=q.getBookmark(v)}function g(){q.moveToBookmark(p)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){o.undoManager.add()},"Cut,Copy,Paste":function(z){var y=o.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){o.windowManager.confirm(o.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{o.windowManager.alert(o.getLang("clipboard_no_support"))}}},unlink:function(v){if(q.isCollapsed()){q.select(q.getNode())}f(v);q.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){o.formatter.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(q.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){j();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(l.font_size_style_values);v=c.explode(l.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){o.formatter.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=q.getBookmark();o.setContent(o.getContent({cleanup:a}),{cleanup:a});q.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||q.getNode();if(v!=o.getBody()){j();o.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(q.getNode(),function(A){if(A.nodeType==1&&v++==x){q.select(A);return b}},o.getBody())},mceSelectNode:function(y,x,v){q.select(v)},mceInsertContent:function(A,z,y){var x,v;q.setContent(y.replace(/\{\$caret\}/g,'<br id="_mce_caret" />'));x=m.select("#_mce_caret")[0];if(x){v=m.createRng();v.setStartBefore(x);v.setEndBefore(x);q.setRng(v);m.remove(x)}},mceInsertRawHTML:function(y,x,v){q.setContent("tiny_mce_marker");o.setContent(o.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceSetContent:function(y,x,v){o.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=l.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!n("InsertUnorderedList")&&!n("InsertOrderedList")){d(q.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(c.isGecko){try{j(a);if(q.getSel()){q.getSel().selectAllChildren(o.getBody())}q.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){o.formatter.toggle(v)},InsertHorizontalRule:function(){q.setContent("<hr />")},mceToggleVisualAid:function(){o.hasVisual=!o.hasVisual;o.addVisual()},mceReplaceContent:function(y,x,v){q.setContent(v.replace(/\{\$selection\}/g,q.getContent({format:"text"})))},mceInsertLink:function(B,A,z){var y=m.getParent(q.getNode(),"a"),x,v;if(c.is(z,"string")){z={href:z}}z.href=z.href.replace(" ","%20");if(!y){if(c.isWebKit){x=m.getParent(q.getNode(),"img");if(x){v=x.style.cssFloat;x.style.cssFloat=null}}f("CreateLink",b,"javascript:mctmp(0);");if(v){x.style.cssFloat=v}d(m.select("a[href=javascript:mctmp(0);]"),function(C){m.setAttribs(C,z)})}else{if(z.href){m.setAttribs(y,z)}else{o.dom.remove(y,a)}}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);o.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){return t("align"+v.substring(7))},"Bold,Italic,Underline,Strikethrough":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(l.inline_styles){if((v=m.getParent(q.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(q.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return n("InsertUnorderedList")||n("InsertOrderedList")||(!l.inline_styles&&!!m.getParent(q.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(q.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(q.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(l.custom_undo_redo){u({Undo:function(){o.undoManager.undo()},Redo:function(){o.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:false,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){if(d>0||g.length==1){return null}}if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){g.length=d+1}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=false}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.bookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=0;c.typing=false},hasUndo:function(){return d>0||c.typing},hasRedo:function(){return d<g.length-1}}}})(tinymce);(function(n){var l=n.dom.Event,c=n.isIE,a=n.isGecko,b=n.isOpera,k=n.each,j=n.extend,d=true,h=false;function m(q){var r,p,o;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(q.nodeName)){if(r){p=q.cloneNode(false);p.appendChild(r);r=p}else{r=o=q.cloneNode(false)}r.removeAttribute("id")}}while(q=q.parentNode);if(r){return{wrapper:r,inner:o}}}function g(p,q){var o=q.ownerDocument.createRange();o.setStart(p.endContainer,p.endOffset);o.setEndAfter(q);return o.cloneContents().textContent.length==0}function f(o){o=o.innerHTML;o=o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");o=o.replace(/<[^>]+>/g,"");return o.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(q,s,o){var p,r;if(f(o)){p=s.getParent(o,"ul,ol");if(!s.getParent(p.parentNode,"ul,ol")){s.split(p,o);r=s.create("p",0,'<br data-mce-bogus="1" />');s.replace(r,o);q.select(r,1)}return h}return d}n.create("tinymce.ForceBlocks",{ForceBlocks:function(o){var p=this,q=o.settings,r;p.editor=o;p.dom=o.dom;r=(q.forced_root_block||"p").toLowerCase();q.element=r.toUpperCase();o.onPreInit.add(p.setup,p);if(q.forced_root_block){o.onInit.add(p.forceRoots,p);o.onSetContent.add(p.forceRoots,p);o.onBeforeGetContent.add(p.forceRoots,p)}},setup:function(){var p=this,o=p.editor,r=o.settings,v=o.dom,q=o.selection;if(r.forced_root_block){o.onBeforeExecCommand.add(p.forceRoots,p);o.onKeyUp.add(p.forceRoots,p);o.onPreProcess.add(p.forceRoots,p)}if(r.force_br_newlines){if(c){o.onKeyPress.add(function(s,t){var x;if(t.keyCode==13&&q.getNode().nodeName!="LI"){q.setContent('<br id="__" /> ',{format:"raw"});x=v.get("__");x.removeAttribute("id");q.select(x);q.collapse();return l.cancel(t)}})}}if(r.force_p_newlines){if(!c){o.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!p.insertPara(t)){l.cancel(t)}})}else{n.addUnload(function(){p._previousFormats=0});o.onKeyPress.add(function(s,t){p._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&r.keep_styles){p._previousFormats=m(s.selection.getStart())}});o.onKeyUp.add(function(t,y){if(y.keyCode==13&&!y.shiftKey){var x=t.selection.getStart(),s=p._previousFormats;if(!x.hasChildNodes()&&s){x=v.getParent(x,v.isBlock);if(x&&x.nodeName!="LI"){x.innerHTML="";if(p._previousFormats){x.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{x.innerHTML="\uFEFF"}q.select(x,1);t.getDoc().execCommand("Delete",false,null);p._previousFormats=0}}}})}if(a){o.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){p.backspaceDelete(t,t.keyCode==8)}})}}if(n.isWebKit){function u(t){var s=q.getRng(),x,A=v.create("div",null," "),z,y=v.getViewPort(t.getWin()).h;s.insertNode(x=v.create("br"));s.setStartAfter(x);s.setEndAfter(x);q.setRng(s);if(q.getSel().focusNode==x.previousSibling){q.select(v.insertAfter(v.doc.createTextNode("\u00a0"),x));q.collapse(d)}v.insertAfter(A,x);z=v.getPos(A).y;v.remove(A);if(z>y){t.getWin().scrollTo(0,z)}}o.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(r.force_br_newlines&&!v.getParent(q.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){u(s);l.cancel(t)}})}if(c){if(r.element!="P"){o.onKeyPress.add(function(s,t){p.lastElm=q.getNode().nodeName});o.onKeyUp.add(function(t,x){var z,y=q.getNode(),s=t.getBody();if(s.childNodes.length===1&&y.nodeName=="P"){y=v.rename(y,r.element);q.select(y);q.collapse();t.nodeChanged()}else{if(x.keyCode==13&&!x.shiftKey&&p.lastElm!="P"){z=v.getParent(y,"p");if(z){v.rename(z,r.element);t.nodeChanged()}}}})}}},find:function(v,q,r){var p=this.editor,o=p.getDoc().createTreeWalker(v,4,null,h),u=-1;while(v=o.nextNode()){u++;if(q==0&&v==r){return u}if(q==1&&u==r){return v}}return -1},forceRoots:function(x,I){var z=this,x=z.editor,M=x.getBody(),J=x.getDoc(),P=x.selection,A=P.getSel(),B=P.getRng(),N=-2,v,G,o,p,K=-16777215;var L,q,O,F,C,u=M.childNodes,E,D,y;for(E=u.length-1;E>=0;E--){L=u[E];if(L.nodeType===1&&L.getAttribute("data-mce-type")){q=null;continue}if(L.nodeType===3||(!z.dom.isBlock(L)&&L.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(L.nodeName))){if(!q){if(L.nodeType!=3||/[^\s]/g.test(L.nodeValue)){if(N==-2&&B){if(!c||B.setStart){if(B.startContainer.nodeType==1&&(D=B.startContainer.childNodes[B.startOffset])&&D.nodeType==1){y=D.getAttribute("id");D.setAttribute("id","__mce")}else{if(x.dom.getParent(B.startContainer,function(r){return r===M})){G=B.startOffset;o=B.endOffset;N=z.find(M,0,B.startContainer);v=z.find(M,0,B.endContainer)}}}else{if(B.item){p=J.body.createTextRange();p.moveToElementText(B.item(0));B=p}p=J.body.createTextRange();p.moveToElementText(M);p.collapse(1);O=p.move("character",K)*-1;p=B.duplicate();p.collapse(1);F=p.move("character",K)*-1;p=B.duplicate();p.collapse(0);C=(p.move("character",K)*-1)-F;N=F-O;v=C}}q=x.dom.create(x.settings.forced_root_block);L.parentNode.replaceChild(q,L);q.appendChild(L)}}else{if(q.hasChildNodes()){q.insertBefore(L,q.firstChild)}else{q.appendChild(L)}}}else{q=null}}if(N!=-2){if(!c||B.setStart){q=M.getElementsByTagName(x.settings.element)[0];B=J.createRange();if(N!=-1){B.setStart(z.find(M,1,N),G)}else{B.setStart(q,0)}if(v!=-1){B.setEnd(z.find(M,1,v),o)}else{B.setEnd(q,0)}if(A){A.removeAllRanges();A.addRange(B)}}else{try{B=A.createRange();B.moveToElementText(M);B.collapse(1);B.moveStart("character",N);B.moveEnd("character",v);B.select()}catch(H){}}}else{if((!c||B.setStart)&&(D=x.dom.get("__mce"))){if(y){D.setAttribute("id",y)}else{D.removeAttribute("id")}B=J.createRange();B.setStartBefore(D);B.setEndBefore(D);P.setRng(B)}}},getParentBlock:function(p){var o=this.dom;return o.getParent(p,o.isBlock)},insertPara:function(S){var G=this,x=G.editor,O=x.dom,T=x.getDoc(),X=x.settings,H=x.selection.getSel(),I=H.getRangeAt(0),W=T.body;var L,M,J,Q,P,u,p,v,A,o,E,V,q,z,K,N=O.getViewPort(x.getWin()),D,F,C;L=T.createRange();L.setStart(H.anchorNode,H.anchorOffset);L.collapse(d);M=T.createRange();M.setStart(H.focusNode,H.focusOffset);M.collapse(d);J=L.compareBoundaryPoints(L.START_TO_END,M)<0;Q=J?H.anchorNode:H.focusNode;P=J?H.anchorOffset:H.focusOffset;u=J?H.focusNode:H.anchorNode;p=J?H.focusOffset:H.anchorOffset;if(Q===u&&/^(TD|TH)$/.test(Q.nodeName)){if(Q.firstChild.nodeName=="BR"){O.remove(Q.firstChild)}if(Q.childNodes.length==0){x.dom.add(Q,X.element,null,"<br />");V=x.dom.add(Q,X.element,null,"<br />")}else{K=Q.innerHTML;Q.innerHTML="";x.dom.add(Q,X.element,null,K);V=x.dom.add(Q,X.element,null,"<br />")}I=T.createRange();I.selectNodeContents(V);I.collapse(1);x.selection.setRng(I);return h}if(Q==W&&u==W&&W.firstChild&&x.dom.isBlock(W.firstChild)){Q=u=Q.firstChild;P=p=0;L=T.createRange();L.setStart(Q,0);M=T.createRange();M.setStart(u,0)}Q=Q.nodeName=="HTML"?T.body:Q;Q=Q.nodeName=="BODY"?Q.firstChild:Q;u=u.nodeName=="HTML"?T.body:u;u=u.nodeName=="BODY"?u.firstChild:u;v=G.getParentBlock(Q);A=G.getParentBlock(u);o=v?v.nodeName:X.element;if(K=G.dom.getParent(v,"li,pre")){if(K.nodeName=="LI"){return e(x.selection,G.dom,K)}return d}if(v&&(v.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;v=null}if(A&&(A.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;A=null}if(/(TD|TABLE|TH|CAPTION)/.test(o)||(v&&o=="DIV"&&/left|right/gi.test(O.getStyle(v,"float",1)))){o=X.element;v=A=null}E=(v&&v.nodeName==o)?v.cloneNode(0):x.dom.create(o);V=(A&&A.nodeName==o)?A.cloneNode(0):x.dom.create(o);V.removeAttribute("id");if(/^(H[1-6])$/.test(o)&&g(I,v)){V=x.dom.create(X.element)}K=q=Q;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}q=K}while((K=K.previousSibling?K.previousSibling:K.parentNode));K=z=u;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}z=K}while((K=K.nextSibling?K.nextSibling:K.parentNode));if(q.nodeName==o){L.setStart(q,0)}else{L.setStartBefore(q)}L.setEnd(Q,P);E.appendChild(L.cloneContents()||T.createTextNode(""));try{M.setEndAfter(z)}catch(R){}M.setStart(u,p);V.appendChild(M.cloneContents()||T.createTextNode(""));I=T.createRange();if(!q.previousSibling&&q.parentNode.nodeName==o){I.setStartBefore(q.parentNode)}else{if(L.startContainer.nodeName==o&&L.startOffset==0){I.setStartBefore(L.startContainer)}else{I.setStart(L.startContainer,L.startOffset)}}if(!z.nextSibling&&z.parentNode.nodeName==o){I.setEndAfter(z.parentNode)}else{I.setEnd(M.endContainer,M.endOffset)}I.deleteContents();if(b){x.getWin().scrollTo(0,N.y)}if(E.firstChild&&E.firstChild.nodeName==o){E.innerHTML=E.firstChild.innerHTML}if(V.firstChild&&V.firstChild.nodeName==o){V.innerHTML=V.firstChild.innerHTML}if(f(E)){E.innerHTML="<br />"}function U(y,s){var r=[],Z,Y,t;y.innerHTML="";if(X.keep_styles){Y=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)){Z=Y.cloneNode(h);O.setAttrib(Z,"id","");r.push(Z)}}while(Y=Y.parentNode)}if(r.length>0){for(t=r.length-1,Z=y;t>=0;t--){Z=Z.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(V)){C=U(V,u)}if(b&&parseFloat(opera.version())<9.5){I.insertNode(E);I.insertNode(V)}else{I.insertNode(V);I.insertNode(E)}V.normalize();E.normalize();function B(r){return T.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}I=T.createRange();I.selectNodeContents(a?B(C||V):C||V);I.collapse(1);H.removeAllRanges();H.addRange(I);D=x.dom.getPos(V).y;F=V.clientHeight;if(D<N.y||D+F>N.y+N.h){x.getWin().scrollTo(0,D<N.y?D:D-N.h+25)}return h},backspaceDelete:function(v,C){var D=this,u=D.editor,z=u.getBody(),s=u.dom,q,x=u.selection,p=x.getRng(),y=p.startContainer,q,A,B,o;if(!C&&p.collapsed&&y.nodeType==1&&p.startOffset==y.childNodes.length){o=new n.dom.TreeWalker(y.lastChild,y);for(q=y.lastChild;q;q=o.prev()){if(q.nodeType==3){p.setStart(q,q.nodeValue.length);p.collapse(true);x.setRng(p);return}}}if(y&&u.dom.isBlock(y)&&!/^(TD|TH)$/.test(y.nodeName)&&C){if(y.childNodes.length==0||(y.childNodes.length==1&&y.firstChild.nodeName=="BR")){q=y;while((q=q.previousSibling)&&!u.dom.isBlock(q)){}if(q){if(y!=z.firstChild){A=u.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,h);while(B=A.nextNode()){q=B}p=u.getDoc().createRange();p.setStart(q,q.nodeValue?q.nodeValue.length:0);p.setEnd(q,q.nodeValue?q.nodeValue.length:0);x.setRng(p);u.dom.remove(y)}return l.cancel(v)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(k){k.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var h,g=this,f=g.editor;d(f.plugins,function(k){if(k.createControl){h=k.createControl(j,g);if(h){return false}}});switch(j){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[j])){return g.createButton(j,h)}return g.add(h)},createDropMenu:function(f,o,h){var n=this,j=n.editor,k,g,l,m;o=e({"class":"mceDropDown",constrain:j.settings.constrain_menus},o);o["class"]=o["class"]+" "+j.getParam("skin")+"Skin";if(l=j.getParam("skin_variant")){o["class"]+=" "+j.getParam("skin")+"Skin"+l.substring(0,1).toUpperCase()+l.substring(1)}f=n.prefix+f;m=h||n._cls.dropmenu||c.ui.DropMenu;k=n.controls[f]=new m(f,o);k.onAddItem.add(function(r,q){var p=q.settings;p.title=j.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(s){if(p.cmd){j.execCommand(p.cmd,p.ui||false,p.value)}}}});j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return n.add(k)},createListBox:function(n,j,m){var h=this,g=h.editor,k,l,f;if(h.get(n)){return null}j.title=g.translate(j.title);j.scope=j.scope||g;if(!j.onselect){j.onselect=function(o){g.execCommand(j.cmd,j.ui||false,o||j.value)}}j=e({title:j.title,"class":"mce_"+n,scope:j.scope,control_manager:h},j);n=h.prefix+n;if(g.settings.use_native_selects){l=new c.ui.NativeListBox(n,j)}else{f=m||h._cls.listbox||c.ui.ListBox;l=new f(n,j)}h.controls[n]=l;if(c.isWebKit){l.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(l.hideMenu){g.onMouseDown.add(l.hideMenu,l)}return h.add(l)},createButton:function(n,j,m){var h=this,g=h.editor,k,l,f;if(h.get(n)){return null}j.title=g.translate(j.title);j.label=g.translate(j.label);j.scope=j.scope||g;if(!j.onclick&&!j.menu_button){j.onclick=function(){g.execCommand(j.cmd,j.ui||false,j.value)}}j=e({title:j.title,"class":"mce_"+n,unavailable_prefix:g.getLang("unavailable",""),scope:j.scope,control_manager:h},j);n=h.prefix+n;if(j.menu_button){f=m||h._cls.menubutton||c.ui.MenuButton;l=new f(n,j);g.onMouseDown.add(l.hideMenu,l)}else{f=h._cls.button||c.ui.Button;l=new f(n,j)}return h.add(l)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(n,j,m){var h=this,g=h.editor,k,l,f;if(h.get(n)){return null}j.title=g.translate(j.title);j.scope=j.scope||g;if(!j.onclick){j.onclick=function(o){g.execCommand(j.cmd,j.ui||false,o||j.value)}}if(!j.onselect){j.onselect=function(o){g.execCommand(j.cmd,j.ui||false,o||j.value)}}j=e({title:j.title,"class":"mce_"+n,scope:j.scope,control_manager:h},j);n=h.prefix+n;f=m||h._cls.splitbutton||c.ui.SplitButton;l=h.add(new f(n,j));g.onMouseDown.add(l.hideMenu,l);return l},createColorSplitButton:function(f,o,h){var m=this,k=m.editor,j,l,n,g;if(m.get(f)){return null}o.title=k.translate(o.title);o.scope=o.scope||k;if(!o.onclick){o.onclick=function(p){if(c.isIE){g=k.selection.getBookmark(1)}k.execCommand(o.cmd,o.ui||false,p||o.value)}}if(!o.onselect){o.onselect=function(p){k.execCommand(o.cmd,o.ui||false,p||o.value)}}o=e({title:o.title,"class":"mce_"+f,menu_class:k.getParam("skin")+"Skin",scope:o.scope,more_colors_title:k.getLang("more_colors")},o);f=m.prefix+f;n=h||m._cls.colorsplitbutton||c.ui.ColorSplitButton;l=new n(f,o);k.onMouseDown.add(l.hideMenu,l);k.onRemove.add(function(){l.destroy()});if(c.isIE){l.onShowMenu.add(function(){k.focus();g=k.selection.getBookmark(1)});l.onHideMenu.add(function(){if(g){k.selection.moveToBookmark(g);g=0}})}return m.add(l)},createToolbar:function(l,h,k){var j,g=this,f;l=g.prefix+l;f=k||g._cls.toolbar||c.ui.Toolbar;j=new f(l,h);if(g.get(l)){return null}return g.add(j)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(A,h){var z=this,l="",o,n,j=z.editor.settings.dialog_type=="modal",r,q,k,g=d.DOM.getViewPort(),v;A=A||{};h=h||{};q=b?g.w:screen.width;k=b?g.h:screen.height;A.name=A.name||"mc_"+new Date().getTime();A.width=parseInt(A.width||320);A.height=parseInt(A.height||240);A.resizable=true;A.left=A.left||parseInt(q/2)-(A.width/2);A.top=A.top||parseInt(k/2)-(A.height/2);h.inline=false;h.mce_width=A.width;h.mce_height=A.height;h.mce_auto_focus=A.auto_focus;if(j){if(c){A.center=true;A.help=false;A.dialogWidth=A.width+"px";A.dialogHeight=A.height+"px";A.scroll=A.scrollbars||false}}e(A,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&j){l+=(l?";":"")+f+":"+p}else{l+=(l?",":"")+f+"="+p}}});z.features=A;z.params=h;z.onOpen.dispatch(z,A,h);v=A.url||A.file;v=d._addVer(v);try{if(c&&j){r=1;window.showModalDialog(v,window,l)}else{r=window.open(v,A.name,l)}}catch(m){}if(!r){alert(z.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(j,h,g,n,m,l){var k=d.resolve(j);return new k(h,g,n,m,l)},confirm:function(h,f,j,g){g=g||window;f.call(j||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,k,g){var j=this;g=g||window;g.alert(j._decode(j.editor.getLang(h,h)));if(f){f.call(k||j)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(U){var L={},N=a.each,c=U.dom,q=U.selection,t=a.dom.TreeWalker,J=new a.dom.RangeUtils(c),d=U.schema.isValidChild,F=c.isBlock,l=U.settings.forced_root_block,s=c.nodeIndex,E="\uFEFF",e=/^(src|href|style)$/,R=false,B=true,p,O={apply:[],remove:[]};function z(V){return V instanceof Array}function m(W,V){return c.getParents(W,V,c.getRoot())}function b(V){return V.nodeType===1&&(V.face==="mceinline"||V.style.fontFamily==="mceinline")}function Q(V){return V?L[V]:L}function k(V,W){if(V){if(typeof(V)!=="string"){N(V,function(Y,X){k(X,Y)})}else{W=W.length?W:[W];N(W,function(X){if(X.deep===p){X.deep=!X.selector}if(X.split===p){X.split=!X.selector||X.inline}if(X.remove===p&&X.selector&&!X.inline){X.remove="none"}if(X.selector&&X.inline){X.mixed=true;X.block_expand=true}if(typeof(X.classes)==="string"){X.classes=X.classes.split(/\s+/)}});L[V]=W}}}function S(X,ad,Z){var aa=Q(X),ae=aa[0],ac,W,ab;function Y(ah){var ag=ah.startContainer,ak=ah.startOffset,aj,ai;if(ag.nodeType==1||ag.nodeValue===""){ag=ag.nodeType==1?ag.childNodes[ak]:ag;if(ag){aj=new t(ag,ag.parentNode);for(ai=aj.current();ai;ai=aj.next()){if(ai.nodeType==3&&!f(ai)){ah.setStart(ai,0);break}}}}return ah}function V(ah,ag){ag=ag||ae;if(ah){N(ag.styles,function(aj,ai){c.setStyle(ah,ai,r(aj,ad))});N(ag.attributes,function(aj,ai){c.setAttrib(ah,ai,r(aj,ad))});N(ag.classes,function(ai){ai=r(ai,ad);if(!c.hasClass(ah,ai)){c.addClass(ah,ai)}})}}function af(ah){var ag=[],aj,ai;aj=ae.inline||ae.block;ai=c.create(aj);V(ai);J.walk(ah,function(ak){var al;function am(an){var aq=an.nodeName.toLowerCase(),ap=an.parentNode.nodeName.toLowerCase(),ao;if(g(aq,"br")){al=0;if(ae.block){c.remove(an)}return}if(ae.wrapper&&x(an,X,ad)){al=0;return}if(ae.block&&!ae.wrapper&&G(aq)){an=c.rename(an,aj);V(an);ag.push(an);al=0;return}if(ae.selector){N(aa,function(ar){if(c.is(an,ar.selector)&&!b(an)){V(an,ar);ao=true}});if(!ae.inline||ao){al=0;return}}if((ae.wrap_links!==false||aq!="a")&&d(aj,aq)&&d(ap,aj)&&!(an.nodeType===3&&an.nodeValue.length===1&&an.nodeValue.charCodeAt(0)===65279)){if(!al){al=ai.cloneNode(R);an.parentNode.insertBefore(al,an);ag.push(al)}al.appendChild(an)}else{al=0;N(a.grep(an.childNodes),am);al=0}}N(ak,am)});N(ag,function(am){var ak;function an(ap){var ao=0;N(ap.childNodes,function(aq){if(!f(aq)&&!H(aq)){ao++}});return ao}function al(ao){var aq,ap;N(ao.childNodes,function(ar){if(ar.nodeType==1&&!H(ar)&&!b(ar)){aq=ar;return R}});if(aq&&h(aq,ae)){ap=aq.cloneNode(R);V(ap);c.replace(ap,ao,B);c.remove(aq,1)}return ap||ao}ak=an(am);if((ag.length>1||!F(am))&&ak===0){c.remove(am,1);return}if(ae.inline||ae.wrapper){if(!ae.exact&&ak===1){am=al(am)}N(aa,function(ao){N(c.select(ao.inline,am),function(ap){T(ao,ad,ap,ao.exact?ap:null)})});if(x(am.parentNode,X,ad)){c.remove(am,1);am=0;return B}if(ae.merge_with_parents){c.getParent(am.parentNode,function(ao){if(x(ao,X,ad)){c.remove(am,1);am=0;return B}})}if(am){am=u(C(am),am);am=u(am,C(am,B))}}})}if(ae){if(Z){W=c.createRng();W.setStartBefore(Z);W.setEndAfter(Z);af(o(W,aa))}else{if(!q.isCollapsed()||!ae.inline){ac=q.getBookmark();af(o(q.getRng(B),aa));q.moveToBookmark(ac);q.setRng(Y(q.getRng(B)));U.nodeChanged()}else{P("apply",X,ad)}}}}function A(X,ag,aa){var ab=Q(X),ai=ab[0],af,ae,W;function Z(al){var ak=al.startContainer,aq=al.startOffset,ap,ao,am,an;if(ak.nodeType==3&&aq>=ak.nodeValue.length-1){ak=ak.parentNode;aq=s(ak)+1}if(ak.nodeType==1){am=ak.childNodes;ak=am[Math.min(aq,am.length-1)];ap=new t(ak);if(aq>am.length-1){ap.next()}for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType==3&&!f(ao)){an=c.create("a",null,E);ao.parentNode.insertBefore(an,ao);al.setStart(ao,0);q.setRng(al);c.remove(an);return}}}}function Y(an){var am,al,ak;am=a.grep(an.childNodes);for(al=0,ak=ab.length;al<ak;al++){if(T(ab[al],ag,an,an)){break}}if(ai.deep){for(al=0,ak=am.length;al<ak;al++){Y(am[al])}}}function ac(ak){var al;N(m(ak.parentNode).reverse(),function(am){var an;if(!al&&am.id!="_start"&&am.id!="_end"){an=x(am,X,ag);if(an&&an.split!==false){al=am}}});return al}function V(an,ak,ap,at){var au,ar,aq,am,ao,al;if(an){al=an.parentNode;for(au=ak.parentNode;au&&au!=al;au=au.parentNode){ar=au.cloneNode(R);for(ao=0;ao<ab.length;ao++){if(T(ab[ao],ag,ar,ar)){ar=0;break}}if(ar){if(aq){ar.appendChild(aq)}if(!am){am=ar}aq=ar}}if(at&&(!ai.mixed||!F(an))){ak=c.split(an,ak)}if(aq){ap.parentNode.insertBefore(aq,ap);am.appendChild(ap)}}return ak}function ah(ak){return V(ac(ak),ak,ak,true)}function ad(am){var al=c.get(am?"_start":"_end"),ak=al[am?"firstChild":"lastChild"];if(H(ak)){ak=ak[am?"firstChild":"lastChild"]}c.remove(al,true);return ak}function aj(ak){var al,am;ak=o(ak,ab,B);if(ai.split){al=I(ak,B);am=I(ak);if(al!=am){al=M(al,"span",{id:"_start","data-mce-type":"bookmark"});am=M(am,"span",{id:"_end","data-mce-type":"bookmark"});ah(al);ah(am);al=ad(B);am=ad()}else{al=am=ah(al)}ak.startContainer=al.parentNode;ak.startOffset=s(al);ak.endContainer=am.parentNode;ak.endOffset=s(am)+1}J.walk(ak,function(an){N(an,function(ao){Y(ao)})})}if(aa){W=c.createRng();W.setStartBefore(aa);W.setEndAfter(aa);aj(W);return}if(!q.isCollapsed()||!ai.inline){af=q.getBookmark();aj(q.getRng(B));q.moveToBookmark(af);if(j(X,ag,q.getStart())){Z(q.getRng(true))}U.nodeChanged()}else{P("remove",X,ag)}}function D(V,X,W){if(j(V,X,W)){A(V,X,W)}else{S(V,X,W)}}function x(W,V,ab,Z){var X=Q(V),ac,aa,Y;function ad(ah,aj,ak){var ag,ai,ae=aj[ak],af;if(ae){if(ae.length===p){for(ag in ae){if(ae.hasOwnProperty(ag)){if(ak==="attributes"){ai=c.getAttrib(ah,ag)}else{ai=K(ah,ag)}if(Z&&!ai&&!aj.exact){return}if((!Z||aj.exact)&&!g(ai,r(ae[ag],ab))){return}}}}else{for(af=0;af<ae.length;af++){if(ak==="attributes"?c.getAttrib(ah,ae[af]):K(ah,ae[af])){return aj}}}}return aj}if(X&&W){for(aa=0;aa<X.length;aa++){ac=X[aa];if(h(W,ac)&&ad(W,ac,"attributes")&&ad(W,ac,"styles")){if(Y=ac.classes){for(aa=0;aa<Y.length;aa++){if(!c.hasClass(W,Y[aa])){return}}}return ac}}}}function j(X,aa,Z){var W,Y;function V(ab){ab=c.getParent(ab,function(ac){return !!x(ac,X,aa,true)});return x(ab,X,aa)}if(Z){return V(Z)}if(q.isCollapsed()){for(Y=O.apply.length-1;Y>=0;Y--){if(O.apply[Y].name==X){return true}}for(Y=O.remove.length-1;Y>=0;Y--){if(O.remove[Y].name==X){return false}}return V(q.getNode())}Z=q.getNode();if(V(Z)){return B}W=q.getStart();if(W!=Z){if(V(W)){return B}}return R}function v(ac,ab){var Z,aa=[],Y={},X,W,V;if(q.isCollapsed()){for(W=0;W<ac.length;W++){for(X=O.remove.length-1;X>=0;X--){V=ac[W];if(O.remove[X].name==V){Y[V]=true;break}}}for(X=O.apply.length-1;X>=0;X--){for(W=0;W<ac.length;W++){V=ac[W];if(!Y[V]&&O.apply[X].name==V){Y[V]=true;aa.push(V)}}}}Z=q.getStart();c.getParent(Z,function(af){var ae,ad;for(ae=0;ae<ac.length;ae++){ad=ac[ae];if(!Y[ad]&&x(af,ad,ab)){Y[ad]=true;aa.push(ad)}}});return aa}function y(Z){var ab=Q(Z),Y,X,aa,W,V;if(ab){Y=q.getStart();X=m(Y);for(W=ab.length-1;W>=0;W--){V=ab[W].selector;if(!V){return B}for(aa=X.length-1;aa>=0;aa--){if(c.is(X[aa],V)){return B}}}}return R}a.extend(this,{get:Q,register:k,apply:S,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(V,W){if(g(V,W.inline)){return B}if(g(V,W.block)){return B}if(W.selector){return c.is(V,W.selector)}}function g(W,V){W=W||"";V=V||"";W=""+(W.nodeName||W);V=""+(V.nodeName||V);return W.toLowerCase()==V.toLowerCase()}function K(W,V){var X=c.getStyle(W,V);if(V=="color"||V=="backgroundColor"){X=c.toHex(X)}if(V=="fontWeight"&&X==700){X="bold"}return""+X}function r(V,W){if(typeof(V)!="string"){V=V(W)}else{if(W){V=V.replace(/%(\w+)/g,function(Y,X){return W[X]||Y})}}return V}function f(V){return V&&V.nodeType===3&&/^([\s\r\n]+|)$/.test(V.nodeValue)}function M(X,W,V){var Y=c.create(W,V);X.parentNode.insertBefore(Y,X);Y.appendChild(X);return Y}function o(V,ad,Y){var X=V.startContainer,aa=V.startOffset,ag=V.endContainer,ab=V.endOffset,af,ac;function ae(aj,ak,ah,ai){var al,am;ai=ai||c.getRoot();for(;;){al=aj.parentNode;if(al==ai||(!ad[0].block_expand&&F(al))){return aj}for(af=al[ak];af&&af!=aj;af=af[ah]){if(af.nodeType==1&&!H(af)){return aj}if(af.nodeType==3&&!f(af)){return aj}}aj=aj.parentNode}return aj}if(X.nodeType==1&&X.hasChildNodes()){ac=X.childNodes.length-1;X=X.childNodes[aa>ac?ac:aa];if(X.nodeType==3){aa=0}}if(ag.nodeType==1&&ag.hasChildNodes()){ac=ag.childNodes.length-1;ag=ag.childNodes[ab>ac?ac:ab-1];if(ag.nodeType==3){ab=ag.nodeValue.length}}if(H(X.parentNode)){X=X.parentNode}if(H(X)){X=X.nextSibling||X}if(H(ag.parentNode)){ag=ag.parentNode}if(H(ag)){ag=ag.previousSibling||ag}if(ad[0].inline||ad[0].block_expand){X=ae(X,"firstChild","nextSibling");ag=ae(ag,"lastChild","previousSibling")}if(ad[0].selector&&ad[0].expand!==R&&!ad[0].inline){function Z(ai,ah){var aj,ak,al;if(ai.nodeType==3&&ai.nodeValue.length==0&&ai[ah]){ai=ai[ah]}aj=m(ai);for(ak=0;ak<aj.length;ak++){for(al=0;al<ad.length;al++){if(c.is(aj[ak],ad[al].selector)){return aj[ak]}}}return ai}X=Z(X,"previousSibling");ag=Z(ag,"nextSibling")}if(ad[0].block||ad[0].selector){function W(ai,ah,ak){var aj;if(!ad[0].wrapper){aj=c.getParent(ai,ad[0].block)}if(!aj){aj=c.getParent(ai.nodeType==3?ai.parentNode:ai,F)}if(aj&&ad[0].wrapper){aj=m(aj,"ul,ol").reverse()[0]||aj}if(!aj){aj=ai;while(aj[ah]&&!F(aj[ah])){aj=aj[ah];if(g(aj,"br")){break}}}return aj||ai}X=W(X,"previousSibling");ag=W(ag,"nextSibling");if(ad[0].block){if(!F(X)){X=ae(X,"firstChild","nextSibling")}if(!F(ag)){ag=ae(ag,"lastChild","previousSibling")}}}if(X.nodeType==1){aa=s(X);X=X.parentNode}if(ag.nodeType==1){ab=s(ag)+1;ag=ag.parentNode}return{startContainer:X,startOffset:aa,endContainer:ag,endOffset:ab}}function T(ab,aa,Y,V){var X,W,Z;if(!h(Y,ab)){return R}if(ab.remove!="all"){N(ab.styles,function(ad,ac){ad=r(ad,aa);if(typeof(ac)==="number"){ac=ad;V=0}if(!V||g(K(V,ac),ad)){c.setStyle(Y,ac,"")}Z=1});if(Z&&c.getAttrib(Y,"style")==""){Y.removeAttribute("style");Y.removeAttribute("data-mce-style")}N(ab.attributes,function(ae,ac){var ad;ae=r(ae,aa);if(typeof(ac)==="number"){ac=ae;V=0}if(!V||g(c.getAttrib(V,ac),ae)){if(ac=="class"){ae=c.getAttrib(Y,ac);if(ae){ad="";N(ae.split(/\s+/),function(af){if(/mce\w+/.test(af)){ad+=(ad?" ":"")+af}});if(ad){c.setAttrib(Y,ac,ad);return}}}if(ac=="class"){Y.removeAttribute("className")}if(e.test(ac)){Y.removeAttribute("data-mce-"+ac)}Y.removeAttribute(ac)}});N(ab.classes,function(ac){ac=r(ac,aa);if(!V||c.hasClass(V,ac)){c.removeClass(Y,ac)}});W=c.getAttribs(Y);for(X=0;X<W.length;X++){if(W[X].nodeName.indexOf("_")!==0){return R}}}if(ab.remove!="none"){n(Y,ab);return B}}function n(X,Y){var V=X.parentNode,W;if(Y.block){if(!l){function Z(ab,aa,ac){ab=C(ab,aa,ac);return !ab||(ab.nodeName=="BR"||F(ab))}if(F(X)&&!F(V)){if(!Z(X,R)&&!Z(X.firstChild,B,1)){X.insertBefore(c.create("br"),X.firstChild)}if(!Z(X,B)&&!Z(X.lastChild,R,1)){X.appendChild(c.create("br"))}}}else{if(V==c.getRoot()){if(!Y.list_block||!g(X,Y.list_block)){N(a.grep(X.childNodes),function(aa){if(d(l,aa.nodeName.toLowerCase())){if(!W){W=M(aa,l)}else{W.appendChild(aa)}}else{W=0}})}}}}if(Y.selector&&Y.inline&&!g(Y.inline,X)){return}c.remove(X,1)}function C(W,V,X){if(W){V=V?"nextSibling":"previousSibling";for(W=X?W:W[V];W;W=W[V]){if(W.nodeType==1||!f(W)){return W}}}}function H(V){return V&&V.nodeType==1&&V.getAttribute("data-mce-type")=="bookmark"}function u(Z,Y){var V,X,W;function ab(ae,ad){if(ae.nodeName!=ad.nodeName){return R}function ac(ag){var ah={};N(c.getAttribs(ag),function(ai){var aj=ai.nodeName.toLowerCase();if(aj.indexOf("_")!==0&&aj!=="style"){ah[aj]=c.getAttrib(ag,aj)}});return ah}function af(aj,ai){var ah,ag;for(ag in aj){if(aj.hasOwnProperty(ag)){ah=ai[ag];if(ah===p){return R}if(aj[ag]!=ah){return R}delete ai[ag]}}for(ag in ai){if(ai.hasOwnProperty(ag)){return R}}return B}if(!af(ac(ae),ac(ad))){return R}if(!af(c.parseStyle(c.getAttrib(ae,"style")),c.parseStyle(c.getAttrib(ad,"style")))){return R}return B}if(Z&&Y){function aa(ad,ac){for(X=ad;X;X=X[ac]){if(X.nodeType==3&&!f(X)){return ad}if(X.nodeType==1&&!H(X)){return X}}return ad}Z=aa(Z,"previousSibling");Y=aa(Y,"nextSibling");if(ab(Z,Y)){for(X=Z.nextSibling;X&&X!=Y;){W=X;X=X.nextSibling;Z.appendChild(W)}c.remove(Y);N(a.grep(Y.childNodes),function(ac){Z.appendChild(ac)});return Z}}return Y}function G(V){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(V)}function I(W,Z){var V,Y,X;V=W[Z?"startContainer":"endContainer"];Y=W[Z?"startOffset":"endOffset"];if(V.nodeType==1){X=V.childNodes.length-1;if(!Z&&Y){Y--}V=V.childNodes[Y>X?X:Y]}return V}function P(aa,W,Z){var X,V=O[aa],ab=O[aa=="apply"?"remove":"apply"];function ac(){return O.apply.length||O.remove.length}function Y(){O.apply=[];O.remove=[]}function ad(ae){N(O.apply.reverse(),function(af){S(af.name,af.vars,ae)});N(O.remove.reverse(),function(af){A(af.name,af.vars,ae)});c.remove(ae,1);Y()}for(X=V.length-1;X>=0;X--){if(V[X].name==W){return}}V.push({name:W,vars:Z});for(X=ab.length-1;X>=0;X--){if(ab[X].name==W){ab.splice(X,1)}}if(ac()){U.getDoc().execCommand("FontName",false,"mceinline");O.lastRng=q.getRng();N(c.select("font,span"),function(af){var ae;if(b(af)){ae=q.getBookmark();ad(af);q.moveToBookmark(ae);U.nodeChanged()}});if(!O.isListening&&ac()){O.isListening=true;N("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(ae){U[ae].addToTop(function(af,ag){if(ac()&&!a.dom.RangeUtils.compareRanges(O.lastRng,q.getRng())){N(c.select("font,span"),function(ai){var aj,ah;if(b(ai)){aj=ai.firstChild;if(aj){ad(ai);ah=c.createRng();ah.setStart(aj,aj.nodeValue.length);ah.setEnd(aj,aj.nodeValue.length);q.setRng(ah);af.nodeChanged()}else{c.remove(ai)}}});if(ag.type=="keyup"||ag.type=="mouseup"){Y()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(k,j){e.each(j,function(m,l){if(m){g.setStyle(k,l,m)}});g.rename(k,"span")}d={font:function(k,j){b(j,{backgroundColor:j.style.backgroundColor,color:j.color,fontFamily:j.face,fontSize:h[parseInt(j.size)-1]})},u:function(k,j){b(j,{textDecoration:"underline"})},strike:function(k,j){b(j,{textDecoration:"line-through"})}};function f(j,k){g=j.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",k.node),function(l){d[l.nodeName.toLowerCase()](a.dom,l)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}}); 
  • trunk/skins/lemill/tiny_mce/tiny_mce_popup.js

    r3015 r3137  
    33// document.domain = 'moxiecode.com'; 
    44 
    5 var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait(); 
     5var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait(); 
  • trunk/skins/lemill/tiny_mce/tiny_mce_src.js

    r3113 r3137  
    66        majorVersion : '3', 
    77 
    8         minorVersion : '3.9.2', 
    9  
    10         releaseDate : '2010-09-29', 
     8        minorVersion : '4b1', 
     9 
     10        releaseDate : '2010-12-20', 
    1111 
    1212        _init : function() { 
     
    104104        }, 
    105105 
     106        makeMap : function(items, delim, map) { 
     107            var i; 
     108 
     109            items = items || []; 
     110            delim = delim || ','; 
     111 
     112            if (typeof(items) == "string") 
     113                items = items.split(delim); 
     114 
     115            map = map || {}; 
     116 
     117            i = items.length; 
     118            while (i--) 
     119                map[items[i]] = {}; 
     120 
     121            return map; 
     122        }, 
     123 
    106124        each : function(o, cb, s) { 
    107125            var n, l; 
     
    136154        }, 
    137155 
    138         create : function(s, p) { 
     156        create : function(s, p, root) { 
    139157            var t = this, sp, ns, cn, scn, c, de = 0; 
    140158 
     
    144162 
    145163            // Create namespace for new class 
    146             ns = t.createNS(s[3].replace(/\.\w+$/, '')); 
     164            ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); 
    147165 
    148166            // Class already exists 
     
    411429    // Expose tinymce namespace to the global namespace (window) 
    412430    win.tinymce = win.tinyMCE = tinymce; 
    413 })(window); 
     431 
     432    // Describe the different namespaces 
     433 
     434    })(window); 
    414435 
    415436(function($, tinymce) { 
     
    428449            var fn = $.fn; 
    429450 
    430             // Adapt the css function to make sure that the _mce_style 
     451            // Adapt the css function to make sure that the data-mce-style 
    431452            // attribute gets updated with the new style information 
    432453            function css(name, value) { 
    433454                var self = this; 
    434455 
    435                 // Remove _mce_style when set operation occurs 
     456                // Remove data-mce-style when set operation occurs 
    436457                if (value) 
    437                     self.removeAttr('_mce_style'); 
     458                    self.removeAttr('data-mce-style'); 
    438459 
    439460                return fn.css.apply(self, arguments); 
    440461            }; 
    441462 
    442             // Apapt the attr function to make sure that it uses the _mce_ prefixed variants 
     463            // Apapt the attr function to make sure that it uses the data-mce- prefixed variants 
    443464            function attr(name, value) { 
    444465                var self = this; 
    445466 
    446                 // Update/retrive _mce_ attribute variants 
     467                // Update/retrive data-mce- attribute variants 
    447468                if (attrRegExp.test(name)) { 
    448469                    if (value !== undefined) { 
     
    454475                        return self; 
    455476                    } else 
    456                         return self.attr('_mce_' + name); 
     477                        return self.attr('data-mce-' + name); 
    457478                } 
    458479 
     
    464485                // Returns a modified function that processes 
    465486                // the HTML before executing the action this makes sure 
    466                 // that href/src etc gets moved into the _mce_ variants 
     487                // that href/src etc gets moved into the data-mce- variants 
    467488                return function(content) { 
    468489                    if (content) 
     
    479500                // Patch some functions, only patch the object once 
    480501                if (jq.css !== css) { 
    481                     // Patch css/attr to use the _mce_ prefixed attribute variants 
     502                    // Patch css/attr to use the data-mce- prefixed attribute variants 
    482503                    jq.css = css; 
    483504                    jq.attr = attr; 
     
    641662                        e.each(function(i, v){ 
    642663                            if (s.keep_values) 
    643                                 $(v).attr('_mce_style', v); 
     664                                $(v).attr('data-mce-style', v); 
    644665 
    645666                            v.style.cssText = v; 
     
    660681                                    v = s.url_converter.call(s.url_converter_scope || t, v, n, v); 
    661682 
    662                                 t.setAttrib(v, '_mce_' + n, v); 
     683                                t.setAttrib(v, 'data-mce-' + n, v); 
    663684                            } 
    664685                        }); 
     
    11031124})(); 
    11041125 
    1105 tinymce.create('static tinymce.util.JSON', { 
    1106     serialize : function(o) { 
    1107         var i, v, s = tinymce.util.JSON.serialize, t; 
     1126(function() { 
     1127    function serialize(o, quote) { 
     1128        var i, v, t; 
     1129 
     1130        quote = quote || '"'; 
    11081131 
    11091132        if (o == null) 
     
    11151138            v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; 
    11161139 
    1117             return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { 
     1140            return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { 
    11181141                i = v.indexOf(b); 
    11191142 
     
    11241147 
    11251148                return '\\u' + '0000'.substring(a.length) + a; 
    1126             }) + '"'; 
     1149            }) + quote; 
    11271150        } 
    11281151 
     
    11301153            if (o.hasOwnProperty && o instanceof Array) { 
    11311154                    for (i=0, v = '['; i<o.length; i++) 
    1132                         v += (i > 0 ? ',' : '') + s(o[i]); 
     1155                        v += (i > 0 ? ',' : '') + serialize(o[i], quote); 
    11331156 
    11341157                    return v + ']'; 
     
    11381161 
    11391162                for (i in o) 
    1140                     v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; 
     1163                    v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; 
    11411164 
    11421165                return v + '}'; 
     
    11441167 
    11451168        return '' + o; 
    1146     }, 
    1147  
    1148     parse : function(s) { 
    1149         try { 
    1150             return eval('(' + s + ')'); 
    1151         } catch (ex) { 
    1152             // Ignore 
     1169    }; 
     1170 
     1171    tinymce.util.JSON = { 
     1172        serialize: serialize, 
     1173 
     1174        parse: function(s) { 
     1175            try { 
     1176                return eval('(' + s + ')'); 
     1177            } catch (ex) { 
     1178                // Ignore 
     1179            } 
    11531180        } 
    1154     } 
    1155  
    1156     }); 
    1157  
     1181 
     1182        }; 
     1183})(); 
    11581184tinymce.create('static tinymce.util.XHR', { 
    11591185    send : function(o) { 
     
    12461272 
    12471273            o.error = function(ty, x) { 
    1248                 ecb.call(o.error_scope || o.scope, ty, x); 
     1274                if (ecb) 
     1275                    ecb.call(o.error_scope || o.scope, ty, x); 
    12491276            }; 
    12501277 
     
    12681295    }); 
    12691296}()); 
     1297(function(tinymce) { 
     1298    var namedEntities, baseEntities, reverseEntities, 
     1299        attrsCharsRegExp = /[&\"\u007E-\uFFFF]/g, 
     1300        textCharsRegExp = /[<>&\u007E-\uFFFF]/g, 
     1301        rawCharsRegExp = /[<>&\"\']/g, 
     1302        entityRegExp = /&(#)?([\w]+);/g; 
     1303 
     1304    // Raw entities 
     1305    baseEntities = { 
     1306        '"' : '&quot;', 
     1307        "'" : '&#39;', 
     1308        '<' : '&lt;', 
     1309        '>' : '&gt;', 
     1310        '&' : '&amp;' 
     1311    }; 
     1312 
     1313    // Reverse lookup table for raw entities 
     1314    reverseEntities = { 
     1315        '&lt;' : '<', 
     1316        '&gt;' : '>', 
     1317        '&amp;' : '&', 
     1318        '&quot;' : '"', 
     1319        '&apos;' : "'" 
     1320    }; 
     1321 
     1322    // Decodes text by using the browser 
     1323    function nativeDecode(text) { 
     1324        var elm; 
     1325 
     1326        elm = document.createElement("div"); 
     1327        elm.innerHTML = text; 
     1328 
     1329        return elm.textContent || elm.innerText || text; 
     1330    }; 
     1331 
     1332    // Build a two way lookup table for the entities 
     1333    function buildEntitiesLookup(items, radix) { 
     1334        var i, chr, entity, lookup = {}; 
     1335 
     1336        if (items) { 
     1337            items = items.split(','); 
     1338            radix = radix || 10; 
     1339 
     1340            // Build entities lookup table 
     1341            for (i = 0; i < items.length; i += 2) { 
     1342                chr = String.fromCharCode(parseInt(items[i], radix)); 
     1343 
     1344                // Only add non base entities 
     1345                if (!baseEntities[chr]) { 
     1346                    entity = '&' + items[i + 1] + ';'; 
     1347                    lookup[chr] = entity; 
     1348                    lookup[entity] = chr; 
     1349                } 
     1350            } 
     1351 
     1352            return lookup; 
     1353        } 
     1354    }; 
     1355 
     1356    // Unpack entities lookup where the numbers are in radix 32 to reduce the size 
     1357    namedEntities = buildEntitiesLookup( 
     1358        '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + 
     1359        '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + 
     1360        '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + 
     1361        '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + 
     1362        '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + 
     1363        '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + 
     1364        '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + 
     1365        '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + 
     1366        '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + 
     1367        '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 
     1368        'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 
     1369        'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 
     1370        't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 
     1371        'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 
     1372        'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + 
     1373        '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + 
     1374        '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + 
     1375        '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + 
     1376        '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + 
     1377        '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 
     1378        'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 
     1379        'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 
     1380        'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + 
     1381        '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + 
     1382        '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' 
     1383    , 32); 
     1384 
     1385    tinymce.html = tinymce.html || {}; 
     1386 
     1387    tinymce.html.Entities = { 
     1388        encodeRaw : function(text, attr) { 
     1389            return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { 
     1390                return baseEntities[chr] || chr; 
     1391            }); 
     1392        }, 
     1393 
     1394        encodeAllRaw : function(text) { 
     1395            return ('' + text).replace(rawCharsRegExp, function(chr) { 
     1396                return baseEntities[chr] || chr; 
     1397            }); 
     1398        }, 
     1399 
     1400        encodeNumeric : function(text, attr) { 
     1401            return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { 
     1402                return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; 
     1403            }); 
     1404        }, 
     1405 
     1406        encodeNamed : function(text, attr, entities) { 
     1407            entities = entities || namedEntities; 
     1408 
     1409            return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { 
     1410                return baseEntities[chr] || entities[chr] || chr; 
     1411            }); 
     1412        }, 
     1413 
     1414        getEncodeFunc : function(name, entities) { 
     1415            var Entities = tinymce.html.Entities; 
     1416 
     1417            entities = buildEntitiesLookup(entities) || namedEntities; 
     1418 
     1419            function encodeNamedAndNumeric(text, attr) { 
     1420                return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { 
     1421                    return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; 
     1422                }); 
     1423            }; 
     1424 
     1425            function encodeCustomNamed(text, attr) { 
     1426                return Entities.encodeNamed(text, attr, entities); 
     1427            }; 
     1428 
     1429            // Replace + with , to be compatible with previous TinyMCE versions 
     1430            name = tinymce.makeMap(name.replace(/\+/g, ',')); 
     1431 
     1432            // Named and numeric encoder 
     1433            if (name.named && name.numeric) 
     1434                return encodeNamedAndNumeric; 
     1435 
     1436            // Named encoder 
     1437            if (name.named) { 
     1438                // Custom names 
     1439                if (entities) 
     1440                    return encodeCustomNamed; 
     1441 
     1442                return Entities.encodeNamed; 
     1443            } 
     1444 
     1445            // Numeric 
     1446            if (name.numeric) 
     1447                return Entities.encodeNumeric; 
     1448 
     1449            // Raw encoder 
     1450            return Entities.encodeRaw; 
     1451        }, 
     1452 
     1453        decode : function(text) { 
     1454            return text.replace(entityRegExp, function(all, numeric, value) { 
     1455                if (numeric) 
     1456                    return String.fromCharCode(value); 
     1457 
     1458                return reverseEntities[all] || namedEntities[all] || nativeDecode(all); 
     1459            }); 
     1460        } 
     1461    }; 
     1462})(tinymce); 
     1463 
     1464tinymce.html.Styles = function(settings, schema) { 
     1465    var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, 
     1466        urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, 
     1467        styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, 
     1468        trimRightRegExp = /\s+$/, 
     1469        urlColorRegExp = /rgb/, 
     1470        undef, i, encodingLookup = {}, encodingItems; 
     1471 
     1472    settings = settings || {}; 
     1473 
     1474    encodingItems = '\\" \\\' \\; \\: ; : _'.split(' '); 
     1475    for (i = 0; i < encodingItems.length; i++) { 
     1476        encodingLookup[encodingItems[i]] = '_' + i; 
     1477        encodingLookup['_' + i] = encodingItems[i]; 
     1478    } 
     1479 
     1480    function toHex(match, r, g, b) { 
     1481        function hex(val) { 
     1482            val = parseInt(val).toString(16); 
     1483 
     1484            return val.length > 1 ? val : '0' + val; // 0 -> 00 
     1485        }; 
     1486 
     1487        return '#' + hex(r) + hex(g) + hex(b); 
     1488    }; 
     1489 
     1490    return { 
     1491        toHex : function(color) { 
     1492            return color.replace(rgbRegExp, toHex); 
     1493        }, 
     1494 
     1495        parse : function(css) { 
     1496            var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter; 
     1497 
     1498            function compress(prefix, suffix) { 
     1499                var top, right, bottom, left; 
     1500 
     1501                // Get values and check it it needs compressing 
     1502                top = styles[prefix + '-top' + suffix]; 
     1503                if (!top) 
     1504                    return; 
     1505 
     1506                right = styles[prefix + '-right' + suffix]; 
     1507                if (top != right) 
     1508                    return; 
     1509 
     1510                bottom = styles[prefix + '-bottom' + suffix]; 
     1511                if (right != bottom) 
     1512                    return; 
     1513 
     1514                left = styles[prefix + '-left' + suffix]; 
     1515                if (bottom != left) 
     1516                    return; 
     1517 
     1518                // Compress 
     1519                styles[prefix + suffix] = left; 
     1520                delete styles[prefix + '-top' + suffix]; 
     1521                delete styles[prefix + '-right' + suffix]; 
     1522                delete styles[prefix + '-bottom' + suffix]; 
     1523                delete styles[prefix + '-left' + suffix]; 
     1524            }; 
     1525 
     1526            function canCompress(key) { 
     1527                var value = styles[key], i; 
     1528 
     1529                if (!value || value.indexOf(' ') < 0) 
     1530                    return; 
     1531 
     1532                value = value.split(' '); 
     1533                i = value.length; 
     1534                while (i--) { 
     1535                    if (value[i] !== value[0]) 
     1536                        return false; 
     1537                } 
     1538 
     1539                styles[key] = value[0]; 
     1540 
     1541                return true; 
     1542            }; 
     1543 
     1544            function compress2(target, a, b, c) { 
     1545                if (!canCompress(a)) 
     1546                    return; 
     1547 
     1548                if (!canCompress(b)) 
     1549                    return; 
     1550 
     1551                if (!canCompress(c)) 
     1552                    return; 
     1553 
     1554                // Compress 
     1555                styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; 
     1556                delete styles[a]; 
     1557                delete styles[b]; 
     1558                delete styles[c]; 
     1559            }; 
     1560 
     1561            // Encodes the specified string by replacing all \" \' ; : with _<num> 
     1562            function encode(str) { 
     1563                isEncoded = true; 
     1564 
     1565                return encodingLookup[str]; 
     1566            }; 
     1567 
     1568            // Decodes the specified string by replacing all _<num> with it's original value \" \' etc 
     1569            // It will also decode the \" \' if keep_slashes is set to fale or omitted 
     1570            function decode(str, keep_slashes) { 
     1571                if (isEncoded) { 
     1572                    str = str.replace(/_[0-9]/g, function(str) { 
     1573                        return encodingLookup[str]; 
     1574                    }); 
     1575                } 
     1576 
     1577                if (!keep_slashes) 
     1578                    str = str.replace(/\\([\'\";:])/g, "$1"); 
     1579 
     1580                return str; 
     1581            } 
     1582 
     1583            if (css) { 
     1584                // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing 
     1585                css = css.replace(/\\[\"\';:_]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { 
     1586                    return str.replace(/[;:]/g, encode); 
     1587                }); 
     1588 
     1589                // Parse styles 
     1590                while (matches = styleRegExp.exec(css)) { 
     1591                    name = matches[1].replace(trimRightRegExp, '').toLowerCase(); 
     1592                    value = matches[2].replace(trimRightRegExp, ''); 
     1593 
     1594                    if (name && value.length > 0) { 
     1595                        // Opera will produce 700 instead of bold in their style values 
     1596                        if (name === 'font-weight' && value === '700') 
     1597                            value = 'bold'; 
     1598                        else if (name === 'color' || name === 'background-color') // Lowercase colors like RED 
     1599                            value = value.toLowerCase();         
     1600 
     1601                        // Convert RGB colors to HEX 
     1602                        value = value.replace(rgbRegExp, toHex); 
     1603 
     1604                        // Convert URLs and force them into url('value') format 
     1605                        value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { 
     1606                            str = str || str2; 
     1607 
     1608                            if (str) { 
     1609                                str = decode(str); 
     1610 
     1611                                // Force strings into single quote format 
     1612                                return "'" + str.replace(/\'/g, "\\'") + "'"; 
     1613                            } 
     1614 
     1615                            url = decode(url || url2 || url3); 
     1616 
     1617                            // Convert the URL to relative/absolute depending on config 
     1618                            if (urlConverter) 
     1619                                url = urlConverter(url, 'style'); 
     1620 
     1621                            // Output new URL format 
     1622                            return "url('" + url.replace(/\'/g, "\\'") + "')"; 
     1623                        }); 
     1624 
     1625                        styles[name] = isEncoded ? decode(value, true) : value; 
     1626                    } 
     1627 
     1628                    styleRegExp.lastIndex = matches.index + matches[0].length; 
     1629                } 
     1630 
     1631                // Compress the styles to reduce it's size for example IE will expand styles 
     1632                compress("border", ""); 
     1633                compress("border", "-width"); 
     1634                compress("border", "-color"); 
     1635                compress("border", "-style"); 
     1636                compress("padding", ""); 
     1637                compress("margin", ""); 
     1638                compress2('border', 'border-width', 'border-style', 'border-color'); 
     1639 
     1640                // Remove pointless border, IE produces these 
     1641                if (styles.border === 'medium none') 
     1642                    delete styles.border; 
     1643            } 
     1644 
     1645            return styles; 
     1646        }, 
     1647 
     1648        serialize : function(styles, element_name) { 
     1649            var css = '', name; 
     1650 
     1651            function serializeStyles(name) { 
     1652                var styleList, i, l, name, value; 
     1653 
     1654                styleList = schema.styles[name]; 
     1655                if (styleList) { 
     1656                    for (i = 0, l = styleList.length; i < l; i++) { 
     1657                        name = styleList[i]; 
     1658                        value = styles[name]; 
     1659 
     1660                        if (value !== undef) 
     1661                            css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; 
     1662                    } 
     1663                } 
     1664            }; 
     1665 
     1666            // Serialize styles according to schema 
     1667            if (element_name && schema && schema.styles) { 
     1668                // Serialize global styles and element specific styles 
     1669                serializeStyles('*'); 
     1670                serializeStyles(name); 
     1671            } else { 
     1672                // Output the styles in the order they are inside the object 
     1673                for (name in styles) 
     1674                    css += (css.length > 0 ? ' ' : '') + name + ': ' + styles[name] + ';'; 
     1675            } 
     1676 
     1677            return css; 
     1678        } 
     1679    }; 
     1680}; 
     1681 
     1682(function(tinymce) { 
     1683    var transitional = {}, boolAttrMap, blockElementsMap, emptyElementsMap, whiteSpaceElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; 
     1684 
     1685    function split(str, delim) { 
     1686        return str.split(delim || ','); 
     1687    }; 
     1688 
     1689    function unpack(lookup, data) { 
     1690        var key, elements = {}; 
     1691 
     1692        function replace(value) { 
     1693            return value.replace(/[A-Z]+/g, function(key) { 
     1694                return replace(lookup[key]); 
     1695            }); 
     1696        }; 
     1697 
     1698        // Unpack lookup 
     1699        for (key in lookup) { 
     1700            if (lookup.hasOwnProperty(key)) 
     1701                lookup[key] = replace(lookup[key]); 
     1702        } 
     1703 
     1704        // Unpack and parse data into object map 
     1705        replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { 
     1706            attributes = split(attributes, '|'); 
     1707 
     1708            elements[name] = { 
     1709                attributes : makeMap(attributes), 
     1710                attributesOrder : attributes, 
     1711                children : makeMap(children, '|', {'#comment' : {}}) 
     1712            } 
     1713        }); 
     1714 
     1715        return elements; 
     1716    }; 
     1717 
     1718    // Build a lookup table for block elements both lowercase and uppercase 
     1719    blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' +  
     1720                        'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' +  
     1721                        'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; 
     1722    blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); 
     1723 
     1724    // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size 
     1725    transitional = unpack({ 
     1726        Z : 'H|K|N|O|P', 
     1727        Y : 'X|form|R|Q', 
     1728        ZG : 'E|span|width|align|char|charoff|valign', 
     1729        X : 'p|T|div|U|W|isindex|fieldset|table', 
     1730        ZF : 'E|align|char|charoff|valign', 
     1731        W : 'pre|hr|blockquote|address|center|noframes', 
     1732        ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', 
     1733        ZD : '[E][S]', 
     1734        U : 'ul|ol|dl|menu|dir', 
     1735        ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', 
     1736        T : 'h1|h2|h3|h4|h5|h6', 
     1737        ZB : 'X|S|Q', 
     1738        S : 'R|P', 
     1739        ZA : 'a|G|J|M|O|P', 
     1740        R : 'a|H|K|N|O', 
     1741        Q : 'noscript|P', 
     1742        P : 'ins|del|script', 
     1743        O : 'input|select|textarea|label|button', 
     1744        N : 'M|L', 
     1745        M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', 
     1746        L : 'sub|sup', 
     1747        K : 'J|I', 
     1748        J : 'tt|i|b|u|s|strike', 
     1749        I : 'big|small|font|basefont', 
     1750        H : 'G|F', 
     1751        G : 'br|span|bdo', 
     1752        F : 'object|applet|img|map|iframe', 
     1753        E : 'A|B|C', 
     1754        D : 'accesskey|tabindex|onfocus|onblur', 
     1755        C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', 
     1756        B : 'lang|xml:lang|dir', 
     1757        A : 'id|class|style|title' 
     1758    }, 'script[id|charset|type|language|src|defer|xml:space][]' +  
     1759        'style[B|id|type|media|title|xml:space][]' +  
     1760        'object[E|declare|classid|codebase|data|type|codetype|archive|standby|height|width|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' +  
     1761        'param[id|name|value|valuetype|type][]' +  
     1762        'p[E|align][#|S]' +  
     1763        'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' +  
     1764        'br[A|clear][]' +  
     1765        'span[E][#|S]' +  
     1766        'bdo[A|C|B][#|S]' +  
     1767        'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' +  
     1768        'h1[E|align][#|S]' +  
     1769        'img[E|src|alt|name|longdesc|height|width|usemap|ismap|align|border|hspace|vspace][]' +  
     1770        'map[B|C|A|name][X|form|Q|area]' +  
     1771        'h2[E|align][#|S]' +  
     1772        'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|height|width][#|Y]' +  
     1773        'h3[E|align][#|S]' +  
     1774        'tt[E][#|S]' +  
     1775        'i[E][#|S]' +  
     1776        'b[E][#|S]' +  
     1777        'u[E][#|S]' +  
     1778        's[E][#|S]' +  
     1779        'strike[E][#|S]' +  
     1780        'big[E][#|S]' +  
     1781        'small[E][#|S]' +  
     1782        'font[A|B|size|color|face][#|S]' +  
     1783        'basefont[id|size|color|face][]' +  
     1784        'em[E][#|S]' +  
     1785        'strong[E][#|S]' +  
     1786        'dfn[E][#|S]' +  
     1787        'code[E][#|S]' +  
     1788        'q[E|cite][#|S]' +  
     1789        'samp[E][#|S]' +  
     1790        'kbd[E][#|S]' +  
     1791        'var[E][#|S]' +  
     1792        'cite[E][#|S]' +  
     1793        'abbr[E][#|S]' +  
     1794        'acronym[E][#|S]' +  
     1795        'sub[E][#|S]' +  
     1796        'sup[E][#|S]' +  
     1797        'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' +  
     1798        'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' +  
     1799        'optgroup[E|disabled|label][option]' +  
     1800        'option[E|selected|disabled|label|value][]' +  
     1801        'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' +  
     1802        'label[E|for|accesskey|onfocus|onblur][#|S]' +  
     1803        'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' +  
     1804        'h4[E|align][#|S]' +  
     1805        'ins[E|cite|datetime][#|Y]' +  
     1806        'h5[E|align][#|S]' +  
     1807        'del[E|cite|datetime][#|Y]' +  
     1808        'h6[E|align][#|S]' +  
     1809        'div[E|align][#|Y]' +  
     1810        'ul[E|type|compact][li]' +  
     1811        'li[E|type|value][#|Y]' +  
     1812        'ol[E|type|compact|start][li]' +  
     1813        'dl[E|compact][dt|dd]' +  
     1814        'dt[E][#|S]' +  
     1815        'dd[E][#|Y]' +  
     1816        'menu[E|compact][li]' +  
     1817        'dir[E|compact][li]' +  
     1818        'pre[E|width|xml:space][#|ZA]' +  
     1819        'hr[E|align|noshade|size|width][]' +  
     1820        'blockquote[E|cite][#|Y]' +  
     1821        'address[E][#|S|p]' +  
     1822        'center[E][#|Y]' +  
     1823        'noframes[E][#|Y]' +  
     1824        'isindex[A|B|prompt][]' +  
     1825        'fieldset[E][#|legend|Y]' +  
     1826        'legend[E|accesskey|align][#|S]' +  
     1827        'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' +  
     1828        'caption[E|align][#|S]' +  
     1829        'col[ZG][]' +  
     1830        'colgroup[ZG][col]' +  
     1831        'thead[ZF][tr]' +  
     1832        'tr[ZF|bgcolor][th|td]' +  
     1833        'th[E|ZE][#|Y]' +  
     1834        'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' +  
     1835        'noscript[E][#|Y]' +  
     1836        'td[E|ZE][#|Y]' +  
     1837        'tfoot[ZF][tr]' +  
     1838        'tbody[ZF][tr]' +  
     1839        'area[E|D|shape|coords|href|nohref|alt|target][]' +  
     1840        'base[id|href|target][]' +  
     1841        'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' 
     1842    ); 
     1843 
     1844    boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls'); 
     1845    emptyElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); 
     1846    whiteSpaceElementsMap = makeMap('pre,script,style'); 
     1847 
     1848    tinymce.html.Schema = function(settings) { 
     1849        var self = this, elements = {}, children = {}, patternElements = [], validStyles; 
     1850 
     1851        settings = settings || {}; 
     1852 
     1853        // Build styles list 
     1854        if (settings.valid_styles) { 
     1855            validStyles = {}; 
     1856 
     1857            // Convert styles into a rule list 
     1858            each(settings.valid_styles, function(value, key) { 
     1859                validStyles[key] = tinymce.explode(value); 
     1860            }); 
     1861        } 
     1862 
     1863        // Converts a wildcard expression string to a regexp for example *a will become /.*a/. 
     1864        function patternToRegExp(str) { 
     1865            return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); 
     1866        }; 
     1867 
     1868        // Parses the specified valid_elements string and adds to the current rules 
     1869        // This function is a bit hard to read since it's heavily optimized for speed 
     1870        function addValidElements(valid_elements) { 
     1871            var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, 
     1872                prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, 
     1873                elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, 
     1874                attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, 
     1875                hasPatternsRegExp = /[*?+]/; 
     1876 
     1877            if (valid_elements) { 
     1878                // Split valid elements into an array with rules 
     1879                valid_elements = split(valid_elements); 
     1880 
     1881                if (elements['@']) { 
     1882                    globalAttributes = elements['@'].attributes; 
     1883                    globalAttributesOrder = elements['@'].attributesOrder; 
     1884                } 
     1885 
     1886                // Loop all rules 
     1887                for (ei = 0, el = valid_elements.length; ei < el; ei++) { 
     1888                    // Parse element rule 
     1889                    matches = elementRuleRegExp.exec(valid_elements[ei]); 
     1890                    if (matches) { 
     1891                        // Setup local names for matches 
     1892                        prefix = matches[1]; 
     1893                        elementName = matches[2]; 
     1894                        outputName = matches[3]; 
     1895                        attrData = matches[4]; 
     1896 
     1897                        // Create new attributes and attributesOrder 
     1898                        attributes = {}; 
     1899                        attributesOrder = []; 
     1900 
     1901                        // Create the new element 
     1902                        element = { 
     1903                            attributes : attributes, 
     1904                            attributesOrder : attributesOrder 
     1905                        }; 
     1906 
     1907                        // Padd empty elements prefix 
     1908                        if (prefix === '#') 
     1909                            element.paddEmpty = true; 
     1910 
     1911                        // Remove empty elements prefix 
     1912                        if (prefix === '-') 
     1913                            element.removeEmpty = true; 
     1914 
     1915                        // Copy attributes from global rule into current rule 
     1916                        if (globalAttributes) { 
     1917                            for (key in globalAttributes) 
     1918                                attributes[key] = globalAttributes[key]; 
     1919 
     1920                            attributesOrder.push.apply(attributesOrder, globalAttributesOrder); 
     1921                        } 
     1922 
     1923                        // Attributes defined 
     1924                        if (attrData) { 
     1925                            attrData = split(attrData, '|'); 
     1926                            for (ai = 0, al = attrData.length; ai < al; ai++) { 
     1927                                matches = attrRuleRegExp.exec(attrData[ai]); 
     1928                                if (matches) { 
     1929                                    attr = {}; 
     1930                                    attrType = matches[1]; 
     1931                                    attrName = matches[2].replace(/::/g, ':'); 
     1932                                    prefix = matches[3]; 
     1933                                    value = matches[4]; 
     1934 
     1935                                    // Required 
     1936                                    if (attrType === '!') { 
     1937                                        element.attributesRequired = element.attributesRequired || []; 
     1938                                        element.attributesRequired.push(attrName); 
     1939                                        attr.required = true; 
     1940                                    } 
     1941 
     1942                                    // Denied from global 
     1943                                    if (attrType === '-') { 
     1944                                        delete attributes[attrName]; 
     1945                                        attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); 
     1946                                        continue; 
     1947                                    } 
     1948 
     1949                                    // Default value 
     1950                                    if (prefix) { 
     1951                                        // Default value 
     1952                                        if (prefix === '=') { 
     1953                                            element.attributesDefault = element.attributesDefault || []; 
     1954                                            element.attributesDefault.push({name: attrName, value: value}); 
     1955                                            attr.defaultValue = value; 
     1956                                        } 
     1957 
     1958                                        // Forced value 
     1959                                        if (prefix === ':') { 
     1960                                            element.attributesForced = element.attributesForced || []; 
     1961                                            element.attributesForced.push({name: attrName, value: value}); 
     1962                                            attr.forcedValue = value; 
     1963                                        } 
     1964 
     1965                                        // Required values 
     1966                                        if (prefix === '<') 
     1967                                            attr.validValues = makeMap(value, '?'); 
     1968                                    } 
     1969 
     1970                                    // Check for attribute patterns 
     1971                                    if (hasPatternsRegExp.test(attrName)) { 
     1972                                        element.attributePatterns = element.attributePatterns || []; 
     1973                                        attr.pattern = patternToRegExp(attrName); 
     1974                                        element.attributePatterns.push(attr); 
     1975                                    } else { 
     1976                                        // Add attribute to order list if it doesn't already exist 
     1977                                        if (!attributes[attrName]) 
     1978                                            attributesOrder.push(attrName); 
     1979 
     1980                                        attributes[attrName] = attr; 
     1981                                    } 
     1982                                } 
     1983                            } 
     1984                        } 
     1985 
     1986                        // Global rule, store away these for later usage 
     1987                        if (!globalAttributes && elementName == '@') { 
     1988                            globalAttributes = attributes; 
     1989                            globalAttributesOrder = attributesOrder; 
     1990                        } 
     1991 
     1992                        // Handle substitute elements such as b/strong 
     1993                        if (outputName) { 
     1994                            element.outputName = elementName; 
     1995                            elements[outputName] = element; 
     1996                        } 
     1997 
     1998                        // Add pattern or exact element 
     1999                        if (hasPatternsRegExp.test(elementName)) { 
     2000                            element.pattern = patternToRegExp(elementName); 
     2001                            patternElements.push(element); 
     2002                        } else 
     2003                            elements[elementName] = element; 
     2004                    } 
     2005                } 
     2006            } 
     2007        }; 
     2008 
     2009        function setValidElements(valid_elements) { 
     2010            elements = {}; 
     2011            patternElements = []; 
     2012 
     2013            addValidElements(valid_elements); 
     2014 
     2015            each(transitional, function(element, name) { 
     2016                children[name] = element.children; 
     2017            }); 
     2018        }; 
     2019 
     2020        // Adds custom non HTML elements to the schema 
     2021        function addCustomElements(custom_elements) { 
     2022            var customElementRegExp = /^(~)?(.+)$/; 
     2023 
     2024            if (custom_elements) { 
     2025                each(split(custom_elements), function(rule) { 
     2026                    var matches = customElementRegExp.exec(rule), 
     2027                        cloneName = matches[1] === '~' ? 'span' : 'div', 
     2028                        name = matches[2]; 
     2029 
     2030                    children[name] = children[cloneName]; 
     2031 
     2032                    // Add custom elements at span/div positions 
     2033                    each(children, function(element, child) { 
     2034                        if (element[cloneName]) 
     2035                            element[name] = element[cloneName]; 
     2036                    }); 
     2037                }); 
     2038            } 
     2039        }; 
     2040 
     2041        // Adds valid children to the schema object 
     2042        function addValidChildren(valid_children) { 
     2043            var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; 
     2044 
     2045            if (valid_children) { 
     2046                each(split(valid_children), function(rule) { 
     2047                    var matches = childRuleRegExp.exec(rule), parent, prefix; 
     2048 
     2049                    if (matches) { 
     2050                        prefix = matches[1]; 
     2051 
     2052                        // Add/remove items from default 
     2053                        if (prefix) 
     2054                            parent = children[matches[2]]; 
     2055                        else 
     2056                            parent = children[matches[2]] = {'#comment' : {}}; 
     2057 
     2058                        parent = children[matches[2]]; 
     2059 
     2060                        each(split(matches[3], '|'), function(child) { 
     2061                            if (prefix === '-') 
     2062                                delete parent[child]; 
     2063                            else 
     2064                                parent[child] = {}; 
     2065                        }); 
     2066                    } 
     2067                }); 
     2068            } 
     2069        } 
     2070 
     2071        if (!settings.valid_elements) { 
     2072            // No valid elements defined then clone the elements from the transitional spec 
     2073            each(transitional, function(element, name) { 
     2074                elements[name] = { 
     2075                    attributes : element.attributes, 
     2076                    attributesOrder : element.attributesOrder 
     2077                }; 
     2078 
     2079                children[name] = element.children; 
     2080            }); 
     2081 
     2082            // Switch these 
     2083            each(split('strong/b,em/i'), function(item) { 
     2084                item = split(item, '/'); 
     2085                elements[item[1]].outputName = item[0]; 
     2086            }); 
     2087 
     2088            // Add default alt attribute for images 
     2089            elements.img.attributesDefault = [{name: 'alt', value: ''}]; 
     2090 
     2091            // Remove these if they are empty by default 
     2092            each(split('ol,ul,li,sub,sup,blockquote,tr,div,span,font,a,table,tbody'), function(name) { 
     2093                elements[name].removeEmpty = true; 
     2094            }); 
     2095 
     2096            // Padd these by default 
     2097            each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { 
     2098                elements[name].paddEmpty = true; 
     2099            }); 
     2100        } else 
     2101            setValidElements(settings.valid_elements); 
     2102 
     2103        addCustomElements(settings.custom_elements); 
     2104        addValidChildren(settings.valid_children); 
     2105        addValidElements(settings.extended_valid_elements); 
     2106 
     2107        // Todo: Remove this when we fix list handling to be valid 
     2108        addValidChildren('+ol[ul|ol],+ul[ul|ol]'); 
     2109 
     2110        // Delete invalid elements 
     2111        if (settings.invalid_elements) { 
     2112            tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { 
     2113                if (elements[item]) 
     2114                    delete elements[item]; 
     2115            }); 
     2116        } 
     2117 
     2118        self.children = children; 
     2119 
     2120        self.styles = validStyles; 
     2121 
     2122        self.getBoolAttrs = function() { 
     2123            return boolAttrMap; 
     2124        }; 
     2125 
     2126        self.getBlockElements = function() { 
     2127            return blockElementsMap; 
     2128        }; 
     2129 
     2130        self.getEmptyElements = function() { 
     2131            return emptyElementsMap; 
     2132        }; 
     2133 
     2134        self.getWhiteSpaceElements = function() { 
     2135            return whiteSpaceElementsMap; 
     2136        }; 
     2137 
     2138        self.isValidChild = function(name, child) { 
     2139            var parent = children[name]; 
     2140 
     2141            return !!(parent && parent[child]); 
     2142        }; 
     2143 
     2144        self.getElementRule = function(name) { 
     2145            var element = elements[name], i; 
     2146 
     2147            // Exact match found 
     2148            if (element) 
     2149                return element; 
     2150 
     2151            // No exact match then try the patterns 
     2152            i = patternElements.length; 
     2153            while (i--) { 
     2154                element = patternElements[i]; 
     2155 
     2156                if (element.pattern.test(name)) 
     2157                    return element; 
     2158            } 
     2159        }; 
     2160 
     2161        self.addValidElements = addValidElements; 
     2162 
     2163        self.setValidElements = setValidElements; 
     2164 
     2165        self.addCustomElements = addCustomElements; 
     2166 
     2167        self.addValidChildren = addValidChildren; 
     2168    }; 
     2169 
     2170    // Expose boolMap and blockElementMap as static properties for usage in DOMUtils 
     2171    tinymce.html.Schema.boolAttrMap = boolAttrMap; 
     2172    tinymce.html.Schema.blockElementsMap = blockElementsMap; 
     2173})(tinymce); 
     2174 
     2175(function(tinymce) { 
     2176    tinymce.html.SaxParser = function(settings, schema) { 
     2177        var self = this, noop = function() {}; 
     2178 
     2179        settings = settings || {}; 
     2180        self.schema = schema = schema || new tinymce.html.Schema(); 
     2181 
     2182        // Add handler functions from settings and setup default handlers 
     2183        tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { 
     2184            if (name) 
     2185                self[name] = settings[name] || noop; 
     2186        }); 
     2187 
     2188        self.parse = function(html) { 
     2189            var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, pos, i, text, 
     2190                emptyElmMap, fillAttrsMap, isEmpty, validate, elementRule, isValidElement, attr, attribsValue, 
     2191                validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, 
     2192                tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode; 
     2193 
     2194            // Precompile RegExps and map objects 
     2195            tokenRegExp = new RegExp('<(?:' + 
     2196                '(?:!--([\\w\\W]*?)-->)|' + // Comment 
     2197                '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA 
     2198                '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE 
     2199                '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI 
     2200                '(?:\\/([^>]+)>)|' + // End element 
     2201                '(?:([^\\s\\/<>]+)\\s*((?:[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]+))*)>)' + // Start element 
     2202            ')', 'g'); 
     2203 
     2204            attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; 
     2205            specialElements = { 
     2206                'script' : /<\/script[^>]*>/gi, 
     2207                'style' : /<\/style[^>]*>/gi, 
     2208                'noscript' : /<\/noscript[^>]*>/gi 
     2209            }; 
     2210 
     2211            // Setup lookup tables for empty elements and boolean attributes 
     2212            emptyElmMap = schema.getEmptyElements(); 
     2213            fillAttrsMap = schema.getBoolAttrs(); 
     2214            validate = settings.validate; 
     2215 
     2216            while (matches = tokenRegExp.exec(html)) { 
     2217                // Text 
     2218                if (index < matches.index) 
     2219                    self.text(decode(html.substr(index, matches.index - index))); 
     2220 
     2221                if (value = matches[6]) { // End element 
     2222                    value = value.toLowerCase(); 
     2223 
     2224                    // Find position of parent of the same type 
     2225                    pos = stack.length; 
     2226                    while (pos--) { 
     2227                        if (stack[pos].name === value) 
     2228                            break;                       
     2229                    } 
     2230 
     2231                    // Found parent 
     2232                    if (pos >= 0) { 
     2233                        // Close all the open elements 
     2234                        for (i = stack.length - 1; i >= pos; i--) { 
     2235                            value = stack[i]; 
     2236 
     2237                            if (value.valid) 
     2238                                self.end(value.name); 
     2239                        } 
     2240 
     2241                        // Remove the open elements from the stack 
     2242                        stack.length = pos; 
     2243                    } 
     2244                } else if (value = matches[7]) { // Start element 
     2245                    value = value.toLowerCase(); 
     2246                    isEmpty = value in emptyElmMap; 
     2247 
     2248                    // Validate element 
     2249                    if (!validate || (elementRule = schema.getElementRule(value))) { 
     2250                        isValidElement = true; 
     2251 
     2252                        // Grab attributes map and patters when validation is enabled 
     2253                        if (validate) { 
     2254                            validAttributesMap = elementRule.attributes; 
     2255                            validAttributePatterns = elementRule.attributePatterns; 
     2256                        } 
     2257 
     2258                        // Parse attributes 
     2259                        if (attribsValue = matches[8]) { 
     2260                            attrList = []; 
     2261                            attrList.map = {}; 
     2262 
     2263                            attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { 
     2264                                var attrRule, i; 
     2265 
     2266                                name = name.toLowerCase(); 
     2267                                value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute 
     2268 
     2269                                // Validate name and value 
     2270                                if (validate && name.indexOf('data-') !== 0) { 
     2271                                    attrRule = validAttributesMap[name]; 
     2272 
     2273                                    // Find rule by pattern matching 
     2274                                    if (!attrRule && validAttributePatterns) { 
     2275                                        i = validAttributePatterns.length; 
     2276                                        while (i--) { 
     2277                                            attrRule = validAttributePatterns[i]; 
     2278                                            if (attrRule.pattern.test(name)) 
     2279                                                break; 
     2280                                        } 
     2281 
     2282                                        // No rule matched 
     2283                                        if (i === -1) 
     2284                                            attrRule = null; 
     2285                                    } 
     2286 
     2287                                    // No attribute rule found 
     2288                                    if (!attrRule) 
     2289                                        return; 
     2290 
     2291                                    // Validate value 
     2292                                    if (attrRule.validValues && !(value in attrRule.validValues)) 
     2293                                        return; 
     2294                                } 
     2295 
     2296                                // Add attribute to list and map 
     2297                                attrList.map[name] = value; 
     2298                                attrList.push({ 
     2299                                    name: name, 
     2300                                    value: value 
     2301                                }); 
     2302                            }); 
     2303                        } else { 
     2304                            attrList = []; 
     2305                            attrList.map = {}; 
     2306                        } 
     2307 
     2308                        // Process attributes if validation is enabled 
     2309                        if (validate) { 
     2310                            attributesRequired = elementRule.attributesRequired; 
     2311                            attributesDefault = elementRule.attributesDefault; 
     2312                            attributesForced = elementRule.attributesForced; 
     2313 
     2314                            // Handle forced attributes 
     2315                            if (attributesForced) { 
     2316                                i = attributesForced.length; 
     2317                                while (i--) { 
     2318                                    attr = attributesForced[i]; 
     2319                                    name = attr.name; 
     2320                                    attrValue = attr.value; 
     2321 
     2322                                    if (attrValue === '{$uid}') 
     2323                                        attrValue = 'mce_' + idCount++; 
     2324 
     2325                                    attrList.map[name] = attrValue; 
     2326                                    attrList.push({name: name, value: attrValue}); 
     2327                                } 
     2328                            } 
     2329 
     2330                            // Handle default attributes 
     2331                            if (attributesDefault) { 
     2332                                i = attributesDefault.length; 
     2333                                while (i--) { 
     2334                                    attr = attributesDefault[i]; 
     2335                                    name = attr.name; 
     2336 
     2337                                    if (!(name in attrList.map)) { 
     2338                                        attrValue = attr.value; 
     2339 
     2340                                        if (attrValue === '{$uid}') 
     2341                                            attrValue = 'mce_' + idCount++; 
     2342 
     2343                                        attrList.map[name] = attrValue; 
     2344                                        attrList.push({name: name, value: attrValue}); 
     2345                                    } 
     2346                                } 
     2347                            } 
     2348 
     2349                            // Handle required attributes 
     2350                            if (attributesRequired) { 
     2351                                i = attributesRequired.length; 
     2352                                while (i--) { 
     2353                                    if (attributesRequired[i] in attrList.map) 
     2354                                        break; 
     2355                                } 
     2356 
     2357                                // None of the required attributes where found 
     2358                                if (i === -1) 
     2359                                    isValidElement = false; 
     2360                            } 
     2361                        } 
     2362 
     2363                        if (isValidElement) 
     2364                            self.start(value, attrList, isEmpty); 
     2365                    } else 
     2366                        isValidElement = false; 
     2367 
     2368                    // Treat script, noscript and style a bit different since they may include code that looks like elements 
     2369                    if (endRegExp = specialElements[value]) { 
     2370                        endRegExp.lastIndex = index = matches.index + matches[0].length; 
     2371 
     2372                        if (matches = endRegExp.exec(html)) { 
     2373                            if (isValidElement) 
     2374                                text = html.substr(index, matches.index - index); 
     2375 
     2376                            index = matches.index + matches[0].length; 
     2377                        } else { 
     2378                            text = html.substr(index); 
     2379                            index = html.length; 
     2380                        } 
     2381 
     2382                        if (isValidElement && text.length > 0) 
     2383                            self.text(text, true); 
     2384 
     2385                        if (isValidElement) 
     2386                            self.end(value); 
     2387 
     2388                        tokenRegExp.lastIndex = index; 
     2389                        continue; 
     2390                    } 
     2391 
     2392                    // Push value on to stack 
     2393                    if (!isEmpty) { 
     2394                        if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) 
     2395                            stack.push({name: value, valid: isValidElement}); 
     2396                        else if (isValidElement) 
     2397                            self.end(value); 
     2398                    } 
     2399                } else if (value = matches[1]) { // Comment 
     2400                    self.comment(value); 
     2401                } else if (value = matches[2]) { // CDATA 
     2402                    self.cdata(value); 
     2403                } else if (value = matches[3]) { // DOCTYPE 
     2404                    self.doctype(value); 
     2405                } else if (value = matches[4]) { // PI 
     2406                    self.pi(value, matches[5]); 
     2407                } 
     2408 
     2409                index = matches.index + matches[0].length; 
     2410            } 
     2411 
     2412            // Text 
     2413            if (index < html.length) 
     2414                self.text(decode(html.substr(index))); 
     2415 
     2416            // Close any open elements 
     2417            for (i = stack.length - 1; i >= 0; i--) { 
     2418                value = stack[i]; 
     2419 
     2420                if (value.valid) 
     2421                    self.end(value.name); 
     2422            } 
     2423        }; 
     2424    } 
     2425})(tinymce); 
     2426 
     2427(function(tinymce) { 
     2428    var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { 
     2429        '#text' : 3, 
     2430        '#comment' : 8, 
     2431        '#cdata' : 4, 
     2432        '#pi' : 7, 
     2433        '#doctype' : 10, 
     2434        '#document-fragment' : 11 
     2435    }; 
     2436 
     2437    // Walks the tree left/right 
     2438    function walk(node, root_node, prev) { 
     2439        var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; 
     2440 
     2441        // Walk into nodes if it has a start 
     2442        if (node[startName]) 
     2443            return node[startName]; 
     2444 
     2445        // Return the sibling if it has one 
     2446        if (node !== root_node) { 
     2447            sibling = node[siblingName]; 
     2448 
     2449            if (sibling) 
     2450                return sibling; 
     2451 
     2452            // Walk up the parents to look for siblings 
     2453            for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { 
     2454                sibling = parent[siblingName]; 
     2455 
     2456                if (sibling) 
     2457                    return sibling; 
     2458            } 
     2459        } 
     2460    }; 
     2461 
     2462    function Node(name, type) { 
     2463        this.name = name; 
     2464        this.type = type; 
     2465 
     2466        if (type === 1) { 
     2467            this.attributes = []; 
     2468            this.attributes.map = {}; 
     2469        } 
     2470    } 
     2471 
     2472    tinymce.extend(Node.prototype, { 
     2473        replace : function(node) { 
     2474            var self = this; 
     2475 
     2476            if (node.parent) 
     2477                node.remove(); 
     2478 
     2479            self.insert(node, self); 
     2480            self.remove(); 
     2481 
     2482            return self; 
     2483        }, 
     2484 
     2485        attr : function(name, value) { 
     2486            var self = this, attrs, i, undef; 
     2487 
     2488            if (typeof name !== "string") { 
     2489                for (i in name) 
     2490                    self.attr(i, name[i]); 
     2491 
     2492                return self; 
     2493            } 
     2494 
     2495            if (attrs = self.attributes) { 
     2496                if (value !== undef) { 
     2497                    // Remove attribute 
     2498                    if (value === null) { 
     2499                        if (name in attrs.map) { 
     2500                            delete attrs.map[name]; 
     2501 
     2502                            i = attrs.length; 
     2503                            while (i--) { 
     2504                                if (attrs[i].name === name) { 
     2505                                    attrs = attrs.splice(i, 1); 
     2506                                    return self; 
     2507                                } 
     2508                            } 
     2509                        } 
     2510 
     2511                        return self; 
     2512                    } 
     2513 
     2514                    // Set attribute 
     2515                    if (name in attrs.map) { 
     2516                        // Set attribute 
     2517                        i = attrs.length; 
     2518                        while (i--) { 
     2519                            if (attrs[i].name === name) { 
     2520                                attrs[i].value = value; 
     2521                                break; 
     2522                            } 
     2523                        } 
     2524                    } else 
     2525                        attrs.push({name: name, value: value}); 
     2526 
     2527                    attrs.map[name] = value; 
     2528 
     2529                    return self; 
     2530                } else { 
     2531                    return attrs.map[name]; 
     2532                } 
     2533            } 
     2534        }, 
     2535 
     2536        clone : function() { 
     2537            var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; 
     2538 
     2539            // Clone element attributes 
     2540            if (selfAttrs = self.attributes) { 
     2541                cloneAttrs = []; 
     2542                cloneAttrs.map = {}; 
     2543 
     2544                for (i = 0, l = selfAttrs.length; i < l; i++) { 
     2545                    selfAttr = selfAttrs[i]; 
     2546 
     2547                    // Clone everything except id 
     2548                    if (selfAttr.name !== 'id') { 
     2549                        cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; 
     2550                        cloneAttrs.map[selfAttr.name] = selfAttr.value; 
     2551                    } 
     2552                } 
     2553 
     2554                clone.attributes = cloneAttrs; 
     2555            } 
     2556 
     2557            clone.value = self.value; 
     2558            clone.empty = self.empty; 
     2559 
     2560            return clone; 
     2561        }, 
     2562 
     2563        wrap : function(wrapper) { 
     2564            var self = this; 
     2565 
     2566            self.parent.insert(wrapper, self); 
     2567            wrapper.append(self); 
     2568 
     2569            return self; 
     2570        }, 
     2571 
     2572        unwrap : function() { 
     2573            var self = this, node, next; 
     2574 
     2575            for (node = self.firstChild; node; ) { 
     2576                next = node.next; 
     2577                self.insert(node, self, true); 
     2578                node = next; 
     2579            } 
     2580 
     2581            self.remove(); 
     2582        }, 
     2583 
     2584        remove : function() { 
     2585            var self = this, parent = self.parent, next = self.next, prev = self.prev; 
     2586 
     2587            if (parent) { 
     2588                if (parent.firstChild === self) { 
     2589                    parent.firstChild = next; 
     2590 
     2591                    if (next) 
     2592                        next.prev = null; 
     2593                } else { 
     2594                    prev.next = next; 
     2595                } 
     2596 
     2597                if (parent.lastChild === self) { 
     2598                    parent.lastChild = prev; 
     2599 
     2600                    if (prev) 
     2601                        prev.next = null; 
     2602                } else { 
     2603                    next.prev = prev; 
     2604                } 
     2605 
     2606                self.parent = self.next = self.prev = null; 
     2607            } 
     2608 
     2609            return self; 
     2610        }, 
     2611 
     2612        append : function(node) { 
     2613            var self = this, last; 
     2614 
     2615            if (node.parent) 
     2616                node.remove(); 
     2617 
     2618            last = self.lastChild; 
     2619            if (last) { 
     2620                last.next = node; 
     2621                node.prev = last; 
     2622                self.lastChild = node; 
     2623            } else 
     2624                self.lastChild = self.firstChild = node; 
     2625 
     2626            node.parent = self; 
     2627 
     2628            return node; 
     2629        }, 
     2630 
     2631        insert : function(node, ref_node, before) { 
     2632            var parent; 
     2633 
     2634            if (node.parent) 
     2635                node.remove(); 
     2636 
     2637            parent = ref_node.parent || this; 
     2638 
     2639            if (before) { 
     2640                if (ref_node === parent.firstChild) 
     2641                    parent.firstChild = node; 
     2642                else 
     2643                    ref_node.prev.next = node; 
     2644 
     2645                node.prev = ref_node.prev; 
     2646                node.next = ref_node; 
     2647                ref_node.prev = node; 
     2648            } else { 
     2649                if (ref_node === parent.lastChild) 
     2650                    parent.lastChild = node; 
     2651                else 
     2652                    ref_node.next.prev = node; 
     2653 
     2654                node.next = ref_node.next; 
     2655                node.prev = ref_node; 
     2656                ref_node.next = node; 
     2657            } 
     2658 
     2659            node.parent = parent; 
     2660 
     2661            return node; 
     2662        }, 
     2663 
     2664        getAll : function(name) { 
     2665            var self = this, node, collection = []; 
     2666 
     2667            for (node = self.firstChild; node; node = walk(node, self)) { 
     2668                if (node.name === name) 
     2669                    collection.push(node); 
     2670            } 
     2671 
     2672            return collection; 
     2673        }, 
     2674 
     2675        empty : function() { 
     2676            var self = this, nodes, i, node; 
     2677 
     2678            // Remove all children 
     2679            if (self.firstChild) { 
     2680                nodes = []; 
     2681 
     2682                // Collect the children 
     2683                for (node = self.firstChild; node; node = walk(node, self)) 
     2684                    nodes.push(node); 
     2685 
     2686                // Remove the children 
     2687                i = nodes.length; 
     2688                while (i--) { 
     2689                    node = nodes[i]; 
     2690                    node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; 
     2691                } 
     2692            } 
     2693 
     2694            self.firstChild = self.lastChild = null; 
     2695 
     2696            return self; 
     2697        }, 
     2698 
     2699        isEmpty : function(elements) { 
     2700            var self = this, node = self, i; 
     2701 
     2702            do { 
     2703                if (node.type === 1) { 
     2704                    // Keep empty elements like <img /> 
     2705                    if (elements[node.name]) 
     2706                        return false; 
     2707 
     2708                    // Keep elements with data attributes 
     2709                    i = node.attributes.length; 
     2710                    while (i--) { 
     2711                        if (node.attributes[i].name.indexOf('data-') === 0) 
     2712                            return false; 
     2713                    } 
     2714                } 
     2715 
     2716                // Keep non whitespace text nodes 
     2717                if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) 
     2718                    return false; 
     2719            } while (node = walk(node, self)); 
     2720 
     2721            return true; 
     2722        } 
     2723    }); 
     2724 
     2725    tinymce.extend(Node, { 
     2726        create : function(name, attrs) { 
     2727            var node, attrName; 
     2728 
     2729            // Create node 
     2730            node = new Node(name, typeLookup[name] || 1); 
     2731 
     2732            // Add attributes if needed 
     2733            if (attrs) { 
     2734                for (attrName in attrs) 
     2735                    node.attr(attrName, attrs[attrName]); 
     2736            } 
     2737 
     2738            return node; 
     2739        } 
     2740    }); 
     2741 
     2742    tinymce.html.Node = Node; 
     2743})(tinymce); 
     2744 
     2745(function(tinymce) { 
     2746    var Node = tinymce.html.Node; 
     2747 
     2748    tinymce.html.DomParser = function(settings, schema) { 
     2749        var self = this, nodeFilters = {}, attributeFilters = []; 
     2750 
     2751        settings = settings || {}; 
     2752        settings.root_name = settings.root_name || 'body'; 
     2753        self.schema = schema = schema || new tinymce.html.Schema(); 
     2754 
     2755        function fixInvalidChildren(nodes) { 
     2756            var ni, node, parent, parents, newParent, currentNode, tempNode, 
     2757                childClone, emptyElements = schema.getEmptyElements(), nonSplitableElements, sibling; 
     2758 
     2759            nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); 
     2760 
     2761            for (ni = 0; ni < nodes.length; ni++) { 
     2762                node = nodes[ni]; 
     2763 
     2764                // Already removed 
     2765                if (!node.parent) 
     2766                    continue; 
     2767 
     2768                // Get list of all parent nodes until we find a valid parent to stick the child into 
     2769                parents = [node]; 
     2770                for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) 
     2771                    parents.push(parent); 
     2772 
     2773                // Found a suitable parent 
     2774                if (parent && parents.length > 1) { 
     2775                    // Reverse the array since it makes looping easier 
     2776                    parents.reverse(); 
     2777 
     2778                    // Clone the related parent and insert that after the moved node 
     2779                    newParent = currentNode = parents[0].clone(); 
     2780 
     2781                    // Start cloning and moving children on the left side of the target node 
     2782                    for (i = 0; i < parents.length - 1; i++) { 
     2783                        if (schema.isValidChild(currentNode.name, parents[i].name)) { 
     2784                            tempNode = parents[i].clone(); 
     2785                            currentNode.append(tempNode); 
     2786                        } else 
     2787                            tempNode = currentNode; 
     2788 
     2789                        for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; childNode = childNode.next) { 
     2790                            tempNode.append(childNode); 
     2791                        } 
     2792 
     2793                        currentNode = tempNode; 
     2794                    } 
     2795 
     2796                    if (!newParent.isEmpty(emptyElements)) { 
     2797                        parent.insert(newParent, parents[0], true); 
     2798                        parent.insert(node, newParent); 
     2799                    } else { 
     2800                        parent.insert(node, parents[0], true); 
     2801                    } 
     2802 
     2803                    if (parents[0].isEmpty(emptyElements)) { 
     2804                        parents[0].empty().remove(); 
     2805                    } 
     2806                } else if (node.parent) { 
     2807                    // If it's an LI try to find a UL/OL for it or wrap it 
     2808                    if (node.name === 'li') { 
     2809                        sibling = node.prev; 
     2810                        if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { 
     2811                            sibling.append(node); 
     2812                            continue; 
     2813                        } 
     2814 
     2815                        sibling = node.next; 
     2816                        if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { 
     2817                            sibling.insert(node, sibling.firstChild, true); 
     2818                            continue; 
     2819                        } 
     2820 
     2821                        node.wrap(new Node('ul', 1)); 
     2822                        continue; 
     2823                    } 
     2824 
     2825                    // Try wrapping the element in a DIV 
     2826                    if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { 
     2827                        node.wrap(new Node('div', 1)); 
     2828                    } else { 
     2829                        // We failed wrapping it, then remove or unwrap it 
     2830                        if (node.name === 'style' || node.name === 'script') 
     2831                            node.empty().remove(); 
     2832                        else 
     2833                            node.unwrap(); 
     2834                    } 
     2835                } 
     2836            } 
     2837        } 
     2838 
     2839        self.addNodeFilter = function(name, callback) { 
     2840            tinymce.each(tinymce.explode(name), function(name) { 
     2841                var list = nodeFilters[name]; 
     2842 
     2843                if (!list) 
     2844                    nodeFilters[name] = list = []; 
     2845 
     2846                list.push(callback); 
     2847            }); 
     2848        }; 
     2849 
     2850        self.addAttributeFilter = function(name, callback) { 
     2851            tinymce.each(tinymce.explode(name), function(name) { 
     2852                var i; 
     2853 
     2854                for (i = 0; i < attributeFilters.length; i++) { 
     2855                    if (attributeFilters[i].name === name) { 
     2856                        attributeFilters[i].callbacks.push(callback); 
     2857                        return; 
     2858                    } 
     2859                } 
     2860 
     2861                attributeFilters.push({name: name, callbacks: [callback]}); 
     2862            }); 
     2863        }; 
     2864 
     2865        self.parse = function(html, args) { 
     2866            var parser, rootNode, node, nodes, matchedNodes = {}, matchedAttributes = {}, 
     2867                i, l, fi, fl, list, name, blockElements, startWhiteSpaceRegExp, invalidChildren = [], 
     2868                endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children; 
     2869 
     2870            args = args || {}; 
     2871            blockElements = tinymce.extend(tinymce.makeMap('script,style,head,title,meta,param'), schema.getBlockElements()); 
     2872            children = schema.children; 
     2873 
     2874            whiteSpaceElements = schema.getWhiteSpaceElements(); 
     2875            startWhiteSpaceRegExp = /^[ \t\r\n]+/; 
     2876            endWhiteSpaceRegExp = /[ \t\r\n]+$/; 
     2877            allWhiteSpaceRegExp = /[ \t\r\n]+/g; 
     2878 
     2879            function createNode(name, type) { 
     2880                var node = new Node(name, type), list; 
     2881 
     2882                if (name in nodeFilters) { 
     2883                    list = matchedNodes[name]; 
     2884 
     2885                    if (list) 
     2886                        list.push(node); 
     2887                    else 
     2888                        matchedNodes[name] = [node]; 
     2889                } 
     2890 
     2891                return node; 
     2892            } 
     2893 
     2894            parser = new tinymce.html.SaxParser({ 
     2895                validate : settings.validate, 
     2896 
     2897                cdata: function(text) { 
     2898                    node.append(createNode('#cdata', 4)).value = text; 
     2899                }, 
     2900 
     2901                text: function(text, raw) { 
     2902                    var textNode; 
     2903 
     2904                    // Trim all redundant whitespace on non white space elements 
     2905                    if (!whiteSpaceElements[node.name]) { 
     2906                        text = text.replace(allWhiteSpaceRegExp, ' '); 
     2907 
     2908                        if (node.lastChild && blockElements[node.lastChild.name]) 
     2909                            text = text.replace(startWhiteSpaceRegExp, ''); 
     2910                    } 
     2911 
     2912                    // Do we need to create the node 
     2913                    if (text.length !== 0) { 
     2914                        textNode = createNode('#text', 3); 
     2915                        textNode.raw = !!raw; 
     2916                        node.append(textNode).value = text; 
     2917                    } 
     2918                }, 
     2919 
     2920                comment: function(text) { 
     2921                    node.append(createNode('#comment', 8)).value = text; 
     2922                }, 
     2923 
     2924                pi: function(name, text) { 
     2925                    node.append(createNode(name, 7)).value = text; 
     2926                }, 
     2927 
     2928                doctype: function(text) { 
     2929                    node.append(createNode('#doctype', 10)).value = text; 
     2930                }, 
     2931 
     2932                start: function(name, attrs, empty) { 
     2933                    var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; 
     2934 
     2935                    elementRule = schema.getElementRule(name); 
     2936                    if (elementRule) { 
     2937                        newNode = createNode(elementRule.outputName || name, 1); 
     2938                        newNode.attributes = attrs; 
     2939                        newNode.shortEnded = empty; 
     2940 
     2941                        node.append(newNode); 
     2942 
     2943                        // Check if node is valid child of the parent node is the child is 
     2944                        // unknown we don't collect it since it's probably a custom element 
     2945                        parent = children[node.name]; 
     2946                        if (parent && children[newNode.name] && !parent[newNode.name]) 
     2947                            invalidChildren.push(newNode); 
     2948 
     2949                        attrFiltersLen = attributeFilters.length; 
     2950                        while (attrFiltersLen--) { 
     2951                            attrName = attributeFilters[attrFiltersLen].name; 
     2952 
     2953                            if (attrName in attrs.map) { 
     2954                                list = matchedAttributes[attrName]; 
     2955 
     2956                                if (list) 
     2957                                    list.push(newNode); 
     2958                                else 
     2959                                    matchedAttributes[attrName] = [newNode]; 
     2960                            } 
     2961                        } 
     2962 
     2963                        // Trim whitespace before block 
     2964                        if (blockElements[name]) { 
     2965                            for (textNode = newNode.prev; textNode && textNode.type === 3; ) { 
     2966                                text = textNode.value.replace(endWhiteSpaceRegExp, ''); 
     2967 
     2968                                if (text.length > 0) { 
     2969                                    textNode.value = text; 
     2970                                    textNode = textNode.prev; 
     2971                                } else { 
     2972                                    sibling = textNode.prev; 
     2973                                    textNode.remove(); 
     2974                                    textNode = sibling; 
     2975                                } 
     2976                            } 
     2977                        } 
     2978 
     2979                        // Change current node if the element wasn't empty i.e not <br /> or <img /> 
     2980                        if (!empty) 
     2981                            node = newNode; 
     2982                    } 
     2983                }, 
     2984 
     2985                end: function(name) { 
     2986                    var textNode, elementRule, text, sibling, tempNode; 
     2987 
     2988                    elementRule = schema.getElementRule(name); 
     2989                    if (elementRule) { 
     2990                        if (blockElements[name]) { 
     2991                            if (!whiteSpaceElements[node.name]) { 
     <