	/**
	 * This function generate the list of elements to aply the clipboard
	 * @return the array list of objects identificators
	 */
	function getListOfObjectsToCopier(){
		var quantity = $$('[class$=picCard]').length;
		if (quantity > 0){
			var list = new Array(quantity);
			for (var i=0; i< quantity; i++){
				list[i] = new Array(3);
				list[i][0] = new Array('imgLink_' + i, 'labelCopierLink_' + i);
				list[i][1] = new Array('htmlCode_' + i, 'labelCopierHTML_' + i);
				list[i][2] = new Array('imgCode_' + i, 'labelCopierIMG_' + i);
			}
		}else{
			var list = new Array(1);
			list[0] = new Array(3);
			list[0][0] = new Array('imgLink', 'labelCopierLink');
			list[0][1] = new Array('htmlCode', 'labelCopierHTML');
			list[0][2] = new Array('imgCode', 'labelCopierIMG');
		}
		return list;
	}
	
	/**
	 * This function construct the copier of elements
	 */
	function constructCopiers(){
		arrayObjects = getListOfObjectsToCopier();
		arrayObjects.each(function(object){
			object.each(function(identificators){
				idLinkBox = identificators[0];
				idLinkLabel = identificators[1];
				if ($type(Clipboard) == "object") {
					window.Clipboard.setMessage('copiado');
					
					var linkBox = $(idLinkBox);
					var linkLabel = idLinkLabel;
						
					if ($type(linkBox) == 'element') {
						linkBox.addEvent('click' , function () {
							this.select();
							window.Clipboard.copyFromElement(linkBox.id, linkLabel);
						});
					}
				}
			});
		});
	}
	
	window.addEvent('domready', function(){	
		constructCopiers();
	});