	
	var sem=0;

	var factor=4;
	var tiempo=6500;
	var velocidad=8;
	var total=totl;  //pasa del index
	var indice = 1;
	
	var color=100;
	
	var posicion=0;
		
	function muestra(){
		var obj = document.getElementById("q1");
		
		obj.style.display = "block";

		sem = 1;
		
		color=color+factor;

		if (color <= 100){
			obj.style.filter = 'alpha(opacity='+color+')';
			obj.style.opacity = color/100;
			obj.style.MozOpacity = color/100;
			obj.style.KHTMLOpacity = color/100;
		}
		else{	sem=0;
				window.clearInterval(cont1);
		}
	}

	function oculta(){
		var obj = document.getElementById("q1");
		color=color-factor;

		sem=1;
		
		if (color >= 0){
			obj.style.filter = 'alpha(opacity='+color+')';
			obj.style.opacity = color/100;
			obj.style.MozOpacity = color/100;
			obj.style.KHTMLOpacity = color/100;
			}
		else{	
				window.clearInterval(cont1);
				sem=0;

				posicion = posicion * -960;
				
				document.getElementById("q1").style.left = posicion + "px";
				cont1 = window.setInterval("muestra()",velocidad);			
		}
	}

	function apaga(val){
		if (sem == 0) {
			indice = val;
			val = val - 1;
			posicion = val;
			cont1 = window.setInterval("oculta()",velocidad);
		}
	}

	function c(val){
		if (sem == 0) {
			window.clearInterval(carro);
			indice = val;
			val = val - 1;
			posicion = val;
			cont1 = window.setInterval("oculta()",velocidad);
			carro = window.setInterval("carrousel()",5000);
		}
	}	
	
	function revisa(){
		
		var cambio = window.navigator.appName;
		
		if (cambio == "Microsoft Internet Explorer") {
			velocidad = 1;
			factor=16;
		}
	}
	
	
	function carrousel(){
		indice=indice + 1;
		if (indice > total)
			indice = 1;
			
		apaga(indice);
	}
	
	window.setTimeout("revisa()",1);
	
	carro = window.setInterval("carrousel()",12000);
	
