// JavaScript Document


function openImage(id_foto)
{
	vent = window.open('/admin/modulos/imagenes/index.php?action=getHTMLImagen&id_imagen='+id_foto, 'Images', 'width=466, height=392, scrollbars=yes, statusbar=no, resizable=yes');				
	centrarVentana(vent, 466, 392);
	vent.focus();
}

function centrarVentana(objvent, width, height)
{
	objvent.moveTo((screen.width-width)/2,(screen.height-height)/2);
}

function onclickEnter(e,funcion){

	var evento_key = (document.all) ? e.keyCode : e.which; 

	if(evento_key==13)//si la tecla apretada es enter
			return eval(funcion);
  
}


function openPopUpEnviar(url,ancho,alto,con_scroll,con_barra,resize)
{	
	
	vent = window.open(url, 'Images', 'width='+ancho+', height='+alto+', scrollbars='+con_scroll+', statusbar='+con_barra+', resizable='+resize);
	centrarVentana(vent,ancho,alto);
	
	return false;
}

function ordenarPor(path){
	window.location = path+"orden="+(document.getElementById("orden").value);
}


function fieldNumber(objeto, numeroDecimales, e) 
{ 
	var valorCampo; 
	var evento_key = (document.all) ? e.keyCode : e.which; 
	var numPosPunto = 0; 
	var strParteEntera = ""; 
	var strParteDecimal = ""; 
	var NUM_DECIMALES = numeroDecimales; 
	
	
	
	switch (evento_key) 
	{ 
		case 48: 
		case 49: 
		case 50: 
		case 51: 
		case 52: 
		case 53: 
		case 54: 
		case 55: 
		case 56: 
		case 57: 
		break; 
		default: 
			if (((evento_key != 46) || (NUM_DECIMALES == 0)) && (evento_key != 8))
			{
				if (document.all) 
					e.keyCode = 0;
				else 
					e.stopPropagation();
				return false; 
			}
			else if (evento_key == 8) return true;
	} 

	valorCampo = objeto.value; 	
	if (evento_key == 46) 
	{
		if (valorCampo == '')
		{
			if (document.all) 
				e.keyCode = 0;
			else 
				e.stopPropagation();
			return false; 
		}
		else if (valorCampo.indexOf(".") != -1)
		{ 
			if (document.all) 
				e.keyCode = 0;
			else 
				e.stopPropagation();
			return false; 
		} 
	}
	/* Sólo puede teclear el número de decimales indicado en NUM_DECIMALES */ 
	if ((numPosPunto = valorCampo.indexOf(".")) != -1) 
	{ 
		strParteEntera = valorCampo.substr(0,(numPosPunto - 1)); 
		strParteDecimal = valorCampo.substr((numPosPunto + 1), valorCampo.length) 
		
		if (strParteDecimal.length > (NUM_DECIMALES - 1)) 
		{ 
			if (document.all) 
				e.keyCode = 0;
			else 
				e.stopPropagation();
			return false; 
		} 
	} 
	
	return true; 
} 

function mostrarMenu(idElemento)
{
	document.getElementById(idElemento).style.display = "";
}

function ocultarMenu(idElemento)
{
	document.getElementById(idElemento).style.display = "none";
}


<!-- CONTROLA EL ESTADO DEL FLASH DE SONIDO-->

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Gestionar todos los mensajes de FSCommand de una película Flash
function ponsibartumeu2_DoFSCommand(command, args) {
	var ponsibartumeu2Obj = isInternetExplorer ? document.all.ponsibartumeu2 : document.ponsibartumeu2;
	
    jsrsExecute("/include/include.funcionesRS.php", null, "setearEstadoSonido", Array(command));

}
// Ancla para Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub ponsibartumeu2_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call ponsibartumeu2_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
//-->