window.addEvent('domready',function(){
	var nS = new noobSlide({
		box: $('div_img_superior_contenido'),
		items: $$('.fotogramas'),
		interval: 10000,
		autoPlay: true,
		fade: true,
		size: 781,
		handles: $$('#div_submenu_productos a'),
		onWalk: function(currentItem,currentHandle){
			$$(this.handles).removeClass('selected');
			$$(currentHandle).addClass('selected');

			pos=currentItem.id.lastIndexOf('_');
			pos++;
			indice_activo=currentItem.id.substr(pos);
			
			$$('.contenedo_carrusel').addClass('oculto');
			if ($('div_box_contenido_'+indice_activo)!=null) {
				$('div_box_contenido_'+indice_activo).removeClass('oculto');
			}
			contenido='div_box_contenido_'+indice_activo;
			inicializaGal();
		},
		fxOptions: {
			duration: 1000,
			wait: false
		}
//		fxOptions: {
//			duration: 1000,
//			transition: Fx.Transitions.Quad.easeIn /*Quad.easeOut*/,
//			wait: false
//		}
	});
	nS.walk(0,false,true);


//	inicializaGal();
	$('carrusel-izda').addEvents({
		'click': function(){
			//...
		},			
		'mouseover': function(){			
			MM_swapImage(this.id,'','img/carrusel-izda-over.jpg',1);
			controla_mov(mover, dcha);
		},
		'mouseout': function(){
			MM_swapImgRestore();
			controla_mov(parar, dcha);
		}
	});																														 
	$('carrusel-dcha').addEvents({
		'click': function(){
			//...
		},			
		'mouseover': function(){			
			MM_swapImage(this.id,'','img/carrusel-dcha-over.jpg',1);
			controla_mov(mover, izq);
		},
		'mouseout': function(){
			MM_swapImgRestore();
			controla_mov(parar, izq);
		}
	});																														 
	$$('.contenedo_carrusel').addClass('oculto');
	if ($('div_box_contenido_1')!=null) {
		$('div_box_contenido_1').removeClass('oculto');
	}
});




<!--
var mover=1;
var parar=0;
var izq=1;
var dcha=0;
var contenido='div_box_contenido_1';
var num_images;
var tamanio_img;
var velocidad=5;//milisegundos
var imgs_mostrar=12;//numero de imagenes que se muestran simultaneamente
var ancho_imgs=59//ancho fijo de las imágenes thumb
var movimiento;

function inicializaGal(){
	$(contenido).style.left='0px';			
	num_images=$$('div[id='+contenido+'] img').length;
	tamanio_img= $$('div[id='+contenido+'] img')[0].width+9;
	
	$(contenido).style.width=(ancho_imgs*num_images)+'px';	
}

function controla_mov(accion, dir){
	movimiento=dir;
	if (accion==mover){contenido
		mov=play();
	} else {
		pause(mov);
	}
}

function mueve_galeria(){
	var pos = $(contenido).style.left;			
	if (pos!=null) {
		if (movimiento==izq){
			valor=parseFloat(pos)-1;
			if (valor>-(tamanio_img*(num_images-imgs_mostrar))){
				$(contenido).style.left=valor+'px';
			} else {
				controla_mov(parar,1)
			}
		} else {
			valor=parseFloat(pos)+1;
			if (valor<0){
				$(contenido).style.left=valor+'px';
			} else {
				controla_mov(parar,1)
			}			
		}
	}			
}

function play(){
	tiempo = setInterval(mueve_galeria, velocidad);	
	return tiempo;
}

function pause(interval){
	clearInterval(interval);
}
