function WYSIWYG_Color(){var D=new Array("#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333","#800000","#FF6600","#808000","#008000","#008080","#0000FF","#666699","#808080","#FF0000","#FF9900","#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999","#FF00FF","#FFCC00","#FFFF00","#00FF00","#00CCFF","#993366","#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF","#99CCFF","#666699","#777777","#999999","#EEEEEE","#FFFFFF");var E="colorpicker-div";this.init=function(){var F=document.createElement("DIV");F.id=E;F.style.position="absolute";F.style.visibility="hidden";document.body.appendChild(F)};this.choose=function(G){var J=document.getElementById(E);if(J==null){alert("Initialisation of color picker failed.");return }B(G);var F=window.event.clientX+document.body.scrollLeft;var I=window.event.clientY+document.body.scrollTop;var H=A();if(F+J.offsetWidth>H.width){F=H.width-J.offsetWidth-5}if(I+J.offsetHeight>H.height){I=H.height-J.offsetHeight-5}J.style.left=F+"px";J.style.top=I+"px";J.style.visibility="visible"};this.select=function(I,F){var H=document.getElementById(E);var G=document.getElementById(I);G.value=F;G.style.color=F;G.style.backgroundColor=F;H.style.visibility="hidden"};function B(J){var I=document.getElementById(E);var G="";G+='<table border="1" cellpadding="0" cellspacing="0" class="wysiwyg-color-picker-table"><tr>';for(var H=0;H<D.length;H++){var F=D[H];G+='<td class="selectColorBorder" ';G+="onmouseover=\"this.className='selectColorOn';\" ";G+="onmouseout=\"this.className='selectColorOff';\" ";G+="onclick=\"WYSIWYG_ColorInst.select('"+J+"', '"+F+"');\"> ";G+='<div style="background-color:'+F+';" class="wysiwyg-color-picker-div">&nbsp;</div> ';G+="</td>";if(((H+1)%Math.round(Math.sqrt(D.length)))==0){G+="</tr><tr>"}}G+="</tr></table>";I.innerHTML=G}function C(F){if(!document.all&&document.getElementById){window.event=F}}document.onmousedown=C;function A(){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_ColorInst=new WYSIWYG_Color();