function InfoPayment(){
	
	$('#tipoPagamento option:selected').each(function(){
		var txt = '';
		switch($(this).attr('value'))
		{
			case 'contrassegno' :
			txt = 'Pagamento in contrassegno alla consegna del pacco.Costo aggiuntivo 10€';
			break;
			case 'bonifico' :
			txt = 'Le invieremo prima di tutto la fattura e dopo aver ricevuto il vostro pagamento invieremo la merce.Nessun costo aggiuntivo.';
			break;
			case 'paypal':
			txt = 'pagamento con PayPal.Costo aggiuntivo 10€' ;
			break;
		}
		
		$('#descrizionePagamento').text(txt);
	})
	.change();
}

function InfoConoscenza(){
	$('#tipoConoscenza option:selected').each(function(){
		var txt = "" ;
		switch($(this).attr('value'))
		{
			case 'rivista' :
			txt = "inserire il nome della rivista" ;
			break;
			case 'medico' :
			txt = "inserire il nome dello studio medico" ;
			break;
			case 'internet' :
			txt = "specifica un canale" ;
			break;
			case 'motore' :
			txt = 'inserire il nome del motore di ricerca' ;
			break;
			case 'sito' :
			txt = "inserire il link del sito web" ;
			break;
			case 'facebook' :
			txt = "" ;
			break;
			case 'conoscenti' :
			txt = "specificare ..." ;
			break;
			case 'altro' :
			txt = "specificare..." ;
			break;
		}
		
		$('#testoConoscenza').val(txt) ;
		
	}).change();
}


function checkFields()
{
	var txtmessage = "" ;
	var count = 0 ;
	$(':input').each(function(){
		if ( $(this).hasClass('obbligatorio') && $(this).val() == "" )
		{
			count++;
			$(this).css('border-color' , '#cc0000') ;
			//txtmessage += "Compila il campo "+$(this).attr('name')+"\n" ;
		}	
	});
	if ( count != 0 )
	{
		alert('Attenzione!!!Abbiamo evidenziato in rosso i campi che devono essere obbligatoriamente compilati');
		return false;
	}
	else
	{
		return true;
	}
		
}

