// source --> https://teleworkph.com/wp-content/plugins/cookie-law-info/legacy/admin/modules/ccpa/assets/js/cookie-law-info-ccpa.js?ver=3.4.0 
(function( $ ) {
	'use strict';
	var CCPA = {
		ccpaOptedOut: false,
		ccpaOptOutConfirmationOpen: false,
		set: function() {
			this.setCheckboxState();
			jQuery( document ).on(
				'click',
				'.wt-cli-ccpa-opt-out-checkbox',
				function() {
					CCPA.ccpaOptedOut = false;
					if (this.checked === true ) {
						CCPA.ccpaOptedOut = true;
					}
					CCPA.optOutCcpa();
				}
			);
			jQuery( document ).on(
				'click',
				'.wt-cli-ccpa-opt-out:not(.wt-cli-ccpa-opt-out-checkbox)',
				function(){
					CCPA.showCcpaOptOutConfirmBox();
				}
			)
		},
		setCheckboxState : function() {
			var cliConsent       = {};
			var preferenceCookie = CLI_Cookie.read( CLI_PREFERENCE_COOKIE );
			if ( preferenceCookie !== null ) {
				cliConsent = CCPA.parseCookie( preferenceCookie );
				if ( typeof( cliConsent.ccpaOptout ) !== 'undefined') {

					if ( cliConsent.ccpaOptout === true ) {
						jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',true );
					} else {
						jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',false );
					}
				}

			}
		},
		optOutCcpa: function() {
			var preferenceCookie = CLI_Cookie.read( CLI_PREFERENCE_COOKIE );
			var cliConsent       = {};
			if ( preferenceCookie !== null ) {
				cliConsent = CCPA.parseCookie( preferenceCookie );
			}
			cliConsent.ccpaOptout = this.ccpaOptedOut;
			cliConsent            = JSON.stringify( cliConsent );
			cliConsent            = window.btoa( cliConsent );
			CLI_Cookie.set( CLI_PREFERENCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE );
			this.setCheckboxState();
		},
		parseCookie: function( preferenceCookie ) {
			var cliConsent = {};
			cliConsent     = window.atob( preferenceCookie );
			cliConsent     = JSON.parse( cliConsent );
			return cliConsent;
		},
		toggleCCPA: function() {

		},
		checkAuthentication: function() {

		},
		showCcpaOptOutConfirmBox: function() {

			var css                         = '.cli-alert-dialog-buttons button {\
                -webkit-box-flex: 1!important;\
                -ms-flex: 1!important;\
                flex: 1!important;\
                -webkit-appearance: none!important;\
                -moz-appearance: none!important;\
                appearance: none!important;\
                margin: 4px!important;\
                padding: 8px 16px!important;\
                border-radius: 64px!important;\
                cursor: pointer!important;\
                font-weight: 700!important;\
                font-size: 12px !important;\
                color: #fff;\
                text-align: center!important;\
                text-transform: capitalize;\
                border: 2px solid #61a229;\
            } #cLiCcpaOptoutPrompt .cli-modal-dialog{\
                max-width: 320px;\
            }\
            #cLiCcpaOptoutPrompt .cli-modal-content {\
                box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            -webkit-box-shadow:0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            -moz-box-shadow0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            }\
            .cli-alert-dialog-content {\
                font-size: 14px;\
            }\
            .cli-alert-dialog-buttons {\
                padding-top:5px;\
            }\
            button.cli-ccpa-button-cancel {\
                background: transparent !important;\
                color: #61a229;\
            }\
            button.cli-ccpa-button-confirm {\
                background-color:#61a229;\
                color:#ffffff;\
            }';
			var head                        = document.head || document.getElementsByTagName( 'head' )[0];
			var style                       = document.createElement( 'style' );
			var primaryColor                = CLI.settings.button_1_button_colour;
			var primaryLinkColor            = CLI.settings.button_1_link_colour;
			var backgroundColor             = CLI.settings.background;
			var textColor                   = CLI.settings.text;
			CCPA.ccpaOptOutConfirmationOpen = false;
			var ccpaPrompt,
			$this                           = this;
			(ccpaPrompt = document.createElement( "div" )).classList.add( "cli-modal", "cli-show", "cli-blowup" );
			ccpaPrompt.id = "cLiCcpaOptoutPrompt";
			var t         = document.createElement( "div" );
			t.className   = "cli-modal-dialog";
			var n         = document.createElement( "div" );
			n.classList.add( "cli-modal-content","cli-bar-popup" );
			var o       = document.createElement( "div" );
			o.className = "cli-modal-body";
			var p       = document.createElement( "div" );
			p.classList.add( "wt-cli-element", "cli-container-fluid", "cli-tab-container" );
			var q       = document.createElement( "div" );
			q.className = "cli-row";
			var r       = document.createElement( "div" );
			r.classList.add( "cli-col-12" );
			var x = document.createElement( "div" );
			x.classList.add( "cli-modal-backdrop", "cli-fade", "cli-settings-overlay", "cli-show" );
			var a       = document.createElement( "button" );
			var b       = document.createElement( "button" );
			var c       = document.createElement( "div" );
			var d       = document.createElement( "div" );
			d.className = "cli-alert-dialog-content",
			d.innerText = ccpa_data.opt_out_prompt,
			c.className = "cli-alert-dialog-buttons";
			a.className = "cli-ccpa-button-confirm",
			a.innerText = ccpa_data.opt_out_confirm,
			a.addEventListener(
				"click",
				function() {
					CCPA.ccpaOptedOut = true,
					CCPA.optOutCcpa(),
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );
					if ( Cli_Data.ccpaType === 'ccpa' ) {
						CLI.enableAllCookies();
						CLI.accept_close();
					}
				}
			),
			b.className = "cli-ccpa-button-cancel",
			b.innerText = ccpa_data.opt_out_cancel,
			b.addEventListener(
				"click",
				function() {
					CCPA.ccpaOptedOut = false,
					CCPA.optOutCcpa(),
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );
					if ( Cli_Data.ccpaType === 'ccpa' ) {
						CLI.enableAllCookies();
						CLI.accept_close();
					}
				}
			),
			ccpaPrompt.addEventListener(
				"click",
				function( event ) {
					event.stopPropagation();
					if ( ccpaPrompt !== event.target) {
						return;
					}
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );

				}
			),
			ccpaPrompt.appendChild( t ),
			t.appendChild( n ),
			n.appendChild( o ),
			o.appendChild( p ),
			p.appendChild( q ),
			q.appendChild( r ),
			r.appendChild( d ),
			r.appendChild( c ),
			c.appendChild( b ),
			c.appendChild( a ),

			head.appendChild( style );
			style.type = 'text/css';
			if (style.styleSheet) {
				// This is required for IE8 and below.
				style.styleSheet.cssText = css;
			} else {
				style.appendChild( document.createTextNode( css ) );
			}
			document.body.appendChild( ccpaPrompt );
			document.body.appendChild( x );
			document.body.classList.add( "cli-modal-open" );

		},
	}
	jQuery( document ).ready(
		function() {
			CCPA.set();
		}
	);

})( jQuery );
// source --> https://teleworkph.com/wp-content/themes/bb-theme-child/js/custom-code.js?ver=1 



