jQuery(document).ready(function($){
$('#menu-burger-link').click(function(){
$('#menu-container').fadeIn();
$('#black-hole').fadeIn();
return false;
});
$('#menu-close').click(function(){
$('#menu-container').fadeOut();
$('#black-hole').fadeOut();
return false;
});
$('#menu-container #menu div .menu-container').slicknav({
prependTo: '#mobile-menu',
label: ''
});
$('#welcome-scroll').click(function(){
$('html, body').animate({
scrollTop: $('#welcome-screen').outerHeight() - $('#welcome-screen').offset().top
}, 750);
return false;
});
if($(window).width() >=991){
var fixedHeight=$(window).height() - 180;
$('.rdv-left-content, .rdv-right-content, #home-content .text-left-container, #home-content .text-right-container').css('height', fixedHeight);
}
var status=$('*').find('[data-status]');
var pageStatus=status.length;
var els=[];
status.each(function(i){
els.push({
name: $(this).attr('id'),
status: $(this).attr('data-status')
});
});
if($('body').hasClass('home')){
var s=$(window).scrollTop(),
d=$(document).height(),
c=$(window).height();
var scrollPercentage=Math.floor((s / (d-c)) * 100);
if(scrollPercentage >=66){
$('#page-status').attr('class', 'third-three');
}else if(scrollPercentage >=33){
$('#page-status').attr('class', 'third-two');
}else{
$('#page-status').attr('class', 'third-one');
}
$(window).scroll(function(){
var s=$(window).scrollTop(),
d=$(document).height(),
c=$(window).height();
var scrollPercentage=Math.floor((s / (d-c)) * 100);
if(scrollPercentage >=66){
$('#page-status').attr('class', 'third-three');
}else if(scrollPercentage >=33){
$('#page-status').attr('class', 'third-two');
}else{
$('#page-status').attr('class', 'third-one');
}});
} else {
var s=$(window).scrollTop(),
d=$(document).height(),
c=$(window).height();
var scrollPercentage=Math.floor((s / (d-c)) * 100);
if(scrollPercentage >=75){
$('#page-status').attr('class', 'fourth-four');
}else if(scrollPercentage >=50){
$('#page-status').attr('class', 'fourth-three');
}else if(scrollPercentage >=25){
$('#page-status').attr('class', 'fourth-two');
}else{
$('#page-status').attr('class', 'fourth-one');
}
$(window).scroll(function(){
var s=$(window).scrollTop(),
d=$(document).height(),
c=$(window).height();
var scrollPercentage=Math.floor((s / (d-c)) * 100);
if(scrollPercentage >=75){
$('#page-status').attr('class', 'fourth-four');
}else if(scrollPercentage >=50){
$('#page-status').attr('class', 'fourth-three');
}else if(scrollPercentage >=25){
$('#page-status').attr('class', 'fourth-two');
}else{
$('#page-status').attr('class', 'fourth-one');
}});
}
$('.member-active-link').click(function(e){
var linkTarget=$(this).attr('id');
$('.member-active-link').removeClass('active');
$(this).addClass('active');
if(linkTarget=='member-active-link-for-lausanne'){
$('#members-geneve').css('display', 'none');
$('#members-lausanne').css('display', 'block');
}
if(linkTarget=='member-active-link-for-geneve'){
$('#members-geneve').css('display', 'block');
$('#members-lausanne').css('display', 'none');
}
return false;
});
$('body').on('click', '#close-member-details', function(){
$('#member-details').fadeOut();
return false;
});
$('.members .member-trigger').click(function(){
var memberID=$(this).data('member');
$.post(ajaxurl.ajaxurl, {action: 'theme_ajax_member', key: memberID}, function(response){
$('#member-details').fadeIn();
$('#member-details').html(response);
});
return false;
});
$('#main #main-content #page-content #pog-team .members .member .text').each(function(index, element){
$clamp(element, {clamp: '173px', useNativeClamp: false});
});
});