function Representante()
{

	$('#representante #btnEnviar').click(function() 
	{
		$('#resultado-listagem').html('');
		var estadoID = $('#representante #selEstado').val()
		if(estadoID == '')
		{
			return false;
		}
		
		$('#resultado-listagem').addClass('loading-grande');
	
		$.ajax(
		{
			url: SITE_CAMINHO_SITE_ABSOLUTO + "acao/Representante.php",
			data: {
				EstadoID: estadoID,
				Acao: 'carregarRepresentante'
			},
			type: 'POST',
			success: function(resposta)
			{
				$('#resultado-listagem').removeClass('loading-grande').html(resposta);
			}
		 });
		 
		 return false;
	});
	
	$('#principal #btnEnviar').click(function() 
		{
			if ($('.obrigatorio').val() == '')
			{
				$('.obrigatorio').addClass('erro');
				$('.msg-erro').text(MSG06).slideDown();
			}
				
		});
		
		
		$('#form-representante').validate(
		{
			debug: false,
			errorClass: "erro",
			errorElement: "span",
			errorContainer: ".msg-erro",
			errorPlacement: function(error, element)	
			{
				$('.msg-erro').text(error.text());
			},
			
			ignore: '.ignorar',
			highlight: function(element, errorClass)
			{
				$(element).addClass(errorClass);
			},
			unhighlight: function(element, errorClass)
			{
				$(element).removeClass(errorClass);
			},
			
			rules: 
			{	
				selEstado:
				{
					required: true
				}
				
			},
			messages:
			{
				selEstado:
				{
					required: MSG06
				}
			}
		});
	
}



