function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=400');");
}

function checkform ( form )
{
	myOption = -1;
	for (i=form.sesso.length-1; i > -1; i--) {
		if (form.sesso[i].checked) {
			myOption = i;
		}
	}
	if (myOption == -1) {
		alert("Non è stato indicato il Sesso");
		return false;
	}
  if (form.username.value == "") {
    alert( 'Non è stata indicata la Username' );
    form.username.focus();
    return false ;
  }
  if (form.passwd.value == "") {
    alert( 'Non è stata indicata la Password' );
    form.passwd.focus();
    return false ;
  }
  if (form.passwd.value != form.passwd2.value) {
    alert( 'Le Password non coincidono' );
    form.passwd.focus();
    return false ;
  }
  return true ;
}

function show(box,valore){
	var infobox = document.getElementById('IMG'+box);	
	var infoboxText = document.getElementById('QB'+box);	
	if(valore == '0'){
  		infobox.src = 'inserimenti/vuoto.jpg';
	}else{
  		infobox.src = 'inserimenti/pieno.jpg';
	}
	if(valore == '0.5'){valore='1/2';}
	if(valore == '1.5'){valore='1,5';}
	if(valore == '2.5'){valore='2,5';}
	if(valore == '3.5'){valore='3,5';}
	if(valore == '4.5'){valore='4,5';}
	if(valore == 'p2'){valore='pi&ugrave; di 2';}
	if(valore == 'p4'){valore='pi&ugrave; di 4';}
/*
	if(valore == 'a0.5'){valore='da 1 a 3';}
	if(valore == 'a1'){valore='da 4 a 6';}
	if(valore == 'a2'){valore='da 7 a 12';}
	if(valore == 'a3'){valore='da 13 a 24';}
	if(valore == 'a4'){valore='pi&ugrave; di 24';}
*/
		infoboxText.innerHTML = valore;
}
function show_checkbox(box,valore){
	var infobox = document.getElementById('IMG'+box);	
	var infoboxText = document.getElementById('QB'+box);	
	if(valore == true){
  		infobox.src = 'inserimenti/pieno.jpg';
		  infoboxText.innerHTML = '1';
	}else{
  		infobox.src = 'inserimenti/vuoto.jpg';
		infoboxText.innerHTML = '0';
	}
}
function noshow(box){
//document.getElementById(box).style.display="none";
}
