if (FlashInGrid == undefined) var FlashInGrid = {}; var beaconID = "flash-in-grid-beacon"; var reqVersion = 9; //FlashInGrid.FLASH_SOURCE = "full path to swf on media server"; (function() { function getHeight(imgHeight, width) { if (FlashInGrid.aspect_ratio) { return Math.round(width / FlashInGrid.aspect_ratio) + 16; } return Math.round(width / 1.33333) + 16; } function init() { if (!jQuery.fn.flash.hasFlash(reqVersion)) { return; } var slot = $('#' + beaconID).parent().children('div.force-inline').children('.img:first'); if ($(slot).length < 1) slot = $('#' + beaconID).parent().children('div.story').children('.img:first'); if ($(slot).length < 1) { return; } var w = $(slot).find('img:first').attr("clientWidth"); var imgH = $(slot).find('img:first').attr("clientHeight"); var h = getHeight(imgH, w); $(slot).empty().flash({ src: FlashInGrid.FLASH_SOURCE, width: w, height: h, allowscriptaccess: 'always', flashvars: { w: w, h: h }, wmode: 'transparent' }, { version: reqVersion, update: false }); $(slot).find('.alt').remove(); } FlashInGrid.load = init; })(); $(function() { FlashInGrid.load(); });