if(typeof HTMLElement!="undefined"){if(typeof HTMLElement.insertAdjacentHTML=="undefined"){HTMLElement.prototype.insertAdjacentElement=function(a,b){switch(a){case"beforeBegin":this.parentNode.insertBefore(b,this);break;case"afterBegin":this.insertBefore(b,this.firstChild);break;case"beforeEnd":this.appendChild(b);break;case"afterEnd":if(this.nextSibling){this.parentNode.insertBefore(b,this.nextSibling)}else{this.parentNode.appendChild(b)}break}}}if(typeof HTMLElement.insertAdjacentHTML=="undefined"){HTMLElement.prototype.insertAdjacentHTML=function(b,d){var c=this.ownerDocument.createRange();c.setStartBefore(this);var a=c.createContextualFragment(d);this.insertAdjacentElement(b,a)}}if(typeof HTMLElement.insertAdjacentText=="undefined"){HTMLElement.prototype.insertAdjacentText=function(b,c){var a=document.createTextNode(c);this.insertAdjacentElement(b,a)}}}var WYSIWYG={Settings:function(){this.ImagesDir="/openwysiwyg/images/";this.PopupsDir="/openwysiwyg/popups/";this.CSSFile="/openwysiwyg/styles/wysiwyg.css";this.Width="475px";this.Height="300px";this.DefaultStyle="font-family: Arial; font-size: 12px; background-color: #FFFFFF";this.DisabledStyle="font-family: Arial; font-size: 12px; background-color: #EEEEEE";this.PreviewWidth=480;this.PreviewHeight=400;this.RemoveFormatConfMessage="Clean HTML inserted by MS Word ?";this.NoValidBrowserMessage="openWYSIWYG does not support your browser.";this.AnchorPathToStrip="auto";this.ImagePathToStrip="auto";this.ContextMenu=true;this.StatusBarEnabled=true;this.InvertIELineBreaks=false;this.ReplaceLineBreaks=false;this.Opener="admin.asp";this.ImagePopupFile="";this.ImagePopupWidth=0;this.ImagePopupHeight=0;this.Toolbar=new Array();this.Toolbar[0]=new Array("bold","italic","underline","seperator","justifyfull","justifyleft","justifycenter","justifyright","seperator","unorderedlist","orderedlist","outdent","indent","seperator","undo","redo","seperator","removeformat","createlink");this.DropDowns=new Array();this.DropDowns.font={id:"fonts",command:"FontName",label:'<font style="font-family:{value};font-size:12px;">{value}</font>',width:"90px",elements:new Array("Arial","Sans Serif","Tahoma","Verdana","Courier New","Georgia","Times New Roman","Impact","Comic Sans MS")};this.DropDowns.fontsize={id:"fontsizes",command:"FontSize",label:'<font size="{value}">Size {value}</font>',width:"54px",elements:new Array("1","2","3","4","5","6","7")};this.DropDowns.headings={id:"headings",command:"FormatBlock",label:'<{value} style="margin:0px;text-decoration:none;font-family:Arial">{value}</{value}>',width:"74px",elements:new Array("H1","H2","H3","H4","H5","H6")};this.addToolbarElement=function(b,c,a){if(b!="seperator"){this.removeToolbarElement(b)}if(this.Toolbar[c-1]==null){this.Toolbar[c-1]=new Array()}this.Toolbar[c-1].splice(a+1,1,b)};this.removeToolbarElement=function(c){if(c=="seperator"){return}for(var b=0;b<this.Toolbar.length;b++){if(this.Toolbar[b]){var d=this.Toolbar[b];for(var a=0;a<d.length;a++){if(d[a]!=null&&d[a]==c){this.Toolbar[b].splice(a,1)}}}}};this.clearToolbar=function(a){if(typeof a=="undefined"){this.Toolbar=new Array()}else{this.Toolbar[a+1]=new Array()}}},ToolbarList:{bold:["Bold","Bold","bold.gif","bold_on.gif"],italic:["Italic","Italic","italics.gif","italics_on.gif"],underline:["Underline","Underline","underline.gif","underline_on.gif"],strikethrough:["Strikethrough","Strikethrough","strikethrough.gif","strikethrough_on.gif"],seperator:["","","seperator.gif","seperator.gif"],subscript:["Subscript","Subscript","subscript.gif","subscript_on.gif"],superscript:["Superscript","Superscript","superscript.gif","superscript_on.gif"],justifyleft:["Justifyleft","Justifyleft","justify_left.gif","justify_left_on.gif"],justifycenter:["Justifycenter","Justifycenter","justify_center.gif","justify_center_on.gif"],justifyright:["Justifyright","Justifyright","justify_right.gif","justify_right_on.gif"],justifyfull:["Justifyfull","Justifyfull","justify_justify.gif","justify_justify_on.gif"],unorderedlist:["InsertUnorderedList","Insert Unordered List","list_unordered.gif","list_unordered_on.gif"],orderedlist:["InsertOrderedList","Insert Ordered List","list_ordered.gif","list_ordered_on.gif"],outdent:["Outdent","Outdent","indent_left.gif","indent_left_on.gif"],indent:["Indent","Indent","indent_right.gif","indent_right_on.gif"],cut:["Cut","Cut","cut.gif","cut_on.gif"],copy:["Copy","Copy","copy.gif","copy_on.gif"],paste:["Paste","Paste","paste.gif","paste_on.gif"],forecolor:["ForeColor","Fore Color","forecolor.gif","forecolor_on.gif"],backcolor:["BackColor","Back Color","backcolor.gif","backcolor_on.gif"],undo:["Undo","Undo","undo.gif","undo_on.gif"],redo:["Redo","Redo","redo.gif","redo_on.gif"],inserttable:["InsertTable","Insert Table","insert_table.gif","insert_table_on.gif"],insertimage:["InsertImage","Insert Image","insert_picture.gif","insert_picture_on.gif"],createlink:["CreateLink","Create Link","insert_hyperlink.gif","insert_hyperlink_on.gif"],viewSource:["ViewSource","View Source","view_source.gif","view_source_on.gif"],viewText:["ViewText","View Text","view_text.gif","view_text_on.gif"],help:["Help","Help","help.gif","help_on.gif"],fonts:["Fonts","Select Font","select_font.gif","select_font_on.gif"],fontsizes:["Fontsizes","Select Size","select_size.gif","select_size_on.gif"],headings:["Headings","Select Size","select_heading.gif","select_heading_on.gif"],preview:["Preview","Preview","preview.gif","preview_on.gif"],print:["Print","Print","print.gif","print_on.gif"],removeformat:["RemoveFormat","Strip Word HTML","remove_format.gif","remove_format_on.gif"],"delete":["Delete","Delete","delete.gif","delete_on.gif"],save:["Save","Save document","save.gif","save_on.gif"],"return":["Return","Return without saving","return.gif","return_on.gif"],maximize:["Maximize","Maximize the editor","maximize.gif","maximize_on.gif"]},config:new Array(),viewTextMode:new Array(),maximized:new Array(),getRange:function(a){return a.createRange?a.createRange():a.getRangeAt(0)},getEditorDiv:function(a){return $("wysiwyg_div_"+a)},getEditorTable:function(a){return $("wysiwyg_table_"+a)},getEditor:function(a){return $("wysiwyg"+a)},getEditorWindow:function(a){return this.getEditor(a).contentWindow},attach:function(c,a){if(c!="all"){this.setSettings(c,a);WYSIWYG_Core.includeCSS(this.config[c].CSSFile);WYSIWYG_Core.addEvent(window,"load",function b(){WYSIWYG._generate(c,a)})}else{WYSIWYG_Core.addEvent(window,"load",function b(){WYSIWYG.attachAll(a)})}},attachAll:function(c){var a=document.getElementsByTagName("textarea");for(var b=0;b<a.length;b++){var d=a[b].getAttribute("id");if(d==null||d==""){continue}this.setSettings(d,c);WYSIWYG_Core.includeCSS(this.config[d].CSSFile);WYSIWYG._generate(d,c)}},display:function(c,b){if(c!="all"){this.setSettings(c,b);WYSIWYG_Core.includeCSS(this.config[c].CSSFile);WYSIWYG_Core.addEvent(window,"load",function a(){WYSIWYG._display(c,b)})}else{WYSIWYG_Core.addEvent(window,"load",function a(){WYSIWYG.displayAll(b)})}},displayAll:function(c){var a=document.getElementsByTagName("textarea");for(var b=0;b<a.length;b++){var d=a[b].getAttribute("id");if(d==null||d==""){continue}this.setSettings(d,c);WYSIWYG_Core.includeCSS(this.config[d].CSSFile);WYSIWYG._display(d,c)}},setSettings:function(b,a){if(typeof(a)!="object"){this.config[b]=new this.Settings()}else{this.config[b]=a}},insertImage:function(a,b,m,k,f,j,o,e,d){var l=this.getEditorWindow(d).document;var c=this.getSelection(d);var i=this.getRange(c);var h=this.findParent("img",i);var g=(h==null)?false:true;if(!g){h=l.createElement("img")}WYSIWYG_Core.setAttribute(h,"src",a);WYSIWYG_Core.setAttribute(h,"style","width:"+b+";height:"+m);if(k!=""){WYSIWYG_Core.setAttribute(h,"align",k)}else{h.removeAttribute("align")}WYSIWYG_Core.setAttribute(h,"border",f);WYSIWYG_Core.setAttribute(h,"alt",j);WYSIWYG_Core.setAttribute(h,"hspace",o);WYSIWYG_Core.setAttribute(h,"vspace",e);h.removeAttribute("width");h.removeAttribute("height");if(g){return}if(WYSIWYG_Core.isMSIE){i.pasteHTML(h.outerHTML)}else{this.insertNodeAtSelection(h,d)}},insertLink:function(c,k,a,j,b,f){var m=this.getEditorWindow(f).document;var e=this.getSelection(f);var i=this.getRange(e);var d=null;if(WYSIWYG_Core.isMSIE){if(e.type=="Control"&&i.length==1){i=this.getTextRange(i(0));i.select()}}d=this.findParent("a",i);var h=(d==null)?false:true;if(!h){d=m.createElement("a")}WYSIWYG_Core.setAttribute(d,"href",c);WYSIWYG_Core.setAttribute(d,"class",j);WYSIWYG_Core.setAttribute(d,"className",j);WYSIWYG_Core.setAttribute(d,"target",k);WYSIWYG_Core.setAttribute(d,"name",b);WYSIWYG_Core.setAttribute(d,"style",a);if(h){return}if(WYSIWYG_Core.isMSIE){i.select();d.innerHTML=i.htmlText;i.pasteHTML(d.outerHTML)}else{var g=i.startContainer;var l=i.startOffset;if(g.nodeType!=3){g=g.childNodes[l]}if(g.tagName){d.appendChild(g)}else{d.innerHTML=e}this.insertNodeAtSelection(d,f)}},removeFormat:function(c){if(!confirm(this.config[c].RemoveFormatConfMessage)){return}var a=this.getEditorWindow(c).document;var b=a.body.innerHTML;b=b.replace(/<span([^>])*>(&nbsp;)*\s*<\/span>/gi,"");b=b.replace(/<span[^>]*>/gi,"");b=b.replace(/<\/span[^>]*>/gi,"");b=b.replace(/<p([^>])*>(&nbsp;)*\s*<\/p>/gi,"");b=b.replace(/<p[^>]*>/gi,"");b=b.replace(/<\/p[^>]*>/gi,"");b=b.replace(/<h([^>])[0-9]>(&nbsp;)*\s*<\/h>/gi,"");b=b.replace(/<h[^>][0-9]>/gi,"");b=b.replace(/<\/h[^>][0-9]>/gi,"");b=b.replace(/<B [^>]*>/ig,"<b>");b=b.replace(/<DIV[^>]*>/ig,"");b=b.replace(/<\/DIV>/gi,"");b=b.replace(/<[\/\w?]+:[^>]*>/ig,"");b=b.replace(/(&nbsp;){2,}/ig,"&nbsp;");b=b.replace(/<STRONG>/ig,"");b=b.replace(/<\/STRONG>/ig,"");b=b.replace(/<TT>/ig,"");b=b.replace(/<\/TT>/ig,"");b=b.replace(/<FONT [^>]*>/ig,"");b=b.replace(/<\/FONT>/ig,"");b=b.replace(/STYLE=\"[^\"]*\"/ig,"");b=b.replace(/<([\w]+) class=([^ |>]*)([^>]*)/gi,"<$1$3");b=b.replace(/<([\w]+) style="([^"]*)"([^>]*)/gi,"<$1$3");b=b.replace(/width=([^ |>]*)([^>]*)/gi,"");b=b.replace(/classname=([^ |>]*)([^>]*)/gi,"");b=b.replace(/align=([^ |>]*)([^>]*)/gi,"");b=b.replace(/valign=([^ |>]*)([^>]*)/gi,"");b=b.replace(/<\\?\??xml[^>]>/gi,"");b=b.replace(/<\/?\w+:[^>]*>/gi,"");b=b.replace(/<st1:.*?>/gi,"");b=b.replace(/o:/gi,"");b=b.replace(/<!--([^>])*>(&nbsp;)*\s*<\/-->/gi,"");b=b.replace(/<!--[^>]*>/gi,"");b=b.replace(/<\/--[^>]*>/gi,"");a.body.innerHTML=b},_display:function(c,e){var j=$(c);if(j==null){alert("No textarea found with the given identifier (ID: "+c+").");return}if(!WYSIWYG_Core.isBrowserCompatible()){if(this.config[c].NoValidBrowserMessage!=""){alert(this.config[c].NoValidBrowserMessage)}return}if(typeof(e)!="object"){this.config[c]=new this.Settings()}else{this.config[c]=e}j.style.display="none";if(j.style.width){this.config[c].Width=j.style.width}if(j.style.height){this.config[c].Height=j.style.height}var b=this.config[c].Width;var d=this.config[c].Height;var g="100%";var a="100%";if(b.search(/%/)==-1){g=b;a=d}var f='<table cellpadding="0" cellspacing="0" border="0" style="width:'+b+"; height:"+d+';" class="tableTextareaEditor"><tr><td valign="top">\n<iframe frameborder="0" id="wysiwyg'+c+'" class="iframeText" style="width:'+g+";height:"+a+';"></iframe>\n</td></tr></table>\n';j.insertAdjacentHTML("afterEnd",f);var h=j.value;var i=this.getEditorWindow(c).document;if(this.config[c].ReplaceLineBreaks){h=h.replace(/(\r\n)|(\n)/ig,"<br>")}i.open();i.write(h);i.close();WYSIWYG_Core.setAttribute(i.body,"style",this.config[c].DefaultStyle)},_generate:function(s,z){var o=$(s);if(o==null){alert("No textarea found with the given identifier (ID: "+s+").");return}if(!WYSIWYG_Core.isBrowserCompatible()){if(this.config[s].NoValidBrowserMessage!=""){alert(this.config[s].NoValidBrowserMessage)}return}o.style.display="none";if(o.style.width){this.config[s].Width=o.style.width}if(o.style.height){this.config[s].Height=o.style.height}var g=this.config[s].Width;var d=this.config[s].Height;var p=g;var y="100%";var h="100%";if(g.search(/%/)==-1){p=g.replace(/px/gi,"");p=(parseFloat(p)+2)+"px";y=g;h=d}var f="";f+='<div id="wysiwyg_div_'+s+'" style="width:'+g+';">';f+='<table border="0" cellpadding="0" cellspacing="0" class="tableTextareaEditor" id="wysiwyg_table_'+s+'" style="width:'+g+"; height:"+d+';">';f+='<tr><td style="height:22px;vertical-align:top;">';for(var u=0;u<this.config[s].Toolbar.length;u++){if(this.config[s].Toolbar[u]&&this.config[s].Toolbar[u].length>0){var l=this.config[s].Toolbar[u];f+='<table border="0" cellpadding="0" cellspacing="0" class="toolbar1" style="width:100%;" id="toolbar'+u+"_"+s+'">';f+='<tr><td style="width:6px;"><img src="'+this.config[s].ImagesDir+'seperator2.gif" alt="" hspace="3"></td>';for(var v=0;v<l.length;v++){var q=l[v];if(l[v]){if(typeof(this.config[s].DropDowns[q])!="undefined"){var w=this.config[s].DropDowns[q];f+='<td style="width: '+w.width+';">';f+=this.writeDropDown(s,q);f+="</td>"}else{var A=this.ToolbarList[l[v]];if(A){var C=A[0];var a=A[1];var r=this.config[s].ImagesDir+A[2];var b=this.config[s].ImagesDir+A[3];if(l[v]=="seperator"){f+='<td style="width: 12px;" align="center">';f+='<img src="'+r+'" border=0 unselectable="on" width="2" height="18" hspace="2" unselectable="on">';f+="</td>"}else{if(l[v]=="viewSource"){f+='<td style="width: 22px;">';f+='<span id="HTMLMode'+s+'"><img src="'+r+'" border="0" unselectable="on" title="'+a+'" id="'+C+'" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\''+b+"';\" onmouseout=\"this.className='buttonEditor'; this.src='"+r+"';\" onclick=\"WYSIWYG.execCommand('"+s+"', '"+C+'\');" unselectable="on" width="20" height="20"></span>';f+='<span id="textMode'+s+'"><img src="'+this.config[s].ImagesDir+'view_text.gif" border="0" unselectable="on" title="viewText" id="ViewText" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\''+this.config[s].ImagesDir+"view_text_on.gif';\" onmouseout=\"this.className='buttonEditor'; this.src='"+this.config[s].ImagesDir+"view_text.gif';\" onclick=\"WYSIWYG.execCommand('"+s+'\',\'ViewText\');" unselectable="on"  width="20" height="20"></span>';f+="</td>"}else{f+='<td style="width: 22px;">';f+='<img src="'+r+'" border=0 unselectable="on" title="'+a+'" id="'+C+'" class="buttonEditor" onmouseover="this.className=\'buttonEditorOver\'; this.src=\''+b+"';\" onmouseout=\"this.className='buttonEditor'; this.src='"+r+"';\" onclick=\"WYSIWYG.execCommand('"+s+"', '"+C+'\');" unselectable="on" width="20" height="20">';f+="</td>"}}}}}}f+="<td>&nbsp;</td></tr></table>"}}f+='</td></tr><tr><td valign="top">\n';f+='<iframe frameborder="0" id="wysiwyg'+s+'" class="iframeText" style="width:100%;height:'+d+';"></iframe>\n</td></tr>';if(this.config[s].StatusBarEnabled){f+='<tr><td class="wysiwyg-statusbar" style="height:10px;" id="wysiwyg_statusbar_'+s+'">&nbsp;</td></tr>'}f+="</table>";f+="</div>";o.insertAdjacentHTML("afterEnd",f);if($("textMode"+s)){$("textMode"+s).style.display="none"}var t=o.value;var B=this.getEditorWindow(s).document;if(this.config[s].ReplaceLineBreaks){t=t.replace(/\n\r|\n/ig,"<br>")}B.open();B.write(t);B.close();if(B.body.contentEditable){B.body.contentEditable=true}else{B.designMode="on"}WYSIWYG_Core.setAttribute(B.body,"style",this.config[s].DefaultStyle);WYSIWYG_Table.refreshHighlighting(s);for(var m=0;m<document.forms.length;m++){WYSIWYG_Core.addEvent(document.forms[m],"submit",function e(){WYSIWYG.updateTextArea(s)})}WYSIWYG_Core.addEvent(B,"mouseover",function k(){WYSIWYG.closeDropDowns(s)});if(this.config[s].InvertIELineBreaks){WYSIWYG_Core.addEvent(B,"keypress",function x(){WYSIWYG.invertIELineBreakCapability(s)})}if(this.config[s].StatusBarEnabled){WYSIWYG_Core.addEvent(B,"mouseup",function c(){WYSIWYG.updateStatusBar(s)})}if(this.config[s].ContextMenu){WYSIWYG_ContextMenu.init(s)}this.viewTextMode[s]=false},disable:function(b){var a=this.getEditorWindow(b);if(a==null){alert("No editor found with the given identifier (ID: "+b+").");return}if(a){if(a.document.body.contentEditable){a.document.body.contentEditable=false}else{a.document.designMode="Off"}WYSIWYG_Core.setAttribute(a.document.body,"style",this.config[b].DisabledStyle);this.hideStatusBar(b);this.hideToolbars(b)}},enable:function(b){var a=this.getEditorWindow(b);if(a==null){alert("No editor found with the given identifier (ID: "+b+").");return}if(a){if(a.document.body.contentEditable){a.document.body.contentEditable=true}else{a.document.designMode="On"}WYSIWYG_Core.setAttribute(a.document.body,"style",this.config[b].DefaultStyle);this.showStatusBar(b);this.showToolbars(b)}},getNodeTree:function(g){var f=this.getSelection(g);var b=this.getRange(f);var a=this.getTag(b);if(a==null){return}var d=this.getParent(a);var e=new Array(a);var c=1;while(d!=null&&d.nodeName!="#document"){e[c]=d;d=this.getParent(d);c++}return e},removeNode:function(g){var e=this.getSelection(g);var b=this.getRange(e);var a=this.getTag(b);var d=a.parentNode;if(a==null||d==null){return}if(a.nodeName=="HTML"||a.nodeName=="BODY"){return}var f=new Array();for(var c=0;c<a.childNodes.length;c++){f[c]=a.childNodes[c]}for(var c=0;c<f.length;c++){d.insertBefore(f[c],a)}d.removeChild(a);if(d.nodeName=="A"&&!d.hasChildNodes()){if(d.parentNode){d.parentNode.removeChild(d)}}this.updateStatusBar(g)},getSelection:function(d){var a=this.getEditorWindow(d);var c=a.document;var b=null;if(a.getSelection){b=a.getSelection()}else{if(c.getSelection){b=c.getSelection()}else{if(c.selection){b=c.selection}}}return b},updateStatusBar:function(f){var e=this.getNodeTree(f);if(e==null){return}var c="";var a=e.length-1;for(var b=a;b>=0;b--){if(e[b].nodeName!="HTML"&&e[b].nodeName!="BODY"){c+='<a class="wysiwyg-statusbar" href="javascript:WYSIWYG.selectNode(\''+f+"',"+b+');">'+e[b].nodeName+"</a>"}else{c+=e[b].nodeName}if(b>0){c+=" > "}}var d=$("wysiwyg_statusbar_"+f);if(d){d.innerHTML=c}},execCommand:function(b,c,o){this.getEditorWindow(b).focus();var l=new Array("ViewText","Print");var m=false;for(var g=0;g<l.length;g++){if(l[g]==c){m=true}}if(this.viewTextMode[b]&&!m){alert("You are in TEXT Mode. This feature has been disabled.");return}var h=WYSIWYG_Core.isMSIE?WYSIWYG_Core._dec_to_rgb:WYSIWYG_Core.toHexColor;var e={left:parseInt(window.screen.availWidth/3),top:parseInt(window.screen.availHeight/3)};var j=this.config[b].PopupsDir+"insert_image.html";var d=400;var p=210;if(typeof this.config[b].ImagePopupFile!="undefined"&&this.config[b].ImagePopupFile!=""){j=this.config[b].ImagePopupFile}if(typeof this.config[b].ImagePopupWidth&&this.config[b].ImagePopupWidth>0){d=this.config[b].ImagePopupWidth}if(typeof this.config[b].ImagePopupHeight&&this.config[b].ImagePopupHeight>0){p=this.config[b].ImagePopupHeight}switch(c){case"Maximize":this.maximize(b);break;case"FormatBlock":WYSIWYG_Core.execCommand(b,c,"<"+o+">");break;case"ForeColor":var k=this.getEditorWindow(b).document.queryCommandValue(c);var f=k!=""?h(this.getEditorWindow(b).document.queryCommandValue(c)):"000000";window.open(this.config[b].PopupsDir+"select_color.html?color="+f+"&command="+c+"&wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,width=210,height=165,top="+e.top+",left="+e.left).focus();break;case"BackColor":var f=h(this.getEditorWindow(b).document.queryCommandValue(c));window.open(this.config[b].PopupsDir+"select_color.html?color="+f+"&command="+c+"&wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,width=210,height=165,top="+e.top+",left="+e.left).focus();break;case"InsertImage":window.open(j+"?wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,resizable=0,width="+d+",height="+p+",top="+e.top+",left="+e.left).focus();break;case"RemoveImage":this.removeImage(b);break;case"RemoveLink":this.removeLink(b);break;case"RemoveNode":this.removeNode(b);break;case"CreateLink":window.open(this.config[b].PopupsDir+"insert_hyperlink.html?wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,resizable=0,width=350,height=160,top="+e.top+",left="+e.left).focus();break;case"InsertTable":window.open(this.config[b].PopupsDir+"create_table.html?wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,resizable=0,width=500,height=260,top="+e.top+",left="+e.left).focus();break;case"ViewSource":this.viewSource(b);break;case"ViewText":this.viewText(b);break;case"Help":window.open(this.config[b].PopupsDir+"about.html?wysiwyg="+b,"popup","location=0,status=0,scrollbars=0,resizable=0,width=400,height=350,top="+e.top+",left="+e.left).focus();break;case"RemoveFormat":this.removeFormat(b);break;case"Preview":window.open(this.config[b].PopupsDir+"preview.html?wysiwyg="+b,"popup","location=0,status=0,scrollbars=1,resizable=1,width="+this.config[b].PreviewWidth+",height="+this.config[b].PreviewHeight+",top="+e.top+",left="+e.left).focus();break;case"Print":this.print(b);break;case"Save":WYSIWYG.updateTextArea(b);var a=WYSIWYG_Core.findParentNode("FORM",this.getEditor(b));if(a==null){alert("Can not submit the content, because no form element found.");return}a.submit();break;case"Return":location.replace(this.config[b].Opener);break;default:WYSIWYG_Core.execCommand(b,c,o)}this.closeDropDowns(b)},maximize:function(f){var e=this.getEditorDiv(f);var a=this.getEditorTable(f);var d=this.getEditor(f);var c=this.config[f];var b=WYSIWYG_Core.windowSize();b.width-=5;if(this.maximized[f]){WYSIWYG_Core.setAttribute(e,"style","position:static;z-index:9998;top:0px;left:0px;width:"+c.Width+";height:100%;");WYSIWYG_Core.setAttribute(a,"style","width:"+c.Width+";height:"+c.Height+";");WYSIWYG_Core.setAttribute(d,"style","width:100%;height:"+c.Height+";");this.maximized[f]=false}else{WYSIWYG_Core.setAttribute(e,"style","position:absolute;z-index:9998;top:0px;left:0px;width:"+b.width+"px;height:"+b.height+"px;");WYSIWYG_Core.setAttribute(a,"style","width:100%;height:100%;");WYSIWYG_Core.setAttribute(d,"style","width:100%;height:100%;");this.maximized[f]=true}},insertHTML:function(a,c){if(WYSIWYG_Core.isMSIE){this.getEditorWindow(c).document.selection.createRange().pasteHTML(a)}else{var b=this.getEditorWindow(c).document.createElement("span");b.innerHTML=a;this.insertNodeAtSelection(b,c)}},insertNodeAtSelection:function(g,c){var o=this.getEditorWindow(c).document;var b=this.getSelection(c);var h=b.getRangeAt(0);b.removeAllRanges();h.deleteContents();var a=h.startContainer;var m=h.startOffset;h=o.createRange();if(a.nodeType==3&&g.nodeType==3){a.insertData(m,g.data);h.setEnd(a,m+g.length);h.setStart(a,m+g.length)}else{var d;var l;if(a.nodeType==3){var f=a;a=f.parentNode;var p=f.nodeValue;var k=p.substr(0,m);var j=p.substr(m);l=document.createTextNode(k);d=document.createTextNode(j);a.insertBefore(d,f);a.insertBefore(g,d);a.insertBefore(l,g);a.removeChild(f)}else{d=a.childNodes[m];a.insertBefore(g,d)}try{h.setEnd(d,0);h.setStart(d,0)}catch(i){alert(i)}}b.addRange(h)},print:function(f){if(document.all&&navigator.appVersion.substring(22,23)==4){var c=this.getEditorWindow(f).document;c.focus();var a=6;var e=2;var b=1;var d='<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';c.body.insertAdjacentHTML("beforeEnd",d);d.ExecWB(a,e);d.outerHTML=""}else{this.getEditorWindow(f).print()}},writeDropDown:function(b,a){var k=this.config[b].DropDowns[a];var j=this.ToolbarList[k.id];var d=this.config[b].ImagesDir+j[2];var f=this.config[b].ImagesDir+j[3];k.elements.sort();var c="";c+='<table border="0" cellpadding="0" cellspacing="0"><tr>';c+="<td onMouseOver=\"$('img_"+k.id+"_"+b+"').src='"+f+"';\" onMouseOut=\"$('img_"+k.id+"_"+b+"').src='"+d+"';\">";c+='<img src="'+d+'" id="img_'+k.id+"_"+b+'" height="20" onClick="WYSIWYG.openDropDown(\''+b+"','"+k.id+'\');" unselectable="on" border="0"><br>';c+='<span id="elm_'+k.id+"_"+b+'" class="dropdown" style="width: 145px;display:none;">';for(var e=0;e<k.elements.length;e++){if(k.elements[e]){var h=k.elements[e];var g=k.label.replace(/{value}/gi,h);c+='<button type="button" onClick="WYSIWYG.execCommand(\''+b+"','"+k.command+"','"+h+'\');" onMouseOver="this.className=\'mouseOver\'" onMouseOut="this.className=\'mouseOut\'" class="mouseOut" style="width: 120px;">';c+='<table cellpadding="0" cellspacing="0" border="0"><tr>';c+='<td align="left">'+g+"</td>";c+="</tr></table></button><br>"}}c+="</span></td></tr></table>";return c},closeDropDowns:function(f,b){if(typeof(b)=="undefined"){b=""}var c=this.config[f].DropDowns;for(var e in c){var d=c[e];if(d.id!=b){var a="elm_"+d.id+"_"+f;if($(a)){$(a).style.display="none"}}}},openDropDown:function(c,b){var a="elm_"+b+"_"+c;if($(a).style.display=="none"){$(a).style.display="block"}else{$(a).style.display="none"}$(a).style.position="absolute";this.closeDropDowns(c,b)},viewSource:function(d){var c=this.getEditorWindow(d).document;WYSIWYG_Table.disableHighlighting(d);if(WYSIWYG_Core.isMSIE){var a=c.body.innerHTML;a=this.stripURLPath(d,a);a=WYSIWYG_Core.replaceRGBWithHexColor(a);c.body.innerText=a}else{var b=WYSIWYG_Core.replaceRGBWithHexColor(c.body.innerHTML);b=document.createTextNode(b);c.body.innerHTML="";c.body.appendChild(b)}if($("HTMLMode"+d)){$("HTMLMode"+d).style.display="none"}if($("textMode"+d)){$("textMode"+d).style.display="block"}c.body.style.fontSize="12px";c.body.style.fontFamily="Courier New";this.viewTextMode[d]=true},viewText:function(d){var b=this.getEditorWindow(d).document;if(WYSIWYG_Core.isMSIE){var c=b.body.innerText;c=this.stripURLPath(d,c);c=WYSIWYG_Core.replaceRGBWithHexColor(c);b.body.innerHTML=c}else{var a=b.body.ownerDocument.createRange();a.selectNodeContents(b.body);a=WYSIWYG_Core.replaceRGBWithHexColor(a.toString());b.body.innerHTML=a}WYSIWYG_Table.refreshHighlighting(d);if($("textMode"+d)){$("textMode"+d).style.display="none"}if($("HTMLMode"+d)){$("HTMLMode"+d).style.display="block"}WYSIWYG_Core.setAttribute(b.body,"style",this.config[d].DefaultStyle);this.viewTextMode[d]=false},stripURLPath:function(n,content,exact){if(typeof exact=="undefined"){exact=true}var stripImgageUrl=null;var stripAnchorUrl=null;if(this.config[n].AnchorPathToStrip=="auto"){stripAnchorUrl=WYSIWYG_Core.getDocumentUrl(document)}else{if(this.config[n].AnchorPathToStrip!=""){stripAnchorUrl=this.config[n].AnchorPathToStrip}}if(this.config[n].ImagePathToStrip=="auto"){stripImgageUrl=WYSIWYG_Core.getDocumentUrl(document)}else{if(this.config[n].ImagePathToStrip!=""){stripImgageUrl=this.config[n].ImagePathToStrip}}var url;var regex;var result;if(stripImgageUrl){url=WYSIWYG_Core.stringToRegex(WYSIWYG_Core.getDocumentPathOfUrl(stripImgageUrl));if(exact){regex=eval('/(src=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}result=WYSIWYG_Core.getDocumentPathOfUrl(stripImgageUrl).match(/.+[\/]{2,3}[^\/]*/,"");if(result){url=WYSIWYG_Core.stringToRegex(result[0]);if(exact){regex=eval('/(src=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}}if(stripAnchorUrl){url=WYSIWYG_Core.stringToRegex(WYSIWYG_Core.getDocumentPathOfUrl(stripAnchorUrl));if(exact){regex=eval('/(href=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}result=WYSIWYG_Core.getDocumentPathOfUrl(stripAnchorUrl).match(/.+[\/]{2,3}[^\/]*/,"");if(result){url=WYSIWYG_Core.stringToRegex(result[0]);if(exact){regex=eval('/(href=")('+url+')([^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}url=WYSIWYG_Core.stringToRegex(stripAnchorUrl);if(exact){regex=eval('/(href=")('+url+')(#[^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}url=WYSIWYG_Core.getDocumentUrl(document);var pos=url.lastIndexOf("/");if(pos!=-1){url=url.substring(pos+1,url.length);url=WYSIWYG_Core.stringToRegex(url);if(exact){regex=eval('/(href=")('+url+')(#[^"]*)/gi');content=content.replace(regex,"$1$3")}else{regex=eval("/("+url+")(.+)/gi");content=content.replace(regex,"$2")}}}return content},updateTextArea:function(b){if(this.viewTextMode[b]){this.viewText(b)}var a=this.getEditorWindow(b).document.body.innerHTML;a=this.stripURLPath(b,a);a=WYSIWYG_Core.replaceRGBWithHexColor(a);if(this.config[b].ReplaceLineBreaks){a=a.replace(/(\r\n)|(\n)/ig,"")}$(b).value=a},hideToolbars:function(c){for(var a=0;a<this.config[c].Toolbar.length;a++){var b=$("toolbar"+a+"_"+c);if(b){b.style.display="none"}}},showToolbars:function(c){for(var a=0;a<this.config[c].Toolbar.length;a++){var b=$("toolbar"+a+"_"+c);if(b){b.style.display=""}}},hideStatusBar:function(b){var a=$("wysiwyg_statusbar_"+b);if(a){a.style.display="none"}},showStatusBar:function(b){var a=$("wysiwyg_statusbar_"+b);if(a){a.style.display=""}},findParent:function(a,c){a=a.toUpperCase();var b;var g=null;try{if(!WYSIWYG_Core.isMSIE){var d=c.startContainer;var h=c.startOffset;if(d.nodeType!=3){d=d.childNodes[h]}return WYSIWYG_Core.findParentNode(a,d)}else{g=(c.length>0)?c.item(0):c.parentElement();g=WYSIWYG_Core.findParentNode(a,g);if(g!=null){return g}b=c.duplicate();b.collapse(true);b.moveEnd("character",1);if(b.text.length>0){while(b.compareEndPoints("EndToEnd",c)<0){b.move("Character");if(null!=this.findParentTag(a,b)){return this.findParentTag(a,b)}}}return null}}catch(f){return null}},getTag:function(a){try{if(!WYSIWYG_Core.isMSIE){var b=a.startContainer;var d=a.startOffset;if(b.nodeType!=3){b=b.childNodes[d]}if(b.nodeName&&b.nodeName.search(/#/)!=-1){return b.parentNode}return b}else{if(a.length>0){return a.item(0)}else{if(a.parentElement()){return a.parentElement()}}}return null}catch(c){return null}},getParent:function(a){if(a.parentNode){return a.parentNode}return null},getTextRange:function(b){var a=b.parentTextEdit.createTextRange();a.moveToElementText(b);return a},invertIELineBreakCapability:function(c){var a=this.getEditorWindow(c);var b;if(a.event.keyCode==13){if(!a.event.shiftKey){b=this.getRange(this.getSelection(c));b.pasteHTML("<br>");a.event.cancelBubble=true;a.event.returnValue=false;b.select();b.moveEnd("character",1);b.moveStart("character",1);b.collapse(false);return false}else{b=this.getRange(this.getSelection(c));b.pasteHTML("<p>");a.event.cancelBubble=true;a.event.returnValue=false;b.select();b.moveEnd("character",1);b.moveStart("character",1);b.collapse(false);return false}}},selectNode:function(g,f){var e=this.getSelection(g);var a=this.getRange(e);var b=this.getTag(a);var c=0;for(var d=b;(d&&(d.nodeType==1));d=d.parentNode){if(c==f){this.nodeSelection(g,d)}c++}this.updateStatusBar(g)},nodeSelection:function(g,b){var f=this.getEditorWindow(g).document;var c=this.getSelection(g);var a=this.getRange(c);if(!WYSIWYG_Core.isMSIE){if(b.nodeName=="BODY"){a.selectNodeContents(b)}else{a.selectNode(b)}if(c){c.removeAllRanges()}if(c){c.addRange(a)}}else{if((b.nodeName=="TABLE")||(b.nodeName=="IMG")||(b.nodeName=="INPUT")||(b.nodeName=="SELECT")||(b.nodeName=="TEXTAREA")){try{a=f.body.createControlRange();a.addElement(b);a.select()}catch(d){}}else{a=f.body.createTextRange();if(a){a.collapse();if(a.moveToElementText){try{a.moveToElementText(b);a.select()}catch(d){try{a=f.body.createTextRange();a.moveToElementText(b);a.select()}catch(d){}}}else{try{a=f.body.createTextRange();a.moveToElementText(b);a.select()}catch(d){}}}}}}};var WYSIWYG_Core={isMSIE:navigator.appName=="Microsoft Internet Explorer"?true:false,isFF:!document.all&&document.getElementById&&!this.isOpera,isOpera:navigator.appName=="Opera"?true:false,trim:function(a){return a.replace(/^\s*|\s*$/g,"")},defined:function(a){return typeof a=="undefined"?false:true},isBrowserCompatible:function(){if(!document.getElementById||!document.designMode||(!document.selection&&typeof document.createRange=="undefined")){return false}return true},_setStyleAttribute:function(c,b){if(b==null){return}var n=b.split(";");var l;for(var f=0;f<n.length;f++){var d=n[f].split(":");if(d.length==2){try{var j=WYSIWYG_Core.trim(d[0]);while((l=j.search(/-/))!=-1){var k=j.substring(0,l);var g=j.substring(l+1,l+2);var a=j.substring(l+2,j.length);j=k+g.toUpperCase()+a}var m=WYSIWYG_Core.trim(d[1]).toLowerCase();c.style[j]=m}catch(h){alert(h)}}}},_getStyleAttribute:function(a){if(this.isMSIE){return a.style.cssText.toLowerCase()}else{return a.getAttribute("style")}},setAttribute:function(b,a,c){if(c==null||b==null||a==null){return}if(a.toLowerCase()=="style"){this._setStyleAttribute(b,c)}else{b.setAttribute(a,c)}},removeAttribute:function(b,a){b.removeAttribute(a,false)},getAttribute:function(b,a){if(b==null||a==null){return}if(a.toLowerCase()=="style"){return this._getStyleAttribute(b)}else{return b.getAttribute(a)}},getDocumentPathOfUrl:function(a){var b=null;a=a.replace(/file:\/\//gi,"file:///");a=a.replace(/\\/gi,"/");var c=a.lastIndexOf("/");if(c!=-1){b=a.substring(0,c+1)}return b},getDocumentUrl:function(b){var a=b.URL;a=a.replace(/file:\/\//gi,"file:///");a=a.replace(/\\/gi,"/");return a},findParentNode:function(a,b){while(b.tagName!="HTML"){if(b.tagName==a){return b}b=b.parentNode}return null},cancelEvent:function(a){if(!a){return false}if(this.isMSIE){a.returnValue=false;a.cancelBubble=true}else{a.preventDefault();a.stopPropagation&&a.stopPropagation()}return false},toHexColor:function(c){c=c.replace(/^rgb/g,"");c=c.replace(/\(/g,"");c=c.replace(/\)/g,"");c=c.replace(/ /g,"");c=c.split(",");var e=parseFloat(c[0]).toString(16).toUpperCase();var d=parseFloat(c[1]).toString(16).toUpperCase();var a=parseFloat(c[2]).toString(16).toUpperCase();if(e.length<2){e="0"+e}if(d.length<2){d="0"+d}if(a.length<2){a="0"+a}return e+d+a},_dec_to_rgb:function(d){var b="";for(var a=0;a<3;a++){var c=d&255;d>>=8;var e=c&15;var f=(c>>4)&15;b+=f.toString(16);b+=e.toString(16)}return b.toUpperCase()},replaceRGBWithHexColor:function(str){if(str==null){return""}var matcher=str.match(/rgb\([0-9 ]+,[0-9 ]+,[0-9 ]+\)/gi);if(matcher){for(var j=0;j<matcher.length;j++){var regex=eval("/"+WYSIWYG_Core.stringToRegex(matcher[j])+"/gi");str=str.replace(regex,"#"+this.toHexColor(matcher[j]))}}return str},execCommand:function(d,b,a){if(typeof(a)=="undefined"){a=null}if(b=="BackColor"&&WYSIWYG_Core.isFF){b="HiliteColor"}if(WYSIWYG_Core.isFF&&(b=="Cut"||b=="Paste"||b=="Copy")){try{WYSIWYG.getEditorWindow(d).document.execCommand(b,false,a)}catch(c){if(confirm("Copy/Cut/Paste is not available in Mozilla and Firefox\nDo you want more information about this issue?")){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html")}}}else{WYSIWYG.getEditorWindow(d).document.execCommand(b,false,a)}},stringToRegex:function(a){a=a.replace(/\//gi,"\\/");a=a.replace(/\(/gi,"\\(");a=a.replace(/\)/gi,"\\)");a=a.replace(/\[/gi,"\\[");a=a.replace(/\]/gi,"\\]");a=a.replace(/\+/gi,"\\+");a=a.replace(/\$/gi,"\\$");a=a.replace(/\*/gi,"\\*");a=a.replace(/\?/gi,"\\?");a=a.replace(/\^/gi,"\\^");a=a.replace(/\\b/gi,"\\\\b");a=a.replace(/\\B/gi,"\\\\B");a=a.replace(/\\d/gi,"\\\\d");a=a.replace(/\\B/gi,"\\\\B");a=a.replace(/\\D/gi,"\\\\D");a=a.replace(/\\f/gi,"\\\\f");a=a.replace(/\\n/gi,"\\\\n");a=a.replace(/\\r/gi,"\\\\r");a=a.replace(/\\t/gi,"\\\\t");a=a.replace(/\\v/gi,"\\\\v");a=a.replace(/\\s/gi,"\\\\s");a=a.replace(/\\S/gi,"\\\\S");a=a.replace(/\\w/gi,"\\\\w");a=a.replace(/\\W/gi,"\\\\W");return a},addEvent:function(b,a,c){if(b.attachEvent){b.attachEvent("on"+a,c)}else{b.addEventListener(a,c,false)}},removeEvent:function(b,a,c){if(b.attachEvent){b.detachEvent("on"+a,c)}else{b.removeEventListener(a,c,false)}},includeJS:function(c){var a=document.createElement("script");this.setAttribute(a,"type","text/javascript");this.setAttribute(a,"src",c);var d=document.getElementsByTagName("head");for(var b=0;b<d.length;b++){d[b].appendChild(a)}},includeCSS:function(d){var c=document.createElement("link");this.setAttribute(c,"rel","stylesheet");this.setAttribute(c,"type","text/css");this.setAttribute(c,"href",d);var b=document.getElementsByTagName("head");for(var a=0;a<b.length;a++){b[a].appendChild(c)}},getElementPosition:function(b,a){var d=0,c=0;while(b&&b!=a){c+=b.offsetLeft;d+=b.offsetTop;b=b.offsetParent}return{left:c,top:d}},windowSize:function(){if(window.innerWidth){return{width:window.innerWidth,height:window.innerHeight}}else{if(document.body&&document.body.offsetWidth){return{width:document.body.offsetWidth,height:document.body.offsetHeight}}else{return{width:0,height:0}}}}};var WYSIWYG_ContextMenu={html:"",contextMenuDiv:null,init:function(c){var b=WYSIWYG.getEditorWindow(c).document;this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="wysiwyg-context-menu-div";this.contextMenuDiv.setAttribute("class","wysiwyg-context-menu-div");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position="absolute";this.contextMenuDiv.style.zIndex=9999;this.contextMenuDiv.style.left="0";this.contextMenuDiv.style.top="0";this.contextMenuDiv.unselectable="on";document.body.insertBefore(this.contextMenuDiv,document.body.firstChild);WYSIWYG_Core.addEvent(b,"contextmenu",function a(d){WYSIWYG_ContextMenu.show(d,c)});WYSIWYG_Core.addEvent(b,"click",function a(d){WYSIWYG_ContextMenu.close()});WYSIWYG_Core.addEvent(b,"keydown",function a(d){WYSIWYG_ContextMenu.close()});WYSIWYG_Core.addEvent(document,"click",function a(d){WYSIWYG_ContextMenu.close()})},show:function(d,h){if(this.contextMenuDiv==null){return false}var b=WYSIWYG.getEditor(h);var c=WYSIWYG.getEditorWindow(h).document;var g=WYSIWYG_Core.getElementPosition(b);var a=WYSIWYG_Core.isMSIE?g.left+d.clientX:g.left+(d.pageX-c.body.scrollLeft);var f=WYSIWYG_Core.isMSIE?g.top+d.clientY:g.top+(d.pageY-c.body.scrollTop);this.contextMenuDiv.style.left=a+"px";this.contextMenuDiv.style.top=f+"px";this.contextMenuDiv.style.visibility="visible";this.contextMenuDiv.style.display="block";window.setTimeout("WYSIWYG_ContextMenu.output('"+h+"')",10);WYSIWYG_Core.cancelEvent(d);return false},output:function(b){var a=WYSIWYG.getSelection(b);var f=WYSIWYG.getRange(a);var m=WYSIWYG.getTag(f);if(m==null){return}this.clear();var d=(m.nodeName=="IMG")?true:false;var c=(m.nodeName=="A")?true:false;var g=0;if(WYSIWYG_Core.isMSIE){g=(document.selection&&f.text)?f.text.length:0}else{g=f.toString().length}var a=g!=0||d;var e={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.createlink[3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.createlink[2]};var k={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.insertimage[3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.insertimage[2]};var l={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList["delete"][3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList["delete"][2]};var j={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.copy[3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.copy[2]};var i={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.cut[3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.cut[2]};var h={enabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.paste[3],disabled:WYSIWYG.config[b].ImagesDir+WYSIWYG.ToolbarList.paste[2]};this.html+='<table class="wysiwyg-context-menu" border="0" cellpadding="0" cellspacing="0">';this.addItem(b,"Copy",j,"Copy",a);this.addItem(b,"Cut",i,"Cut",a);this.addItem(b,"Paste",h,"Paste",true);this.addSeperator();this.addItem(b,"InsertImage",k,"Modify Image Properties...",d);this.addItem(b,"CreateLink",e,"Create or Modify Link...",a||c);this.addItem(b,"RemoveNode",l,"Remove",true);this.html+="</table>";this.contextMenuDiv.innerHTML=this.html},close:function(){this.contextMenuDiv.style.visibility="hidden";this.contextMenuDiv.style.display="none"},clear:function(){this.contextMenuDiv.innerHTML="";this.html=""},addItem:function(f,d,b,e,a){var c="";if(a){c+="<tr>";c+='<td class="icon"><a href="javascript:WYSIWYG.execCommand(\''+f+"','"+d+'\', null);"><img src="'+b.enabled+'" border="0"></a></td>';c+="<td onmouseover=\"this.className='mouseover'\" onmouseout=\"this.className=''\" onclick=\"WYSIWYG.execCommand('"+f+"', '"+d+'\', null);WYSIWYG_ContextMenu.close();"><a href="javascript:void(0);">'+e+"</a></td>";c+="</tr>"}else{c+="<tr>";c+='<td class="icon"><img src="'+b.disabled+'" border="0"></td>';c+='<td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'"><span class="disabled">'+e+"</span></td>";c+="</tr>"}this.html+=c},addSeperator:function(){var a="";a+="<tr>";a+='<td colspan="2" style="text-align:center;"><hr size="1" color="#C9C9C9" width="95%"></td>';a+="</tr>";this.html+=a}};var WYSIWYG_Table={create:function(c,g){var m=WYSIWYG.getEditorWindow(c).document;var b=WYSIWYG.getSelection(c);var h=WYSIWYG.getRange(b);var o=null;if(WYSIWYG_Core.isMSIE){if(b.type=="Control"&&h.length==1){h=WYSIWYG.getTextRange(h(0));h.select()}}o=g;var p=WYSIWYG_Core.getAttribute(g,"tmprows");var l=WYSIWYG_Core.getAttribute(g,"tmpcols");WYSIWYG_Core.removeAttribute(g,"tmprows");WYSIWYG_Core.removeAttribute(g,"tmpcols");for(var f=0;f<p;f++){var k=m.createElement("tr");for(var e=0;e<l;e++){var d=a();k.appendChild(d)}o.appendChild(k)}if(WYSIWYG_Core.isMSIE){h.pasteHTML(o.outerHTML)}else{WYSIWYG.insertNodeAtSelection(o,c)}this.refreshHighlighting(c);function a(){var i=m.createElement("td");i.innerHTML="&nbsp;";return i}},refreshHighlighting:function(e){var d=WYSIWYG.getEditorWindow(e).document;var b=d.getElementsByTagName("table");for(var a=0;a<b.length;a++){this._enableHighlighting(b[a])}var c=d.getElementsByTagName("td");for(var a=0;a<c.length;a++){this._enableHighlighting(c[a])}},disableHighlighting:function(e){var d=WYSIWYG.getEditorWindow(e).document;var b=d.getElementsByTagName("table");for(var a=0;a<b.length;a++){this._disableHighlighting(b[a])}var c=d.getElementsByTagName("td");for(var a=0;a<c.length;a++){this._disableHighlighting(c[a])}},_enableHighlighting:function(b){var a=WYSIWYG_Core.getAttribute(b,"style");if(a==null){a=" "}WYSIWYG_Core.removeAttribute(b,"prevstyle");WYSIWYG_Core.setAttribute(b,"prevstyle",a);WYSIWYG_Core.setAttribute(b,"style","border:1px dashed #AAAAAA;")},_disableHighlighting:function(b){var a=WYSIWYG_Core.getAttribute(b,"prevstyle");if(a==null||a==""){this._enableHighlighting(b);return}WYSIWYG_Core.removeAttribute(b,"prevstyle");WYSIWYG_Core.removeAttribute(b,"style");WYSIWYG_Core.setAttribute(b,"style",a)}};function $(a){return document.getElementById(a)}if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement=function(a,b){switch(a){case"beforeBegin":this.parentNode.insertBefore(b,this);break;case"afterBegin":this.insertBefore(b,this.firstChild);break;case"beforeEnd":this.appendChild(b);break;case"afterEnd":if(this.nextSibling){this.parentNode.insertBefore(b,this.nextSibling)}else{this.parentNode.appendChild(b)}break}};HTMLElement.prototype.insertAdjacentHTML=function(b,d){var c=this.ownerDocument.createRange();c.setStartBefore(this);var a=c.createContextualFragment(d);this.insertAdjacentElement(b,a)};HTMLElement.prototype.insertAdjacentText=function(b,c){var a=document.createTextNode(c);this.insertAdjacentElement(b,a)}};