var rgbaBackground=(function(){Base64.encoding=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];function Base64(){}Base64.encode=function(data){var result=[];var ip57=Math.floor(data.length/57);var fp57=data.length%57;var ip3=Math.floor(fp57/3);var fp3=fp57%3;var index=0;var num;for(var i=0;i<ip57;i++){for(j=0;j<19;j++,index+=3){num=data[index]<<16|data[index+1]<<8|data[index+2];result.push(Base64.encoding[(num&16515072)>>18]);result.push(Base64.encoding[(num&258048)>>12]);result.push(Base64.encoding[(num&4032)>>6]);result.push(Base64.encoding[(num&63)])}result.push("\n")}for(i=0;i<ip3;i++,index+=3){num=data[index]<<16|data[index+1]<<8|data[index+2];result.push(Base64.encoding[(num&16515072)>>18]);result.push(Base64.encoding[(num&258048)>>12]);result.push(Base64.encoding[(num&4032)>>6]);result.push(Base64.encoding[(num&63)])}if(fp3==1){num=data[index]<<16;result.push(Base64.encoding[(num&16515072)>>18]);result.push(Base64.encoding[(num&258048)>>12]);result.push("==")}else{if(fp3==2){num=data[index]<<16|data[index+1]<<8;result.push(Base64.encoding[(num&16515072)>>18]);result.push(Base64.encoding[(num&258048)>>12]);result.push(Base64.encoding[(num&4032)>>6]);result.push("=")}}return result.join("")};CRC32.VERSION=1;CRC32.table=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function CRC32(){}CRC32.getCRC=function(data,offset,count){var crc=4294967295;var k;for(var i=0;i<count;i++){k=(crc^data[offset+i])&255;crc=((crc>>8)&16777215)^CRC32.table[k]}return ~crc};Chunk.VERSION=1;Chunk.LENGTH=0;Chunk.TYPE=Chunk.LENGTH+4;Chunk.EOD=Chunk.TYPE+4;function Chunk(length,type){if(arguments.length>0){if(isNaN(length)){throw new Error("Chunk: length must be a number: "+length)}if(length<Chunk.EOD){throw new Error("Chunk: length must be >= "+Chunk.EOD)}var size=length+4;this.data=new Array(size);for(var i=0;i<size;i++){this.data[i]=0}this.setLength(length-4-4);this.setType(type)}}Chunk.prototype.storeByte=function(offset,value){if(isNaN(offset)||isNaN(value)){throw new Error("Chunk.storeByte: parameters must be numbers")}if(offset<0||this.data.length<=offset){throw new Error("Chunk.storeByte: offset out of range: "+offset)}if(value<0||255<value){throw new Error("Chunk.storeByte: value out of range: "+value)}this.data[offset]=value};Chunk.prototype.storeInt2=function(offset,value){if(isNaN(offset)||isNaN(value)){throw new Error("Chunk.storeInt2: parameters must be numbers")}if(offset<0||this.data.length<=offset){throw new Error("Chunk.storeInt2: offset out of range: "+offset)}if(value<0||65535<value){throw new Error("Chunk.storeInt2: value out of range: "+value)}this.data[offset++]=(value>>8)&255;this.data[offset]=value&255};Chunk.prototype.storeInt2Reversed=function(offset,value){if(isNaN(offset)||isNaN(value)){throw new Error("Chunk.storeInt2Reversed: parameters must be numbers")}if(offset<0||this.data.length<=offset){throw new Error("Chunk.storeInt2Reversed: offset out of range: "+offset)}this.data[offset++]=value&255;this.data[offset]=(value>>8)&255};Chunk.prototype.storeInt4=function(offset,value){if(isNaN(offset)||isNaN(value)){throw new Error("Chunk.storeInt4: parameters must be numbers")}if(offset<0||this.data.length<=offset){throw new Error("Chunk.storeInt4: offset out of range: "+offset)}this.data[offset++]=(value>>24)&255;this.data[offset++]=(value>>16)&255;this.data[offset++]=(value>>8)&255;this.data[offset]=value&255};Chunk.prototype.setLength=function(length){this.storeInt4(Chunk.LENGTH,length)};Chunk.prototype.setType=function(type){if(typeof type!="string"){throw new Error("Chunk.setType: parameter must be a string")}if(type.length!=4){throw new Error("Chunk.setType: type must be 4 characters in length")}for(var i=0;i<4;i++){this.data[Chunk.TYPE+i]=type.charCodeAt(i)}};Chunk.prototype.setCRC=function(){var size=this.data.length-8;var crc=CRC32.getCRC(this.data,4,size);this.storeInt4(this.data.length-4,crc)};Chunk.prototype.toString=function(){var data=this.data;var length=data.length;var chars=new Array(length);for(var i=0;i<length;i++){var a=data[i].toString();var h=data[i].toString(16);var b;if(32<=a&&a<127){b=String.fromCharCode(data[i])}else{b="."}chars[i]=a+"\t\t"+h+"\t\t"+b}return chars.join("\r\n")};IHDRChunk.VERSION=1;IHDRChunk.WIDTH=Chunk.EOD;IHDRChunk.HEIGHT=IHDRChunk.WIDTH+4;IHDRChunk.BITDEPTH=IHDRChunk.HEIGHT+4;IHDRChunk.COLORTYPE=IHDRChunk.BITDEPTH+1;IHDRChunk.COMPRESSION=IHDRChunk.COLORTYPE+1;IHDRChunk.FILTER=IHDRChunk.COMPRESSION+1;IHDRChunk.INTERLACE=IHDRChunk.FILTER+1;IHDRChunk.EOD=IHDRChunk.INTERLACE+1;IHDRChunk.prototype=new Chunk();IHDRChunk.prototype.constructor=IHDRChunk;IHDRChunk.superclass=Chunk.prototype;function IHDRChunk(width,height,bit_depth,color_type,compression,filter,interlace){if(arguments.length>0){IHDRChunk.superclass.constructor.call(this,IHDRChunk.EOD,"IHDR");this.setWidth(width);this.setHeight(height);this.setBitDepth(bit_depth);this.setColorType(color_type);this.setCompression(compression);this.setFilter(filter);this.setInterlace(interlace)}}IHDRChunk.prototype.setWidth=function(width){this.storeInt4(IHDRChunk.WIDTH,width)};IHDRChunk.prototype.setHeight=function(height){this.storeInt4(IHDRChunk.HEIGHT,height)};IHDRChunk.prototype.setBitDepth=function(bit_depth){this.storeByte(IHDRChunk.BITDEPTH,bit_depth)};IHDRChunk.prototype.setColorType=function(color_type){this.storeByte(IHDRChunk.COLORTYPE,color_type)};IHDRChunk.prototype.setCompression=function(compression){this.storeByte(IHDRChunk.COMPRESSION,compression)};IHDRChunk.prototype.setFilter=function(filter){this.storeByte(IHDRChunk.FILTER,filter)};IHDRChunk.prototype.setInterlace=function(interlace){this.storeByte(IHDRChunk.INTERLACE,interlace)};PLTEChunk.VERSION=1;PLTEChunk.DATA=Chunk.EOD;PLTEChunk.prototype=new Chunk();PLTEChunk.prototype.constructor=PLTEChunk;PLTEChunk.superclass=Chunk.prototype;function PLTEChunk(lastIndex){if(arguments.length>0){if(isNaN(lastIndex)){throw new Error("PLTEChunk: lastIndex must be a number")}if(lastIndex<0||255<lastIndex){throw new Error("PLTEChunk: lastIndex must be between 0 and 255, inclusive")}PLTEChunk.superclass.constructor.call(this,PLTEChunk.DATA+(3*(lastIndex+1)),"PLTE");this.lastIndex=lastIndex}}PLTEChunk.prototype.setColor=function(index,red,green,blue){if(isNaN(index)||isNaN(red)||isNaN(green)||isNaN(blue)){throw new Error("PLTEChunk.setColor: all parameters must be numbers")}if(index<0||this.lastIndex<index){throw new Error("PLTEChunk.setColor: index out of range: "+index)}var offset=PLTEChunk.DATA+3*index;this.storeByte(offset++,red);this.storeByte(offset++,green);this.storeByte(offset,blue)};IDATChunk.VERSION=1;IDATChunk.DEFLATE=Chunk.EOD;IDATChunk.DATA=IDATChunk.DEFLATE+2;IDATChunk.prototype=new Chunk();IDATChunk.prototype.constructor=IDATChunk;IDATChunk.superclass=Chunk.prototype;function IDATChunk(width,height,bytesPerPixel){if(arguments.length>0){if(bytesPerPixel==null){bytesPerPixel=1}if(isNaN(width)||isNaN(height)||isNaN(bytesPerPixel)){throw new Error("IDATChunk: parameters must be numbers")}if(width<0||height<0){throw new Error("IDATChunk: width and height must be positive numbers")}if(bytesPerPixel<0||4<bytesPerPixel){throw new Error("IDATChunk: bytesPerPixel must be between 1 and 4, inclusive")}this.width=width;this.height=height;this.bytesPerPixel=bytesPerPixel;if(bytesPerPixel>1){var blockSize=65535-5;var rowBytes=width*bytesPerPixel+1;var wholeRows=Math.floor(blockSize/rowBytes);if(wholeRows<height){lastRowBytes=blockSize-wholeRows*rowBytes;if(lastRowBytes<(bytesPerPixel+1)){throw new Error("IDATChunk: this case not yet implemented")}else{lastRowBytes--;blockSize-=lastRowBytes%bytesPerPixel}}this.blockSize=blockSize+5}else{this.blockSize=65535}var image_data=(width*height)*bytesPerPixel+this.height;var block_headers=5*Math.floor((image_data+this.blockSize-1)/this.blockSize);var total=image_data+block_headers+4;IDATChunk.superclass.constructor.call(this,IDATChunk.DATA+total,"IDAT");this.initDeflateHeader();var offset=IDATChunk.DATA;for(var i=0;i<image_data;i+=this.blockSize){var block_size=this.blockSize;var last_block=0;if(i+this.blockSize>=image_data){block_size=image_data-i;last_block=1}this.storeByte(offset,last_block);this.storeInt2Reversed(offset+1,block_size);this.storeInt2Reversed(offset+3,~block_size);offset+=this.blockSize+5}}}IDATChunk.prototype.initDeflateHeader=function(){var compressMethod=8;var windowSize=32768;var log2Size=Math.LOG2E*Math.log(windowSize);var windowLog=log2Size-8;var flevel=0;var header=((windowLog<<4)|compressMethod)<<8|(flevel<<6);header+=31-(header%31);this.setDeflateHeader(header)};IDATChunk.prototype.setChecksum=function(){var base=65521;var nmax=5552;var s1=1;var s2=0;var k=nmax;for(var y=0;y<this.height;y++){var offset=this.getPixelOffset(0,y)-1;s1+=this.data[offset++];s2+=s1;if(--k==0){s1%=base;s2%=base;k=nmax}for(var x=0;x<this.width;x++){var offset=this.getPixelOffset(x,y);for(var i=0;i<this.bytesPerPixel;i++){s1+=this.data[offset++];s2+=s1;if(--k==0){s1%=base;s2%=base;k=nmax}}}}if(k!=nmax){s1%=base;s2%=base}this.storeInt4(this.data.length-8,(s2<<16)|s1)};IDATChunk.prototype.setDeflateHeader=function(header){if(isNaN(header)){throw new Error("IDATChunk.setDefaultHeader: header must be a number")}this.storeInt2(IDATChunk.DEFLATE,header)};IDATChunk.prototype.setPixel=function(x,y,color){if(isNaN(color)){throw new Error("IDATChunk.setPixel: parameters must be numbers")}if(color<0||255<color){throw new Error("IDATChunk.setPixel: color out of range: "+color)}if(arguments.length-2!=this.bytesPerPixel){throw new Error("IDATChunk.setPixel: not enough parameters to specify a color")}var offset=this.getPixelOffset(x,y);for(var i=0;i<this.bytesPerPixel;i++){this.storeByte(offset++,arguments[2+i])}};IDATChunk.prototype.getPixel=function(x,y){return this.data[this.getPixelOffset(x,y)]};IDATChunk.prototype.getPixelOffset=function(x,y){if(isNaN(x)||isNaN(y)){throw new Error("IDATChunk.setPixel: parameters must be numbers")}if(x<0||this.width<x){throw new Error("IDATChunk.getPixelOffset: x out of range: "+x)}if(y<0||this.width<y){throw new Error("IDATChunk.getPixelOffset: y out of range: "+y)}var index=y*this.width*this.bytesPerPixel+y+1+x*this.bytesPerPixel;var blocks_offset=5*Math.floor((index+this.blockSize)/this.blockSize);return IDATChunk.DATA+index+blocks_offset};IENDChunk.VERSION=1;IENDChunk.prototype=new Chunk();IENDChunk.prototype.constructor=IENDChunk;IENDChunk.superclass=Chunk.prototype;function IENDChunk(){IENDChunk.superclass.constructor.call(this,Chunk.EOD,"IEND")}tRNSChunk.VERSION=1;tRNSChunk.DATA=Chunk.EOD;tRNSChunk.prototype=new Chunk();tRNSChunk.prototype.constructor=tRNSChunk;tRNSChunk.superclass=Chunk.prototype;function tRNSChunk(lastIndex,entrySize){if(arguments.length>0){if(entrySize==null){entrySize=1}if(isNaN(lastIndex)){throw new Error("tRNSChunk: lastIndex must be a number")}if(lastIndex<0||255<lastIndex){throw new Error("tRNSChunk: lastIndex must be between 0 and 255, inclusive")}if(isNaN(entrySize)){throw new Error("tRNSChunk: entrySize must be null or a number")}if(entrySize!=1&&entrySize!=2&&entrySize!=6){throw new Error("tRNSChunk: entrySize must equal 1, 2 or 6")}var totalSize=tRNSChunk.DATA+((lastIndex+1)*entrySize);PLTEChunk.superclass.constructor.call(this,totalSize,"tRNS");this.entrySize=entrySize;this.lastIndex=lastIndex}}tRNSChunk.prototype.setAlpha=function(index,alpha){if(isNaN(index)){throw new Error("tRNSChunk.setAlpha: index must be a number")}if(index<0||this.lastIndex<index){throw new Error("tRNSChunk.setAlpha: index out of range: "+index)}if(this.entrySize!=1){throw new Error("tRNSChunk.setAlpha: this function valid with index color images only")}this.storeByte(tRNSChunk.DATA+index,alpha)};tRNSChunk.prototype.setTransparencyValue=function(value){var lastIndex=(Png.ASV_FIX)?1:0;if(this.entrySize!=2||this.lastIndex!=lastIndex){throw new Error("tRNSChunk.setTransparencyValue: this function valid with greyscale images only")}this.storeInt2(tRNSChunk.DATA,value)};tRNSChunk.prototype.setTransparencyColor=function(red,green,blue){if(this.entrySize!=6||this.lastIndex!=0){throw new Error("tRNSChunk.setTransparencyColor: this function valid with color images only")}this.storeInt2(tRNSChunk.DATA,red);this.storeInt2(tRNSChunk.DATA+2,green);this.storeInt2(tRNSChunk.DATA+4,blue)};Png.VERSION=1;Png.ASV_FIX=true;function Png(width,height,useTransparency){this.chunks=[]}Png.prototype.getBase64=function(){return Base64.encode(this.getData()).split("\n").join("")};Png.prototype.setColor=function(index,red,green,blue,alpha){this.palette.setColor(index,red,green,blue);if(alpha!=null&&this.alphas!=null){this.alphas.setAlpha(index,alpha)}};Png.prototype.getData=function(){var chunks=this.chunks;var length=chunks.length;var data=[];var header="\211PNG\r\n\032\n";for(var i=0;i<header.length;i++){data.push(header.charCodeAt(i))}this.image.setChecksum();for(var i=0;i<length;i++){var chunk=chunks[i];chunk.setCRC();data=data.concat(chunk.data)}return data};Png.prototype.getHeight=function(){return this.image.height};Png.prototype.setPixel=function(x,y,color){this.image.setPixel(x,y,color)};Png.prototype.getWidth=function(){return this.image.width};PngGreyscale.VERSION=1;PngGreyscale.prototype=new Png();PngGreyscale.prototype.constructor=PngGreyscale;PngGreyscale.superclass=Png.prototype;function PngGreyscale(width,height,useAlpha){if(arguments.length>0){if(useAlpha==null){useAlpha=false}PngGreyscale.superclass.constructor.call(this);var colorType=(useAlpha)?4:0;this.chunks.push(this.header=new IHDRChunk(width,height,8,colorType,0,0,0));this.transparency=null;this.useAlpha=useAlpha;if(useAlpha){this.chunks.push(this.image=new IDATChunk(width,height,2))}else{this.chunks.push(this.image=new IDATChunk(width,height))}this.chunks.push(this.end=new IENDChunk())}}PngGreyscale.prototype.setPixel=function(x,y,value,alpha){if(this.useAlpha){this.image.setPixel(x,y,value,alpha)}else{this.image.setPixel(x,y,value)}};PngGreyscale.prototype.setTransparencyValue=function(value){if(this.transparency==null){var lastIndex=(Png.ASV_FIX)?1:0;this.transparency=new tRNSChunk(lastIndex,2);this.chunks.splice(1,0,this.transparency)}this.transparency.setTransparencyValue(value)};PngIndex.VERSION=1;PngIndex.prototype=new Png();PngIndex.prototype.constructor=PngIndex;PngIndex.superclass=Png.prototype;function PngIndex(width,height,useTransparency){if(arguments.length>0){PngIndex.superclass.constructor.call(this);this.chunks.push(this.header=new IHDRChunk(width,height,8,3,0,0,0));this.chunks.push(this.palette=new PLTEChunk(255));if(useTransparency){this.chunks.push(this.alphas=new tRNSChunk(255))}this.chunks.push(this.image=new IDATChunk(width,height));this.chunks.push(this.end=new IENDChunk())}}PngTrueColor.VERSION=1;PngTrueColor.prototype=new Png();PngTrueColor.prototype.constructor=PngTrueColor;PngTrueColor.superclass=Png.prototype;function PngTrueColor(width,height,useAlpha){if(arguments.length>0){if(useAlpha==null){useAlpha=false}PngTrueColor.superclass.constructor.call(this);var colorType=(useAlpha)?6:2;this.chunks.push(this.header=new IHDRChunk(width,height,8,colorType,0,0,0));this.transparency=null;this.useAlpha=useAlpha;this.chunks.push(this.image=new IDATChunk(width,height,(useAlpha)?4:3));this.chunks.push(this.end=new IENDChunk())}}PngTrueColor.prototype.setPixel=function(x,y,red,green,blue,alpha){if(this.useAlpha){this.image.setPixel(x,y,red,green,blue,alpha)}else{this.image.setPixel(x,y,red,green,blue)}};PngTrueColor.prototype.setTransparencyColor=function(red,green,blue){if(this.transparency==null){this.transparency=new tRNSChunk(0,6);this.chunks.splice(1,0,this.transparency)}this.transparency.setTransparencyColor(red,green,blue)};var p_isIE=!!(document.expando&&document.uniqueID);var p_oColorNames={transparent:"transparent",aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var p_aColorNames=[];for(var i in p_oColorNames){p_aColorNames.push(i)}var oApi={trim:function(str){str=str||"";return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},parseRGB:function(sColor){if(sColor.indexOf("rgb")<0){return null}var re=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");var rgb=sColor.replace(re,"$1,$2,$3").split(",");if(rgb.length==3){return rgb}else{return null}},getRandomColorName:function(){var n=Math.round(Math.random()*p_aColorNames.length)-1;return p_aColorNames[n]},toRGB:function(sColor){sColor=this.trim(sColor).toLowerCase();sColor=p_oColorNames[sColor]||sColor;switch(true){case (sColor.indexOf("#")==0):return this.convertHexToRGB(sColor);case (sColor.indexOf("rgba")==0):return this.convertRGBToRGB(sColor);case (sColor.indexOf("rgb")==0):return this.convertRGBToRGB(sColor);default:return null}},convertRGBToRGB:function(sColor){var aRGB=this.parseRGB(sColor);if(!aRGB){return null}return"rgb("+aRGB.join(",")+")"},convertRGBAToRGB:function(sColor){if(sColor.indexOf("rgba")<0){return null}},convertRGBToHex:function(sColor){if(sColor.indexOf("rgb")<0){return null}var rgb=this.parseRGB(sColor);if(rgb){r=parseInt(rgb[0]).toString(16);g=parseInt(rgb[1]).toString(16);b=parseInt(rgb[2]).toString(16);r=r.length==1?"0"+r:r;g=g.length==1?"0"+g:g;b=b.length==1?"0"+b:b;return"#"+r+g+b}else{return null}},convertRGBtoRGBA:function(sColor,nOpacity){var rgb=this.parseRGB(sColor);nOpacity=Math.round(nOpacity*10)/10;if(!rgb){return null}return["rgba(",rgb,",",nOpacity,")"].join("")},convertHexToRGB:function(sColor){if(sColor.indexOf("#")<0){return null}sColor=sColor.replace(new RegExp("[^0-9A-F]","gi"),"");r=parseInt(sColor.substring(0,2),16);g=parseInt(sColor.substring(2,4),16);b=parseInt(sColor.substring(4,6),16);return"rgb("+r+","+g+","+b+")"},set:function(dEl,sColor,nOpacity){if(typeof(dEl)==="string"){dEl=document.getElementById(dEl)}if(!dEl){throw new Error("unknown object or element : "+dEl)}sColor=this.toRGB(sColor);if(!sColor){throw new Error("unknown color name : "+sColor)}if(isNaN(nOpacity)||nOpacity>=1){return dEl.style.background=sColor}nOpacity=Math.min(nOpacity,1);nOpacity=Math.max(nOpacity,0);if(p_isIE){with(dEl.style){zoom:1;background="transparent";filter=this.getFilterValue(sColor,nOpacity)}return true}else{dEl.style.background="transparent "+this.getDataUrlValue(sColor,nOpacity)}},getFilterValue:function(sColor,nOpacity){sColor=this.convertRGBToHex(sColor);nOpacity=Math.round(nOpacity*255).toString(16);sColor="#"+nOpacity+sColor.substr(1,7);var filter=["progid:DXImageTransform.Microsoft.gradient(startColorstr=",sColor,",endColorstr=",sColor,")"].join("");return filter},getDataUrlValue:function(sColor,nOpacity){sColor=this.toRGB(sColor);var png=new PngIndex(1,1,true);var rgb=this.parseRGB(sColor);png.setColor(0,rgb[0],rgb[1],rgb[2],Math.round(nOpacity*255));return"url(data:image/png;base64,"+png.getBase64()+")"},getCssText:function(sColor,nOpacity){sColor=this.toRGB(sColor);return["*zoom:1","*background:none","*filter:"+this.getFilterValue(sColor,nOpacity),"background:transparent "+this.getDataUrlValue(sColor,nOpacity),""].join(";")}};return oApi})();