(function($){$(document).ready(function(){var _loadAmazonAutoLinksAjax=function(){jQuery('.amazon-auto-links.aal-js-loading').each(function(index,value){var _aData={action:aalAjaxUnitLoading.actionHookSuffix,aalAjaxUnitLoading_security:aalAjaxUnitLoading.nonce,aal_nonce:aalAjaxUnitLoading.nonce,data:$(this).data(),post_id:aalAjaxUnitLoading.post_id,page_type:aalAjaxUnitLoading.page_type,author_name:aalAjaxUnitLoading.author_name,term_id:aalAjaxUnitLoading.term_id,REQUEST:aalAjaxUnitLoading.REQUEST,referrer:window.location.href,};var _oThis=this;var _oSpinner=$('<img src="'+aalAjaxUnitLoading.spinnerURL+'" />');_oSpinner.css({margin:'0 0.5em','vertical-align':'middle','display':'inline-block'});$(this).find('.now-loading-placeholder').append(_oSpinner);$.ajax({type:'post',dataType:'json',async:!0,url:aalAjaxUnitLoading.ajaxURL,data:_aData,success:function(response){if(response.success){var _oReplacement=$(response.result);$(_oThis).replaceWith(_oReplacement);_oReplacement.trigger('aal_ajax_loaded_unit',[])}else{$(_oThis).replaceWith('<p>'+response.result+'<p>')}},error:function(xhr){$(_oThis).replaceWith('<p>'+aalAjaxUnitLoading.messages.ajax_error+'<p>')},complete:function(){_oSpinner.remove()}})})};setTimeout(_loadAmazonAutoLinksAjax,parseInt(aalAjaxUnitLoading.delay))})}(jQuery));