volimgsrc = ["sound_1.gif","sound_2.gif","sound_3.gif","sound_4.gif"];
volid = ["s1","s2","s3","s4"];  
pos = 3;  
function volimg(op) 
{
     if(op == 'mas' && pos < 3) 
     { 
          pos++; 
          nv=0; 
           while(nv <= pos) 
          {
              document.images[volid[nv]].src = 'images/'+volimgsrc[nv]; 
			  nv++;
          }
     }
     else 
     {
          if(op == 'menos' && pos >= 0)
          {
               pos--;
               nv=3;
               while (nv > pos)
               { 
                  document.images[volid[nv]].src = 'images/sound_0.gif';  
                  nv--; 
               } 
          }  
     } 
} 

var estado_anterior = -1;
var buffer = 0

function estado(){
	var estado_actual = document.Video.playState;
	if (estado_actual != estado_anterior) {
		if (document.Video.BufferingProgress < 70 ){
			if(buffer = 0){
				document.status.src = 'images/status_0.gif';
				buffer = 1
			}			
	}else{
		if (estado_actual == 0){
			document.status.src = 'images/status_2.gif';
		} else if (estado_actual == 1){
			document.status.src = 'images/status_3.gif';			
		} else if (estado_actual == 2) {
			document.status.src = 'images/status_1.gif';
		} else if (estado_actual == 3) {
			document.status.src = 'images/status_0.gif';
		} else if (estado_actual == 8) {
			document.status.src = 'images/status_0.gif';
		}
		buffer = 0
		estado_anterior = estado_actual;		
	}
	}
setTimeout("estado()",500);
}

function volumeup() {
nowvol=document.Video.Volume;
nowvol=nowvol+400;
if(nowvol>=0) { nowvol=0 };
document.Video.Volume=nowvol;
}

function myStop() {
document.Video.Stop();
document.status.src = 'images/status_2.gif';
}

function myPlay() {
document.Video.Play();
document.status.src = 'images/status_0.gif';
}

function volumedown() { 
nowvol=document.Video.Volume;
nowvol=nowvol-400;
if(nowvol== -2400) { nowvol=document.Video.Volume };
document.Video.Volume=nowvol;
}

function mute0() {
if (document.Video.mute == true) {
document.Video.mute = false;
document.mute.src = 'images/sound_on.gif';
document.mute.alt = 'Desactivar Sonido';
} else {
document.Video.mute = true;
document.mute.src = 'images/sound_off.gif';
document.mute.alt = 'Activar Sonido';
}
}

