// JavaScript Document
function pulisci(elemento){
 if(isNaN(elemento.value)){
  elemento.value="";
  elemento.focus();
 }
}

function pulisci2(obj) {
	var numero = obj.value;
	if (isNaN(numero) || String(numero).indexOf(".") != (-1))
	{
	obj.value="";
	obj.focus();
	}
}

function toggleMe(obj, a){
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="block"
  return true;
}

function toggleMe2(obj, a){
  var e=document.getElementById(a);
  if(!e)return true;
    e.style.display="none"
  return true;
}

function verifica(arg){
	if(arg.azDen.value == 0){
		alert("selezionare un\'azienda")
		arg.azDen.focus();
		return false;
	}
	for(var i=0; i<arg.offerta.length; i++) { 
		if(arg.offerta[i].checked){
			valore = arg.offerta[i].value
			//alert(valore)
			// se ho selezionato il prdotto come offerta devo controllare il corretto inserimento sia della qta min che del prezzo
			if (valore  == "1")  
				{
					if((arg.qtaMin.value=="")||(arg.b2bOf.value=="")){
						alert("La quantità minima e il prezzo sono obbligatori")
						return false;
						arg.qtaMin.focus()
					}

				}
		} 
	}
}

