<!--
function checkFormSx(){
// impostazioni variabili per il controllo
var checkOK = "0123456789-/";
var allValid = true;
if(document.controllaRiparazione.codicecliente.value=="")
	{
	alert("Inserire il codice cliente!")
	document.controllaRiparazione.codicecliente.focus();
	return false
	}
if(document.controllaRiparazione.codiceimei.value=="" &&  document.controllaRiparazione.numeroscheda.value=="")
	{
	alert("Inserire codice imei oppure il numero bolla!")
	document.controllaRiparazione.codiceimei.focus();
	return false
	}
	
return true
}
////////////////////////////////////////////////////////////////////////////////
//Funzione ingrandimento
function zoom(img){
	var z = window.open('zoom.asp?img='+img,'zoom','scrollbars=no,width=530,height=470');
	z.focus();
}
function zoomG(img,id){
	var G = window.open('zoom.asp?img='+img+'&id='+id,'zoomG','scrollbars=no,width=530,height=470');
	G.focus();
}
function informativa() { //v2.0
  	informativaP = window.open('http://www.systep.net/informativa.asp?societa=Infolab electronics di Santoro Giuseppe&email=info@infolabaversa.it&tel=+ 39 (081) 812.0072','informativa','scrollbars=yes,resizable=yes,width=520,height=500');
 	informativaP.focus()	
}
function caricaAltro2(valore){
	if (valore == "altro"){
		document.getElementById("altro2").innerHTML = "<input name='a18' type='text' class='box' id='a18'>";
		document.modulo2.a18.focus();
	}
}
function caricaAltro1(valore){
	if (valore == "altro"){
		document.getElementById("altro1").innerHTML = "<input name='a16' type='text' class='box' id='a16'>";
		document.modulo2.a16.focus();
	}
}
function visualizzaR(idEvento){
	//alert(idEvento)
	document.location.href="fotoRaduni.asp?idevento="+idEvento
}

function validate(theForm){
	if (theForm.codice.value == ""){
		alert("Inserisci il codice.");
		theForm.codice.focus();
		return false;
	}
	if (theForm.centro.value == ""){
		alert("Inserisci il centro Infolab.");
		theForm.centro.focus();
		return false;
	}
	
	if (theForm.ragsoc.value == "" || theForm.ragsoc.value.length < 2){
		alert("Inserisci la ragione sociale.");
		theForm.ragsoc.focus();
		return false;
	}
	if (theForm.nome.value == "" || theForm.nome.value.length < 2){
		alert("Inserisci il nome.");
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1)== -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("Inserisci un indirizzo email valido.");
		theForm.email.focus();
		return false;
	}
	if (theForm.address.value == "") {
		alert("Inserisci il tuo indirizzo.");
		theForm.address.focus();
		return false;
	}
	
	if (theForm.town.value == "") {
		alert("Inserisci la cittą.");
		theForm.town.focus();
		return false;
	}
	if (theForm.zip.value == "") {
		alert("Inserisci il cap.");
		theForm.zip.focus();
		return false;
	}
	if (theForm.country.value == "") {
		alert("Inserisci la provincia.");
		theForm.phone.focus();
		return false;
	}
	if (theForm.phone.value == "") {
		alert("Inserisci il telefono.");
		theForm.phone.focus();
		return false;
	}
	if (theForm.userid.value == "" || theForm.userid.value.length < 5){
		alert("Inserisci la userID.");
		theForm.nome.focus();
		return false;
	}
	if (theForm.password.value == "" || theForm.password.value.length < 5){
		alert("Inserisci la password.");
		theForm.password.focus();
		return false;
	}
	if(theForm.accetto.checked == false)
	{
	alert("Devi dare il consenso al trattamento dei \ndati personali per inviare il modulo")
	return false}
	
return true;
}

function visualizzaDettaglio(id){
	document.location.href = "utente.asp?azione=dettaglio&ID="+id
}

