function RGBColor(n){var r,u,t,i;this.ok=!1;n.charAt(0)=="#"&&(n=n.substr(1,6));n=n.replace(/ /g,"");n=n.toLowerCase();r={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",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"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",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(u in r)n==u&&(n=r[u]);for(t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(n){return[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}}],i=0;i<t.length;i++){var e=t[i].re,o=t[i].process,f=e.exec(n);f&&(channels=o(f),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var n=this.r.toString(16),t=this.g.toString(16),i=this.b.toString(16);return n.length==1&&(n="0"+n),t.length==1&&(t="0"+t),i.length==1&&(i="0"+i),"#"+n+t+i};this.getHelpXML=function(){for(var i=[],o,u,c,f,l,n=0;n<t.length;n++)for(o=t[n].example,u=0;u<o.length;u++)i[i.length]=o[u];for(c in r)i[i.length]=c;for(f=document.createElement("ul"),f.setAttribute("id","rgbcolor-examples"),n=0;n<i.length;n++)try{var s=document.createElement("li"),e=new RGBColor(i[n]),h=document.createElement("div");h.style.cssText="margin: 3px; border: 1px solid black; background:"+e.toHex()+"; color:"+e.toHex();h.appendChild(document.createTextNode("test"));l=document.createTextNode(" "+i[n]+" -> "+e.toRGB()+" -> "+e.toHex());s.appendChild(h);s.appendChild(l);f.appendChild(s)}catch(a){}return f}}function stackBlurImage(n,t,i,r){var o=document.getElementById(n),u=o.naturalWidth,f=o.naturalHeight,e=document.getElementById(t),s;(e.style.width=u+"px",e.style.height=f+"px",e.width=u,e.height=f,s=e.getContext("2d"),s.clearRect(0,0,u,f),s.drawImage(o,0,0),isNaN(i)||i<1)||(r?stackBlurCanvasRGBA(t,0,0,u,f,i):stackBlurCanvasRGB(t,0,0,u,f,i))}function stackBlurCanvasRGBA(n,t,i,r,u,f){var ii,wt,bt,ti,l,y,et,ot;if(!isNaN(f)&&!(f<1)){f|=0;ii=document.getElementById(n);wt=ii.getContext("2d");try{try{bt=wt.getImageData(t,i,r,u)}catch(ri){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");bt=wt.getImageData(t,i,r,u)}catch(ri){alert("Cannot access local image");throw new Error("unable to access local image data: "+ri);}}}catch(ri){alert("Cannot access image");throw new Error("unable to access image data: "+ri);}for(var e=bt.data,tt,yt,h,dt,c,gt,k,d,g,nt,st,ht,ct,lt,it,rt,ut,ft,p,w,b,s,at,ui=f+f+1,fi=r<<2,kt=r-1,ni=u-1,v=f+1,vt=v*(v+1)/2,pt=new BlurStack,o=pt,a=1;a<ui;a++)o=o.next=new BlurStack,a==v&&(ti=o);for(o.next=pt,l=null,y=null,gt=c=0,et=mul_table[f],ot=shg_table[f],yt=0;yt<u;yt++){for(it=rt=ut=ft=k=d=g=nt=0,st=v*(p=e[c]),ht=v*(w=e[c+1]),ct=v*(b=e[c+2]),lt=v*(s=e[c+3]),k+=vt*p,d+=vt*w,g+=vt*b,nt+=vt*s,o=pt,a=0;a<v;a++)o.r=p,o.g=w,o.b=b,o.a=s,o=o.next;for(a=1;a<v;a++)h=c+((kt<a?kt:a)<<2),k+=(o.r=p=e[h])*(at=v-a),d+=(o.g=w=e[h+1])*at,g+=(o.b=b=e[h+2])*at,nt+=(o.a=s=e[h+3])*at,it+=p,rt+=w,ut+=b,ft+=s,o=o.next;for(l=pt,y=ti,tt=0;tt<r;tt++)e[c+3]=s=nt*et>>ot,s!=0?(s=255/s,e[c]=(k*et>>ot)*s,e[c+1]=(d*et>>ot)*s,e[c+2]=(g*et>>ot)*s):e[c]=e[c+1]=e[c+2]=0,k-=st,d-=ht,g-=ct,nt-=lt,st-=l.r,ht-=l.g,ct-=l.b,lt-=l.a,h=gt+((h=tt+f+1)<kt?h:kt)<<2,it+=l.r=e[h],rt+=l.g=e[h+1],ut+=l.b=e[h+2],ft+=l.a=e[h+3],k+=it,d+=rt,g+=ut,nt+=ft,l=l.next,st+=p=y.r,ht+=w=y.g,ct+=b=y.b,lt+=s=y.a,it-=p,rt-=w,ut-=b,ft-=s,y=y.next,c+=4;gt+=r}for(tt=0;tt<r;tt++){for(rt=ut=ft=it=d=g=nt=k=0,c=tt<<2,st=v*(p=e[c]),ht=v*(w=e[c+1]),ct=v*(b=e[c+2]),lt=v*(s=e[c+3]),k+=vt*p,d+=vt*w,g+=vt*b,nt+=vt*s,o=pt,a=0;a<v;a++)o.r=p,o.g=w,o.b=b,o.a=s,o=o.next;for(dt=r,a=1;a<=f;a++)c=dt+tt<<2,k+=(o.r=p=e[c])*(at=v-a),d+=(o.g=w=e[c+1])*at,g+=(o.b=b=e[c+2])*at,nt+=(o.a=s=e[c+3])*at,it+=p,rt+=w,ut+=b,ft+=s,o=o.next,a<ni&&(dt+=r);for(c=tt,l=pt,y=ti,yt=0;yt<u;yt++)h=c<<2,e[h+3]=s=nt*et>>ot,s>0?(s=255/s,e[h]=(k*et>>ot)*s,e[h+1]=(d*et>>ot)*s,e[h+2]=(g*et>>ot)*s):e[h]=e[h+1]=e[h+2]=0,k-=st,d-=ht,g-=ct,nt-=lt,st-=l.r,ht-=l.g,ct-=l.b,lt-=l.a,h=tt+((h=yt+v)<ni?h:ni)*r<<2,k+=it+=l.r=e[h],d+=rt+=l.g=e[h+1],g+=ut+=l.b=e[h+2],nt+=ft+=l.a=e[h+3],l=l.next,st+=p=y.r,ht+=w=y.g,ct+=b=y.b,lt+=s=y.a,it-=p,rt-=w,ut-=b,ft-=s,y=y.next,c+=r}wt.putImageData(bt,t,i)}}function stackBlurCanvasRGB(n,t,i,r,u,f){var dt,at,vt,kt,l,w,ot,st;if(!isNaN(f)&&!(f<1)){f|=0;dt=document.getElementById(n);at=dt.getContext("2d");try{try{vt=at.getImageData(t,i,r,u)}catch(gt){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");vt=at.getImageData(t,i,r,u)}catch(gt){alert("Cannot access local image");throw new Error("unable to access local image data: "+gt);}}}catch(gt){alert("Cannot access image");throw new Error("unable to access image data: "+gt);}for(var o=vt.data,g,et,h,pt,c,wt,b,k,d,rt,ut,ft,nt,tt,it,v,y,p,ht,ni=f+f+1,ti=r<<2,yt=r-1,bt=u-1,a=f+1,ct=a*(a+1)/2,lt=new BlurStack,e=lt,s=1;s<ni;s++)e=e.next=new BlurStack,s==a&&(kt=e);for(e.next=lt,l=null,w=null,wt=c=0,ot=mul_table[f],st=shg_table[f],et=0;et<u;et++){for(nt=tt=it=b=k=d=0,rt=a*(v=o[c]),ut=a*(y=o[c+1]),ft=a*(p=o[c+2]),b+=ct*v,k+=ct*y,d+=ct*p,e=lt,s=0;s<a;s++)e.r=v,e.g=y,e.b=p,e=e.next;for(s=1;s<a;s++)h=c+((yt<s?yt:s)<<2),b+=(e.r=v=o[h])*(ht=a-s),k+=(e.g=y=o[h+1])*ht,d+=(e.b=p=o[h+2])*ht,nt+=v,tt+=y,it+=p,e=e.next;for(l=lt,w=kt,g=0;g<r;g++)o[c]=b*ot>>st,o[c+1]=k*ot>>st,o[c+2]=d*ot>>st,b-=rt,k-=ut,d-=ft,rt-=l.r,ut-=l.g,ft-=l.b,h=wt+((h=g+f+1)<yt?h:yt)<<2,nt+=l.r=o[h],tt+=l.g=o[h+1],it+=l.b=o[h+2],b+=nt,k+=tt,d+=it,l=l.next,rt+=v=w.r,ut+=y=w.g,ft+=p=w.b,nt-=v,tt-=y,it-=p,w=w.next,c+=4;wt+=r}for(g=0;g<r;g++){for(tt=it=nt=k=d=b=0,c=g<<2,rt=a*(v=o[c]),ut=a*(y=o[c+1]),ft=a*(p=o[c+2]),b+=ct*v,k+=ct*y,d+=ct*p,e=lt,s=0;s<a;s++)e.r=v,e.g=y,e.b=p,e=e.next;for(pt=r,s=1;s<=f;s++)c=pt+g<<2,b+=(e.r=v=o[c])*(ht=a-s),k+=(e.g=y=o[c+1])*ht,d+=(e.b=p=o[c+2])*ht,nt+=v,tt+=y,it+=p,e=e.next,s<bt&&(pt+=r);for(c=g,l=lt,w=kt,et=0;et<u;et++)h=c<<2,o[h]=b*ot>>st,o[h+1]=k*ot>>st,o[h+2]=d*ot>>st,b-=rt,k-=ut,d-=ft,rt-=l.r,ut-=l.g,ft-=l.b,h=g+((h=et+a)<bt?h:bt)*r<<2,b+=nt+=l.r=o[h],k+=tt+=l.g=o[h+1],d+=it+=l.b=o[h+2],l=l.next,rt+=v=w.r,ut+=y=w.g,ft+=p=w.b,nt-=v,tt-=y,it-=p,w=w.next,c+=r}at.putImageData(vt,t,i)}}function BlurStack(){this.r=0;this.g=0;this.b=0;this.a=0;this.next=null}function svgAvatarsTranslation(n,t){return welcome_slogan="<h2>Welcome to SVG Avatar Generator<\/h2>",welcome_msg="<p>Select where you would like to start<\/p>",wait_msg="<p>Please wait...<\/p>",rnd_msg="random",reset_msg="reset",save_msg="save",share_msg="share",gravatar_msg="Gravatar",dnl_msg="download",svg_msg="svg - vector format",png_one_msg="png - "+n+"x"+n,png_two_msg="png - "+t+"x"+t,confirm_msg="<h3>Are you sure?<\/h3><p>The all current changes will be lost.<\/p>",ios_msg="<p>Please tap and hold the image and choose Save<\/p>",gravatar_title="<h3>You can upload to and use the created avatar on Gravatar.com<\/h3><p>Please enter your Gravatar email and password<\/p>",gravatar_email="Your Gravatar email",gravatar_pwd="Your Gravatar password",gravatar_rating="Rating:",gravatar_note="<p><small>Note: Your email and password will NEVER be stored on our server<\/small><\/p>",install_msg="upload",alert_svg_support_error="Sorry, but your browser does not support SVG (Scalable Vector Graphic).<br> Avatar Generator cannot start.",alert_json_error="<h3>Error loading graphic data!<\/h3><p>Please reload a page<\/p>",alert_success="<h3>Your avatar is stored on our server.<\/h3><p>Thank you!<\/p>",alert_error="<h3>Avatar is not saved!<\/h3><p>Please try again<\/p>",alert_error_download="<h3>An error occured!<\/h3><p>Please try again<\/p>",alert_error_image="<h3>The image is broken!<\/h3><p>Please try again<\/p>",alert_success_gravatar="<h3>Congratulations!<\/h3><p>You have successfully changed your Gravatar.<\/p><p>Please allow 5 to 10 minutes for avatar changes to take effect<\/p>",alert_common_error_gravatar="<h3>An unknown error occured!<\/h3><p>Please try again<\/p>",alert_error_ratingfail="<h3>The wrong Rating value!<\/h3><p>Don't change input radio values. Please try again<\/p>",alert_error_emailfail="<h3>Email is empty!<\/h3><p>Please enter your email and try again<\/p>",alert_error_passwordfail="<h3>Password is empty!<\/h3><p>Please enter your password and try again<\/p>",alert_error_imagefail="<h3>An error with converting your avatar to PNG data!<\/h3><p>Please try again<\/p>",alert_error_faultcode_8="<h3>Internal error on secure.gravatar.com<\/h3><p>Please try later<\/p>",alert_error_faultcode_9="<h3>Incorrect Email or Password!<\/h3><p>Please check them and try again<\/p>",crd_msg="Graphic engine by ",ok_msg="ok",cancel_msg="cancel",close_msg="close",tryagain_msg="try again",block_titles={face:"face",eyes:"eyes",hair:"head",clothes:"clothes",backs:"backgrounds",accessories:"accessories"},body_zone_titles={backs:"basic",faceshape:"shape",chinshadow:"",facehighlight:"",humanbody:"",clothes:"basic",hair:"hair",freckles:"freckles",ears:"ears",eyebrows:"eyebrows",eyesback:"",eyesiris:"eyeballs",eyesfront:"eye shape",mouth:"mouth",nose:"nose",glasses:"glasses",mustache:"moustache",beard:"facial hair",hats:"on head",earings:"earings",necklaces:"necklaces",decor:"scenes"}}var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol?"symbol":typeof n},mul_table,shg_table;(function(){var n,t;if(this.SVG=function(n){if(SVG.supported)return new SVG.Doc(n)},SVG.ns="http://www.w3.org/2000/svg",SVG.xlink="http://www.w3.org/1999/xlink",SVG.did=1e3,SVG.eid=function(n){return"Svgjs"+n.charAt(0).toUpperCase()+n.slice(1)+SVG.did++},SVG.create=function(n){var t=document.createElementNS(this.ns,n);return t.setAttribute("id",this.eid(n)),t},SVG.extend=function(){var n,i,r,t;for(n=[].slice.call(arguments),i=n.pop(),t=n.length-1;t>=0;t--)if(n[t])for(r in i)n[t].prototype[r]=i[r];SVG.Set&&SVG.Set.inherit&&SVG.Set.inherit()},SVG.get=function(n){var t=document.getElementById(n);if(t)return t.instance},SVG.supported=function(){return!!document.createElementNS&&!!document.createElementNS(SVG.ns,"svg").createSVGRect}(),!SVG.supported)return!1;SVG.regex={test:function(n,t){return this[t].test(n)},unit:/^(-?[\d\.]+)([a-z%]{0,2})$/,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isStyle:/^font|text|leading|cursor/,isBlank:/^(\s+)?$/,isNumber:/^-?[\d\.]+$/,isPercent:/^-?[\d\.]+%$/};SVG.defaults={matrix:"1 0 0 1 0 0",attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000"},trans:function(){return{x:0,y:0,scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0,matrix:this.matrix,a:1,b:0,c:0,d:1,e:0,f:0}}};SVG.Color=function(n){var t;this.r=0;this.g=0;this.b=0;typeof n=="string"?SVG.regex.isRgb.test(n)?(t=SVG.regex.rgb.exec(n.replace(/\s/g,"")),this.r=parseInt(t[1]),this.g=parseInt(t[2]),this.b=parseInt(t[3])):SVG.regex.isHex.test(n)&&(t=SVG.regex.hex.exec(this._fullHex(n)),this.r=parseInt(t[1],16),this.g=parseInt(t[2],16),this.b=parseInt(t[3],16)):(typeof n=="undefined"?"undefined":_typeof(n))=="object"&&(this.r=n.r,this.g=n.g,this.b=n.b)};SVG.extend(SVG.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+this._compToHex(this.r)+this._compToHex(this.g)+this._compToHex(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},_fullHex:function(n){return n.length==4?["#",n.substring(1,2),n.substring(1,2),n.substring(2,3),n.substring(2,3),n.substring(3,4),n.substring(3,4)].join(""):n},_compToHex:function(n){var t=n.toString(16);return t.length==1?"0"+t:t}});SVG.Color.test=function(n){return n+="",SVG.regex.isHex.test(n)||SVG.regex.isRgb.test(n)};SVG.Color.isRgb=function(n){return n&&typeof n.r=="number"};SVG.Array=function(n,t){n=(n||[]).valueOf();n.length==0&&t&&(n=t.valueOf());this.value=this.parse(n)};SVG.extend(SVG.Array,{morph:function(n){if(this.destination=this.parse(n),this.value.length!=this.destination.length){for(var t=this.value[this.value.length-1],i=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(i);while(this.value.length<this.destination.length)this.value.push(t)}return this},settle:function(){for(var t=[],n=this.value.length-1;n>=0;n--)t.indexOf(this.value[n])==-1&&t.push(this.value[n]);return this.value=t},at:function(n){if(!this.destination)return this;for(var t=0,r=this.value.length,i=[];t<r;t++)i.push(this.value[t]+(this.destination[t]-this.value[t])*n);return new SVG.Array(i)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(n){return(n=n.valueOf(),Array.isArray(n))?n:this.split(n)},split:function(n){return n.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").split(" ")}});SVG.PointArray=function(){this.constructor.apply(this,arguments)};SVG.PointArray.prototype=new SVG.Array;SVG.extend(SVG.PointArray,{toString:function(){for(var n=0,i=this.value.length,t=[];n<i;n++)t.push(this.value[n].join(","));return t.join(" ")},at:function(n){if(!this.destination)return this;for(var t=0,r=this.value.length,i=[];t<r;t++)i.push([this.value[t][0]+(this.destination[t][0]-this.value[t][0])*n,this.value[t][1]+(this.destination[t][1]-this.value[t][1])*n]);return new SVG.PointArray(i)},parse:function(n){if(n=n.valueOf(),Array.isArray(n))return n;n=this.split(n);for(var t=0,u=n.length,i,r=[];t<u;t++)i=n[t].split(","),r.push([parseFloat(i[0]),parseFloat(i[1])]);return r},move:function(n,t){var r=this.bbox(),i;for(n-=r.x,t-=r.y,i=this.value.length-1;i>=0;i--)this.value[i]=[this.value[i][0]+n,this.value[i][1]+t];return this},size:function(n,t){for(var r=this.bbox(),i=this.value.length-1;i>=0;i--)this.value[i][0]=(this.value[i][0]-r.x)*n/r.width+r.x,this.value[i][1]=(this.value[i][1]-r.y)*t/r.height+r.x;return this},bbox:function(){if(this.value.length==0)return{x:0,y:0,width:0,height:0};for(var i=this.value[0][0],r=this.value[0][1],t={x:i,y:r},n=this.value.length-1;n>=0;n--)this.value[n][0]<t.x&&(t.x=this.value[n][0]),this.value[n][1]<t.y&&(t.y=this.value[n][1]),this.value[n][0]>i&&(i=this.value[n][0]),this.value[n][1]>r&&(r=this.value[n][1]);return t.width=i-t.x,t.height=r-t.y,t}});SVG.Number=function(n){this.value=0;this.unit="";switch(typeof n=="undefined"?"undefined":_typeof(n)){case"number":this.value=isNaN(n)?0:isFinite(n)?n:n<0?-34e37:34e37;break;case"string":var t=n.match(SVG.regex.unit);t&&(this.value=parseFloat(t[1]),t[2]=="%"&&(this.value/=100),this.unit=t[2]);break;default:n instanceof SVG.Number&&(this.value=n.value,this.unit=n.unit)}};SVG.extend(SVG.Number,{toString:function(){return(this.unit=="%"?~~(this.value*1e8)/1e6:this.value)+this.unit},valueOf:function(){return this.value},to:function(n){return typeof n=="string"&&(this.unit=n),this},plus:function(n){return this.value=this+new SVG.Number(n),this},minus:function(n){return this.plus(-new SVG.Number(n))},times:function(n){return this.value=this*new SVG.Number(n),this},divide:function(n){return this.value=this/new SVG.Number(n),this}});SVG.ViewBox=function(n){var u,f,i,r,e=n.bbox(),t=(n.attr("viewBox")||"").match(/-?[\d\.]+/g);this.x=e.x;this.y=e.y;this.width=n.node.offsetWidth||n.attr("width");this.height=n.node.offsetHeight||n.attr("height");t&&(u=parseFloat(t[0]),f=parseFloat(t[1]),i=parseFloat(t[2]),r=parseFloat(t[3]),this.zoom=this.width/this.height>i/r?this.height/r:this.width/i,this.x=u,this.y=f,this.width=i,this.height=r);this.zoom=this.zoom||1};SVG.extend(SVG.ViewBox,{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height}});SVG.BBox=function(n){var t;if(this.x=0,this.y=0,this.width=0,this.height=0,n){try{t=n.node.getBBox()}catch(i){t={x:n.node.clientLeft,y:n.node.clientTop,width:n.node.clientWidth,height:n.node.clientHeight}}this.x=t.x+n.trans.x;this.y=t.y+n.trans.y;this.width=t.width*n.trans.scaleX;this.height=t.height*n.trans.scaleY}this.cx=this.x+this.width/2;this.cy=this.y+this.height/2};SVG.extend(SVG.BBox,{merge:function(n){var t=new SVG.BBox;return t.x=Math.min(this.x,n.x),t.y=Math.min(this.y,n.y),t.width=Math.max(this.x+this.width,n.x+n.width)-t.x,t.height=Math.max(this.y+this.height,n.y+n.height)-t.y,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}});SVG.RBox=function(n){var t,i,r={};if(this.x=0,this.y=0,this.width=0,this.height=0,n){for(t=n.doc().parent,i=n.doc().viewbox().zoom,r=n.node.getBoundingClientRect(),this.x=r.left,this.y=r.top,this.x-=t.offsetLeft,this.y-=t.offsetTop;t=t.offsetParent;)this.x-=t.offsetLeft,this.y-=t.offsetTop;for(t=n;t=t.parent;)t.type=="svg"&&t.viewbox&&(i*=t.viewbox().zoom,this.x-=t.x()||0,this.y-=t.y()||0)}this.x/=i;this.y/=i;this.width=r.width/=i;this.height=r.height/=i;this.cx=this.x+this.width/2;this.cy=this.y+this.height/2};SVG.Element=function(n){this._stroke=SVG.defaults.attrs.stroke;this.styles={};this.trans=SVG.defaults.trans();(this.node=n)&&(this.type=n.nodeName,this.node.instance=this)};SVG.extend(SVG.Element,{x:function(n){return n&&(n=new SVG.Number(n),n.value/=this.trans.scaleX),this.attr("x",n)},y:function(n){return n&&(n=new SVG.Number(n),n.value/=this.trans.scaleY),this.attr("y",n)},cx:function(n){return n==null?this.bbox().cx:this.x(n-this.bbox().width/2)},cy:function(n){return n==null?this.bbox().cy:this.y(n-this.bbox().height/2)},move:function(n,t){return this.x(n).y(t)},center:function(n,t){return this.cx(n).cy(t)},size:function(n,t){return this.attr({width:new SVG.Number(n),height:new SVG.Number(t)})},clone:function(){var t,i,n=this.type;return t=n=="rect"||n=="ellipse"?this.parent[n](0,0):n=="line"?this.parent[n](0,0,0,0):n=="image"?this.parent[n](this.src):n=="text"?this.parent[n](this.content):n=="path"?this.parent[n](this.attr("d")):n=="polyline"||n=="polygon"?this.parent[n](this.attr("points")):n=="g"?this.parent.group():this.parent[n](),i=this.attr(),delete i.id,t.attr(i),t.trans=this.trans,t.transform({})},remove:function(){return this.parent&&this.parent.removeElement(this),this},doc:function(n){return this._parent(n||SVG.Doc)},attr:function(n,t,i){if(n==null){for(n={},t=this.node.attributes,i=t.length-1;i>=0;i--)n[t[i].nodeName]=SVG.regex.test(t[i].nodeValue,"isNumber")?parseFloat(t[i].nodeValue):t[i].nodeValue;return n}if((typeof n=="undefined"?"undefined":_typeof(n))=="object")for(t in n)this.attr(t,n[t]);else if(t===null)this.node.removeAttribute(n);else{if(t==null)return this._isStyle(n)?n=="text"?this.content:n=="leading"&&this.leading?this.leading():this.style(n):(t=this.node.getAttribute(n),t==null?SVG.defaults.attrs[n]:SVG.regex.test(t,"isNumber")?parseFloat(t):t);if(n=="style")return this.style(t);if(n=="x"&&Array.isArray(this.lines))for(i=this.lines.length-1;i>=0;i--)this.lines[i].attr(n,t);n=="stroke-width"?this.attr("stroke",parseFloat(t)>0?this._stroke:null):n=="stroke"&&(this._stroke=t);SVG.Color.test(t)||SVG.Color.isRgb(t)?t=new SVG.Color(t):typeof t=="number"?t=new SVG.Number(t):Array.isArray(t)&&(t=new SVG.Array(t));i!=null?this.node.setAttributeNS(i,n,t.toString()):this.node.setAttribute(n,t.toString());this._isStyle(n)&&(n=="text"?this.text(t):n=="leading"&&this.leading?this.leading(t):this.style(n,t),this.rebuild&&this.rebuild(n,t))}return this},transform:function(n,t){var i;if(arguments.length==0)return this.trans;if(typeof n=="string")return arguments.length<2?this.trans[n]:(i={},i[n]=t,this.transform(i));i=[];n=this._parseMatrix(n);for(t in n)n[t]!=null&&(this.trans[t]=n[t]);return this.trans.matrix=this.trans.a+" "+this.trans.b+" "+this.trans.c+" "+this.trans.d+" "+this.trans.e+" "+this.trans.f,n=this.trans,n.matrix!=SVG.defaults.matrix&&i.push("matrix("+n.matrix+")"),n.rotation!=0&&i.push("rotate("+n.rotation+" "+(n.cx==null?this.bbox().cx:n.cx)+" "+(n.cy==null?this.bbox().cy:n.cy)+")"),(n.scaleX!=1||n.scaleY!=1)&&i.push("scale("+n.scaleX+" "+n.scaleY+")"),n.skewX!=0&&i.push("skewX("+n.skewX+")"),n.skewY!=0&&i.push("skewY("+n.skewY+")"),(n.x!=0||n.y!=0)&&i.push("translate("+new SVG.Number(n.x/n.scaleX)+" "+new SVG.Number(n.y/n.scaleY)+")"),this._offset&&this._offset.x!=0&&this._offset.y!=0&&i.push("translate("+-this._offset.x+" "+-this._offset.y+")"),i.length==0?this.node.removeAttribute("transform"):this.node.setAttribute("transform",i.join(" ")),this},style:function(n,t){if(arguments.length==0)return this.attr("style")||"";if(arguments.length<2)if((typeof n=="undefined"?"undefined":_typeof(n))=="object")for(t in n)this.style(t,n[t]);else if(SVG.regex.isCss.test(n)){n=n.split(";");for(var i=0;i<n.length;i++)t=n[i].split(":"),t.length==2&&this.style(t[0].replace(/\s+/g,""),t[1].replace(/^\s+/,"").replace(/\s+$/,""))}else return this.styles[n];else t===null||SVG.regex.test(t,"isBlank")?delete this.styles[n]:this.styles[n]=t;n="";for(t in this.styles)n+=t+":"+this.styles[t]+";";return n==""?this.node.removeAttribute("style"):this.node.setAttribute("style",n),this},data:function(n,t,i){if(arguments.length<2)try{return JSON.parse(this.attr("data-"+n))}catch(r){return this.attr("data-"+n)}else this.attr("data-"+n,t===null?null:i===!0||typeof t=="string"||typeof t=="number"?t:JSON.stringify(t));return this},bbox:function(){return new SVG.BBox(this)},rbox:function(){return new SVG.RBox(this)},inside:function(n,t){var i=this.bbox();return n>i.x&&t>i.y&&n<i.x+i.width&&t<i.y+i.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},_parent:function(n){for(var t=this;t!=null&&!(t instanceof n);)t=t.parent;return t},_isStyle:function(n){return typeof n=="string"?SVG.regex.test(n,"isStyle"):!1},_parseMatrix:function(n){if(n.matrix){var t=n.matrix.replace(/\s/g,"").split(",");t.length==6&&(n.a=parseFloat(t[0]),n.b=parseFloat(t[1]),n.c=parseFloat(t[2]),n.d=parseFloat(t[3]),n.e=parseFloat(t[4]),n.f=parseFloat(t[5]))}return n}});SVG.Parent=function(n){this.constructor.call(this,n)};SVG.Parent.prototype=new SVG.Element;SVG.extend(SVG.Parent,{children:function(){return this._children||(this._children=[])},add:function(n,t){if(!this.has(n)){if(t=t==null?this.children().length:t,n.parent){var i=n.parent.children().indexOf(n);n.parent.children().splice(i,1)}this.children().splice(t,0,n);this.node.insertBefore(n.node,this.node.childNodes[t]||null);n.parent=this}return this._defs&&(this.node.removeChild(this._defs.node),this.node.appendChild(this._defs.node)),this},put:function(n,t){return this.add(n,t),n},has:function(n){return this.children().indexOf(n)>=0},get:function(n){return this.children()[n]},first:function(){return this.children()[0]},last:function(){return this.children()[this.children().length-1]},each:function(n,t){for(var r=this.children(),i=0,u=r.length;i<u;i++)r[i]instanceof SVG.Element&&n.apply(r[i],[i,r]),t&&r[i]instanceof SVG.Container&&r[i].each(n,t);return this},removeElement:function(n){var t=this.children().indexOf(n);return this.children().splice(t,1),this.node.removeChild(n.node),n.parent=null,this},clear:function(){for(var n=this.children().length-1;n>=0;n--)this.removeElement(this.children()[n]);return this._defs&&this._defs.clear(),this},defs:function(){return this.doc().defs()}});SVG.Container=function(n){this.constructor.call(this,n)};SVG.Container.prototype=new SVG.Parent;SVG.extend(SVG.Container,{viewbox:function(n){return arguments.length==0?new SVG.ViewBox(this):(n=arguments.length==1?[n.x,n.y,n.width,n.height]:[].slice.call(arguments),this.attr("viewBox",n))}});SVG.FX=function(n){this.target=n};SVG.extend(SVG.FX,{animate:function(n,t,i){var f,e,o,s,u=this.target,r=this;return(typeof n=="undefined"?"undefined":_typeof(n))=="object"&&(i=n.delay,t=n.ease,n=n.duration),n=n==null?1e3:n,t=t||"<>",r.to=function(n){var i,c,h;if(n=n<0?0:n>1?1:n,f==null){f=[];for(s in r.attrs)f.push(s);u.morphArray&&(h=new u.morphArray(r._plot||u.points.toString()),r._size&&h.size(r._size.width.to,r._size.height.to),c=h.bbox(),r._x?h.move(r._x.to,c.y):r._cx&&h.move(r._cx.to-c.width/2,c.y),c=h.bbox(),r._y?h.move(c.x,r._y.to):r._cy&&h.move(c.x,r._cy.to-c.height/2),delete r._x,delete r._y,delete r._cx,delete r._cy,delete r._size,r._plot=u.points.morph(h))}if(e==null){e=[];for(s in r.trans)e.push(s)}if(o==null){o=[];for(s in r.styles)o.push(s)}for(n=t=="<>"?-Math.cos(n*Math.PI)/2+.5:t==">"?Math.sin(n*Math.PI/2):t=="<"?-Math.cos(n*Math.PI/2)+1:t=="-"?n:typeof t=="function"?t(n):n,r._x?u.x(r._at(r._x,n)):r._cx&&u.cx(r._at(r._cx,n)),r._y?u.y(r._at(r._y,n)):r._cy&&u.cy(r._at(r._cy,n)),r._size&&u.size(r._at(r._size.width,n),r._at(r._size.height,n)),r._plot&&u.plot(r._plot.at(n)),r._viewbox&&u.viewbox(r._at(r._viewbox.x,n),r._at(r._viewbox.y,n),r._at(r._viewbox.width,n),r._at(r._viewbox.height,n)),i=f.length-1;i>=0;i--)u.attr(f[i],r._at(r.attrs[f[i]],n));for(i=e.length-1;i>=0;i--)u.transform(e[i],r._at(r.trans[e[i]],n));for(i=o.length-1;i>=0;i--)u.style(o[i],r._at(r.styles[o[i]],n));r._during&&r._during.call(u,n,function(t,i){return r._at({from:t,to:i},n)})},typeof n=="number"&&(this.timeout=setTimeout(function(){var t=1e3/60,i=(new Date).getTime(),f=i+n;r.interval=setInterval(function(){var t=(new Date).getTime(),e=t>f?1:(t-i)/n;r.to(e);t>f&&(r._plot&&u.plot(new SVG.PointArray(r._plot.destination).settle()),clearInterval(r.interval),r._after?r._after.apply(u,[r]):r.stop())},n>t?t:n)},i||0)),this},bbox:function(){return this.target.bbox()},attr:function(n,t){if((typeof n=="undefined"?"undefined":_typeof(n))=="object")for(var i in n)this.attr(i,n[i]);else this.attrs[n]={from:this.target.attr(n),to:t};return this},transform:function(n,t){if(arguments.length==1){n=this.target._parseMatrix(n);delete n.matrix;for(t in n)this.trans[t]={from:this.target.trans[t],to:n[t]}}else{var i={};i[n]=t;this.transform(i)}return this},style:function(n,t){if((typeof n=="undefined"?"undefined":_typeof(n))=="object")for(var i in n)this.style(i,n[i]);else this.styles[n]={from:this.target.style(n),to:t};return this},x:function(n){return this._x={from:this.target.x(),to:n},this},y:function(n){return this._y={from:this.target.y(),to:n},this},cx:function(n){return this._cx={from:this.target.cx(),to:n},this},cy:function(n){return this._cy={from:this.target.cy(),to:n},this},move:function(n,t){return this.x(n).y(t)},center:function(n,t){return this.cx(n).cy(t)},size:function(n,t){if(this.target instanceof SVG.Text)this.attr("font-size",n);else{var i=this.target.bbox();this._size={width:{from:i.width,to:n},height:{from:i.height,to:t}}}return this},plot:function(n){return this._plot=n,this},viewbox:function(n,t,i,r){if(this.target instanceof SVG.Container){var u=this.target.viewbox();this._viewbox={x:{from:u.x,to:n},y:{from:u.y,to:t},width:{from:u.width,to:i},height:{from:u.height,to:r}}}return this},update:function(n){return this.target instanceof SVG.Stop&&(n.opacity!=null&&this.attr("stop-opacity",n.opacity),n.color!=null&&this.attr("stop-color",n.color),n.offset!=null&&this.attr("offset",new SVG.Number(n.offset))),this},during:function(n){return this._during=n,this},after:function(n){return this._after=n,this},stop:function(){return clearTimeout(this.timeout),clearInterval(this.interval),this.attrs={},this.trans={},this.styles={},delete this._x,delete this._y,delete this._cx,delete this._cy,delete this._size,delete this._plot,delete this._after,delete this._during,delete this._viewbox,this},_at:function(n,t){return typeof n.from=="number"?n.from+(n.to-n.from)*t:SVG.regex.unit.test(n.to)?new SVG.Number(n.to).minus(new SVG.Number(n.from)).times(t).plus(new SVG.Number(n.from)):n.to&&(n.to.r||SVG.Color.test(n.to))?this._color(n,t):t<1?n.from:n.to},_color:function(n,t){var i,r;return t=t<0?0:t>1?1:t,i=new SVG.Color(n.from),r=new SVG.Color(n.to),new SVG.Color({r:~~(i.r+(r.r-i.r)*t),g:~~(i.g+(r.g-i.g)*t),b:~~(i.b+(r.b-i.b)*t)}).toHex()}});SVG.extend(SVG.Element,{animate:function(n,t,i){return(this.fx||(this.fx=new SVG.FX(this))).stop().animate(n,t,i)},stop:function(){return this.fx&&this.fx.stop(),this}});["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave"].forEach(function(n){SVG.Element.prototype[n]=function(t){var i=this;return this.node["on"+n]=typeof t=="function"?function(){return t.apply(i,arguments)}:null,this}});SVG.on=function(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent("on"+t,i)};SVG.off=function(n,t,i){n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent("on"+t,i)};SVG.extend(SVG.Element,{on:function(n,t){SVG.on(this.node,n,t);return this},off:function(n,t){return SVG.off(this.node,n,t),this}});SVG.Defs=function(){this.constructor.call(this,SVG.create("defs"))};SVG.Defs.prototype=new SVG.Container;SVG.G=function(){this.constructor.call(this,SVG.create("g"))};SVG.G.prototype=new SVG.Container;SVG.extend(SVG.G,{x:function(n){return n==null?this.trans.x:this.transform("x",n)},y:function(n){return n==null?this.trans.y:this.transform("y",n)}});SVG.extend(SVG.Container,{group:function(){return this.put(new SVG.G)}});SVG.extend(SVG.Element,{siblings:function(){return this.parent.children()},position:function(){var n=this.siblings();return n.indexOf(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var n=this.position();return this.parent.removeElement(this).put(this,n+1)},backward:function(){var n=this.position();return n>0&&this.parent.removeElement(this).add(this,n-1),this},front:function(){return this.parent.removeElement(this).put(this)},back:function(){return this.position()>0&&this.parent.removeElement(this).add(this,0),this},before:function(n){n.remove();var t=this.position();return this.parent.add(n,t),this},after:function(n){n.remove();var t=this.position();return this.parent.add(n,t+1),this}});SVG.Mask=function(){this.constructor.call(this,SVG.create("mask"));this.targets=[]};SVG.Mask.prototype=new SVG.Container;SVG.extend(SVG.Mask,{remove:function(){for(var n=this.targets.length-1;n>=0;n--)this.targets[n]&&this.targets[n].unmask();return delete this.targets,this.parent.removeElement(this),this}});SVG.extend(SVG.Element,{maskWith:function(n){return this.masker=n instanceof SVG.Mask?n:this.parent.mask().add(n),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}});SVG.extend(SVG.Container,{mask:function(){return this.defs().put(new SVG.Mask)}});SVG.Clip=function(){this.constructor.call(this,SVG.create("clipPath"));this.targets=[]};SVG.Clip.prototype=new SVG.Container;SVG.extend(SVG.Clip,{remove:function(){for(var n=this.targets.length-1;n>=0;n--)this.targets[n]&&this.targets[n].unclip();return delete this.targets,this.parent.removeElement(this),this}});SVG.extend(SVG.Element,{clipWith:function(n){return this.clipper=n instanceof SVG.Clip?n:this.parent.clip().add(n),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}});SVG.extend(SVG.Container,{clip:function(){return this.defs().put(new SVG.Clip)}});SVG.Gradient=function(n){this.constructor.call(this,SVG.create(n+"Gradient"));this.type=n};SVG.Gradient.prototype=new SVG.Container;SVG.extend(SVG.Gradient,{from:function(n,t){return this.type=="radial"?this.attr({fx:new SVG.Number(n),fy:new SVG.Number(t)}):this.attr({x1:new SVG.Number(n),y1:new SVG.Number(t)})},to:function(n,t){return this.type=="radial"?this.attr({cx:new SVG.Number(n),cy:new SVG.Number(t)}):this.attr({x2:new SVG.Number(n),y2:new SVG.Number(t)})},radius:function(n){return this.type=="radial"?this.attr({r:new SVG.Number(n)}):this},at:function(n){return this.put(new SVG.Stop(n))},update:function(n){return this.clear(),n(this),this},fill:function(){return"url(#"+this.attr("id")+")"},toString:function(){return this.fill()}});SVG.extend(SVG.Defs,{gradient:function(n,t){var i=this.put(new SVG.Gradient(n));return t(i),i}});SVG.extend(SVG.Container,{gradient:function(n,t){return this.defs().gradient(n,t)}});SVG.Stop=function(n){this.constructor.call(this,SVG.create("stop"));this.update(n)};SVG.Stop.prototype=new SVG.Element;SVG.extend(SVG.Stop,{update:function(n){return n.opacity!=null&&this.attr("stop-opacity",n.opacity),n.color!=null&&this.attr("stop-color",n.color),n.offset!=null&&this.attr("offset",new SVG.Number(n.offset)),this}});SVG.Doc=function(n){this.parent=typeof n=="string"?document.getElementById(n):n;this.constructor.call(this,this.parent.nodeName=="svg"?this.parent:SVG.create("svg"));this.attr({xmlns:SVG.ns,version:"1.1",width:"100%",height:"100%"}).attr("xlink",SVG.xlink,SVG.ns);this._defs=new SVG.Defs;this.node.appendChild(this._defs.node);this.parent.nodeName!="svg"&&this.stage()};SVG.Doc.prototype=new SVG.Container;SVG.extend(SVG.Doc,{stage:function(){var t,n=this,i=document.createElement("div");return i.style.cssText="position:relative;height:100%;",n.parent.appendChild(i),i.appendChild(n.node),t=function(){document.readyState==="complete"?(n.style("position:absolute;"),setTimeout(function(){n.style("position:relative;overflow:hidden;");n.parent.removeChild(n.node.parentNode);n.node.parentNode.removeChild(n.node);n.parent.appendChild(n.node);n.fixSubPixelOffset();SVG.on(window,"resize",function(){n.fixSubPixelOffset()})},5)):setTimeout(t,10)},t(),this},defs:function(){return this._defs},fixSubPixelOffset:function(){var n=this.node.getScreenCTM();this.style("left",-n.e%1+"px").style("top",-n.f%1+"px")}});SVG.Shape=function(n){this.constructor.call(this,n)};SVG.Shape.prototype=new SVG.Element;SVG.Use=function(){this.constructor.call(this,SVG.create("use"))};SVG.Use.prototype=new SVG.Shape;SVG.extend(SVG.Use,{element:function(n){return this.target=n,this.attr("href","#"+n,SVG.xlink)}});SVG.extend(SVG.Container,{use:function(n){return this.put(new SVG.Use).element(n)}});SVG.Rect=function(){this.constructor.call(this,SVG.create("rect"))};SVG.Rect.prototype=new SVG.Shape;SVG.extend(SVG.Container,{rect:function(n,t){return this.put((new SVG.Rect).size(n,t))}});SVG.Ellipse=function(){this.constructor.call(this,SVG.create("ellipse"))};SVG.Ellipse.prototype=new SVG.Shape;SVG.extend(SVG.Ellipse,{x:function(n){return n==null?this.cx()-this.attr("rx"):this.cx(n+this.attr("rx"))},y:function(n){return n==null?this.cy()-this.attr("ry"):this.cy(n+this.attr("ry"))},cx:function(n){return n==null?this.attr("cx"):this.attr("cx",new SVG.Number(n).divide(this.trans.scaleX))},cy:function(n){return n==null?this.attr("cy"):this.attr("cy",new SVG.Number(n).divide(this.trans.scaleY))},size:function(n,t){return this.attr({rx:new SVG.Number(n).divide(2),ry:new SVG.Number(t).divide(2)})}});SVG.extend(SVG.Container,{circle:function(n){return this.ellipse(n,n)},ellipse:function(n,t){return this.put(new SVG.Ellipse).size(n,t).move(0,0)}});SVG.Line=function(){this.constructor.call(this,SVG.create("line"))};SVG.Line.prototype=new SVG.Shape;SVG.extend(SVG.Line,{x:function(n){var t=this.bbox();return n==null?t.x:this.attr({x1:this.attr("x1")-t.x+n,x2:this.attr("x2")-t.x+n})},y:function(n){var t=this.bbox();return n==null?t.y:this.attr({y1:this.attr("y1")-t.y+n,y2:this.attr("y2")-t.y+n})},cx:function(n){var t=this.bbox().width/2;return n==null?this.x()+t:this.x(n-t)},cy:function(n){var t=this.bbox().height/2;return n==null?this.y()+t:this.y(n-t)},size:function(n,t){var i=this.bbox();return this.attr(this.attr("x1")<this.attr("x2")?"x2":"x1",i.x+n).attr(this.attr("y1")<this.attr("y2")?"y2":"y1",i.y+t)},plot:function(n,t,i,r){return this.attr({x1:n,y1:t,x2:i,y2:r})}});SVG.extend(SVG.Container,{line:function(n,t,i,r){return this.put((new SVG.Line).plot(n,t,i,r))}});SVG.Polyline=function(){this.constructor.call(this,SVG.create("polyline"))};SVG.Polyline.prototype=new SVG.Shape;SVG.Polygon=function(){this.constructor.call(this,SVG.create("polygon"))};SVG.Polygon.prototype=new SVG.Shape;SVG.extend(SVG.Polyline,SVG.Polygon,{morphArray:SVG.PointArray,plot:function(n){return this.attr("points",this.points=new SVG.PointArray(n,[[0,0]]))},move:function(n,t){return this.attr("points",this.points.move(n,t))},x:function(n){return n==null?this.bbox().x:this.move(n,this.bbox().y)},y:function(n){return n==null?this.bbox().y:this.move(this.bbox().x,n)},size:function(n,t){return this.attr("points",this.points.size(n,t))}});SVG.extend(SVG.Container,{polyline:function(n){return this.put(new SVG.Polyline).plot(n)},polygon:function(n){return this.put(new SVG.Polygon).plot(n)}});SVG.Path=function(n){this.constructor.call(this,SVG.create("path"));this.unbiased=!!n};SVG.Path.prototype=new SVG.Shape;SVG.extend(SVG.Path,{_plot:function(n){return this.attr("d",n||"M0,0")}});SVG.extend(SVG.Container,{path:function(n,t){return this.put(new SVG.Path(t)).plot(n)}});SVG.extend(SVG.Path,{x:function(n){return n==null?this.bbox().x:this.transform("x",n)},y:function(n){return n==null?this.bbox().y:this.transform("y",n)},size:function(n,t){var i=n/this._offset.width;return this.transform({scaleX:i,scaleY:t!=null?t/this._offset.height:i})},plot:function(n){var t=this.trans.scaleX,i=this.trans.scaleY;return this._plot(n),this._offset=this.transform({scaleX:1,scaleY:1}).bbox(),this.unbiased?this._offset.x=this._offset.y=0:(this._offset.x-=this.trans.x,this._offset.y-=this.trans.y),this.transform({scaleX:t,scaleY:i})}});SVG.Image=function(){this.constructor.call(this,SVG.create("image"))};SVG.Image.prototype=new SVG.Shape;SVG.extend(SVG.Image,{load:function(n){return n?this.attr("href",this.src=n,SVG.xlink):this}});SVG.extend(SVG.Container,{image:function(n,t,i){return t=t!=null?t:100,this.put((new SVG.Image).load(n).size(t,i!=null?i:t))}});n="size family weight stretch variant style".split(" ");SVG.Text=function(){this.constructor.call(this,SVG.create("text"));this.styles={"font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"};this._leading=new SVG.Number("1.2em");this._rebuild=!0};SVG.Text.prototype=new SVG.Shape;SVG.extend(SVG.Text,{x:function(n,t){return n==null?t?this.attr("x"):this.bbox().x:(t||(t=this.style("text-anchor"),n=t=="start"?n:t=="end"?n+this.bbox().width:n+this.bbox().width/2),this.textPath||this.lines.each(function(){this.newLined&&this.x(n)}),this.attr("x",n))},cx:function(n){return n==null?this.bbox().cx:this.x(n-this.bbox().width/2)},cy:function(n,t){return n==null?this.bbox().cy:this.y(t?n:n-this.bbox().height/2)},move:function(n,t,i){return this.x(n,i).y(t)},center:function(n,t,i){return this.cx(n,i).cy(t,i)},text:function(n){if(n==null)return this.content;if(this.clear(),typeof n=="function")this._rebuild=!1,n(this);else{this._rebuild=!0;n=SVG.regex.isBlank.test(n)?"text":n;for(var r=n.split("\n"),t=0,i=r.length;t<i;t++)this.tspan(r[t]).newLine();this.rebuild()}return this},tspan:function(n){var r=this.textPath?this.textPath.node:this.node,t=(new SVG.TSpan).text(n),i=this.style();return r.appendChild(t.node),this.lines.add(t),SVG.regex.isBlank.test(i)||t.style(i),this.content+=n,t.parent=this,t},size:function(n){return this.attr("font-size",n)},leading:function(n){return n==null?this._leading:(n=new SVG.Number(n),this._leading=n,this.lines.each(function(){this.newLined&&this.attr("dy",n)}),this)},rebuild:function(){var n=this;return this._rebuild&&this.lines.attr({x:this.attr("x"),dy:this._leading,style:this.style()}),this},clear:function(){for(var n=this.textPath?this.textPath.node:this.node;n.hasChildNodes();)n.removeChild(n.lastChild);return delete this.lines,this.lines=new SVG.Set,this.content="",this}});SVG.extend(SVG.Container,{text:function(n){return this.put(new SVG.Text).text(n)}});SVG.TSpan=function(){this.constructor.call(this,SVG.create("tspan"))};SVG.TSpan.prototype=new SVG.Shape;SVG.extend(SVG.TSpan,{text:function(n){return this.node.appendChild(document.createTextNode(n)),this},dx:function(n){return this.attr("dx",n)},dy:function(n){return this.attr("dy",n)},newLine:function(){return this.newLined=!0,this.parent.content+="\n",this.dy(this.parent._leading),this.attr("x",this.parent.x())}});SVG.TextPath=function(){this.constructor.call(this,SVG.create("textPath"))};SVG.TextPath.prototype=new SVG.Element;SVG.extend(SVG.Text,{path:function(n){for(this.textPath=new SVG.TextPath;this.node.hasChildNodes();)this.textPath.node.appendChild(this.node.firstChild);return this.node.appendChild(this.textPath.node),this.track=this.doc().defs().path(n,!0),this.textPath.parent=this,this.textPath.attr("href","#"+this.track,SVG.xlink),this},plot:function(n){return this.track&&this.track.plot(n),this}});SVG.Nested=function(){this.constructor.call(this,SVG.create("svg"));this.style("overflow","visible")};SVG.Nested.prototype=new SVG.Container;SVG.extend(SVG.Container,{nested:function(){return this.put(new SVG.Nested)}});SVG._stroke=["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"];SVG._fill=["color","opacity","rule"];t=function(n,t){return t=="color"?n:n+"-"+t};["fill","stroke"].forEach(function(n){var i={};i[n]=function(i){if(typeof i=="string"||SVG.Color.isRgb(i)||i&&typeof i.fill=="function")this.attr(n,i);else for(index=SVG["_"+n].length-1;index>=0;index--)i[SVG["_"+n][index]]!=null&&this.attr(t(n,SVG["_"+n][index]),i[SVG["_"+n][index]]);return this};SVG.extend(SVG.Element,SVG.FX,i)});SVG.extend(SVG.Element,SVG.FX,{rotate:function(n,t,i){return this.transform({rotation:n||0,cx:t,cy:i})},skew:function(n,t){return this.transform({skewX:n||0,skewY:t||0})},scale:function(n,t){return this.transform({scaleX:n,scaleY:t==null?n:t})},translate:function(n,t){return this.transform({x:n,y:t})},matrix:function(n){return this.transform({matrix:n})},opacity:function(n){return this.attr("opacity",n)}});SVG.Text&&SVG.extend(SVG.Text,SVG.FX,{font:function(t){for(var i in t)i=="anchor"?this.attr("text-anchor",t[i]):n.indexOf(i)>-1?this.attr("font-"+i,t[i]):this.attr(i,t[i]);return this}});SVG.Set=function(){this.clear()};SVG.SetFX=function(n){this.set=n};SVG.extend(SVG.Set,{add:function(){for(var i=[].slice.call(arguments),n=0,t=i.length;n<t;n++)this.members.push(i[n]);return this},remove:function(n){var t=this.members.indexOf(n);return t>-1&&this.members.splice(t,1),this},each:function(n){for(var t=0,i=this.members.length;t<i;t++)n.apply(this.members[t],[t,this.members]);return this},clear:function(){return this.members=[],this},valueOf:function(){return this.members}});SVG.Set.inherit=function(){var t=[],n;for(n in SVG.Shape.prototype)typeof SVG.Shape.prototype[n]=="function"&&typeof SVG.Set.prototype[n]!="function"&&t.push(n);t.forEach(function(n){SVG.Set.prototype[n]=function(){for(var t=0,i=this.members.length;t<i;t++)this.members[t]&&typeof this.members[t][n]=="function"&&this.members[t][n].apply(this.members[t],arguments);return n=="animate"?this.fx||(this.fx=new SVG.SetFX(this)):this}});t=[];for(n in SVG.FX.prototype)typeof SVG.FX.prototype[n]=="function"&&typeof SVG.SetFX.prototype[n]!="function"&&t.push(n);t.forEach(function(n){SVG.SetFX.prototype[n]=function(){for(var t=0,i=this.set.members.length;t<i;t++)this.set.members[t].fx[n].apply(this.set.members[t].fx,arguments);return this}})};SVG.extend(SVG.Container,{set:function(){return new SVG.Set}});SVG.extend(SVG.Element,{_memory:{},remember:function(n,t){if(_typeof(arguments[0])=="object")for(var t in n)this.remember(t,n[t]);else{if(arguments.length==1)return this._memory[n];this._memory[n]=t}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var n=arguments.length-1;n>=0;n--)delete this._memory[arguments[n]];return this}});typeof define=="function"&&define.amd?define(function(){return SVG}):typeof exports!="undefined"&&(exports.SVG=SVG)}).call(this),function(n,t,i){function s(n,t,i){for(var e=[],f,r,o,s,h,u=0;u<n.length;u++)f=n[u],f?(r=tinycolor(f),o=r.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light",o+=tinycolor.equals(t,f)?" sp-thumb-active":"",s=a?"background-color:"+r.toHexString():"filter:"+r.toFilter(),e.push('<span title="'+r.toHexString()+'" data-color="'+r.toHexString()+'" class="'+o+'"><span class="sp-thumb-inner" style="'+s+';" /><\/span>')):(h="sp-clear-display",e.push('<span title="No Color Selected" data-color="" style="background-color:transparent;" class="'+h+'"><\/span>'));return"<div class='sp-cf "+i+"'>"+e.join("")+"<\/div>"}function w(){for(var n=0;n<r.length;n++)r[n]&&r[n].hide()}function b(n,i){var r=t.extend({},l,n);return r.callbacks={move:e(r.move,i),change:e(r.change,i),show:e(r.show,i),hide:e(r.hide,i),beforeShow:e(r.beforeShow,i)},r}function k(f,e){function br(){h.showPaletteOnly&&(h.showPalette=!0);c.toggleClass("sp-flat",st);c.toggleClass("sp-input-disabled",!h.showInput);c.toggleClass("sp-alpha-enabled",h.showAlpha);c.toggleClass("sp-clear-enabled",lt);c.toggleClass("sp-buttons-disabled",!h.showButtons);c.toggleClass("sp-palette-disabled",!h.showPalette);c.toggleClass("sp-palette-only",h.showPaletteOnly);c.toggleClass("sp-initial-disabled",!h.showInitial);c.addClass(h.className);kt()}function hu(){function e(n){return n.data&&n.data.ignore?(at(t(this).data("color")),bt()):(at(t(this).data("color")),si(!0),bt(),ot()),!1}var i,r,f;if(u&&c.find("*:not(input)").attr("unselectable","on"),br(),tr&&l.after(pt).hide(),lt||pr.hide(),st?l.after(c).hide():(i=h.appendTo==="parent"?l.parent():t(h.appendTo),i.length!==1&&(i=t("body")),i.append(c)),vt&&n.localStorage){try{r=n.localStorage[vt].split(",#");r.length>1&&(delete n.localStorage[vt],t.each(r,function(n,t){rr(t)}))}catch(s){}try{it=n.localStorage[vt].split(";")}catch(s){}}ui.bind("click.spectrum touchstart.spectrum",function(n){gi||tu();n.stopPropagation();t(n.target).is("input")||n.preventDefault()});(l.is(":disabled")||h.disabled===!0)&&ru();c.click(g);ut.change(ur);ut.bind("paste",function(){setTimeout(ur,1)});ut.keydown(function(n){n.keyCode==13&&ur()});yr.text(h.cancelText);yr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();ot("cancel")});pr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();et=!0;bt();st&&si(!0)});wr.text(h.chooseText);wr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();au()&&(si(!0),ot())});o(lr,function(n,t,i){ct=n/ki;et=!1;i.shiftKey&&(ct=Math.round(ct*10)/10);bt()});o(nr,function(n,t){ni=parseFloat(t/ci);et=!1;bt()},gr,nu);o(vi,function(n,t,i){var r,u;if(i.shiftKey){if(!rt){var f=ti*yt,e=tt-ii*tt,o=Math.abs(n-f)>Math.abs(t-e);rt=o?"x":"y"}}else rt=null;r=!rt||rt==="x";u=!rt||rt==="y";r&&(ti=parseFloat(n/yt));u&&(ii=parseFloat((tt-t)/tt));et=!1;bt()},gr,nu);fi?(at(fi),oi(),ei=ir||tinycolor(fi).format,rr(fi)):oi();st&&fr();f=u?"mousedown.spectrum":"click.spectrum touchstart.spectrum";ar.delegate(".sp-thumb-el",f,e);vr.delegate(".sp-thumb-el:nth-child(1)",f,{ignore:!0},e)}function rr(i){if(uu){var r=tinycolor(i).toRgbString();if(t.inArray(r,it)===-1)for(it.push(r);it.length>eu;)it.shift();if(vt&&n.localStorage)try{n.localStorage[vt]=it.join(";")}catch(u){}}}function cu(){var f=[],r=it,u={},t,n,i;if(h.showPalette){for(n=0;n<li.length;n++)for(i=0;i<li[n].length;i++)t=tinycolor(li[n][i]).toRgbString(),u[t]=!0;for(n=0;n<r.length;n++)t=tinycolor(r[n]).toRgbString(),u.hasOwnProperty(t)||(f.push(r[n]),u[t]=!0)}return f.reverse().slice(0,h.maxSelectionSize)}function kr(){var n=k(),i=t.map(li,function(t,i){return s(t,n,"sp-palette-row sp-palette-row-"+i)});it&&i.push(s(cu(),n,"sp-palette-row sp-palette-row-selection"));ar.html(i.join(""))}function dr(){if(h.showInitial){var t=ft,n=k();vr.html(s([t,n],n,"sp-palette-row-initial"))}}function gr(){(tt<=0||yt<=0||ci<=0)&&kt();c.addClass(cr);rt=null}function nu(){c.removeClass(cr)}function ur(){var n=ut.val(),t;(n===null||n==="")&&lt?at(null):(t=tinycolor(n),t.ok?at(t):ut.addClass("sp-validation-error"))}function tu(){gt?ot():fr()}function fr(){var i=t.Event("beforeShow.spectrum");if(gt){kt();return}(l.trigger(i,[k()]),dt.beforeShow(k())===!1||i.isDefaultPrevented())||(w(),gt=!0,t(ai).bind("click.spectrum",ot),t(n).bind("resize.spectrum",or),pt.addClass("sp-active"),c.removeClass("sp-hidden"),h.showPalette&&kr(),kt(),oi(),ft=k(),dr(),dt.show(ft),l.trigger("show.spectrum",[ft]))}function ot(i){if((!i||i.type!="click"||i.button!=2)&&gt&&!st){gt=!1;t(ai).unbind("click.spectrum",ot);t(n).unbind("resize.spectrum",or);pt.removeClass("sp-active");c.addClass("sp-hidden");var r=!tinycolor.equals(k(),ft);r&&(su&&i!=="cancel"?si(!0):lu());dt.hide(k());l.trigger("hide.spectrum",[k()])}}function lu(){at(ft,!0)}function at(n,t){var i,r;tinycolor.equals(n,k())||(!n&&lt?et=!0:(et=!1,i=tinycolor(n),r=i.toHsv(),ni=r.h%360/360,ti=r.s,ii=r.v,ct=r.a),oi(),i&&i.ok&&!t&&(ei=ir||i.format))}function k(n){return(n=n||{},lt&&et)?null:tinycolor.fromRatio({h:ni,s:ti,v:ii,a:Math.round(ct*100)/100},{format:n.format||ei})}function au(){return!ut.hasClass("sp-validation-error")}function bt(){oi();dt.move(k());l.trigger("move.spectrum",[k()])}function oi(){var s,n,t,r,f,c,e,o,i;ut.removeClass("sp-validation-error");iu();s=tinycolor.fromRatio({h:ni,s:1,v:1});vi.css("background-color",s.toHexString());n=ei;ct<1&&(n==="hex"||n==="hex3"||n==="hex6"||n==="name")&&(n="rgb");t=k({format:n});r="";wt.removeClass("sp-clear-display");wt.css("background-color","transparent");!t&&lt?wt.addClass("sp-clear-display"):(f=t.toHexString(),c=t.toRgbString(),a||t.alpha===1?wt.css("background-color",c):(wt.css("background-color","transparent"),wt.css("filter",t.toFilter())),h.showAlpha&&(e=t.toRgb(),e.a=0,o=tinycolor(e).toRgbString(),i="linear-gradient(left, "+o+", "+f+")",u?ri.css("filter",tinycolor(o).toFilter({gradientType:1},f)):(ri.css("background","-webkit-"+i),ri.css("background","-moz-"+i),ri.css("background","-ms-"+i),ri.css("background",i))),r=t.toString(n));h.showInput&&ut.val(r);h.showPalette&&kr();dr()}function iu(){var u=ti,f=ii,n,t,i,r;lt&&et?(wi.hide(),pi.hide(),yi.hide()):(wi.show(),pi.show(),yi.show(),n=u*yt,t=tt-f*tt,n=Math.max(-ht,Math.min(yt-ht,n-ht)),t=Math.max(-ht,Math.min(tt-ht,t-ht)),yi.css({top:t,left:n}),i=ct*ki,wi.css({left:i-sr/2}),r=ni*ci,pi.css({top:r-hr}))}function si(n){var t=k(),i="",r=!tinycolor.equals(t,ft);t&&(i=t.toString(ei),rr(t));bi&&l.val(i);ft=t;n&&r&&(dt.change(t),l.trigger("change",[t]))}function kt(){yt=vi.width();tt=vi.height();ht=yi.height();fu=nr.width();ci=nr.height();hr=pi.height();ki=lr.width();sr=wi.width();st||(c.css("position","absolute"),c.offset(d(c,ui)));iu()}function vu(){l.show();ui.unbind("click.spectrum touchstart.spectrum");c.remove();pt.remove();r[hi.id]=null}function yu(n,r){if(n===i)return t.extend({},h);if(r===i)return h[n];h[n]=r;br()}function pu(){gi=!1;l.attr("disabled",!1);ui.removeClass("sp-disabled")}function ru(){ot();gi=!0;l.attr("disabled",!0);ui.addClass("sp-disabled")}var h=b(e,f),st=h.flat,uu=h.showSelectionPalette,vt=h.localStorageKey,er=h.theme,dt=h.callbacks,or=nt(kt,10),gt=!1,yt=0,tt=0,ht=0,ci=0,fu=0,ki=0,sr=0,hr=0,ni=0,ti=0,ii=0,ct=1,di=h.palette.slice(0),li=t.isArray(di[0])?di:[di],it=h.selectionPalette.slice(0),eu=h.maxSelectionSize,cr="sp-dragging",rt=null,ai=f.ownerDocument,wu=ai.body,l=t(f),gi=!1,c=t(p,ai).addClass(er),vi=c.find(".sp-color"),yi=c.find(".sp-dragger"),nr=c.find(".sp-hue"),pi=c.find(".sp-slider"),ri=c.find(".sp-alpha-inner"),lr=c.find(".sp-alpha"),wi=c.find(".sp-alpha-handle"),ut=c.find(".sp-input"),ar=c.find(".sp-palette"),vr=c.find(".sp-initial"),yr=c.find(".sp-cancel"),pr=c.find(".sp-clear"),wr=c.find(".sp-choose"),bi=l.is("input"),ou=bi&&v&&l.attr("type")==="color",tr=bi&&!st,pt=tr?t(y).addClass(er).addClass(h.className):t([]),ui=tr?pt:l,wt=pt.find(".sp-preview-inner"),fi=h.color||bi&&l.val(),ft=!1,ir=h.preferredFormat,ei=ir,su=!h.showButtons||h.clickoutFiresChange,et=!fi,lt=h.allowEmpty&&!ou,hi;return hu(),hi={show:fr,hide:ot,toggle:tu,reflow:kt,option:yu,enable:pu,disable:ru,set:function(n){at(n);si()},get:k,destroy:vu,container:c},hi.id=r.push(hi)-1,hi}function d(n,i){var s=0,u=n.outerWidth(),f=n.outerHeight(),h=i.outerHeight(),e=n[0].ownerDocument,c=e.documentElement,o=c.clientWidth+t(e).scrollLeft(),l=c.clientHeight+t(e).scrollTop(),r=i.offset();return r.top+=h,r.left-=Math.min(r.left,r.left+u>o&&o>u?Math.abs(r.left+u-o):0),r.top-=Math.min(r.top,r.top+f>l&&l>f?Math.abs(f+h-s):s),r}function f(){}function g(n){n.stopPropagation()}function e(n,t){var i=Array.prototype.slice,r=i.call(arguments,2);return function(){return n.apply(t,r.concat(i.call(arguments)))}}function o(i,r,f,e){function c(n){n.stopPropagation&&n.stopPropagation();n.preventDefault&&n.preventDefault();n.returnValue=!1}function p(n){if(s){if(u&&document.documentMode<9&&!n.button)return w();var t=n.originalEvent.touches,f=t?t[0].pageX:n.pageX,e=t?t[0].pageY:n.pageY,o=Math.max(0,Math.min(f-l.left,v)),h=Math.max(0,Math.min(e-l.top,a));y&&c(n);r.apply(i,[o,h,n])}}function b(n){var r=n.which?n.which==3:n.button==2,u=n.originalEvent.touches;r||s||f.apply(i,arguments)!==!1&&(s=!0,a=t(i).height(),v=t(i).width(),l=t(i).offset(),t(h).bind(o),t(h.body).addClass("sp-dragging"),y||p(n),c(n))}function w(){s&&(t(h).unbind(o),t(h.body).removeClass("sp-dragging"),e.apply(i,arguments));s=!1}r=r||function(){};f=f||function(){};e=e||function(){};var h=i.ownerDocument||document,s=!1,l={},a=0,v=0,y="ontouchstart"in n,o={};o.selectstart=c;o.dragstart=c;o["touchmove mousemove"]=p;o["touchend mouseup"]=w;t(i).bind("touchstart mousedown",b)}function nt(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;n.apply(u,f)};i&&clearTimeout(r);(i||!r)&&(r=setTimeout(e,t))}}function h(){n.console&&(h=Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.log,console,arguments)},h.apply(this,arguments))}var l={beforeShow:f,move:f,change:f,show:f,hide:f,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!1,showInitial:!1,showPalette:!1,showPaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",preferredFormat:!1,className:"",showAlpha:!1,theme:"sp-light",palette:["fff","000"],selectionPalette:[],disabled:!1},r=[],u=!!/msie/i.exec(n.navigator.userAgent),a=function(){function t(n,t){return!!~(""+n).indexOf(t)}var i=document.createElement("div"),n=i.style;return n.cssText="background-color:rgba(0,0,0,.5)",t(n.backgroundColor,"rgba")||t(n.backgroundColor,"hsla")}(),v=function(){var n=t("<input type='color' value='!' />")[0];return n.type==="color"&&n.value!=="!"}(),y="<div class='sp-replacer'><div class='sp-preview'><div class='sp-preview-inner'><\/div><\/div><div class='sp-dd'>&#9660;<\/div><\/div>",p=function(){var t="",n;if(u)for(n=1;n<=6;n++)t+="<div class='sp-"+n+"'><\/div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'><\/div>","<\/div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'><\/div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'><\/div>","<\/div>","<\/div>","<\/div>","<div class='sp-clear sp-clear-display' title='Clear Color Selection'>","<\/div>","<div class='sp-hue'>","<div class='sp-slider'><\/div>",t,"<\/div>","<\/div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'><\/div><\/div><\/div>","<\/div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","<\/div>","<div class='sp-initial sp-thumb sp-cf'><\/div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'><\/a>","<button class='sp-choose'><\/button>","<\/div>","<\/div>","<\/div>"].join("")}(),c="spectrum.id";t.fn.spectrum=function(n){if(typeof n=="string"){var i=this,u=Array.prototype.slice.call(arguments,1);return this.each(function(){var f=r[t(this).data(c)],e;if(f){if(e=f[n],!e)throw new Error("Spectrum: no such method: '"+n+"'");n=="get"?i=f.get():n=="container"?i=f.container:n=="option"?i=f.option.apply(f,u):n=="destroy"?(f.destroy(),t(this).removeData(c)):e.apply(f,u)}}),i}return this.spectrum("destroy").each(function(){var i=k(this,n);t(this).data(c,i.id)})};t.fn.spectrum.load=!0;t.fn.spectrum.loadOpts={};t.fn.spectrum.draggable=o;t.fn.spectrum.defaults=l;t.spectrum={};t.spectrum.localization={};t.spectrum.palettes={};t.fn.spectrum.processNativeColorInputs=function(){v||t("input[type=color]").spectrum({preferredFormat:"hex6"})},function(){function t(n,u){if(n=n?n:"",u=u||{},(typeof n=="undefined"?"undefined":_typeof(n))=="object"&&n.hasOwnProperty("_tc_id"))return n;var c=tt(n),f=c.r,e=c.g,o=c.b,s=c.a,a=i(100*s)/100,v=u.format||c.format;return f<1&&(f=i(f)),e<1&&(e=i(e)),o<1&&(o=i(o)),{ok:c.ok,format:v,_tc_id:nt++,alpha:s,getAlpha:function(){return s},setAlpha:function(n){s=k(n);a=i(100*s)/100},toHsv:function(){var n=w(f,e,o);return{h:n.h*360,s:n.s,v:n.v,a:s}},toHsvString:function(){var n=w(f,e,o),t=i(n.h*360),r=i(n.s*100),u=i(n.v*100);return s==1?"hsv("+t+", "+r+"%, "+u+"%)":"hsva("+t+", "+r+"%, "+u+"%, "+a+")"},toHsl:function(){var n=p(f,e,o);return{h:n.h*360,s:n.s,l:n.l,a:s}},toHslString:function(){var n=p(f,e,o),t=i(n.h*360),r=i(n.s*100),u=i(n.l*100);return s==1?"hsl("+t+", "+r+"%, "+u+"%)":"hsla("+t+", "+r+"%, "+u+"%, "+a+")"},toHex:function(n){return l(f,e,o,n)},toHexString:function(n){return"#"+l(f,e,o,n)},toRgb:function(){return{r:i(f),g:i(e),b:i(o),a:s}},toRgbString:function(){return s==1?"rgb("+i(f)+", "+i(e)+", "+i(o)+")":"rgba("+i(f)+", "+i(e)+", "+i(o)+", "+a+")"},toPercentageRgb:function(){return{r:i(r(f,255)*100)+"%",g:i(r(e,255)*100)+"%",b:i(r(o,255)*100)+"%",a:s}},toPercentageRgbString:function(){return s==1?"rgb("+i(r(f,255)*100)+"%, "+i(r(e,255)*100)+"%, "+i(r(o,255)*100)+"%)":"rgba("+i(r(f,255)*100)+"%, "+i(r(e,255)*100)+"%, "+i(r(o,255)*100)+"%, "+a+")"},toName:function(){return s===0?"transparent":b[l(f,e,o,!0)]||!1},toFilter:function(n){var r=l(f,e,o),c=r,a=Math.round(parseFloat(s)*255).toString(16),v=a,y=u&&u.gradientType?"GradientType = 1, ":"",i;return n&&(i=t(n),c=i.toHex(),v=Math.round(parseFloat(i.alpha)*255).toString(16)),"progid:DXImageTransform.Microsoft.gradient("+y+"startColorstr=#"+h(a)+r+",endColorstr=#"+h(v)+c+")"},toString:function(n){var i=!!n;n=n||this.format;var t=!1,r=!i&&s<1&&s>0,u=r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="name");return(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),u)?this.toRgbString():t||this.toHexString()}}}function tt(n){var t={r:0,g:0,b:0},i=1,r=!1,u=!1;return typeof n=="string"&&(n=st(n)),(typeof n=="undefined"?"undefined":_typeof(n))=="object"&&(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b")?(t=it(n.r,n.g,n.b),r=!0,u=String(n.r).substr(-1)==="%"?"prgb":"rgb"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("v")?(n.s=c(n.s),n.v=c(n.v),t=ut(n.h,n.s,n.v),r=!0,u="hsv"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("l")&&(n.s=c(n.s),n.l=c(n.l),t=rt(n.h,n.s,n.l),r=!0,u="hsl"),n.hasOwnProperty("a")&&(i=n.a)),i=k(i),{ok:r,format:n.format||u,r:f(255,e(t.r,0)),g:f(255,e(t.g,0)),b:f(255,e(t.b,0)),a:i}}function it(n,t,i){return{r:r(n,255)*255,g:r(t,255)*255,b:r(i,255)*255}}function p(n,t,i){var s;n=r(n,255);t=r(t,255);i=r(i,255);var u=e(n,t,i),h=f(n,t,i),o,c,l=(u+h)/2;if(u==h)o=c=0;else{s=u-h;c=l>.5?s/(2-u-h):s/(u+h);switch(u){case n:o=(t-i)/s+(t<i?6:0);break;case t:o=(i-n)/s+2;break;case i:o=(n-t)/s+4}o/=6}return{h:o,s:c,l:l}}function rt(n,t,i){function h(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}var e,o,s,u,f;return n=r(n,360),t=r(t,100),i=r(i,100),t===0?e=o=s=i:(u=i<.5?i*(1+t):i+t-i*t,f=2*i-u,e=h(f,u,n+1/3),o=h(f,u,n),s=h(f,u,n-1/3)),{r:e*255,g:o*255,b:s*255}}function w(n,t,i){n=r(n,255);t=r(t,255);i=r(i,255);var u=e(n,t,i),h=f(n,t,i),o,c,l=u,s=u-h;if(c=u===0?0:s/u,u==h)o=0;else{switch(u){case n:o=(t-i)/s+(t<i?6:0);break;case t:o=(i-n)/s+2;break;case i:o=(n-t)/s+4}o/=6}return{h:o,s:c,v:l}}function ut(n,t,i){n=r(n,360)*6;t=r(t,100);i=r(i,100);var h=o.floor(n),c=n-h,u=i*(1-t),f=i*(1-c*t),e=i*(1-(1-c)*t),s=h%6,l=[i,f,u,u,e,i][s],a=[e,i,i,f,u,u][s],v=[u,u,e,i,i,f][s];return{r:l*255,g:a*255,b:v*255}}function l(n,t,r,u){var f=[h(i(n).toString(16)),h(i(t).toString(16)),h(i(r).toString(16))];return u&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0):f.join("")}function ft(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[n[t]]=t);return i}function k(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function r(n,t){et(n)&&(n="100%");var i=ot(n);return(n=f(t,e(0,parseFloat(n))),i&&(n=parseInt(n*t,10)/100),o.abs(n-t)<1e-6)?1:n%t/parseFloat(t)}function v(n){return f(1,e(0,n))}function s(n){return parseInt(n,16)}function et(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function ot(n){return typeof n=="string"&&n.indexOf("%")!=-1}function h(n){return n.length==1?"0"+n:""+n}function c(n){return n<=1&&(n=n*100+"%"),n}function st(n){var i,t;if(n=n.replace(d,"").replace(g,"").toLowerCase(),i=!1,a[n])n=a[n],i=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(t=u.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=u.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=u.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=u.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=u.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=u.hex6.exec(n))?{r:s(t[1]),g:s(t[2]),b:s(t[3]),format:i?"name":"hex"}:(t=u.hex3.exec(n))?{r:s(t[1]+""+t[1]),g:s(t[2]+""+t[2]),b:s(t[3]+""+t[3]),format:i?"name":"hex"}:!1}var d=/^[\s,#]+/,g=/\s+$/,nt=0,o=Math,i=o.round,f=o.min,e=o.max,y=o.random,a,b,u;t.fromRatio=function(n,i){var u,r;if((typeof n=="undefined"?"undefined":_typeof(n))=="object"){u={};for(r in n)n.hasOwnProperty(r)&&(u[r]=r==="a"?n[r]:c(n[r]));n=u}return t(n,i)};t.equals=function(n,i){return!n||!i?!1:t(n).toRgbString()==t(i).toRgbString()};t.random=function(){return t.fromRatio({r:y(),g:y(),b:y()})};t.desaturate=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s-=i/100,r.s=v(r.s),t(r)};t.saturate=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s+=i/100,r.s=v(r.s),t(r)};t.greyscale=function(n){return t.desaturate(n,100)};t.lighten=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l+=i/100,r.l=v(r.l),t(r)};t.darken=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l-=i/100,r.l=v(r.l),t(r)};t.complement=function(n){var i=t(n).toHsl();return i.h=(i.h+180)%360,t(i)};t.triad=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+120)%360,s:i.s,l:i.l}),t({h:(r+240)%360,s:i.s,l:i.l})]};t.tetrad=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+90)%360,s:i.s,l:i.l}),t({h:(r+180)%360,s:i.s,l:i.l}),t({h:(r+270)%360,s:i.s,l:i.l})]};t.splitcomplement=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+72)%360,s:i.s,l:i.l}),t({h:(r+216)%360,s:i.s,l:i.l})]};t.analogous=function(n,i,r){i=i||6;r=r||30;var u=t(n).toHsl(),f=360/r,e=[t(n)];for(u.h=(u.h-(f*i>>1)+720)%360;--i;)u.h=(u.h+f)%360,e.push(t(u));return e};t.monochromatic=function(n,i){i=i||6;for(var r=t(n).toHsv(),e=r.h,o=r.s,u=r.v,f=[],s=1/i;i--;)f.push(t({h:e,s:o,v:u})),u=(u+s)%1;return f};t.readability=function(n,i){var r=t(n).toRgb(),u=t(i).toRgb(),f=(r.r*299+r.g*587+r.b*114)/1e3,e=(u.r*299+u.g*587+u.b*114)/1e3,o=Math.max(r.r,u.r)-Math.min(r.r,u.r)+Math.max(r.g,u.g)-Math.min(r.g,u.g)+Math.max(r.b,u.b)-Math.min(r.b,u.b);return{brightness:Math.abs(f-e),color:o}};t.readable=function(n,i){var r=t.readability(n,i);return r.brightness>125&&r.color>500};t.mostReadable=function(n,i){for(var h=null,o=0,u=!1,r=0;r<i.length;r++){var f=t.readability(n,i[r]),e=f.brightness>125&&f.color>500,s=3*(f.brightness/125)+f.color/500;(e&&!u||e&&u&&s>o||!e&&!u&&s>o)&&(u=e,o=s,h=t(i[r]))}return h};a=t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};b=t.hexNames=ft(a);u=function(){var n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+t),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();n.tinycolor=t}();t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})}(window,jQuery),function(n,t,i){"use strict";function e(t){if(r.webkit&&!t)return{height:0,width:0};if(!r.data.outer){var i={border:"none","box-sizing":"content-box",height:"200px",margin:"0",padding:"0",width:"200px"};r.data.inner=n("<div>").css(n.extend({},i));r.data.outer=n("<div>").css(n.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},i)).append(r.data.inner).appendTo("body")}return r.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(r.data.outer.offset().top-r.data.inner.offset().top||0),width:Math.ceil(r.data.outer.offset().left-r.data.inner.offset().left||0)}}function h(i,r){n(t).on({"blur.scrollbar":function(){n(t).add("body").off(".scrollbar");i&&i()},"dragstart.scrollbar":function(n){return n.preventDefault(),!1},"mouseup.scrollbar":function(){n(t).add("body").off(".scrollbar");i&&i()}});n("body").on({"selectstart.scrollbar":function(n){return n.preventDefault(),!1}});return r&&r.preventDefault(),!1}function p(){var n=e(!0);return!(n.height||n.width)}function o(n){var t=n.originalEvent;return t.axis&&t.axis===t.HORIZONTAL_AXIS?!1:t.wheelDeltaX?!1:!0}var s=!1,c=1,u="px",r={data:{},macosx:i.navigator.platform.toLowerCase().indexOf("mac")!==-1,mobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(i.navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/WebKit/.test(i.navigator.userAgent),log:s?function(t,r){var u=t;r&&typeof t!="string"&&(u=[],n.each(t,function(n,t){u.push('"'+n+'": '+t)}),u=u.join(", "));i.console&&i.console.log?i.console.log(u):alert(u)}:function(){}},l={autoScrollSize:!0,autoUpdate:!0,debug:!1,disableBodyScroll:!1,duration:200,ignoreMobile:!0,ignoreOverlay:!0,scrollStep:30,showArrows:!1,stepScrolling:!0,type:"simple",scrollx:null,scrolly:null,onDestroy:null,onInit:null,onScroll:null,onUpdate:null},a=function(t,u){r.scroll||(r.log("Init jQuery Scrollbar v0.2.5"),r.overlay=p(),r.scroll=e(),f(),n(i).resize(function(){var t=!1,n;r.scroll&&(r.scroll.height||r.scroll.width)&&(n=e(),(n.height!=r.scroll.height||n.width!=r.scroll.width)&&(r.scroll=n,t=!0));f(t)}));this.container=t;this.options=n.extend({},l,i.jQueryScrollbarOptions||{});this.scrollTo=null;this.scrollx={};this.scrolly={};this.init(u)};a.prototype={destroy:function(){if(this.wrapper){var i=this.container.scrollLeft(),r=this.container.scrollTop();this.container.insertBefore(this.wrapper).css({height:"",margin:""}).removeClass("scroll-content").removeClass("scroll-scrollx_visible").removeClass("scroll-scrolly_visible").off(".scrollbar").scrollLeft(i).scrollTop(r);this.scrollx.scrollbar.removeClass("scroll-scrollx_visible").find("div").andSelf().off(".scrollbar");this.scrolly.scrollbar.removeClass("scroll-scrolly_visible").find("div").andSelf().off(".scrollbar");this.wrapper.remove();n(t).add("body").off(".scrollbar");n.isFunction(this.options.onDestroy)&&this.options.onDestroy.apply(this,[this.container])}},getScrollbar:function(t){var i=this.options["scroll"+t],r={advanced:'<div class="scroll-element_corner"><\/div><div class="scroll-arrow scroll-arrow_less"><\/div><div class="scroll-arrow scroll-arrow_more"><\/div><div class="scroll-element_outer">    <div class="scroll-element_size"><\/div>    <div class="scroll-element_inner-wrapper">        <div class="scroll-element_inner scroll-element_track">            <div class="scroll-element_inner-bottom"><\/div>        <\/div>    <\/div>    <div class="scroll-bar">        <div class="scroll-bar_body">            <div class="scroll-bar_body-inner"><\/div>        <\/div>        <div class="scroll-bar_bottom"><\/div>        <div class="scroll-bar_center"><\/div>    <\/div><\/div>',simple:'<div class="scroll-element_outer">    <div class="scroll-element_size"><\/div>    <div class="scroll-element_track"><\/div>    <div class="scroll-bar"><\/div><\/div>'},u=r[this.options.type]?this.options.type:"advanced";return i=i?typeof i=="string"?n(i).appendTo(this.wrapper):n(i):n("<div>").addClass("scroll-element").html(r[u]).appendTo(this.wrapper),this.options.showArrows&&i.addClass("scroll-element_arrows_visible"),i.addClass("scroll-"+t)},init:function(i){var l=this,f=this.container,v=this.containerWrapper||f,s=n.extend(this.options,i||{}),e={x:this.scrollx,y:this.scrolly},a=this.wrapper,w={scrollLeft:f.scrollLeft(),scrollTop:f.scrollTop()},y,p;if(r.mobile&&s.ignoreMobile||r.overlay&&s.ignoreOverlay||r.macosx&&!r.webkit)return!1;if(a)v.css({height:"","margin-bottom":r.scroll.height*-1+u,"margin-right":r.scroll.width*-1+u});else{this.wrapper=a=n("<div>").addClass("scroll-wrapper").addClass(f.attr("class")).css("position",f.css("position")=="absolute"?"absolute":"relative").insertBefore(f).append(f);f.is("textarea")&&(this.containerWrapper=v=n("<div>").insertBefore(f).append(f),a.addClass("scroll-textarea"));v.addClass("scroll-content").css({height:"","margin-bottom":r.scroll.height*-1+u,"margin-right":r.scroll.width*-1+u});f.on("scroll.scrollbar",function(){n.isFunction(s.onScroll)&&s.onScroll.call(l,{maxScroll:e.y.maxScrollOffset,scroll:f.scrollTop(),size:e.y.size,visible:e.y.visible},{maxScroll:e.x.maxScrollOffset,scroll:f.scrollLeft(),size:e.x.size,visible:e.x.visible});e.x.isVisible&&e.x.scroller.css("left",f.scrollLeft()*e.x.kx+u);e.y.isVisible&&e.y.scroller.css("top",f.scrollTop()*e.y.kx+u)});a.on("scroll",function(){a.scrollTop(0).scrollLeft(0)});if(s.disableBodyScroll){y=function(n){o(n)?e.y.isVisible&&e.y.mousewheel(n):e.x.isVisible&&e.x.mousewheel(n)};a.on({"MozMousePixelScroll.scrollbar":y,"mousewheel.scrollbar":y});if(r.mobile)a.on("touchstart.scrollbar",function(i){var r=i.originalEvent.touches&&i.originalEvent.touches[0]||i,u={pageX:r.pageX,pageY:r.pageY},e={left:f.scrollLeft(),top:f.scrollTop()};n(t).on({"touchmove.scrollbar":function(n){var t=n.originalEvent.targetTouches&&n.originalEvent.targetTouches[0]||n;f.scrollLeft(e.left+u.pageX-t.pageX);f.scrollTop(e.top+u.pageY-t.pageY);n.preventDefault()},"touchend.scrollbar":function(){n(t).off(".scrollbar")}})})}n.isFunction(s.onInit)&&s.onInit.apply(this,[f])}n.each(e,function(i,r){var p=null,v=1,a=i=="x"?"scrollLeft":"scrollTop",y=s.scrollStep,w=function(){var n=f[a]();f[a](n+y);v==1&&n+y>=u&&(n=f[a]());v==-1&&n+y<=u&&(n=f[a]());f[a]()==n&&p&&p()},u=0;if(!r.scrollbar){r.scrollbar=l.getScrollbar(i);r.scroller=r.scrollbar.find(".scroll-bar");r.mousewheel=function(n){if(!r.isVisible||i=="x"&&o(n))return!0;if(i=="y"&&!o(n))return e.x.mousewheel(n),!0;var t=n.originalEvent.wheelDelta*-1||n.originalEvent.detail,s=r.size-r.visible-r.offset;return u<=0&&t<0||u>=s&&t>0||(u=u+t,u<0&&(u=0),u>s&&(u=s),l.scrollTo=l.scrollTo||{},l.scrollTo[a]=u,setTimeout(function(){l.scrollTo&&(f.stop().animate(l.scrollTo,240,"linear",function(){u=f[a]()}),l.scrollTo=null)},1)),n.preventDefault(),!1};r.scrollbar.on({"MozMousePixelScroll.scrollbar":r.mousewheel,"mousewheel.scrollbar":r.mousewheel,"mouseenter.scrollbar":function(){u=f[a]()}});r.scrollbar.find(".scroll-arrow, .scroll-element_track").on("mousedown.scrollbar",function(t){if(t.which!=c)return!0;v=1;var e={eventOffset:t[i=="x"?"pageX":"pageY"],maxScrollValue:r.size-r.visible-r.offset,scrollbarOffset:r.scroller.offset()[i=="x"?"left":"top"],scrollbarSize:r.scroller[i=="x"?"outerWidth":"outerHeight"]()},o=0,b=0;return n(this).hasClass("scroll-arrow")?(v=n(this).hasClass("scroll-arrow_more")?1:-1,y=s.scrollStep*v,u=v>0?e.maxScrollValue:0):(v=e.eventOffset>e.scrollbarOffset+e.scrollbarSize?1:e.eventOffset<e.scrollbarOffset?-1:0,y=Math.round(r.visible*.75)*v,u=e.eventOffset-e.scrollbarOffset-(s.stepScrolling?v==1?e.scrollbarSize:0:Math.round(e.scrollbarSize/2)),u=f[a]()+u/r.kx),l.scrollTo=l.scrollTo||{},l.scrollTo[a]=s.stepScrolling?f[a]()+y:u,s.stepScrolling&&(p=function(){u=f[a]();clearInterval(b);clearTimeout(o);o=0;b=0},o=setTimeout(function(){b=setInterval(w,40)},s.duration+100)),setTimeout(function(){l.scrollTo&&(f.animate(l.scrollTo,s.duration),l.scrollTo=null)},1),h(p,t)});r.scroller.on("mousedown.scrollbar",function(e){if(e.which!=c)return!0;var o=e[i=="x"?"pageX":"pageY"],s=f[a]();r.scrollbar.addClass("scroll-draggable");n(t).on("mousemove.scrollbar",function(n){var t=parseInt((n[i=="x"?"pageX":"pageY"]-o)/r.kx,10);f[a](s+t)});return h(function(){r.scrollbar.removeClass("scroll-draggable");u=f[a]()},e)})}});n.each(e,function(n,t){var i="scroll-scroll"+n+"_visible",r=n=="x"?e.y:e.x;t.scrollbar.removeClass(i);r.scrollbar.removeClass(i);v.removeClass(i)});n.each(e,function(t,i){n.extend(i,t=="x"?{offset:parseInt(f.css("left"),10)||0,size:f.prop("scrollWidth"),visible:a.width()}:{offset:parseInt(f.css("top"),10)||0,size:f.prop("scrollHeight"),visible:a.height()})});p=function p(t,i){var o="scroll-scroll"+t+"_visible",s=t=="x"?e.y:e.x,c=parseInt(f.css(t=="x"?"left":"top"),10)||0,l=i.size,h=i.visible+c;i.isVisible=l-h>1;i.isVisible?(i.scrollbar.addClass(o),s.scrollbar.addClass(o),v.addClass(o)):(i.scrollbar.removeClass(o),s.scrollbar.removeClass(o),v.removeClass(o));t=="y"&&(i.isVisible||i.size<i.visible)&&v.css("height",h+r.scroll.height+u);(e.x.size!=f.prop("scrollWidth")||e.y.size!=f.prop("scrollHeight")||e.x.visible!=a.width()||e.y.visible!=a.height()||e.x.offset!=(parseInt(f.css("left"),10)||0)||e.y.offset!=(parseInt(f.css("top"),10)||0))&&(n.each(e,function(t,i){n.extend(i,t=="x"?{offset:parseInt(f.css("left"),10)||0,size:f.prop("scrollWidth"),visible:a.width()}:{offset:parseInt(f.css("top"),10)||0,size:f.prop("scrollHeight"),visible:a.height()})}),p(t=="x"?"y":"x",s))};n.each(e,p);n.isFunction(s.onUpdate)&&s.onUpdate.apply(this,[f]);n.each(e,function(n,t){var o=n=="x"?"left":"top",h=n=="x"?"outerWidth":"outerHeight",c=n=="x"?"width":"height",l=parseInt(f.css(o),10)||0,r=t.size,e=t.visible+l,i=t.scrollbar.find(".scroll-element_size");i=i[h]()+(parseInt(i.css(o),10)||0);s.autoScrollSize&&(t.scrollbarSize=parseInt(i*e/r,10),t.scroller.css(c,t.scrollbarSize+u));t.scrollbarSize=t.scroller[h]();t.kx=(i-t.scrollbarSize)/(r-e)||1;t.maxScrollOffset=r-e});f.scrollLeft(w.scrollLeft).scrollTop(w.scrollTop).trigger("scroll")}};n.fn.scrollbar=function(t,i){var u=this;return t==="get"&&(u=null),this.each(function(){var e=n(this),f,o;if(e.hasClass("scroll-wrapper")||e.get(0).nodeName=="body")return!0;if(f=e.data("scrollbar"),f){if(t==="get")return u=f,!1;if(o=typeof t=="string"&&f[t]?t:"init",f[o].apply(f,n.isArray(i)?i:[]),t==="destroy")for(e.removeData("scrollbar");n.inArray(f,r.scrolls)>=0;)r.scrolls.splice(n.inArray(f,r.scrolls),1)}else typeof t!="string"&&(f=new a(e,t),e.data("scrollbar",f),r.scrolls.push(f));return!0}),u};n.fn.scrollbar.options=l;i.angular&&function(n){var t=n.module("jQueryScrollbar",[]);t.directive("jqueryScrollbar",function(){return{link:function(n,t){t.scrollbar(n.options).on("$destroy",function(){t.scrollbar("destroy")})},restring:"AC",scope:{options:"=jqueryScrollbar"}}})}(i.angular);var v=0,y=0,f=function(n){for(var u,c,t,i,o,h,e=0;e<r.scrolls.length;e++)t=r.scrolls[e],u=t.container,c=t.options,i=t.wrapper,o=t.scrollx,h=t.scrolly,(n||c.autoUpdate&&i&&i.is(":visible")&&(u.prop("scrollWidth")!=o.size||u.prop("scrollHeight")!=h.size||i.width()!=o.visible||i.height()!=h.visible))&&(t.init(),s&&(r.log({scrollHeight:u.prop("scrollHeight")+":"+t.scrolly.size,scrollWidth:u.prop("scrollWidth")+":"+t.scrollx.size,visibleHeight:i.height()+":"+t.scrolly.visible,visibleWidth:i.width()+":"+t.scrollx.visible},!0),y++));s&&y>10?(r.log("Scroll updates exceed 10"),f=function(){}):(clearTimeout(v),v=setTimeout(f,300))}}(jQuery,document,window);mul_table=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259];shg_table=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],function(){function n(){var n={};return n.FRAMERATE=30,n.MAX_VIRTUAL_PIXELS=3e4,n.init=function(t){var i=0;n.UniqueId=function(){return i++,"canvg"+i};n.Definitions={};n.Styles={};n.Animations=[];n.Images=[];n.ctx=t;n.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(n,t){this.viewPorts.push({width:n,height:t})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};this.ComputeSize=function(n){return n!=null&&typeof n=="number"?n:n=="x"?this.width():n=="y"?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}},n.init(),n.ImagesLoaded=function(){for(var t=0;t<n.Images.length;t++)if(!n.Images[t].loaded)return!1;return!0},n.trim=function(n){return n.replace(/^\s+|\s+$/g,"")},n.compressSpaces=function(n){return n.replace(/[\s\r\t\n]+/gm," ")},n.ajax=function(n){var t;return(t=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),t)?(t.open("GET",n,!1),t.send(null),t.responseText):null},n.parseXml=function(n){var i,t;return window.DOMParser?(i=new DOMParser,n=n.replace(/xmlns=\"http:\/\/www\.w3\.org\/2000\/svg\"/,""),i.parseFromString(n,"text/xml")):(n=n.replace(/<!DOCTYPE svg[^>]*>/,""),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(n),t)},n.Property=function(n,t){this.name=n;this.value=t},n.Property.prototype.getValue=function(){return this.value},n.Property.prototype.hasValue=function(){return this.value!=null&&this.value!==""},n.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var n=parseFloat(this.value);return(this.value+"").match(/%$/)&&(n=n/100),n},n.Property.prototype.valueOrDefault=function(n){return this.hasValue()?this.value:n},n.Property.prototype.numValueOrDefault=function(n){return this.hasValue()?this.numValue():n},n.Property.prototype.addOpacity=function(t){var r=this.value,i;return t!=null&&t!=""&&typeof this.value=="string"&&(i=new RGBColor(this.value),i.ok&&(r="rgba("+i.r+", "+i.g+", "+i.b+", "+t+")")),new n.Property(this.name,r)},n.Property.prototype.getDefinition=function(){var t=this.value.match(/#([^\)'"]+)/);return t&&(t=t[1]),t||(t=this.value),n.Definitions[t]},n.Property.prototype.isUrlDefinition=function(){return this.value.indexOf("url(")==0},n.Property.prototype.getFillStyleDefinition=function(t,i){var r=this.getDefinition(),u;return r!=null&&r.createGradient?r.createGradient(n.ctx,t,i):r!=null&&r.createPattern?(r.getHrefAttribute().hasValue()&&(u=r.attribute("patternTransform"),r=r.getHrefAttribute().getDefinition(),u.hasValue()&&(r.attribute("patternTransform",!0).value=u.value)),r.createPattern(n.ctx,t)):null},n.Property.prototype.getDPI=function(){return 96},n.Property.prototype.getEM=function(t){var i=12,r=new n.Property("fontSize",n.Font.Parse(n.ctx.font).fontSize);return r.hasValue()&&(i=r.toPixels(t)),i},n.Property.prototype.getUnits=function(){var n=this.value+"";return n.replace(/[0-9\.\-]/g,"")},n.Property.prototype.toPixels=function(t,i){var r,u;return this.hasValue()?(r=this.value+"",r.match(/em$/))?this.numValue()*this.getEM(t):r.match(/ex$/)?this.numValue()*this.getEM(t)/2:r.match(/px$/)?this.numValue():r.match(/pt$/)?this.numValue()*this.getDPI(t)*(1/72):r.match(/pc$/)?this.numValue()*15:r.match(/cm$/)?this.numValue()*this.getDPI(t)/2.54:r.match(/mm$/)?this.numValue()*this.getDPI(t)/25.4:r.match(/in$/)?this.numValue()*this.getDPI(t):r.match(/%$/)?this.numValue()*n.ViewPort.ComputeSize(t):(u=this.numValue(),i&&u<1)?u*n.ViewPort.ComputeSize(t):u:0},n.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var n=this.value+"";return n.match(/s$/)?this.numValue()*1e3:(n.match(/ms$/),this.numValue())},n.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var n=this.value+"";return n.match(/deg$/)?this.numValue()*(Math.PI/180):n.match(/grad$/)?this.numValue()*(Math.PI/200):n.match(/rad$/)?this.numValue():this.numValue()*(Math.PI/180)},n.Font=new function(){this.Styles="normal|italic|oblique|inherit";this.Variants="normal|small-caps|inherit";this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";this.CreateFont=function(t,i,r,u,f,e){var o=e!=null?this.Parse(e):this.CreateFont("","","","","",n.ctx.font);return{fontFamily:f||o.fontFamily,fontSize:u||o.fontSize,fontStyle:t||o.fontStyle,fontWeight:r||o.fontWeight,fontVariant:i||o.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var t=this;this.Parse=function(i){for(var e={},u=n.trim(n.compressSpaces(i||"")).split(" "),f={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},o="",r=0;r<u.length;r++)f.fontStyle||t.Styles.indexOf(u[r])==-1?f.fontVariant||t.Variants.indexOf(u[r])==-1?f.fontWeight||t.Weights.indexOf(u[r])==-1?f.fontSize?u[r]!="inherit"&&(o+=u[r]):(u[r]!="inherit"&&(e.fontSize=u[r].split("/")[0]),f.fontStyle=f.fontVariant=f.fontWeight=f.fontSize=!0):(u[r]!="inherit"&&(e.fontWeight=u[r]),f.fontStyle=f.fontVariant=f.fontWeight=!0):(u[r]!="inherit"&&(e.fontVariant=u[r]),f.fontStyle=f.fontVariant=!0):(u[r]!="inherit"&&(e.fontStyle=u[r]),f.fontStyle=!0);return o!=""&&(e.fontFamily=o),e}},n.ToNumberArray=function(t){for(var r=n.trim(n.compressSpaces((t||"").replace(/,/g," "))).split(" "),i=0;i<r.length;i++)r[i]=parseFloat(r[i]);return r},n.Point=function(n,t){this.x=n;this.y=t},n.Point.prototype.angleTo=function(n){return Math.atan2(n.y-this.y,n.x-this.x)},n.Point.prototype.applyTransform=function(n){var t=this.x*n[0]+this.y*n[2]+n[4],i=this.x*n[1]+this.y*n[3]+n[5];this.x=t;this.y=i},n.CreatePoint=function(t){var i=n.ToNumberArray(t);return new n.Point(i[0],i[1])},n.CreatePath=function(t){for(var r=n.ToNumberArray(t),u=[],i=0;i<r.length;i+=2)u.push(new n.Point(r[i],r[i+1]));return u},n.BoundingBox=function(n,t,r,u){this.x1=Number.NaN;this.y1=Number.NaN;this.x2=Number.NaN;this.y2=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-this.y1};this.addPoint=function(n,t){n!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=n,this.x2=n),n<this.x1&&(this.x1=n),n>this.x2&&(this.x2=n));t!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))};this.addX=function(n){this.addPoint(n,null)};this.addY=function(n){this.addPoint(null,n)};this.addBoundingBox=function(n){this.addPoint(n.x1,n.y1);this.addPoint(n.x2,n.y2)};this.addQuadraticCurve=function(n,t,i,r,u,f){var e=n+2/3*(i-n),o=t+2/3*(r-t),s=e+1/3*(u-n),h=o+1/3*(f-t);this.addBezierCurve(n,t,e,s,o,h,u,f)};this.addBezierCurve=function(n,t,r,u,f,e,o,s){var h=[n,t],p=[r,u],d=[f,e],w=[o,s],a,k,v,y;for(this.addPoint(h[0],h[1]),this.addPoint(w[0],w[1]),i=0;i<=1;i++){var c=function(n){return Math.pow(1-n,3)*h[i]+3*Math.pow(1-n,2)*n*p[i]+3*(1-n)*Math.pow(n,2)*d[i]+Math.pow(n,3)*w[i]},l=6*h[i]-12*p[i]+6*d[i],b=-3*h[i]+9*p[i]-9*d[i]+3*w[i],g=3*p[i]-3*h[i];if(b==0){if(l==0)continue;a=-g/l;0<a&&a<1&&(i==0&&this.addX(c(a)),i==1&&this.addY(c(a)));continue}(k=Math.pow(l,2)-4*g*b,k<0)||(v=(-l+Math.sqrt(k))/(2*b),0<v&&v<1&&(i==0&&this.addX(c(v)),i==1&&this.addY(c(v))),y=(-l-Math.sqrt(k))/(2*b),0<y&&y<1&&(i==0&&this.addX(c(y)),i==1&&this.addY(c(y))))}};this.isPointInBox=function(n,t){return this.x1<=n&&n<=this.x2&&this.y1<=t&&t<=this.y2};this.addPoint(n,t);this.addPoint(r,u)},n.Transform=function(t){var u=this,r,i;for(this.Type={},this.Type.translate=function(t){this.p=n.CreatePoint(t);this.apply=function(n){n.translate(this.p.x||0,this.p.y||0)};this.unapply=function(n){n.translate(-1*this.p.x||0,-1*this.p.y||0)};this.applyToPoint=function(n){n.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},this.Type.rotate=function(t){var i=n.ToNumberArray(t);this.angle=new n.Property("angle",i[0]);this.cx=i[1]||0;this.cy=i[2]||0;this.apply=function(n){n.translate(this.cx,this.cy);n.rotate(this.angle.toRadians());n.translate(-this.cx,-this.cy)};this.unapply=function(n){n.translate(this.cx,this.cy);n.rotate(-1*this.angle.toRadians());n.translate(-this.cx,-this.cy)};this.applyToPoint=function(n){var t=this.angle.toRadians();n.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);n.applyTransform([Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0]);n.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},this.Type.scale=function(t){this.p=n.CreatePoint(t);this.apply=function(n){n.scale(this.p.x||1,this.p.y||this.p.x||1)};this.unapply=function(n){n.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)};this.applyToPoint=function(n){n.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},this.Type.matrix=function(t){this.m=n.ToNumberArray(t);this.apply=function(n){n.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(n){n.applyTransform(this.m)}},this.Type.SkewBase=function(t){this.base=u.Type.matrix;this.base(t);this.angle=new n.Property("angle",t)},this.Type.SkewBase.prototype=new this.Type.matrix,this.Type.skewX=function(n){this.base=u.Type.SkewBase;this.base(n);this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]},this.Type.skewX.prototype=new this.Type.SkewBase,this.Type.skewY=function(n){this.base=u.Type.SkewBase;this.base(n);this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]},this.Type.skewY.prototype=new this.Type.SkewBase,this.transforms=[],this.apply=function(n){for(var t=0;t<this.transforms.length;t++)this.transforms[t].apply(n)},this.unapply=function(n){for(var t=this.transforms.length-1;t>=0;t--)this.transforms[t].unapply(n)},this.applyToPoint=function(n){for(var t=0;t<this.transforms.length;t++)this.transforms[t].applyToPoint(n)},r=n.trim(n.compressSpaces(t)).replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/),i=0;i<r.length;i++){var f=n.trim(r[i].split("(")[0]),o=r[i].split("(")[1].replace(")",""),e=new this.Type[f](o);e.type=f;this.transforms.push(e)}},n.AspectRatio=function(t,i,r,u,f,e,o,s,h,c){i=n.compressSpaces(i);i=i.replace(/^defer\s/,"");var w=i.split(" ")[0]||"xMidYMid",l=i.split(" ")[1]||"meet",y=r/u,p=f/e,a=Math.min(y,p),v=Math.max(y,p);l=="meet"&&(u*=a,e*=a);l=="slice"&&(u*=v,e*=v);h=new n.Property("refX",h);c=new n.Property("refY",c);h.hasValue()&&c.hasValue()?t.translate(-a*h.toPixels("x"),-a*c.toPixels("y")):(w.match(/^xMid/)&&(l=="meet"&&a==p||l=="slice"&&v==p)&&t.translate(r/2-u/2,0),w.match(/YMid$/)&&(l=="meet"&&a==y||l=="slice"&&v==y)&&t.translate(0,f/2-e/2),w.match(/^xMax/)&&(l=="meet"&&a==p||l=="slice"&&v==p)&&t.translate(r-u,0),w.match(/YMax$/)&&(l=="meet"&&a==y||l=="slice"&&v==y)&&t.translate(0,f-e));w=="none"?t.scale(y,p):l=="meet"?t.scale(a,a):l=="slice"&&t.scale(v,v);t.translate(o==null?0:-o,s==null?0:-s)},n.Element={},n.EmptyProperty=new n.Property("EMPTY",""),n.Element.ElementBase=function(t){var f,h,o,s,e,u,i,r;if(this.attributes={},this.styles={},this.children=[],this.attribute=function(t,i){var r=this.attributes[t];return r!=null?r:(i==!0&&(r=new n.Property(t,""),this.attributes[t]=r),r||n.EmptyProperty)},this.getHrefAttribute=function(){for(var t in this.attributes)if(t.match(/:href$/))return this.attributes[t];return n.EmptyProperty},this.style=function(t,i){var r=this.styles[t],u,e,f;return r!=null?r:(u=this.attribute(t),u!=null&&u.hasValue())?(this.styles[t]=u,u):(e=this.parent,e!=null&&(f=e.style(t),f!=null&&f.hasValue()))?f:(i==!0&&(r=new n.Property(t,""),this.styles[t]=r),r||n.EmptyProperty)},this.render=function(n){var t,i;this.style("display").value!="none"&&this.attribute("visibility").value!="hidden"&&(n.save(),this.attribute("mask").hasValue()?(t=this.attribute("mask").getDefinition(),t!=null&&t.apply(n,this)):this.style("filter").hasValue()?(i=this.style("filter").getDefinition(),i!=null&&i.apply(n,this)):(this.setContext(n),this.renderChildren(n),this.clearContext(n)),n.restore())},this.setContext=function(){},this.clearContext=function(){},this.renderChildren=function(n){for(var t=0;t<this.children.length;t++)this.children[t].render(n)},this.addChild=function(t,i){var r=t;i&&(r=n.CreateElement(t));r.parent=this;this.children.push(r)},t!=null&&t.nodeType==1){for(r=0;r<t.childNodes.length;r++)f=t.childNodes[r],f.nodeType==1&&this.addChild(f,!0),this.captureTextNodes&&f.nodeType==3&&(h=f.nodeValue||f.text||"",n.trim(n.compressSpaces(h))!=""&&this.addChild(new n.Element.tspan(f),!1));for(r=0;r<t.attributes.length;r++)o=t.attributes[r],this.attributes[o.nodeName]=new n.Property(o.nodeName,o.nodeValue);if(i=n.Styles[t.nodeName],i!=null)for(u in i)this.styles[u]=i[u];if(this.attribute("class").hasValue())for(s=n.compressSpaces(this.attribute("class").value).split(" "),e=0;e<s.length;e++){if(i=n.Styles["."+s[e]],i!=null)for(u in i)this.styles[u]=i[u];if(i=n.Styles[t.nodeName+"."+s[e]],i!=null)for(u in i)this.styles[u]=i[u]}if(this.attribute("id").hasValue()&&(i=n.Styles["#"+this.attribute("id").value],i!=null))for(u in i)this.styles[u]=i[u];if(this.attribute("style").hasValue())for(i=this.attribute("style").value.split(";"),r=0;r<i.length;r++)if(n.trim(i[r])!=""){var c=i[r].split(":"),u=n.trim(c[0]),l=n.trim(c[1]);this.styles[u]=new n.Property(u,l)}this.attribute("id").hasValue()&&n.Definitions[this.attribute("id").value]==null&&(n.Definitions[this.attribute("id").value]=this)}},n.Element.RenderedElementBase=function(t){this.base=n.Element.ElementBase;this.base(t);this.setContext=function(t){var i,u,r,o,f,e,h,s;this.style("fill").isUrlDefinition()?(u=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity")),u!=null&&(t.fillStyle=u)):this.style("fill").hasValue()&&(i=this.style("fill"),i.value=="currentColor"&&(i.value=this.style("color").value),t.fillStyle=i.value=="none"?"rgba(0,0,0,0)":i.value);this.style("fill-opacity").hasValue()&&(i=new n.Property("fill",t.fillStyle),i=i.addOpacity(this.style("fill-opacity").value),t.fillStyle=i.value);this.style("stroke").isUrlDefinition()?(u=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity")),u!=null&&(t.strokeStyle=u)):this.style("stroke").hasValue()&&(r=this.style("stroke"),r.value=="currentColor"&&(r.value=this.style("color").value),t.strokeStyle=r.value=="none"?"rgba(0,0,0,0)":r.value);this.style("stroke-opacity").hasValue()&&(r=new n.Property("stroke",t.strokeStyle),r=r.addOpacity(this.style("stroke-opacity").value),t.strokeStyle=r.value);this.style("stroke-width").hasValue()&&(o=this.style("stroke-width").toPixels(),t.lineWidth=o==0?.001:o);this.style("stroke-linecap").hasValue()&&(t.lineCap=this.style("stroke-linecap").value);this.style("stroke-linejoin").hasValue()&&(t.lineJoin=this.style("stroke-linejoin").value);this.style("stroke-miterlimit").hasValue()&&(t.miterLimit=this.style("stroke-miterlimit").value);this.style("stroke-dasharray").hasValue()&&(f=n.ToNumberArray(this.style("stroke-dasharray").value),typeof t.setLineDash!="undefined"?t.setLineDash(f):typeof t.webkitLineDash!="undefined"?t.webkitLineDash=f:typeof t.mozDash!="undefined"&&(t.mozDash=f),e=this.style("stroke-dashoffset").numValueOrDefault(1),typeof t.lineDashOffset!="undefined"?t.lineDashOffset=e:typeof t.webkitLineDashOffset!="undefined"?t.webkitLineDashOffset=e:typeof t.mozDashOffset!="undefined"&&(t.mozDashOffset=e));typeof t.font!="undefined"&&(t.font=n.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString());this.attribute("transform").hasValue()&&(h=new n.Transform(this.attribute("transform").value),h.apply(t));this.style("clip-path").hasValue()&&(s=this.style("clip-path").getDefinition(),s!=null&&s.apply(t));this.style("opacity").hasValue()&&(t.globalAlpha=this.style("opacity").numValue())}},n.Element.RenderedElementBase.prototype=new n.Element.ElementBase,n.Element.PathElementBase=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.path=function(t){return t!=null&&t.beginPath(),new n.BoundingBox};this.renderChildren=function(t){var i,u,r;if(this.path(t),n.Mouse.checkPath(this,t),t.fillStyle!=""&&(this.attribute("fill-rule").hasValue()?t.fill(this.attribute("fill-rule").value):t.fill()),t.strokeStyle!=""&&t.stroke(),i=this.getMarkers(),i!=null){if(this.style("marker-start").isUrlDefinition()&&(r=this.style("marker-start").getDefinition(),r.render(t,i[0][0],i[0][1])),this.style("marker-mid").isUrlDefinition())for(r=this.style("marker-mid").getDefinition(),u=1;u<i.length-1;u++)r.render(t,i[u][0],i[u][1]);this.style("marker-end").isUrlDefinition()&&(r=this.style("marker-end").getDefinition(),r.render(t,i[i.length-1][0],i[i.length-1][1]))}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}},n.Element.PathElementBase.prototype=new n.Element.RenderedElementBase,n.Element.svg=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.baseClearContext=this.clearContext;this.clearContext=function(t){this.baseClearContext(t);n.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;this.setContext=function(t){var i,r,f,e;if(t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4,this.baseSetContext(t),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),t.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y")),i=n.ViewPort.width(),r=n.ViewPort.height(),this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),typeof this.root=="undefined"&&(i=this.attribute("width").toPixels("x"),r=this.attribute("height").toPixels("y"),f=0,e=0,this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(f=-this.attribute("refX").toPixels("x"),e=-this.attribute("refY").toPixels("y")),t.beginPath(),t.moveTo(f,e),t.lineTo(i,e),t.lineTo(i,r),t.lineTo(f,r),t.closePath(),t.clip()),n.ViewPort.SetCurrent(i,r),this.attribute("viewBox").hasValue()){var u=n.ToNumberArray(this.attribute("viewBox").value),o=u[0],s=u[1];i=u[2];r=u[3];n.AspectRatio(t,this.attribute("preserveAspectRatio").value,n.ViewPort.width(),i,n.ViewPort.height(),r,o,s,this.attribute("refX").value,this.attribute("refY").value);n.ViewPort.RemoveCurrent();n.ViewPort.SetCurrent(u[2],u[3])}}},n.Element.svg.prototype=new n.Element.RenderedElementBase,n.Element.rect=function(t){this.base=n.Element.PathElementBase;this.base(t);this.path=function(t){var i=this.attribute("x").toPixels("x"),r=this.attribute("y").toPixels("y"),f=this.attribute("width").toPixels("x"),e=this.attribute("height").toPixels("y"),u=this.attribute("rx").toPixels("x"),o=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(o=u),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(u=o),u=Math.min(u,f/2),o=Math.min(o,e/2),t!=null&&(t.beginPath(),t.moveTo(i+u,r),t.lineTo(i+f-u,r),t.quadraticCurveTo(i+f,r,i+f,r+o),t.lineTo(i+f,r+e-o),t.quadraticCurveTo(i+f,r+e,i+f-u,r+e),t.lineTo(i+u,r+e),t.quadraticCurveTo(i,r+e,i,r+e-o),t.lineTo(i,r+o),t.quadraticCurveTo(i,r,i+u,r),t.closePath()),new n.BoundingBox(i,r,i+f,r+e)}},n.Element.rect.prototype=new n.Element.PathElementBase,n.Element.circle=function(t){this.base=n.Element.PathElementBase;this.base(t);this.path=function(t){var r=this.attribute("cx").toPixels("x"),u=this.attribute("cy").toPixels("y"),i=this.attribute("r").toPixels();return t!=null&&(t.beginPath(),t.arc(r,u,i,0,Math.PI*2,!0),t.closePath()),new n.BoundingBox(r-i,u-i,r+i,u+i)}},n.Element.circle.prototype=new n.Element.PathElementBase,n.Element.ellipse=function(t){this.base=n.Element.PathElementBase;this.base(t);this.path=function(t){var e=4*((Math.sqrt(2)-1)/3),f=this.attribute("rx").toPixels("x"),u=this.attribute("ry").toPixels("y"),i=this.attribute("cx").toPixels("x"),r=this.attribute("cy").toPixels("y");return t!=null&&(t.beginPath(),t.moveTo(i,r-u),t.bezierCurveTo(i+e*f,r-u,i+f,r-e*u,i+f,r),t.bezierCurveTo(i+f,r+e*u,i+e*f,r+u,i,r+u),t.bezierCurveTo(i-e*f,r+u,i-f,r+e*u,i-f,r),t.bezierCurveTo(i-f,r-e*u,i-e*f,r-u,i,r-u),t.closePath()),new n.BoundingBox(i-f,r-u,i+f,r+u)}},n.Element.ellipse.prototype=new n.Element.PathElementBase,n.Element.line=function(t){this.base=n.Element.PathElementBase;this.base(t);this.getPoints=function(){return[new n.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new n.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]};this.path=function(t){var i=this.getPoints();return t!=null&&(t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y)),new n.BoundingBox(i[0].x,i[0].y,i[1].x,i[1].y)};this.getMarkers=function(){var n=this.getPoints(),t=n[0].angleTo(n[1]);return[[n[0],t],[n[1],t]]}},n.Element.line.prototype=new n.Element.PathElementBase,n.Element.polyline=function(t){this.base=n.Element.PathElementBase;this.base(t);this.points=n.CreatePath(this.attribute("points").value);this.path=function(t){var r=new n.BoundingBox(this.points[0].x,this.points[0].y),i;for(t!=null&&(t.beginPath(),t.moveTo(this.points[0].x,this.points[0].y)),i=1;i<this.points.length;i++)r.addPoint(this.points[i].x,this.points[i].y),t!=null&&t.lineTo(this.points[i].x,this.points[i].y);return r};this.getMarkers=function(){for(var t=[],n=0;n<this.points.length-1;n++)t.push([this.points[n],this.points[n].angleTo(this.points[n+1])]);return t.push([this.points[this.points.length-1],t[t.length-1][1]]),t}},n.Element.polyline.prototype=new n.Element.PathElementBase,n.Element.polygon=function(t){this.base=n.Element.polyline;this.base(t);this.basePath=this.path;this.path=function(n){var t=this.basePath(n);return n!=null&&(n.lineTo(this.points[0].x,this.points[0].y),n.closePath()),t}},n.Element.polygon.prototype=new n.Element.polyline,n.Element.path=function(t){this.base=n.Element.PathElementBase;this.base(t);var i=this.attribute("d").value;i=i.replace(/,/gm," ");i=i.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");i=i.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");i=i.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");i=i.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");i=i.replace(/([0-9])([+\-])/gm,"$1 $2");i=i.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");i=i.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");i=n.compressSpaces(i);i=n.trim(i);this.PathParser=new function(t){this.tokens=t.split(" ");this.reset=function(){this.i=-1;this.command="";this.previousCommand="";this.start=new n.Point(0,0);this.control=new n.Point(0,0);this.current=new n.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()?!0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1};this.getToken=function(){return this.i++,this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){var t=new n.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(t)};this.getAsControlPoint=function(){var n=this.getPoint();return this.control=n,n};this.getAsCurrentPoint=function(){var n=this.getPoint();return this.current=n,n};this.getReflectedControlPoint=function(){if(this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"&&this.previousCommand.toLowerCase()!="q"&&this.previousCommand.toLowerCase()!="t")return this.current;return new n.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(n){return this.isRelativeCommand()&&(n.x+=this.current.x,n.y+=this.current.y),n};this.addMarker=function(n,t,i){i!=null&&this.angles.length>0&&this.angles[this.angles.length-1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(i));this.addMarkerAngle(n,t==null?null:t.angleTo(n))};this.addMarkerAngle=function(n,t){this.points.push(n);this.angles.push(t)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var t,n=0;n<this.angles.length;n++)if(this.angles[n]==null)for(t=n+1;t<this.angles.length;t++)if(this.angles[t]!=null){this.angles[n]=this.angles[t];break}return this.angles}}(i);this.path=function(t){var i=this.PathParser,c,ft,f,y,e,u,r,w;for(i.reset(),c=new n.BoundingBox,t!=null&&t.beginPath();!i.isEnd();){i.nextCommand();switch(i.command){case"M":case"m":for(f=i.getAsCurrentPoint(),i.addMarker(f),c.addPoint(f.x,f.y),t!=null&&t.moveTo(f.x,f.y),i.start=i.current;!i.isCommandOrEnd();)f=i.getAsCurrentPoint(),i.addMarker(f,i.start),c.addPoint(f.x,f.y),t!=null&&t.lineTo(f.x,f.y);break;case"L":case"l":while(!i.isCommandOrEnd())ft=i.current,f=i.getAsCurrentPoint(),i.addMarker(f,ft),c.addPoint(f.x,f.y),t!=null&&t.lineTo(f.x,f.y);break;case"H":case"h":while(!i.isCommandOrEnd())y=new n.Point((i.isRelativeCommand()?i.current.x:0)+i.getScalar(),i.current.y),i.addMarker(y,i.current),i.current=y,c.addPoint(i.current.x,i.current.y),t!=null&&t.lineTo(i.current.x,i.current.y);break;case"V":case"v":while(!i.isCommandOrEnd())y=new n.Point(i.current.x,(i.isRelativeCommand()?i.current.y:0)+i.getScalar()),i.addMarker(y,i.current),i.current=y,c.addPoint(i.current.x,i.current.y),t!=null&&t.lineTo(i.current.x,i.current.y);break;case"C":case"c":while(!i.isCommandOrEnd()){var e=i.current,l=i.getPoint(),u=i.getAsControlPoint(),r=i.getAsCurrentPoint();i.addMarker(r,u,l);c.addBezierCurve(e.x,e.y,l.x,l.y,u.x,u.y,r.x,r.y);t!=null&&t.bezierCurveTo(l.x,l.y,u.x,u.y,r.x,r.y)}break;case"S":case"s":while(!i.isCommandOrEnd()){var e=i.current,l=i.getReflectedControlPoint(),u=i.getAsControlPoint(),r=i.getAsCurrentPoint();i.addMarker(r,u,l);c.addBezierCurve(e.x,e.y,l.x,l.y,u.x,u.y,r.x,r.y);t!=null&&t.bezierCurveTo(l.x,l.y,u.x,u.y,r.x,r.y)}break;case"Q":case"q":while(!i.isCommandOrEnd()){var e=i.current,u=i.getAsControlPoint(),r=i.getAsCurrentPoint();i.addMarker(r,u,u);c.addQuadraticCurve(e.x,e.y,u.x,u.y,r.x,r.y);t!=null&&t.quadraticCurveTo(u.x,u.y,r.x,r.y)}break;case"T":case"t":while(!i.isCommandOrEnd())e=i.current,u=i.getReflectedControlPoint(),i.control=u,r=i.getAsCurrentPoint(),i.addMarker(r,u,u),c.addQuadraticCurve(e.x,e.y,u.x,u.y,r.x,r.y),t!=null&&t.quadraticCurveTo(u.x,u.y,r.x,r.y);break;case"A":case"a":while(!i.isCommandOrEnd()){var e=i.current,o=i.getScalar(),s=i.getScalar(),a=i.getScalar()*(Math.PI/180),ct=i.getScalar(),g=i.getScalar(),r=i.getAsCurrentPoint(),h=new n.Point(Math.cos(a)*(e.x-r.x)/2+Math.sin(a)*(e.y-r.y)/2,-Math.sin(a)*(e.x-r.x)/2+Math.cos(a)*(e.y-r.y)/2),nt=Math.pow(h.x,2)/Math.pow(o,2)+Math.pow(h.y,2)/Math.pow(s,2);nt>1&&(o*=Math.sqrt(nt),s*=Math.sqrt(nt));w=(ct==g?-1:1)*Math.sqrt((Math.pow(o,2)*Math.pow(s,2)-Math.pow(o,2)*Math.pow(h.y,2)-Math.pow(s,2)*Math.pow(h.x,2))/(Math.pow(o,2)*Math.pow(h.y,2)+Math.pow(s,2)*Math.pow(h.x,2)));isNaN(w)&&(w=0);var v=new n.Point(w*o*h.y/s,w*-s*h.x/o),p=new n.Point((e.x+r.x)/2+Math.cos(a)*v.x-Math.sin(a)*v.y,(e.y+r.y)/2+Math.sin(a)*v.x+Math.cos(a)*v.y),et=function(n){return Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2))},b=function(n,t){return(n[0]*t[0]+n[1]*t[1])/(et(n)*et(t))},ot=function(n,t){return(n[0]*t[1]<n[1]*t[0]?-1:1)*Math.acos(b(n,t))},tt=ot([1,0],[(h.x-v.x)/o,(h.y-v.y)/s]),it=[(h.x-v.x)/o,(h.y-v.y)/s],rt=[(-h.x-v.x)/o,(-h.y-v.y)/s],k=ot(it,rt);b(it,rt)<=-1&&(k=Math.PI);b(it,rt)>=1&&(k=0);var ut=1-g?1:-1,d=tt+ut*(k/2),lt=new n.Point(p.x+o*Math.cos(d),p.y+s*Math.sin(d));if(i.addMarkerAngle(lt,d-ut*Math.PI/2),i.addMarkerAngle(r,d-ut*Math.PI),c.addPoint(r.x,r.y),t!=null){var b=o>s?o:s,st=o>s?1:o/s,ht=o>s?s/o:1;t.translate(p.x,p.y);t.rotate(a);t.scale(st,ht);t.arc(0,0,b,tt,tt+k,1-g);t.scale(1/st,1/ht);t.rotate(-a);t.translate(-p.x,-p.y)}}break;case"Z":case"z":t!=null&&t.closePath();i.current=i.start}}return c};this.getMarkers=function(){for(var t=this.PathParser.getMarkerPoints(),r=this.PathParser.getMarkerAngles(),i=[],n=0;n<t.length;n++)i.push([t[n],r[n]]);return i}},n.Element.path.prototype=new n.Element.PathElementBase,n.Element.pattern=function(t){this.base=n.Element.ElementBase;this.base(t);this.createPattern=function(t){var o=this.attribute("width").toPixels("x",!0),s=this.attribute("height").toPixels("y",!0),r=new n.Element.svg,i,u,f,e;for(r.attributes.viewBox=new n.Property("viewBox",this.attribute("viewBox").value),r.attributes.width=new n.Property("width",o+"px"),r.attributes.height=new n.Property("height",s+"px"),r.attributes.transform=new n.Property("transform",this.attribute("patternTransform").value),r.children=this.children,i=document.createElement("canvas"),i.width=o,i.height=s,u=i.getContext("2d"),this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&u.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0)),f=-1;f<=1;f++)for(e=-1;e<=1;e++)u.save(),u.translate(f*i.width,e*i.height),r.render(u),u.restore();return t.createPattern(i,"repeat")}},n.Element.pattern.prototype=new n.Element.ElementBase,n.Element.marker=function(t){this.base=n.Element.ElementBase;this.base(t);this.baseRender=this.render;this.render=function(t,i,r){t.translate(i.x,i.y);this.attribute("orient").valueOrDefault("auto")=="auto"&&t.rotate(r);this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&t.scale(t.lineWidth,t.lineWidth);t.save();var u=new n.Element.svg;u.attributes.viewBox=new n.Property("viewBox",this.attribute("viewBox").value);u.attributes.refX=new n.Property("refX",this.attribute("refX").value);u.attributes.refY=new n.Property("refY",this.attribute("refY").value);u.attributes.width=new n.Property("width",this.attribute("markerWidth").value);u.attributes.height=new n.Property("height",this.attribute("markerHeight").value);u.attributes.fill=new n.Property("fill",this.attribute("fill").valueOrDefault("black"));u.attributes.stroke=new n.Property("stroke",this.attribute("stroke").valueOrDefault("none"));u.children=this.children;u.render(t);t.restore();this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&t.scale(1/t.lineWidth,1/t.lineWidth);this.attribute("orient").valueOrDefault("auto")=="auto"&&t.rotate(-r);t.translate(-i.x,-i.y)}},n.Element.marker.prototype=new n.Element.ElementBase,n.Element.defs=function(t){this.base=n.Element.ElementBase;this.base(t);this.render=function(){}},n.Element.defs.prototype=new n.Element.ElementBase,n.Element.GradientBase=function(t){var i,r;for(this.base=n.Element.ElementBase,this.base(t),this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox"),this.stops=[],i=0;i<this.children.length;i++)r=this.children[i],r.type=="stop"&&this.stops.push(r);this.getGradient=function(){};this.createGradient=function(t,i,r){var f=this,v,o,s,h,e,l,u,c,a;if(this.getHrefAttribute().hasValue()&&(f=this.getHrefAttribute().getDefinition()),v=function(t){if(r.hasValue()){var i=new n.Property("color",t);return i.addOpacity(r.value).value}return t},o=this.getGradient(t,i),o==null)return v(f.stops[f.stops.length-1].color);for(s=0;s<f.stops.length;s++)o.addColorStop(f.stops[s].offset,v(f.stops[s].color));return this.attribute("gradientTransform").hasValue()?(h=n.ViewPort.viewPorts[0],e=new n.Element.rect,e.attributes.x=new n.Property("x",-n.MAX_VIRTUAL_PIXELS/3),e.attributes.y=new n.Property("y",-n.MAX_VIRTUAL_PIXELS/3),e.attributes.width=new n.Property("width",n.MAX_VIRTUAL_PIXELS),e.attributes.height=new n.Property("height",n.MAX_VIRTUAL_PIXELS),l=new n.Element.g,l.attributes.transform=new n.Property("transform",this.attribute("gradientTransform").value),l.children=[e],u=new n.Element.svg,u.attributes.x=new n.Property("x",0),u.attributes.y=new n.Property("y",0),u.attributes.width=new n.Property("width",h.width),u.attributes.height=new n.Property("height",h.height),u.children=[l],c=document.createElement("canvas"),c.width=h.width,c.height=h.height,a=c.getContext("2d"),a.fillStyle=o,u.render(a),a.createPattern(c,"no-repeat")):o}},n.Element.GradientBase.prototype=new n.Element.ElementBase,n.Element.linearGradient=function(t){this.base=n.Element.GradientBase;this.base(t);this.getGradient=function(n,t){var i=t.getBoundingBox();this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var r=this.gradientUnits=="objectBoundingBox"?i.x()+i.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),u=this.gradientUnits=="objectBoundingBox"?i.y()+i.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),f=this.gradientUnits=="objectBoundingBox"?i.x()+i.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),e=this.gradientUnits=="objectBoundingBox"?i.y()+i.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return r==f&&u==e?null:n.createLinearGradient(r,u,f,e)}},n.Element.linearGradient.prototype=new n.Element.GradientBase,n.Element.radialGradient=function(t){this.base=n.Element.GradientBase;this.base(t);this.getGradient=function(n,t){var i=t.getBoundingBox(),o;this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%");this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%");this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var r=this.gradientUnits=="objectBoundingBox"?i.x()+i.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),u=this.gradientUnits=="objectBoundingBox"?i.y()+i.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),f=r,e=u;return this.attribute("fx").hasValue()&&(f=this.gradientUnits=="objectBoundingBox"?i.x()+i.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(e=this.gradientUnits=="objectBoundingBox"?i.y()+i.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y")),o=this.gradientUnits=="objectBoundingBox"?(i.width()+i.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels(),n.createRadialGradient(f,e,0,r,u,o)}},n.Element.radialGradient.prototype=new n.Element.GradientBase,n.Element.stop=function(t){this.base=n.Element.ElementBase;this.base(t);this.offset=this.attribute("offset").numValue();this.offset<0&&(this.offset=0);this.offset>1&&(this.offset=1);var i=this.style("stop-color");this.style("stop-opacity").hasValue()&&(i=i.addOpacity(this.style("stop-opacity").value));this.color=i.value},n.Element.stop.prototype=new n.Element.ElementBase,n.Element.AnimateBase=function(t){this.base=n.Element.ElementBase;this.base(t);n.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").toMilliseconds();this.getProperty=function(){var t=this.attribute("attributeType").value,n=this.attribute("attributeName").value;return t=="CSS"?this.parent.style(n,!0):this.parent.attribute(n,!0)};this.initialValue=null;this.initialUnits="";this.removed=!1;this.calcValue=function(){return""};this.update=function(n){var i,t,r;if(this.initialValue==null&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration)if(this.attribute("repeatCount").value=="indefinite"||this.attribute("repeatDur").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")!="remove"||this.removed?!1:(this.removed=!0,this.getProperty().value=this.initialValue,!0);return this.duration=this.duration+n,i=!1,this.begin<this.duration&&(t=this.calcValue(),this.attribute("type").hasValue()&&(r=this.attribute("type").value,t=r+"("+t+")"),this.getProperty().value=t,i=!0),i};this.from=this.attribute("from");this.to=this.attribute("to");this.values=this.attribute("values");this.values.hasValue()&&(this.values.value=this.values.value.split(";"));this.progress=function(){var t={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var i=t.progress*(this.values.value.length-1),r=Math.floor(i),u=Math.ceil(i);t.from=new n.Property("from",parseFloat(this.values.value[r]));t.to=new n.Property("to",parseFloat(this.values.value[u]));t.progress=(i-r)/(u-r)}else t.from=this.from,t.to=this.to;return t}},n.Element.AnimateBase.prototype=new n.Element.ElementBase,n.Element.animate=function(t){this.base=n.Element.AnimateBase;this.base(t);this.calcValue=function(){var n=this.progress(),t=n.from.numValue()+(n.to.numValue()-n.from.numValue())*n.progress;return t+this.initialUnits}},n.Element.animate.prototype=new n.Element.AnimateBase,n.Element.animateColor=function(t){this.base=n.Element.AnimateBase;this.base(t);this.calcValue=function(){var t=this.progress(),n=new RGBColor(t.from.value),i=new RGBColor(t.to.value);if(n.ok&&i.ok){var r=n.r+(i.r-n.r)*t.progress,u=n.g+(i.g-n.g)*t.progress,f=n.b+(i.b-n.b)*t.progress;return"rgb("+parseInt(r,10)+","+parseInt(u,10)+","+parseInt(f,10)+")"}return this.attribute("from").value}},n.Element.animateColor.prototype=new n.Element.AnimateBase,n.Element.animateTransform=function(t){this.base=n.Element.AnimateBase;this.base(t);this.calcValue=function(){for(var i=this.progress(),r=n.ToNumberArray(i.from.value),f=n.ToNumberArray(i.to.value),u="",t=0;t<r.length;t++)u+=r[t]+(f[t]-r[t])*i.progress+" ";return u}},n.Element.animateTransform.prototype=new n.Element.animate,n.Element.font=function(t){var r,i;for(this.base=n.Element.ElementBase,this.base(t),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.isRTL=!1,this.isArabic=!1,this.fontFace=null,this.missingGlyph=null,this.glyphs=[],r=0;r<this.children.length;r++)i=this.children[r],i.type=="font-face"?(this.fontFace=i,i.style("font-family").hasValue()&&(n.Definitions[i.style("font-family").value]=this)):i.type=="missing-glyph"?this.missingGlyph=i:i.type=="glyph"&&(i.arabicForm!=""?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[i.unicode]=="undefined"&&(this.glyphs[i.unicode]=[]),this.glyphs[i.unicode][i.arabicForm]=i):this.glyphs[i.unicode]=i)},n.Element.font.prototype=new n.Element.ElementBase,n.Element.fontface=function(t){this.base=n.Element.ElementBase;this.base(t);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()},n.Element.fontface.prototype=new n.Element.ElementBase,n.Element.missingglyph=function(t){this.base=n.Element.path;this.base(t);this.horizAdvX=0},n.Element.missingglyph.prototype=new n.Element.path,n.Element.glyph=function(t){this.base=n.Element.path;this.base(t);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value},n.Element.glyph.prototype=new n.Element.path,n.Element.text=function(t){this.captureTextNodes=!0;this.base=n.Element.RenderedElementBase;this.base(t);this.baseSetContext=this.setContext;this.setContext=function(n){this.baseSetContext(n);this.style("dominant-baseline").hasValue()&&(n.textBaseline=this.style("dominant-baseline").value);this.style("alignment-baseline").hasValue()&&(n.textBaseline=this.style("alignment-baseline").value)};this.getBoundingBox=function(){return new n.BoundingBox(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"),0,0)};this.renderChildren=function(n){this.x=this.attribute("x").toPixels("x");this.y=this.attribute("y").toPixels("y");this.x+=this.getAnchorDelta(n,this,0);for(var t=0;t<this.children.length;t++)this.renderChild(n,this,t)};this.getAnchorDelta=function(n,t,i){var e=this.style("text-anchor").valueOrDefault("start"),u,r,f;if(e!="start"){for(u=0,r=i;r<t.children.length;r++){if(f=t.children[r],r>i&&f.attribute("x").hasValue())break;u+=f.measureTextRecursive(n)}return-1*(e=="end"?u:u/2)}return 0};this.renderChild=function(n,t,i){var r=t.children[i],i;for(r.attribute("x").hasValue()?r.x=r.attribute("x").toPixels("x")+this.getAnchorDelta(n,t,i):(this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),r.attribute("dx").hasValue()&&(this.x+=r.attribute("dx").toPixels("x")),r.x=this.x),this.x=r.x+r.measureText(n),r.attribute("y").hasValue()?r.y=r.attribute("y").toPixels("y"):(this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),r.attribute("dy").hasValue()&&(this.y+=r.attribute("dy").toPixels("y")),r.y=this.y),this.y=r.y,r.render(n),i=0;i<r.children.length;i++)this.renderChild(n,r,i)}},n.Element.text.prototype=new n.Element.RenderedElementBase,n.Element.TextElementBase=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.getGlyph=function(n,t,i){var u=t[i],r=null,f;return n.isArabic?(f="isolated",(i==0||t[i-1]==" ")&&i<t.length-2&&t[i+1]!=" "&&(f="terminal"),i>0&&t[i-1]!=" "&&i<t.length-2&&t[i+1]!=" "&&(f="medial"),i>0&&t[i-1]!=" "&&(i==t.length-1||t[i+1]==" ")&&(f="initial"),typeof n.glyphs[u]!="undefined"&&(r=n.glyphs[u][f],r==null&&n.glyphs[u].type=="glyph"&&(r=n.glyphs[u]))):r=n.glyphs[u],r==null&&(r=n.missingGlyph),r};this.renderChildren=function(t){var i=this.parent.style("font-family").getDefinition(),e,r,s,u,c;if(i!=null){var o=this.parent.style("font-size").numValueOrDefault(n.Font.Parse(n.ctx.font).fontSize),h=this.parent.style("font-style").valueOrDefault(n.Font.Parse(n.ctx.font).fontStyle),f=this.getText();for(i.isRTL&&(f=f.split("").reverse().join("")),e=n.ToNumberArray(this.parent.attribute("dx").value),r=0;r<f.length;r++)s=this.getGlyph(i,f,r),u=o/i.fontFace.unitsPerEm,t.translate(this.x,this.y),t.scale(u,-u),c=t.lineWidth,t.lineWidth=t.lineWidth*i.fontFace.unitsPerEm/o,h=="italic"&&t.transform(1,0,.4,1,0,0),s.render(t),h=="italic"&&t.transform(1,0,-.4,1,0,0),t.lineWidth=c,t.scale(1/u,-1/u),t.translate(-this.x,-this.y),this.x+=o*(s.horizAdvX||i.horizAdvX)/i.fontFace.unitsPerEm,typeof e[r]=="undefined"||isNaN(e[r])||(this.x+=e[r]);return}t.fillStyle!=""&&t.fillText(n.compressSpaces(this.getText()),this.x,this.y);t.strokeStyle!=""&&t.strokeText(n.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureTextRecursive=function(n){for(var i=this.measureText(n),t=0;t<this.children.length;t++)i+=this.children[t].measureTextRecursive(n);return i};this.measureText=function(t){var r=this.parent.style("font-family").getDefinition(),f,i,s,o,h;if(r!=null){var c=this.parent.style("font-size").numValueOrDefault(n.Font.Parse(n.ctx.font).fontSize),e=0,u=this.getText();for(r.isRTL&&(u=u.split("").reverse().join("")),f=n.ToNumberArray(this.parent.attribute("dx").value),i=0;i<u.length;i++)s=this.getGlyph(r,u,i),e+=(s.horizAdvX||r.horizAdvX)*c/r.fontFace.unitsPerEm,typeof f[i]=="undefined"||isNaN(f[i])||(e+=f[i]);return e}return(o=n.compressSpaces(this.getText()),!t.measureText)?o.length*10:(t.save(),this.setContext(t),h=t.measureText(o).width,t.restore(),h)}},n.Element.TextElementBase.prototype=new n.Element.RenderedElementBase,n.Element.tspan=function(t){this.captureTextNodes=!0;this.base=n.Element.TextElementBase;this.base(t);this.text=t.nodeValue||t.text||"";this.getText=function(){return this.text}},n.Element.tspan.prototype=new n.Element.TextElementBase,n.Element.tref=function(t){this.base=n.Element.TextElementBase;this.base(t);this.getText=function(){var n=this.getHrefAttribute().getDefinition();if(n!=null)return n.children[0].getText()}},n.Element.tref.prototype=new n.Element.TextElementBase,n.Element.a=function(t){this.base=n.Element.TextElementBase;this.base(t);this.hasText=!0;for(var i=0;i<t.childNodes.length;i++)t.childNodes[i].nodeType!=3&&(this.hasText=!1);this.text=this.hasText?t.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(t){var r,i;this.hasText?(this.baseRenderChildren(t),r=new n.Property("fontSize",n.Font.Parse(n.ctx.font).fontSize),n.Mouse.checkBoundingBox(this,new n.BoundingBox(this.x,this.y-r.toPixels("y"),this.x+this.measureText(t),this.y))):(i=new n.Element.g,i.children=this.children,i.parent=this,i.render(t))};this.onclick=function(){window.open(this.getHrefAttribute().value)};this.onmousemove=function(){n.ctx.canvas.style.cursor="pointer"}},n.Element.a.prototype=new n.Element.TextElementBase,n.Element.image=function(t){var i,r,u;this.base=n.Element.RenderedElementBase;this.base(t);i=this.getHrefAttribute().value;r=i.match(/\.svg$/);n.Images.push(this);this.loaded=!1;r?(this.img=n.ajax(i),this.loaded=!0):(this.img=document.createElement("img"),u=this,this.img.onload=function(){u.loaded=!0},this.img.onerror=function(){typeof console!="undefined"&&(console.log('ERROR: image "'+i+'" not found'),u.loaded=!0)},this.img.src=i);this.renderChildren=function(t){var f=this.attribute("x").toPixels("x"),e=this.attribute("y").toPixels("y"),i=this.attribute("width").toPixels("x"),u=this.attribute("height").toPixels("y");i!=0&&u!=0&&(t.save(),r?t.drawSvg(this.img,f,e,i,u):(t.translate(f,e),n.AspectRatio(t,this.attribute("preserveAspectRatio").value,i,this.img.width,u,this.img.height,0,0),t.drawImage(this.img,0,0)),t.restore())};this.getBoundingBox=function(){var t=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),r=this.attribute("width").toPixels("x"),u=this.attribute("height").toPixels("y");return new n.BoundingBox(t,i,t+r,i+u)}},n.Element.image.prototype=new n.Element.RenderedElementBase,n.Element.g=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.getBoundingBox=function(){for(var i=new n.BoundingBox,t=0;t<this.children.length;t++)i.addBoundingBox(this.children[t].getBoundingBox());return i}},n.Element.g.prototype=new n.Element.RenderedElementBase,n.Element.symbol=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.baseSetContext=this.setContext;this.setContext=function(t){if(this.baseSetContext(t),this.attribute("viewBox").hasValue()){var i=n.ToNumberArray(this.attribute("viewBox").value),r=i[0],u=i[1];width=i[2];height=i[3];n.AspectRatio(t,this.attribute("preserveAspectRatio").value,this.attribute("width").toPixels("x"),width,this.attribute("height").toPixels("y"),height,r,u);n.ViewPort.SetCurrent(i[2],i[3])}}},n.Element.symbol.prototype=new n.Element.RenderedElementBase,n.Element.style=function(t){var r,h,i,c,l,s,u,d,e,f,a,nt;for(this.base=n.Element.ElementBase,this.base(t),r="",i=0;i<t.childNodes.length;i++)r+=t.childNodes[i].nodeValue;for(r=r.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),r=n.compressSpaces(r),h=r.split("}"),i=0;i<h.length;i++)if(n.trim(h[i])!=""){var w=h[i].split("{"),b=w[0].split(","),o=w[1].split(";");for(c=0;c<b.length;c++)if(l=n.trim(b[c]),l!=""){for(s={},u=0;u<o.length;u++){var v=o[u].indexOf(":"),y=o[u].substr(0,v),k=o[u].substr(v+1,o[u].length-v);y!=null&&k!=null&&(s[n.trim(y)]=new n.Property(n.trim(y),n.trim(k)))}if(n.Styles[l]=s,l=="@font-face")for(d=s["font-family"].value.replace(/"/g,""),e=s.src.value.split(","),f=0;f<e.length;f++)if(e[f].indexOf('format("svg")')>0){var p=e[f].indexOf("url"),tt=e[f].indexOf(")",p),it=e[f].substr(p+5,tt-p-6),rt=n.parseXml(n.ajax(it)),g=rt.getElementsByTagName("font");for(a=0;a<g.length;a++)nt=n.CreateElement(g[a]),n.Definitions[d]=nt}}}},n.Element.style.prototype=new n.Element.ElementBase,n.Element.use=function(t){this.base=n.Element.RenderedElementBase;this.base(t);this.baseSetContext=this.setContext;this.setContext=function(n){this.baseSetContext(n);this.attribute("x").hasValue()&&n.translate(this.attribute("x").toPixels("x"),0);this.attribute("y").hasValue()&&n.translate(0,this.attribute("y").toPixels("y"))};this.getDefinition=function(){var n=this.getHrefAttribute().getDefinition();return this.attribute("width").hasValue()&&(n.attribute("width",!0).value=this.attribute("width").value),this.attribute("height").hasValue()&&(n.attribute("height",!0).value=this.attribute("height").value),n};this.path=function(n){var t=this.getDefinition();t!=null&&t.path(n)};this.getBoundingBox=function(){var n=this.getDefinition();if(n!=null)return n.getBoundingBox()};this.renderChildren=function(n){var t=this.getDefinition(),i;t!=null&&(i=t.parent,t.parent=null,t.render(n),t.parent=i)}},n.Element.use.prototype=new n.Element.RenderedElementBase,n.Element.mask=function(t){this.base=n.Element.ElementBase;this.base(t);this.apply=function(t,i){var o=this.attribute("x").toPixels("x"),s=this.attribute("y").toPixels("y"),r=this.attribute("width").toPixels("x"),u=this.attribute("height").toPixels("y"),f,l,v,h,a,c,e;if(r==0&&u==0){for(f=new n.BoundingBox,l=0;l<this.children.length;l++)f.addBoundingBox(this.children[l].getBoundingBox());var o=Math.floor(f.x1),s=Math.floor(f.y1),r=Math.floor(f.width()),u=Math.floor(f.height())}v=i.attribute("mask").value;i.attribute("mask").value="";h=document.createElement("canvas");h.width=o+r;h.height=s+u;a=h.getContext("2d");this.renderChildren(a);c=document.createElement("canvas");c.width=o+r;c.height=s+u;e=c.getContext("2d");i.render(e);e.globalCompositeOperation="destination-in";e.fillStyle=a.createPattern(h,"no-repeat");e.fillRect(0,0,o+r,s+u);t.fillStyle=e.createPattern(c,"no-repeat");t.fillRect(0,0,o+r,s+u);i.attribute("mask").value=v};this.render=function(){}},n.Element.mask.prototype=new n.Element.ElementBase,n.Element.clipPath=function(t){this.base=n.Element.ElementBase;this.base(t);this.apply=function(t){for(var i,r,u=0;u<this.children.length;u++)i=this.children[u],typeof i.path!="undefined"&&(r=null,i.attribute("transform").hasValue()&&(r=new n.Transform(i.attribute("transform").value),r.apply(t)),i.path(t),t.clip(),r&&r.unapply(t))};this.render=function(){}},n.Element.clipPath.prototype=new n.Element.ElementBase,n.Element.filter=function(t){this.base=n.Element.ElementBase;this.base(t);this.apply=function(n,t){var e=t.getBoundingBox(),l=Math.floor(e.x1),a=Math.floor(e.y1),o=Math.floor(e.width()),s=Math.floor(e.height()),v=t.style("filter").value,i,r,c,f,h,u;for(t.style("filter").value="",i=0,r=0,u=0;u<this.children.length;u++)c=this.children[u].extraFilterDistance||0,i=Math.max(i,c),r=Math.max(r,c);for(f=document.createElement("canvas"),f.width=o+2*i,f.height=s+2*r,h=f.getContext("2d"),h.translate(-l+i,-a+r),t.render(h),u=0;u<this.children.length;u++)this.children[u].apply(h,0,0,o+2*i,s+2*r);n.drawImage(f,0,0,o+2*i,s+2*r,l-i,a-r,o+2*i,s+2*r);t.style("filter",!0).value=v};this.render=function(){}},n.Element.filter.prototype=new n.Element.ElementBase,n.Element.feMorphology=function(t){this.base=n.Element.ElementBase;this.base(t);this.apply=function(){}},n.Element.feMorphology.prototype=new n.Element.ElementBase,n.Element.feColorMatrix=function(t){function i(n,t,i,r,u,f){return n[i*r*4+t*4+f]}function r(n,t,i,r,u,f,e){n[i*r*4+t*4+f]=e}this.base=n.Element.ElementBase;this.base(t);this.apply=function(n,t,u,f,e){for(var o=n.getImageData(0,0,f,e),t,u=0;u<e;u++)for(t=0;t<f;t++){var h=i(o.data,t,u,f,e,0),c=i(o.data,t,u,f,e,1),l=i(o.data,t,u,f,e,2),s=(h+c+l)/3;r(o.data,t,u,f,e,0,s);r(o.data,t,u,f,e,1,s);r(o.data,t,u,f,e,2,s)}n.clearRect(0,0,f,e);n.putImageData(o,0,0)}},n.Element.feColorMatrix.prototype=new n.Element.ElementBase,n.Element.feGaussianBlur=function(t){this.base=n.Element.ElementBase;this.base(t);this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue());this.extraFilterDistance=this.blurRadius;this.apply=function(t,i,r,u,f){if(typeof stackBlurCanvasRGBA=="undefined"){typeof console!="undefined"&&console.log("ERROR: StackBlur.js must be included for blur to work");return}t.canvas.id=n.UniqueId();t.canvas.style.display="none";document.body.appendChild(t.canvas);stackBlurCanvasRGBA(t.canvas.id,i,r,u,f,this.blurRadius);document.body.removeChild(t.canvas)}},n.Element.feGaussianBlur.prototype=new n.Element.ElementBase,n.Element.title=function(){},n.Element.title.prototype=new n.Element.ElementBase,n.Element.desc=function(){},n.Element.desc.prototype=new n.Element.ElementBase,n.Element.MISSING=function(n){typeof console!="undefined"&&console.log("ERROR: Element '"+n.nodeName+"' not yet implemented.")},n.Element.MISSING.prototype=new n.Element.ElementBase,n.CreateElement=function(t){var i=t.nodeName.replace(/^[^:]+:/,""),r;return i=i.replace(/\-/g,""),r=null,r=typeof n.Element[i]!="undefined"?new n.Element[i](t):new n.Element.MISSING(t),r.type=t.nodeName,r},n.load=function(t,i){n.loadXml(t,n.ajax(i))},n.loadXml=function(t,i){n.loadXmlDoc(t,n.parseXml(i))},n.loadXmlDoc=function(t,i){var u,r;n.init(t);u=function(n){for(var i=t.canvas;i;)n.x-=i.offsetLeft,n.y-=i.offsetTop,i=i.offsetParent;return window.scrollX&&(n.x+=window.scrollX),window.scrollY&&(n.y+=window.scrollY),n};n.opts.ignoreMouse!=!0&&(t.canvas.onclick=function(t){var i=u(new n.Point(t!=null?t.clientX:event.clientX,t!=null?t.clientY:event.clientY));n.Mouse.onclick(i.x,i.y)},t.canvas.onmousemove=function(t){var i=u(new n.Point(t!=null?t.clientX:event.clientX,t!=null?t.clientY:event.clientY));n.Mouse.onmousemove(i.x,i.y)});r=n.CreateElement(i.documentElement);r.root=!0;var e=!0,o=function(){var u,f;if(n.ViewPort.Clear(),t.canvas.parentNode&&n.ViewPort.SetCurrent(t.canvas.parentNode.clientWidth,t.canvas.parentNode.clientHeight),n.opts.ignoreDimensions!=!0&&(r.style("width").hasValue()&&(t.canvas.width=r.style("width").toPixels("x"),t.canvas.style.width=t.canvas.width+"px"),r.style("height").hasValue()&&(t.canvas.height=r.style("height").toPixels("y"),t.canvas.style.height=t.canvas.height+"px")),u=t.canvas.clientWidth||t.canvas.width,f=t.canvas.clientHeight||t.canvas.height,n.opts.ignoreDimensions==!0&&r.style("width").hasValue()&&r.style("height").hasValue()&&(u=r.style("width").toPixels("x"),f=r.style("height").toPixels("y")),n.ViewPort.SetCurrent(u,f),n.opts.offsetX!=null&&(r.attribute("x",!0).value=n.opts.offsetX),n.opts.offsetY!=null&&(r.attribute("y",!0).value=n.opts.offsetY),n.opts.scaleWidth!=null&&n.opts.scaleHeight!=null){var s=1,h=1,o=n.ToNumberArray(r.attribute("viewBox").value);r.attribute("width").hasValue()?s=r.attribute("width").toPixels("x")/n.opts.scaleWidth:isNaN(o[2])||(s=o[2]/n.opts.scaleWidth);r.attribute("height").hasValue()?h=r.attribute("height").toPixels("y")/n.opts.scaleHeight:isNaN(o[3])||(h=o[3]/n.opts.scaleHeight);r.attribute("width",!0).value=n.opts.scaleWidth;r.attribute("height",!0).value=n.opts.scaleHeight;r.attribute("viewBox",!0).value="0 0 "+u*s+" "+f*h;r.attribute("preserveAspectRatio",!0).value="none"}n.opts.ignoreClear!=!0&&t.clearRect(0,0,u,f);r.render(t);e&&(e=!1,typeof n.opts.renderCallback=="function"&&n.opts.renderCallback(i))},f=!0;n.ImagesLoaded()&&(f=!1,o());n.intervalID=setInterval(function(){var t=!1,i;if(f&&n.ImagesLoaded()&&(f=!1,t=!0),n.opts.ignoreMouse!=!0&&(t=t|n.Mouse.hasEvents()),n.opts.ignoreAnimation!=!0)for(i=0;i<n.Animations.length;i++)t=t|n.Animations[i].update(1e3/n.FRAMERATE);typeof n.opts.forceRedraw=="function"&&n.opts.forceRedraw()==!0&&(t=!0);t&&(o(),n.Mouse.runEvents())},1e3/n.FRAMERATE)},n.stop=function(){n.intervalID&&clearInterval(n.intervalID)},n.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!=0};this.onclick=function(n,t){this.events.push({type:"onclick",x:n,y:t,run:function(n){n.onclick&&n.onclick()}})};this.onmousemove=function(n,t){this.events.push({type:"onmousemove",x:n,y:t,run:function(n){n.onmousemove&&n.onmousemove()}})};this.eventElements=[];this.checkPath=function(n,t){for(var r,i=0;i<this.events.length;i++)r=this.events[i],t.isPointInPath&&t.isPointInPath(r.x,r.y)&&(this.eventElements[i]=n)};this.checkBoundingBox=function(n,t){for(var r,i=0;i<this.events.length;i++)r=this.events[i],t.isPointInBox(r.x,r.y)&&(this.eventElements[i]=n)};this.runEvents=function(){var t,r,i;for(n.ctx.canvas.style.cursor="",t=0;t<this.events.length;t++)for(r=this.events[t],i=this.eventElements[t];i;)r.run(i),i=i.parent;this.events=[];this.eventElements=[]}},n}this.canvg=function(t,i,r){var h,o,u,e,c,f,s;if(t==null&&i==null&&r==null){for(h=document.getElementsByTagName("svg"),o=0;o<h.length;o++)u=h[o],e=document.createElement("canvas"),e.width=u.clientWidth,e.height=u.clientHeight,u.parentNode.insertBefore(e,u),u.parentNode.removeChild(u),c=document.createElement("div"),c.appendChild(u),canvg(e,c.innerHTML);return}r=r||{};typeof t=="string"&&(t=document.getElementById(t));t.svg!=null&&t.svg.stop();f=n();t.childNodes.length==1&&t.childNodes[0].nodeName=="OBJECT"||(t.svg=f);f.opts=r;s=t.getContext("2d");typeof i.documentElement!="undefined"?f.loadXmlDoc(s,i):i.substr(0,1)=="<"?f.loadXml(s,i):f.load(s,i)}}();typeof CanvasRenderingContext2D!="undefined"&&(CanvasRenderingContext2D.prototype.drawSvg=function(n,t,i,r,u){canvg(this.canvas,n,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:t,offsetY:i,scaleWidth:r,scaleHeight:u})});jQuery(document).ready(function(n){"use strict";function et(p,b){function er(){function n(n){for(var t=0;t<vi.length;t++)vi[t].match(/scale/)?n.data(vi[t],1,!0):n.data(vi[t],0,!0)}if(g=SVG("svga-svgmain").attr({id:"svga-svgcanvas",width:null,height:null,"class":"svga-svg",viewBox:"0 0 200 200",preserveAspectRatio:"xMinYMin meet"}),g=g.group().attr("id","svga-group-wrapper"),k=g.group().attr("id","svga-group-backs-single"),g=g.group().attr({id:"svga-group-subwrapper",transform:"matrix(0.8, 0, 0, 0.8, 22, 40)"}),n(g),k=g.group().attr("id","svga-group-hair-back"),k=g.group().attr("id","svga-group-hats-back"),n(k),k=g.group().attr("id","svga-group-earings-back"),n(k),k=g.group().attr("id","svga-group-humanbody-single"),k=g.group().attr("id","svga-group-chinshadow-single"),k=g.group().attr("id","svga-group-clothes-single"),n(k),pt=g.group().attr("id","svga-group-head"),n(pt),k=g.group().attr("id","svga-group-ears-left"),n(k),pt.add(k),k=g.group().attr("id","svga-group-ears-right"),n(k),pt.add(k),k=g.group().attr("id","svga-group-faceshape-wrap"),dt=g.group().attr("id","svga-group-faceshape-single"),k.add(dt),n(k),n(dt),pt.add(k),k=g.group().attr("id","svga-group-mouth-single"),n(k),pt.add(k),k=g.group().attr("id","svga-group-freckles-single"),n(k),pt.add(k),k=g.group().attr("id","svga-group-eyes-left"),dt=g.group().attr("id","svga-group-eyesback-left"),ei=g.group().attr("id","svga-group-eyesiriswrapper-left"),ti=g.group().attr("id","svga-group-eyesiriscontrol-left"),oi=g.group().attr("id","svga-group-eyesiris-left"),wi=g.group().attr("id","svga-group-eyesfront-left"),ei.add(ti),ti.add(oi),k.add(dt).add(ei).add(wi),n(k),n(ti),n(oi),pt.add(k),k=g.group().attr("id","svga-group-eyes-right"),dt=g.group().attr("id","svga-group-eyesback-right"),ei=g.group().attr("id","svga-group-eyesiriswrapper-right"),ti=g.group().attr("id","svga-group-eyesiriscontrol-right"),oi=g.group().attr("id","svga-group-eyesiris-right"),wi=g.group().attr("id","svga-group-eyesfront-right"),ei.add(ti),ti.add(oi),k.add(dt).add(ei).add(wi),n(k),n(ti),n(oi),pt.add(k),k=g.group().attr("id","svga-group-facehighlight-single"),n(k),pt.add(k),k=g.group().attr("id","svga-group-eyebrows-left"),n(k),pt.add(k),k=g.group().attr("id","svga-group-eyebrows-right"),n(k),pt.add(k),k=g.group().attr("id","svga-group-nose-single"),n(k),pt.add(k),p==="boys"&&(k=g.group().attr("id","svga-group-beardwrap"),dt=g.group().attr("id","svga-group-beard-single"),k.add(dt),n(k),n(dt),pt.add(k),k=g.group().attr("id","svga-group-mustache-single"),n(k),pt.add(k)),k=g.group().attr("id","svga-group-necklaces-back"),n(k),k=g.group().attr("id","svga-group-necklaces-front"),n(k),k=g.group().attr("id","svga-group-earings-front"),n(k),pt.add(k),k=g.group().attr("id","svga-group-hair-front"),n(k),pt.add(k),k=g.group().attr("id","svga-group-glasses-single"),k=g.group().attr("id","svga-group-hats-front"),n(k),pt.add(k),nt){g=SVG.get("svga-group-wrapper");at=g.rect(200,15).move(0,185).fill("#ecf0f1").opacity(.5);lt=g.text(nt).font({family:'"Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif',size:"0.84em",anchor:"middle",weight:400}).fill("#000");var t=lt.bbox().width;lt.move((200-t)/2,185);at.hide();lt.hide()}}function rr(n,t,i,r){for(var y=b[t],l=y.shapes[i][r],u,f,s,a,v,c,e,o=0;o<l.length;o++){if(u=l[o],f=n.path(u.path,!0),f.data("colored",u.colored,!0),f.data("transparence",u.transparence,!0),f.data("filltype",u.fill),f.data("stroketype",u.stroke),u.fromskin&&f.data("fromskin",u.fromskin,!0),f.data("colored")===!0){s=u.fromskin?"faceshape":t;var p=f.data("filltype"),h=!1,w=si(p,s,h);f.attr("fill",w);a=f.data("stroketype");v=si(a,s,h);f.attr({stroke:v,"stroke-width":u.strokeWidth,"stroke-linecap":u.strokeLinecap,"stroke-linejoin":u.strokeLinejoin,"stroke-miterlimit":u.strokeMiterlimit})}else u.fill==="gradient"?(ui?dr("svga-on-canvas-"+t+"-gradient-"+r+"-"+o):(c=document.getElementById("svga-"+t+"-gradient-"+r+"-"+i+"-"+o),c&&kr(c)),e=n.gradient(u.type,function(n){for(var r,f,o,e,i=0;i<u.gradientStops.length;i++)r=u.gradientStops[i].color,h=!0,f=u.fromskin?"faceshape":t,o=si(r,f,h),e=n.at(u.gradientStops[i]),e.update({color:o}),e.data("stoptype",r)}),u.x1&&e.attr({x1:u.x1}),u.y1&&e.attr({y1:u.y1}),u.x2&&e.attr({x2:u.x2}),u.y2&&e.attr({y2:u.y2}),u.cx&&e.attr({cx:u.cx}),u.cy&&e.attr({cy:u.cy}),u.fx&&e.attr({fx:u.fx}),u.fy&&e.attr({fy:u.fy}),u.r&&e.attr({r:u.r}),u.gradientTransform&&e.attr({gradientTransform:u.gradientTransform}),u.gradientUnits&&e.attr({gradientUnits:u.gradientUnits}),ui?e.attr("class","svga-on-canvas-"+t+"-gradient-"+r+"-"+o):e.attr("id","svga-"+t+"-gradient-"+r+"-"+i+"-"+o),f.attr({fill:e})):(f.attr({fill:u.fill}),f.attr({stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-linecap":u.strokeLinecap,"stroke-linejoin":u.strokeLinejoin,"stroke-miterlimit":u.strokeMiterlimit}));u.opacity&&f.attr({opacity:u.opacity});ui&&(u.id&&f.attr("id",u.id+"-"+r),t=="eyesback"&&SVG.get("svga-group-eyesiriswrapper-"+r).transform({x:0,y:0}),(u.irisx||u.irisy)&&SVG.get("svga-group-eyesiriswrapper-"+r).move(u.irisx,u.irisy),t==="hair"&&u.hideears?(SVG.get("svga-group-ears-left").hide(),SVG.get("svga-group-ears-right").hide()):t==="hair"&&(SVG.get("svga-group-ears-left").show(),SVG.get("svga-group-ears-right").show()));!ui&&u.hideonthumbs&&f.remove();ui&&u.hideoncanvas&&f.remove()}}function si(n,t,u){var f;switch(n){case"none":f="none";break;case"tone":f=yt[t];break;case"hl05":f=ri(yt[t],-.5*i,.5*r);break;case"hl1":f=ri(yt[t],-i,r);break;case"hl2":f=ri(yt[t],-2*i,2*r);break;case"sd05":f=ri(yt[t],.5*i,-.5*r);break;case"sd1":f=ri(yt[t],i,-r);break;case"sd2":f=ri(yt[t],2*i,-2*r);break;case"sd3":f=ri(yt[t],3*i,-3*r);break;case"sd35":f=ri(yt[t],3.5*i,-3.5*r);break;default:f=yt[t];u&&(f=n)}return f}function ii(n,t){for(var u=n.length,r,f,i=0;i<u;i++){u>1&&n[i]!=="mouth"&&n[i]!=="eyesfront"?yt[n[i]]=t:yt[et]=t;r=n[i]==="facehighlight"||n[i]==="humanbody"?0:ci[n[i]];for(vt in b[n[i]].shapes[r])b[n[i]].shapes[r].hasOwnProperty(vt)&&(f=SVG.get("svga-group-"+n[i]+"-"+vt),f.each(function(){var e,o,r,u,t;if(this.data("colored")){t=this.data("fromskin")==!0?"faceshape":n[i];var s=this.data("filltype"),f=!1,h=si(s,t,f);this.attr("fill",h);e=this.data("stroketype");o=si(e,t,f);this.stroke(o)}else this.data("filltype")=="gradient"&&(r=this.attr("fill"),r=r.replace(/url\(\#/,"").replace(/\)/,""),u=SVG.get(r),u&&(t=this.data("fromskin")===!0?"faceshape":n[i],u.each(function(){var n=this.data("stoptype"),i=si(n,t,!0);this.update({color:i})})))}))}}function or(n){var i=tinycolor(n).toHexString(),t;switch(et){case"faceshape":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;case"ears":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;case"nose":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;default:t=[et];ii(t,i)}}function ar(){if(ki)return!1;var i=n(".svga-blocks.svga-active"),r=n(".svga-bodyzones.svga-active"),t;i.data("blockname")=="eyes"&&r.data("bodyzone")=="eyesiris"&&(t=ai.find("[data-block=eyes][data-zone=eyesiris]"));i.data("blockname")=="face"&&r.data("bodyzone")=="mouth"&&(t=ai.find("[data-block=face][data-zone=mouth]"));i.data("blockname")=="accessories"&&r.data("bodyzone")=="hats"&&(t=ai.find("[data-block=accessories][data-zone=hats]"));t!==undefined&&(t.is(".dismissed")||vr(t))}function vr(t){var i=n("."+t.data("anchor"));ki=!0;i.css({display:"block",position:"relative"});setTimeout(function(){var n=t.clone();n.appendTo(i);setTimeout(function(){n.addClass("visible")},100)},6900)}function ur(){yt=p==="boys"?{backs:"#ecf0f1",humanbody:"#f0c7b1",clothes:"#386e77",hats:"#fff",earings:"#fff",necklaces:"#fff",hair:"#2a232b",ears:"#f0c7b1",freckles:"#623f00",faceshape:"#f0c7b1",chinshadow:"#f0c7b1",facehighlight:"#f0c7b1",eyebrows:"#2a232b",eyesback:"#000000",eyesfront:"#000000",eyesiris:"#4e60a3",glasses:"#26120B",mustache:"#2a232b",beard:"#2a232b",mouth:"#e0a4a0"}:{backs:"#ecf0f1",humanbody:"#F3D4CF",clothes:"#09aac5",hats:"#fff",earings:"#fff",necklaces:"#fff",hair:"#2a232b",ears:"#F3D4CF",freckles:"#623f00",faceshape:"#F3D4CF",chinshadow:"#F3D4CF",facehighlight:"#F3D4CF",eyebrows:"#2a232b",eyesback:"#000000",eyesfront:"#000000",eyesiris:"#4e60a3",glasses:"#26120B",mouth:"#da7c87"};n("#svga-svgmain").empty();er();for(var t in b)ct=0,b.hasOwnProperty(t)&&n("#svga-elements-"+t+"-"+ct).trigger("click");n("#svga-colors-faceshape > div:nth-child(1)").trigger("click");ut=2;pi=!1}function sr(){var f,e,r,u,t,i;ur();e=wt(0,19);wt(0,2)>1&&(wt(0,1)===0?(r=!0,u=!1):(r=!1,u=!0));for(t in b)if(i=!1,b.hasOwnProperty(t)){switch(t){case"ears":i=wt(0,6);break;case"eyesiris":i=wt(0,7);break;case"hair":i=p==="boys"?wt(0,17):wt(0,14);break;case"mustache":r&&(i=wt(1,12));break;case"beard":u&&(i=wt(1,12));break;case"glasses":wt(0,2)>1&&(i=wt(0,17));break;default:i=wt(0,14)}f=wt(0,19);i&&(t==="hair"||t==="mustache"||t==="beard"||t==="eyebrows"?(n("#svga-elements-"+t+"-"+i).trigger("click"),et=t,n("#svga-colors-"+et+" > div:nth-child("+e+")").trigger("click")):(n("#svga-elements-"+t+"-"+i).trigger("click"),et=t,n("#svga-colors-"+et+" > div:nth-child("+f+")").trigger("click")))}n("#svga-blocks-face").trigger("click");n("#svga-bodyzones-faceshape").trigger("click");ut=2;pi=!0}function fi(t){n("#svga-loader").hide();n("#svga-gravatar-message-text").html(t).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-gravatar-message").fadeIn("fast")}function yr(){var t=n("#svga-share-image img")[0].src;window.open("https://www.facebook.com/dialog/feed?app_id="+st+"&link="+encodeURIComponent(a)+"&picture="+encodeURIComponent(t)+"&name="+encodeURIComponent(y)+"&display=popup&description="+encodeURIComponent(ht)+"&redirect_uri=https://www.facebook.com","Facebook","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}function pr(){window.open("https://twitter.com/intent/tweet?original_referer="+encodeURIComponent(a)+"&text="+encodeURIComponent(y)+"%20"+encodeURIComponent(a),"Twitter","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}function wr(){var t=n("#svga-share-image img")[0].src;window.open("//pinterest.com/pin/create/button/?url="+encodeURIComponent(a)+"&media="+encodeURIComponent(t)+"&description="+encodeURIComponent(y),"Pinterest","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}function br(){window.open("//plus.google.com/share?url="+encodeURIComponent(a),"GooglePlus","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}function di(n,t){function r(n){this.url=n;this.fileRequest=function(t,i){var u,f,r;n&&(u=document.createElement("input"),u.setAttribute("name","filename"),u.setAttribute("value",t),f=document.createElement("input"),f.setAttribute("name","filetype"),f.setAttribute("value",i),r=document.createElement("form"),r.method="get",r.action=n,r.target="_top",r.appendChild(u),r.appendChild(f),document.body.appendChild(r),r.submit(),document.body.removeChild(r))}}var i=new r(u+"php/download-temp-avatar.php");i.fileRequest(n,t)}function kr(n){n.parentNode.removeChild(n)}function dr(n){for(var t=document.getElementsByClassName(n);t.length>0;)t[0].parentNode.removeChild(t[0])}function ri(n,t,i){var r=tinycolor(n).toHsv();return r.s=r.s+t,r.s<0&&(r.s=0),r.s>1&&(r.s=1),r.v=r.v+i,r.v<0&&(r.v=0),r.v>1&&(r.v=1),tinycolor(r).toHexString()}function wt(n,t){return Math.floor(Math.random()*(t-n+1))+n}var yt,hi,kt,bt,ft,bi,tr,li,ct,rt,vt,ir,gt,ai,ki;if(p==="boys")yt={backs:"#ecf0f1",humanbody:"#f0c7b1",clothes:"#386e77",hair:"#2a232b",hats:"#2a232c",ears:"#f0c7b1",freckles:"#623f00",faceshape:"#f0c7b1",chinshadow:"#f0c7b1",facehighlight:"#f0c7b1",eyebrows:"#624f3f",eyesback:"#000000",eyesfront:"#c38372",eyesiris:"#4e60a3",glasses:"#26120B",mustache:"#2a232b",beard:"#2a232b",mouth:"#e0a4a0"},n("#svga-container").addClass("svga-boys");else if(p==="girls")yt={backs:"#ecf0f1",humanbody:"#F3D4CF",clothes:"#09aac5",hats:"#2a232c",hair:"#2a232b",ears:"#F3D4CF",freckles:"#623f00",faceshape:"#F3D4CF",chinshadow:"#F3D4CF",facehighlight:"#F3D4CF",eyebrows:"#624f3f",eyesback:"#000000",eyesfront:"#c38372",eyesiris:"#4e60a3",glasses:"#26120B",mouth:"#e0a4a0"},n("#svga-container").addClass("svga-girls");else return;hi=["face","eyes","hair","clothes","accessories","backs"];kt=p==="boys"?["backs","faceshape","chinshadow","facehighlight","humanbody","clothes","hats","earings","necklaces","hair","freckles","ears","eyebrows","eyesback","eyesiris","eyesfront","glasses","mouth","mustache","beard","nose"]:["backs","faceshape","chinshadow","facehighlight","humanbody","clothes","hats","earings","necklaces","hair","freckles","ears","eyebrows","eyesback","eyesiris","eyesfront","glasses","mouth","nose"];var vi=["updown","leftright","dist","scaleX","scaleY","rotate"],ci={},ni={up:"M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M11.1,9.4l-2.3-2v4.4H7V7.4l-2.3,2V7l3.2-2.9L11.1,7V9.4z",down:"M8,16c4.4,0,8-3.6,8-8s-3.6-8-8-8S0,3.6,0,8S3.6,16,8,16z M4.9,6.6l2.3,2V4.2H9v4.4l2.3-2V9l-3.2,2.9L4.9,9V6.6z",left:"M0,8c0,4.4,3.6,8,8,8s8-3.6,8-8s-3.6-8-8-8S0,3.6,0,8z M9.4,4.9l-2,2.3h4.4V9H7.4l2,2.3H7L4.2,8.1L7,4.9H9.4z",right:"M16,8c0-4.4-3.6-8-8-8S0,3.6,0,8s3.6,8,8,8S16,12.4,16,8z M6.6,11.1l2-2.3H4.2V7h4.4l-2-2.3H9l2.9,3.2L9,11.1H6.6z",tightly:"M12.594,8l3.241,3.205c0.22,0.216,0.22,0.567,0,0.783l-0.858,0.85c-0.219,0.217-0.575,0.217-0.795,0L9.683,8.393c-0.221-0.216-0.221-0.568,0-0.785l4.499-4.445c0.22-0.217,0.576-0.217,0.795,0l0.858,0.849c0.22,0.217,0.22,0.568,0,0.785L12.594,8z M0.164,11.205c-0.219,0.216-0.219,0.567,0,0.783l0.859,0.85c0.221,0.217,0.575,0.217,0.795,0l4.499-4.445c0.22-0.217,0.22-0.568,0-0.785L1.818,3.163c-0.221-0.217-0.576-0.217-0.795,0L0.164,4.012c-0.219,0.217-0.219,0.568,0,0.785L3.405,8L0.164,11.205z",wider:"M3.039,8.001l3.203,3.203c0.217,0.216,0.217,0.567,0,0.784l-0.85,0.85c-0.217,0.217-0.567,0.217-0.785,0L0.163,8.393c-0.217-0.216-0.217-0.568,0-0.785l4.444-4.445c0.218-0.217,0.568-0.217,0.785,0l0.85,0.849c0.217,0.217,0.217,0.568,0,0.785L3.039,8.001z M9.758,11.204c-0.217,0.216-0.217,0.567,0,0.784l0.85,0.849c0.217,0.218,0.568,0.218,0.785,0l4.445-4.444c0.217-0.218,0.217-0.568,0-0.785l-4.445-4.445c-0.219-0.217-0.568-0.217-0.785,0l-0.85,0.849c-0.217,0.217-0.217,0.568,0,0.785l3.203,3.204L9.758,11.204z",scaledown:"M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M11.8,9H9H7H4.2V7H7h2h2.8V9z",scaleup:"M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M11.8,9H9v2.8H7V9H4.2V7H7V4.2h2V7h2.8V9z",eb1:"M5.453,8.316C5.129,7.499,4.146,6.352,1.492,5.521C1.087,5.393,0.868,4.982,1.003,4.602c0.135-0.379,0.572-0.586,0.98-0.458c2.996,0.938,4.917,2.505,5.015,4.088c0.026,0.4-0.3,0.767-0.728,0.767C5.875,8.998,5.531,8.514,5.453,8.316z M9.021,8.313C8.66,8.077,8.593,7.626,8.841,7.301c0.983-1.288,3.5-1.651,6.569-0.948c0.415,0.095,0.669,0.489,0.567,0.877c-0.102,0.39-0.518,0.628-0.937,0.533c-2.718-0.623-4.315-0.188-4.939,0.282C9.908,8.191,9.5,8.625,9.021,8.313z",eb2:"M9.729,8.998c-0.428,0-0.753-0.366-0.728-0.767c0.098-1.583,2.02-3.149,5.016-4.088c0.407-0.128,0.845,0.079,0.979,0.458c0.136,0.38-0.083,0.792-0.488,0.919c-2.654,0.831-3.638,1.978-3.961,2.796C10.469,8.514,10.125,8.998,9.729,8.998z M5.898,8.045C5.274,7.576,3.677,7.141,0.959,7.764C0.54,7.858,0.124,7.62,0.022,7.23C-0.079,6.842,0.175,6.448,0.59,6.353c3.069-0.703,5.586-0.34,6.569,0.948c0.248,0.325,0.181,0.776-0.18,1.012C6.5,8.625,6.092,8.191,5.898,8.045z",eb3:"M5.453,8.316C5.129,7.499,4.146,6.352,1.492,5.521C1.087,5.393,0.868,4.982,1.003,4.602c0.135-0.379,0.572-0.586,0.98-0.458c2.996,0.938,4.917,2.505,5.015,4.088c0.026,0.4-0.3,0.767-0.728,0.767C5.875,8.998,5.531,8.514,5.453,8.316z M9.729,8.998c-0.428,0-0.753-0.366-0.728-0.767c0.098-1.583,2.02-3.149,5.016-4.088c0.407-0.128,0.845,0.079,0.979,0.458c0.136,0.38-0.083,0.792-0.488,0.919c-2.654,0.831-3.638,1.978-3.961,2.796C10.469,8.514,10.125,8.998,9.729,8.998z",eb4:"M5.728,6.662C4.873,6.458,3.369,6.605,1.166,8.303C0.829,8.562,0.367,8.506,0.133,8.176C-0.1,7.848-0.019,7.371,0.32,7.111C2.807,5.195,5.192,4.52,6.545,5.348c0.343,0.208,0.456,0.685,0.211,1.036C6.528,6.708,5.935,6.711,5.728,6.662z M9.244,6.383C8.999,6.033,9.111,5.556,9.455,5.348c1.353-0.828,3.737-0.152,6.225,1.764c0.339,0.26,0.421,0.737,0.187,1.065c-0.233,0.33-0.695,0.386-1.032,0.127c-2.203-1.698-3.707-1.845-4.563-1.641C10.065,6.712,9.471,6.708,9.244,6.383z",ebcancel:"M11.294,3.091l1.617,1.615c0.119,0.12,0.119,0.315,0,0.436L10.052,8l2.858,2.858c0.12,0.12,0.12,0.314,0.001,0.435l-1.617,1.618c-0.12,0.119-0.314,0.119-0.435-0.001l-2.858-2.859l-2.86,2.86c-0.12,0.119-0.314,0.119-0.435-0.001L3.09,11.293c-0.12-0.12-0.12-0.314,0-0.435L5.949,8L3.09,5.142c-0.12-0.12-0.12-0.315,0-0.436l1.616-1.615c0.12-0.121,0.314-0.121,0.435,0l2.86,2.858l2.858-2.858C10.979,2.97,11.174,2.97,11.294,3.091z",tiltleft:"M13.399,10h-0.851c-0.165,0-0.299-0.135-0.31-0.3C12.085,7.494,10.244,5.75,8,5.75c-1.393,0-2.627,0.67-3.402,1.705l1.335,1.333C6.049,8.904,6.01,9,5.845,9H2.3C2.135,9,2,8.865,2,8.699V5.156C2,4.99,2.095,4.951,2.212,5.068l1.354,1.354C4.611,5.129,6.208,4.3,8,4.3c3.047,0,5.535,2.393,5.691,5.4C13.7,9.865,13.564,10,13.399,10z",tiltright:"M2.309,9.7C2.465,6.693,4.953,4.3,8,4.3c1.792,0,3.389,0.829,4.434,2.122l1.354-1.354C13.905,4.951,14,4.99,14,5.156v3.543C14,8.865,13.865,9,13.7,9h-3.545C9.99,9,9.951,8.904,10.067,8.787l1.335-1.333C10.627,6.42,9.393,5.75,8,5.75c-2.244,0-4.085,1.744-4.239,3.95C3.75,9.865,3.616,10,3.451,10h-0.85C2.435,10,2.3,9.865,2.309,9.7z",back:"M1.17,6.438l4.406,4.428C5.811,11.1,6,11.021,6,10.689V8c0,0,8,0,8,7C14,3,6,4,6,4V1.311c0-0.332-0.189-0.41-0.424-0.176L1.17,5.563C0.943,5.805,0.943,6.197,1.17,6.438z",forward:"M14.829,6.438l-4.405,4.428C10.189,11.1,10,11.021,10,10.689V8c0,0-8,0-8,7C2,3,10,4,10,4V1.311c0-0.332,0.189-0.41,0.424-0.176l4.405,4.429C15.057,5.805,15.057,6.197,14.829,6.438z",random:"M24.311,14.514c-0.681,0-1.225,0.553-1.318,1.227c-0.599,4.243-4.245,7.512-8.655,7.512c-2.86,0-6.168-2.057-7.711-4.112l-3.655-4.412c-0.196-0.205-0.547-0.292-0.74-0.131C2.107,14.702,2,14.833,2,14.974v9.503c0,0.339,0.194,0.42,0.436,0.181l2.782-2.782c2.149,2.658,5.436,4.358,9.119,4.358c6.056,0,11.04-4.594,11.657-10.489c0.072-0.678-0.488-1.231-1.169-1.231H24.311z M3.689,13.486c0.681,0,1.225-0.553,1.319-1.227c0.598-4.243,4.245-7.512,8.654-7.512c2.861,0,5.816,1.542,7.71,4.112l3.655,4.412c0.195,0.205,0.547,0.293,0.739,0.13C25.893,13.299,26,13.167,26,13.026V3.522c0-0.339-0.195-0.419-0.437-0.181l-2.782,2.784c-2.149-2.659-5.435-4.36-9.119-4.36c-6.056,0-11.04,4.595-11.656,10.49c-0.072,0.678,0.488,1.231,1.169,1.231H3.689z M15.277,16.982h-1.896l-0.006-0.231c-0.026-1.809,1.087-2.446,2.282-3.581c1.224-1.162-0.229-2.5-1.542-2.339c-0.789,0.097-1.337,0.646-1.574,1.385c-0.166,0.517-0.158,0.653-0.158,0.653l-1.744-0.545c0.051-0.838,0.446-1.583,1.071-2.137c1.202-1.06,3.252-1.16,4.651-0.442c1.418,0.727,2.229,2.522,1.196,3.913C16.638,14.899,15.247,15.266,15.277,16.982z M13.382,19.719v-1.977h1.974v1.977H13.382z",reset:"M5.515,5.515c-4.686,4.686-4.686,12.284,0,16.971c4.687,4.687,12.284,4.686,16.971,0c4.687-4.687,4.687-12.284,0-16.971C17.799,0.829,10.201,0.828,5.515,5.515z M6.929,6.929C10.595,3.263,16.4,3.04,20.328,6.258L6.257,20.328C3.04,16.4,3.263,10.595,6.929,6.929z M21.071,21.071c-3.667,3.666-9.471,3.89-13.4,0.671l14.071-14.07C24.961,11.601,24.737,17.405,21.071,21.071z",save:"M25.64,7.142l-4.761-4.779C20.679,2.162,20.282,2,20,2H3.026C2.458,2,2,2.459,2,3.027v21.946C2,25.539,2.458,26,3.026,26h21.947C25.541,26,26,25.539,26,24.974V8.02C26,7.736,25.839,7.341,25.64,7.142z M14,4v5h-4V4H14z M20,24H8v-8h12V24z M24,24h-2v-8.973C22,14.461,21.541,14,20.969,14H7.027C6.458,14,6,14.461,6,15.027V24H4V4h2v4.97C6,9.538,6.458,10,7.027,10h7.862C15.456,10,16,9.538,16,8.97V4h3.146c0.281,0,0.674,0.162,0.873,0.363l3.623,3.257C23.838,7.817,24,8.212,24,8.495V24z M19,18H9v-1h10V18z M19,20H9v-1h10V20z M19,22H9v-1h10V22z",download:"M28,24.8c0,0.663-0.537,1.2-1.2,1.2H1.2C0.537,26,0,25.463,0,24.8v-4.2C0,20.293,0.297,20,0.6,20H3.4C3.703,20,4,20.293,4,20.6V22h20v-1.4c0-0.307,0.299-0.6,0.601-0.6h2.8c0.302,0,0.6,0.293,0.6,0.6V24.8z M14.873,19.658l8.857-8.811C24.199,10.379,24.043,10,23.379,10H18V3.2C18,2.538,17.463,2,16.801,2H11.2C10.537,2,10,2.538,10,3.2V10H4.621c-0.662,0-0.82,0.379-0.352,0.848l8.855,8.811C13.607,20.113,14.391,20.113,14.873,19.658z",gravatar:"M16.39,7.2c0,0.19,0,5.34,0,5.53c-0.03,3.21-4.73,3.26-4.76,0.04c-0.01-1.37-0.01-7.55,0-8.25c0.01-1.54,1.01-2.53,2.54-2.52c5.75,0.05,10.74,4.38,11.62,10.07c1.01,6.54-3.25,12.55-9.72,13.74c-10.9,2-18.81-11.34-10.64-20.16c2.23-2.4,5.84,0.85,3.56,3.24C4.1,14,8.12,21.58,14.54,21.13C22.24,20.58,23.72,9.79,16.39,7.2z",share:"M21.32,19.51l-3.7-2.61c0.66-1.59,0.46-3.4-0.58-4.83l3.01-3.4C22.39,9.74,25,8.03,25,5.5C25,3.57,23.43,2,21.5,2c-2.74,0-4.43,3.03-2.95,5.37l-2.98,3.36c-1.51-0.91-3.33-1.01-5-0.07L7.62,7.44C7.85,7.01,8,6.52,8,6c0-3.96-6-3.97-6,0c0,2.14,2.17,3.59,4.15,2.77l2.91,3.19c-1.41,1.82-1.41,4.25-0.02,6.07l-2.8,3.1C4.57,20.6,3,21.87,3,23.5C3,24.88,4.12,26,5.5,26c1.8,0,3.06-1.87,2.25-3.57l2.8-3.1c2.08,1.18,4.46,0.72,5.97-0.79l3.63,2.56C18.74,25.57,26,26.53,26,22C26,19.58,23.29,18.18,21.32,19.51z",facebook:"M27 2H5C3.34 2 2 3.34 2 5v22c0 1.66 1.34 3 3 3h22c1.66 0 3-1.34 3-3V5C30 3.34 28.66 2 27 2zM23.66 16.11h-3.28V28h-4.92V16.11H13v-4.1h2.46c0-3.5-0.53-7.79 5.33-7.79h3.28v4.1c-4.09 0-3.68-0.32-3.7 3.69h3.72L23.66 16.11z",twitter:"M27 2H5C3.34 2 2 3.34 2 5v22c0 1.66 1.34 3 3 3h22c1.66 0 3-1.34 3-3V5C30 3.34 28.66 2 27 2zM24.75 11.57c0.26 6.54-4.58 13.43-12.83 13.43 -3.9 0-6.55-1.75-6.92-2.03 3.58 0.47 6.14-1.37 6.68-1.87 -2.1 0.04-3.84-1.7-4.22-3.13 1.02 0.24 2.04-0.08 2.04-0.08 -2.49-0.5-3.68-2.79-3.62-4.48 0.77 0.4 1.32 0.5 2.04 0.56 -1.74-1.17-2.74-3.73-1.4-6.03 3.69 4.4 8.37 4.67 9.3 4.72 -0.86-4.93 4.74-7.25 7.69-4.12 1.03-0.2 1.99-0.58 2.86-1.09 -0.34 1.05-1.05 1.94-1.98 2.5C25.32 9.84 26.19 9.6 27 9.24 26.39 10.14 25.63 10.94 24.75 11.57z",googleplus:"M12.22 11.62c-0.43-3.29-2.83-5.94-5.34-6.01 -2.52-0.07-4.2 2.45-3.77 5.74C4.17 19.41 13.24 19.4 12.22 11.62zM30 10V5c0-1.7-1.3-3-3-3H5C3.3 2 2 3.3 2 5c0 0 0.02 0.88 0 1.54C5.68 3.3 7.72 3.96 17.87 3.96l-2.19 1.85h-3.1c2.72 1.04 5.92 6.4 0.39 10.71 -1.58 1.23-1.88 1.74-1.88 2.78 0 0.89 1.69 2.41 2.57 3.03 2.58 1.82 3.42 3.51 3.42 6.33 0 0.45-0.05 0.9-0.17 1.34H27c1.7 0 3-1.3 3-3V12h-6v6h-2v-6h-6v-2h6V4h2v6H30zM8.78 22.93C7.5 21.7 7 20.2 7.94 18.42 7.4 18.5 4.23 18.6 2 16.7v7.36C4.83 22.71 8.78 22.93 8.78 22.93zM2 26.45v0.7C2 28.85 3.3 30 5 30h9.5C15.46 24.15 6.21 21.86 2 26.45z",pinterest:"M27 2H5C3.34 2 2 3.34 2 5v22c0 1.66 1.34 3 3 3h22c1.66 0 3-1.34 3-3V5C30 3.34 28.66 2 27 2zM17.36 20.23c-1.28-0.1-1.81-0.73-2.82-1.34C14 21.78 13.32 24.55 11.33 26c-0.62-4.37 0.9-7.65 1.61-11.13 -1.2-2.03 0.15-6.1 2.68-5.1 3.12 1.24-2.71 7.53 1.21 8.32 4.09 0.82 5.75-7.09 3.22-9.66 -3.66-3.71-10.66-0.08-9.8 5.23 0.21 1.3 1.55 1.69 0.54 3.49C5.64 16 7.18 5.94 14.95 5.07 27.93 3.62 25.78 20.89 17.36 20.23L17.36 20.23z"},hr=["up","down","left","right","tightly","wider","scaledown","scaleup","eb1","eb2","eb3","eb4","ebcancel"],cr=["up","down","left","right","scaledown","scaleup","tiltleft","tiltright"],gi=["random","reset","save","share","gravatar","download"],nr=["facebook","twitter","pinterest","googleplus"],lr=["#385997","#19A6CA","#CB2028","#D33D2C"],fr={backs:"backs",face:"faceshape",eyes:"eyesfront",hair:"hair",clothes:"clothes",accessories:"accessories"},ut=1,ui=!1,et="faceshape",yi,pi=!1,k,dt,ei,ti,oi,wi,g,pt,at,lt;for(er(),rt=0;rt<hi.length;rt++)n("#svga-blocks").append('<div id="svga-blocks-'+hi[rt]+'" class="svga-blocks" data-blockname="'+hi[rt]+'">'+block_titles[hi[rt]]+"<\/div>");n(".svga-blocks:last").addClass("svga-last");n("#svga-blocks-backs").data("bodyzones","backs");n("#svga-blocks-face").data("bodyzones","faceshape,nose,mouth,freckles");n("#svga-blocks-eyes").data("bodyzones","eyesfront,eyesiris,eyebrows,glasses");p==="boys"?n("#svga-blocks-hair").data("bodyzones","hair,ears,mustache,beard"):n("#svga-blocks-hair").data("bodyzones","hair,ears");n("#svga-blocks-clothes").data("bodyzones","clothes");n("#svga-blocks-accessories").data("bodyzones","hats,earings,necklaces");for(ft in b)b.hasOwnProperty(ft)&&(n("#svga-bodyzones").append('<div id="svga-bodyzones-'+ft+'" class="svga-bodyzones" data-bodyzone="'+ft+'" data-controls="'+b[ft].controls+'" data-block="'+b[ft].block+'">'+body_zone_titles[ft]+"<\/div>"),n("#svga-bodyzones-"+ft).hide());for(bt in ni)ni.hasOwnProperty(bt)&&hr.indexOf(bt)>-1&&(n("#svga-controls").append('<div id="svga-controls-'+bt+'" class="svga-controls"><svg class="svga-control-icon" xmlns="http://www.w3.org/2000/svg" version="1.1" xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" preserveAspectRatio="xMinYMin meet"><path class="svga-control-icon-path" d="'+ni[bt]+'"/><\/svg><\/div>'),n("#svga-controls-"+bt).hide());for(bt in ni)ni.hasOwnProperty(bt)&&cr.indexOf(bt)>-1&&n("#svga-glob-controls").append('<div id="svga-glob-controls-'+bt+'" class="svga-glob-controls"><svg class="svga-control-icon" xmlns="http://www.w3.org/2000/svg" version="1.1" xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" preserveAspectRatio="xMinYMin meet"><path class="svga-control-icon-path" d="'+ni[bt]+'"/><\/svg><\/div>');for(rt=0;rt<gi.length;rt++)n("#svga-"+gi[rt]+"avatar > div").append('<svg class="svga-menu-icon" xmlns="http://www.w3.org/2000/svg" version="1.1" xlink="http://www.w3.org/1999/xlink" viewBox="0 0 28 28" preserveAspectRatio="xMinYMin meet"><path class="svga-menu-icon-path" d="'+ni[gi[rt]]+'"/><\/svg>');for(rt=0;rt<nr.length;rt++)n("#svga-"+nr[rt]+"-icon").append('<svg class="svga-share-icons" xmlns="http://www.w3.org/2000/svg" version="1.1" xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" preserveAspectRatio="xMinYMin meet"><path class="svga-share-icons-path" fill="'+lr[rt]+'" d="'+ni[nr[rt]]+'"/><\/svg>');for(ft in b)if(b.hasOwnProperty(ft)){for(bi=b[ft].scaleFactor,tr=b[ft].colors,n("#svga-elements").append('<div class="svga-elements-wrap" id="svga-elements-'+ft+'"><\/div>'),rt=0;rt<b[ft].shapes.length;rt++){n("#svga-elements-"+ft).append('<div class="svga-elements" id="svga-elements-'+ft+"-"+rt+'" data-zone="'+ft+'" data-shape="'+rt+'"><\/div>');gt=SVG("svga-elements-"+ft+"-"+rt).size("100%","100%").attr({id:"svga-svgcanvas-elements-"+ft+"-"+rt,width:null,height:null,"class":"svga-svg",viewBox:"0 0 200 200",preserveAspectRatio:"xMinYMin meet"}).group();ct=rt;for(vt in b[ft].shapes[ct])b[ft].shapes[ct].hasOwnProperty(vt)&&(vt==="right"||vt==="single"||vt==="back"||vt==="front")&&(b[ft].shapes[ct][vt].length?(rr(gt,ft,ct,vt),gt.scale(bi),li=gt.bbox(),gt.move(-li.x*bi+(200-li.width)/2,-li.y*bi+(200-li.height)/2),ft==="clothes"&&gt.move(10,5),ft==="hair"&&ct>0&&gt.move(0,20)):n("#svga-elements-"+ft+"-"+rt).empty().append("<div><\/div>").addClass("empty"))}for(n("#svga-elements-"+ft).hide(),n("#svga-colors").append('<div id="svga-colors-'+ft+'" class="svga-colors-set"><\/div>'),rt=0;rt<tr.length;rt++)n("#svga-colors-"+ft).append("<div><\/div>"),n("#svga-colors-"+ft+" div:last-child").css("background-color",tr[rt]);n("#svga-colors-"+ft).hide()}for(n("#svga-custom-color").hide(),ct=0,rt=0;rt<kt.length;rt++){(kt[rt]==="backs"||kt[rt]==="hair")&&(ct=1);for(vt in b[kt[rt]].shapes[ct])b[kt[rt]].shapes[ct].hasOwnProperty(vt)&&(ir="svga-group-"+kt[rt]+"-"+vt,n("#"+ir).empty(),gt=SVG.get(ir),ui=!0,rr(gt,kt[rt],ct,vt));ci[kt[rt]]=ct;ct=0}n(".svga-colors-set > div").click(function(){var r=n(this),i,t;r.siblings().removeClass("svga-active");r.addClass("svga-active");ct=0;i=r.css("background-color");i=tinycolor(i).toHexString();n("#svga-custom-color > input").spectrum("set",i);switch(et){case"faceshape":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;case"ears":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;case"nose":t=["faceshape","humanbody","chinshadow","facehighlight","ears","mouth","nose","eyesfront"];ii(t,i);break;default:t=[et];ii(t,i)}ut=++ut});n("#svga-custom-color > input").spectrum({color:"#000000",clickoutFiresChange:!0,showInput:!0,showInitial:!0,showButtons:!1,move:or,change:or});n(".sp-replacer").click(function(){n("#svga-colors-"+et+" div.svga-active").removeClass("svga-active");ut=++ut});n(".svga-blocks").click(function(){var t=n(this),r=t.data("bodyzones").split(","),u=t.data("blockname"),i;for(t.siblings().removeClass("svga-active"),t.addClass("svga-active"),n("#svga-bodyzones").children().hide(),i=0;i<r.length;i++)n("#svga-bodyzones-"+r[i]).show();n("#svga-bodyzones").children().removeClass("svga-active");n("#svga-bodyzones-"+fr[u]).addClass("svga-active").trigger("click")});n(".svga-bodyzones").click(function(){var t=n(this),u,r,i;for(et=t.data("bodyzone"),u=t.data("block"),r=t.data("controls").split(","),t.siblings().removeClass("svga-active"),t.addClass("svga-active"),n("#svga-elements").children().hide(),n("#svga-elements-"+et).show(),n("#svga-colors").children().hide(),n("#svga-custom-color").hide(),b[et].colors&&(n("#svga-colors-"+et).show(),n("#svga-custom-color").show()),n("#svga-controls").children().hide(),i=0;i<r.length;i++)n("#svga-controls-"+r[i]).css("display","inline-block");fr[u]=et;ut=--ut;n("#svga-elements-"+et+"-"+ci[et]).addClass("svga-active-element").trigger("click");ar()});ai=n("#avatar-tooltips");ki=!1;n("#svgAvatars").on("click",".avatar-tooltip-close-btn",function(){var t=n(this).parents(".avatar-tooltip"),i=ai.find("[data-index="+t.data("index")+"]");t.removeClass("visible");setTimeout(function(){t.remove();i.addClass("dismissed");ki=!1},400)});n(".svga-elements").click(function(){for(var r=n(this),u=r.data(),t=u.zone,f,t=t==="eyesfront"?["eyesback","eyesfront"]:t==="faceshape"?["faceshape","chinshadow"]:t.split(),i=0;i<t.length;i++){n("#svga-custom-color > input").spectrum("set",yt[t[i]]);ct=t[i]==="facehighlight"||t[i]==="humanbody"?0:u.shape;for(vt in b[t[i]].shapes[ct])b[t[i]].shapes[ct].hasOwnProperty(vt)&&(f=SVG.get("svga-group-"+t[i]+"-"+vt),n("#svga-group-"+t[i]+"-"+vt).empty(),ui=!0,rr(f,t[i],ct,vt));r.siblings().removeClass("svga-active-element");r.addClass("svga-active-element");ci[t[i]]=ct}ut=++ut});n(".svga-glob-controls").click(function(){var i=n(this).attr("id"),t=SVG.get("svga-group-subwrapper");switch(i){case"svga-glob-controls-up":t.svgaUp(3,2);break;case"svga-glob-controls-down":t.svgaDown(3,2);break;case"svga-glob-controls-left":t.svgaLeft(4,2);break;case"svga-glob-controls-right":t.svgaRight(4,2);break;case"svga-glob-controls-scaleup":t.svgaScaleUp();break;case"svga-glob-controls-scaledown":t.svgaScaleDown();break;case"svga-glob-controls-tiltleft":t=SVG.get("svga-group-hair-back");t.svgaRotateLeft(1,3,100,150);t=SVG.get("svga-group-head");t.svgaRotateLeft(1,3,100,150);break;case"svga-glob-controls-tiltright":t=SVG.get("svga-group-hair-back");t.svgaRotateRight(1,3,100,150);t=SVG.get("svga-group-head");t.svgaRotateRight(1,3,100,150)}ut=++ut});n("#svga-controls-up").click(function(){var n;switch(et){case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaUp();break;case"ears":n=SVG.get("svga-group-ears-left");n.svgaUp(1);n=SVG.get("svga-group-ears-right");n.svgaUp(1);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaUp(4);break;case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaUp(4);n=SVG.get("svga-group-eyebrows-right");n.svgaUp(4);break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaUp(2);n=SVG.get("svga-group-eyes-right");n.svgaUp(2);break;case"eyesiris":n=SVG.get("svga-group-eyesiriscontrol-left");n.svgaUp();n=SVG.get("svga-group-eyesiriscontrol-right");n.svgaUp();break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaUp(4);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaUp(4);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaUp(4);break;case"glasses":n=SVG.get("svga-group-glasses-single");n.svgaUp(5);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaUp(5);n=SVG.get("svga-group-hats-back");n.svgaUp(5);break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaUp(5);n=SVG.get("svga-group-earings-back");n.svgaUp(5);break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaUp(5);n=SVG.get("svga-group-necklaces-back");n.svgaUp(5)}ut=++ut});n("#svga-controls-down").click(function(){var n;switch(et){case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaDown();break;case"ears":n=SVG.get("svga-group-ears-left");n.svgaDown(1);n=SVG.get("svga-group-ears-right");n.svgaDown(1);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaDown(4);break;case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaDown(4);n=SVG.get("svga-group-eyebrows-right");n.svgaDown(4);break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaDown(2);n=SVG.get("svga-group-eyes-right");n.svgaDown(2);break;case"eyesiris":n=SVG.get("svga-group-eyesiriscontrol-left");n.svgaDown();n=SVG.get("svga-group-eyesiriscontrol-right");n.svgaDown();break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaDown(4);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaDown(4);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaDown(4);break;case"glasses":n=SVG.get("svga-group-glasses-single");n.svgaDown(5);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaDown(5);n=SVG.get("svga-group-hats-back");n.svgaDown(5);break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaDown(5);n=SVG.get("svga-group-earings-back");n.svgaDown(5);break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaDown(5);n=SVG.get("svga-group-necklaces-back");n.svgaDown(5)}ut=++ut});n("#svga-controls-left").click(function(){var n;switch(et){case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaLeft(2,.5);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaLeft(2,.5);break;case"eyesiris":n=SVG.get("svga-group-eyesiriscontrol-left");n.svgaLeft();n=SVG.get("svga-group-eyesiriscontrol-right");n.svgaLeft();break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaLeft(2,.5);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaLeft(2,.5);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaLeft(2,.5);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaLeft();n=SVG.get("svga-group-hats-back");n.svgaLeft();break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaLeft();n=SVG.get("svga-group-earings-back");n.svgaLeft();break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaLeft();n=SVG.get("svga-group-necklaces-back");n.svgaLeft()}ut=++ut});n("#svga-controls-right").click(function(){var n;switch(et){case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaRight(2,.5);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaRight(2,.5);break;case"eyesiris":n=SVG.get("svga-group-eyesiriscontrol-left");n.svgaRight();n=SVG.get("svga-group-eyesiriscontrol-right");n.svgaRight();break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaRight(2,.5);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaRight(2,.5);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaRight(2,.5);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaRight();n=SVG.get("svga-group-hats-back");n.svgaRight();break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaRight();n=SVG.get("svga-group-earings-back");n.svgaRight();break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaRight();n=SVG.get("svga-group-necklaces-back");n.svgaRight()}ut=++ut});n("#svga-controls-scaleup").click(function(){var n;switch(et){case"faceshape":n=SVG.get("svga-group-faceshape-wrap");n.svgaScaleUp(2,.02,.0001);n=SVG.get("svga-group-hair-back");n.svgaScaleUp(2,.02,.0001);n=SVG.get("svga-group-hair-front");n.svgaScaleUp(2,.02,.0001);n=SVG.get("svga-group-freckles-single");n.svgaScaleUp(2,.02,.0001);p==="boys"&&(n=SVG.get("svga-group-beardwrap"),n.svgaScaleUp(2,.02,.0001));n=SVG.get("svga-group-ears-left");n.svgaLeft(2,1.5);n=SVG.get("svga-group-ears-right");n.svgaRight(2,1.5);break;case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaScaleUp(7);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaScaleUp(5);break;case"ears":n=SVG.get("svga-group-ears-left");n.svgaScaleUp(1);n=SVG.get("svga-group-ears-right");n.svgaScaleUp(1);break;case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaScaleUp();n=SVG.get("svga-group-eyebrows-right");n.svgaScaleUp();break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaScaleUp(2);n=SVG.get("svga-group-eyes-right");n.svgaScaleUp(2);break;case"eyesiris":n=SVG.get("svga-group-eyesiris-left");n.svgaScaleUp(4);n=SVG.get("svga-group-eyesiris-right");n.svgaScaleUp(4);break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaScaleUp(4);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaScaleUp(4);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaScaleUp(3);break;case"glasses":n=SVG.get("svga-group-glasses-single");n.svgaScaleUp(3);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaScaleUp();n=SVG.get("svga-group-hats-back");n.svgaScaleUp();break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaScaleUp();n=SVG.get("svga-group-earings-back");n.svgaScaleUp();break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaScaleUp();n=SVG.get("svga-group-necklaces-back");n.svgaScaleUp()}ut=++ut});n("#svga-controls-scaledown").click(function(){var n;switch(et){case"faceshape":n=SVG.get("svga-group-faceshape-wrap");n.svgaScaleDown(2,.02,.0001);n=SVG.get("svga-group-hair-back");n.svgaScaleDown(2,.02,.0001);n=SVG.get("svga-group-hair-front");n.svgaScaleDown(2,.02,.0001);n=SVG.get("svga-group-freckles-single");n.svgaScaleDown(2,.02,.0001);p==="boys"&&(n=SVG.get("svga-group-beardwrap"),n.svgaScaleDown(2,.02,.0001));n=SVG.get("svga-group-ears-left");n.svgaRight(2,1.5);n=SVG.get("svga-group-ears-right");n.svgaLeft(2,1.5);break;case"mouth":n=SVG.get("svga-group-mouth-single");n.svgaScaleDown(7);break;case"nose":n=SVG.get("svga-group-nose-single");n.svgaScaleDown(5);break;case"ears":n=SVG.get("svga-group-ears-left");n.svgaScaleDown(1);n=SVG.get("svga-group-ears-right");n.svgaScaleDown(1);break;case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaScaleDown(2);n=SVG.get("svga-group-eyebrows-right");n.svgaScaleDown(2);break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaScaleDown(2);n=SVG.get("svga-group-eyes-right");n.svgaScaleDown(2);break;case"eyesiris":n=SVG.get("svga-group-eyesiris-left");n.svgaScaleDown(4);n=SVG.get("svga-group-eyesiris-right");n.svgaScaleDown(4);break;case"freckles":n=SVG.get("svga-group-freckles-single");n.svgaScaleDown(4);break;case"mustache":n=SVG.get("svga-group-mustache-single");n.svgaScaleDown(4);break;case"beard":n=SVG.get("svga-group-beard-single");n.svgaScaleDown(3);break;case"glasses":n=SVG.get("svga-group-glasses-single");n.svgaScaleDown(3);break;case"hats":n=SVG.get("svga-group-hats-front");n.svgaScaleDown();n=SVG.get("svga-group-hats-back");n.svgaScaleDown();break;case"earings":n=SVG.get("svga-group-earings-front");n.svgaScaleDown();n=SVG.get("svga-group-earings-back");n.svgaScaleDown();break;case"necklaces":n=SVG.get("svga-group-necklaces-front");n.svgaScaleDown();n=SVG.get("svga-group-necklaces-back");n.svgaScaleDown()}ut=++ut});n("#svga-controls-tightly").click(function(){var n;switch(et){case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaRight();n=SVG.get("svga-group-eyebrows-right");n.svgaLeft();break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaRight();n=SVG.get("svga-group-eyes-right");n.svgaLeft()}ut=++ut});n("#svga-controls-wider").click(function(){var n;switch(et){case"eyebrows":n=SVG.get("svga-group-eyebrows-left");n.svgaLeft();n=SVG.get("svga-group-eyebrows-right");n.svgaRight();break;case"eyesfront":n=SVG.get("svga-group-eyes-left");n.svgaLeft();n=SVG.get("svga-group-eyes-right");n.svgaRight()}ut=++ut});n("#svga-controls-eb1").click(function(){var n;n=SVG.get("svga-group-eyebrows-left");n.svgaCancelRotate().svgaRotateRight(1,t/2);n=SVG.get("svga-group-eyebrows-right");n.svgaCancelRotate().svgaRotateRight(1,t/4);ut=++ut});n("#svga-controls-eb2").click(function(){var n;n=SVG.get("svga-group-eyebrows-left");n.svgaCancelRotate().svgaRotateLeft(1,t/4);n=SVG.get("svga-group-eyebrows-right");n.svgaCancelRotate().svgaRotateLeft(1,t/2);ut=++ut});n("#svga-controls-eb3").click(function(){var n;n=SVG.get("svga-group-eyebrows-left");n.svgaCancelRotate().svgaRotateRight(1,t/2);n=SVG.get("svga-group-eyebrows-right");n.svgaCancelRotate().svgaRotateLeft(1,t/2);ut=++ut});n("#svga-controls-eb4").click(function(){var n;n=SVG.get("svga-group-eyebrows-left");n.svgaCancelRotate().svgaRotateLeft(1,t/1.4);n=SVG.get("svga-group-eyebrows-right");n.svgaCancelRotate().svgaRotateRight(1,t/1.4);ut=++ut});n("#svga-controls-ebcancel").click(function(){var n;n=SVG.get("svga-group-eyebrows-left");n.svgaCancelRotate();n=SVG.get("svga-group-eyebrows-right");n.svgaCancelRotate()});n("#svga-resetavatar").click(function(){ut<=2&&!pi?ur():(yi="reset",n("#svga-blocks-face").trigger("click"),n("#svga-bodyzones-faceshape").trigger("click"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-dialog").fadeIn("fast"))});n("#svga-randomavatar").click(function(){ut<=2?sr():(yi="random",n("#svga-work-overlay").fadeIn("fast"),n("#svga-dialog").fadeIn("fast"))});n("#svga-dialog-ok").click(function(){yi==="reset"?(ur(),n("#svga-work-overlay").fadeOut("fast"),n("#svga-dialog").fadeOut("fast")):yi==="random"&&(sr(),n("#svga-work-overlay").fadeOut("fast"),n("#svga-dialog").fadeOut("fast"))});n("#svga-dialog-cancel").click(function(){n("#svga-work-overlay").fadeOut("fast");n("#svga-dialog").fadeOut("fast")});n(".svga-close").click(function(){n("#svga-loader").hide();n("#svga-work-overlay").fadeOut("fast");n("#svga-message").fadeOut("fast");n("#svga-ios").fadeOut("fast");n("#svga-share-block").fadeOut("fast")});n("#svga-tryagain").click(function(){n("#svga-loader").hide();n("#svga-message").hide();n("#svga-ios").hide();n("#svga-share-block").hide();n("#svga-gravatar-message").fadeOut("fast");n("#svga-gravataravatar").click()});n("#svga-saveavatar").click(function(){var t,f,i,r;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:o,height:o});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'px" height="'+o+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+o/200+" "+o/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");w==="png"?(f=document.getElementById("svga-canvas"),canvg(f,t,{ignoreMouse:!0,ignoreDimensions:!0}),i=f.toDataURL("image/png"),r="svgA"+(Math.random()+"").replace("0.","")+".png"):w==="svg"&&(i=t,r="svgA"+(Math.random()+"").replace("0.","")+".svg");n("#svga-canvas").attr({width:200,height:200});n.ajax({url:u+"php/save-ready-avatar.php",type:"post",dataType:"text",data:{imgdata:i,filename:r},cache:!1,success:function(t){t=="saved"?(n("#svga-message-text").html(alert_success).removeClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast")):(n("#svga-work-overlay").fadeIn("fast"),n("#svga-message-text").html(alert_error).addClass("svga-error"),n("#svga-message").fadeIn("fast"))},error:function(){n("#svga-message-text").html(alert_error).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});n("#svga-gravataravatar").click(function(){n("#svga-work-overlay").fadeIn("fast");n("#svga-gravatar").fadeIn("fast")});n("#svga-gravatar-cancel").click(function(){n("#svga-gravatar").hide();n("#svga-work-overlay").fadeOut("fast")});n("#svga-gravatar-ok").click(function(){var t,i;n("#svga-gravatar").hide();n("#svga-loader").show();n("#svga-canvas").attr({width:c,height:c});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+c+'px" height="'+c+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+c/200+" "+c/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});var r=i.toDataURL("image/png"),f=n("#svga-gravatar-email").val(),e=n("#svga-gravatar-pass").val(),o=n("input[name=svga-gr-rating]:checked").val();n("#svga-canvas").attr({width:200,height:200});n.ajax({url:u+"php/send-to-gravatar.php",type:"post",dataType:"text",data:{imgdata:r,datastring1:f,datastring2:e,rating:o},cache:!1,success:function(t){if(t=="success")n("#svga-message-text").removeClass("svga-error"),n("#svga-loader").hide(),n("#svga-message-text").html(alert_success_gravatar),n("#svga-message").fadeIn("fast");else switch(t){case"ratingfail":fi(alert_error_ratingfail);break;case"emailfail":fi(alert_error_emailfail);break;case"passwordfail":fi(alert_error_passwordfail);break;case"imagefail":fi(alert_error_imagefail);break;case"faultcode-8":n("#svga-loader").hide();n("#svga-message-text").html(alert_error_faultcode_8).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast");break;case"faultcode-9":fi(alert_error_faultcode_9);break;default:fi(alert_common_error_gravatar)}},error:function(){fi(alert_common_error_gravatar)}})});n("#svga-png-one").click(function(){var t,i,r,u,e;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:f,height:f});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+f+'px" height="'+f+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+f/200+" "+f/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});r=i.toDataURL("image/png");u="svgA"+(Math.random()+"").replace("0.","")+".png";n("#svga-canvas").attr({width:200,height:200});e=JSON.stringify({imgdata:r,filename:u});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:e,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){t.result=="success"?(console.log("first",t),n("#svga-message-text").removeClass("svga-error"),di(t.location,"png"),n("#svga-work-overlay").fadeOut("fast")):(n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});n("#svga-png-two").click(function(){var t,i,r,u,f;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:e,height:e});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+e+'px" height="'+e+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+e/200+" "+e/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});r=i.toDataURL("image/png");u="svgA"+(Math.random()+"").replace("0.","")+".png";n("#svga-canvas").attr({width:200,height:200});f=JSON.stringify({imgdata:r,filename:u});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:f,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){t.result=="success"?(console.log("second",t),n("#svga-message-text").removeClass("svga-error"),di(t.location,"png"),n("#svga-work-overlay").fadeOut("fast")):(n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});tt&&n("#svga-downloadavatar").click(function(){var t,i,f,r,e;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:s,height:s});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'px" height="'+s+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+s/200+" "+s/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});f=i.toDataURL("image/png");r="svgA"+(Math.random()+"").replace("0.","")+".png";n("#svga-canvas").attr({width:200,height:200});e=JSON.stringify({imgdata:f,filename:r});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:e,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){if(t.result=="success"){console.log("third",t);n("#svga-message-text").removeClass("svga-error");var i=n("<img />").error(function(){n(this).hide();n("#svga-message-text").html(alert_error_image).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}).attr("src",u+"temp-avatars/"+r).on("load",function(){this.complete&&typeof this.naturalWidth!="undefined"&&this.naturalWidth!=0?(n("#svga-ios-image").empty().append(i),n("#svga-work-overlay").fadeIn("fast"),n("#svga-ios").fadeIn("fast")):(n("#svga-message-text").html(alert_error_image).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))})}else n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast")},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});it&&n("#svga-downloadavatar").click(function(){var t,i,u,r,f;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:h,height:h});at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+h+'px" height="'+h+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+h/200+" "+h/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});u=i.toDataURL("image/png");r="svgA"+(Math.random()+"").replace("0.","")+".png";n("#svga-canvas").attr({width:200,height:200});f=JSON.stringify({imgdata:u,filename:r});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:f,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){t=="saved"?(console.log("fourth",d),n("#svga-message-text").removeClass("svga-error"),di(r,"png"),n("#svga-work-overlay").fadeOut("fast")):(n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});n("#svga-svgfile").click(function(){var t,i,r;n("#svga-work-overlay").fadeIn("fast");at&&at.hide();lt&&lt.hide();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+v+'px" height="'+v+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+v/200+" "+v/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i="svgA"+(Math.random()+"").replace("0.","")+".svg";r=JSON.stringify({imgdata:img,filename:i});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:r,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){t.result=="success"?(console.log("fifth",t),n("#svga-message-text").removeClass("svga-error"),di(t.location,"svg"),n("#svga-work-overlay").fadeOut("fast")):(n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});n("#svga-shareavatar").click(function(){var t,i,f,r,e;n("#svga-work-overlay").fadeIn("fast");n("#svga-canvas").attr({width:l,height:l});at&&at.show();lt&&lt.show();t=n("#svga-svgmain").html();t='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+l+'px" height="'+l+'px" xlink="http://www.w3.org/1999/xlink" style="overflow:hidden!important;"><g id="svga-group-wrapper" transform="scale('+l/200+" "+l/200+')">'+t.replace(/<svg(.*?)>/,"").replace(/<g id(.*?)>/,"").replace(/data-(.*?)\"(.*?)\"/g,"").replace(/   /g," ").replace(/  /g," ").replace(/  /g," ");i=document.getElementById("svga-canvas");canvg(i,t,{ignoreMouse:!0,ignoreDimensions:!0});f=i.toDataURL("image/png");r="svgA"+(Math.random()+"").replace("0.","")+".png";n("#svga-canvas").attr({width:200,height:200});at&&at.hide();lt&&lt.hide();e=JSON.stringify({imgdata:f,filename:r});n.ajax({url:"/Umbraco/Api/DigiMe/UploadAvatar",type:"POST",dataType:"json",data:e,cache:!1,contentType:"application/json; charset=utf-8",success:function(t){if(t.result=="success"){console.log("sixth",t);n("#svga-message-text").removeClass("svga-error");var i=n("<img />").error(function(){n(this).hide();n("#svga-message-text").html(alert_error_image).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}).attr("src",u+"temp-avatars/"+r).on("load",function(){this.complete&&typeof this.naturalWidth!="undefined"&&this.naturalWidth!=0?(n("#svga-share-image").empty().append(i),n("#svga-work-overlay").fadeIn("fast"),n("#svga-share-block").fadeIn("fast")):(n("#svga-message-text").html(alert_error_image).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast"))})}else n("#svga-message-text").html(alert_error_download).addClass("svga-error"),n("#svga-work-overlay").fadeIn("fast"),n("#svga-message").fadeIn("fast")},error:function(){n("#svga-message-text").html(alert_error_download).addClass("svga-error");n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})});n("#svga-share-facebook").click(function(){return yr(),!1});n("#svga-share-twitter").click(function(){return pr(),!1});n("#svga-share-pinterest").click(function(){return wr(),!1});n("#svga-share-googleplus").click(function(){return br(),!1});n(".svga-col-left .sp-dd").remove();n("#svga-blocks-face").trigger("click");n("#svga-bodyzones-faceshape").trigger("click");n("#svga-elements-faceshape-"+ci.faceshape).trigger("click").addClass("svga-active-element");n("#svga-colors-faceshape > div:nth-child(1)").trigger("click");n("#svga-elements-hair > div:nth-child(1)").trigger("click");n("#svga-elements-backs > div:nth-child(1)").trigger("click");n("#svga-loader").hide();ut=2;pi=!1;ot()}function ot(){var t=n(".svga-col-left"),i=n(".svga-col-right"),r,u;t.height("auto");i.height("auto");window.innerWidth>=481&&(r=t.height(),u=i.height(),r>=u&&(i.height(r),t.height(u)))}var u="/svgavatars/",i=.1,r=.06,w="png",o=200,v=600,f=200,e=400,s=500,h=400,c=200,b=!0,k=!1,g=!1,l=500,st="replace me!",a=document.URL,y=document.title,ht="",nt="Created on YourSite.com";svgAvatarsTranslation(f,e);SVG.extend(SVG.Element,{svgaCenterScale:function(n,t){var i=this.bbox(),r=i.cx,u=i.cy;return t||(t=n),this.transform({a:n,b:0,c:0,d:t,e:r-n*r,f:u-t*u})},svgaLeft:function(n,t){var n=n?n:3,t=t?t:ut,i=this.data("leftright"),r=this.data("updown");return i>-(n*t)&&(this.move(i-t,r),this.data("leftright",i-t-1e-7)),this},svgaRight:function(n,t){var n=n?n:3,t=t?t:ut,i=this.data("leftright"),r=this.data("updown");return i<n*t&&(this.move(i+t,r),this.data("leftright",i+t+1e-7)),this},svgaUp:function(n,t){var n=n?n:3,t=t?t:rt,r=this.data("leftright"),i=this.data("updown");return i>-(n*t)&&(this.move(r,i-t),this.data("updown",i-t-1e-7)),this},svgaDown:function(n,t){var n=n?n:3,t=t?t:rt,r=this.data("leftright"),i=this.data("updown");return i<n*t&&(this.move(r,i+t),this.data("updown",i+t+1e-7)),this},svgaScaleUp:function(n,t,i){var n=n?n:3,t=t?t:ft,i=i?i:t,r=this.data("scaleX")+1e-7,u=this.data("scaleY")+1e-7;return r<1+n*t&&(this.svgaCenterScale(r+t,u+i),this.data("scaleX",r+t+11e-8),this.data("scaleY",u+i+11e-8)),this},svgaScaleDown:function(n,t,i){var n=n?n:3,t=t?t:ft,i=i?i:t,r=this.data("scaleX")-1e-7,u=this.data("scaleY")-1e-7;return r>1-n*t&&(this.svgaCenterScale(r-t,u-i),this.data("scaleX",r-t-11e-8),this.data("scaleY",u-i-11e-8)),this},svgaRotateLeft:function(n,i,r,u){var n=n?n:2,i=i?i:t,f=this.data("rotate");return f>-(n*i)&&(this.rotate(f-i-1e-7,r,u),this.data("rotate",f-i)),this},svgaRotateRight:function(n,i,r,u){var n=n?n:2,i=i?i:t,f=this.data("rotate");return f<n*i&&(this.rotate(f+i+1e-7,r,u),this.data("rotate",f+i)),this},svgaCancelRotate:function(){return this.rotate(1e-7).data("rotate",1e-7,!0)}});var tt=navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,ct=navigator.userAgent.match(/(Android)/g)?!0:!1,lt=navigator.userAgent.match(/(Opera)/g)?!0:!1,it=navigator.platform.toLowerCase().indexOf("win")!==-1&&navigator.userAgent.toLowerCase().indexOf("touch")!==-1?!0:!1,rt=1,ut=1,ft=.05,t=15,p=['<div id="svga-container" class="svga-no-touch">','<div id="svga-canvas-wrap">','<canvas id="svga-canvas"><\/canvas>',"<\/div>",'<div class="svga-row invisible">','<div class="svga-col-left">','<div class="svga-vert-order-svgcanvas">','<div class="svga-row row-svgcanvas">','<div id="svga-svgmain"><\/div>',"<\/div>","<\/div>","<\/div>",'<div class="svga-col-right">','<div class="svga-vert-order-main">','<div class="svga-android-hack">','<div class="svga-vert-order-elements">','<div class="svga-row row-elements">','<div id="svga-elements" class="scrollbar scroll-simple_outer"><\/div>',"<\/div>","<\/div>",'<div class="svga-vert-order-bodyzones">','<div class="svga-row row-bodyzones">','<div id="svga-bodyzones"><\/div>',"<\/div>","<\/div>",'<div class="svga-vert-order-blocks">','<div class="svga-row">','<div id="svga-blocks" class="scrollbar scroll-simple_outer"><\/div>',"<\/div>","<\/div>","<\/div>","<\/div>",'<div class="svga-colours-controls-wrap">','<div class="svga-vert-order-colors">','<div class="svga-row row-colors">','<div id="svga-colors-wrap">','<div id="svga-colors" class="scrollbar scroll-simple_outer"><\/div>',"<\/div>",'<div id="svga-custom-color"><input type="text"><\/div>',"<\/div>","<\/div>",'<div class="svga-vert-order-controls">','<div class="svga-row row-controls">','<div id="svga-controls" class="scrollbar scroll-simple_outer"><\/div>',"<\/div>","<\/div>","<\/div>","<\/div>","<\/div>",'<div id="svga-start-overlay">&nbsp;<\/div>','<div id="svga-work-overlay">&nbsp;<\/div>','<div id="svga-loader" class="invisible">',wait_msg,"<\/div>",'<div id="svga-gender">',welcome_msg,'<div id="svga-starticons-wrap">','<div id="svga-start-boys"><\/div>','<div id="svga-start-girls"><\/div>',"<\/div>","<\/div>",'<div id="svga-dialog">',confirm_msg,'<div id="svga-dialog-btns">','<div id="svga-dialog-ok">',ok_msg,"<\/div>",'<div id="svga-dialog-cancel">',cancel_msg,"<\/div>","<\/div>","<\/div>",'<div id="svga-gravatar">',gravatar_title,'<div id="svga-gravatar-fields">','<input class="svga-input" type="text" id="svga-gravatar-email" value="" placeholder="',gravatar_email,'">','<input class="svga-input" type="password" id="svga-gravatar-pass" value="" placeholder="',gravatar_pwd,'">',"<p>",gravatar_rating,'<label class="svga-gr-rating"><input type="radio" name="svga-gr-rating" value="0" checked> G<\/label>','<label class="svga-gr-rating"><input type="radio" name="svga-gr-rating" value="1"> PG<\/label>','<label class="svga-gr-rating"><input type="radio" name="svga-gr-rating" value="2"> R<\/label>','<label class="svga-gr-rating"><input type="radio" name="svga-gr-rating" value="3"> X<\/label><\/p>',"<\/div>",gravatar_note,'<div id="svga-gravatar-btns">','<div id="svga-gravatar-ok">',install_msg,"<\/div>",'<div id="svga-gravatar-cancel">',cancel_msg,"<\/div>","<\/div>","<\/div>",'<div id="svga-message">','<div id="svga-message-text"><\/div>','<div class="svga-close">',close_msg,"<\/div>","<\/div>",'<div id="svga-gravatar-message">','<div id="svga-gravatar-message-text"><\/div>','<div id="svga-tryagain">',tryagain_msg,"<\/div>","<\/div>",'<div id="svga-ios">','<div id="svga-ios-text">',ios_msg,"<\/div>",'<div id="svga-ios-image"><\/div>','<div class="svga-close">',close_msg,"<\/div>","<\/div>",'<div id="svga-share-block">','<div id="svga-share-image"><\/div>',"<ul>",'<li id="svga-share-facebook"><a href="#"><span id="svga-facebook-icon"><\/span><\/a><\/li>','<li id="svga-share-twitter"><a href="#"><span id="svga-twitter-icon"><\/span><\/a><\/li>','<li id="svga-share-pinterest"><a href="#"><span id="svga-pinterest-icon"><\/span><\/a><\/li>','<li id="svga-share-googleplus"><a href="#"><span id="svga-googleplus-icon"><\/span><\/a><\/li>',"<\/ul>",'<div class="svga-close">',close_msg,"<\/div>","<\/div>","<\/div>"].join("");SVG.supported?n("#svgAvatars").empty().html(p):(p=['<div id="svga-container" class="svga-no-touch">','<h3 class="svga-nosvg">',alert_svg_support_error,"<\/h3>","<\/div>"].join(""),n("#svgAvatars").empty().html(p));switch("dark"){case"light":n("#svga-container").addClass("svga-light");break;case"dark":n("#svga-container").addClass("svga-dark");break;case"custom":n("#svga-container").addClass("svga-custom");break;default:n("#svga-container").addClass("svga-light")}SVG.supported&&(n("#svga-canvas").attr({width:200,height:200}),!0&&n("#svga-saveavatar").remove(),!1&&n("#svga-shareavatar").remove(),b&&k&&g?n("#svga-downloadavatar").remove():(k&&n("#svga-png-one").remove(),g&&n("#svga-png-two").remove(),b&&n("#svga-svgfile").remove()),!1&&n("#svga-gravataravatar").remove(),!0||n("#svga-share-facebook").remove(),!0||n("#svga-share-twitter").remove(),!0||n("#svga-share-pinterest").remove(),!0||n("#svga-share-googleplus").remove(),tt&&(n("#svga-container").removeClass("svga-no-touch"),n("#svga-downloadavatar > ul").remove()),ct&&!0&&n("#svga-svgfile").remove(),lt&&n("#svga-container").addClass("svga-opera"),it&&(n("#svga-container").addClass("svga-win8tablet"),n("#svga-downloadavatar > ul").remove()),n("#svga-start-boys").append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 540 410.2"><path d="M0 0h540v410.2H0V0z" fill="#FFF"/><path d="M364.6 212.2c-1.5 0-3 .2-4.5.7 3.7-6.2 8.5-18.4 7.5-39.6-1-21.4 4.7-45.6-11.2-58.3-11.2-9-38.6-14.5-50.8-15-9.5-.2-38.4-4.5-44.4-12.7.5 4.7-2 12 .7 15.7-10.2-6.2-19.4-6.5-25.9-18.2-1 6.7-1.7 16.5 3.5 21.2-10.2-8.5-33.4-23.4-30.7-41.9-12 15-13.2 29.9-6.7 48.4-6.7-5.2-14.2-12.5-13.2-22.2-3 3-4 6.7-4.5 10.7-1.2 10.5.2 22.7 4.2 33.9-3 10.5-3 21.9-4 35.6-1 13.2-3.2 28.4-1.2 41.6-7 .5-12.5 6-12.5 13.2V249c0 7.2 6 13.2 13.2 13.2 3.5 0 6.7-1.5 9.2-3.7 1.5 43.6 35.4 78.5 77 78.5h8.2c41.6 0 75.8-34.9 77-78.5 2.2 2.2 5.5 3.7 9.2 3.7 7.2 0 13.2-6 13.2-13.2v-23.7c-.1-7.4-5.8-13.1-13.3-13.1zm-141.6-.8c0-2.2 1.7-4 4-4h23.2c2.2 0 4 1.7 4 4 0 2.2-1.7 4-4 4H227c-2.2-.2-4-2-4-4zm16.5 34.9c-5 0-9.2-4-9.2-9.2 0-5 4-9.2 9.2-9.2 5 0 9.2 4 9.2 9.2s-4.2 9.2-9.2 9.2zm54.6 45.4c-8.5 4.7-16 6.5-22.4 6.5-12.7 0-20.4-6.5-20.9-7-2-1.7-2.2-5-.5-7 1.7-2 5-2.2 7-.5.5.5 12.7 10.2 32.2-.5 2.5-1.2 5.5-.5 6.7 2 1.1 2.3.1 5.3-2.1 6.5zm11.7-45.4c-5 0-9.2-4-9.2-9.2 0-5 4-9.2 9.2-9.2 5 0 9.2 4 9.2 9.2s-4.2 9.2-9.2 9.2zm11.4-31.1H294c-2.2 0-4-1.7-4-4 0-2.2 1.7-4 4-4h23.2c2.2 0 4 1.7 4 4s-1.7 4-4 4z" fill="#4E4E4E"/><\/svg>'),n("#svga-start-girls").append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 540 410.2"><path d="M0 0h540v410.2H0V0z" fill="#FFF"/><path d="M371 237.1v-46.2c0-2.5-.3-5.3-.3-7.9 30.7 14 77.7 27.9 77.7 27.9s-25.4-84.3-41.7-100.8c-16.3-16.3-42.9-16.3-59.2 0-3.3 3.3-5.8 6.9-7.6 10.7-16.3-14.5-37.6-23.6-61-23.6h-9.7c-24.4 0-46.7 10.2-63.2 26.4-2-4.8-5.1-9.4-8.9-13.2-16.3-16.3-42.9-16.3-59.2 0S96.5 211.2 96.5 211.2s51.3-15.5 81.8-30c-.5 4.1-.8 8.1-.8 12.4v43.7c-3 1.8-4.8 4.6-4.8 7.4v17.8c0 5.6 6.3 9.9 14 9.9 3.8 0 7.1-1 9.7-2.8 5.6 37.6 36.6 66.3 73.9 66.3h7.9c37.3 0 68.6-28.7 74.2-66.3 2.5 1.8 5.8 2.8 9.7 2.8 7.6 0 14-4.3 14-9.9v-17.8c-.2-3.1-2-5.6-5.1-7.6zM201.9 132.4l-8.1 6.3-3 9.7c-1.3 1.8-3.8 2.3-5.6 1-1.8-1.3-2.3-3.8-1-5.6l3-9.4 8.1-6.3c1.3-1.8 3.8-2.3 5.6-1 1.8 1 2.3 3.5 1 5.3zm35.6 114.8c-5.3 0-9.7-4.3-9.7-9.7 0-5.3 4.3-9.7 9.7-9.7 5.3 0 9.7 4.3 9.7 9.7-.1 5.4-4.4 9.7-9.7 9.7zm58.1 36.6c-6.1 7.6-13.2 11.7-21.1 11.9h-1c-13.5 0-24.1-11.2-24.6-11.7-1.8-1.8-1.5-4.8.3-6.6s4.8-1.5 6.6.3c.3.3 8.6 9.1 18.5 8.6 5.1-.3 9.9-3 14-8.4 1.5-2 4.6-2.3 6.6-.8 2 1.9 2.2 4.7.7 6.7zm11.9-36.6c-5.3 0-9.7-4.3-9.7-9.7 0-5.3 4.3-9.7 9.7-9.7s9.7 4.3 9.7 9.7c0 5.4-4.3 9.7-9.7 9.7zm52.6-97.8c-1.8 1.3-4.3.8-5.6-1l-3-9.7-8.1-6.3c-1.3-1.8-.8-4.3 1-5.6s4.3-.8 5.6 1l8.1 6.3 3 9.4c1.3 2.1.8 4.7-1 5.9z" fill="#4E4E4E"/><\/svg>'),n("#svga-start-boys").click(function(){n("#svga-gender").hide();setTimeout(function(){n.ajax({url:u+"json/svgavatars-male-data.json",async:!1,dataType:"json",success:function(t){et("boys",t);n("#svga-start-overlay").hide();n("#svga-start-boys").trigger("avatar-loaded");console.log("start boys")},error:function(){n("#svga-message-text").html(alert_json_error).addClass("svga-error");n("#svga-loader").hide();n(".svga-close").hide();n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})},50)}),n("#svga-start-girls").click(function(){n("#svga-gender").hide();setTimeout(function(){n.ajax({url:u+"json/svgavatars-female-data.json",async:!1,dataType:"json",success:function(t){et("girls",t);n("#svga-start-overlay").hide();n("#svga-start-girls").trigger("avatar-loaded");console.log("start boys")},error:function(){n("#svga-message-text").html(alert_json_error).addClass("svga-error");n("#svga-loader").hide();n(".svga-close").hide();n("#svga-work-overlay").fadeIn("fast");n("#svga-message").fadeIn("fast")}})},50)}),n(window).resize(function(){ot()}),n(".scrollbar").scrollbar({showArrows:!1,ignoreMobile:!1}),n("#svga-start-boys, #svga-start-girls").click(function(){var t=n(".svga-row"),i=n("#svga-loader"),r=n("#btn-avatar-gender"),u=n(".link-see-other");t.removeClass("invisible");i.removeClass("invisible");r.removeClass("invisible");u.addClass("invisible")}))})