var target = $('.light-bg');
var targetPos = target.offset().top;
var winHeight = $(window).height();
var scrollToElem = targetPos - winHeight + 200;
$(window).scroll(function(){
var winScrollTop = $(this).scrollTop();
if(winScrollTop > scrollToElem){
$('header').addClass('header-black');
} else {
$('header').removeClass('header-black');
}
});