lck=0;
        
 function r(hval)
 {
	if ( lck == 0 )
	{
			
		switch (hval) {
		case "uno": //uno
		//document.colores.bgColor=hval;
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "transparent";
		document.getElementById('tres').style.backgroundColor = "transparent";
		document.getElementById('cuatro').style.backgroundColor = "transparent";
		document.getElementById('cinco').style.backgroundColor = "transparent";
		document.getElementById('seis').style.backgroundColor = "transparent";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "dos": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "transparent";
		document.getElementById('cuatro').style.backgroundColor = "transparent";
		document.getElementById('cinco').style.backgroundColor = "transparent";
		document.getElementById('seis').style.backgroundColor = "transparent";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;
		
		case "tres": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "transparent";
		document.getElementById('cinco').style.backgroundColor = "transparent";
		document.getElementById('seis').style.backgroundColor = "transparent";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "cuatro": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "transparent";
		document.getElementById('seis').style.backgroundColor = "transparent";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "cinco": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "transparent";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "seis": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "#fcfd9e";
		document.getElementById('siete').style.backgroundColor = "transparent";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "siete": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "#fcfd9e";
		document.getElementById('siete').style.backgroundColor = "#f4d130";
		document.getElementById('ocho').style.backgroundColor = "transparent";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "ocho": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "#fcfd9e";
		document.getElementById('siete').style.backgroundColor = "#f4d130";
		document.getElementById('ocho').style.backgroundColor = "#ed9435";
		document.getElementById('nueve').style.backgroundColor = "transparent";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "nueve": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "#fcfd9e";
		document.getElementById('siete').style.backgroundColor = "#f4d130";
		document.getElementById('ocho').style.backgroundColor = "#ed9435";
		document.getElementById('nueve').style.backgroundColor = "#f47e63";
		document.getElementById('diez').style.backgroundColor = "transparent";
		break;

		case "diez": 
		document.getElementById('uno').style.backgroundColor = "#321bdd";
		document.getElementById('dos').style.backgroundColor = "#5d93ec";
		document.getElementById('tres').style.backgroundColor = "#1bcf52";
		document.getElementById('cuatro').style.backgroundColor = "#84dd1b";
		document.getElementById('cinco').style.backgroundColor = "#daed37";
		document.getElementById('seis').style.backgroundColor = "#fcfd9e";
		document.getElementById('siete').style.backgroundColor = "#f4d130";
		document.getElementById('ocho').style.backgroundColor = "#ed9435";
		document.getElementById('nueve').style.backgroundColor = "#f47e63";
		document.getElementById('diez').style.backgroundColor = "red";
		break;

	   }
	}
  }
        
 function l()
 {
   if (lck == 0)
   {
	 lck = 1;
   }else{
	 lck = 0;
	}
 }


var position = 4; // variable global
var position2 = 4; // variable global
var limit = 0;
var clear = 0;
  
 function desplazar(position2)
 {    
    if ( position2<10 && limit==0)
    {
       position = position2 + 2;
       position2 = position;
       if(position==10){limit=1;}
     }else if (limit==1){
        position = position2 - 2;
        position2 = position;
        if(position==2){limit=0;}
      }
      
      clear++;
      if(clear > 21 ){clearInterval(sexymetro); position=8;}
        
     switch (position) 
	{
       case 1: r('uno'); break;
       case 2: r('dos'); break; 
       case 3: r('tres'); break; 
       case 4: r('cuatro'); break; 
       case 5: r('cinco'); break; 
       case 6: r('seis'); break; 
       case 7: r('siete'); break;
       case 8: r('ocho'); break; 
       case 9: r('nueve'); break; 
       case 10: r('diez'); break; 
      }
  }