if(!("RORTICUS" in window)){RORTICUS={};}RORTICUS.SetupRichText=function(){var d=document.getElementsByTagName("textarea");for(var b=0;b<d.length;b++){var a=d[b].getAttribute("rich")||"false";if(a.toLowerCase()=="true"){var c=new RORTICUS.RichTextArea(d[b]);}}};RORTICUS.RichTextArea=function(a){this.initFromElement(a);};RORTICUS.RichTextArea.prototype.initFromElement=function(u){this.targetElement=u;var m=this;var c=document.createElement("IFRAME");this.iframeElement=c;function o(){var v=m.getContentDocument();if("body" in v&&v.body!=null){if("textContent" in v.body){v.body.textContent=u.value;}else{v.body.innerText=u.value;}m.setDefaultStyle(v);v.designMode="On";}}if("addEventListener" in c){c.addEventListener("load",o,false);}else{c.attachEvent("onload",o);}var d=u.offsetWidth;var e=u.offsetHeight;if(d<500){d=500;}if(e<150){e=150;}var i=document.createElement("DIV");i.style.width=d+"px";i.style.height=e+"px";i.style.border="1px solid black";var a=document.createElement("TABLE");a.style.border="1px outset #ddd";a.style.backgroundColor="#ddd";a.width="100%";a.height=30;var k=document.createElement("TBODY");var r=document.createElement("TR");function b(v){var w=document.createElement("TD");w.appendChild(v);r.appendChild(w);}k.appendChild(r,true);a.appendChild(k,true);i.appendChild(a,true);i.appendChild(c,true);c.width="100%";c.style.height=e-30+"px";c.style.border="none";c.frameBorder=0;u.parentNode.insertBefore(i,u);u.style.visibility="hidden";u.style.position="absolute";var h=u.parentNode;while(h){if(h.tagName=="FORM"){if("addEventListener" in h){h.addEventListener("submit",j,false);}else{h.attachEvent("onsubmit",j,false);}}h=h.parentNode;}function j(){u.value=m.getContentDocument().body.innerHTML;}function s(v,w){var x=document.createElement("OPTION");x.innerHTML=w;x.value=w;v.appendChild(x,true);}function n(v,A,w){var y=document.createElement("OPTGROUP");y.label=A;for(var x=0;x<w.length;x++){var z=document.createElement("OPTION");z.innerHTML=w[x];z.value=w[x];y.appendChild(z,true);}v.appendChild(y,true);}var t=document.createElement("SELECT");t.onchange=function(){m.onSelect(t);};s(t,"-- Format --");n(t,"Style",["Normal","Heading 1","Heading 2","Heading 3","Heading 4","Heading 5","Heading 6","Paragraph","&raquo; Indent","&laquo; Outdent"]);n(t,"Lists",["Unordered List","Ordered List"]);n(t,"Justification",["Left","Right","Center"]);n(t,"Decorations",["Bold","Italic","Underline","Superscript","Subscript"]);b(t);var p=document.createElement("SELECT");p.onchange=function(){m.onSelect(p);};s(p,"-- Font --");n(p,"Face",["Sans-Serif","Serif","Monospace"]);n(p,"Size",["Size 1","Size 2","Size 3","Size 4","Size 5","Size 6","Size 7"]);n(p,"Color",["Black","Red","Green","Blue","Yellow","Gray","Magenta"]);b(p);var l=document.createElement("SELECT");l.onchange=function(){m.onSelect(l);};s(l,"-- Insert --");n(l,"Elements",["Link","Linked Image","Horizontal Rule"]);b(l);var f=document.createElement("INPUT");f.type="checkbox";f.onclick=function(){if(f.checked){m.viewSource();}else{m.stopViewingSource();}};b(f);var q=document.createElement("SPAN");q.innerHTML="Source";q.style.fontFamily="monospace";q.style.fontSize="12px";b(q);var g=document.createElement("TD");g.width="100%";r.appendChild(g,true);};RORTICUS.RichTextArea.prototype.doCommand=function(c,a,b){this.getContentDocument().execCommand(c,a,b);};RORTICUS.RichTextArea.prototype.onSelect=function(a){var c=a.value;a.selectedIndex=0;switch(c){case"Normal":this.doCommand("removeFormat",null,null);break;case"Heading 1":this.doCommand("formatBlock",null,"<H1>");break;case"Heading 2":this.doCommand("formatBlock",null,"<H2>");break;case"Heading 3":this.doCommand("formatBlock",null,"<H3>");break;case"Heading 4":this.doCommand("formatBlock",null,"<H4>");break;case"Heading 5":this.doCommand("formatBlock",null,"<H5>");break;case"Heading 6":this.doCommand("formatBlock",null,"<H6>");break;case"Paragraph":this.doCommand("insertParagraph",null,null);break;case"Unordered List":this.doCommand("insertUnorderedList",null,null);break;case"Ordered List":this.doCommand("insertOrderedList",null,null);break;case"Bold":this.doCommand("bold",null,null);break;case"Italic":this.doCommand("italic",null,null);break;case"Underline":this.doCommand("underline",null,null);break;case"Superscript":this.doCommand("superscript",null,null);break;case"Subscript":this.doCommand("subscript",null,null);break;case"Left":this.doCommand("justifyLeft",null,null);break;case"Right":this.doCommand("justifyRight",null,null);break;case"Center":this.doCommand("justifyCenter",null,null);break;case"&raquo; Indent":this.doCommand("indent",null,null);break;case"&laquo; Outdent":this.doCommand("outdent",null,null);break;case"Sans-Serif":this.doCommand("fontname",null,"sans-serif");break;case"Serif":this.doCommand("fontname",null,"serif");break;case"Monospace":this.doCommand("fontname",null,"monospace");break;case"Size 1":this.doCommand("fontsize",null,1);break;case"Size 2":this.doCommand("fontsize",null,2);break;case"Size 3":this.doCommand("fontsize",null,3);break;case"Size 4":this.doCommand("fontsize",null,4);break;case"Size 5":this.doCommand("fontsize",null,5);break;case"Size 6":this.doCommand("fontsize",null,6);break;case"Size 7":this.doCommand("fontsize",null,7);break;case"Black":case"Red":case"Green":case"Blue":case"Yellow":case"Gray":case"Magenta":this.doCommand("forecolor",null,c);break;case"Link":var b=prompt("URL of Link:");if(b!=""){this.doCommand("createLink",null,b);}break;case"Linked Image":var b=prompt("URL of Image:");if(b!=""){this.doCommand("insertImage",null,b);}break;case"Horizontal Rule":this.doCommand("insertHorizontalRule",null,null);break;}this.iframeElement.contentWindow.focus();};RORTICUS.RichTextArea.prototype.viewSource=function(){var a=this.getContentDocument().body.innerHTML;var b=document.createElement("textarea");b.style.width=this.iframeElement.offsetWidth+"px";b.style.height=this.iframeElement.offsetHeight-5+"px";b.value=a;b.style.border="none";this.viewSourceBox=b;this.iframeElement.style.display="none";this.iframeElement.parentNode.insertBefore(b,this.iframeElement);};RORTICUS.RichTextArea.prototype.stopViewingSource=function(){var a=this.viewSourceBox.value;this.getContentDocument().body.innerHTML=a;this.iframeElement.parentNode.removeChild(this.viewSourceBox);this.iframeElement.style.display="";};RORTICUS.RichTextArea.prototype.setDefaultStyle=function(a){a.body.style.fontFamily="sans-serif";a.body.style.fontSize="10pt";};RORTICUS.RichTextArea.prototype.getContentDocument=function(){return this.iframeElement.contentWindow.document;};if("addEventListener" in window){window.addEventListener("load",RORTICUS.SetupRichText,false);}else{window.attachEvent("onload",RORTICUS.SetupRichText);}