﻿$(document).ready(function () {
    // If browser does not have flash replace flash with images.
    if (!FlashDetect.installed) {
        $('object').each(function () {
            var url = $(this).attr('data');
            var img = new Image();
            img.src = url.replace('.swf', '.jpg').replace('_swf/', '_images/').toLowerCase();

            // If the flash had redirects, add a map if needed.
            if ($('#map_' + $(this).attr('id')).length > 0)
                $(img).attr('useMap', '#map_' + $(this).attr('id'));

            $(this).replaceWith(img);
        });
    }
});
