

window.addEvent('domready', function() {
		var status = {
		'true': 'open',
		'false': 'close'
	};
	

	
	//THIRD EXAMPLE
	
	
	//var anotherE3 = $('modul_book_dia');
	
	var anotherE1 = new Array();
	var anotherE2 = new Array();
	var anotherE3 = new Array();
	var anotherE4 = new Array();
	var anotherE5 = new Array();

	// Or we just use Element.morph

	for($i=1;$i<=$n_proyectos;$i++){

		anotherE1[$i] = new Fx.Slide('descripcio_'+$i);
		anotherE2[$i] = $('imatge_'+$i);
		anotherE3[$i] = $('info_desplegat_'+$i);
		anotherE4[$i] = $('CSSmorphEffect_'+$i);
		anotherE5[$i] = $('modul_book'+$colors_estil+'_'+$i);
		
		if($i>1){
			anotherE1[$i].hide();
			/*anotherE2[$i].setStyle('height','158px');
			anotherE3[$i].setStyle('height','60px');
			anotherE4[$i].setStyle('margin','0 10px 0 auto');
			anotherE5[$i].setStyle('background-position','left -343px');
			document.getElementById('CSSmorphEffect_'+$i).src = 'img/img_mes_info'+$colors_estil+'.gif';*/
		}
			
		//background-position:left -340px;
	if($i<=9){
	$('CSSmorphEffect_'+$i).addEvent('click', function(e){

			var $numero = e.target.id.charAt(e.target.id.length-1);

			e.stop();
			anotherE1[$numero].toggle();
			
			
			if(status[anotherE1[$numero].open]=='open'){
				anotherE2[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE3[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE4[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});

				anotherE2[$numero].morph('.plegat .imatge_partida'+$colors_estil);
				anotherE3[$numero].morph('.info_peu_projecte_plegat');
				anotherE4[$numero].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_plegada');
				anotherE5[$numero].setStyle('background-position','left -343px');
				e.target.src = 'img/img_mes_info'+$colors_estil+'.gif';
				
				
			} else {
				anotherE2[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE3[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE4[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				
				anotherE2[$numero].morph('.desplegat .imatge_senzera'+$colors_estil);
				anotherE3[$numero].morph('.desplegat .info_peu_projecte'+$colors_estil);
				anotherE4[$numero].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_desplegada');
				anotherE5[$numero].setStyle('background-position','left -23px');
				e.target.src = 'img/img_menys_info'+$colors_estil+'.gif';
			}
			
			for($i=1;$i<=$n_proyectos;$i++){
				if(status[anotherE1[$i].open]=='open'){
					anotherE1[$i].toggle();
					anotherE2[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE3[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE4[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE2[$i].morph('.plegat .imatge_partida');
					anotherE3[$i].morph('.info_peu_projecte_plegat');
					anotherE4[$i].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_plegada');
					anotherE5[$i].setStyle('background-position','left -343px');
					document.getElementById('CSSmorphEffect_'+$i).src = 'img/img_mes_info'+$colors_estil+'.gif';
					//alert(document.getElementById('CSSmorphEffect_'+$i));
				}
			}
			
		});
	} else {
		
		$('CSSmorphEffect_'+$i).addEvent('click', function(e){
		  	
			var $numero = e.target.id.charAt(e.target.id.length-2)+e.target.id.charAt(e.target.id.length-1);
			e.stop();
			anotherE1[$numero].toggle();

			
			
			if(status[anotherE1[$numero].open]=='open'){
				anotherE2[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE3[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE4[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});

				anotherE2[$numero].morph('.plegat .imatge_partida'+$colors_estil);
				anotherE3[$numero].morph('.info_peu_projecte_plegat');
				anotherE4[$numero].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_plegada');
				anotherE5[$numero].setStyle('background-position','left -343px');
				e.target.src = 'img/img_mes_info'+$colors_estil+'.gif';
				
				
			} else {
				anotherE2[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE3[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				anotherE4[$numero].set('morph', {duration: '840ms', transition: 'elastic:out'});
				
				anotherE2[$numero].morph('.desplegat .imatge_senzera'+$colors_estil);
				anotherE3[$numero].morph('.desplegat .info_peu_projecte'+$colors_estil);
				anotherE4[$numero].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_desplegada');
				anotherE5[$numero].setStyle('background-position','left -23px');
				e.target.src = 'img/img_menys_info'+$colors_estil+'.gif';
			}
			
			for($i=1;$i<=$n_proyectos;$i++){
				if(status[anotherE1[$i].open]=='open'){
					anotherE1[$i].toggle();
					anotherE2[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE3[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE4[$i].set('morph', {duration: '840ms', transition: 'elastic:out'});
					anotherE2[$i].morph('.plegat .imatge_partida');
					anotherE3[$i].morph('.info_peu_projecte_plegat');
					anotherE4[$i].morph('.info_peu_projecte'+$colors_estil+' .mas_info .img_plegada');
					anotherE5[$i].setStyle('background-position','left -343px');
					document.getElementById('CSSmorphEffect_'+$i).src = 'img/img_mes_info'+$colors_estil+'.gif';
					//alert(document.getElementById('CSSmorphEffect_'+$i));
				}
			}
			
		});	
	}
	
	
	}
	if(poner_scroller==true){
		posa_scroll();
	} 
	
});