オブジェクトを管理しやすいようにする

var Maneger = function ( ) {
  var list = [ ];

  this.has = function ( e ) {
    for( var cnt = 0, obj; obj = list[ cnt++ ]; )
      if( obj.element == e ) return true;
    return false;
  };
  
  this.del = function ( e ) {
    for( var cnt = 0, obj; obj = list[ cnt ]; cnt++ )
      if( obj.element == e ) return list.splice( cnt, 1 );
    return false;
  };
  
  this.add = function ( e, s ) {
    if( ! this.has( e ) )
      return list.push( { 'element': e, 'status': s } );
    return false;
  };
  
  this.get = function ( e )
    for( var cnt = 0, obj; obj = list[ cnt++ ]; )
      if( obj.element == e ) return obj.status;
    return undefined;
  };
  
  this.put = function ( e, s ) {
    for( var cnt = 0, obj; obj = list[ cnt++ ]; )
      if( obj.element == e ) return obj.status = s;
    return undefined;
  };
);