I want to use SVG (scalable vector Graphics) on my site but the plugin is not widely available (yet) first is it possible to detect the presence of the plug in and the feed the right file extention to link, sort of

if plugin svg is present extension = svg
if not extension = gif


<img src="pic.{extension}">

javascript newbie so be gentle