function chessboard(color) {
	color = color == 'b' ? color : 'w';
	this.parent = board;
	this.parent('libs/img/chessboard_' + color + '.png');
	this.pieces = new Array(
	    {
		    color: 'w',
		    type: 'q',
		    start_position: {
			    x: 4,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'k',
		    start_position: {
			    x: 3,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'b',
		    start_position: {
			    x: 2,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'b',
		    start_position: {
			    x: 5,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'n',
		    start_position: {
			    x: 1,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'n',
		    start_position: {
			    x: 6,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'r',
		    start_position: {
			    x: 0,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'r',
		    start_position: {
			    x: 7,
			    y: 0
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 0,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 1,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 2,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 3,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 4,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 5,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 6,
			    y: 1
		    }
	    },
	    {
		    color: 'w',
		    type: 'p',
		    start_position: {
			    x: 7,
			    y: 1
		    }
	    },
	    {
		    color: 'b',
		    type: 'q',
		    start_position: {
			    x: 4,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'k',
		    start_position: {
			    x: 3,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'b',
		    start_position: {
			    x: 2,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'b',
		    start_position: {
			    x: 5,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'n',
		    start_position: {
			    x: 1,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'n',
		    start_position: {
			    x: 6,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'r',
		    start_position: {
			    x: 0,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'r',
		    start_position: {
			    x: 7,
			    y: 7
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 0,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 1,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 2,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 3,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 4,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 5,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 6,
			    y: 6
		    }
	    },
	    {
		    color: 'b',
		    type: 'p',
		    start_position: {
			    x: 7,
			    y: 6
		    }
	    }
	);
	for (var i=0; i<this.pieces.length; ++i) {
		this.pieces[i].sprite = new sprite(
			'libs/img/' + 
			this.pieces[i].type +
			this.pieces[i].color +
			'.png'
		);
		this.pieces[i].sprite.type = this.pieces[i].type;
		this.pieces[i].sprite.color = this.pieces[i].color;
		this.add_sprite(this.pieces[i].sprite);
		this.pieces[i].sprite.set_pos_field(
			this.pieces[i].start_position.x,
			this.pieces[i].start_position.y
		);
	}
}


