';SBN.TextEditor.widget_boundry_marker_begin="\n"+SBN.TextEditor.widget_boundry_marker+"\n";SBN.TextEditor.widget_boundry_marker_end="\n"+SBN.TextEditor.widget_boundry_marker+"\n";SBN.TextEditor.FormattedView.MCEInitialized=false;SBN.TextEditor.FormattedView.onMCEload=function(){if(SBN.TextEditor.Options.div_ids){SBN.TextEditor.Options.div_ids.each(function(a){SBN.TextEditor.FormattedView.enableFor(a)})}if(typeof(TinyMCE_SpellCheckerPlugin)!="undefined"){TinyMCE_SpellCheckerPlugin._oldSendAjax=TinyMCE_SpellCheckerPlugin._sendAjax;TinyMCE_SpellCheckerPlugin._sendAjax=function(e,g,b,d){e="/admin/admin/tinyspell";TinyMCE_SpellCheckerPlugin._oldSendAjax(e,g,b,d)}}};SBN.TextEditor.DefaultOptions={convert_urls:false,relative_urls:false,width:"480",remove_linebreaks:true,apply_source_formatting:true,accessibility_focus:false,mode:"none",browsers:"msie,gecko,opera,safari",theme:"advanced",inline_styles:false,theme_advanced_layout_manager:"SimpleLayout",theme_advanced_buttons2:"",theme_advanced_toolbar_location:"top",theme_advanced_disable:"sub,sup,visualaid,charmap,hr,code",theme_advanced_resizing:true,theme_advanced_statusbar_location:"bottom",gecko_spellcheck:true,dialog_type:"modal",theme_advanced_resize_horizontal:false,convert_newlines_to_brs:false,theme_advanced_blockformats:"p,pre,h3,h4, h5",theme_advanced_buttons1:"bold,italic,strikethrough,separator,numlist,separator,separator,formatselect,blockquote,outdent,indent,justifyleft,justifyright,justifycenter,justifyfull",valid_elements:"*[*]",oninit:SBN.TextEditor.FormattedView.onMCEload,cleanup_callback:"SBN.TextEditor.customCleanup",theme_advanced_path:false,body_class:"entries",content_css:"/stylesheets/admin/tinymce_extensions.css"};SBN.TextEditor.toggleProgressIndicator=function(a){if(SBN.TextEditor.codeViewEditor==undefined){return}c=SBN.TextEditor.codeViewEditor.parentNode;if(SBN.TextEditor.progressIndicator==undefined){SBN.TextEditor.progressIndicator=document.createElement("div");Element.extend(SBN.TextEditor.progressIndicator);SBN.TextEditor.progressIndicator.addClassName("editor-progress-indicator");c.appendChild(SBN.TextEditor.progressIndicator)}a?SBN.TextEditor.progressIndicator.show():SBN.TextEditor.progressIndicator.hide()};SBN.TextEditor.insert=function(a){if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand("mceInsertContent",false,a)}else{this.CodeView.insertAtCursor(a)}};SBN.TextEditor.replaceWithLink=function(b,a){sel=SBN.TextEditor.getSelection();if(sel!=undefined&&sel.length>0){SBN.TextEditor.insert(''+sel+"")}else{SBN.TextEditor.insert(b)}};SBN.TextEditor.getSelection=function(){if(tinyMCE.selectedInstance){return tinyMCE.selectedInstance.selection.getContent()}else{var f=SBN.TextEditor.codeViewEditor;var e;if(document.selection!=undefined){f.focus();var d=document.selection.createRange();e=d.text}else{if(f.selectionStart!=undefined){var b=f.selectionStart;var a=f.selectionEnd;e=f.value.substring(b,a)}}return e}};SBN.TextEditor.customCleanup=function(a,b){switch(a){case"insert_to_editor":b=b.replace(/-->[\s]+<\/script>/mig,"--><\/script>");b=b.replace(/“|„|”|«|»/gi,'"');if(/src\=(\"|\')data:image/.test(b)){alert("WARNING: Your story appears to contain one or more images with inline data. These images WILL NOT be saved into the system! Please delete these images and upload them using our upload tool.")}break}return b};SBN.TextEditor.init=function(a){if(SBN.TextEditor.FormattedView.MCEInitialized){return}SBN.TextEditor.Options=Object.extend(Object.extend({},SBN.TextEditor.DefaultOptions),a||{});tinyMCE.init(SBN.TextEditor.Options);SBN.TextEditor.FormattedView.MCEInitialized=true};SBN.TextEditor.tidyUrl=function(a){if(!(/^[a-zA-Z]+:\/\//.test(a))){a="http://"+a}return a};SBN.TextEditor.insertSimpleLink=function(a){URL=SBN.TextEditor.tidyUrl(a.url.value);if(a.tex!=undefined){SBN.TextEditor.simpleLinkText=a.tex.value}if(a.new_window.checked){new_window='target="_blank"'}else{new_window=""}if(URL){tinyMCE.selectedInstance.selection.moveToBookmark(SBN.TextEditor.simpleLinkBookmark);tinyMCE.selectedInstance.execCommand("mceInsertContent",false,"'+SBN.TextEditor.simpleLinkText+"");SBN.TextEditor.simpleLinkBookmark=false}Control.Modal.close()};SBN.TextEditor.openSimpleLinkModal=function(a){if(document.selection&&SBN.TextEditor.simpleLinkField){SBN.TextEditor.simpleLinkField.focus();SBN.TextEditor.simpleLinkSelection=document.selection.createRange()}if(SBN.TextEditor.simpleLinkText){t=""}else{t="