function AnimalList(posY) {
	this.animals = [];
	this.activeAnimalIndex = -1;

	var animalCount = Animal.SPECIES_DATA.length;
	var lineWidth = GAME_SCREEN_SIZE.x - AnimalList.MARGIN_X * 2;
	// console.log("lineWidth : " + lineWidth);
	var offsetAnimal = lineWidth / (animalCount - 1);
	// console.log("animalCount : " + animalCount);
	// console.log("offsetAnimal : " + offsetAnimal);

	this.activeAnimalIndex = 0;

	var bg = game.add.graphics();
	bg.beginFill(AnimalList.COLOR_BG, 1);
	bg.drawRect(0, posY - 30, GAME_SCREEN_SIZE.x, 80);

	this.recordTextList = this.makeRecordTextList(posY);

	for(var i = 0; i < animalCount; i++) {
		this.animals[i] = new Animal(
			Animal.TYPE_ICON,
			i,
			AnimalList.MARGIN_X + offsetAnimal * i,
			posY
		);
		this.inactivate(i);
	}

	this.activate(this.activeAnimalIndex);
	this.tweenAnimation(Animal.ANIMATION_TYPE_DAMAGE);
}

AnimalList.prototype.activate = function(index) {
	this.inactivate(this.activeAnimalIndex);

	this.activeAnimalIndex = index;

	this.animals[this.activeAnimalIndex].setScale(2);
	this.animals[index].setAlpha(1);
	this.animate(this.activeAnimalIndex);

	this.recordTextList[index].addColor(AnimalList.COLOR_SCORE_CLEARED_TEXT, 0);
}

AnimalList.prototype.inactivate = function(index) {
	this.animals[index].stopAnimation();
	this.animals[index].setScale(1);
	this.animals[index].setAlpha(AnimalList.ALPHA_INACTIVE);

	this.recordTextList[index].addColor(AnimalList.COLOR_SCORE_DEFAULT_TEXT, 0);
}


AnimalList.prototype.makeRecordTextList = function(posY) {
	var animalCount = Animal.SPECIES_DATA.length;
	var lineWidth = GAME_SCREEN_SIZE.x - AnimalList.MARGIN_X * 2;
	// console.log("lineWidth : " + lineWidth);
	var offsetAnimal = lineWidth / (animalCount - 1);

	var titleTextStyle = { font: "16px Arial", fill: "#fff", align: "center"};
	var typingCount = 0;
	var animalData = null;
	var recordTextList = new Array();
	for(var i = 0; i < animalCount; i++) {
		animalData = Animal.SPECIES_DATA[i];
		if(isTypingPracticeApp())
			typingCount = RecordUtil.getRecordValueWithUnit(animalData.practiceTypingCount, 1);
		else
			typingCount = RecordUtil.getRecordValueWithUnit(animalData.testTypingCount, 1);

		var recordText = game.add.text(
			AnimalList.MARGIN_X + offsetAnimal * i,
			posY + AnimalList.RECORD_TEXT_OFFSET_Y,
			typingCount, titleTextStyle
		);
		recordText.anchor.set(0.5);
		recordText.addColor(AnimalList.COLOR_SCORE_DEFAULT_TEXT, 0);
		recordText.stroke = "#333";
		recordText.strokeThickness = 3;
		recordText.setShadow(1, 1, 'rgba(0, 0, 0, 0.5)', 2);
		recordTextList.push(recordText);
	}

	return recordTextList;
}



AnimalList.prototype.animate = function(index) {
	var animalData = Animal.SPECIES_DATA[index];
	this.animals[index].startAnimation(animalData);
}

AnimalList.prototype.stopAnimation = function() {
	this.animals[this.activeAnimalIndex].stopAnimation();
}

AnimalList.prototype.tweenAnimation = function(animationType) {
	this.animals[this.activeAnimalIndex].tweenAnimation(animationType);
}


AnimalList.MARGIN_X			= 100;
AnimalList.ALPHA_INACTIVE	= 0.1;

// AnimalList.ANIMAL_LIST_POS_Y		= 90;
AnimalList.RECORD_TEXT_OFFSET_Y		= 36;

AnimalList.ALPHA_INACTIVE			= 0.3;

AnimalList.TYPE_PRACTICE		= 0;
AnimalList.TYPE_TEST			= 1;

AnimalList.COLOR_BG					= 0x545454;	// "0x77aadd"; //0x99ccff;
AnimalList.COLOR_SCORE_DEFAULT_TEXT	= "#999999";	// "#dddddd";	//"#bbddff";
AnimalList.COLOR_SCORE_CLEARED_TEXT	= "#ffffff";
