function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}

function loadWin(para1,para2,w,h) {
msg=window.open(para1,para2,'width='+w+',height='+h+', scrollbars=yes, toolbar=no,location=no,directories=no,status=no,menubar=no');
msg.creator = self;
}

function alle(mioform) {
if (mioform == 'fmarche'){
	if (document.fmarche.marca.options[document.fmarche.marca.selectedIndex].value==""){
	alert("Selezionare una MARCA");
	}
	else{
	document.fmarche.submit();
	}
}
if (mioform == 'ffamiglie'){
	if (document.ffamiglie.famiglia.options[document.ffamiglie.famiglia.selectedIndex].value==""){
	alert("Selezionare una FAMIGLIA");
	}
	else{
	document.ffamiglie.submit();
	}
}
if (mioform == 'fcategorie'){
	if (document.fcategorie.categoria.options[document.fcategorie.categoria.selectedIndex].value==""){
	alert("Selezionare una CATEGORIA");
	}
	else{
	document.fcategorie.submit();
	}
}
if (mioform == 'fmodello'){
	if (document.fmodello.modello.options[document.fmodello.modello.selectedIndex].value==""){
	alert("Selezionare un MODELLO");
	return false;
	}
	else{
	return true;
	}
}
}

function alle2(mioform) {
if (mioform == 'fregione'){
	if (document.fregione.regione.options[document.fregione.regione.selectedIndex].value==""){
	alert("Selezionare una REGIONE");
	}
	else{
	document.fregione.submit();
	}
}
if (mioform == 'fprovincia'){
	if (document.fprovincia.provincia.options[document.fprovincia.provincia.selectedIndex].value==""){
	alert("Selezionare una PROVINCIA");
	}
	else{
	document.fprovincia.submit();
	}
}
if (mioform == 'flocalita'){
	if (document.flocalita.localita.options[document.flocalita.localita.selectedIndex].value==""){
	alert("Selezionare una LOCALITA'");
	return false;
	}
	else{
	document.flocalita.submit();
	}
}
if (mioform == 'fcap'){
	if (document.fcap.cap.options[document.fcap.cap.selectedIndex].value==""){
	alert("Selezionare un CAP'");
	return false;
	}
	else{
	document.fcap.submit();
	}
}
if (mioform == 'fstato'){
	if (document.fstato.stato.options[document.fstato.stato.selectedIndex].value==""){
	alert("Selezionare uno STATO'");
	return false;
	}
	else{
	document.fstato.submit();
	}
}
}

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=="hidden"||tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Assicurarsi di aver compilato il campo "+shortFieldName);
return false;
}
else
	return true;
}