function carrusel_anterior(){
	if(cuenta_carrusel>=1){
		cuenta_carrusel--;
		foto = fotos[cuenta_carrusel];
		texto = textos[cuenta_carrusel];
		
		img = new Image();
		img.src = ruta_imagenes + foto;
		
		orig = document.getElementById('fotocarrusel');
		orig.src = img.src;
		/*
		pieorig = document.getElementById('pieCarrusel');
		pieorig.firstChild.nodeValue = texto;
		*/
		enlace = document.getElementById('enlace_carrusel');
		enlace.href = ruta_imagenes + 'z_' + foto;
		enlace.rel ='gb_imageset[carrusel]';
		enlace.title = texto;
		
		j = 1;
		for (x = 0; x < total_carrusel; x++) { 
			if(x != cuenta_carrusel){
				foto = fotos[x];
				
				img = new Image();
				img.src = ruta_imagenes + foto;
				
				orig = document.getElementById('miniz'+j);
				orig.src = img.src;
				
				enlace = document.getElementById('emini'+j);
				enlace.href = ruta_imagenes + 'z_' + foto;
				enlace.rel ='gb_imageset[carrusel]';
				j++;
			}
		}
	}
}

function carrusel_siguiente(){
	if(cuenta_carrusel<(total_carrusel-1)){
		cuenta_carrusel++;
		foto = fotos[cuenta_carrusel];
		texto = textos[cuenta_carrusel];
		
		img = new Image();
		img.src = ruta_imagenes + foto;
		
		orig = document.getElementById('fotocarrusel');
		orig.src = img.src;
		/*
		pieorig = document.getElementById('pieCarrusel');
		pieorig.firstChild.nodeValue = texto;
		*/
		enlace = document.getElementById('enlace_carrusel');
		enlace.href = ruta_imagenes + 'z_' + foto;
		enlace.rel ='gb_imageset[carrusel]';
		enlace.title = texto;
		
		j = 1;
		for (x = 0; x < total_carrusel; x++) { 
			if(x != cuenta_carrusel){
				foto = fotos[x];
				
				img = new Image();
				img.src = ruta_imagenes + foto;
				
				orig = document.getElementById('miniz'+j);
				orig.src = img.src;
				
				enlace = document.getElementById('emini'+j);
				enlace.href = ruta_imagenes + 'z_' + foto;
				enlace.rel ='gb_imageset[carrusel]';
				j++;
			}
		}
	}
}

function carrusel_foto(foto,texto,num_carrusel){
	cuenta_carrusel = num_carrusel;
	img = new Image();
	img.src = ruta_imagenes + foto;
	
	orig = document.getElementById('fotocarrusel');
	orig.src = img.src;
	
	pieorig = document.getElementById('pieCarrusel');
	pieorig.firstChild.nodeValue = texto;
	
	enlace = document.getElementById('enlace_carrusel');
	enlace.href = ruta_imagenes + 'z_' + foto;
	enlace.rel ='gb_imageset[carrusel]';
	enlace.title = texto;
}

function carrusel_compania_anterior(){
	if(cuenta_carrusel>=1){
		cuenta_carrusel--;
		foto = fotos[cuenta_carrusel];
		
		img = new Image();
		img.src = ruta_imagenes + foto;
		
		orig = document.getElementById('fotocarrusel');
		orig.src = img.src;
		
		enlace = document.getElementById('enlace_carrusel');
		enlace.href = ruta_imagenes + 'z_' + foto;
		enlace.rel ='gb_imageset[carrusel]';
		
		j = 1;
		for (x = 0; x < total_carrusel; x++) { 
			if(x != cuenta_carrusel){
				foto = fotos[x];
				
				img = new Image();
				img.src = ruta_imagenes + foto;
				
				orig = document.getElementById('miniz'+j);
				orig.src = img.src;
				
				enlace = document.getElementById('emini'+j);
				enlace.href = ruta_imagenes + 'z_' + foto;
				enlace.rel ='gb_imageset[carrusel]';
				j++;
			}
		}
	}
}

function carrusel_compania_siguiente(){
	if(cuenta_carrusel<(total_carrusel-1)){
		cuenta_carrusel++;
		foto = fotos[cuenta_carrusel];
		
		img = new Image();
		img.src = ruta_imagenes + foto;
		
		orig = document.getElementById('fotocarrusel');
		orig.src = img.src;
		
		enlace = document.getElementById('enlace_carrusel');
		enlace.href = ruta_imagenes + 'z_' + foto;
		enlace.rel ='gb_imageset[carrusel]';
		
		j = 1;
		for (x = 0; x < total_carrusel; x++) { 
			if(x != cuenta_carrusel){
				foto = fotos[x];
				
				img = new Image();
				img.src = ruta_imagenes + foto;
				
				orig = document.getElementById('miniz'+j);
				orig.src = img.src;
				
				enlace = document.getElementById('emini'+j);
				enlace.href = ruta_imagenes + 'z_' + foto;
				enlace.rel ='gb_imageset[carrusel]';
				j++;
			}
		}
	}
}
