
$(function(){
	
	$('#codcli').val('');
	$('#telcli').val('');
	$('#btconsultar').click(
		function(){
			$('.ptdisp').text('');
			$('#dvpontosdisp').hide();
					
			$('#codcli, #telcli').each(function(){
			var attrid = $(this).attr('id');
			var vlr = $(this).val();
				if((attrid=='codcli' && vlr.length<12) || (attrid=='telcli' && vlr.length<9) || vlr==''){
					$(this).focus();
					alert('Digite corretamente');
					x = false;
					return false;
				}  else x = true;
			});
			if(x) {
				$.post('/class/results.asp',
				{
				process:1,
				codcli:$('#codcli').val(),
				telcli:$('#telcli').val()
				},
				function(data){
						$('.ptdisp').text(data);
						$('#dvpontosdisp').show()
					
				}
				
				)
			
			}

				
			
		}
			
	)
});
