I have a one page site with fixed navigation and using a scroll script, very similar to this: http://www.ivanjevremovic.in.rs/live/temptation/single/orange/index-cycle-slide
Use $('#element').offset().top; to detect element top side.
$('#element').offset().top;
$(window).scrollTop(); to detect current scroll position.
$(window).scrollTop();
And $(window).height(); to detect current window height.
$(window).height();
And after that steps you actually need only something easy math calculations.