(function(){JsBarcode=function(f,g,b){var d=JsBarcode.defaults,k;for(k in b)d[k]=b[k];b=d;d=document.createElement("canvas");if(!d.getContext)return f;g=new window[b.format](g);if(!g.valid())return this;g=g.encoded();k=d.getContext("2d");d.width=g.length*b.width+2*b.quite;d.height=b.height;k.clearRect(0,0,d.width,d.height);b.backgroundColor&&(k.fillStyle=b.backgroundColor,k.fillRect(0,0,d.width,d.height));k.fillStyle=b.lineColor;for(var l=0;l","11011011000",30],["?","11011000110",31],["@","11000110110", 32],["A","10100011000",33],["B","10001011000",34],["C","10001000110",35],["D","10110001000",36],["E","10001101000",37],["F","10001100010",38],["G","11010001000",39],["H","11000101000",40],["I","11000100010",41],["J","10110111000",42],["K","10110001110",43],["L","10001101110",44],["M","10111011000",45],["N","10111000110",46],["O","10001110110",47],["P","11101110110",48],["Q","11010001110",49],["R","11000101110",50],["S","11011101000",51],["T","11011100010",52],["U","11011101110",53],["V","11101011000", 54],["W","11101000110",55],["X","11100010110",56],["Y","11101101000",57],["Z","11101100010",58],["[","11100011010",59],["\\","11101111010",60],["]","11001000010",61],["^","11110001010",62],["_","10100110000",63],["`","10100001100",64],["a","10010110000",65],["b","10010000110",66],["c","10000101100",67],["d","10000100110",68],["e","10110010000",69],["f","10110000100",70],["g","10011010000",71],["h","10011000010",72],["i","10000110100",73],["j","10000110010",74],["k","11000010010",75],["l","11001010000", 76],["m","11110111010",77],["n","11000010100",78],["o","10001111010",79],["p","10100111100",80],["q","10010111100",81],["r","10010011110",82],["s","10111100100",83],["t","10011110100",84],["u","10011110010",85],["v","11110100100",86],["w","11110010100",87],["x","11110010010",88],["y","11011011110",89],["z","11011110110",90],["{","11110110110",91],["|","10101111000",92],["}","10100011110",93],["~","10001011110",94],[String.fromCharCode(127),"10111101000",95],[String.fromCharCode(128),"10111100010", 96],[String.fromCharCode(129),"11110101000",97],[String.fromCharCode(130),"11110100010",98],[String.fromCharCode(131),"10111011110",99],[String.fromCharCode(132),"10111101110",100],[String.fromCharCode(133),"11101011110",101],[String.fromCharCode(134),"11110101110",102],[String.fromCharCode(135),"11010000100",103],[String.fromCharCode(136),"11010010000",104],[String.fromCharCode(137),"11010011100",105]],s="1100011101011",r=/^[!-~ ]+$/,n={code128B:function(a){return d(a,k,104,q)},code128C:function(a){a= a.replace(/ /g,"");return d(a,l,105,e)}}}function CODE128B(f){return new CODE128(f,"B")}function CODE128C(f){return new CODE128(f,"C")};(function(f,g){var b={backgroundColor:"#fff",lineColor:"#000",strict:!1},d=function(b,a){var c=b.length;return(b.substring(0,c-(""+a).length)+a).substring(0,c)},k=function(e){var a=g.createElement("canvas"),c=a.getContext("2d");a.width=e.offsetWidth;a.height=e.offsetHeight;c.clearRect(0,0,a.width,a.height);c.fillStyle=b.backgroundColor;c.fillRect(0,0,a.width,a.height);c.fillStyle=b.lineColor;c.textAlign="center";c.textBaseline="middle";c.fillText("Virheellinen pankkiviivakoodi",a.width/2,a.height/ 2);a=a.toDataURL("image/png");e.setAttribute("src",a)},l=function(b,a,c,d,f,g,l,m){c=function(a){k(b);throw a;};20f.length&&c("Viitenumero liian lyhyt (min. 4).");18!=a.length&&c("IBAN tilinumero virheellinen.");"FI"!==a.substring(0,2)&&c("IBAN tilinumero ei FI-alkuinen.")},q=function(d,a,c,f,g,l,p,m){a=function(a,c){if(b.strict)throw k(d),a;console.warn(a+" "+c)};if(0>c||999999f||99arguments.length)throw k(e),"Unohdit antaa kaikki function vaatimat parametrit.";"number"!==typeof g&&(g=parseInt(g.replace(/ /g,"")));a=(""+a).replace(/ /g,"");l(e,a,c,f,g,n,p,m);q(e,a,c,f,g,n,p,m);a=a.replace("FI","");c=d("000000",c);f=d("00",f);g=d("00000000000000000000",g);m=(""+m).substr(-2); p=d("00",p);n=d("00",n);JsBarcode(e,"4"+a+c+f+"000"+g+m+p+n,{width:4,height:e.offsetHeight,quite:20,format:"CODE128C",backgroundColor:b.backgroundColor,lineColor:b.lineColor})};f.Pankkiviivakoodi=b})(window,document);