(function($){
$.fn.afi = function(o){
var settings = $.extend({
imagePath : "//a.nd-cdn.us/tirepros/IndyFund_180x150.jpg", //Path to the image file
afi_link : "", //Link to the unique campaign
position_type : "fixed", //Positioning type
position_x : "right", //X Position
position_y : "bottom", //Y Position
x_buffer : "10px", //Space from x position
y_buffer : "10px" //Space from y position
}, o);
//Configure Button
$(window).load(function() {
if(window.matchMedia("(min-width: 640px)").matches){
$('body').prepend('');
} else {
if(window.location.href.indexOf("/mobile") > -1){
$('html').prepend('');
$('html').css('margin-top', '40px');
} else if(window.matchMedia("(max-width: 640px) and (min-width: 481px)").matches){
$('body').prepend('');
$('#dnn_SocialPane').css('display','none');
} else if(window.matchMedia("(max-width: 480px)").matches){
$('body').prepend('');
$('#dnn_SocialPane').css('display','none');
}
}
});
$(window).load(function(e) {
$('img[src*="allies-for-independence-slider.jpg"]').each(function(index, element) {
$(this).parents('a').attr('href', settings.afi_link);
$(this).parents('a').attr('target', '_blank');
});
});
};
})(jQuery);