var ChoixShort = Class.create();

ChoixShort.prototype = {
	
	initialize: function() {	
		
		this.updateChoixShortList();
	},

	updateChoixShortList: function() {	
		if (!document.getElementsByTagName){ return; }
		
		var inputs = document.getElementsByTagName('a');
		for (var i=0; i<inputs.length; i++){
			var input = inputs[i];
			
			if (input.getAttribute('rel') && (input.getAttribute('rel').toLowerCase().match('short_'))){
				input.onclick = function (){myChoixShort.start(this); return false;}
			}
		}
	},
	
	refreshList: function() {	
		if (!document.getElementsByTagName){ return; }
		
		var inputs = document.getElementsByTagName('a');
		for (var i=0; i<inputs.length; i++){
			var input = inputs[i];
			
			if (input.getAttribute('rel') && (input.getAttribute('rel').toLowerCase().match('short_'))){
				input.innerHTML = '<img src="css/default/'+ input.getAttribute('rel') +'.jpg" alt="'+ input.getAttribute('title') +'" border="0" />';
				input.onclick = function (){myChoixShort.start(this); return false;}
			}
		}
	},
	
	start: function(obj) {
		myChoixShort.refreshList();
		obj.innerHTML = '<img src="css/default/'+ obj.getAttribute('rel') +'_on.jpg" alt="'+ obj.getAttribute('title') +'" border="0" />';
		document.getElementById('childs').innerHTML = document.getElementById(obj.getAttribute('rel')).innerHTML;
	},
	
	end: function() {
		
	}
}

function initChoixShort() { myChoixShort = new ChoixShort(); }
