$.fn.wave=function(e){var t=$.extend({wavelength:100,amplitude:60,phase:0,width:600,color:"DodgerBlue",bgColor:"",thickness:3,paddingH:0,paddingV:0,grid:false,gridSize:20,gridThickness:1,gridColor:"lightBlue"},e);var n=t.width+t.paddingH*2;var r=t.amplitude*2+t.paddingV*2;this.css({width:n,height:r,display:"inline-block"});var i=document.createElement("canvas");i.width=n;i.height=r;document.getElementById(this.attr("id")).appendChild(i);var s=document.createElement("canvas");s.width=n;s.height=r;var o=s.getContext("2d");o.clearRect(0,0,s.width,s.height);if(t.bgColor!=""){o.fillStyle=t.bgColor;o.fillRect(0,0,s.width,s.height)}if(t.grid){o.strokeStyle=t.gridColor;o.lineWidth=t.gridThickness;var u=t.gridSize;o.beginPath();for(var a=1;a