jQuery(document).ready(function(){
    
    
    
    
    
    
    
    if (jQuery(window).width() <= 767) {
        jQuery("nav .navbar-toggle.navbar-toggler").hide();    
        jQuery("nav .fl-page-nav-collapse.collapse.navbar-collapse").addClass("in");
    }
    
    
    
    

    
    
    
    
    
    
   // jQuery(".page-id-14 #masthead .site-logo-img img").attr("src", "http://teleworkph.com/wp-content/uploads/2020/01/twphlogo-2.png");
    
    jQuery(".comments-area .comment-respond .comment-reply-title").html("Let us know what you think of this post");
    

       
    
    jQuery('.my-owl-1').owlCarousel({ 
        margin:40,
        autoplay:true,
        loop: true,
        autoplayTimeout:3000,
        autoplayHoverPause:true,
        smartSpeed :700,
        nav :true,
        responsive:{
            0:{
                items:1,
                stagePadding: 20
            },
            580:{
                items:2,
                stagePadding: 10,
                margin:20
            },
            1000:{
                items:3,
                stagePadding: 10,
                margin:30
            },
            1053:{
                items:3 
            }
        }
    });
     
        
    jQuery('.my-owl-2').owlCarousel({
        loop:true,
        autoplay:true,
        autoplayTimeout:2000,
        autoplayHoverPause:true,
        items:1,
        margin:30,
        smartSpeed :700
      
    });
    
     jQuery('.my-owl-3').owlCarousel({ 
        margin:40,
        smartSpeed :700,
        autoplayTimeout:7000,
        autoplayHoverPause:true,
        dots: true,
        responsive:{
            0:{
                items:1,
                stagePadding: 20
            },
            600:{
                items:2,
                stagePadding: 10,
                margin:20
            },
            1000:{
                items:2,
                stagePadding: 10,
                margin:30
            },
            1053:{
                items:2 
            }
        }
    });
    
    jQuery('.my-owl-6').owlCarousel({ 
        margin:40,
        smartSpeed :700,
        autoplayTimeout:7000,
        autoplayHoverPause:true,
        dots: true,
        responsive:{
            0:{
                items:1,
                stagePadding: 20
            },
            600:{
                items:2,
                stagePadding: 10,
                margin:20
            },
            1000:{
                items:3,
                stagePadding: 10,
                margin:30
            },
            1053:{
                items:3 
            }
        }
    });
    
    if (jQuery(window).width() <= 921) {
        jQuery( ".ast-mobile-menu-buttons" ).addClass( "thetrigger" );    
        //alert("bb");
    }
    
  
      
    function setblogimages22() {
        if (jQuery(window).width() <= 768) {
            jQuery(document).ready(function(){
                // Select and loop the container element of the elements you want to equalise
                jQuery('.fl-post-feed').each(function(){         
                      jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(){   
                        jQuery('a img', this).css('display', 'block');
                        jQuery(this).css({'height' : '', 'background-image' : 'url()'});   
                      }); 
                }); 
            });
        }
        else{
             // Select and loop the container element of the elements you want to equalise
            jQuery('.fl-post-feed').each(function(){  
              
                 
                  var sizebox1 = 0;
                  var sizebox2 = 0;
                  var sizebox3 = 0;
                  var sizebox4 = 0;
                  
                  var imgurl1 = '';
                  var imgurl2 = '';
                  var imgurl3 = '';
                  var imgurl4 = '';
                  
                  var blogurl1 = '';
                  var blogurl2 = '';
                  var blogurl3 = '';
                  var blogurl4 = '';
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-text', this).each(function(i, el){
                                            
                        if ( i === 0) {
                           sizebox1 = jQuery(this).height();
                        }
                        else if ( i === 1 ) {
                            sizebox2 = jQuery(this).height();
                        }
                        else if ( i === 2 ) {
                            sizebox3 = jQuery(this).height();
                        }
                        else if ( i === 3 ) {
                            sizebox4 = jQuery(this).height();
                        }
                                               
                  });  
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(x, el){
                        if ( x === 0) {
                            imgurl1 = jQuery('a img', this).attr('src');  
                            
                            
                            blogurl1 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl1 +'"></a>');
                                
                            
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl1 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox1); 
                        }
                        else if ( x === 1 ) {
                            imgurl2 = jQuery('a img', this).attr('src');  
                             
                            blogurl2 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl2 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl2 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox2); 
                            
                            
                         
                        }
                        else if ( x === 2 ) {
                            imgurl3 = jQuery('a img', this).attr('src');  
                             
                            blogurl3 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl3 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl3 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox3); 
                        }
                        else if ( x === 3 ) {
                            imgurl4 = jQuery('a img', this).attr('src');  
                             
                            blogurl4 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl4 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl4 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox4); 
                        } 
                  }); 
                }); 
        }
   }
   
   setTimeout(setblogimages22, 1100);
    
   /*jQuery('.my-owl-1').each(function(){  
        jQuery('.owl-stage-outer .owl-stage .owl-item .item', this).each(function(y, ey){
            
            var slnpermalink1 = '';
            var slnpermalink2 = '';
            var slnpermalink3 = '';
            var slnpermalink4 = '';
            var slnpermalink5 = '';
            
           
            if ( y === 0) {
               slnpermalink1 = jQuery('h2 a', this).attr('href');
               jQuery(this).wrap('<a href="'+ slnpermalink1 +'"></a>'); 
            }
            else if ( y === 1 ) {
               slnpermalink2 = jQuery('h2 a', this).attr('href');
               jQuery(this).wrap('<a href="'+ slnpermalink2 +'"></a>');  
            }
            else if ( y === 2 ) {
               slnpermalink3 = jQuery('h2 a', this).attr('href');
               jQuery(this).wrap('<a href="'+ slnpermalink3 +'"></a>');  
            }
            else if ( y === 3 ) {
               slnpermalink4 = jQuery('h2 a', this).attr('href');
               jQuery(this).wrap('<a href="'+ slnpermalink4 +'"></a>');  
            }
            else if ( y === 4 ) {
                slnpermalink5 = jQuery('h2 a', this).attr('href');
               jQuery(this).wrap('<a href="'+ slnpermalink5 +'"></a>');  
            }
            
        });        
    }); */
    
    jQuery('#projects-carousel-2 .owl-dps').wrap('<a href="http://teleworkph.com/data-processing-services/"</a>');
    jQuery('#projects-carousel-2 .owl-icc').wrap('<a href="http://teleworkph.com/inbound-call-center-services/"</a>');
    jQuery('#projects-carousel-2 .owl-occ').wrap('<a href="http://teleworkph.com/outbound-call-center-services/"</a>');
    jQuery('#projects-carousel-2 .owl-va').wrap('<a href="http://teleworkph.com/virtual-assistance-services/"</a>');
    jQuery('#projects-carousel-2 .owl-boo').wrap('<a href="http://teleworkph.com/back-office-operation-service/"</a>');
    jQuery('#projects-carousel-2 .owl-das').wrap('<a href="https://teleworkph.com/data-annotation-services/"</a>');
    
   
   jQuery(".button-testimonial-new-homepage a").click(function(event){
        event.preventDefault();
        jQuery(".all-testimonial-toggle").css("display", "block");
        jQuery(".button-testimonial-new-homepage a").toggle();
    });
    
    
    jQuery(".button2-testimonial-new-homepage a").click(function(event2){
        event2.preventDefault();
        jQuery(".all-testimonial-toggle").css("display", "none");
        jQuery(".button-testimonial-new-homepage a").toggle();
    });

    
    //blog Why outsource to the philippines 12 key benefits smoot scrolling
    jQuery("#blog-wottp1").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp1").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp2").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp2").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp3").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp3").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp4").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp4").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp5").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp5").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp6").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp6").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp7").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp7").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp8").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp8").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp9").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp9").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp10").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp10").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp11").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp11").offset().top
        }, 1000);
    });
    jQuery("#blog-wottp12").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#wottp12").offset().top
        }, 1000);
    });
    
    jQuery( ".single-blog-cta" ).closest( ".wp-block-columns" ).css( "display", "block" );
});       

