if(typeof dailychart=="undefined"){var dailychart=function(f){return dailychart.addChart(f)};(function(f){var m=[];f.addChart=function(a){var b=null,h=document.getElementById(a);if(h)h.innerHTML="",a=f.getChart(a),a>-1&&m.splice(a,1),b=new f.chart(h),m.push(b);return b};f.getChart=function(a){for(var b=0;b<m.length;b++)if(m[b].id()==a)return b;return-1};f.chart=function(a){function b(i){var i=n(i,!0),c=e.width-d[1]-d[3],a=j[j.length-1].key;jwplayer().seek(Math.ceil(i.x/c*a))}function h(i){k.setAttribute("width",
e.width);k.setAttribute("height",e.height);var c=e.height-d[0]-d[2],a=e.maximum.toString().length,b=k.getContext("2d");b.font="normal 11px sans-serif";b.textBaseline="middle";b.textAlign="right";d[3]=20+(a+e.unit.length)*6;for(var g=0;g<=5;g++){var h=Math.round(d[0]+c/5*g),p=(e.maximum*(5-g)/5).toString().substr(0,a)+e.unit;b.fillStyle="#FFFFFF";b.fillRect(d[3],h,e.width-d[3]-d[1],1);b.fillStyle="#000000";b.fillText(p,d[3]-8,h)}e.column=(e.width-d[1]-d[3])/(j.length-1);c=1;e.column<5?c=40:e.column<
10?c=20:e.column<20?c=10:e.column<40?c=5:e.column<100&&(c=2);a=k.getContext("2d");a.textBaseline="top";a.textAlign="left";b=e.height-d[0]-d[2];for(g=0;g<j.length;g+=c)if(h=d[3]+e.column*g,p=e.height-d[2]+8,h<e.width-d[1]-50)a.fillStyle="#FFFFFF",a.fillRect(h,d[0],1,b),a.fillStyle="#000000",e.labels=="date"?a.fillText(f.utils.date(j[g].key),h,p):a.fillText(f.utils.digits(j[g].key),h,p);a.fillStyle="#FFFFFF";a.fillRect(e.width-d[1],d[0],1,b);if(i)c=k.getContext("2d"),a=e.height-d[0]-d[2],i=Math.min(i/
j[j.length-1].key,1)*(e.width-d[1]-d[3]),c.fillStyle=f.utils.rgba(e.lightcolor,0.25),c.fillRect(d[3],d[0],i,a),c.beginPath(),c.moveTo(d[3]+i,d[0]),c.lineTo(d[3]+i,e.height-d[2]),c.lineCap="round",c.lineWidth=3,c.strokeStyle="#"+e.lightcolor.substr(-6),c.stroke(),c.closePath();i=e.height-d[0]-d[2];c=k.getContext("2d");c.beginPath();for(a=0;a<j.length;a++){var b=Math.round(j[a].value/e.maximum*i),l=j[a].xps=d[3]+e.column*a,b=j[a].yps=d[0]+i-b;a==0?c.moveTo(l,b):c.lineTo(l,b)}c.lineWidth=4;c.lineJoin=
"round";c.lineCap="round";c.strokeStyle="#"+e.color.substr(-6);c.stroke();if(e.labels=="date")c.fillStyle=f.utils.rgba(e.color,0.25),c.lineTo(l,d[0]+i),c.lineTo(d[3],d[0]+i),c.fill();c.closePath();if(e.column>20){l=e.height-d[0]-d[2];i=k.getContext("2d");i.lineWidth=4;i.strokeStyle="#FFFFFF";i.fillStyle="#"+e.color.substr(-6);for(c=0;c<j.length;c++)b=Math.round(j[c].value/e.maximum*l),a=j[c].xps=d[3]+e.column*c,b=j[c].yps=d[0]+l-b,i.beginPath(),i.arc(a,b,4,0,Math.PI*2,!1),i.stroke(),i.fill(),i.closePath()}}
function g(a){a.preventDefault();var c,b=j[0],e=n(a),d=e.x,g=Math.abs(d-b.xps);if(d<j[0].xps||d>j[j.length-1].xps)q();else{f.utils.style(l,{display:"block"});for(a=1;a<j.length;a++)c=Math.abs(d-j[a].xps),c<g&&(g=c,b=j[a]);f.utils.style(l,{top:e.chart.y+b.yps-14+"px",left:e.chart.x+b.xps+"px"});l.innerHTML=f.utils.date(b.key)+": <strong>"+b.value+"</strong>"}}function q(){f.utils.style(l,{display:"none"})}function n(a,c){var b,e,f,g=0,h=0;"ontouchend"in document?(e=g=a.touches[0].pageX,f=h=a.touches[0].pageY):
a.pageX!=void 0?(e=g=a.pageX,f=h=a.pageY):(e=g=a.clientX,f=h=a.clientY);b=k;do g-=b.offsetLeft,h-=b.offsetTop;while(b=b.offsetParent);typeof c=="boolean"&&c&&(g-=d[3],h-=d[0]);return{x:g,y:h,chart:{x:e-g,y:f-h},page:{x:e,y:f}}}var k,l,j=[],d=[20,20,30,20],o,e={color:"1369BF",column:50,debug:"none",data:void 0,height:200,lightcolor:"46800d",labels:"date",maximum:0,primary:"canvas",rounding:!0,swf:"../dailychart.swf",unit:"",width:720,pointerbg:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAAAkCAYAAABSZHLHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAthJREFUeNrsnMGrEkEcx2dX7RWZdDEQEoIuejEQBB+8Lh4F/4FA/Bs6RdHRg7fqdQkPeujQ2aP3IAQ7PL0Ivm4hKMQrn5um224zvpneZLvuunV4u36/8GVnYQTnNx9+s7vMbxTiXYrNNUjy65hMD31Nq98qHoOmcoekthJAMBQfjsu0m+wt/Q3un1Lb9AKIgCFSq9XipVLp4Xw+D+u6rhqGEagMkkwmH4gxmabpi7EpimKOx+PT5XKpqarqKouwfo1G40O9Xv9Cb5fUP6h1DstOAxcZ42AymTyJx+PPCRQYDQaDF+l0+iVtnlPPqVcMEnVXOEaj0VPAETylUqnHhULhHm3eYvMsHhtCu8KRSCSeIZzBFF1KT1ut1ie+zLjKIIBjj6Rp2g16YY6IDKICDkhotVpFOBxhPv9EBRyQEH9rU6XXe8sMAjj2W8omDIAD2vqcATggR0DE2gM4oD8UluCI8C+kgAP6K4OEqtXqHXwhhawAYRkkXC6XHyEckB0goVgsdohwQLaARKPRHMIB2QGiTKfTjwgHZAXIekdRp9N5i3BAdoDoxWLxfb/ff42QQJaAUM8zmcxxt9t9g7BAm4Cw/YcL6vNcLndMl5s6QgNtAsJ2EGnUX/P5/CtAAglAiAQJ22rGNq2eARJIBoTJACTQNkAACeQICCCBTCdAAMm+ZouLajxRdrn2tl3tgGTP1Gw2T/jbrM7nnzjVxQCSPVG73X7X6/XG5LLscp1J3Nbm/t6vSh2lvn10dHS3UqkcLhaLA13Xw0Eq3mbF2tls9r5o++m/D4fDz7PZbCHuWUG307LCMgeH44yaFXF/o/7OMomn4m1yUX11k/s6uSy0CQokoi5ErhHxywPm5nOEU3+DZwyWOTSyUbzt+fgH6msclggHJ0hwyJD4DRAiAUJcQqJzIP7p+Ac5gDhA5upnETdwyFnkvxwgYxdEQnAE1ZX9luGyryVUvwQYAJb/TJexLGqIAAAAAElFTkSuQmCC"};this.id=function(){return a.id};this.setup=
function(d){f.utils.extend(e,d);if(e.labels=="timecode")jwplayer().onTime(this.select),e.click="function(pos){jwplayer().seek(pos);}";var d=f.utils.hasCanvas(),c=f.utils.hasFlash();e.primary=="canvas"?d?o="canvas":c&&(o="flash"):c?o="flash":d&&(o="canvas");if(o=="canvas"){for(var d=e.data.split(","),c=0.0099,n=0;n<d.length;n++){var m=d[n].split(":");j.push({key:m[0],value:m[1]});c=Math.max(m[1],c)}for(d=0;c<10;)d--,c*=10;c=Math.round(c);d+=c.toString().length;c=parseInt(c.toString().substr(0,2));
c%5>0&&(c+=5-c%5);e.maximum=c*Math.pow(10,d-2);d=String(e.maximum);if(d.indexOf("0000")>2)e.maximum=Number(d.substr(0,d.indexOf("0000")));if(e.rounding&&e.maximum<5)e.maximum=5;k=document.createElement("canvas");a.appendChild(k);f.utils.style(k,{background:"#EBEBEB",border:"none",display:"block",margin:"0",padding:0});h();if(e.labels=="timecode")k.onclick=b,k.style.cursor="pointer";if(e.labels!="timecode")l=document.createElement("div"),document.body.appendChild(l),f.utils.style(l,{position:"absolute",
display:"none",top:"0px",left:"0px",width:"136px",height:"36px",padding:"8px 0 8px 16px",transition:"all 200ms ease",webkitTransition:"all 200ms ease",mozTransition:"all 200ms ease",fontSize:"12px",lineHeight:"18px",fontFamily:"Arial, sans-serif",background:"transparent url("+e.pointerbg+") no-repeat 0 0"}),l.onmousemove=g,"ontouchend"in document?(k.ontouchmove=g,k.ontouchend=q):(k.onmousemove=g,k.onmouseout=q)}else o=="flash"?f.utils.embedFlash(a,e):a.innerHTML="No canvas, no Flash..."};this.select=
function(b){o=="flash"?document.getElementById(a.id+"_swf").select(b.position):o=="canvas"&&h(b.position)}};f.utils=function(){};f.utils.date=function(a){var b=new Date;b.setTime(Number(a)*1E3+(b.getTimezoneOffset()+60)*6E4);var a="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(",")[b.getMonth()],h=f.utils.zero(b.getDate()),b=b.getFullYear();return a+" "+h+", "+b};f.utils.digits=function(a){var b=f.utils.zero(Math.floor(a/60)),a=f.utils.zero(Math.floor(a%60));return b+":"+a};f.utils.embedFlash=
function(a,b){var f="",g;for(g in b)f+="&"+g+"="+encodeURIComponent(b[g]);g="<embed";g+=" src='"+b.swf+"'";g+=" flashvars='"+f+"'";g+=" height='"+b.height+"'";g+=" width='"+b.width+"'";g+=" id='"+a.id+"_swf'";g+=" name='"+a.id+"_swf'";g+=" wmode='opaque'";g+=" bgcolor='#ebebeb'";g+=" allowscriptaccess='always'";g+=" style='display:block; padding:0; margin:0; border:0;' />";a.innerHTML=g};f.utils.extend=function(){var a=f.utils.extend.arguments;if(a.length>1){for(var b=1;b<a.length;b++)for(var h in a[b])a[0][h]=
a[b][h];return a[0]}return null};f.utils.hasCanvas=function(){var a=document.createElement("canvas");return a.getContext&&typeof a.getContext("2d").fillText=="function"};f.utils.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined")return!0;if(typeof window.ActiveXObject!="undefined")try{return new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),!0}catch(a){}return!1};f.utils.rgba=function(a,b){var a=a.substr(-6),f=parseInt(a.substr(0,
2),16).toString(),g=parseInt(a.substr(2,2),16).toString(),m=parseInt(a.substr(4,2),16).toString(),n=1;b&&(n=b);return"rgba("+f+","+g+","+m+","+n+")"};f.utils.style=function(a,b){for(var f in b)a.style[f]=b[f]};f.utils.zero=function(a){return a<10?"0"+a:""+a}})(dailychart)};

