function checkrequired(which,array){

var pass=true;
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i];
if (contains(array,tempobj.name)){
	
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false;
break;
}
}
}
}
if (!pass){
alert("Non sono stati complilati tutti i campi obbligatori (*)");
return false;
}
else
return true;
}

function contains(a, obj){
	  for(var i = 0; i < a.length; i++) {
		if(a[i] === obj){
	      return true;
	    }
	  }
	  return false;
	}
