var whizzywig_version="Whizzywig v61min";var btn=[];btn._w=16;btn._h=16;btn._f=getDir()+"icons.png";var buttonPath;var buttonExt;var cssFile;var imageBrowse;var linkBrowse;var idTa;var oW,sel,rng,papa,trail,ppw,wn=window;var sels="";var buts="";var vals=new Array();var opts=new Array();var dobut=new Array();var whizzies=new Array();var taOrigSize=new Array();function whizzywig(b){var d,a=document.getElementsByTagName("TEXTAREA");for(d=0;d<a.length;d++){if(!a[d].id){a[d].id=a.name}makeWhizzyWig(a[d].id,b)}}function makeWhizzyWig(f,z){idTa=f;whizzies[whizzies.length]=idTa;if(!document.designMode){if(idTa.nodeName=="TEXTAREA"){tagButs()}alert("Whizzywig "+t("editor not available for your browser"));return}var a=o(idTa).defaultValue?o(idTa).defaultValue:o(idTa).innerHTML?o(idTa).innerHTML:"";if(!o(idTa).rows<5){o(idTa).rows="15"}taWidth=o(idTa).style.width?o(idTa).style.width:o(idTa).cols+"ex";taHeight=o(idTa).style.height?o(idTa).style.height:o(idTa).rows+"em";taOrigSize[idTa]={w:taWidth,h:taHeight};var b=document.createElement("div");b.id="CONTAINER"+idTa+"";b.style.width=taWidth;var g=o(idTa);o(idTa).parentNode.replaceChild(b,o(idTa));o("CONTAINER"+idTa).appendChild(g);if(o(idTa).nodeName=="TEXTAREA"){o(idTa).style.color="#060";o(idTa).style.zIndex="2"}else{w('<input type="hidden" id="wzhid_'+idTa+'" name="'+idTa+'" />')}h(idTa);var x=o(idTa).parentNode;while(x.nodeName!="FORM"){x=x.parentNode}addEvt(x,"submit",syncTextarea);w('<style type="text/css">button {vertical-align:middle;padding:0;margin:1px 0} button img{vertical-align:middle;margin:-1px} select{vertical-align:middle;margin:1px}  .wzCtrl {background:ButtonFace; border:2px outset ButtonShadow; padding:5px;} #sourceTa{color:#060;font-family:mono;}</style>');var u="formatblock fontname fontsize";var y=" bold italic underline | left center right justify | number bullet indent outdent | undo redo | color hilite rule | link image table | clean html spellcheck fullscreen ";var m=" tstart add_row_above add_row_below delete_row | add_column_before add_column_after delete_column | table_in_cell";var n="";btns=(y+m).split(" ");for(var l=0,v=0;l<btns.length;l++){if(btns[l]&&btns[l]!="|"&&btns[l]!="tstart"){btn[btns[l]]=btn._w*v++}}z=typeof z=="string"?z.toLowerCase():"all";if(z=="all"){z=u+" newline "+buts+y+m}else{z+=m}w("<div onmouseover=\"c('"+idTa+'\')"><div id="CONTROLS'+idTa+'" class="wzCtrl" unselectable="on">');gizmos=z.split(" ");for(l=0;l<gizmos.length;l++){if(gizmos[l]){if(gizmos[l]=="tstart"){w('<div id="TABLE_CONTROLS'+idTa+'" style="display:none" unselectable="on">');n="</div>"}else{if(gizmos[l]=="|"){w('&nbsp;<big style="padding-bottom:2em">|</big>&nbsp;')}else{if(gizmos[l]=="newline"){w("<br>")}else{if((u+sels).indexOf(gizmos[l])!=-1){makeSelect(gizmos[l])}else{if((y+buts+m).indexOf(gizmos[l])!=-1){makeButton(gizmos[l])}}}}}}}w(n);w('<a href="http://www.unverse.net" style="color:buttonface" title="'+whizzywig_version+'">.</a> ');w(fGo("LINK"));if(linkBrowse){w('<input type="button" onclick=doWin("'+linkBrowse+'"); value="'+t("Browse")+'"> ')}w(t("Link address (URL)")+': <input type="text" id="lf_url'+idTa+'" size="60"><br><input type="button" value="http://" onclick="o(\'lf_url'+idTa+"').value='http://'+o('lf_url"+idTa+'\').value"> <input type="button" value="mailto:" onclick="o(\'lf_url'+idTa+"').value='mailto:'+o('lf_url"+idTa+'\').value"><input type="checkbox" id="lf_new'+idTa+'">'+t("Open link in new window")+fNo(t("OK"),"insertLink()"));w(fGo("IMAGE"));if(imageBrowse){w('<input type="button" onclick=doWin("'+imageBrowse+'"); value="'+t("Browse")+'"> ')}w(t("Image address (URL)")+': <input type="text" id="if_url'+idTa+'" size="50"> <label title='+t("to display if image unavailable")+"><br>"+t("Alternate text")+':<input id="if_alt'+idTa+'" type="text" size="50"></label><br>'+t("Align")+':<select id="if_side'+idTa+'"><option value="none">_&hearts;_ '+t("normal")+'</option><option value="left">&hearts;= &nbsp;'+t("left")+'</option><option value="right">=&hearts; &nbsp;'+t("right")+"</option></select> "+t("Border")+':<input type="text" id="if_border'+idTa+'" size="20" value="0" title="'+t("number or CSS e.g. 3px maroon outset")+'"> '+t("Margin")+':<input type="text" id="if_margin'+idTa+'" size="20" value="0" title="'+t("number or CSS e.g. 5px 1em")+'">'+fNo(t("Insert Image"),"insertImage()"));w(fGo("TABLE")+t("Rows")+':<input type="text" id="tf_rows'+idTa+'" size="2" value="3"> <select id="tf_head'+idTa+'"><option value="0">'+t("No header row")+'</option><option value="1">'+t("Include header row")+"</option></select> "+t("Columns")+':<input type="text" id="tf_cols'+idTa+'" size="2" value="3"> '+t("Border width")+':<input type="text" id="tf_border'+idTa+'" size="2" value="1"> '+fNo(t("Insert Table"),"makeTable()"));w(fGo("COLOR")+'<input type="hidden" id="cf_cmd'+idTa+'"><div style="background:#000;padding:1px;height:22px;width:125px;float:left"><div id="cPrvw'+idTa+'" style="background-color:red; height:100%; width:100%"></div></div> <input type=text id="cf_color'+idTa+'" value="red" size=17 onpaste=vC(value) onblur=vC(value)> <input type="button" onmouseover=vC() onclick=sC() value="'+t("OK")+'">  <input type="button" onclick="hideDialogs();" value="'+t("Cancel")+'"><br> '+t("click below or enter a")+' <a href="http://www.unverse.net/colortable.htm" target="_blank">'+t("color name")+'</a><br clear=all> <table border=0 cellspacing=1 cellpadding=0 width=480 bgcolor="#000000">\n');var r=new Array("00","33","66","99","CC","FF");for(l=0;l<r.length;l++){w("<tr>");for(j=0;j<r.length;j++){for(k=0;k<r.length;k++){var B=r[l]+r[j]+r[k];w(' <td style="background:#'+B+';height:12px;width:12px" onmouseover=vC("#'+B+'") onclick=sC("#'+B+'")></td>\n')}}w("</tr>")}w("</table></div>\n");w("</div>\n");w('<div class="wzCtrl" id="showWYSIWYG'+idTa+'" style="display:none"><input type="button" onclick="showDesign();" value="'+t("Hide HTML")+'">');tagButs();w("</div>\n");w('<iframe style="width:100%;height:'+taHeight+'" src="javascript:;" id="whizzy'+idTa+'"></iframe></div>\n',true);var A="<html>\n<head>\n";if(cssFile){A+='<link media="all" type="text/css" href="'+cssFile+'" rel="stylesheet">\n'}A+='</head>\n<body id="'+idTa+'" style="background-image:none">\n'+tidyD(a)+"</body>\n</html>";oW=o("whizzy"+idTa).contentWindow;var q=oW.document;try{q.designMode="on"}catch(p){setTimeout('oW.designMode="on";',100)}q.open();q.write(A);q.close();if(oW.addEventListener){oW.addEventListener("keypress",kb_handler,true)}else{q.body.attachEvent("onpaste",function(){setTimeout("cleanUp()",10)})}addEvt(q,"mouseup",whereAmI);addEvt(q,"keyup",whereAmI);addEvt(q,"dblclick",doDbl);g=o(idTa);o("CONTAINER"+idTa).removeChild(o(idTa));o("CONTAINER"+idTa).appendChild(g);idTa=null}function addEvt(d,b,a){if(wn.addEventListener){d.addEventListener(b,a,false)}else{d.attachEvent("on"+b,a)}}function doDbl(){if(papa.nodeName=="IMG"){doImage()}else{if(papa.nodeName=="A"){doLink()}}}function makeButton(a){var d,b=a.substring(0,1).toUpperCase();b+=a.substring(1);b=t(b.replace(/_/g," "));if(!document.frames&&(a=="spellcheck")){return}if(o(idTa).nodeName!="TEXTAREA"&&a=="html"){return}if(!buttonExt){buttonExt=".gif"}if(buttonPath=="textbuttons"){d='<button type=button onClick=makeSo("'+a+'")>'+b+"</button>\n"}else{d='<button  title="'+b+'" type=button onClick=makeSo("'+a+'")>'+(btn[a]!=undefined?'<div style="width:'+btn._w+"px;height:"+btn._h+"px;background-image:url("+btn._f+");background-position:-"+btn[a]+'px 0px"></div>':'<img src="'+buttonPath+a+buttonExt+'" alt="'+b+'" onError="this.parentNode.innerHTML=this.alt">')+"</button>\n"}w(d)}function fGo(a){return'<div id="'+a+"_FORM"+idTa+'" unselectable="on" style="display:none" onkeypress="if(event.keyCode==13) {return false;}"><hr>\n'}function fNo(a,b){return' <input type="button" onclick="'+b+'" value="'+a+'"> <input type="button" onclick="hideDialogs();" value='+t("Cancel")+"></div>\n"}function makeSelect(a){var b,d;if(a=="formatblock"){var f="Heading";b=["<p>","<p>","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<address>","<pre>"];d=[t("Choose style")+":",t("Paragraph"),t(f)+" 1 ",t(f)+" 2 ",t(f)+" 3 ",t(f)+" 4 ",t(f)+" 5 ",t(f)+" 6",t("Address"),t("Fixed width<pre>")]}else{if(a=="fontname"){b=["Arial, Helvetica, sans-serif","Arial, Helvetica, sans-serif","'Arial Black', Helvetica, sans-serif","'Comic Sans MS' fantasy","Courier New, Courier, monospace","Georgia, serif","Impact,sans-serif","'Times New Roman', Times, serif","'Trebuchet MS',sans-serif","Verdana, Arial, Helvetica, sans-serif"];d=[t("Font")+":","Arial","Arial Black","Comic","Courier","Georgia","Impact","Times New Roman","Trebuchet","Verdana"]}else{if(a=="fontsize"){b=["3","1","2","3","4","5","6","7"];d=[t("Font size")+":","1 "+t("Small"),"2","3","4","5","6","7 "+t("Big")]}else{b=vals[a];d=opts[a]}}}w('<select id="'+a+idTa+'" onchange="doSelect(this.id);">\n');for(var e=0;e<b.length;e++){w(' <option value="'+b[e]+'">'+d[e]+"</option>\n")}w("</select>\n")}function tagButs(){w('<input type="button" onclick=\'doTag("<h1>")\' value="H1" title="<H1>"><input type="button" onclick=\'doTag("<h2>")\' value="H2" title="<H2>"><input type="button" onclick=\'doTag("<h3>")\' value="H3" title="<H3>"><input type="button" onclick=\'doTag("<h4>")\' value="H4" title="<H4>"><input type="button" onclick=\'doTag("<p>")\' value="P" title="<P>"><input type="button" onclick=\'doTag("<strong>")\' value="S" title="<STRONG>" style="font-weight:bold"><input type="button" onclick=\'doTag("<em>")\' value="E" title="<EM>" style="font-style:italic;"><input type="button" onclick=\'doTag("<li>")\' value="&bull;&mdash;" title="<LI>"><input type="button" onclick=\'doTag("<a>")\' value="@" title="<A HREF= >"><input type="button" onclick=\'doTag("<img>")\' value="[&hearts;]" title="<IMG SRC= >"><input type="button" onclick=\'doTag("<br />")\' value="&larr;" title="<BR />">')}function xC(b,a){return oW.document.execCommand(b,false,a)}function makeSo(a,b){hideDialogs();oW.focus();if(dobut[a]){insHTML(dobut[a]);return}if(/Firefox/.test(navigator.userAgent)){xC("styleWithCSS",a=="hilite")}if(a=="justify"){a="full"}if("leftrightcenterfull".indexOf(a)!=-1){a="justify"+a}else{if(a=="number"){a="insertorderedlist"}else{if(a=="bullet"){a="insertunorderedlist"}else{if(a=="rule"){a="inserthorizontalrule"}}}}switch(a){case"color":o("cf_cmd"+idTa).value="forecolor";if(textSel()){s("COLOR_FORM"+idTa)}break;case"hilite":o("cf_cmd"+idTa).value=a;if(textSel()){s("COLOR_FORM"+idTa)}break;case"image":doImage();break;case"link":doLink();break;case"html":showHTML();break;case"table":doTable();break;case"delete_row":doRow("delete","0");break;case"add_row_above":doRow("add","0");break;case"add_row_below":doRow("add","1");break;case"delete_column":doCol("delete","0");break;case"add_column_before":doCol("add","0");break;case"add_column_after":doCol("add","1");break;case"table_in_cell":hideDialogs();s("TABLE_FORM"+idTa);break;case"clean":cleanUp();break;case"spellcheck":spellCheck();break;case"fullscreen":fullscreen();break;default:xC(a,b);break}oW.focus()}function doSelect(b){var a=o(b).selectedIndex;var d=o(b).options[a].value;o(b).selectedIndex=0;b=b.replace(idTa,"");if(" _formatblock_fontname_fontsize".indexOf("_"+b)>0){var e=b;oW.focus();xC(e,d)}else{insHTML(d)}oW.focus()}function vC(a){if(!a){a=o("cf_color"+idTa).value}o("cPrvw"+idTa).style.backgroundColor=a;o("cf_color"+idTa).value=a}function sC(a){hideDialogs();var b=o("cf_cmd"+idTa).value;if(!a){a=o("cf_color"+idTa).value}if(rng){rng.select()}if(b=="hilite"){try{xC("hilitecolor",a)}catch(d){xC("backcolor",a)}}else{xC(b,a)}oW.focus()}function doLink(){if(textSel()){if(papa.nodeName=="A"){o("lf_url"+idTa).value=papa.href}s("LINK_FORM"+idTa)}}function insertLink(a){if(rng){rng.select()}URL=a?a:o("lf_url"+idTa).value;if(URL.replace(/ /g,"")===""){xC("Unlink",null)}else{if(o("lf_new"+idTa).checked){insHTML('<a href="'+URL+'" target="_blank">')}else{xC("CreateLink",URL)}}hideDialogs()}function doImage(){if(papa&&papa.nodeName=="IMG"){o("if_url"+idTa).value=papa.src;o("if_alt"+idTa).value=papa.alt;var a=papa.style.cssFloat?papa.style.cssFloat:papa.style.styleFloat;o("if_side"+idTa).selectedIndex=(a=="left")?1:(a=="right")?2:0;o("if_border"+idTa).value=papa.style.border?papa.style.border:papa.border>0?papa.border:0;o("if_margin"+idTa).value=papa.style.margin?papa.style.margin:papa.hspace>0?papa.hspace:0}s("IMAGE_FORM"+idTa)}function insertImage(a,d,b,e,f){hideDialogs();if(!a){a=o("if_url"+idTa).value}if(a){if(!f){f=o("if_alt"+idTa).value?o("if_alt"+idTa).value:a.replace(/.*\/(.+)\..*/,"$1")}img='<img alt="'+f+'" src="'+a+'" ';if(!d){d=o("if_side"+idTa).value}if(d=="left"||d=="right"){align="float:"+d+";"}else{align=""}if(!b){b=o("if_border"+idTa).value}if(b.match(/^\d+$/)){b+="px solid"}if(!e){e=o("if_margin"+idTa).value}if(e.match(/^\d+$/)){e+="px"}if(b||e){img+=' style="border:'+b+";margin:"+e+";"+align+'"'}img+="/>";insHTML(img)}}function doTable(){if(trail&&trail.indexOf("TABLE")>0){s("TABLE_CONTROLS"+idTa)}else{s("TABLE_FORM"+idTa)}}function doRow(a,l){var d=papa;while(d.tagName!="TR"){d=d.parentNode}var g=d.rowIndex;var e=d.cells.length;while(d.tagName!="TABLE"){d=d.parentNode}if(a=="delete"){d.deleteRow(g)}else{var b=d.insertRow(g+parseInt(l,10));for(i=0;i<e;i++){var f=b.insertCell(i);f.innerHTML="#"}}}function doCol(a,g){var d=papa;while(d.tagName!="TD"){d=d.parentNode}var b=d.cellIndex;while(d.tagName!="TABLE"){d=d.parentNode}var e=d.rows.length;for(i=0;i<e;i++){if(a=="delete"){d.rows[i].deleteCell(b)}else{var f=d.rows[i].insertCell(b+parseInt(g,10));f.innerHTML="#"}}}function makeTable(){hideDialogs();var g=o("tf_rows"+idTa).value,l=o("tf_cols"+idTa).value,b=o("tf_border"+idTa).value,e=o("tf_head"+idTa).value;if((g>0)&&(l>0)){var f='<table border="'+b+'">';for(var d=1;d<=g;d++){f=f+"<tr>";for(var a=1;a<=l;a++){if(d==1){if(e=="1"){f+="<th>Title"+a+"</th>"}else{f+="<td>"+a+"</td>"}}else{if(a==1){f+="<td>"+d+"</td>"}else{f+="<td>#</td>"}}}f+="</tr>"}f+=" </table>";insHTML(f)}}function doWin(a){ppw=wn.open(a,"popWhizz","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=480,top=100");ppw.focus()}function spellCheck(){try{var a=new ActiveXObject("ieSpell.ieSpellExtension");a.CheckAllLinkedDocuments(document)}catch(b){if(b.number==-2146827859){if(confirm("ieSpell is not installed on your computer. \n Click [OK] to go to download page.")){wn.open("http://www.iespell.com/download.php","DownLoad")}}else{alert("Error Loading ieSpell: Exception "+b.number)}}}function getWinSize(){var a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;var b=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;return{w:a,h:b}}function fullscreen(){var a=o("CONTAINER"+idTa);if(!isFullscreen()){if(document.body.style.overflow){document.body.style.overflow="hidden"}else{document.documentElement.style.overflow="hidden"}document.body.style.visibility="hidden";a.style.visibility="visible";a.style.position="absolute";a.style.top=(window.pageYOffset?window.pageYOffset:document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop)+"px";a.style.left="0";a.style.width=getWinSize().w+"px";a.style.height=getWinSize().h+"px";o("whizzy"+idTa).style.backgroundColor="#fff";o("whizzy"+idTa).style.height=getWinSize().h-o("CONTROLS"+idTa).offsetHeight+"px"}else{if(document.body.style.overflow){document.body.style.overflow="visible"}else{document.documentElement.style.overflow=""}document.body.style.visibility="visible";a.style.position="relative";a.style.top=o(idTa).style.top?o(idTa).style.top:"0px";a.style.left=o(idTa).style.left?o(idTa).style.left:"0px";a.style.width=taOrigSize[idTa].w;a.style.height="auto";o("whizzy"+idTa).style.backgroundColor="transparent";o("whizzy"+idTa).style.height=taOrigSize[idTa].h}}function getDir(){var b=location.href;var d=document.getElementsByTagName("base");for(var a=0;a<d.length;a+=1){if(d[a].href){b=d[a].href}}d=document.getElementsByTagName("script");for(a=0;a<d.length;a+=1){if(d[a].src&&(/(^|\/)whizzywig\.js([?#].*)?$/i.test(d[a].src))){return d[a].src.replace(/whizzywig\.js/i.exec(d[a].src),"")}else{if(d[a].src&&(/(^|\/)whizzywig[^\/].*?\.js([?#].*)?$/i.test(d[a].src))){return d[a].src.replace(/whizzywig[^\/].*?\.js/i.exec(d[a].src),"")}}}return""}function isFullscreen(){if(o("CONTAINER"+idTa).style.width==getWinSize().w+"px"){return true}return false}function hideDialogs(){h("LINK_FORM"+idTa);h("IMAGE_FORM"+idTa);h("COLOR_FORM"+idTa);h("TABLE_FORM"+idTa);h("TABLE_CONTROLS"+idTa)}function showDesign(){oW.document.body.innerHTML=tidyD(o(idTa).value);h(idTa);h("showWYSIWYG"+idTa);s("CONTROLS"+idTa);s("whizzy"+idTa);if(o("whizzy"+idTa).contentDocument){o("whizzy"+idTa).contentDocument.designMode="on"}oW.focus()}function showHTML(){o(idTa).value=tidyH(oW.document);h("CONTROLS"+idTa);h("whizzy"+idTa);s(idTa);s("showWYSIWYG"+idTa);if(isFullscreen()){o(idTa).style.width=getWinSize().w+"px";o(idTa).style.height=(getWinSize().h-o("showWYSIWYG"+idTa).offsetHeight)+"px";o(idTa).style.borderWidth="0px"}else{o(idTa).style.position="relative";o(idTa).style.width=taOrigSize[idTa].w;o(idTa).style.height=taOrigSize[idTa].h;o(idTa).style.borderWidth="1px"}o(idTa).focus()}function syncTextarea(){for(var e=0;e<whizzies.length;e++){var b=whizzies[e];var f=o("whizzy"+b).contentWindow.document;if(o(b).style.display=="block"){f.body.innerHTML=o(b).value}var a=(o(b).nodeName!="TEXTAREA")?o("wzhid_"+o(b).id):o(b);a.value=tidyH(f)}}function cleanUp(){xC("removeformat",null);tidyH(oW.document)}function tidyD(a){a=a.replace(/<(\/?)strong([^>]*)>/gi,"<$1B$2>").replace(/<(\/?)em>/gi,"<$1I>");return a}function tidyH(l){function e(d){return d.toLowerCase()}function f(d){return d.replace(/(\s+\w+=)([^"][^>\s]*)/gi,'$1"$2"')}function a(d){return d.replace(/("|;)\s*[A-Z-]+\s*:/g,e)}var g=new Array("medium","xx-small","x-small","small","medium","large","x-large","xx-large");fs=l.getElementsByTagName("FONT");for(var b=0;b<fs.length;b++){if(fs[b].face){fs[b].style.fontFamily=fs[b].face;fs[b].removeAttribute("face")}if(fs[b].size){fs[b].style.fontSize=g[fs[b].size];fs[b].removeAttribute("size")}if(fs[b].color){fs[b].style.color=fs[b].color;fs[b].removeAttribute("color")}}ih=l.body.innerHTML;ih=ih.replace(/(<\/?)FONT([^>]*)/gi,"$1span$2").replace(/(<\/?)[B](\s+[^>]*)?>/gi,"$1strong$2>").replace(/(<\/?)[I](\s+[^>]*)?>/gi,"$1em$2>").replace(/<\/?(COL|XML|ST1|SHAPE|V:|O:|F:|F |PATH|LOCK|IMAGEDATA|STROKE|FORMULAS)[^>]*>/gi,"").replace(/\bCLASS="?(MSOw*|Apple-style-span)"?/gi,"").replace(/<[^>]+=[^>]+>/g,f).replace(/[–]/g,"-").replace(/[‘’]/g,"'").replace(/[“”]/g,'"').replace(/<(TABLE|TD|TH|COL)(.*)(WIDTH|HEIGHT)=["'0-9A-Z]*/gi,"<$1$2").replace(/<([^>]+)>\s*<\/\1>/g,"").replace(/><(H|P|D|T|BLO|FOR|IN|SE|OP|UL|OL|LI|SC)/gi,">\n<$1").replace(/(<BR ?\/?>)([^\r\n])/gi,"$1\n$2").replace(/([^\n])<(P|DIV|TAB|FOR)/gi,"$1\n\n<$2").replace(/([^\n])<\/(UL|OL|DL|DIV|TAB|FOR)/gi,"$1\n</$2").replace(/([^\n])(<\/TR)/gi,"$1\n $2").replace(/\n<(BLO|LI|OP|TR|IN|DT)/gi,"\n <$1").replace(/\n<(TD|TH|DD)/gi,"\n  <$1").replace(window.location.href+"#","#").replace(/<(IMG|INPUT|BR|HR|LINK|META)([^>]*)>/gi,"<$1$2 />").replace(/(<\/?[A-Z]*)/g,e).replace(/STYLE="[^"]*"/gi,a);return ih}function kb_handler(f){var d=false,a=false,b;if(f&&(f.ctrlKey&&f.keyCode==f.DOM_VK_V)||(f.shiftKey&&f.keyCode==f.DOM_VK_INSERT)){setTimeout("cleanUp()",10)}else{if(f&&f.keyCode==13&&!f.shiftKey&&papa.nodeName=="BODY"){d="formatblock";a="<p>"}else{if(f&&f.ctrlKey){b=String.fromCharCode(f.charCode).toLowerCase();d=(b=="b")?"bold":(b=="i")?"italic":(b=="l")?"link":(b=="m")?"image":false}}}if(d){makeSo(d,a);f.preventDefault();f.stopPropagation()}}function doTag(b){var a;if(!b){b=prompt("Enter some HTML or text to insert:","")}o(idTa).focus();if(b=="<a>"){a=prompt("Link address:","http://");b='<a href="'+a+'">'}if(b=="<img>"){a=prompt("Address of image:","http://");var d=prompt("Description of image");b='<img src="'+a+'" alt="'+d+'">'}var e="";if(b.indexOf("<")===0&&b.indexOf("br")!=1&&b.indexOf("img")!=1){e=b.replace(/<([a-z0-6]+).*/,"</$1>")}if(b!="<strong>"&&b!="<em>"){e+="\n"}if(document.selection){sel=document.selection.createRange();sel.text=b+sel.text+e}else{before=o(idTa).value.slice(0,o(idTa).selectionStart);sel=o(idTa).value.slice(o(idTa).selectionStart,o(idTa).selectionEnd);after=o(idTa).value.slice(o(idTa).selectionEnd);o(idTa).value=before+b+sel+e+after}o(idTa).focus()}function insHTML(html){if(!html){html=prompt(t("Enter some HTML or text to insert:"),"")}if(html.indexOf("js:")===0){try{eval(html.replace(/^js:/,""))}catch(e){}return}whereAmI();try{if(sel.type&&sel.type!="Text"){sel=""}xC("inserthtml",html+sel)}catch(e){if(document.selection){if(papa&&papa.nodeName=="IMG"){papa.outerHTML=html}else{if(rng){rng.select();rng.pasteHTML(html+rng.htmlText)}}}}}function whereAmI(d){if(!d){d=wn.event}var a=d&&d.type=="mouseup";if(wn.getSelection){sel=oW.getSelection();sn=sel.anchorNode;papa=a?d.target:(sn.nodeName=="#text")?sn.parentNode:sn}else{oW.document.getElementsByTagName("body")[0].focus();sel=oW.document.selection;rng=sel.createRange();papa=a?d.srcElement:(sel.type=="Control")?rng.item(0):rng.parentElement()}var b=papa;trail=papa.nodeName;while(!b.nodeName.match(/^(HTML|BODY)/)&&b.className!="wzCtrl"){b=b.parentNode;trail=b.nodeName+">"+trail}if(b.className=="wzCtrl"){trail=sel=rng=null}var f=b.nodeName=="HTML"?b.getElementsByTagName("BODY")[0].id:b.id.replace("CONTROL","");c(f);wn.status=f+":"+trail;if(trail.indexOf("TABLE")>0){s("TABLE_CONTROLS"+idTa)}else{h("TABLE_CONTROLS"+idTa)}}function c(b){if(b==""||whizzies.join().indexOf(b)=="-1"){return}if(b!=idTa){idTa=b;try{oW=o("whizzy"+b).contentWindow}catch(a){alert("set current: "+b)}if(oW){if(oW.focus){oW.focus()}wn.status=oW.document.body.id}}}function w(b,a){if(!w.temp){w.temp=""}w.temp+=b;if(a){o("CONTAINER"+idTa).innerHTML+=w.temp;w.temp=""}}function textSel(){if(sel&&sel!=""&&sel.type!="None"){return true}else{alert(t("Select some text first"));return false}}function s(a){o(a).style.display="block"}function h(a){o(a).style.display="none"}function o(a){return document.getElementById(a)}function t(a){return(wn.language&&language[a])?language[a]:a};
