keTag=0;var lang="en";var encoding="UTF-8";var debugMode=false;var isRichText=false;var defaultWidth=480;var defaultHeight=200;var defaultImgWidth=20;var defaultImgHeight=20;var allRTEs="";var currentRTE="";var selectionText="";var rng;var lastCommand;var maxLoops=20;var loopCnt=0;var baseUrl=window.parent.document.location.protocol+"//"+document.domain+"/";var imagesPath="";var includesPath="";var cssFile="";var generateXHTML=true;var encodeHTML=false;var ua=navigator.userAgent.toLowerCase();var isIE=((ua.indexOf("msie")!=-1)&&(ua.indexOf("opera")==-1)&&(ua.indexOf("webtv")==-1));var ieVersion=parseFloat(ua.substring(ua.indexOf("msie ")+5));var isGecko=(ua.indexOf("gecko")!=-1);var isSafari=(ua.indexOf("safari")!=-1);var webkitVersion=get_webkit_version();if(webkitVersion){webkitVersion=webkitVersion.major}else{webkitVersion=null}var isKonqueror=(ua.indexOf("konqueror")!=-1);var konquerorVersion=parseFloat(ua.substring(ua.indexOf("konqueror/")+10));var isOpera=(ua.indexOf("opera")!=-1);var isNetscape=(ua.indexOf("netscape")!=-1);var netscapeVersion=parseFloat(ua.substring(ua.lastIndexOf("/")+1));var toolbar1Enabled=true;var toolbar2Enabled=true;var cmdFormatBlockEnabled=true;var cmdFontNameEnabled=true;var cmdFontSizeEnabled=true;var cmdIncreaseFontSizeEnabled=false;var cmdDecreaseFontSizeEnabled=false;var cmdBoldEnabled=true;var cmdItalicEnabled=true;var cmdUnderlineEnabled=true;var cmdStrikethroughEnabled=true;var cmdSuperscriptEnabled=true;var cmdSubscriptEnabled=true;var cmdJustifyLeftEnabled=true;var cmdJustifyCenterEnabled=true;var cmdJustifyRightEnabled=true;var cmdJustifyFullEnabled=true;var cmdInsertHorizontalRuleEnabled=true;var cmdInsertOrderedListEnabled=true;var cmdInsertUnorderedListEnabled=true;var cmdOutdentEnabled=true;var cmdIndentEnabled=true;var cmdForeColorEnabled=true;var cmdHiliteColorEnabled=true;var cmdInsertHTMLEnabled=true;var cmdSpellCheckEnabled=false;var cmdCreateLinkEnabled=true;var cmdInsertImageEnabled=true;var cmdCutEnabled=true;var cmdCopyEnabled=true;var cmdPasteEnabled=true;var cmdUndoEnabled=true;var cmdRedoEnabled=true;var cmdRemoveFormatEnabled=true;var cmdUnlinkEnabled=true;function initRTE(F,D,C,B,A){try{imagesPath=F;includesPath=D;cssFile=C;generateXHTML=B;if(A){encodeHTML=true}if(document.designMode){if(document.getElementById&&!isIE&&!isSafari&&!isKonqueror){isRichText=true;if(isGecko||isOpera){cmdIncreaseFontSizeEnabled=true;cmdDecreaseFontSizeEnabled=true;cmdCutEnabled=false;cmdCopyEnabled=false;cmdPasteEnabled=false}if(isNetscape&&netscapeVersion<8){cmdInsertHTMLEnabled=false}}else{if(isIE&&ieVersion>=5.5){isRichText=true;cmdSpellCheckEnabled=true}else{if(isSafari){if(webkitVersion>=420){isRichText=true}else{if(webkitVersion>=312){isRichText=true;toolbar1Enabled=false;cmdStrikethroughEnabled=false;cmdJustifyFullEnabled=false;cmdInsertHorizontalRuleEnabled=false;cmdInsertOrderedListEnabled=false;cmdInsertUnorderedListEnabled=false;cmdOutdentEnabled=false;cmdIndentEnabled=false;cmdInsertImageEnabled=false;cmdPasteEnabled=false;cmdInsertHTMLEnabled=false;cmdCreateLinkEnabled=false;cmdUnlinkEnabled=false;cmdRemoveFormatEnabled=false}}}}}}if(isRichText){document.writeln('<style type="text/css">@import "'+includesPath+'rte.css";</style>');document.writeln('<iframe width="150" height="100" id="cp" src="'+includesPath+'palette.htm" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="visibility:hidden; position: absolute;"></iframe>');if(isIE){document.onmouseover=raiseButton;document.onmouseout=normalButton;document.onmousedown=lowerButton;document.onmouseup=raiseButton}}}catch(E){if(debugMode){alert(E)}}}function richTextEditor(A){this.rteID=A;this.html="";this.width=defaultWidth;this.height=defaultHeight;this.readOnly=false;this.toolbar1=true;this.toolbar2=true;this.cmdFormatBlock=true;this.cmdFontName=true;this.cmdFontSize=true;this.cmdIncreaseFontSize=false;this.cmdDecreaseFontSize=false;this.cmdBold=true;this.cmdItalic=true;this.cmdUnderline=true;this.cmdStrikethrough=false;this.cmdSuperscript=true;this.cmdSubscript=true;this.cmdJustifyLeft=true;this.cmdJustifyCenter=true;this.cmdJustifyRight=true;this.cmdJustifyFull=true;this.cmdInsertHorizontalRule=true;this.cmdInsertOrderedList=true;this.cmdInsertUnorderedList=true;this.cmdOutdent=true;this.cmdIndent=true;this.cmdForeColor=true;this.cmdHiliteColor=true;this.cmdInsertLink=true;this.cmdInsertImage=false;this.cmdInsertSpecialChars=true;this.cmdInsertTable=true;this.cmdSpellcheck=false;this.cmdCut=false;this.cmdCopy=false;this.cmdPaste=false;this.cmdUndo=false;this.cmdRedo=false;this.cmdRemoveFormat=false;this.cmdUnlink=false;this.toggleSrc=true;this.build=build}function build(){with(this){if(isRichText){if(this.readOnly){this.toolbar1=false;this.toolbar2=false}writeRichText(this);enableDesignMode(this.rteID,htmlDecode(this.html),this.readOnly);if(isGecko){currentRTE=this.rteID;insertHTML("<br>");rteCommand(this.rteID,"undo")}if(!this.readOnly){if(this.toggleSrc){document.getElementById("chkSrc"+this.rteID).checked=false}}}else{writePlainText(this)}}}function writePlainText(A){if(!A.readOnly){document.writeln('<textarea name="'+A.rteID+'" id="'+A.rteID+'" style="width: '+A.width+"px; height: "+A.height+'px;">'+A.html+"</textarea>")}else{document.writeln('<textarea name="'+A.rteID+'" id="'+A.rteID+'" style="width: '+A.width+"px; height: "+A.height+'px;" readonly>'+A.html+"</textarea>")}}function writeRichText(A){try{if(allRTEs.length>0){allRTEs+=";"}allRTEs+=A.rteID;document.writeln('<table width="'+A.width+'" cellpadding="0" cellspacing="0" style="border: 1px solid #000;">');document.writeln("	<tr>");document.writeln("		<td>");if(toolbar1Enabled&&A.toolbar1){document.writeln('		<table class="rteBack" cellpadding="2" cellspacing="0" id="toolbar1_'+A.rteID+'" width="100%">');document.writeln("			<tr>");if(cmdFormatBlockEnabled&&A.cmdFormatBlock){document.writeln("				<td>");document.writeln('					<select style="width:120px" id="formatblock_'+A.rteID+'" onchange="selectFont(\''+A.rteID+"', this.id);\">");document.writeln('						<option value="">[Style]</option>');document.writeln('						<option value="<p>">Paragraph &lt;p&gt;</option>');document.writeln('						<option value="<h1>">Heading 1 &lt;h1&gt;</option>');document.writeln('						<option value="<h2>">Heading 2 &lt;h2&gt;</option>');document.writeln('						<option value="<h3>">Heading 3 &lt;h3&gt;</option>');document.writeln('						<option value="<h4>">Heading 4 &lt;h4&gt;</option>');document.writeln('						<option value="<h5>">Heading 5 &lt;h5&gt;</option>');document.writeln('						<option value="<h6>">Heading 6 &lt;h6&gt;</option>');document.writeln('						<option value="<address>">Address &lt;ADDR&gt;</option>');document.writeln('						<option value="<pre>">Formatted &lt;pre&gt;</option>');document.writeln("					</select>");document.writeln("				</td>")}if(cmdFontNameEnabled&&A.cmdFontName){document.writeln("				<td>");document.writeln('					<select style="width:120px" id="fontname_'+A.rteID+'" onchange="selectFont(\''+A.rteID+"', this.id)\">");document.writeln('						<option value="Font" selected>[Font]</option>');document.writeln('						<option value="Arial, Helvetica, sans-serif">Arial</option>');document.writeln('						<option value="Courier New, Courier, mono">Courier New</option>');document.writeln('						<option value="Times New Roman, Times, serif">Times New Roman</option>');document.writeln('						<option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');document.writeln("					</select>");document.writeln("				</td>")}if(cmdFontSizeEnabled&&A.cmdFontSize){document.writeln("				<td>");document.writeln('					<select style="width:60px" id="fontsize_'+A.rteID+'" onchange="selectFont(\''+A.rteID+"', this.id);\">");document.writeln('						<option value="Size">[Size]</option>');document.writeln('						<option value="1">1</option>');document.writeln('						<option value="2">2</option>');document.writeln('						<option value="3">3</option>');document.writeln('						<option value="4">4</option>');document.writeln('						<option value="5">5</option>');document.writeln('						<option value="6">6</option>');document.writeln('						<option value="7">7</option>');document.writeln("					</select>");document.writeln("				</td>")}if(A.keTag==1){document.writeln("		<td>");document.writeln('			<select style="width:150px" unselectable="on" id="special_ke_'+A.rteID+'" onchange="selectKeTag(\''+A.rteID+"', this.id);\">");document.writeln('				<option value="Size">[Email Fields]</option>');document.writeln('				<option value="[FIRST_NAME]">Recipient First Name</option>');document.writeln('				<option value="[LAST_NAME]">Recipient Last Name</option>');document.writeln('				<option value="[FULL_NAME]">Recipient Full Name</option>');document.writeln('				<option value="[DESTINATION]">Recipient Email</option>');document.writeln('				<option value="[USERNAME]">Recipient Username</option>');document.writeln('				<option value="[PASSWORD]">Recipient Password</option>');document.writeln('				<option value="[PARTNER_NAME]">Recipient Partner Name</option>');document.writeln('				<option value="[SENDER_NAME]">Sender Name</option>');document.writeln('				<option value="[SENDER_EMAIL]">Sender Email</option>');document.writeln("			</select>");document.writeln("		</td>")}if(A.keTag==2){document.writeln("		<td>");document.writeln('			<select style="width:150px" unselectable="on" id="special_ke_'+A.rteID+'" onchange="selectKeTag(\''+A.rteID+"', this.id);\">");document.writeln('				<option value="Size">[Emoticons]</option>');document.writeln('				<option value="[:-@]">Angry</option>');document.writeln('				<option value="[:-S]">Confused</option>');document.writeln('				<option value="[:(]">Cry</option>');document.writeln('				<option value="[:-|]">Disappointed</option>');document.writeln('				<option value="[:-#]">Dont Tell</option>');document.writeln('				<option value="[*8-|]">Nerd</option>');document.writeln('				<option value="[:-D]">Open Mouthed</option>');document.writeln('				<option value="[:-(]">Sad</option>');document.writeln('				<option value="[:->]">Sarcastic</option>');document.writeln('				<option value="[:-*]">Secret Telling</option>');document.writeln('				<option value="[;-(*)]">Sick</option>');document.writeln('				<option value="[|-)]">Sleepy</option>');document.writeln('				<option value="[:-)]">Smile</option>');document.writeln('				<option value="[:-O]">Surprised</option>');document.writeln('				<option value="[:-P]">Tongue Out</option>');document.writeln('				<option value="[;-)]">Wink</option>');document.writeln("			</select>");document.writeln("		</td>")}if(cmdIncreaseFontSizeEnabled&&A.cmdIncreaseFontSize){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'increase_font.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Increase Font Size" title="Increase Font Size" onmousedown="rteCommand(\''+A.rteID+"', 'increasefontsize')\"></td>")}if(cmdDecreaseFontSizeEnabled&&A.cmdDecreaseFontSize){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'decrease_font.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Decrease Font Size" title="Decrease Font Size" onmousedown="rteCommand(\''+A.rteID+"', 'decreasefontsize')\"></td>")}document.writeln('				<td width="100%"></td>');document.writeln("			</tr>");document.writeln("		</table>")}if(A.toolbar2){document.writeln('		<table class="rteBack" cellpadding="0" cellspacing="0" id="toolbar2_'+A.rteID+'" width="100%">');document.writeln("			<tr>");if(cmdBoldEnabled&&A.cmdBold){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'bold.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Bold" title="Bold" onmousedown="rteCommand(\''+A.rteID+"', 'bold')\"></td>")}if(cmdItalicEnabled&&A.cmdItalic){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'italic.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Italic" title="Italic" onmousedown="rteCommand(\''+A.rteID+"', 'italic')\"></td>")}if(cmdUnderlineEnabled&&A.cmdUnderline){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'underline.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Underline" title="Underline" onmousedown="rteCommand(\''+A.rteID+"', 'underline')\"></td>")}if(cmdStrikethroughEnabled&&A.cmdStrikethrough){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'strikethrough.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Strikethrough" title="Strikethrough" onmousedown="rteCommand(\''+A.rteID+"', 'strikethrough', '')\"></td>")}if(cmdSuperscriptEnabled&&A.cmdSuperscript){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'superscript.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Superscript" title="Superscript" onmousedown="rteCommand(\''+A.rteID+"', 'superscript')\"></td>")}if(cmdSubscriptEnabled&&A.cmdSubscript){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'subscript.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Subscript" title="Subscript" onmousedown="rteCommand(\''+A.rteID+"', 'subscript')\"></td>")}if(cmdJustifyLeftEnabled&&A.cmdJustifyLeft){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'left_just.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Align Left" title="Align Left" onmousedown="rteCommand(\''+A.rteID+"', 'justifyleft')\"></td>")}if(cmdJustifyCenterEnabled&&A.cmdJustifyCenter){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'centre.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Center" title="Center" onmousedown="rteCommand(\''+A.rteID+"', 'justifycenter')\"></td>")}if(cmdJustifyRightEnabled&&A.cmdJustifyRight){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'right_just.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Align Right" title="Align Right" onmousedown="rteCommand(\''+A.rteID+"', 'justifyright')\"></td>")}if(cmdJustifyFullEnabled&&A.cmdJustifyFull){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'justifyfull.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Justify Full" title="Justify Full" onmousedown="rteCommand(\''+A.rteID+"', 'justifyfull')\"></td>")}if(cmdInsertHorizontalRuleEnabled&&A.cmdInsertHorizontalRule){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'hr.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Horizontal Rule" title="Horizontal Rule" onmousedown="rteCommand(\''+A.rteID+"', 'inserthorizontalrule')\"></td>")}if(cmdInsertOrderedListEnabled&&A.cmdInsertOrderedList){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'numbered_list.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Ordered List" title="Ordered List" onmousedown="rteCommand(\''+A.rteID+"', 'insertorderedlist')\"></td>")}if(cmdInsertUnorderedListEnabled&&A.cmdInsertUnorderedList){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'list.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Unordered List" title="Unordered List" onmousedown="rteCommand(\''+A.rteID+"', 'insertunorderedlist')\"></td>")}if(cmdOutdentEnabled&&A.cmdOutdent){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'outdent.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Outdent" title="Outdent" onmousedown="rteCommand(\''+A.rteID+"', 'outdent')\"></td>")}if(cmdIndentEnabled&&A.cmdIndent){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'indent.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Indent" title="Indent" onmousedown="rteCommand(\''+A.rteID+"', 'indent')\"></td>")}if(cmdForeColorEnabled&&A.cmdForeColor){document.writeln('				<td><div id="forecolor_'+A.rteID+'"><img class="rteImage" src="'+imagesPath+'textcolor.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Text Color" title="Text Color" onmousedown="dlgColorPalette(\''+A.rteID+"', 'forecolor', ''); return false;\"></div></td>")}if(cmdHiliteColorEnabled&&A.cmdHiliteColor){document.writeln('				<td><div id="hilitecolor_'+A.rteID+'"><img class="rteImage" src="'+imagesPath+'bgcolor.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Background Color" title="Background Color" onmousedown="dlgColorPalette(\''+A.rteID+"', 'hilitecolor', ''); return false;\"></div></td>")}if((cmdInsertHTMLEnabled||cmdCreateLinkEnabled)&&A.cmdInsertLink){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'hyperlink.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Insert Link" title="Insert Link" onmousedown="dlgInsertLink(\''+A.rteID+"')\"></td>")}if(cmdUnlinkEnabled&&A.cmdUnlink){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'unlink.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Remove Link" title="Remove Link" onmousedown="rteCommand(\''+A.rteID+"', 'unlink')\"></td>")}if(cmdInsertImageEnabled&&A.cmdInsertImage){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'image.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Add Image" title="Add Image" onmousedown="addImage(\''+A.rteID+"')\"></td>")}if(cmdInsertHTMLEnabled&&A.cmdInsertSpecialChars){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'special_chars.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Insert Special Character" title="Insert Special Character" onmousedown="dlgInsertSpecialChar(\''+A.rteID+"')\"></td>")}if(cmdInsertHTMLEnabled&&A.cmdInsertTable&&!isOpera){document.writeln('				<td><div id="table_'+A.rteID+'"><img class="rteImage" src="'+imagesPath+'insert_table.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Insert Table" title="Insert Table" onmousedown="dlgInsertTable(\''+A.rteID+"')\"></div></td>")}if(cmdSpellCheckEnabled&&A.cmdSpellcheck){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'spellcheck.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Spell Check" title="Spell Check" onmousedown="checkspell()"></td>')}if(cmdCutEnabled&&A.cmdCut){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'cut.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Cut" title="Cut" onmousedown="rteCommand(\''+A.rteID+"', 'cut')\"></td>")}if(cmdCopyEnabled&&A.cmdCopy){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'copy.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Copy" title="Copy" onmousedown="rteCommand(\''+A.rteID+"', 'copy')\"></td>")}if(cmdPasteEnabled&&A.cmdPaste){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'paste.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Paste" title="Paste" onmousedown="rteCommand(\''+A.rteID+"', 'paste')\"></td>")}if(cmdUndoEnabled&&A.cmdUndo){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'undo.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Undo" title="Undo" onmousedown="rteCommand(\''+A.rteID+"', 'undo')\"></td>")}if(cmdRedoEnabled&&A.cmdRedo){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'redo.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Redo" title="Redo" onmousedown="rteCommand(\''+A.rteID+"', 'redo')\"></td>")}if(cmdRemoveFormatEnabled&&A.cmdRemoveFormat){document.writeln('				<td><img class="rteImage" src="'+imagesPath+'removeformat.gif" width="'+defaultImgWidth+'" height="'+defaultImgHeight+'" alt="Remove Formatting" title="Remove Formatting" onmousedown="rteCommand(\''+A.rteID+"', 'removeformat')\"></td>")}document.writeln('				<td width="100%"></td>');document.writeln("			</tr>");document.writeln("		</table>")}document.writeln('			<iframe id="'+A.rteID+'" name="'+A.rteID+'" src="'+includesPath+'blank.htm" frameborder="0" style="width: 100%; height: '+A.height+'px; margin: 0; padding: 0;"></iframe>');document.writeln("		</td>");document.writeln("	</tr>");document.writeln("</table>");document.writeln('<div style="margin: 0; padding: 0;">');if(!A.readOnly&&A.toggleSrc){document.writeln('<input type="checkbox" id="chkSrc'+A.rteID+'" onclick="toggleHTMLSrc(\''+A.rteID+"',"+A.toolbar1+","+A.toolbar2+');" />&nbsp;<label for="chkSrc'+A.rteID+'">View Source</label>')}document.writeln('<input type="hidden" id="hdn'+A.rteID+'" name="'+A.rteID+'" value="">');document.writeln("</div>")}catch(B){if(debugMode){alert(B)}}}function enableDesignMode(D,C,H){try{if(cssFile.length>0){var A='<style type="text/css">@import url('+cssFile+");</style>\n"}else{var A='<style type="text/css">\n';A+="body {\n";A+="	background: #FFF;\n";A+="}\n";A+="</style>\n"}var B='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';B+='<html id="'+D+'" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n';B+="<head>\n";B+='<meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n';B+='<base href="'+baseUrl+'" />\n';B+=A;B+="</head>\n";B+='<body style="margin: 0; padding: 0;">\n';B+=C+"\n";B+="</body>\n";B+="</html>";var G=document.getElementById(D);try{if(isGecko){if(!H){G.contentDocument.designMode="on"}try{var E=G.contentWindow.document;E.open("text/html","replace");E.write(B);E.close();if(!H){E.addEventListener("keypress",geckoKeyPress,true)}}catch(F){if(debugMode){alert("Error preloading content.")}}loopCnt=0}else{if(G.contentWindow){try{var E=G.contentWindow.document;E.open("text/html","replace");E.write(B);E.close();if(!H&&isIE){E.attachEvent("onkeypress",evt_ie_keypress)}}catch(F){if(debugMode){alert("Error preloading content.")}}if(!H){E.designMode="on"}loopCnt=0}else{var E=G.document;E.open("text/html","replace");E.write(B);E.close();if(!H&&isIE){E.attachEvent("onkeypress",evt_ie_keypress)}if(!H){E.designMode="on"}loopCnt=0}}}catch(F){if(loopCnt<maxLoops){setTimeout("enableDesignMode('"+D+"', '"+C+"', "+H+");",100);loopCnt+=1}else{if(debugMode){alert("Error enabling designMode.")}}}}catch(F){if(debugMode){alert(F)}}}function updateRTE(A){try{if(isRichText){if(document.getElementById("chkSrc"+A)&&document.getElementById("chkSrc"+A).checked){document.getElementById("chkSrc"+A).click()}setHiddenVal(A)}else{return }}catch(B){if(debugMode){alert(B)}}}function updateRTEs(){try{if(allRTEs!=""){var B=allRTEs.split(";");for(var A=0;A<B.length;A++){updateRTE(B[A])}}}catch(C){if(debugMode){alert(C)}}}function rteCommand(A,E,B){try{var D=document.getElementById(A);if(D.contentWindow){D.contentWindow.focus();D.contentWindow.document.execCommand(E,false,B)}else{D.document.focus();D.document.execCommand(E,false,B)}loopCnt=0;return false}catch(C){if(debugMode){alert(C)}if(loopCnt<maxLoops){setTimeout("rteCommand('"+A+"', '"+E+"', '"+B+"');",100);loopCnt+=1}else{if(debugMode){alert("Error executing command.")}}}}function dlgColorPalette(B,G){try{setRange(B);var F=document.getElementById(G+"_"+B);var C=findPosX(F);var A=findPosY(F)+F.offsetHeight;var D=document.getElementById("cp");D.style.left=C+"px";D.style.top=A+"px";if((G==lastCommand)&&(B==currentRTE)){if(D.style.visibility=="hidden"){showHideElement("cp","show")}else{showHideElement("cp","hide")}}else{showHideElement("cp","show")}lastCommand=G;currentRTE=B}catch(E){if(debugMode){alert(E)}}}function dlgInsertTable(A){try{setRange(A);currentRTE=A;InsertTable=popUpWin(includesPath+"insert_table.htm","InsertTable",360,180,"");if(InsertTable){setTimeout("InsertTable.focus()",100)}else{if(debugMode){alert("Error: While Launching New Window...\nYour browser maybe blocking up Popup windows.\n\nPlease check your Popup Blocker Settings")}}}catch(B){if(debugMode){alert(B)}}}function dlgInsertLink(B){try{if(cmdInsertHTMLEnabled){setRange(B);currentRTE=B;InsertLink=popUpWin(includesPath+"insert_link.htm?selectionText="+selectionText,"InsertLink",360,180,"");if(InsertLink){setTimeout("InsertLink.focus()",100)}else{if(debugMode){alert("Error: While Launching New Window...\nYour browser maybe blocking up Popup windows.\n\nPlease check your Popup Blocker Settings")}}}else{var A=prompt("Enter URL","http://");rteCommand(B,"createlink",A)}}catch(C){if(debugMode){alert(C)}}}function dlgInsertSpecialChar(A){try{setRange(A);currentRTE=A;InsertSpecialChar=popUpWin(includesPath+"insert_special_char.htm","InsertSpecialChar",360,250,"");if(InsertSpecialChar){setTimeout("InsertSpecialChar.focus()",100)}else{if(debugMode){alert("Error: While Launching New Window...\nYour browser maybe blocking up Popup windows.\n\nPlease check your Popup Blocker Settings")}}}catch(B){if(debugMode){alert(B)}}}function popUpWin(D,H,F,A,C){try{var E=(screen.availWidth-F)/2;var B=(screen.availHeight-A)/2;C+="width="+F+",height="+A+",top="+B+",left="+E;return window.open(D,H,C)}catch(G){if(debugMode){alert(G)}}}function setColor(A){try{var B=currentRTE;if(isSafari||isIE){if(lastCommand=="hilitecolor"){lastCommand="backcolor"}if(!isSafari){rng.select()}}rteCommand(B,lastCommand,A);showHideElement("cp","hide")}catch(C){if(debugMode){alert(C)}}}function addImage(A){try{imagePath=prompt("Enter Image URL:","http://");if((imagePath!=null)&&(imagePath!="")){rteCommand(A,"InsertImage",imagePath)}}catch(B){if(debugMode){alert(B)}}}function findPosX(A){var B=0;if(A.offsetParent){B=A.offsetLeft;while(A=A.offsetParent){B+=A.offsetLeft}}return B}function findPosY(B){var A=0;if(B.offsetParent){A=B.offsetTop;while(B=B.offsetParent){A+=B.offsetTop}}return A}function selectFont(C,B){try{var A=document.getElementById(B).selectedIndex;if(A!=0){var D=document.getElementById(B).options[A].value;var E=B.replace("_"+C,"");rteCommand(C,E,D);document.getElementById(B).selectedIndex=0}}catch(F){if(debugMode){alert(F)}}}function insertHTML(A){try{if(document.all&&!isOpera){rng.pasteHTML(A);rng.collapse(false);rng.select()}else{rteCommand(currentRTE,"inserthtml",A)}}catch(B){if(debugMode){alert(B)}}}function showHideElement(A,C){try{if(document.getElementById(A)){A=document.getElementById(A);if(C=="show"){if(A.id.substring(0,7)=="toolbar"){A.style.display="block"}A.style.visibility="visible"}else{if(C=="hide"){if(A.id.substring(0,7)=="toolbar"){A.style.display="none"}A.style.visibility="hidden"}}}}catch(B){if(debugMode){alert(B)}}}function setRange(A){try{var D=document.getElementById(A);if(D.contentWindow){var B=D.contentWindow.document;D.contentWindow.focus()}else{var B=D.document;B.focus()}if(document.all){sel=B.selection;rng=sel.createRange();if(encodeHTML){selectionText=htmlEncode(rng.text.toString())}else{selectionText=rng.text.toString()}}else{if(document.getSelection){rng=B.createRange();if(encodeHTML){selectionText=htmlEncode(B.getSelection())}else{selectionText=B.getSelection()}}}}catch(C){if(debugMode){alert(C)}}}function stripHTML(A){try{var B=A.replace(/(<([^>]+)>)/ig,"");B=B.replace(/\r\n/g," ");B=B.replace(/\n/g," ");B=B.replace(/\r/g," ");B=trim(B);return B}catch(C){if(debugMode){alert(C)}}}function trim(B){try{B=B.replace(/^\s+/g,"");return B.replace(/\s+$/g,"")}catch(A){if(debugMode){alert(A)}}}function cleanWordContent(A){A=String(A).replace(/<\\?\?xml[^>]*>/g,"");A=String(A).replace(/<\/?o:p[^>]*>/g,"");A=String(A).replace(/<\/?v:[^>]*>/g,"");A=String(A).replace(/<\/?o:[^>]*>/g,"");return A}function toggleHTMLSrc(A,F,C){try{var E=document.getElementById("hdn"+A);var H=document.getElementById(A);if(H.contentWindow){var B=H.contentWindow.document}else{var B=H.document}if(document.getElementById("chkSrc"+A).checked){if(F){showHideElement("toolbar1_"+A,"hide")}if(C){showHideElement("toolbar2_"+A,"hide")}setHiddenVal(A);if(encodeHTML){var G=B.createTextNode(htmlDecode(E.value))}else{var G=B.createTextNode(E.value)}B.body.focus();B.body.innerHTML="";B.body.appendChild(G)}else{if(F){showHideElement("toolbar1_"+A,"show")}if(C){showHideElement("toolbar2_"+A,"show")}if(isIE){var G=B.body.innerText}else{var G=B.body.ownerDocument.createRange();G.selectNodeContents(B.body);G=G.toString()}setHtmlSrc(A,G)}}catch(D){if(debugMode){alert(D)}}}function setHiddenVal(B){try{var D=document.getElementById("hdn"+B);if(D.value==null){D.value=""}var A=getHtmlSrc(B);A=cleanWordContent(A);if(generateXHTML){A=getXHTML(A)}if(stripHTML(A.replace("&nbsp;"," "))==""&&A.toLowerCase().search("<hr")==-1&&A.toLowerCase().search("<img")==-1){A=""}if(encodeHTML){D.value=htmlEncode(A)}else{D.value=A}}catch(C){if(debugMode){alert(C)}}}function getHtmlSrc(A){try{var D=document.getElementById(A);if(D.contentWindow){var B=D.contentWindow.document}else{var B=D.document}return B.body.innerHTML}catch(C){if(debugMode){alert(C)}}}function setHtmlSrc(C,B){try{var F=document.getElementById(C);if(F.contentWindow){var D=F.contentWindow.document}else{var D=F.document}if(isIE){var A=htmlEncode(B);A=A.replace("%3CP%3E%0D%0A%3CHR%3E","%3CHR%3E");A=A.replace("%3CHR%3E%0D%0A%3C/P%3E","%3CHR%3E");D.body.innerHTML=htmlDecode(A)}else{B=strip160(B);D.body.innerHTML=B}}catch(E){if(debugMode){alert(E)}}}function strip160(A){newString="";for(i=0;i<A.length;i++){if(A.charCodeAt(i)==160){newString=newString+" "}else{newString=newString+A.charAt(i)}}return newString}function htmlEncode(A){return A.replace(/\&/ig,"&amp;").replace(/\</ig,"&lt;").replace(/\>/ig,"&gt;").replace(/\"/ig,"&quot;")}function htmlDecode(A){return A.replace(/\&amp\;/ig,"&").replace(/\&lt\;/ig,"<").replace(/\&gt\;/ig,">").replace(/\&quot\;/ig,'"')}function parse_webkit_version(A){try{var D=A.split(".");var B=(A[A.length-1]=="+");if(B){var C="+"}else{var C=parseInt(D[1]);if(isNaN(C)){C=""}}return{major:parseInt(D[0]),minor:C,is_nightly:B}}catch(E){if(debugMode){alert(E)}}}function get_webkit_version(){try{var B=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");var C=B.exec(navigator.userAgent);if(C){var A=parse_webkit_version(C[1])}return{major:A.major,minor:A.minor,is_nightly:A.is_nightly}}catch(D){}}function geckoKeyPress(A){try{var C=A.target.id;if(A.ctrlKey){var B=String.fromCharCode(A.charCode).toLowerCase();var D="";switch(B){case"b":D="bold";break;case"i":D="italic";break;case"u":D="underline";break}if(D){rteCommand(C,D);A.preventDefault();A.stopPropagation()}}}catch(E){if(debugMode){alert(E)}}}function evt_ie_keypress(A){try{ieKeyPress(A,rte)}catch(B){if(debugMode){alert(B)}}}function ieKeyPress(A,C){try{var B=(A.which||A.charCode||A.keyCode);var D=String.fromCharCode(B).toLowerCase()}catch(E){if(debugMode){alert(E)}}}function checkspell(){try{var A=new ActiveXObject("ieSpell.ieSpellExtension");A.CheckAllLinkedDocuments(document)}catch(B){if(B.number==-2146827859){if(confirm("ieSpell not detected.  Click Ok to go to download page.")){window.open("http://www.iespell.com/download.php","DownLoad")}}else{if(debugMode){alert("Error Loading ieSpell: Exception "+B.number)}}}}function raiseButton(B){try{var A=window.event.srcElement;className=A.className;if(className=="rteImage"||className=="rteImageLowered"){A.className="rteImageRaised"}}catch(B){if(debugMode){alert(B)}}}function normalButton(B){try{var A=window.event.srcElement;className=A.className;if(className=="rteImageRaised"||className=="rteImageLowered"){A.className="rteImage"}}catch(B){if(debugMode){alert(B)}}}function lowerButton(B){try{var A=window.event.srcElement;className=A.className;if(className=="rteImage"||className=="rteImageRaised"){A.className="rteImageLowered"}}catch(B){if(debugMode){alert(B)}}}function selectKeTag(C,B){var A=document.getElementById(B).selectedIndex;if(A!=0){var D=document.getElementById(B).options[A].value;setRange(C);currentRTE=C;insertHTML(D);document.getElementById(B).selectedIndex=0}};
