var vtagally=0.31;function $1(objStr){return document.getElementById(objStr);};var tagally_selcolgNum=0;var tagally_tbrow=6;var tagally_tbnum=30;var tagally_examplenum=50;var tagally_tcolo="000042";var tagally_coltable=null;var tagally_adcotb=null;function tga_createCoTb(){tagally_settbnum=parseInt($1("tagallytbnum").value);if(tagally_settbnum>0){tagally_tbnum=tagally_settbnum;}else{return;};if(!tagally_adcotb){tagally_adcotb=$1("tagallyaddcolortable");};tagally_adcotb.innerHTML="";stlen=null;tagally_coltable=document.createElement("TABLE");tagally_coltable.border="1px";var rownum=parseInt(tagally_tbnum/tagally_tbrow)-1;var rowdt=tagally_tbnum%tagally_tbrow;if(rowdt!=0){rownum=rownum+1;};for(i=0;i<=rownum;i++){adnewrow=tagally_coltable.insertRow(i);for(j=0;j<=tagally_tbrow-1;j++){if(i==rownum&&j>=rowdt&&rowdt!=0){if(tagally_tbnum>tagally_tbrow){adnewrow.insertCell(j).innerHTML=" ";}}else{adnewrow.insertCell(j).innerHTML="#";}};adnewrow=null;};tagally_adcotb.appendChild(tagally_coltable);for(k=0;k<=tagally_tbnum-1;k++){attachColorPicker($1('colrPkrBtn_'+k));};$1("tagally_apc_btn").style.display="block";$1("tagallyrscbtn").style.display="inline";apply_colortb();};function tgaexmbg(){$1("tga_exmdiv").style.background="#"+$1("tga_exbg").value;};function iupcolor(obj,obnm){$1(obnm).style.backgroundColor="#"+obj.value;if($1(obnm).id=="tga_exbgbtn"){$1("tga_exmdiv").style.backgroundColor="#"+obj.value;$1(obnm).style.backgroundColor="#"+obj.value;}else{if(tagally_selcolgNum==0){cpcon=obj.id.substr(12,(obj.id.length-1));for(i=parseInt(cpcon);i<=parseInt(tagally_examplenum)-1;i+=parseInt(tagally_tbnum)){$1("tagally_ts_"+i).style.color="#"+obj.value;};tgatbnum=parseInt($1("tagallytbnum").value);tgactbStr="";for(i=0;i<=tagally_examplenum-1;i++){if(i=1){node=cE(A[0]);if(aL>=2){for(var arg in A[1]){if(arg.indexOf('on')==0){node[arg]=A[1][arg];}else if(arg=='ref'){ref[A[1][arg]]=node;ref['DOM']=node;bRef=true;}else{if(arg=='style'){node.style.cssText=A[1][arg];}else if(arg.toLowerCase()=='classname'){node.style.className=A[1][arg];}else{node.setAttribute(arg,A[1][arg]);}}}};for(var i=2;i=sWidth*6){r=g=b=255-l;}else{h=255-l;r=C(height/2)){var base=(height-R)/(height/2);r=r*base;g=g*base;b=b*base;}};return hex(r)+hex(g)+hex(b);};function getVertColor(i,sZ){var n=sZ/6,j=sZ/n,C=i,c=C%n;r=C255?255:x;y=y<0?0:y>255?255:y;var r=Math.round((1-(1-(Base.r/255))*(x/255))*(255-y));var g=Math.round((1-(1-(Base.g/255))*(x/255))*(255-y));var b=Math.round((1-(1-(Base.b/255))*(x/255))*(255-y));return{r:r,g:g,b:b};};function getWebSafeColor(color){var rMod=color.r%51;var gMod=color.g%51;var bMod=color.b%51;if((rMod==0)&&(gMod==0)&&(bMod==0))return false;var wsColor={};wsColor.r=(rMod<=25?Math.floor(color.r/51)*51:Math.ceil(color.r/51)*51);wsColor.g=(gMod<=25?Math.floor(color.g/51)*51:Math.ceil(color.g/51)*51);wsColor.b=(bMod<=25?Math.floor(color.b/51)*51:Math.ceil(color.b/51)*51);return wsColor;};function hColorPickerMouseMove(ev){ev=ev||window.event;var hCPImg=ev.target||ev.srcElement;var mousePos=mouseCoordinates(ev);cp.colorPos=getPosition(hCPImg);var x=mousePos.x-cp.colorPos.x;var y=mousePos.y-cp.colorPos.y;var width=parseInt(hCPImg.offsetWidth);var height=parseInt(hCPImg.offsetHeight);var color=getHorizColor(y*width+x,width,height);try{cp.hColorDiv.style.backgroundColor=cp.cpColor='#'+color;}catch(e){}};function hColorPickerMouseDown(){if(cp.cpColor.r||(cp.cpColor.r===0))cp.cpColor='#'+hex(cp.cpColor.r)+hex(cp.cpColor.g)+hex(cp.cpColor.b);if(cp.cpInput.id=="tga_exbgbtn"){$1("tga_exmdiv").style.backgroundColor=cp.cpColor;$1("tga_exbg").value=(cp.cpColor.substr(1,6)).toUpperCase();}else{if(tagally_selcolgNum==0){cpcon=cp.cpInput.id.substr(11,(cp.cpInput.id.length-1));$1("colrPkrshow_"+cpcon).value=(cp.cpColor.substr(1,6)).toUpperCase();for(i=parseInt(cpcon);i<=parseInt(tagally_examplenum)-1;i+=parseInt(tagally_tbnum)){$1("tagally_ts_"+i).style.color=cp.cpColor;};tgatbnum=parseInt($1("tagallytbnum").value);tgactbStr="";for(i=0;i<=tagally_examplenum-1;i++){if(i255?255:y;cp.Arrows.style.top=(y+18)+'px';var color=cp.baseColor=getVertColor(y,256);cp.fColorImg.style.backgroundColor='#'+hex(color.r)+hex(color.g)+hex(color.b);};function selectWebSafeColor(){setCPColor(getWebSafeColor(cp.cpColor));};function resetColor(){setCPColor(cp.origColor);};function setCPColor(color){if(color.srcElement||color.target){color=null;};if(color&&(!color.r&&(color.r!=0))){color=parseColor(color);};if(!color){color={r:parseInt(cp.rInput.value),g:parseInt(cp.gInput.value),b:parseInt(cp.bInput.value)}};var wsColor=getWebSafeColor(color);if(wsColor&&!cp.websafeCheckbox.checked){cp.websafeImg.style.display='block';cp.websafeImg.style.backgroundColor='#'+hex(wsColor.r)+hex(wsColor.g)+hex(wsColor.b);}else{if(wsColor&&cp.websafeCheckbox.checked)color=wsColor;cp.websafeImg.style.display='none';};cp.rInput.value=color.r;cp.gInput.value=color.g;cp.bInput.value=color.b;cp.cpColor=color;cp.curColorDiv.style.backgroundColor='#'+hex(color.r)+hex(color.g)+hex(color.b);};function parseColor(text){if(colorNames[text.toLowerCase()])text=colorNames[text.toLowerCase()];if(/^\#?[0-9A-F]{6}$/i.test(text)){return{r:eval('0x'+text.substr(text.length==6?0:1,2)),g:eval('0x'+text.substr(text.length==6?2:3,2)),b:eval('0x'+text.substr(text.length==6?4:5,2))}};return{r:255,g:0,b:0};};function documentMouseDown(ev){ev=ev||window.event;var target=ev.srcElement||ev.target;while(target){if(target==cp.ColorPicker)return true;target=target.parentNode;};cp.ColorPicker.style.display='none';return true;};function documentMouseUp(ev){cpMouseUp(ev);cpSliderMouseUp(ev);};window.attachColorPicker=attachColorPicker;})();function prgcolor(){attachColorPicker($1('mpcolorbtn'));attachColorPicker($1('lpcolorbtn'));};window.onload=function(){tagally_tbnum=parseInt($1('tagallytbnum').value);if($1('colrPkrBtn_0')){for(k=0;k<=tagally_tbnum-1;k++){attachColorPicker($1('colrPkrBtn_'+k));};$1("tagally_apc_btn").style.display="block";$1("tagallyrscbtn").style.display="inline";};tagally_selcolgNum=$1('tagally_hdn_selno').value;if(tagally_selcolgNum=="1"){prgcolor();};attachColorPicker($1('tga_exbgbtn'));}