$.supportSvg = function()
{
    return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1");
};

$.svgReplaceImage = function()
{
	var img = new Image();
	img.src = $(this).data('altpng');
	$(this).replaceWith(img);
};

$.fn.svg = function()
{
	if($.supportSvg()) return;
	
	this.filter('[data-altpng]:not([data-altflash])').each($.svgReplaceImage);
	var i = 0;
	this.filter('[data-altflash]').each(function()
	{
		var obj = this;
		this.id = 'svg-alt-'+(++i);
		swfobject.embedSWF($(this).data('altflash'), this.id, $(this).width(), $(this).height(), '10.0.0', 'expressInstall.swf', false, {wmode: 'transparent'}, false,
			function(e){ if(!e.success) $.svgReplaceImage.apply(obj); });
	});
};