// THIS FILE HAS BEEN MINIFIED

if(typeof(RGraph) == 'undefined') RGraph = {isRGraph:true,type:'common'};RGraph.Contextmenu = function (canvas, menuitems, e)
{
e = RGraph.FixEventObject(e);if(RGraph.Registry.Get('chart.contextmenu')){
RGraph.HideContext();}
RGraph.HideZoomedCanvas();RGraph.HidePalette();canvas.__object__.Set('chart.mousedown', false)
var x = e.pageX;var y = e.pageY;var div = document.createElement('div');var bg = document.createElement('div');div.className = 'RGraph_contextmenu';div.__canvas__ = canvas; 
div.style.position = 'absolute';div.style.left = 0;div.style.top = 0;div.style.border = '1px solid black';div.style.backgroundColor = 'white';div.style.boxShadow = '3px 3px 3px rgba(96,96,96,0.5)';div.style.MozBoxShadow = '3px 3px 3px rgba(96,96,96,0.5)';div.style.WebkitBoxShadow = '3px 3px 3px rgba(96,96,96,0.5)';div.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(color=#aaaaaa,direction=135)';div.style.opacity = 0;bg.className = 'RGraph_contextmenu_background';bg.style.position = 'absolute';bg.style.backgroundColor = '#ccc';bg.style.borderRight = '1px solid #aaa';bg.style.top = 0;bg.style.left = 0;bg.style.width = '18px';bg.style.height = '100%';bg.style.opacity = 0;div = document.body.appendChild(div);bg = div.appendChild(bg);for (i=0; i<menuitems.length; ++i){
var menuitem = document.createElement('div');menuitem.__canvas__ = canvas;menuitem.__contextmenu__ = div;menuitem.className = 'RGraph_contextmenu_item';if(menuitems[i]){
menuitem.style.padding = '2px 5px 2px 23px';menuitem.style.fontFamily = 'Arial';menuitem.style.fontSize = '10pt';menuitem.style.fontWeight = 'normal';menuitem.innerHTML = menuitems[i][0];if(RGraph.is_array(menuitems[i][1])){
menuitem.style.backgroundImage = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAQUlEQVQImY3NoQ2AMABE0ZewABMyGQ6mqWODzlAclBSFO8HZl8uf0FFxCHtwYkt4Y6ChYE44cGH9/fyae2p2LAleW9oVTQuVf6gAAAAASUVORK5CYII=)';menuitem.style.backgroundRepeat = 'no-repeat';menuitem.style.backgroundPosition = '97% center';}
if(menuitems[i][1]){
if(menuitem.addEventListener){
menuitem.addEventListener("mouseover", function (e){RGraph.HideContextSubmenu(); e.target.style.backgroundColor = 'rgba(0,0,0,0.2)'; e.target.style.cursor = 'pointer';}, false);menuitem.addEventListener("mouseout", function (e){e.target.style.backgroundColor = 'inherit'; e.target.style.cursor = 'default';}, false);} else  {
menuitem.attachEvent("onmouseover", function (){RGraph.HideContextSubmenu();event.srcElement.style.backgroundColor = '#eee';event.srcElement.style.cursor = 'pointer';}
, false);menuitem.attachEvent("onmouseout", function (){event.srcElement.style.backgroundColor = 'inherit'; event.srcElement.style.cursor = 'default';}, false);}
} else {
if(menuitem.addEventListener){
menuitem.addEventListener("mouseover", function (e){e.target.style.cursor = 'default';}, false);menuitem.addEventListener("mouseout", function (e){e.target.style.cursor = 'default';}, false);} else  {
menuitem.attachEvent("onmouseover", function (){event.srcElement.style.cursor = 'default'}, false);menuitem.attachEvent("onmouseout", function (){event.srcElement.style.cursor = 'default';}, false);}
}
} else {
menuitem.style.borderBottom = '1px solid #ddd';menuitem.style.marginLeft = '25px';}
div.appendChild(menuitem);if(menuitems[i] && menuitems[i][1] && typeof(menuitems[i][1]) == 'function'){
if(document.all){
menuitem.attachEvent('onclick', menuitems[i][1]);menuitem.attachEvent('onclick', function (){RGraph.HideContext();});} else {
menuitem.addEventListener('click', menuitems[i][1], false);}
} else if(menuitems[i] && menuitems[i][1] && RGraph.is_array(menuitems[i][1])){
var tmp = menuitems[i][1];menuitem.addEventListener('mouseover', function (e){RGraph.Contextmenu_submenu(canvas.__object__, tmp, e.target);}, false);}
}
div.style.width = (div.offsetWidth + 10) + 'px';div.style.height = (div.offsetHeight - (RGraph.isIE9() ? 10 : 2)) + 'px';if(document.all){
bg.style.height = (div.offsetHeight - 10) + 'px';}
if(x + div.offsetWidth > document.body.offsetWidth){
x -= div.offsetWidth;}
div.style.left = x + 'px';div.style.top = y + 'px';setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu')) obj.style.opacity = 0.2", 50);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu')) obj.style.opacity = 0.4", 100);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu')) obj.style.opacity = 0.6", 150);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu')) obj.style.opacity = 0.8", 200);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu')) obj.style.opacity = 1", 250);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu.bg')) obj.style.opacity = 0.2", 50);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu.bg')) obj.style.opacity = 0.4", 100);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu.bg')) obj.style.opacity = 0.6", 150);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu.bg')) obj.style.opacity = 0.8", 200);setTimeout("if(obj = RGraph.Registry.Get('chart.contextmenu.bg')) obj.style.opacity = 1", 250);RGraph.Registry.Set('chart.contextmenu', div);RGraph.Registry.Set('chart.contextmenu.bg', bg);RGraph.Registry.Get('chart.contextmenu').oncontextmenu = function (){return false;};RGraph.Registry.Get('chart.contextmenu.bg').oncontextmenu = function (){return false;};canvas.addEventListener('click', function (){RGraph.HideContext();}, false);window.onclick = function (e)
{
RGraph.HideContext();if(e.target.onclick && e.button == 0){
e.target.onclick(e);}
}
window.onresize = function (){RGraph.HideContext();}
e.stopPropagation();RGraph.FireCustomEvent(canvas.__object__, 'oncontextmenu');return false;}
RGraph.HideContext = function ()
{
var cm = RGraph.Registry.Get('chart.contextmenu');var cmbg = RGraph.Registry.Get('chart.contextmenu.bg');RGraph.HideContextSubmenu();if(cm){
cm.parentNode.removeChild(cm);cmbg.parentNode.removeChild(cmbg);cm.style.visibility = 'hidden';cm.style.display = 'none';RGraph.Registry.Set('chart.contextmenu', null);cmbg.style.visibility = 'hidden';cmbg.style.display = 'none';RGraph.Registry.Set('chart.contextmenu.bg', null);}
}
RGraph.HideContextSubmenu = function ()
{
var sub = RGraph.Registry.Get('chart.contextmenu.submenu');if(sub){
sub.style.visibility = 'none';sub.style.display = 'none';RGraph.Registry.Set('chart.contextmenu.submenu', null);}
}
RGraph.ShowContext = function (obj)
{
RGraph.HidePalette();if(obj.Get('chart.contextmenu') && obj.Get('chart.contextmenu').length){
var isOpera = navigator.userAgent.indexOf('Opera') >= 0;var isSafari = navigator.userAgent.indexOf('Safari') >= 0;var isChrome = navigator.userAgent.indexOf('Chrome') >= 0;var isMacFirefox = navigator.userAgent.indexOf('Firefox') > 0 && navigator.userAgent.indexOf('Mac') > 0;if(((!isOpera && !isSafari) || isChrome) && !isMacFirefox){
obj.canvas.oncontextmenu = function (e)
{
e = RGraph.FixEventObject(e);if(e.ctrlKey) return true;RGraph.Contextmenu(obj.canvas, obj.Get('chart.contextmenu'), e);return false;}
} else {
obj.canvas.addEventListener('dblclick', function (e)
{
if(e.ctrlKey) return true;if(!RGraph.Registry.Get('chart.contextmenu')){
RGraph.Contextmenu(obj.canvas, obj.Get('chart.contextmenu'), e);}
}, false);}
}
}
RGraph.Contextmenu_submenu = function (obj, menuitems, parentMenuItem)
{
RGraph.HideContextSubmenu();var canvas = obj.canvas;var context = obj.context;var menu = parentMenuItem.parentNode;var subMenu = document.createElement('DIV');subMenu.style.position = 'absolute';subMenu.style.width = '100px';subMenu.style.top = menu.offsetTop + parentMenuItem.offsetTop + 'px';subMenu.style.left = (menu.offsetLeft + menu.offsetWidth) + 'px';subMenu.style.backgroundColor = 'white';subMenu.style.border = '1px solid black';subMenu.className = 'RGraph_contextmenu';subMenu.__contextmenu__ = menu;subMenu.style.boxShadow = '3px 3px 3px rgba(96,96,96,0.5)';subMenu.style.MozBoxShadow = '3px 3px 3px rgba(96,96,96,0.5)';subMenu.style.WebkitBoxShadow = '3px 3px 3px rgba(96,96,96,0.5)';subMenu.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(color=#aaaaaa,direction=135)';document.body.appendChild(subMenu);for (var i=0; i<menuitems.length; ++i){
var menuitem = document.createElement('DIV');menuitem.__canvas__ = canvas;menuitem.__contextmenu__ = menu;menuitem.className = 'RGraph_contextmenu_item';if(menuitems[i]){
menuitem.style.padding = '2px 5px 2px 23px';menuitem.style.fontFamily = 'Arial';menuitem.style.fontSize = '10pt';menuitem.style.fontWeight = 'normal';menuitem.innerHTML = menuitems[i][0];if(menuitems[i][1]){
if(menuitem.addEventListener){
menuitem.addEventListener("mouseover", function (e){e.target.style.backgroundColor = 'rgba(0,0,0,0.2)'; e.target.style.cursor = 'pointer';}, false);menuitem.addEventListener("mouseout", function (e){e.target.style.backgroundColor = 'inherit'; e.target.style.cursor = 'default';}, false);} else  {
menuitem.attachEvent("onmouseover", function (){event.srcElement.style.backgroundColor = 'rgba(0,0,0,0.2)'; event.srcElement.style.cursor = 'pointer'}, false);menuitem.attachEvent("onmouseout", function (){event.srcElement.style.backgroundColor = 'inherit'; event.srcElement.style.cursor = 'default';}, false);}
} else {
if(menuitem.addEventListener){
menuitem.addEventListener("mouseover", function (e){e.target.style.cursor = 'default';}, false);menuitem.addEventListener("mouseout", function (e){e.target.style.cursor = 'default';}, false);} else  {
menuitem.attachEvent("onmouseover", function (){event.srcElement.style.cursor = 'default'}, false);menuitem.attachEvent("onmouseout", function (){event.srcElement.style.cursor = 'default';}, false);}
}
} else {
menuitem.style.borderBottom = '1px solid #ddd';menuitem.style.marginLeft = '25px';}
subMenu.appendChild(menuitem);if(menuitems[i] && menuitems[i][1]){
if(document.all){
menuitem.attachEvent('onclick', menuitems[i][1]);} else {
menuitem.addEventListener('click', menuitems[i][1], false);}
}
}
var bg = document.createElement('DIV');bg.className = 'RGraph_contextmenu_background';bg.style.position = 'absolute';bg.style.backgroundColor = '#ccc';bg.style.borderRight = '1px solid #aaa';bg.style.top = 0;bg.style.left = 0;bg.style.width = '18px';bg.style.height = '100%';bg = subMenu.appendChild(bg);RGraph.Registry.Set('chart.contextmenu.submenu', subMenu);}
RGraph.showPNG = function ()
{
var div = document.createElement('DIV');div.id = '__rgraph_image_div__';div.style.position = 'fixed';div.style.top = '-10px';div.style.left = '-10px';div.style.width = '5000px';div.style.height = '5000px';div.style.backgroundColor = 'rgb(204,204,204)';div.style.opacity = 0;document.body.appendChild(div);var img = document.createElement('IMG');img.id = '__rgraph_image_img__';img.className = 'RGraph_png';img.style.position = 'fixed';img.style.padding = '5px';img.style.opacity = 0;img.style.top = '150px';img.style.left = (document.body.clientWidth / 2) - 240 + 'px';img.style.backgroundColor = 'white';img.style.border = '1px solid gray';img.style.padding = '5px';img.style.borderRadius = '10px';img.style.MozBorderRadius = '10px';img.style.WebkitBorderRadius = '10px';img.src = RGraph.Registry.Get('chart.contextmenu').__canvas__.toDataURL();img.style.boxShadow = '0 0 15px rgba(96,96,96,0.5)';img.style.MozBoxShadow = '0 0 15px rgba(96,96,96,0.5)';img.style.WebkitBoxShadow = 'rgba(96,96,96,0.5) 0 0 15px';document.body.appendChild(img);div.onclick = function (e)
{
var div = document.getElementById("__rgraph_image_div__")
var img = document.getElementById("__rgraph_image_img__")
if(div){
div.id = '';div.style.display = 'none';div = null;}
if(img){
img.id = '';img.style.display = 'none';img = null;}
}
__rgraph_image_div__ = div;
__rgraph_image_img__ = img;setTimeout('__rgraph_image_div__.style.opacity = 0.1', 50);setTimeout('__rgraph_image_div__.style.opacity = 0.2', 100);setTimeout('__rgraph_image_div__.style.opacity = 0.3', 150);setTimeout('__rgraph_image_div__.style.opacity = 0.4', 200);setTimeout('__rgraph_image_div__.style.opacity = 0.5', 250);setTimeout('__rgraph_image_img__.style.opacity = 0.2', 50);setTimeout('__rgraph_image_img__.style.opacity = 0.4', 100);setTimeout('__rgraph_image_img__.style.opacity = 0.6', 150);setTimeout('__rgraph_image_img__.style.opacity = 0.8', 200);setTimeout('__rgraph_image_img__.style.opacity = 1', 250);img.onclick = function (e)
{
if(e.stopPropagation) e.stopPropagation();else event.cancelBubble = true;}
}