﻿function tinyMCE_init_full(special){if((LANG=="")||(LANG=="GB")){lang="zh";font="宋体;";}
else{lang="en";font="";}var c='';if (special==1)c=",code";
tinyMCE.init({mode:"textareas",theme:"advanced",language:lang,plugins:"safari,emotions,inlinepopups,preview,media,paste",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,indent,outdent,blockquote,|,undo,redo,|,link,unlink,|,emotions,|,preview"+c,theme_advanced_buttons2:"forecolor,backcolor,|,fontselect,fontsizeselect",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",document_base_url:BASE_URL,convert_urls:false,content_css:"css/textarea_3_0_8.css",convert_fonts_to_spans:true,theme_advanced_fonts:font+"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",font_size_style_values:"8pt,10pt,12pt,14pt,18pt,24pt,36pt",plugin_preview_width:"650",plugin_preview_height:"600",apply_source_formatting:true,theme_advanced_more_colors:false,tab_focus:':prev,:next',execcommand_callback:"myCustomExecCommandHandler"});}
function tinyMCE_gzip(){if((LANG=="")||(LANG=="GB"))lang="zh";else lang="en";tinyMCE_GZ.init({plugins:'safari,emotions,inlinepopups,preview,media,paste',themes:'simple,advanced',languages:lang,disk_cache:true,debug:false});}
function tinyMCE_init_comment(){if((LANG=="")||(LANG=="GB")){lang="zh";font="宋体;";}
else{lang="en";font="";}
tinyMCE.init({mode:"textareas",theme:"advanced",language:lang,plugins:"safari,emotions,inlinepopups,paste",theme_advanced_buttons1:"bold,italic,underline,|,undo,redo,|,link,unlink,|,forecolor,emotions,|,fontselect,fontsizeselect",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",document_base_url:BASE_URL,convert_urls:false,content_css:"css/textarea_3_0_8.css",convert_fonts_to_spans:true,theme_advanced_fonts:font+"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",font_size_style_values:"8pt,10pt,12pt,14pt,18pt,24pt,36pt",apply_source_formatting:true,theme_advanced_more_colors:false,tab_focus:':prev,:next',execcommand_callback:"myCustomExecCommandHandler"});}
function tinyMCE_init_profile(){if((LANG=="")||(LANG=="GB")){lang="zh";font="宋体;";}
else{lang="en";font="";}
tinyMCE.init({mode:"exact",elements:"about_me",theme:"advanced",plugins:"inlinepopups,emotions,safari,paste",theme_advanced_buttons1:"bold,italic,underline,|,undo,redo,|,link,unlink,|,forecolor,emotions,|,fontselect,fontsizeselect",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",document_base_url:BASE_URL,convert_urls:false,content_css:"css/textarea_3_0_8.css",convert_fonts_to_spans:true,theme_advanced_fonts:font+"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",font_size_style_values:"8pt,10pt,12pt,14pt,18pt,24pt,36pt",apply_source_formatting:true,theme_advanced_more_colors:false,tab_focus:':prev,:next',execcommand_callback:"myCustomExecCommandHandler"});}
function myCustomExecCommandHandler(editor_id,elm,command,user_interface,value){var linkElm,inst;var href=null;switch(command){case"mceLink":inst=tinyMCE.get(editor_id);linkElm=tinyMCE.activeEditor.dom.getParent(inst.selection.getNode(),"A");link=tinyMCE.activeEditor.dom.getAttrib(linkElm,"href");if(linkElm){href=window.prompt("Please enter a URL:",link);if((href!=null)&&(href!="")&&(href!="http://"))
tinyMCE.execCommand('mceInsertLink',false,{href:href,target:"_blank"});}
else{href=window.prompt("Please enter a URL:","http://");if((href!=null)&&(href!="")&&(href!="http://"))
tinyMCE.execCommand('mceInsertLink',false,{href:href,target:"_blank"});}
return true;case"JustifyLeft":case"JustifyRight":case"JustifyCenter":var test_align="align_left";if(command=="JustifyRight")test_align="align_right";else if(command=="JustifyCenter")test_align="align_center";inst=tinyMCE.getInstanceById(editor_id);imageElm=tinyMCE.activeEditor.dom.getParent(inst.selection.getNode(),"IMG");if(imageElm){var c=tinyMCE.activeEditor.dom.getAttrib(imageElm,"class");if(c==test_align)tinyMCE.activeEditor.dom.setAttrib(imageElm,"class","");else tinyMCE.activeEditor.dom.setAttrib(imageElm,"class",test_align);return true;}
return false;}
return false;}