$(window).on('load', function() {
    $(".preLoader").fadeOut("slow");
});

$(document).ready(function() {
	var urls = ['contents/images/headerBg1-min-min.webp', 'contents/images/headerBg2-min-min.webp'];
	var count = 1;

	// $('.header').css('background', 'url("' + urls[0] + '")');
	$('.header').css({
		background: 'url("' + urls[0] + '")',
		backgroundRepeat: 'no-repeat',
		backgroundSize: 'cover',
		backgroundPosition: 'center'
	});

	setInterval(function(){
		$('.header').css({
			background: 'url("' + urls[count] + '")',
			backgroundRepeat: 'no-repeat',
			backgroundSize: 'cover',
			backgroundPosition: 'center'
		});
		if (count == urls.length-1) {
			count = 0;
		}
		else{
			count++;
		}
	}, 6000);

    var scrollUp = document.getElementById("scrollUp");
    window.onscroll = function() {scrollFunction()};

    function scrollFunction() {
        if (document.body.scrollTop > 600 || document.documentElement.scrollTop > 600) {
          scrollUp.style.display = "block";
          scrollUp.style.animation = "fadeIn ease 1s";
        } else {
          scrollUp.style.display = "none";
        }
    }

    $('.hoverOpacity').hover(function() {
        $(this).find('.serviceImages').css('opacity', '.5');
    }, function() {
        $(this).find('.serviceImages').css('opacity', '1');
    });


    $('.airportImages').hover(function() {
        $(this).addClass('airportImagesAnimation');
    }, function() {
        $(this).removeClass('airportImagesAnimation');
    });


    $('.fleetCards').hover(function() {
        $(this).css({
            backgroundColor: '#232323',
            transform: 'translateY(-4px)'
        });
        $(this).find('.fleetCardsTitle').css('color', '#ffc326');
        $(this).find('.fleetList').css('color', '#ffffff');
        $(this).find('.fleetIcons').css('color', '#ffc326');
    }, function() {
        $(this).css({
            backgroundColor: 'rgba(35,35,35, .7)',
            transform: 'translateY(0px)'
        });
        $(this).find('.fleetCardsTitle').css('color', '#ffffff');
        $(this).find('.fleetList').css('color', '#ffc326');
        $(this).find('.fleetIcons').css('color', '#ffffff');
    });

    $('.stationImages').hover(function() {
        $(this).addClass('stationImagesAnim');
    }, function() {
        $(this).removeClass('stationImagesAnim');
    });

    $('#readMore').click(function() {
        $('#readMoreContent').slideToggle('fast');
        $(this).hide();
        $('#readLess').show();
    });

    $('#readLess').click(function() {
        $('#readMoreContent').slideToggle('fast');
        $(this).hide();
        $('#readMore').show();
    });

});