// JavaScript Document
function cambiaedicion(){
	$("#ediccion").slideUp();
	$("#cartel").slideUp();
	
	$.ajax({
			type: "POST",
			url: "php/edicion.php",
			data: "idedicion="+$('#idedicion').val(),
			success: function(datos){
				
				$("#ediccion").html(datos);
				
			}
		});
	$.ajax({
			type: "POST",
			url: "php/cartel.php",
			data: "idedicion="+$('#idedicion').val(),
			success: function(datos){
				
				$("#cartel").html(datos);
				
			}
		});

	
}

function AbreNoticia(id){
	$.ajax({
			type: "POST",
			url: "php/novas.php",
			data: "idnoticia="+id,
			success: function(datos){
				
				$("#contenedor").html(datos);
				
			}
		});
	
}

function inicio(){
	//Cargo el menu de la página de inicio
	$.ajax({
			type: "POST",
			url: "php/inicio.php",
			data: "id=1",
			success: function(datos){
				
				$("#contenedor").html(datos);
				$("#preloader").hide();
			}
		});

}

function Abre(crumb){
	
	var cr = crumb.split("-");
	$.history.add(crumb);
	alert(cr[0]);
	if(cr[0]=='listado'){
		$("#contenedor").slideUp();
		$("#preloader").show();
		$.ajax({
			type: "POST",
			url: "php/listado.php",
			data: "id="+cr[1],
			success: function(datos){
				
				$("#contenedor").html(datos);
				$("#preloader").hide();
				$("#contenedor").slideDown();
			}
		});	
		
	}
	if(cr[0]=='detalle'){
		$("#contenedor").slideUp();
		$("#preloader").show();
		$.ajax({
			type: "POST",
			url: "php/detalle.php",
			data: "id="+cr[1]+"&idca="+cr[2],
			success: function(datos){
				
				$("#contenedor").html(datos);
				$("#preloader").hide();
				$("#contenedor").slideDown();
			}
		});	
		
		
		
		
		
	}
	
		
	
}