function getOrderItems(idordine)
{
	location.href ="getOrdiniUtente.do?idordine="+idordine;
}


function settaCampoForm(campo,valore)
{
    if(valore!="")
	   document.getElementById(campo).value=valore;
   
	
}

function settaComboValue(campo,valore)
{
	if(valore!="")
	   document.getElementById(campo).options.value=valore;
}



function emailContattiVerifica()
{
	var nomecontatti=document.getElementById("nomecontatti").value;
	var emailcontatti=document.getElementById("emailcontatti").value;
	var messaggiocontatti=document.getElementById("messaggiocontatti").value;
	var nosp=document.getElementById("nosp").value;
	
	if(nomecontatti!="" && emailcontatti!="" && messaggiocontatti!="" && nosp=="")
		document.formcontatti.submit();
	else
		return;
		
}



/******************addCart(paginacorrente,idsequenzadett,isoffer)******************************/
function addCart(paginacorrente,isoffer)
{
        var quantitaprod=document.getElementById("quantitaprod").value;
     	var indice=document.getElementById("numeromodello").options.selectedIndex;
		var codice=document.getElementById("numeromodello").options[indice].value; 
    	var url="setCart.do?paginacorr="+paginacorrente+"&addcart=true&idsequenzadett="+codice+"&isoffer="+isoffer+"&quantitaprod="+quantitaprod;
    	location.href=url;
   
}

function aggiornaQuant(paginacorrente,idsequenzadett)
{
    var quantitaprod=document.getElementById("quantitaprod"+idsequenzadett).value;
    var url="setCart.do?paginacorr="+paginacorrente+"&aggiornaQuant=true&idsequenzadett="+idsequenzadett+"&quantitaprod="+quantitaprod;
    location.href=url;
}

function deleteformCart(paginacorrente,idsequenzadett)
{
    var url="setCart.do?paginacorr="+paginacorrente+"&deleteformCart=true&idsequenzadett="+idsequenzadett;
    location.href=url;
}




function addDeletefromcart(paginacorrente,isoffer)
{
    var indice=document.getElementById("numeromodello").options.selectedIndex;
	var codice=document.getElementById("numeromodello").options[indice].value;
    var url="setCart.do?paginacorr="+paginacorrente+"&addcart=true&idsequenzadett="+codice+"&isoffer="+isoffer;
    location.href=url;
}


/******************controlloCampo(campo,msg)******************************/
function controlloCampo(campo)
{
   if(document.getElementById(campo).value=='')
	{
		return false;	
    }
 return true;
 }
 
 
 /******************controlloMail(campo)******************************/
function controlloMail(campo)
{
  var valCampo=document.getElementById(campo).value;
  if(valCampo != "")
  {
		if(valCampo.indexOf("@") == -1)
		{
			if(valCampo.indexOf(".") == -1)
			{
            	alert("Inserire correttamente l'indirizzo e-mail");
                document.getElementById(campo).value = "";
                document.getElementById(campo).focus();
                return false;
            }
        }
   } 
return true;
}

/*****************void checkNumImporti()*******************************/
function checkNumImporti()
{

	var ie = (navigator.appName.indexOf('Microsoft Internet Explorer')>-1); // se browser è ie 
	if(ie) 
	{
    		key = event.keyCode; 
  	} 
	else key = e.which;
  	  
  	
	if((event.ctrlKey && key==86) || key==188 || key == 110 || key == 37 || key== 39 || key==9) return true;
  		
  		  		
  	if((key < 48 || key > 58) && (key != 8 && key != 13 && key != 46 )) 
   	{
        	if(key < 96 || key > 105)		
        	return false;                	
        }
  		
	return true;
}


/*****************void checkNumData()*******************************/
function checkNumData()
{

	var ie = (navigator.appName.indexOf('Microsoft Internet Explorer')>-1); // se browser è ie 
	if(ie) 
	{
    		key = event.keyCode; 
  	} 
	else key = e.which;
  	  
  	
	if((event.ctrlKey && key==86) || key==16 || key == 37 || key== 39 || key==9) return true;
  		
  		  		
  	if((key < 48 || key > 58) && (key != 8 && key != 13 && key != 46 )) 
   	{
        	if(key < 96 || key > 105)		
        	return false;                	
        }
  		
	return true;
}

