//Autore Cristiano Ceglia
//  preloading per lightbox2
function pausa(numberMillis) {
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true) {
		now = new Date();
		if (now.getTime() > exitTime)
			return;
	}
}

function nascondiMaschera() {
	document.getElementById("preloading").style.display = "none";	
	document.getElementById("maschera").style.visibility = "visible";
}

function visualizzaSeCaricato() {
	trovati = false;
	while (!trovati) {
		if (uno && due && tre && quattro)
			trovati = true;
		else
			pausa(500);
	}
	nascondiMaschera();
}
