$(':input').on('input keyup change paste', function(){
if($(this).hasClass('error')) {
$(this).removeClass('error');
}
});
$(':input').on('blur', function(){
if($(this).val() == '') {
$(this).removeClass('error');
}
});
.block p:first-of-type {
margin-top: -5px;
}
$('.aside-nav ul li a').click(function(e){
e.preventDefault();
$('.aside-nav ul li').removeClass('active-aside-item');
$(this).parent().addClass('active-aside-item');
var this_hash = $.attr(this, 'href');
$('html, body').animate({
scrollTop: $( this_hash ).offset().top -10
}, 500);
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
$('.sidebar').animate({
left: '-=260'
}, 300);
$('.sidebar-overlay').fadeOut();
$('body').css('overflow', 'initial');
}
location.hash = this_hash;
});
$(document).on("scroll", onScroll);
function onScroll(event){
var scrollPos = $(document).scrollTop();
$('.aside-nav ul li a').each(function (){
var currLink = $(this);
var refElement = $(currLink.attr("href"));
if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos){
$('.aside-nav ul li a').closest('li').removeClass("active-aside-item");
currLink.closest('li').addClass("active-aside-item");
} else {
currLink.removeClass("active-aside-item");
}
});
}