jQuery(document).ready(function($){
	
	// Open external links in new tab
	/*$('a[href^=http]').click(function () {
	  var a = new RegExp('/' + window.location.host + '/');
	  if (!a.test(this.href)) {
		window.open(this.href);
		return false;
	  }
	});*/

	// RankMath FAQ accordion
    let faqWrap = jQuery('.single-content #rank-math-faq .rank-math-list');

	if (faqWrap.length > 0) {
		faqWrap.find('.rank-math-list-item').each(function (i, el) {
			let faq = jQuery(this);
			let faqTitle = faq.find('.rank-math-question');
			let faqContent = faq.find('.rank-math-answer');
			if (i === 0) {
				faqContent.slideDown();
				faqTitle.addClass('active');
			} else {
				faqContent.slideUp();
				faqTitle.removeClass('active');
			}
			faq.click(function () {
				faqContent.slideDown(200);
				faqTitle.addClass('active');
				jQuery(this).siblings('.rank-math-list-item').find('.rank-math-answer').slideUp(200);
				jQuery(this).siblings('.rank-math-list-item').find('.rank-math-question').removeClass('active');
			});
		});
	}
    // End of RankMath FAQ accordion

    // Ol li more than 15
	let singleOl = jQuery('.single-content-left-col ol');
	if (singleOl.length > 0) {
	  singleOl.each(function (i, el) {
		let maxOl = jQuery(this);
		if (maxOl.children('li').length > 15) {
		  maxOl.css('column-count', '2');
		}
	  })
	}
	// End Ol li more than 15
    
    // Wrap the iframe with a center tag
	jQuery('.single-content-left-col iframe').each(function(){
		if (jQuery(this).parent('p')) {
			jQuery(this).wrap('<center></center>');
		}
	});
	// End Wrap the iframe with a center tag
	
});

// Google maps custom
// function setMapInBlock(idBlock,LatLngS,LatLngD,zoom,companyName){
//     let map;

//     function initMap() {
//         map = new google.maps.Map( document.getElementById( idBlock ), {
//             center: new google.maps.LatLng( LatLngS, LatLngD ),
//             zoom: zoom,
//             styles: [ {
//                 stylers: [ {
//                     // saturation: -100
//                 } ]
//             } ]
//         } );

//         let marker = new google.maps.Marker( {
//             position: new google.maps.LatLng( LatLngS, LatLngD ),
//             map: map,
//             title: companyName,
//         } );
//     }

//     initMap();
// }
// End Google maps custom