var toolbarLabels={addUrlPanelTitle:{de_DE:'URL hinzufügen',en_US:'Add URL'},bold:{'de_DE':'Fett','en_US':'Bold'},italic:{'de_DE':'Kursiv','en_US':'Italic'},strikeThorugh:{'de_DE':'Durchgestrichen','en_US':'Strike Through'},underline:{'de_DE':'Unterstrichen','en_US':'Underline'},justifyLeft:{'de_DE':'Linksbündig','en_US':'Justify Left'},justifyRight:{'de_DE':'Rechtsbündig','en_US':'Justify Right'},justifyCenter:{'de_DE':'Zentriert','en_US':'Justify Center'},indent:{'de_DE':'Einrücken','en_US':'Indent'},outdent:{'de_DE':'Ausrücken','en_US':'Outdent'},subscript:{'de_DE':'Tiefgestellt','en_US':'Subscript'},superscript:{'de_DE':'Hochgestellt','en_US':'Superscript'},orderedList:{'de_DE':'Sortierte Liste','en_US':'Ordered List'},unorderedList:{'de_DE':'Unsortierte Liste','en_US':'Unorered List'},color:{'de_DE':'Farbe','en_US':'Color'},image:{'de_DE':'Bild einfügen','en_US':'Add Image'},link:{'de_DE':'Link hinzufügen','en_US':'Add Link'},unlink:{'de_DE':'Link entfernen','en_US':'Remove Link'},removeFormat:{'de_DE':'Formatierung entfernen','en_US':'Remove Format'},word:{'de_DE':'Word','en_US':'Word'},clear:{'de_DE':'Form leeren','en_US':'Empty Form'},enterUrl:{'de_DE':'Enter URL to view','en_US':'Bitte gib eine URL ein'},errorSelectLinkText:{'de_DE':'Select the text you wish to link!','en_US':'Bitte markiere zuerst den Text, den du verlinken möchtest'},clearDoc:{'de_DE':'Inhalt wirklich löschen?','en_US':'Really clear the whole document'},errorEnterUrlOfImage:{'de_DE':'Enter URL of image to view','en_US':'Bite gib eine Bild-URL ein'},labelCancel:{'de_DE':'Abbrechen','en_US':'Cancel'},labelOk:{'de_DE':'Ok','en_US':'Ok'},addImagePanelTitle:{'de_DE':'Gib eine Bild URL ein','en_US':'Add an image url'},buttonView:{'de_DE':'Anzeigen','en_US':'View'},addUrlPanelTitle:{'de_DE':'Link hinzufügen','en_US':'Add a URL'},labelUrl:{'de_DE':'URL','en_US':'URL'},labelTitle:{'de_DE':'Titel','en_US':'Title'},labelTarget:{'de_DE':'öffnen in','en_US':'open in'},labelDefault:{'de_DE':'Gleichem Fenster','en_US':'Same Window'},labelNew:{'de_DE':'Neues Fenster','en_US':'New Window'}};var rte_tag='-rte-tmp-tag-';var rte_toolbar={bold:{command:'bold',tags:['b','strong']},italic:{command:'italic',tags:['i','em']},underline:{command:'underline',tags:['u']},s2:{separator:true},justifyLeft:{command:'justifyleft'},justifyCenter:{command:'justifycenter'},s5:{separator:true},orderedList:{command:'insertorderedlist',tags:['ol']},unorderedList:{command:'insertunorderedlist',tags:['ul']},s6:{separator:true},block:{command:'formatblock',select:'\
<select>\
 <option value="">- style -</option>\
 <option value="<p>">Paragraph</option>\
 <option value="<h1>">Header 1</option>\
 <option value="<h2>">Header 2</options>\
 <option value="<h3>">Header 3</option>\
 <option value="<h4>">Header 4</options>\
 <option value="<h5>">Header 5</option>\
 <option value="<h6>">Header 6</options>\
</select>\
 ',arg_cmp:function(node,arg){arg=arg.replace(/<([^>]*)>/,'$1');return(arg.toLowerCase()==node.nodeName.toLowerCase());},tags:['p','h1','h2','h3','h4','h5','h6']},font:{command:'fontname',select:'\
<select>\
 <option value="">- font -</option>\
 <option value="arial">Arial</option>\
 <option value="comic sans ms">Comic Sans</option>\
 <option value="courier new">Courier New</options>\
 <option value="georgia">Georgia</option>\
 <option value="helvetica">Helvetica</options>\
 <option value="impact">Impact</option>\
 <option value="times new roman">Times</options>\
 <option value="trebuchet ms">Trebuchet</options>\
 <option value="verdana">Verdana</options>\
</select>\
 ',tags:['font']},size:{command:'fontsize',select:'\
<select>\
 <option value="">-</option>\
 <option value="1">1 (8pt)</option>\
 <option value="2">2 (10pt)</option>\
 <option value="3">3 (12pt)</options>\
 <option value="4">4 (14pt)</option>\
 <option value="5">5 (16pt)</options>\
 <option value="6">6 (18pt)</option>\
 <option value="7">7 (20pt)</options>\
</select>\
 ',tags:['font']},color:{exec:function(){var self=this;var panel=self.create_panel({title:'Set color for text',width:385,content:'\
<div class="colorpicker1"><div class="rgb" id="rgb"></div></div>\
<div class="colorpicker1"><div class="gray" id="gray"></div></div>\
<div class="colorpicker2">\
  <div class="palette" id="palette"></div>\
  <div class="preview" id="preview"></div>\
  <div class="color" id="color"></div>\
</div>\
<div class="clear"></div>\
<p class="submit"><button id="ok"><span>'+i18n('labelOk',self.culture,toolbarLabels)+'</span></button><button id="cancel"><span>'+i18n('labelCancel',self.culture,toolbarLabels)+'</span></button></p>'});var mouse_down=false;var mouse_over=false;$(panel).show();var preview=$('#preview',panel);var color=$("#color",panel);var palette=$("#palette",panel);var colors=['#660000','#990000','#cc0000','#ff0000','#333333','#006600','#009900','#00cc00','#00ff00','#666666','#000066','#000099','#0000cc','#0000ff','#999999','#909000','#900090','#009090','#ffffff','#cccccc','#ffff00','#ff00ff','#00ffff','#000000','#eeeeee'];for(var i=0;i<25;i++)
$("<div></div>").addClass("item").css('background',colors[i]).appendTo(palette);var height=$('#rgb').height();var part_width=$('#rgb').width()/6;$('#rgb,#gray,#palette',panel).mousedown(function(e){mouse_down=true;return false;}).mouseup(function(e){mouse_down=false;return false;}).mouseout(function(e){mouse_over=false;return false;}).mouseover(function(e){mouse_over=true;return false;});$('#rgb').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,true,false,false,e);return false;});$('#gray').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,false,true,false,e);return false;});$('#palette').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,false,false,true,e);return false;});$('#rgb').click(function(e){compute_color(this,true,false,false,e);return false;});$('#gray').click(function(e){compute_color(this,false,true,false,e);return false;});$('#palette').click(function(e){compute_color(this,false,false,true,e);return false;});$('#cancel',panel).click(function(){$(panel).remove();$('#rtePanelOverlay').hide();return false;});$('#ok',panel).click(function(){var value=color.html();if(value.length>0&&value.charAt(0)=='#'){if(self.iframe_doc.selection)
self.range.select();self.editor_cmd('foreColor',value);}
$(panel).remove();$('#rtePanelOverlay').hide();return false;});function to_hex(n){var s="0123456789abcdef";return s.charAt(Math.floor(n/16))+s.charAt(n%16);}
function get_abs_pos(element){var r={x:element.offsetLeft,y:element.offsetTop};if(element.offsetParent){var tmp=get_abs_pos(element.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}
return r;};function get_xy(obj,event){var x,y;event=event||window.event;var el=event.target||event.srcElement;var pos=get_abs_pos(obj);x=event.pageX-pos.x;y=event.pageY-pos.y;return{x:x,y:y};}
function compute_color(obj,is_rgb,is_gray,is_palette,e){var r,g,b,c;var mouse=get_xy(obj,e);var x=mouse.x;var y=mouse.y;if(is_rgb){r=(x>=0)*(x<part_width)*255+(x>=part_width)*(x<2*part_width)*(2*255-x*255/part_width)+(x>=4*part_width)*(x<5*part_width)*(-4*255+x*255/part_width)+(x>=5*part_width)*(x<6*part_width)*255;g=(x>=0)*(x<part_width)*(x*255/part_width)+(x>=part_width)*(x<3*part_width)*255+(x>=3*part_width)*(x<4*part_width)*(4*255-x*255/part_width);b=(x>=2*part_width)*(x<3*part_width)*(-2*255+x*255/part_width)+(x>=3*part_width)*(x<5*part_width)*255+(x>=5*part_width)*(x<6*part_width)*(6*255-x*255/part_width);var k=(height-y)/height;r=128+(r-128)*k;g=128+(g-128)*k;b=128+(b-128)*k;}else if(is_gray){r=g=b=(height-y)*1.7;}else if(is_palette){x=Math.floor(x/10);y=Math.floor(y/10);c=colors[x+y*5];}
if(!is_palette)
c='#'+to_hex(r)+to_hex(g)+to_hex(b);preview.css('background',c);color.html(c);}}},smiley:{exec:function(){var self=this;var panel=self.create_panel({title:i18n('addSmileyPanelTitle',self.culture,toolbarLabels),content:'<table width cellspacing="0" cellpadding="4" id="smileyTable">'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/01.gif" width="19" height="19"  alt="" title=":)" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/02.gif" width="19" height="19"  alt="" title=":(" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/03.gif" width="19" height="19"  alt="" title=":D" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/04.gif" width="19" height="19"  alt="" title="8)" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/05.gif" width="19" height="19"  alt="" title=":o" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/06.gif" width="19" height="19"  alt="" title=";)" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/07.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/08.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/09.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/10.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/11.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/12.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/13.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/14.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/15.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/16.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/17.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/18.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/19.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/20.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/21.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/22.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/23.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/24.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/25.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/26.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/27.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/28.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/29.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/30.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/31.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/32.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/33.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/34.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/35.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/36.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/37.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/38.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/39.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/40.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/41.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/42.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/43.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/44.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/45.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/46.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/47.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/48.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/49.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/50.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/51.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/52.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/53.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/54.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/55.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/56.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/57.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/58.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/59.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/60.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/61.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/62.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/63.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/64.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/65.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/66.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/67.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/68.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/69.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/70.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/71.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/72.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/bandit.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/bug.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/drunk.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/finger.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/fubar.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/headbang.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/heidy.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/mooning.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'</tr>'
+'<tr>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/poolparty.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/rock.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/smoke.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/swear.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/tmi.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td><a href="#"><img src="/images/smilies/Skype_Smileypack/toivo.gif" width="19" height="19"  alt="" title="" /></a></td>'
+'<td></td>'
+'<td></td>'
+'</tr>'
+'</table>'});$(panel).show();$('#smileyTable a').unbind('click').click(function(){self.editor_cmd('insertImage',$(this).find('img').attr('src'));$(panel).remove();$('#rtePanelOverlay').hide();return false;});}},image:{exec:function(){var self=this;var panel=self.create_panel({title:i18n('addImagePanelTitle',self.culture,toolbarLabels),content:'<p><label>URL</label><input type="text" id="url" size="30" value=""></p>\
<div class="clear"></div>\
<p class="submit"><button id="ok"><span>'+i18n('labelOk',self.culture,toolbarLabels)+'</span></button><button id="cancel"><span>'+i18n('labelCancel',self.culture,toolbarLabels)+'</span></button></p>'});$(panel).show();var url=$('#url',panel);$('#view',panel).click(function(){(url.val().length>0)?window.open(url.val()):alert(i18n('errorEnterUrlOfImage',self.culture,toolbarLabels));return false;});$('#cancel',panel).click(function(){$(panel).remove();$('#rtePanelOverlay').hide();return false;});$('#ok',panel).click(function(){var file=url.val();self.editor_cmd('insertImage',file);$(panel).remove();$('#rtePanelOverlay').hide();return false;})},tags:['img']},link:{exec:function(){var self=this;var panel=self.create_panel({title:i18n('addUrlPanelTitle',self.culture,toolbarLabels),width:385,content:'\
<p><label>'+i18n('labelUrl',self.culture,toolbarLabels)+'</label>\
<input type="text" id="url" size="30" value=""></p>\
<div class="clear"></div>\
<p><label>'+i18n('labelTitle',self.culture,toolbarLabels)+'</label>\
<input type="text" id="title" size="30" value="'+self.get_selected_text()+'">\
<label>'+i18n('labelTarget',self.culture,toolbarLabels)+'</label><select id="target"><option value="">'+i18n('labelDefault',self.culture,toolbarLabels)+'</option>\
<option value="_blank">'+i18n('labelNew',self.culture,toolbarLabels)+'</option></select></p>\
<div class="clear"></div>\
<p class="submit"><button id="ok"><span>'+i18n('labelOk',self.culture,toolbarLabels)+'</span></button><button id="cancel"><span>'+i18n('labelCancel',self.culture,toolbarLabels)+'</span></button></p>'});$(panel).show();$('#cancel',panel).click(function(){$(panel).remove();$('#rtePanelOverlay').hide();return false;});var url=$('#url',panel);$('#view',panel).click(function(){(url.val().length>0)?window.open(url.val()):alert(i18n('errorEnterUrl',self.culture,toolbarLabels));return false;});$('#ok',panel).click(function(){var url=$('#url',panel).val();var target=$('#target',panel).val();var title=$('#title',panel).val()!=''?$('#title',panel).val():url;$(panel).remove();$('#rtePanelOverlay').hide();if(url.length<=0){return false;}
var link=$('<a></a>').attr('href',url).attr('rel','external').text(title);var html=$('<span></span>').append(link);html=$(html).html();if(self.get_selected_text().length<1){self.editor_cmd('inserthtml',html);}
else{self.editor_cmd('unlink');self.selection_replace_with(html);}
return false;})},tags:['a']},unlink:{command:'unlink'}};var html_toolbar={s1:{separator:true},word:{exec:function(){this.set_content(cleanup_word(this.get_content(),true,true,true));}},clear:{exec:function(){if(confirm(i18n('clearDoc',self.culture,toolbarLabels)))this.set_content('');}}};function cleanup_word(s,bIgnoreFont,bRemoveStyles,bCleanWordKeepsStructure){s=s.replace(/<o:p>\s*<\/o:p>/g,'');s=s.replace(/<o:p>[\s\S]*?<\/o:p>/g,'&nbsp;');s=s.replace(/\s*mso-[^:]+:[^;"]+;?/gi,'');s=s.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi,'');s=s.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi,"\"");s=s.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,'');s=s.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,"\"");s=s.replace(/\s*TEXT-ALIGN: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*tab-stops:[^;"]*;?/gi,'');s=s.replace(/\s*tab-stops:[^"]*/gi,'');if(bIgnoreFont){s=s.replace(/\s*face="[^"]*"/gi,'');s=s.replace(/\s*face=[^ >]*/gi,'');s=s.replace(/\s*FONT-FAMILY:[^;"]*;?/gi,'');}
s=s.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");if(bRemoveStyles)
s=s.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi,"<$1$3");s=s.replace(/<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi,'');s=s.replace(/<(?:META|LINK)[^>]*>\s*/gi,'');s=s.replace(/\s*style="\s*"/gi,'');s=s.replace(/<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi,'&nbsp;');s=s.replace(/<SPAN\s*[^>]*><\/SPAN>/gi,'');s=s.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");s=s.replace(/<SPAN\s*>([\s\S]*?)<\/SPAN>/gi,'$1');s=s.replace(/<FONT\s*>([\s\S]*?)<\/FONT>/gi,'$1');s=s.replace(/<\\?\?xml[^>]*>/gi,'');s=s.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,'');s=s.replace(/<\/?\w+:[^>]*>/gi,'');s=s.replace(/<\!--[\s\S]*?-->/g,'');s=s.replace(/<(U|I|STRIKE)>&nbsp;<\/\1>/g,'&nbsp;');s=s.replace(/<H\d>\s*<\/H\d>/gi,'');s=s.replace(/<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig,'');s=s.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");s=s.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");s=s.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");if(bCleanWordKeepsStructure){s=s.replace(/<H(\d)([^>]*)>/gi,'<h$1>');s=s.replace(/<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi,'<$1>$2<\/$1>');s=s.replace(/<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi,'<$1>$2<\/$1>');}else{s=s.replace(/<H1([^>]*)>/gi,'<div$1><b><font size="6">');s=s.replace(/<H2([^>]*)>/gi,'<div$1><b><font size="5">');s=s.replace(/<H3([^>]*)>/gi,'<div$1><b><font size="4">');s=s.replace(/<H4([^>]*)>/gi,'<div$1><b><font size="3">');s=s.replace(/<H5([^>]*)>/gi,'<div$1><b><font size="2">');s=s.replace(/<H6([^>]*)>/gi,'<div$1><b><font size="1">');s=s.replace(/<\/H\d>/gi,'<\/font><\/b><\/div>');var re=new RegExp('(<P)([^>]*>[\\s\\S]*?)(<\/P>)','gi');s=s.replace(re,'<div$2<\/div>');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');}
return s;}