/* smartVISU, Martin Gleiß, 2013, GPL [http://www.gnu.de] */
$(document).delegate('a[data-widget="basic.button"]',{click:function(d){""!=$(this).attr("data-val")&&io.write($(this).attr("data-item"),$(this).attr("data-val"))}});$(document).delegate('input[data-widget="basic.checkbox"]',{update:function(d,a){$(this).prop("checked",0!=a).checkboxradio("refresh")},change:function(d){io.write($(this).attr("data-item"),$(this).prop("checked")?1:0)}});
$(document).delegate('a[data-widget="basic.colordisc"]',{update:function(d,a){var b=$(this).attr("data-max");$("#"+this.id+" span").css("background-color","rgb("+Math.round(a[0]/b*255)+","+Math.round(a[1]/b*255)+","+Math.round(a[2]/b*255)+")")},click:function(d){$("#"+this.id+"-screen").removeClass("hide").addClass("in");var a=$(this).offset();d=$("#"+this.id+"-disc");var b=a.top-d.height()/2+15,a=a.left-d.width()/2+25;d.css("top",b.limit(5,$(window).height()+$(document).scrollTop()-d.height()-5,
1));d.css("left",a.limit(5,$(window).width()-d.width()-5,1));d.show()}});$(document).delegate('div[data-widget="basic.colordisc"]',{click:function(d){d=this.id.substr(0,this.id.length-7);$("#"+d+"-disc").hide();$("#"+d+"-screen").removeClass("in").addClass("hide")}});
$(document).delegate('canvas[data-widget="basic.colordisc"]',{init:function(d){d=parseFloat($(this).attr("data-colors"));var a=$(this)[0],b=100/($(this).attr("data-step")/2),c=Math.PI/(d+2)*2,e=-(Math.PI/2)+c,f=16.875/($(this).attr("data-step")/8),h=360/d;a.width=280;a.height=280;if(a.getContext){a=a.getContext("2d");a.beginPath();a.fillStyle="#888";a.shadowColor="rgba(96,96,96,0.4)";a.shadowOffsetX=2;a.shadowOffsetY=2;a.shadowBlur=4;a.arc(139,139,139,0,2*Math.PI,!1);a.fill();a.beginPath();a.shadowOffsetX=
0;a.shadowOffsetY=0;a.shadowBlur=0;a.fillStyle="#555";a.arc(139,139,138,0,2*Math.PI,!1);a.fill();for(var g,k=0;k<=d;k++){var l=e+k*c,m=1,n=k*h;for(g=b;100>=g;g+=b)a.beginPath(),a.fillStyle=fx.hsv2rgb(n,100,g),a.arc(139,139,m*f+f+1,l,l+c+0.01,!1),a.arc(139,139,m*f,l+c+0.01,l,!0),a.fill(),m+=1;for(g=100-b;g>=b;g-=b)a.beginPath(),a.fillStyle=fx.hsv2rgb(n,g,100),a.arc(139,139,m*f+f+1,l,l+c+0.01,!1),a.arc(139,139,m*f,l+c+0.01,l,!0),a.fill(),m+=1}k-=1;l=e+k*c;m=1;n=k*h;for(g=b;100>=g;g+=b/2)a.beginPath(),
a.fillStyle=fx.hsv2rgb(n,0,g),a.arc(139,139,m*f+f+1,l,l+2*c+0.01,!1),a.arc(139,139,m*f,l+2*c+0.01,l,!0),a.fill(),m+=1;a.beginPath();a.fillStyle="rgb(0,0,0)";a.arc(139,139,f+1,0,2*Math.PI,!1);a.fill()}},click:function(d){var a=this.id.substr(0,this.id.length-5),b=$(this)[0].getContext("2d"),c=$(this).offset(),e=Math.round(d.pageX-c.left);d=Math.round(d.pageY-c.top);b=b.getImageData(e,d,1,1).data;e=$("#"+a).attr("data-max");d=$("#"+a).attr("data-item").explode();io.write(d[0],Math.round(b[0]/255*e));
io.write(d[1],Math.round(b[1]/255*e));io.write(d[2],Math.round(b[2]/255*e));$(this).hide();$("#"+a+"-screen").removeClass("in").addClass("hide")}});
$(document).delegate('a[data-widget="basic.dual"]',{update:function(d,a){$("#"+this.id+" img").attr("src",a==$(this).attr("data-val-on")?$(this).attr("data-pic-on"):$(this).attr("data-pic-off"))},click:function(d){$("#"+this.id+" img").attr("src")==$(this).attr("data-pic-off")?io.write($(this).attr("data-item"),$(this).attr("data-val-on")):io.write($(this).attr("data-item"),$(this).attr("data-val-off"))}});
$(document).delegate('select[data-widget="basic.flip"]',{update:function(d,a){$(this).val(0<a?"on":"off").slider("refresh")},change:function(d){io.write($(this).attr("data-item"),"on"==$(this).val()?1:0)}});$(document).delegate('[data-widget="basic.float"]',{update:function(d,a){""!=$(this).attr("data-unit")?$("#"+this.id).html(parseFloat(a).transUnit($(this).attr("data-unit"))):$("#"+this.id).html(parseFloat(a).transFloat())}});
$(document).delegate('[data-widget="basic.formula"]',{update:function(d,a){var b=0,c=0,e=$(this).attr("data-unit"),f=$(this).attr("data-formula").substring(0,3);if("time"==e)b=new Date(a[0]),$("#"+this.id).html(b.transTime());else if("short"==e)b=new Date(a[0]),$("#"+this.id).html(b.transShort());else{"SUB"==f&&(b=a[c],c++);for(;c<a.length;c++)b="SUB"==f?b-a[c]:b+a[c];"AVG"==f&&(b/=c);""!=f&&(b=eval($(this).attr("data-formula").replace(/VAR/g,b).replace(/AVG/g,"").replace(/SUM/g,"").replace(/SUB/g,
"")));$("#"+this.id).html(parseFloat(b).transUnit(e))}}});$(document).delegate('a[data-widget="basic.rgb"]',{update:function(d,a){var b=$(this).attr("data-max");$("#"+this.id+" span").css("background-color","rgb("+Math.round(a[0]/b*255)+","+Math.round(a[1]/b*255)+","+Math.round(a[2]/b*255)+")")}});
$(document).delegate('div[data-widget="basic.rgb-popup"] > div',{click:function(d){d=$(this).css("background-color");d=d.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);var a=$(this).parent().attr("data-max"),b=$(this).parent().attr("data-item").explode();io.write(b[0],Math.round(d[1]/255*a));io.write(b[1],Math.round(d[2]/255*a));io.write(b[2],Math.round(d[3]/255*a));$(this).parent().popup("close")},mouseenter:function(d){$(this).addClass("ui-focus")},mouseleave:function(d){$(this).removeClass("ui-focus")}});
$(document).delegate('span[data-widget="basic.shifter"]',{update:function(d,a){var b=Math.min(10*(a[0]/$(this).attr("data-max")*10+0.49).toFixed(0),100);0<b&&0!=a[1]?$("#"+this.id+" img").attr("src",$(this).attr("data-pic-on").replace("00",b)):0<b&&"_00.png"==$(this).attr("data-pic-off").substr(-7)?$("#"+this.id+" img").attr("src",$(this).attr("data-pic-off").replace("00",b)):$("#"+this.id+" img").attr("src",$(this).attr("data-pic-off"))},click:function(d){d=$(this).attr("data-item").explode();d[1]&&
io.write(d[1],0==widget.get(d[1])?1:0)}});$(document).delegate('span[data-widget="basic.shifter"] > a > img',"hover",function(d){"mouseenter"===d.type?$(this).addClass("ui-focus"):$(this).removeClass("ui-focus")});
$(document).delegate('div[data-widget="basic.shutter"]',{update:function(d,a){var b=13,c="half"==$(this).attr("data-mode")?0.5:1;void 0!==a[1]&&(b=parseInt(13/c*(a[1]/$(this).attr("data-max")+c-1)));for(var e=parseInt(182*a[0]/$(this).attr("data-max")),f=12;1<=f;f--)if(14<=e){var h=13-Math.abs(b),c="height: "+(e>14*f&&13==b?14-h:15-h)+"px;",c=13!=b?c+("margin-top: "+(14<=e-15?h:parseInt(h/2))+"px;"):c+("border-top: 1px dotted "+(e>14*f?"#ccc":"#333")+";");0<b?$("#"+this.id+"-"+f).attr("class","blade-pos"):
$("#"+this.id+"-"+f).attr("class","blade-neg");$("#"+this.id+"-"+f).attr("style",c);e-=15}else c="height: "+e+"px;",c+="border-top: 1px dotted #aaa;",$("#"+this.id+"-"+f).attr("style",c),e=1},click:function(d){var a=$(this).offset(),b=Math.round(d.pageX-a.left);d=Math.floor(((d.pageY-a.top)/160-0.0625)*$(this).attr("data-max")/$(this).attr("data-step"))*$(this).attr("data-step");d=d.limit($(this).attr("data-min"),$(this).attr("data-max"),1);a=$(this).attr("data-item").explode();""!=a[1]&&52<b?io.write(a[1],
d):io.write(a[0],d)},mouseenter:function(d){$("#"+this.id+" .control").fadeIn(400)},mouseleave:function(d){$("#"+this.id+" .control").fadeOut(400)}});
$(document).delegate('input[data-widget="basic.slider"]',{update:function(d,a){$(this).attr("lock",1);$("#"+this.id).val(a).slider("refresh").attr("mem",$(this).val())},slidestop:function(d){$(this).val()!=$(this).attr("mem")&&io.write($(this).attr("data-item"),$(this).val())},change:function(d){(void 0===$(this).attr("timer")||0==$(this).attr("timer")&&0==$(this).attr("lock"))&&$(this).val()!=$(this).attr("mem")&&(void 0!==$(this).attr("timer")&&$(this).trigger("click"),$(this).attr("timer",1),setTimeout("$('#"+
this.id+"').attr('timer', 0);",400));$(this).attr("lock",0)},click:function(d){io.write($(this).attr("data-item"),$(this).val())}});
$(document).delegate('span[data-widget="basic.switch"]',{update:function(d,a){$("#"+this.id+" img").attr("src",a==$(this).attr("data-val-on")?$(this).attr("data-pic-on"):$(this).attr("data-pic-off"))},click:function(d){$("#"+this.id+" img").attr("src")==$(this).attr("data-pic-off")?io.write($(this).attr("data-item"),$(this).attr("data-val-on")):io.write($(this).attr("data-item"),$(this).attr("data-val-off"))}});
$(document).delegate('span[data-widget="basic.switch"] > a > img',"hover",function(d){"mouseenter"===d.type?$(this).addClass("ui-focus"):$(this).removeClass("ui-focus")});
$(document).delegate('span[data-widget="basic.symbol"]',{update:function(d,a){var b="and"==$(this).attr("data-mode");if(a instanceof Array)for(var c=0;c<a.length;c++)b="and"==$(this).attr("data-mode")?b&&a[c]==$(this).attr("data-val"):b||a[c]==$(this).attr("data-val");else b=a==$(this).attr("data-val");$("#"+this.id+" img").attr("title",new Date);b?$("#"+this.id).show():$("#"+this.id).hide()}});
$(document).delegate('div[data-widget="basic.tank"]',{update:function(d,a){$("#"+this.id+" div").css("height",Math.round(180*Math.min(a/$(this).attr("data-max"),1)))}});$(document).delegate('[data-widget="basic.text"]',{update:function(d,a){$("#"+this.id).html(a==$(this).attr("data-val-on")?$(this).attr("data-txt-on"):$(this).attr("data-txt-off"))}});$(document).delegate('a[data-widget="basic.trigger"]',{click:function(d){io.trigger($(this).attr("data-name"),$(this).attr("data-val"))}});
$(document).delegate('[data-widget="basic.value"]',{update:function(d,a){$("#"+this.id).html(a+" "+$(this).attr("data-unit"))}});$(document).delegate('span[data-widget="clock.iconclock"]',{repeat:function(d){d=Math.floor((new Date-(new Date).setHours(0,0,0,0))/1E3/60);$("#"+this.id+" svg").trigger("update",[[d],[0]])}});$(document).delegate('span[data-widget="clock.miniclock"]',{repeat:function(d){d=new Date;$(".miniclock").html(d.getHours()+":"+(10>d.getMinutes()?"0"+d.getMinutes():d.getMinutes()))}});
$(document).delegate('div[data-widget="device.rtr"] > div > a[data-icon="minus"]',{click:function(d,a){var b=$(this).parent().parent().attr("id"),c=$("#"+b).attr("data-step"),b=$("#"+b+"set").attr("data-item"),c=(Math.round(10*(widget.get(b)-c))/10).toFixed(1);io.write(b,c)}});
$(document).delegate('div[data-widget="device.rtr"] > div > a[data-icon="plus"]',{click:function(d,a){var b=$(this).parent().parent().attr("id"),c=$("#"+b).attr("data-step"),b=$("#"+b+"set").attr("data-item"),c=(Math.round(10*(1*widget.get(b)+1*c))/10).toFixed(1);io.write(b,c)}});
$(document).delegate('div[data-widget="plot.comfortchart"]',{update:function(d,a){var b=$(this).attr("data-label").explode(),c=$(this).attr("data-axis").explode(),e=[];e[0]={type:"area",name:b[0],lineWidth:0,data:[[17,35],[16,75],[17,85],[21,80],[25,60],[27,35],[25,19],[20,20],[17,35]]};e[1]={type:"area",name:b[1],lineWidth:0,data:[[17,75],[22.5,65],[25,33],[18.5,35],[17,75]]};e[2]={name:"point",data:[[1*a[0],1*a[1]]],marker:{enabled:!0,lineWidth:2,radius:6,symbol:"circle"},showInLegend:!1};$("#"+
this.id).highcharts({series:e,xAxis:{min:10,max:35,title:{text:c[0],align:"high",margin:-2}},yAxis:{min:0,max:100,title:{text:c[1],margin:7}},plotOptions:{area:{enableMouseTracking:!1}},tooltip:{formatter:function(){return this.x.transUnit("temp")+" / "+this.y.transUnit("%")}}})},point:function(d,a){var b=$("#"+this.id).highcharts(),c=b.series[2].data[0];a[0]||(a[0]=c.x);a[1]||(a[1]=c.y);b.series[2].data[0].update([1*a[0],1*a[1]],!0)}});
$(document).delegate('div[data-widget="plot.period"]',{update:function(d,a){for(var b=$(this).attr("data-label").explode(),c=$(this).attr("data-color").explode(),e=$(this).attr("data-exposure").explode(),f=$(this).attr("data-axis").explode(),h=$(this).attr("data-zoom"),g=[],k=0;k<a.length;k++)g[k]={type:"stair"!=e[k]?e[k]:"line",step:"stair"==e[k]?"left":!1,name:b[k],data:a[k],color:c[k]?c[k]:null};h?$("#"+this.id).highcharts({chart:{zoomType:"x"},series:g,xAxis:{type:"datetime",title:{text:f[0]},
minRange:(new Date).duration(h).valueOf()},yAxis:{min:$(this).attr("data-ymin"),max:$(this).attr("data-ymax"),title:{text:f[1]}}}):$("#"+this.id).highcharts({series:g,xAxis:{type:"datetime",title:{text:f[0]}},yAxis:{min:$(this).attr("data-ymin"),max:$(this).attr("data-ymax"),title:{text:f[1]}}})},point:function(d,a){for(var b=0;b<a.length;b++)if(a[b]){for(var c=$("#"+this.id).highcharts(),e=0;e<a[b].length;e++)c.series[b].addPoint(a[b][e],!1,100<=c.series[b].data.length);c.redraw()}}});
$(document).delegate('div[data-widget="plot.rtr"]',{update:function(d,a){for(var b=$(this).attr("data-label").explode(),c=$(this).attr("data-axis").explode(),e=a[2],f=e[0][0],h=0,g=1;g<e.length;g++)h+=e[g-1][1]*(e[g][0]-f),f=e[g][0];h/=f-e[0][0];1>h?h*=100:100<h&&(h=h/255*100);$("#"+this.id).highcharts({chart:{type:"line"},series:[{name:b[0],data:a[0],type:"spline"},{name:b[1],data:a[1],dashStyle:"shortdot",step:"left"},{type:"pie",name:"\u2211 On: ",data:[{name:"On",y:h},{name:"Off",y:100-h,color:null}],
center:["95%","90%"],size:35,showInLegend:!1,dataLabels:{enabled:!1}}],xAxis:{type:"datetime"},yAxis:{min:$(this).attr("data-min"),max:$(this).attr("data-max"),title:{text:c[1]}},tooltip:{formatter:function(){return this.series.name+" <b>"+(this.percentage?this.y.transUnit("%"):this.y.transUnit("temp"))+"</b>"}}})},point:function(d,a){for(var b=0;b<a.length;b++){var c=$("#"+this.id).highcharts();if(a[b]&&(0==b||1==b))for(var e=0;e<a[b].length;e++)c.series[b].addPoint(a[b][e],!1,100<=c.series[b].data.length);
c.redraw()}}});
$(document).delegate('div[data-widget="plot.temprose"]',{update:function(d,a){var b=$(this).attr("data-label").explode(),c=$(this).attr("data-axis").explode(),e=parseInt($(this).attr("data-count")),f=[];f[0]={name:b[0],pointPlacement:"on",data:a.slice(0,e)};a.slice(e).length==e&&(f[1]={name:b[1],pointPlacement:"on",data:a.slice(e),dashStyle:"shortdot"});$("#"+this.id).highcharts({chart:{polar:!0,type:"line",marginLeft:10},series:f,xAxis:{categories:c,tickmarkPlacement:"on",lineWidth:0},yAxis:{gridLineInterpolation:"polygon",
lineWidth:0},tooltip:{formatter:function(){return this.x+" - "+this.series.name+": <b>"+this.y.transUnit("temp")+"</b>"}},legend:{x:10,layout:"vertical"}})},point:function(d,a){var b=$("#"+this.id).highcharts(),c=b.series[2].data[0];a[0]||(a[0]=c.x);a[1]||(a[1]=c.y);b.series[2].data[0].update([1*a[0],1*a[1]],!0)}});
$(document).delegate('span[data-widget="status.log"]',{update:function(d,a){var b,c="";if(a[0]instanceof Array){for(var e=a[0].slice(0,$(this).attr("data-count")),f=0;f<e.length;f++)b='<div class="color '+e[f].level.toLowerCase()+'"></div>',b+="<h3>"+(new Date(e[f].time)).transLong()+"</h3>",b+="<p>"+e[f].message+"</p>",c+='<li data-icon="false">'+b+"</li>";$("#"+this.id+" ul").html(c).trigger("prepare").listview("refresh").trigger("redraw")}}});
$(document).delegate('span[data-widget="status.notify"]',{update:function(d,a){0!=a[0]&&(notify.add($(this).attr("data-mode"),$(this).attr("data-signal"),$("#"+this.id+" h1").html(),"<b>"+a[1]+"</b><br  />"+$("#"+this.id+" p").html()),notify.display())}});
$(document).delegate('svg[data-widget^="icon."]',{update:function(d,a){a instanceof Array&&this.setAttributeNS(null,"class","icon"+(a[0]&&a[1]?" icon1":" icon0"))},click:function(d){$(this).attr("data-item")&&(d=$(this).attr("data-item").explode(),d[1]&&io.write(d[1],0==widget.get(d[1])?1:0))}});
$(document).delegate('svg[data-widget="icon.arrow"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*2*Math.PI,c=[],c=c.concat([50,50],fx.rotate([25,50],b,[50,50]),fx.rotate([50,18],b,[50,50]),fx.rotate([75,50],b,[50,50]),[50,50]);$("#"+this.id+" #line0").attr("points",c.toString());c=[];c=c.concat(fx.rotate([32,50],b,[50,50]),fx.rotate([32,60],b,[50,50]),fx.rotate([68,60],b,[50,50]),fx.rotate([68,50],b,[50,50]));$("#"+this.id+" #line1").attr("points",c.toString())}});
$(document).delegate('svg[data-widget="icon.battery"]',{update:function(d,a){var b=Math.round(a[0]/$(this).attr("data-max")*40);fx.grid(this,b,[39,68],[61,28])}});$(document).delegate('svg[data-widget="icon.blade"]',{update:function(d,a){for(var b=a[0]/$(this).attr("data-max")*0.4*Math.PI,c,e=0;3>=e;e++)c=[],c=c.concat(fx.rotate([37,20+20*e],b,[50,20+20*e]),fx.rotate([63,20+20*e],b,[50,20+20*e])),$("#"+this.id+" #blade"+e).attr("points",c.toString())}});
$(document).delegate('svg[data-widget="icon.blade_z"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*0.5*Math.PI*-1,c=[],c=c.concat(fx.rotate([25,25],b,[50,30]),fx.rotate([45,25],b,[50,30]),fx.rotate([55,35],b,[50,30]),fx.rotate([75,35],b,[50,30]));$("#"+this.id+" #blade0").attr("points",c.toString());c=[];c=c.concat(fx.rotate([25,65],b,[50,70]),fx.rotate([45,65],b,[50,70]),fx.rotate([55,75],b,[50,70]),fx.rotate([75,75],b,[50,70]));$("#"+this.id+" #blade1").attr("points",c.toString())}});
$(document).delegate('svg[data-widget="icon.blade_arc"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*-0.7*Math.PI+0.35*Math.PI,c;c="M "+fx.rotate([30,40],b,[50,37])+" Q "+fx.rotate([50,22],b,[50,30])+" "+fx.rotate([70,40],b,[50,37]);$("#"+this.id+" #blade0").attr("d",c);c="M "+fx.rotate([30,80],b,[50,77])+" Q "+fx.rotate([50,62],b,[50,70])+" "+fx.rotate([70,80],b,[50,77]);$("#"+this.id+" #blade1").attr("d",c)}});
$(document).delegate('svg[data-widget="icon.clock"]',{update:function(d,a){var b=a[0]%60/60*2*Math.PI;$("#"+this.id+" #hand_l").attr("points","50,50 "+fx.rotate([50,30],b,[50,50]).toString());b=5*Math.floor(a[0]/60)/60*2*Math.PI;$("#"+this.id+" #hand_s").attr("points","50,50 "+fx.rotate([50,35],b,[50,50]).toString())}});
$(document).delegate('svg[data-widget="icon.compass"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*2*Math.PI,c=[],c=c.concat(fx.rotate([40,50],b,[50,50]),fx.rotate([50,25],b,[50,50]),fx.rotate([60,50],b,[50,50]));$("#"+this.id+" #pin0").attr("points",c.toString());c=[];c=c.concat(fx.rotate([40,50],b,[50,50]),fx.rotate([50,75],b,[50,50]),fx.rotate([60,50],b,[50,50]));$("#"+this.id+" #pin1").attr("points",c.toString())}});
$(document).delegate('svg[data-widget="icon.graph"]',{update:function(d,a){var b=Math.round(a[0]/$(this).attr("data-max")*70),c=$("#"+this.id+" #graph").attr("d").substr(8),e=c.split("L");8<e.length&&e.shift();for(var c="M 15,85 ",f=1;f<e.length;f++)c+="L "+(10*f+5)+","+e[f].substr(e[f].indexOf(",")+1).trim()+" ";$("#"+this.id+" #graph").attr("d",c+"L "+(10*f+5)+","+(85-b))}});
$(document).delegate('svg[data-widget="icon.meter"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*0.44*Math.PI;$("#"+this.id+" #pointer").attr("points","50,85 "+fx.rotate([15,48],b,[50,85]).toString())}});$(document).delegate('svg[data-widget="icon.shutter"]',{update:function(d,a){var b=Math.round(a[0]/$(this).attr("data-max")*38);fx.grid(this,b,[14,30],[86,68])}});
$(document).delegate('svg[data-widget="icon.windrose"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*2*Math.PI,c=[],c=c.concat(fx.rotate([50,60],b,[50,50]),fx.rotate([37,71],b,[50,50]),fx.rotate([50,29],b,[50,50]));$("#"+this.id+" #pin0").attr("points",c.toString());c=[];c=c.concat(fx.rotate([50,60],b,[50,50]),fx.rotate([63,71],b,[50,50]),fx.rotate([50,29],b,[50,50]));$("#"+this.id+" #pin1").attr("points",c.toString())}});
$(document).delegate('svg[data-widget="icon.windsock"]',{update:function(d,a){var b=a[0]/$(this).attr("data-max")*0.45*Math.PI,c=[],c=c.concat(fx.rotate([70,40],b,[80,22]),[80,22],fx.rotate([90,40],b,[80,22]));$("#"+this.id+" #top").attr("points",c.toString());for(var e=0;3>e;e++)c=[],c=c.concat(fx.rotate([71+2*e,50+14*e],b,[80,22]),fx.rotate([89-2*e,50+14*e],b,[80,22]),fx.rotate([88-2*e,54+14*e],b,[80,22]),fx.rotate([72+2*e,54+14*e],b,[80,22])),$("#"+this.id+" #part"+e).attr("points",c.toString());
c=[];c=c.concat(fx.rotate([70,40],b,[80,22]),fx.rotate([76,82],b,[80,22]),fx.rotate([84,82],b,[80,22]),fx.rotate([90,40],b,[80,22]));$("#"+this.id+" #part3").attr("points",c.toString())}}); 
