/**
  *	This method gets the position of mouse within the document
  *
  *	@author Vytenis Urbonavicius <vytenis.urbonavicius@myhost.lt>
  *	@version 0.0
  *
  *	@p event e - mouse-related event
  *
  *	@return object that contains x and y attributes
  */
function getMousePosition( e ) { 
	
	var pos_x = 0;
	var pos_y = 0;
	
	if ( !e ) {
		var e = window.event;
	}
	
	if ( e.pageX || e.pageY ) {
		pos_x = e.pageX;
		pos_y = e.pageY;
	} else if ( e.clientX || e.clientY ) {
		pos_x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		pos_y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	
	return { 
		x : pos_x, 
		y : pos_y
	}; 
	
}