function invia(id){
		document.location.href = "utente.asp?azione=dettaglio&ID="+id+"#notez"
}
function accettaPrev(id,acc){
	var conferma = confirm('Vuoi '+acc+'RE il preventivo selezionato?')
			if (conferma){
					//alert(id)
					document.location.href = "utente.asp?azione=accettaPreventivo&id="+id+"&accetta="+acc
				}else{
					//alert('cancellazione annullata')
			}
	
}
function accettaPrevNoUtente(codcli,id,acc){
	//alert(codcli)
	var conferma = confirm('Vuoi '+acc+'RE il preventivo selezionato?')
		if (conferma){
					//alert(id)
					document.location.href = "routineUtente.asp?azione=accettaPreventivo&id="+id+"&codcli="+ codcli +"&accetta="+acc
				}else{
					//alert('cancellazione annullata')
			}
	
}
function mostraDettaglio(m,d){
	if (m == "apri"){
		document.getElementById(d).style.display = "";
		document.location.href="#dettaglioA"
		}else{
		document.getElementById(d).style.display = "none";
		}
}
function stampa(id){
	//alert("Funzione in allestimento "+id)
	var s = window.open('stampa.asp?id='+id,'stampa','scrollbars=yes,width=530,height=520');
	s.focus();
}
function stampaUt(id,scheda){
	//alert("Funzione in allestimento "+id+" - "+scheda)
	var s = window.open('stampaUt.asp?id='+id+'&scheda='+scheda,'stampa','scrollbars=yes,width=530,height=520');
	s.focus();
}


function checkModuloQualita(){
// impostazioni variabili per il controllo
var checkOK = "0123456789-/";
var checkStr = document.step1.scheda.value;
var checkStr2 = document.step1.CODICECLIENTE.value;
var allValid = true;

// controllo scheda
for (i = 0;  i < checkStr.length;  i++)
	 {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			 break;
			 	if (j == checkOK.length)
				  {
				    allValid = false;
				    break;
				   }
				  
				}
				if (!allValid)
				{
				  alert ("E' necessario inserire solo valori numerici nel campo SCHEDA!");
				  document.step1.scheda.value = "";
				  document.step1.scheda.focus();
				  return (false);
				}	

//controllo telefono
if(document.step1.scheda.value=="")
{
alert("Inserire il numero SCHEDA !")
document.step1.scheda.focus();
return false}

//CONTROLLO COD CLIENTE
for (i = 0;  i < checkStr2.length;  i++)
	 {
		ch = checkStr2.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			 break;
			 	if (j == checkOK.length)
				  {
				    allValid = false;
				    break;
				   }
				  
				}
				if (!allValid)
				{
				  alert ("E' necessario inserire solo valori numerici nel campo CODICE CLIENTE!");
				  document.step1.CODICECLIENTE.value = "";
				  document.step1.CODICECLIENTE.focus();
				  return (false);
				}	

//controllo telefono
if(document.step1.CODICECLIENTE.value=="")
{
alert("Inserire il numero CODICE CLIENTE !")
document.step1.CODICECLIENTE.focus();
return false}


// controllo nome
if(document.step1.CLIENTE.value=="")
{
alert("Inserire il nome cliente!")
document.step1.CLIENTE.focus();
return false}

//controllo nome
if(document.step1.APPARATO.value=="")
{
alert("Inserire il nome APPARATO!")
document.step1.APPARATO.focus();
return false}

return true
}
//Funzione network
function filtra(pr,re){
	if (pr || ""){
	//alert(pr)
	if (pr == "tutte"){
		document.location.href="network.asp?regione=" + re 
		}else{
		document.location.href="network.asp?regione=" + re +"&prov=" + pr
		}
	}
	
}

function scaricaexcel(q0,q1,q2,q3,q4,q5,q6,q7){
	//alert(q0+q1+q2+q3+q4+q5)
	var riepilogo = window.open('te_excel.asp?q0='+q0+'&q1='+q1+'&q2='+q2+'&q3='+q3+'&q4='+q4+'&q5='+q5+'&q6='+q6+'&q7='+q7,'riepilogo','scrollbars=yes,width=100,height=100');
	riepilogo.focus();
}


function controlladate(){
	var espressione = /^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/;
	
	if (document.cercaUT.aConsegna.value || "") {
		if (!espressione.test(document.cercaUT.aConsegna.value))
			{
			alert("Formato data sbagliato");
			document.cercaUT.aConsegna.value="";
			return false
			}
		}
		
	if (document.cercaUT.daConsegna.value || "") {
		if (!espressione.test(document.cercaUT.daConsegna.value))
			{
			alert("Formato data sbagliato");
			document.cercaUT.daConsegna.value="";
			return false
			}
		}
			
	return true
	}

	
function codiceabarre(nome,codice){
	var CB = window.open('codiceabarre.asp?nome='+nome+'&codice='+codice,'codicebarre','scrollbars=yes,width=850,height=550');
	CB.focus();
}
//-->

