var choiceContact = new Class({
	
	initialize: function(params) {
		
		this.contactList = $$('.choice_contact');
		this.elLi = this.contactList.getChildren('li');
		this.setup();

	},
	
	setup: function() {

		for (j=0;j<this.elLi[0].length;j++) {
			this.elLi[0][j].index = j;
			this.elLi[0][j].showIndex = function(index) {
				this.showIndex(index);
			}.bind(this);
			
			this.elLi[0][j].addEvent("click", function(event) { // add event onclick to each menu element with translate self index
				this.showIndex(this.index);
				input = this.getChildren('input');
				$('contact_id').value = input[0].value;
				$('contact_email').value = input[1].value;
			});
		}	

	},

	showIndex: function(index) {
		this.elLi[0].removeClass('active');
		this.elLi[0][index].addClass('active');
	}
});