function createFlashMarkup(width,height,uri,replaceid){ var obj = document.createElement('object'); obj.setAttribute('type','application/x-shockwave-flash'); obj.setAttribute('width',width); obj.setAttribute('height',height); obj.setAttribute('data',uri); var p_m = document.createElement('param'); p_m.setAttribute('name','movie'); p_m.setAttribute('value',uri); obj.appendChild(p_m); var div = document.getElementById(replaceid); document.getElementsByTagName('body')[0].replaceChild(obj,div); } window.onload = function(){ createFlashMarkup('550','400','vuurwerk.swf','replaced-by-flash'); }