var state = 'none';

function showhide(layer_ref) {
	if (state == 'block') {
		state = 'none';
	}
	else {
		state = 'block';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
	
}

function showhide_address(layer_ref, value) {
	if (value == true) {
		state = 'none';
	}
	else {
		state = 'block';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
		
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
	
}

function popup_image(image)
{
	i1 = new Image;
	i1.src = image;
	html = '<HTML>\n<HEAD>\n<TITLE>Image</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+image+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
};

function show_misure(layer_ref, layer_none) {
	state_vis = 'block';
	nascondi = "none";
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		hza = document.getElementById(layer_ref);
		hza.style.display = state_vis;
		//eval( "document.all." + layer_ref + ".style.display = state_vis");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state_vis;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state_vis;
	}
	
	var my_array=layer_none.split(";");

	for (i=0;i<=my_array.length;i++)
	{
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
			hza = document.getElementById(my_array[i]);
			hza.style.display = nascondi;
			//eval( "document.all." + my_array[i] + ".style.display = nascondi");
		}
		if (document.layers) { //IS NETSCAPE 4 or below
			document.layers[my_array[i]].display = nascondi;
		}
		if (document.getElementById &&!document.all) {
			hza = document.getElementById(my_array[i]);
			hza.style.display = nascondi;
		}
	}

	
}
