Element.addMethods({
  isOrphaned: function(element){
    var orphaned = false;
    if (element.id) orphaned = element.ownerDocument.getElementById(element.id) ? false : true;
    else orphaned = element.up('body') ? false : true;
    return orphaned;
  }
});