function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}


// Función para borrar el boton y activar el ON GO del select.
function selecamb() {
	document.write('<style type="text/css">#formSelAmb select {margin: 5px 0 0 8px; font-size: 13px; width: 175px; } #formSelAmb button {display: none; }</style>');

	if($('selectAmb')) {
		$('selectAmb').onchange = function() {
			$('formSelAmb').submit();
		}
	}
}
function detectEvent(e) {
	opc = false;
	var evt = e || window.event;
	tecla = evt.keyCode;
	
	if (tecla > 47 && tecla < 58) {	opc = true;} /* los numeros del 0 al 9 para el IE */
	if (evt.charCode > 47 && evt.charCode < 58) {opc = true;} /* los numeros del 0 al 9 para FF */	
	if (tecla == 35 && !document.all) {opc = true;} /* la tecla END para FF */
	if (tecla == 46 && !document.all) {opc = true;} /* la tecla DELETE para FF */
	if (tecla > 36 && tecla < 41 && !document.all) {opc = true;	} /* las flechas para el FF */
	if (tecla == 8 || tecla==9 || tecla==13){opc = true;} /* Backspace, TAB y Enter */

	//if(opc==false) {alertar('Solo se aceptan numeros',3);}
	return opc;
}
