function ejecutacadena(cadena)
{
	eval(cadena);
}
function makeRequest(url, funcionx)
{
	http_request = false;
	if (window.XMLHttpRequest)
	{
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType)
		{
			http_request.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
			}
		}
	}
	if(!http_request)
	{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	
	http_request.onreadystatechange=funcionx;
	http_request.open('POST', url, true);
	http_request.send(null);
}
function metedatos(datos, nombre)
{
	try{
		grid_name=nombre;
		oInp =[];
		var oGrid = document.getElementById(nombre);
		oInp.push(datos);
		sH = oInp.join(' ');
		oGrid.innerHTML=sH;
	}catch(exception){
		if (exception.description == null)
		{
			alert("Error de pintado: " + exception.message);
		}else{
			alert("Error de pintado: " + exception.description);
		}
	}
}
function viewHide(id)
{
	var targetId, srcElement, targetElement;
	var targetElement = document.getElementById(id);
	if (targetElement.style.display == "none")
	{
		targetElement.style.display = "";
	}else{
		targetElement.style.display = "none";
	}
}
function viewtable(id)
{
	var targetId, srcElement, targetElement;
	var targetElement = document.getElementById(id);
	targetElement.style.display = "";
}
function hidetable(id)
{
	var targetId, srcElement, targetElement;
	var targetElement = document.getElementById(id);
	targetElement.style.display = "none";
}
function datolleno(objeto, texto)
{
	if (objeto.value!="")
	{
		return 1;
	}else{
		if (texto!="")
		{
			alert(texto);
			objeto.focus();
		};
		return 0;
	}
}
function validarEntero(objeto, texto)
{
	valor = parseInt(objeto.value);
	if (isNaN(valor))
	{
		alert(texto);
		objeto.focus();
		return 0;
	}else{
		return 1;
	}
}
function validaremail(direccion, texto)
{
	if (direccion.value.indexOf("@") != -1)
	{
		return 1;
	}else{
		alert(texto);
		direccion.focus();
		return false;
	}
}
function validanumeros(numx,tes)
{
	var v_nivel;
	var num2;
	v_nivel=numx.value;
	if (v_nivel != "" )
	{
		if (isNaN(v_nivel))
		{
			alert(tes);
			numx.focus();
			return "1";
		}else{
			return "0";
		}
	}else{
		return "0";
	}
}

