// Add in markup necessary to make this work. Basically two divs:
// Overlay holds the shadow
// Lightbox is the centered square that the content is put into.
function addLightboxMarkup() {
	bod 				= document.getElementsByTagName('body')[0];
	overlay 			= document.createElement('div');
	overlay.id		= 'overlay';
	lb					= document.createElement('div');
	lb.id				= 'lightbox';
	lb.className 	= 'loading';
	lb.innerHTML	= '<div id="lbLoadMessage">' +
						  '<p>Loading</p>' +
						  '</div>';
	bod.appendChild(overlay);
	bod.appendChild(lb);
}

/* ----------------------- FUNZIONI PERSONALIZZATE ----------------------------- */

function layer_close(){

	Element.remove($('lbContent'));
		
	/*if (browser == "Internet Explorer"){
		this.setScroll(0,this.yPos);
		this.prepareIE("auto", "auto");
		this.hideSelects("visible");
	}*/
	
	$('overlay').style.display = "none";
	$('lightbox').style.display = "none";
}




function openLayer(){
      addLightboxMarkup();
	lbox = document.getElementsByClassName('lbOn');
	for(i = 0; i < lbox.length; i++) {
		valid = new lightbox(lbox[i]);
	}

}

