jQuery(document).ready(function($) {
	"use strict";

	$('.dollah-abouttheme-top').on('click',function(e){
		var $target = $( $(this).attr('href') );
		if ( $target.length ) {
			e.preventDefault();
			var destin = $target.offset().top - 50;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destin}, 500 );
		}
	});

	$('.dollah-abouttabs .nav-tab, .dollah-about-sub .linkto-tab, .dollah-abouttabs .linkto-tab').on('click',function(e){
		e.preventDefault();
		var targetid = $(this).data('tabid'),
			$navtabs = $('.dollah-abouttabs .nav-tab'),
			$tabs = $('.dollah-abouttabs .dollah-tab'),
			$target = $('#dollah-'+targetid);
		if ( $target.length ) {
			$navtabs.removeClass('nav-tab-active');
			$navtabs.filter('[data-tabid="'+targetid+'"]').addClass('nav-tab-active');
			$tabs.removeClass('dollah-tab-active');
			$target.addClass('dollah-tab-active');
			// Update the URL with the new tab parameter
			var newUrl = new URL(window.location.href);
			newUrl.searchParams.set('tab', targetid);
			history.replaceState(null, null, newUrl.toString());
		}
	});

});