function mostra(livello){

	$('#'+livello).toggle();

}

<!-- stampa

function printit() {

        var NS = (navigator.appName == "Netscape");

        var IE = (navigator.appName == "IE");

        var VERSION = parseInt(navigator.appVersion);



        if (VERSION > 3) {

//              if (NS) {

                if (window.print) {

                    window.print() ;  

                } else {

                    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

                        document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

                        WebBrowser1.ExecWB(6, 2); //Use a 1 vs. a 2 for a prompting dialog box    

                        WebBrowser1.outerHTML = "";  

                }

        }

//        self.close();

}

//-->



// PREVIENE SUBMIT AL FORM MULTIPLI

var submitDone = false;



function submitForm(myForm, button, action, target, msgOK) {   

  if (!submitDone) {

		submitDone = true;

		button.disabled = true;



		$('#loadingbtn').show();

		

		// legge le variabili del form

		var inputs = []; 

		$(':input', myForm).each(function() { 

			if (this.type=="checkbox") { // se è una checkbox

				if (this.checked==true) inputs.push(this.name + '=' + escape(this.value)); 

			} 

			else if (this.type=="radio") { // se è un radio button

				if (this.checked==true) inputs.push(this.name + '=' + escape(this.value)); 

			} 

			else { // è un campo testo

				inputs.push(this.name + '=' + escape(this.value)); 

			} 

		})

		var parametri = inputs.join('&'); 

		//alert("Parametri: "+parametri);

		$.ajax(

		{

			type: "POST",

			url: action,

			data: parametri,

			success: function(msg)

			{

				if (msg=='OK') {

					$('#loadingbtn').hide();

					$('#'+target).html('<p>'+msgOK+'</p>');

					return true;

				}

				else {

					$('#loadingbtn').hide();

					alert(msg);

					button.disabled = false;

					submitDone = false;

					return false;

				}

			},

			error: function() {

					$('#loadingbtn').hide();

					alert("<? echo _erroregenerico; ?>");

					return false;

			}				

		}

		);

  } else return false;

}

function seleziona(myForm, campo, action, target) {   

		// se legge il codice o la descrizione

		var codice = false;

		// legge le variabili del form

		var parametri = "p="+campo.value;

		if (codice==true) parametri = parametri + "&c=1"; else parametri = parametri + "&c=0";

		$.ajax(

		{

			type: "POST",

			url: action,

			data: parametri,

			success: function(msg)

			{

					$('#'+target).html(msg);

			},

			error: function() {

					alert("<? echo _erroregenerico; ?>");

			}				

		}

		);

}

function checkifitaly(campo) {   

$('#codiceregione').val('');

$('#codiceprovincia').val('');

$('#codicecomune').val('');

$('#city').val('');

if (campo.value!="IT") {

		$('#regione').hide();

		$('#provincia').hide();

		$('#comune').hide();

		$('#city').show();



}

else {

		$('#regione').show();

		$('#provincia').show();

		$('#comune').show();

		$('#city').hide();

}

}

function azzera(target) {   

$('#'+target).html('');

}

function show(target) {   

$('#'+target).show();

}

function nascondi(target) {   

$('#'+target).hide();

}





<!--comuni province regioni-->



// Ottieni la base url

url = document.location.href;

xend = url.lastIndexOf("/") + 1;

var base_url = url.substring(0, xend);



function chiama_ajax(url,campo) {

        

		var parametri = "?p="+campo.value;

		

		//Inizia l'url con http?

        if (url.substring(0, 4) != 'http') {

                url = base_url + url;

        }



		url = url + parametri;

		

        // Crea un nuovo elemento JS

        var jsel = document.createElement('SCRIPT');

        jsel.type = 'text/javascript';

        jsel.src = url;



        //Appende l'elemento JS e quindi esegue la 'chiamata AJAX')

        document.body.appendChild (jsel);

}

<!--comuni province regioni-->





function apri(i){

ncat = document.getElementById('ncatf').value;

	//ncat = $('#ncat').val();



	//alert(ncat);

	for(g=1; g<=ncat; g++){

		$('#cat'+g).css('display', 'none');		

	}

	

	pcat = document.getElementById('numcat'+i).value;

	scat = document.getElementById('numsot'+i).value;





	v = 137+(25*(i-1));

	$('#sottocat').css('top',v+'px');

	

	

	$('#sottocat').css('display', 'block');	

	k=pcat;

	for(j=0; j<scat; j++){	

		

		$('#cat'+k).css('display', 'block');

		k++;

	}



}

function visualizza(){

	$('#sottocat').css('display', 'block');

}

function chiudi(){

	$('#sottocat').css('display', 'none');

	

}



/* funzioni menu top */

function aprimenu(j, nu){

	ncat = document.getElementById('catop').value;



	for(g=1; g<=ncat; g++){

		$('#menut_s'+g).css('display', 'none');		

	}

	if(nu!=0){

	$('#menut_s'+j).css('display', 'block');

	switch(j){

		case 1: left=225;  break;

		case 2: left=330;  break;

		case 3: left=410;  break;

		case 4: left=490;  break;

	

	}

	

	$('#menut_s'+j).css('left', left+'px');



	}



}



function nascondim(j){

	ncat = document.getElementById('catop').value;

	

	for(g=1; g<=ncat; g++){

		$('#menut_s'+g).css('display', 'none');		

	}

		

}








