﻿var Overlay = {

	Measures : function(o) {

		var l = parseInt(o.style.left.replace('px', ''));
		var t = parseInt(o.style.top.replace('px', ''));
		var w = parseInt(o.style.width.replace('px', ''));
		var h = parseInt(o.style.height.replace('px', ''));

		return { left : l, top : t, width : w, height : h };
	},

	Show : function (e, text, width, height) {
	
		var ev  = new CrossEvent(e);
		
	    var div = document.getElementById('divOverlay');
	    var fix = document.getElementById('divOverlayFix');
	    
	    div.style.left   = ev.screenX;
	    div.style.top    = ev.screenY;
	    
	    div.style.width  = width;
	    div.style.height = height;
	    
	    fix.style.left  = ev.screenX;
	    fix.style.top   = ev.screenY;
	    
	    fix.style.width  = width;
	    fix.style.height = height;
	    
	    div.style.visibility = 'visible';
	    fix.style.visibility = 'visible';
	    
	    div.innerHTML = text;
	},
	
	Hide : function ()
	{
		var div = document.getElementById('divOverlay');
	    var fix = document.getElementById('divOverlayFix');
	    
	    div.style.visibility = 'hidden';
	    fix.style.visibility = 'hidden';
	}
}