//estas son funciones básicas javascript para toda pagina del sistema

//evento presionartecla enter
function eventoOnKeyPress(evento)	{
	var ascii;
	if (evento.keyCode)
		ascii = evento.keyCode;
	else if (evento.which)
		ascii = evento.which;
	else
		return false;
	if (ascii == 13)
		submitForm(1);
	return true;
}

//funcion ir a, carga la direccion pasada como parametro
function goTo(url) {
	location.href= url;
}

//funcion ir a, carga la direccion pasada como parametro
function openURL(url) {
	document.target="_blank";
	location.href=url;
	document.target="_self";
}

//funcion para cambiar el color de objeto seleccionado
function entrarcolor(id,estilo){
	document.getElementById(id).className=estilo;
}

//funcion para volver al color original de objeto que perdio el foco
function salircolor(id,estilo){
	document.getElementById(id).className=estilo;
}

//Esta función abre un pop-up del URL pasado como parámetro
function popUp(URL,width,height,scrolls) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+scrolls+",location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left = 100,top = 20');");
}
/*
//Esta función cubre el error del IE6 con la transparencia de los archivos PNG
function PNG_loader() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") imgStyle += "float:left;";
			if (img.align == "right") imgStyle += "float:right;";
			//if (img.parentElement.href) imgStyle += "cursor:hand;";
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			img.outerHTML = strNewHTML;
			i--;
		}
	}
}
window.attachEvent("onload", PNG_loader);*/