var RelationComponent = {} RelationComponent.children = []; RelationComponent.add = function(object) { object.relationStatus = 'single'; //'conversation', 'married' object.relationTarget = null; object.relationInvite = null; // modified by agent who asked object.relationQuestion = null; // modified by agent who asked object.relationAnswer = null; // modified by agent who answer object.relationMyTurn = false; object.relationBad = 0; object.relationGood = 0; object.relationTocos = 0; RelationComponent.children.push(object); } RelationComponent.remove = function(object) { var index = RelationComponent.children.indexOf(object); if (index > -1) { RelationComponent.children.splice(index, 1); } }