function callback(hash)
{
	if (hash)
	{
		if (hash.lastIndexOf("pagina=") != -1)
		{
			$.ajax({  
				url: "scripts/history.php",
				type: "GET",
				data: hash,
				cache: false,
				success: function (html) {

				//Ocultar barra de progreso
				$('#loading').hide();
				
				//Revertir el contenido en el cuerpo/id necesario  
				$('#cuerpo').html(html);  
				}
			});
		}
	}
}

$(document).ready(function() {
	$.history.init(callback);
	$("a[rel='history'], input[rel='history']").click(function(){
		var url = $(this).attr('href');
		url = url.replace(/^.*#/, '');
		$.history.load(url);
		return false;
    });
});

$(document).ajaxStop(function(){
    $("a[rel='history'], input[rel='history']").click(function(){
		var url = $(this).attr('href');
		url = url.replace(/^.*#/, '');
		$.history.load(url);
		return false;
    });
});

