function lookup(inputString) {
    if(inputString.length == 0) {
		$('#suggestions').hide();
	} else {
		$.post("http://www.artesaniaseljaguel.com.ar/rpc.php", {queryString: ""+inputString+""}, function(data){
		    if(data.length >0) {
			    $('#suggestions').show();
			    $('#autoSuggestionsList').html(data);
		    }
		});
	}
}
	
function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').fadeOut(500);", 100);
}

function limpiar(b) {
	b.value = "";
}

function verificar(b) {
	if (b.value == "") b.value = "Buscar...";
}

function ValidarFormulario() {
/*
	if ($('#comercio').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese el nombre de su comercio.');
		$('#comercio').focus();
		return false;
	}*/
	if ($('#nombre').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese su nombre.');
		$('#nombre').focus();
		return false;
	}/*
	if ($('#direccion').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese su direccion.');
		$('#direccion').focus();
		return false;
	}*/
	if ($('#ciudad').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese la ciudad.');
		$('#cuidad').focus();
		return false;
	}
/*
	if ($('#provincia').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese su provincia.');
		$('#provincia').focus();
		return false;
	}

	if ($('#telefono').val() == "") {
		$('#error').show();
		$('#error').html('Por favor ingrese su telefono.');
		$('#telefono').focus();
		return;
	}

	if (isNaN($('#telefono').val()) == true) {
		$('#error').show();
		$('#error').html('Ingrese su telefono solo con caracteres numericos.'); 	
		$('#telefono').focus();
		return;
	}
*/
	if ($('#email').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese su dirección de e-mail.');
		$('#email').focus();
		return false;
	}
	
	if (mailValido('#email'))
	{
		$('#error').show();
		$('#error').html('Direccion de correo electrónico no valida.');
		$('#email').focus();
		return false;
	}
	
	if ($('#consulta').val() == '') {
		$('#error').show();
		$('#error').html('Por favor ingrese su consulta.');
		$('#consulta').focus();
		return false;
	} 
	return true;
}
	
function mailValido(dir) {
	var cadena = /^(.+\@.+\..+)$/		
	if(!cadena.test(v_email = $(dir).attr("value"))) return true;	
	return false;
}

