$('#menu a').click(function(){
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('body').stop().animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
function onScroll(event){
var scrollPos = $(document).scrollTop();
$('.cl-effect-4 a').each(function () {
var currLink = $(this);
var refElement = $(currLink.attr("href"));
if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
$('.cl-effect-4 li a').removeClass("active");
currLink.addClass("active");
$('.text').fadeOut('slow');
}
});
}