// JavaScript Document
<!-- Created by Marina Planells Guasch 22/08/2009-->
<!-- Web site: http://www.marina-planells.es -->

var rotate_delay = 5000; // delay in milliseconds (1000 = 1 secs)
imagenesPasteleria = new Array ("./img/bienvenidos1.jpg","./img/bienvenidos2.jpg","./img/bienvenidos3.jpg","./img/bienvenidos4.jpg");
imagenesCharcuteria = new Array ("./img/charcuteria1.jpg","./img/charcuteria2.jpg","./img/charcuteria3.jpg","./img/charcuteria4.jpg");
imagenesBodega = new Array ("./img/bodega1.jpg","./img/bodega2.jpg","./img/bodega3.jpg","./img/bodega4.jpg");
imagenesPanaderia = new Array ("./img/panaderia1.jpg","./img/panaderia2.jpg","./img/panaderia3.jpg","./img/panaderia4.jpg");
imagenesProductos = new Array ("./img/productos-tradicionales1.jpg","./img/productos-tradicionales2.jpg","./img/productos-tradicionales3.jpg","./img/productos-tradicionales4.jpg");
imagenesCatering = new Array ("./img/cattering1.jpg","./img/cattering2.jpg","./img/cattering3.jpg","./img/cattering4.jpg");
imagenesLocalizacion = new Array ("./img/localizacion1.jpg","./img/localizacion2.jpg","./img/localizacion3.jpg","./img/localizacion4.jpg");
var t;

function rotatePasteleria(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesPasteleria[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotatePasteleria("+current+")", rotate_delay);
}

function rotateCharcuteria(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesCharcuteria[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotateCharcuteria("+current+")", rotate_delay);
}
function rotateBodega(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesBodega[current];
		if (current<2){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotateBodega("+current+")", rotate_delay);
}
function rotatePanaderia(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesPanaderia[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotatePanaderia("+current+")", rotate_delay);
}
function rotateProductos(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesProductos[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotateProductos("+current+")", rotate_delay);
}
function rotateCattering(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesCatering[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotateCattering("+current+")", rotate_delay);
}
function rotateLocalizacion(current) {		
		clearTimeout(t);
		var current = parseInt(current)
		document.getElementById('imgCabecera').src = imagenesLocalizacion[current];
		if (current<3){
			current = current+1;
		}
		else{
			current = 0;
		}
		t=window.setTimeout("rotateLocalizacion("+current+")", rotate_delay);
}
//  End -->