function canviaImatge(path,image){
	image.src = path;
}

function playMedia() {
	document.objMediaPlayer.controls.Play()
}	
	
	function stopMedia()
		{
			document.objMediaPlayer.controls.Stop();
		}

 /*function surfto(form) {
        var myindex=form.select1.selectedIndex;
        if (form.select1.options[myindex].value != "0") {
       	  window.open(form.select1.options[myindex].value,'sonido','');
        }
 } */

function canviaControls(controlId) {
	if (controlId == "stop") {
		document.getElementById(controlId).src = "/imagenes/reproductor/stop2.jpg";
		document.getElementById("play").src = "/imagenes/reproductor/play3.jpg";
	}
	else if (controlId == "play") {
		document.getElementById(controlId).src = "/imagenes/reproductor/play2.jpg";
		document.getElementById("stop").src = "/imagenes/reproductor/stop3.jpg";
	}
	
}

 function ChangeTo(index) {
    toFicha1= document.getElementById ('divficha1');
    toFicha2= document.getElementById ('divficha2');
    if (index== "divficha1") {
      toFicha1.style.display="block";
      toFicha2.style.display="none";      
    } else {
      toFicha1.style.display="none";
      toFicha2.style.display="block";
    }
 }

/* Control de la barra de volumen */

 valorVolumen= 10;
 tamanioVolumen= 25;
 
 function subirVolumen () {
   if (valorVolumen<tamanioVolumen) {
     valorVolumen++;
     imagenVolumen(valorVolumen);
	/*var miLed= document.getElementById ("miLed"+valorVolumen);
     miLed.style.backgroundColor= "#50B1F2";*/

     playerValor= ((valorVolumen * 100) / 5);
     document.objMediaPlayer.settings.volume= playerValor;
   }
 }

 function imagenVolumen(val){
 		
		var img = document.getElementById('vol');
		if(val == 0){
			img.src = "/~soulnati/imagenes/Radio/vol_3_0.jpg"
		}
		else if(val > 0 && val <= 5){
			img.src = "/~soulnati/imagenes/Radio/vol_3_1.jpg"	
		}
		else if(val > 5 && val <= 10){
			img.src = "/~soulnati/imagenes/Radio/vol_3_2.jpg"	
		}
		else if(val > 10 && val <= 15){
			img.src = "/~soulnati/imagenes/Radio/vol_3_3.jpg"	
		}	
		else if(val > 15 && val <= 24){
			img.src = "/~soulnati/imagenes/Radio/vol_3_4.jpg"	
		}
		else{
			img.src = "/~soulnati/imagenes/Radio/vol_3_5.jpg"
		} 
 }
 
function bajarVolumen () {
 
   if (valorVolumen>0) {
     /*var miLed= document.getElementById ("miLed"+valorVolumen);
     miLed.style.backgroundColor= "#F0F0F0";*/
     valorVolumen--;
	 imagenVolumen(valorVolumen);
     playerValor= ((valorVolumen * 100) / 5);
     document.objMediaPlayer.settings.volume= playerValor; 
   }
 }

 function ponerVolumenValor (valor) {
   valorVolumen= valor;

   // BorrarBarra
   for (k=1; k<=tamanioVolumen; k++) {
     var miLed= document.getElementById ("miLed"+k);
     miLed.style.backgroundColor= "#F0F0F0";
   }
   // Relleno hasta valor
   for (k=1; k<=valorVolumen; k++) {
     var miLed= document.getElementById ("miLed"+k);
     miLed.style.backgroundColor= "#50B1F2";
   }

   playerValor= ((valorVolumen * 100) / 22);
   document.objMediaPlayer.settings.volume= playerValor;

 }

/* FIN Control de la barra de volumen */

