function chk_contacts(lang_id){
	
	with(document.contacts){
		if(
         chk_txt1(nome,		nome.alt ) &&
		 chk_txt1(cognome,	cognome.alt ) &&
		// chk_txt(indirizzo,"Inserisci l'Indirizzo") &&
		 //chk_num(cap,"Inserisci CAP") &&
		// chk_txt(stato,"Inserisci la Stato","Insert The Country",lang_id) &&
		
		// chk_telefono(telefono,"Inserisci un numero di Telefono corretto") &&
		 //chk_telefono(fax,"Inserisci un numero di Fax corretto") &&
		 chk_email(email,	email.alt ) &&
		 chk_txt(messaggio,	'Insert your Messagge') &&
		 chk_aut2(lang_id, autorizzazione.alt) ){
			return true;
		}
		return false;
	}
}


function chk_form_iscrizione(){
	with(document.iscrizione){
		if(
		 chk_txt(ragsoc,	ragsoc.alt ) &&
		 chk_num(piva,		piva.alt ) &&
		 chk_codfis(cod_fis_azienda,		cod_fis_azienda.alt ) &&
		 chk_txt1(nome,		nome.alt ) &&
		 chk_txt1(cognome,	cognome.alt ) &&
         chk_email(email,	email.alt ) &&
		 chk_txt(indirizzo,	indirizzo.alt ) &&
		 chk_txt(citta,		citta.alt ) &&
		 chk_num(cap,		cap.alt ) &&
		 chk_txt1(prov,		prov.alt ) &&
		 chk_txt1(stato,		stato.alt ) &&
		 chk_telefono(telefono,	telefono.alt) &&
		 chk_info(informazione.alt)  &&
		 chk_radio(autorizzazione[0].alt)
		){
		
		return true;
		}
		return false;
	}
}	


function control_login(){
	with(document.login){
		if((user.value=="")&&(pswd.value=="")){
			return false;
		}
		return true;
	}
}


function PrintThisPage() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=no,"; 
       sOption+="scrollbars=yes,width=800,height=650,left=100,top=25"; 

   var sWinHTML = document.getElementById('contentstart').innerHTML; 
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><LINK href=print.css rel=Stylesheet><body onload="window.print();window.close();">'); 
       winprint.document.write(sWinHTML);          
       winprint.document.write('</body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}



function GetPrintContent()
{
	var PrintDiv =  document.getElementById('printcontent');
	var ContentDiv =  window.opener.document.getElementById('contentstart');
	PrintDiv.innerHTML = ContentDiv.innerHTML;
}



function changemenu(menusel,menustampsel)
{
	document.getElementById('menu0').className = 'campo_scelta_menu_normale';
	document.getElementById('menu1').className = 'campo_scelta_menu_normale';
	document.getElementById('menu2').className = 'campo_scelta_menu_normale';
	document.getElementById('menu3').className = 'campo_scelta_menu_normale';
	
	document.getElementById(menusel).className = 'campo_scelta_menu_sel';
	
	document.getElementById('menustamp0').style.display = 'none';
	document.getElementById('menustamp1').style.display = 'none';
	document.getElementById('menustamp2').style.display = 'none';
	document.getElementById('menustamp3').style.display = 'none';
	
	document.getElementById('menustamp0').style.visibility = 'hidden';
	document.getElementById('menustamp1').style.visibility = 'hidden';
	document.getElementById('menustamp2').style.visibility = 'hidden';
	document.getElementById('menustamp3').style.visibility = 'hidden';
	
	document.getElementById(menustampsel).style.display = "block";
	document.getElementById(menustampsel).style.visibility = "visible";
}

function chk_ordine(count, pagamento0, pagamento1, pagamento2){
	
	//document.carrello2.codicesconto.value = document.carrello.codicesconto.value;
	
	var pagamento = '';
	var checked = '';
	
	if(pagamento0 == true) checked = 0;
	else if(pagamento1 == true) checked = 1;
	else if(pagamento2 == true) checked = 2;
	
	if(checked !== '') pagamento = document.carrello.pagamento[checked].value;
	else pagamento = '';
	
	//alert(pagamento);
	
	document.carrello2.pagamento.value = pagamento;
	
	var ordine = parseInt(count);
	if(ordine > 0 && pagamento !== '') return true;
	else if(!ordine) alert("Impossibile inviare l'ordine: il carrello è vuoto");
	else alert("attenzione, devi scegliere un metodo di pagamento");
	
	return false;
	
}




