jQuery(function($){
$(function(){
var lastScrollTop=0, delta=5;
$(window).scroll(function(){
var $el=$('.sorucevap');
var $el2=$('.footer');
var hide_c=1;
if($el2.length>0){
var top_of_element=$el2.offset().top - 100;
var bottom_of_element=$el2.offset().top + $el2.outerHeight();
var bottom_of_screen=$(window).scrollTop() + $(window).innerHeight();
var top_of_screen=$(window).scrollTop();
if((bottom_of_screen > top_of_element)&&(top_of_screen < bottom_of_element)){
hide_c=0;
if($('.bottom-navigation-band.not-show-band').length>0){
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').addClass('show-band');
}}
}
if($el.length>0){
var top_of_element=$el.offset().top;
var bottom_of_element=$el.offset().top + $el.outerHeight();
var bottom_of_screen=$(window).scrollTop() + $(window).innerHeight();
var top_of_screen=$(window).scrollTop();
if((bottom_of_screen > top_of_element)&&(top_of_screen < bottom_of_element)){
if($('.bottom-navigation-band.not-show-band').length>0){
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').addClass('show-band');
}}else{
var nowScrollTop=$(this).scrollTop();
if(Math.abs(lastScrollTop - nowScrollTop) >=delta){
if(nowScrollTop > lastScrollTop){
if($('.bottom-navigation-band.show-band').length>0){
if(hide_c){
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').addClass('not-show-band');
$('.bottom-navigation-band-modal.show-band-modal').removeClass('show-band-modal');
$('.bottom-navigation-band-modal').addClass('hide-band-modal');
}}
}else{
if($('.bottom-navigation-band.not-show-band').length>0){
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').addClass('show-band');
}}
lastScrollTop=nowScrollTop;
}else{
}}
}else{
var nowScrollTop=$(this).scrollTop();
if(Math.abs(lastScrollTop - nowScrollTop) >=delta){
if(nowScrollTop > lastScrollTop){
if($('.bottom-navigation-band.show-band').length>0){
if(hide_c){
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').addClass('not-show-band');
$('.bottom-navigation-band-modal.show-band-modal').removeClass('show-band-modal');
$('.bottom-navigation-band-modal').addClass('hide-band-modal');
}}
}else{
if($('.bottom-navigation-band.not-show-band').length>0){
$('.bottom-navigation-band').removeClass('not-show-band');
$('.bottom-navigation-band').removeClass('show-band');
$('.bottom-navigation-band').addClass('show-band');
}}
lastScrollTop=nowScrollTop;
}else{
}}
});
});
$(document).on('click','.open-popup-navigation-band',function(){
if($('.bottom-navigation-band-modal.hide-band-modal').length>0){
$('.bottom-navigation-band-modal.hide-band-modal').removeClass('hide-band-modal');
$('.bottom-navigation-band-modal').addClass('show-band-modal');
}else{
$('.bottom-navigation-band-modal.show-band-modal').removeClass('show-band-modal');
$('.bottom-navigation-band-modal').addClass('hide-band-modal');
}});
$(document).on('click','.to-up-animate',function(){
var body=$("html, body");
body.stop().animate({scrollTop:0}, 500, 'swing', function(){
});
});
});