// (c) Copyright 2012, The Software Ranch LLC and Morpho-Graphics LLC. All rights reserved

var mouseX = 0;
var mouseY = 0;

// Firefox event cache
var fireFoxEvent = null;

function getMouseXY(evt) 
{
	var tempX = 0;
	var tempY = 0;
	mouseX = 0;
	mouseY = 0;

	if (evt)
	{
		fireFoxEvent = evt;
		tempX = evt.pageX;
		tempY = evt.pageY;
	}
	else if (document.all) 
	{
		if (event)
		{
			// IE cursor location
			tempX = event.clientX + document.documentElement.scrollLeft;
			tempY = event.clientY + document.documentElement.scrollTop;
		}
	}

	if (tempX < 0)
	{
		tempX = 0;
	}
	if (tempY < 0)
	{
		tempY = 0;
	}  

	mouseX = tempX;
	mouseY = tempY;
	return new Point(mouseX, mouseY);
}

function getScrollXY() 
{
	var left = $(document).scrollLeft();
	var top = $(document).scrollTop();

	return new Point(left, top);
}

function getBrowserSize()
{
	var width = $(window).width();
	var height = $(window).height();

	return new Point(width, height);
}


