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