var loginBox_reservas = function() {
	cargandov2(true);
	$.ajax({
		data: 'accion=cliente&queHacer=boxLoginReserva',
		type: 'POST',
		url: 'includes/funciones_parser.php',
		success: function(response) {
			$('#boxLoginHeaderContainer').html($('#boxLoginHeader').html());
			$('#texto_reservas_activas').html(response[1]);
			$('#texto_nombre_usuario').html('<strong>'+response[0]+'</strong>');
			cargandov2(false);							
		}
	});
};

var getEventos = function() {
	var parametros = {accion: 'eventos',
					  queHacer: 'get_eventosFront',
					  limite: 5,
					  orden: 'random'};
					  
	cargandov2(true);
	$.ajax({
		data: parametros,
		type: 'POST',
		url: 'includes/funciones_parser.php',
		success: function(response){
			response = response.respuesta;

			var salidaEventos = '';
			$.each(response.eventos, function(i, val){
				$('.col .eventos div:first').find('h4 a').attr('href', 'detalle/'+val.id).html(val.nombre);
				$('.col .eventos div:first').find('.linkEvento').attr('href', 'detalle/'+val.id);
				$('.col .eventos div:first').find('.photo')
											.attr('src', 'img/eventos/'+val.imagen+'.thumb_front.'+val.imagen_tipo)
											.attr('width', '75')
											.attr('height', '75');
				$('.col .eventos div:first').find('p').html(val.contenido);
				$('.col .eventos div div:first').find('span').text('('+val.stock_numero+')');
				
				salidaEventos += '<div class="evento" style="clear:both">'+$('.col .eventos div:first').html()+'</div>';
			});
			$('.col .eventos').html(salidaEventos);
			$('.col .eventos').css({'display':''});
			cargandov2(false);
		}
	});
};

$(document).ready(function(){
	$.ajaxSetup({
   		type: "POST",
		dataType: "json",
	    contentType: "application/x-www-form-urlencoded; charset=utf-8"
    });
	
	Shadowbox.init();
	staticbar();
});