jQuery(document).ready(function($){
$(".tab-menu a").click(function (event) {
event.preventDefault();
$(this).parent().addClass('active');
$(this).parent().siblings().removeClass('active');
var tab = $(this).attr('data-tab');
$('.tab-content').not(tab).removeClass('active').css('display', 'none');
$(tab).fadeIn().addClass('active');
});
// $(".logos-2").flexisel(
// {
// visibleItems: 5,
// animationSpeed: 200,
// autoPlay: true,
// autoPlaySpeed: 3000,
// pauseOnHover: true,
// clone:true,
// enableResponsiveBreakpoints: true,
// responsiveBreakpoints: {
// portrait: {
// changePoint:480,
// visibleItems: 1
// },
// landscape: {
// changePoint:640,
// visibleItems: 2
// },
// tablet: {
// changePoint:768,
// visibleItems: 3
// }
// }
// }
// );
// open-close menu in mobile
// var target = $('.menu-item-has-children');
// target.append('');
// //target.find('li').hide();
// var clickTarget = $('.mclick-target');
// target.on('click', '.mclick-target', function(event) {
// /* Act on the event */
// // target.removeClass('opened');
// if($(this).closest(target).hasClass('opened')){
// $(this).closest(target).removeClass('opened');
// }else{
// $(this).closest(target).toggleClass('opened');
// }
// //target.find('li').slideUp();
// $(this).closest(target).find('li').slideToggle();
// });
// open-close menu in mobile end script
$('.heading, .widget-title, .entry-title, .page-title, .news-title').not('.coaches .heading, .staff .heading').each(function() {
var h = $(this).html();
var index = h.indexOf(' ');
if(index == -1) {
index = h.length;
}
//$(this).html('' + h.substring(0, index) + '' + $.trim(h.substring(index, h.length)));
});
$('.scroller').on('click', function(){
$('html,body').animate({scrollTop: ($(this).offset().top + 160)}, 800);
});
var cbpAnimatedHeader = (function() {
var docElem = document.documentElement,
header = document.querySelector( '.cbp-af-header' ),
didScroll = false,
changeHeaderOn = 10;
function init() {
window.addEventListener( 'scroll', function( event ) {
if( !didScroll ) {
didScroll = true;
setTimeout( scrollPage, 10 );
}
}, false );
}
function scrollPage() {
var sy = scrollY();
if ( sy >= changeHeaderOn ) {
classie.add( header, 'cbp-af-header-shrink' );
}
else {
classie.remove( header, 'cbp-af-header-shrink' );
}
didScroll = false;
}
function scrollY() {
return window.pageYOffset || docElem.scrollTop;
}
init();
})();
var first_img = $('.panel_youtube .ytCard .aggroPic:first img').attr('src');
if(typeof first_img === 'undefined'){
} else {
var fixed_img = first_img.replace("hqdefault", "maxresdefault");
$('.panel_youtube .ytCard .aggroPic:first img').attr('src', fixed_img)
};
$('.scroller').on('click', function(){
$('html,body').animate({scrollTop: ($(this).offset().top + 120)}, 800);
});
})
function createCookie(name, value, expires, path, domain) {
var cookie = name + "=" + escape(value) + ";";
if (expires) {
// If it's a date
if(expires instanceof Date) {
// If it isn't a valid date
if (isNaN(expires.getTime()))
expires = new Date();
}
else
expires = new Date(new Date().getTime() + parseInt(expires) * 1000 * 60 * 60 * 24);
cookie += "expires=" + expires.toGMTString() + ";";
}
if (path)
cookie += "path=" + path + ";";
if (domain)
cookie += "domain=" + domain + ";";
document.cookie = cookie;
}
function getCookie(name) {
var regexp = new RegExp("(?:^" + name + "|;\s*"+ name + ")=(.*?)(?:;|$)", "g");
var result = regexp.exec(document.cookie);
return (result === null) ? null : result[1];
}
function deleteCookie(name, path, domain) {
// If the cookie exists
if (getCookie(name))
createCookie(name, "", -1, path, domain);
}
if (screen && screen.width < 768) {
jQuery(document).ready(function($){
$('#menu-main-menu li').children('ul').hide();
$('#menu-main-menu li').click(function () {
$(this).siblings('li').children('ul,p').slideUp('slow');
$(this).children('ul,p').slideUp('slow');
$('#menu-main-menu li a').each(function () {
if ($(this).attr('rel') != '') {
$(this).removeClass($(this).attr('rel') + 'Over on')
}
});
if ($(this).children('ul,p').is(':hidden') == true) {
$(this).children('ul,p').slideDown('slow');
return false
}
})
$('#menu-02-main-menu li').children('ul').hide();
$('#menu-02-main-menu li').click(function () {
$(this).siblings('li').children('ul,p').slideUp('slow');
$(this).children('ul,p').slideUp('slow');
$('#menu-02-main-menu li a').each(function () {
if ($(this).attr('rel') != '') {
$(this).removeClass($(this).attr('rel') + 'Over on')
}
});
if ($(this).children('ul,p').is(':hidden') == true) {
$(this).children('ul,p').slideDown('slow');
return false
}
})
});
}