function mostra_iscrizioni()
	{
  		var checkino = document.getElementById('check_iscrizioni');
  		if (checkino.checked == true)
	  		{
			swap_class('categorie','block');
	  		}
		else
			{
			swap_class('categorie','hidden');
			}
	}


function nascondi_iscrizioni()
	{
			swap_class('categorie','hidden');
	}

	
	
function checkrequired(variabile)
	{
		if (document.getElementById(variabile).value.length < 5)
			{
			alert("Il form non è stato compilato correttamente. Si prega di inserire tutti i campi obbligatori (*).")
//			document.getElementById('avviso').style.display = "block";
			return false;
			}
		else
			{
			return true;
			}
	}



// function checkrequired(which)
// 	{
// 	var pass=true
// 	if (document.images)
// 		{
// 		for (i=0;i<which.length;i++)
// 			{
// 			var tempobj=which.elements[i]
// 			if (tempobj.name.substring(0,8)=="required")
// 				{
// 				if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1))
// 					{
// 					pass=false
// 					break
// 					}
// 				}
// 			}
// 		}
// if (!pass)
// 	{
// 	alert("Il form non è stato compilato correttamente. Si prega di inserire tutti i campi obbligatori (*).")
// /*	document.write("Il form non è stato compilato correttamente. Si prega di inserire tutti i campi obbligatori (*).");
// 	document.getElementById(avviso).style.display = "block";
// */

// 	return false
// 	}
// else
// 	return true
// }


/* -------------------------------- */

	function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit)
	field.value = field.value.substring(0, maxlimit);
	else
	countfield.value = maxlimit - field.value.length;	
	}
	
/* -------------------------------- */
	
// function	avvisa_disabilita()
// 			{
// 			document.oncontextmenu = avvisa_disabilita;
// //			alert('Tasto destro disabilitato');
// 			return(false);
// 			}
// function	riabilita ()
// 			{
// 			document.oncontextmenu = riabilita;
// 			return(true);
// 			}
	
/* -------------------------------- */
			
function swap_class(oggetto,classe)
	{
  var mio_oggetto = document.getElementById(oggetto);
  if(mio_oggetto)
	  	{
	    mio_oggetto.className = classe;
	  	}
	}
			
/* -------------------------------- */
	
function checktutti(variabile_1) 
	{
  with (document.form_contatti_1) 
  	{
    for (var i=0; i < elements.length; i++) 
    	{
        if (elements[i].type == 'checkbox' && elements[i].name == variabile_1)
        	{
           elements[i].checked = true;
       		}
    	}
  	}  
	}

function unchecktutti(variabile_1) 
	{
  with (document.form_contatti_1) {
    for (var i=0; i < elements.length; i++) 
    	{
        if (elements[i].type == 'checkbox' && elements[i].name == variabile_1)
        	{
           	elements[i].checked = false;
       		}
		}
	}
	}	

/* disabilita tasto destro
-------------------------------- */
		
function	avvisa_disabilita()
			{
			document.oncontextmenu = avvisa_disabilita;
//			alert('Tasto destro disabilitato');
			return(false);
			}
function	riabilita ()
			{
			document.oncontextmenu = riabilita;
			return(true);
			}
	
