function Coords() {
  this.c = new Array();
}
Coords.prototype.push_c = function(c) {
    this.c.pushUnique(c);
}
Coords.prototype.remove_by_coord_id = function(id) {
  for (var i = 0;i<this.c.length;i++) {
    if(this.c[i].id == id) this.c.splice(i,1);
  }
}
Coords.prototype.get_by_coord_id = function(id) {
  for (var i = 0;i<this.c.length;i++) {
    if(this.c[i].id == id) return this.c[i];
  }
}
Coords.prototype.push_coord_values = function(id,x,y) {
  this.c.push(new Coord(id,x,y));
}
Coords.prototype.get_value_by_key = function(k) {
  var r = new Array();
  for (var i = 0;i<this.c.length;i++) {
    r.push(this.c[i][k]);
  }
  return r;
}

Coords.prototype.to_hashable_string = function() {
  var s = "";
  for (var i =0;i<this.c.length;i++) {
    a = this.c[i].to_array();
    for (var k in a) {
      s+=i+"["+k+"]="+a[k]+"&";
    }
  }
  return s.substring(0,s.length-1);
}

function Coord(id,x,y) {
  this.id = id;
  this.x = x;
  this.y = y;
}

Coord.prototype.to_array = function() {
  o = {id: this.id, x: this.x, y: this.y};
  return o;
}
