function getRefByTagName( tag, scope ) {
  scope = scope || document;

  if( scope.getElementsByTagName ) {
    return scope.getElementsByTagName( tag );
  } else if( scope.all && scope.all.tags ) {
    return scope.all.tags( tag );
  }
  return null;
}

function getRefById( id ) {
  if( document.getElementById ) {
    return document.getElementById( id );
  } else if( document.all ) {
    return document.all[ id ];
  }
  return null;
}
