var mensure;
var timeIDstopScroll = null; //usado no evento scroll

window.onload = function(e)
{
	mensure = new unitsWindow();
	mensure.load();

	SA.create();
	SAWait.create();
}

window.onresize = function(e)
{
	mensure.load();

	SA.refresh();
	SAWait.refresh();
};

window.onscroll = function() {
	if (timeIDstopScroll != null) clearTimeout(timeIDstopScroll);
	timeIDstopScroll = setTimeout(onscrollstop, 50);
};
onscrollstop = function() {
	SA.refresh();
	SAWait.refresh();
};

document.onkeydown = function(e) {
	if (!e) var e = window.event;

	var numkey = (is_ie)?e.keyCode:e.which;

	if (numkey == 27 && SA.opened == 1 && SA.ESCClose == 1) {
		SA.close();
		if (window.event) e.returnValue = false;
		else e.preventDefault();
	}
}




