﻿jQuery.fn.extend({
    ihReplace: function(bgColor, color, size, refreshCache, font) {
        jQuery.each(this, function() {
            var text = jQuery(this).html();
            var image = new Image();
            image.src = "/i.axd?bgcolor=" + bgColor + "&color=" + color + "&size=" + size + "&refreshCache=" + refreshCache + "&font=" + font + "&text=" + text.toUpperCase();
            image.alt = text;
            image.title = text;
            return jQuery(this).html(image);
        });
    }
});

jQuery(document).ready(function() {

    jQuery("h1").ihReplace('000000', 'ffffff', 42, true, 'GROTR___');
    jQuery("h2").ihReplace('000000', 'ffffff', 36, true, 'GROTR___');
    jQuery("h3").ihReplace('000000', 'ffffff', 24, true, 'GROTR___');

    //jQuery(".caption").ihReplace('000000', 'ffffff', 24, true, 'GROTR___');
    

});
