function Pag_Volumen_Show() {
	Page_Show("Pag_Volumen",
		 '<table id="Pag_Volumen" width="720px" cellpadding="0" cellspacing="0" style="position: absolute; visibility: ' + (bMuted?"hidden":"visible") + ';">'
		+'<tr height="493px"/>'
		+'<tr height="33px">'
		+'	<td width="79px"/>'
		+'	<td width="522px" height="33px" style="background-image: url(volume_fondo.png); background-repeat: no-repeat;">'
		+'		<table id="Pag_Volumen_Barra" width="' + (iVolumen*4) + '%" height="33px" cellpadding="0" cellspacing="0" style="background-image: url(volume_barra.png); background-repeat: no-repeat;">'
		+'			<tr height="33px"><td/></tr>'
		+'		</table>'
		+'	</td>'
		+'	<td width="10px"/>'
		+'	<td id="Pag_Volumen_Valor" width="109px" class="font25">' + iVolumen + '</td>'
		+'</tr>'
		+'</table>');
	lTimerPageHide = setTimeout("Page_Show('','')",5000);
}

function Pag_Volumen_KeyDown(keyChar) {
	try {
		switch (keyChar) {
		case KEY_RIGHT:
		case KEY_VOLUP:
			ActualizarVolumen(iVolumen + 1, false);
			Pag_Volumen_Show();
			return 0;
		case KEY_LEFT:
		case KEY_VOLDN:
			ActualizarVolumen(iVolumen - 1, false);
			Pag_Volumen_Show();
			return 0;
		case KEY_MUTE:
			ActualizarVolumen(iVolumen, (bMuted==false));
			Pag_Volumen_Show();
			return 0;
		}
	} catch(ex) {
		alert("Pag_Volumen_KeyDown: " + ex);
	}
	return 1;
}

function ActualizarVolumen(iVol, bMut) {
	iVolumen = iVol;
	bMuted = bMut;
	if (iVolumen > 25) iVolumen = 25;
	if (iVolumen < 0) iVolumen = 0;
	if (bMuted) {
		document.getElementById("Body").style.backgroundImage = "url(volume_muted.png)";
	} else {
		document.getElementById("Body").style.backgroundImage = "none";
	}
	if (bMuted == true) {
		ialEnv.system.master_output.mute(true);
	} else {
		if (ialEnv.system.master_output.isMuted) {
			ialEnv.system.master_output.mute(false);
		}
		ialEnv.system.master_output.setVolume(iVolumen*4);
	}
	setValue(CFG_MUTED, bMuted);
	setValue(CFG_VOLUMEN, iVolumen);
}
