function PopupCentrata(filename,w,h) {
   var l = Math.floor((screen.width-w)/2);
   var t = Math.floor((screen.height-h)/2);
   window.open(filename,'',"scrollbars=yes,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
}

function ControllaSondaggioStile()
{
	for (i=0;i<3;i++)
	   if (document.test1["risposta"][i].checked)
	      return true;
        alert("Attenzione: devi selezionare almeno un'opzione!");
	return false;
}

function ControllaSondaggino()
{
    for (i=0;i<18;i++)
       if (document.test1["risposta"][i].checked)
          return true;
        alert("Attenzione: devi selezionare almeno un'opzione!");
    return false;
}

function ControllaSondaggioSito()
{
    var ret=0;
	for (i=0;i<4;i++)
	   if (document.sondaggio["d1"][i].checked)
	      ret++;
    
    for (i=0;i<3;i++)
       if (document.sondaggio["d3"][i].checked)
          ret++;
    for (i=0;i<4;i++)
       if (document.sondaggio["d4"][i].checked)
          ret++;
    for (i=0;i<4;i++)
       if (document.sondaggio["d5"][i].checked)
          ret++;
              
    var altro=0;
    for (i=0;i<3;i++)
       if (document.sondaggio["d3"][i].checked)
          altro++;
          
    if ((altro==0 && document.sondaggio.altro.value == "") || ret!=4)
    {
        alert("Attenzione: mancano delle risposte!");
        return false;
    } 
    
    return true;	
}

function processImage(process_image,w,h)
{
   var l = Math.floor((screen.width-w)/2);
   var t = Math.floor((screen.height-h)/2);
   window.open(process_image,'',"scrollbars=yes,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
}

function ControllaPDB()
{
        if (document.pdb.risposta.value!="null")
	      return true;
        alert("Attenzione: devi scegliere un'opzione valida!");
	return false;
}
