// THIS FILE HAS BEEN MINIFIED

if(typeof(RGraph) == 'undefined') RGraph = {isRGraph:true,type:'common'};RGraph.AllowResizing = function (obj)
{
if(obj.Get('chart.resizable')){
var canvas = obj.canvas;var context = obj.context;var resizeHandle = 15;RGraph.Resizing.canvas = canvas;if(!canvas.__original_width__ && !canvas.__original_height__){
canvas.__original_width__ = canvas.width;canvas.__original_height__ = canvas.height;}
var textWidth = context.measureText('Reset').width + 2;obj.context.beginPath();obj.context.strokeStyle = 'gray';obj.context.fillStyle = 'rgba(0,0,0,0)';obj.context.lineWidth = 1;obj.context.fillRect(obj.canvas.width - resizeHandle, obj.canvas.height - resizeHandle - 2, resizeHandle, resizeHandle + 2);obj.context.fillRect(obj.canvas.width - resizeHandle - textWidth, obj.canvas.height - resizeHandle, resizeHandle + textWidth, resizeHandle + 2);obj.context.moveTo(obj.canvas.width - (resizeHandle / 2), obj.canvas.height - resizeHandle);obj.context.lineTo(obj.canvas.width - (resizeHandle / 2), obj.canvas.height);obj.context.moveTo(obj.canvas.width, obj.canvas.height - (resizeHandle / 2));obj.context.lineTo(obj.canvas.width - resizeHandle, obj.canvas.height - (resizeHandle / 2));context.fill();context.stroke();context.fillStyle = 'gray';context.beginPath();context.moveTo(canvas.width - (resizeHandle / 2), canvas.height - resizeHandle);context.lineTo(canvas.width - (resizeHandle / 2) + 3, canvas.height - resizeHandle + 3);context.lineTo(canvas.width - (resizeHandle / 2) - 3, canvas.height - resizeHandle + 3);context.closePath();context.fill();context.beginPath();context.moveTo(canvas.width - (resizeHandle / 2), canvas.height);context.lineTo(canvas.width - (resizeHandle / 2) + 3, canvas.height - 3);context.lineTo(canvas.width - (resizeHandle / 2) - 3, canvas.height - 3);context.closePath();context.fill();context.beginPath();context.moveTo(canvas.width - resizeHandle, canvas.height - (resizeHandle / 2));context.lineTo(canvas.width - resizeHandle + 3, canvas.height - (resizeHandle / 2) + 3);context.lineTo(canvas.width - resizeHandle + 3, canvas.height - (resizeHandle / 2) - 3);context.closePath();context.fill();context.beginPath();context.moveTo(canvas.width, canvas.height - (resizeHandle / 2));context.lineTo(canvas.width - 3, canvas.height - (resizeHandle / 2) + 3);context.lineTo(canvas.width  - 3, canvas.height - (resizeHandle / 2) - 3);context.closePath();context.fill();context.beginPath();context.fillStyle = 'white';context.moveTo(canvas.width, canvas.height - (resizeHandle / 2));context.strokeRect(canvas.width - (resizeHandle / 2) - 2, canvas.height - (resizeHandle / 2) - 2, 4, 4);context.fillRect(canvas.width - (resizeHandle / 2) - 2, canvas.height - (resizeHandle / 2) - 2, 4, 4);context.fill();context.stroke();context.beginPath();context.fillStyle = 'gray';context.moveTo(canvas.width - resizeHandle - 3, canvas.height - resizeHandle / 2);context.lineTo(canvas.width - resizeHandle - resizeHandle, canvas.height - (resizeHandle / 2));context.lineTo(canvas.width - resizeHandle - resizeHandle + 2, canvas.height - (resizeHandle / 2) - 2);context.lineTo(canvas.width - resizeHandle - resizeHandle + 2, canvas.height - (resizeHandle / 2) + 2);context.lineTo(canvas.width - resizeHandle - resizeHandle, canvas.height - (resizeHandle / 2));context.stroke();context.fill();context.beginPath();context.moveTo(canvas.width - resizeHandle - resizeHandle - 1, canvas.height - (resizeHandle / 2) - 3);context.lineTo(canvas.width - resizeHandle - resizeHandle - 1, canvas.height - (resizeHandle / 2) + 3);context.stroke();context.fill();window.onmousemove = function (e)
{
e = RGraph.FixEventObject(e);var canvas = RGraph.Resizing.canvas;var newWidth = RGraph.Resizing.originalw - (RGraph.Resizing.originalx - e.pageX);var newHeight = RGraph.Resizing.originalh - (RGraph.Resizing.originaly - e.pageY);if(RGraph.Resizing.mousedown){
if(newWidth > (canvas.__original_width__ / 2)) RGraph.Resizing.div.style.width = newWidth + 'px';if(newHeight > (canvas.__original_height__ / 2)) RGraph.Resizing.div.style.height = newHeight + 'px';}
}
var MouseupFunc = function (e)
{
if(!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown){
return;}
if(RGraph.Resizing.div){
var div = RGraph.Resizing.div;var canvas = div.__canvas__;var coords = RGraph.getCanvasXY(div.__canvas__);var parentNode = canvas.parentNode;if(canvas.style.position != 'absolute'){
var placeHolderDIV = document.createElement('DIV');placeHolderDIV.style.width = (RGraph.Resizing.originalw)+ 'px';placeHolderDIV.style.height = (RGraph.Resizing.originalh) + 'px';placeHolderDIV.style.position = canvas.style.position;placeHolderDIV.style.left = canvas.style.left;placeHolderDIV.style.top = canvas.style.top;placeHolderDIV.style.cssFloat = canvas.style.cssFloat;parentNode.insertBefore(placeHolderDIV, canvas);}
canvas.style.backgroundColor = 'white';canvas.style.position = 'absolute';canvas.style.border = '1px dashed gray';canvas.style.left = RGraph.Resizing.originalCanvasX + 'px';canvas.style.top = RGraph.Resizing.originalCanvasY + 'px';canvas.width = parseInt(div.style.width);canvas.height = parseInt(div.style.height);canvas.__object__.Draw();RGraph.Resizing.mousedown = false;div.style.left = '-1000px';div.style.top = '-1000px';}
RGraph.FireCustomEvent(canvas.__object__, 'onresize');}
window.onmouseup = MouseupFunc;canvas.onmousemove = function (e)
{
e = RGraph.FixEventObject(e);var coords = RGraph.getMouseXY(e);var canvas = e.target;var context = canvas.getContext('2d');RGraph.Resizing.title = canvas.title;if(   (coords[0] > (canvas.width - resizeHandle)
&& coords[0] < canvas.width
&& coords[1] > (canvas.height - resizeHandle)
&& coords[1] < canvas.height)){
canvas.title = 'Resize the graph';canvas.style.cursor = 'move';} else if(   coords[0] > (canvas.width - resizeHandle - resizeHandle)
&& coords[0] < canvas.width - resizeHandle
&& coords[1] > (canvas.height - resizeHandle)
&& coords[1] < canvas.height){
canvas.style.cursor = 'pointer';canvas.title = 'Reset graph to original size';} else {
canvas.style.cursor = 'default';canvas.title = '';}
}
canvas.onmousedown = function (e)
{
e = RGraph.FixEventObject(e);var coords = RGraph.getMouseXY(e);var canvasCoords = RGraph.getCanvasXY(e.target);if(   coords[0] > (obj.canvas.width - resizeHandle)
&& coords[0] < obj.canvas.width
&& coords[1] > (obj.canvas.height - resizeHandle)
&& coords[1] < obj.canvas.height){
RGraph.Resizing.mousedown = true;var div = document.createElement('DIV');div.style.position = 'absolute';div.style.left = canvasCoords[0] + 'px';div.style.top = canvasCoords[1] + 'px';div.style.width = canvas.width +'px';div.style.height = canvas.height + 'px';div.style.border = '1px dotted black';div.style.backgroundColor = 'gray';div.style.opacity = 0.5;div.__canvas__ = e.target;document.body.appendChild(div);RGraph.Resizing.div = div;div.onmouseup = function (e)
{
MouseupFunc(e);}
RGraph.Resizing.div.onmouseover = function (e)
{
e = RGraph.FixEventObject(e);e.stopPropagation();}
RGraph.Resizing.originalx = e.pageX;RGraph.Resizing.originaly = e.pageY;RGraph.Resizing.originalw = obj.canvas.width;RGraph.Resizing.originalh = obj.canvas.height;RGraph.Resizing.originalCanvasX = RGraph.getCanvasXY(obj.canvas)[0];RGraph.Resizing.originalCanvasY = RGraph.getCanvasXY(obj.canvas)[1];}
}
canvas.onclick = function (e)
{
var coords = RGraph.getMouseXY(e);var canvas = e.target;if(   coords[0] > (canvas.width - resizeHandle - resizeHandle)
&& coords[0] < canvas.width - resizeHandle
&& coords[1] > (canvas.height - resizeHandle)
&& coords[1] < canvas.height){
canvas.width = canvas.__original_width__;canvas.height = canvas.__original_height__;canvas.style.border = '';canvas.__object__.Draw();RGraph.Resizing.div.style.width = canvas.__original_width__ + 'px';RGraph.Resizing.div.style.height = canvas.__original_height__ + 'px';RGraph.FireCustomEvent(canvas.__object__, 'onresize');}
}
}
}