//-----



if(performance.navigation.type == 2) {
    
   function setblogimages() {
        if (jQuery(window).width() <= 768) {
            jQuery(document).ready(function(){
                // Select and loop the container element of the elements you want to equalise
                jQuery('.fl-post-feed').each(function(){         
                      jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(){   
                        jQuery('a img', this).css('display', 'block');
                        jQuery(this).css({'height' : '', 'background-image' : 'url()'});   
                      }); 
                }); 
            });
        }
        else{
             // Select and loop the container element of the elements you want to equalise
            jQuery('.fl-post-feed').each(function(){  
              
                 
                  var sizebox1 = 0;
                  var sizebox2 = 0;
                  var sizebox3 = 0;
                  var sizebox4 = 0;
                  
                  var imgurl1 = '';
                  var imgurl2 = '';
                  var imgurl3 = '';
                  var imgurl4 = '';
                  
                  var blogurl1 = '';
                  var blogurl2 = '';
                  var blogurl3 = '';
                  var blogurl4 = '';
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-text', this).each(function(i, el){
                                            
                        if ( i === 0) {
                           sizebox1 = jQuery(this).height();
                        }
                        else if ( i === 1 ) {
                            sizebox2 = jQuery(this).height();
                        }
                        else if ( i === 2 ) {
                            sizebox3 = jQuery(this).height();
                        }
                        else if ( i === 3 ) {
                            sizebox4 = jQuery(this).height();
                        }
                                               
                  });  
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(x, el){
                        if ( x === 0) {
                            imgurl1 = jQuery('a img', this).attr('src');  
                            
                            blogurl1 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl1 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl1 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox1); 
                        }
                        else if ( x === 1 ) {
                            imgurl2 = jQuery('a img', this).attr('src');  
                             
                            blogurl2 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl2 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl2 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox2); 
                            
                            
                         
                        }
                        else if ( x === 2 ) {
                            imgurl3 = jQuery('a img', this).attr('src');  
                             
                            blogurl3 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl3 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl3 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox3); 
                        }
                        else if ( x === 3 ) {
                            imgurl4 = jQuery('a img', this).attr('src');  
                             
                            blogurl4 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl4 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl4 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox4); 
                        } 
                  }); 
                }); 
        }
   }
   
   setTimeout(setblogimages, 1100)
}


