  function appendEmbed(parentobj,embedobj,type,src,width,height,bgcolor) {
  var attNames = new Array("type","src","width","height","bgcolor");
  var attVals = new Array(type,src,width,height,bgcolor);
  var i = 0;
     do {
        embedobj.setAttribute(attNames[i],attVals[i]);  
        i++;
     }
     while (i < attVals.length);

       parentobj.appendChild(embedobj);
  }
