/**
 * Classe matiereautre
 */
var Matiereautre = new Class({
	initialize: function(id, lib) {
		this.id = id;
		this.lib = lib;

	},
	getOptionLabel: function() {
		return this.lib;
	}
});
/**
 * Classe matiere
 */
var Matiere = new Class({
	initialize: function(id, lib) {
		this.id = id;
		this.lib = lib;
		this.cycles = new Array();
	},
	getOptionLabel: function() {
		var rep = this.lib + ' / Cycle(s) : ';
		var j = this.cycles.length;
		for (var i = 0; i < j; i++) {
			if (this.cycles[i].etat == 'O') rep += '- ' + this.cycles[i].lib;
		}
		return rep;
	}
});
/**
 * Classe Cycle
 */
var Cycle = new Class({
	initialize: function(id, lib) {
		this.id = id;
		this.lib = lib;
		this.etat = 'N';
	},
	setSelected: function() {
		this.etat = 'O';
	}
});


/**
 * Classe instrument
 */
var Instrument = new Class({
	initialize: function(id, lib) {
		this.id = id;
		this.lib = lib;
		this.niveaux = new Array();
	},
	getOptionLabel: function() {
		var rep = this.lib + ' / Niveau : ';
		this.niveaux.each(function(item) {
			if (item.etat == 'O') rep += '- ' + item.lib;
		});
		return rep;
	}
});
/**
 * Classe Niveau
 */
var Niveau = new Class({
	initialize: function(id, lib) {
		this.id = id;
		this.lib = lib;
		this.etat = 'N';
	},
	setSelected: function() {
		this.etat = 'O';
	}
}); 


/**
 * Classe Diplome
 */
var Diplome = new Class({
	initialize: function(id, lib, annee) {
		this.id = id;
		this.lib = lib;
		this.annee = annee;
		this.specialite = '';
		this.acquis = 'N';
	},
	getOptionLabel: function(isAcquis) {
		var rep = this.lib;
		if (this.specialite != '') {
			rep += ' - ' + this.specialite;
		}

		rep += ' - ' + this.annee ;
		if(!isAcquis){
			rep += ' - ' ;
			if (this.acquis == 'N') {
				rep += 'Non ';
			}
			rep += 'Acquis';
		}
		return rep;
	},
	setAcquis: function(bool) {
		if (bool) {
			this.acquis = 'O';
		}
	}
});

/**
 * classe Expériences pédagogiques
 */
var Experience = new Class({
	initialize: function(id, lib, date_deb, date_fin) {
		this.id = id;
		this.lib = lib;
		this.date_deb = date_deb;
		this.date_fin = date_fin;
	},
	getOptionLabel: function() {
		return 'Du ' + this.date_deb + ' Au ' + this.date_fin + ' ' + this.lib;
	}
});