jQuery('ul.page-numbers li a.next').text('»');
jQuery('ul.page-numbers li a.prev').text('«');


/* **************************MOUSE HOVER ON TEAM PLAYER************************** */
jQuery('.team-outer-div').mouseover(function(){
    jQuery('.team-outer-div:hover .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.team-outer-div:hover .team-inner-div').css('background-image', 'url(http://teleworkph.com/wp-content/uploads/2020/02/teambg2.png)');
    }).fadeTo('fast', 1);
});

/* **************************MOUSE HOVER ON TEAM PLAYER************************** */


/* **************************MOUSE LEAVE PER BOX/TEAM PLAYER************************** */
jQuery('.person-1').mouseleave(function(){
    jQuery('.person-1 .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.person-1 .team-inner-div').css('background-image', 'url()');
    }).fadeTo('slow', 1);
});
   
jQuery('.person-2').mouseleave(function(){
    jQuery('.person-2 .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.person-2 .team-inner-div').css('background-image', 'url()');
    }).fadeTo('slow', 1);
});

jQuery('.person-3').mouseleave(function(){
    jQuery('.person-3 .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.person-3 .team-inner-div').css('background-image', 'url()');
    }).fadeTo('slow', 1);
});

jQuery('.person-4').mouseleave(function(){
    jQuery('.person-4 .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.person-4 .team-inner-div').css('background-image', 'url()');
    }).fadeTo('slow', 1);
});

