function AddToDocument()
  {
    if(typeof(parent) == "string")
      parent = document.getElementById(parent);