// * SECCION LOGIN-LOGOUT
// *
// */

function Login(){

	var Email = $('#Email').val();
	var Password = $('#Password').val();

	$.ajax({
		type: 'POST',
		url: 'login.php',
		data: 'Email=' + Email + '&Password=' + Password,
		success: function(html){
		}
	});
	$("#header,#wrapper,#footer").hide('slow', function(){ window.location.href = 'index.php';} );
}


function Logout(){

	var Email = $('#Email').val();
	var Password = $('#Password').val();

	$.ajax({
		type: 'POST',
		url: 'logout.php',
		data: 'Email=&Password=',
		success: function(html){
			$('#DivFormIngreso').html(html);
		}
	});
	$("#header,#wrapper,#footer").hide('slow', function(){ window.location.href = 'index.php';} );
}

function Buscador() {
	var CriterioDeBusqueda = $('#CriterioDeBusqueda').val();
	
	if (CriterioDeBusqueda != "") {
	    window.location.href = 'resultados.php?CriterioDeBusqueda=' + CriterioDeBusqueda;
	}
}

function CriterioCalibre() {
	var criteriocalibre = $('#criteriocalibre').val();
	
	$.ajax({
		type: 'POST',
		url: 'manualesbuscar.php',
		data: 'criteriocalibre=' + criteriocalibre,
		success: function(html){
			$('#DivContenidoManuales').html(html);
		}
	});
}

function SeleccionCriteriosDesdeMenu(MarcaSeleccionada){

	$.ajax({
		type: 'POST',
		url: 'productos_desdemenu.php',
		data: 'MarcaSeleccionada=' + MarcaSeleccionada,
		success: function(html){
			$('.contenido').html(html);
		}
	});

	$.ajax({
		type: 'POST',
		data: 'pagina=' + 1 + '&Marca=' + MarcaSeleccionada,
		url: 'productos_interno.php',
		success: function(html){
			$('#DivProductos').html(html);
			$('#DivProductos').hide();
			$('#DivProductos').fadeIn(1000);
		}
	});

}

    function EnviaFormulario(Formulario) {
        if ($('#email').val() == ''){
            $('TD.TDEmail').append("<font style='color: red;'>&nbsp;* Obligatorio</font>");
            $('#email').focus();
        } else {
            $('#' + Formulario).submit();
        }
    }

$(document).ready(function() {
    $('#header').click( function(){ window.location.href='index.php'; });

});