jQuery('.person-5').mouseleave(function(){
    jQuery('.person-5 .team-inner-div').fadeTo('fast', 0.3, function()
    {
        jQuery('.person-5 .team-inner-div').css('background-image', 'url()');
    }).fadeTo('slow', 1);
});
/* **************************MOUSE LEAVE PER BOX/TEAM PLAYER************************** */
   
var resizeTimer;
jQuery(window).resize(function(e) {
    clearTimeout(resizeTimer);
    resizeTimer = setTimeout(function() {
        if (jQuery(window).width() <= 921) {
           jQuery( ".ast-mobile-menu-buttons" ).addClass( "thetrigger" );
           //alert("aaaaa");
        }
    },250);
});






jQuery(window).on('resize', function(){
     
      var win = jQuery(this); //this = window
      if (win.width() >= 769) { 
      jQuery(document).ready(function(){

            // Select and loop the container element of the elements you want to equalise
            jQuery('.fl-post-feed').each(function(){  
              
                 
                  var sizebox1 = 0;
                  var sizebox2 = 0;
                  var sizebox3 = 0;
                  var sizebox4 = 0;
                  
                  var imgurl1 = '';
                  var imgurl2 = '';
                  var imgurl3 = '';
                  var imgurl4 = '';
                  
                  var blogurl1 = '';
                  var blogurl2 = '';
                  var blogurl3 = '';
                  var blogurl4 = '';
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-text', this).each(function(i, el){
                                            
                        if ( i === 0) {
                           sizebox1 = jQuery(this).height();
                        }
                        else if ( i === 1 ) {
                            sizebox2 = jQuery(this).height();
                        }
                        else if ( i === 2 ) {
                            sizebox3 = jQuery(this).height();
                        }
                        else if ( i === 3 ) {
                            sizebox4 = jQuery(this).height();
                        }
                                               
                  });  
                  
                  jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(x, el){
                        if ( x === 0) {
                            imgurl1 = jQuery('a img', this).attr('src');  
                              
                            blogurl1 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl1 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl1 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox1); 
                        }
                        else if ( x === 1 ) {
                            imgurl2 = jQuery('a img', this).attr('src');  
                              
                            blogurl2 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl2 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl2 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox2); 
                        }
                        else if ( x === 2 ) {
                            imgurl3 = jQuery('a img', this).attr('src');  
                              
                            blogurl3 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl3 +'"></a>');
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl3 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox3); 
                        }
                        else if ( x === 3 ) {
                            imgurl4 = jQuery('a img', this).attr('src');
                              
                            blogurl4 = jQuery('a', this).attr('href');
                            jQuery(this).wrap('<a href="'+ blogurl4 +'"></a>');
                            
                            
                            jQuery(this).css({'background-image' : 'url(' + imgurl4 + ')', 
                            'background-size' : 'cover', 
                            'background-position' : 'center center'});    
                            jQuery('a img', this).css('display', 'none');
                            jQuery(this).height(sizebox4); 
                        } 
                  }); 
                }); 
            });
      }
      else{
           jQuery(document).ready(function(){
                // Select and loop the container element of the elements you want to equalise
                jQuery('.fl-post-feed').each(function(){         
                      jQuery('.fl-post-feed-post .fl-post-feed-image', this).each(function(){   
                        jQuery('a img', this).css('display', 'block');
                        jQuery(this).css({'height' : '', 'background-image' : 'url()'});   
                      }); 
                }); 
            });
      }
});