
flashactive();

function flashactive() {
  var objects = document.getElementsByTagName("object");
  for (var i = 0; i < objects.length; i++)
  {
    var node = objects[i];
    var parentNode = node.parentNode;
    parentNode.replaceChild(copyTree(node), node);
  }
}

function copyTree(node){
  var createdNode;
  switch (node.nodeType){
  //Element 1
  case 1:
    createdNode = document.createElement(node.nodeName);
    // copy childs
    var child;
    var copiedChild;
    if(child = node.firstChild) {
      do {
        if (copiedChild = copyTree(child)) createdNode.appendChild(copiedChild);
      } while (child = child.nextSibling)
    }
    // copy attributes
    var nodeAttributes = node.attributes;
    var i;
    for (i = 0; i < nodeAttributes.length; i++)
      createdNode.setAttribute(nodeAttributes[i].nodeName, nodeAttributes[i].nodeValue);
    break;
  //Attribute 2
  //Text 3
  case 3:
    createdNode = document.createTextNode(node.nodeValue);
    break;
  //Comment 8
  //Document 9
  }
  return createdNode;
}
