function getObj(obj) {

	

	if (document.all && !document.getElementById) {

		//alert("Internet Explorer 4");

		// Internet Explorer 4

		return document.all(obj);

	}

	if (document.all && document.getElementById) {

		//alert("Internet Explorer 5");

		// Internet Explorer 5

		return document.getElementById(obj);

	}

	if (document.layers) {

		//alert("Netscape 4");

		// Netscape 4

		return document.layers(obj);

	}

	if (!document.all && document.getElementById) {

		//alert("Netscape 6");

		// Netscape 6

		return document.getElementById(obj);

	}

	



}



function openPopUpPrenotazione() {

	openURL('popup_prenotazione.php','Prenotazione','width=670,height=600,scrollbars=YES,resizable=no');	

}



function download(f) {

	window.location = ("d_file.php?type=DOC&id="+f);

}



function openURL(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

// Funzioni per la centratura delle pagine nel browser

function centerLayerOnScreen(lyName) {

	var obj = document.getElementById(lyName);

	var layerWidth;

	var screenWidth;

	var x;	

	if ( obj != null ) {

		if ( isExplorer() || isOpera() )

			screenWidth = parseInt(document.body.clientWidth);

		else

			screenWidth = parseInt(window.innerWidth);

		layerWidth = parseInt(obj.style.width);

		if ( layerWidth < screenWidth ) {

			x = eval("( " + screenWidth + " - " + layerWidth + " ) / parseInt(2) ")+10;

		} else {

			x = 0;

		}

		obj.style.left =x + "px";

		obj.style.visibility = "visible";

		return true;

	}

	return false;

}



// Funzioni sul browser utilizzato

function isExplorer() {

	if ( ( navigator != null ) && ( navigator.appName != null ) )

		if ( navigator.appName.indexOf("Explorer") != -1 ) 

			return true;

	return false;	

}



function isNetscape() {

	if ( ( navigator != null ) && ( navigator.appName != null ) )

		if ( navigator.appName.indexOf("Netscape") != -1 ) 

			return true;

	return false;	

}



function isOpera() {

	if ( ( navigator != null ) && ( navigator.appName != null ) )

		if ( navigator.appName.indexOf("Opera") != -1 ) 

			return true;

	return false;	

}



function redirect(url,target) {

	if(target == null || target=="")

		window.location = url;

	else

		eval(target).window.location = url;

}



function display(f) {

	if(getObj(f).style.display == "none")

		getObj(f).style.display = "block";

	else

		getObj(f).style.display = "none";

}
