function ajaxUrl(href){
$(document).scrollTop('0');
$('#loades').css({'display':'block'});
$('body').css('overflow','hidden');
$.post(
href,
{'ajaxes_loaders' : null},
function (data){
$('#loades').css('display','none');
$('body').css('overflow','auto');
$('body').html(data);
}
);
}
if (history.pushState){
$(window).on('popstate', function(event){
var loc = event.location || ( event.originalEvent && event.originalEvent.location )|| document.location;
ajaxUrl(loc.href);
});
$(document).on('click', 'a[load != "none"]', function(e){
var href = $(this).attr('href');
if (href != null){
ajaxUrl(href);
var titl = $('div[title]').text();
document.title = titl;
history.pushState(href, titl, href);
e.preventDefault();
}
});
}