	<!--

/**
* ----------------------------------------------------------
*                     UTILESJS XP 1.4
* ----------------------------------------------------------
* Fecha de Creación: Martes 16 de Enero de 2007
* Ultima actualización: Martes 14 de Junio de 2007
* ----------------------------------------------------------
* Nombre de Autor: Ing. Andrés González Tenorio
* ----------------------------------------------------------
* Nombre de Archivo: utilesXp.js
* ----------------------------------------------------------
* Descripción: 
* Funcionalidades javascript utilitarias genericas para 
* páginas HTML.
* ----------------------------------------------------------
* Licencia GPL (General Public License): 
* Este es un producto que se rige por la filosofía GPL. 
* Puede usar este producto asi como modificarlo tanto para 
* uso personal como empresarial siempre y cuando no elimine 
* este encambezado que le brinda "Honor a quien honor 
* merece".
* ----------------------------------------------------------
* Gracias por darme un buen uso. 
* Cualquier duda comunicate a mi correo.
* andigtmail-web@yahoo.com
*/

	/**************************************** 
	 * Fija el cursor en el objeto deseado. *
	 * Recibe como parámetro el id que se   *
	 * del objeto a fijar.                  * 
	 ****************************************/
	function fijaCursor(id){
		if(id != ""){
			var objeto = window.document.getElementById(id);
			if(objeto.type == "text"){
				objeto.focus();
			}
		}
	}
	
	/******************************************
	 * Envia un mensaje al navegador web, re- *
	 * cibe como parámetro el texto del men-  *
	 * saje a desplegar.                      *
	 ******************************************/
	function msg(mensaje){
		window.alert(mensaje);	
	}
	
	/*****************************************
	 * Ejecuta el submit de un formulario,   *
	 * recibe como parámetro el id que se le *
	 * asigna al formulario.                 *
	 *****************************************/
	function enviar(id){
		if(id != ""){
			objeto = window.document.getElementById(id);
			objeto.submit();
		}
	}
	
	/*****************************************
	 * Ejecuta el redireccionamiento a una   *
	 * pagina html mediante javascript.      *
	 * Recibe como parametro url de la pá-   *
	 * gina que se quiere ver.               *
	 *****************************************/
	function redirect(url){
		if(url != ""){
			 window.location = url;
		}
	}
	
	/******************************************
	* Cierra una ventana html siempre y cuan- *
	* do la misma se haya creado mediante la  *
	* función window.open.                    *
	*******************************************/
	function cierra(){		
		window.close();	
	}
	
	/******************************************
	* Imprime el contenido de una pagina html *
	*******************************************/
	function imprimir(){
		window.print();
	}
	
	/********************************************
	* Limpia el contenido de objetos de simples *
	* formulario. Recibe como parametro una ca- *
	* dena de id de objetos separados por (,)   *
	* coma.                                     *
	*********************************************/
	function cleanObj(lista){		
		var vector = lista.split(",");
		var indice = 0;
		for(indice = 0; indice < vector.length; indice ++){			
			objeto = window.document.getElementById(vector[indice]);
			objeto.value = "";
		}
	}
	
	/*************************************
	 * Funciones de Apertura de Ventanas *
	 *************************************/
	
	/*************************************
	 * Redimensionar una ventana.        *
	 *************************************/
	function resizeOuterTo(w,h) {
	 if (parseInt(navigator.appVersion)>3) {
	   if (navigator.appName=="Netscape") {
		top.outerWidth=w;
		top.outerHeight=h;
	   }
	   else top.resizeTo(w,h);
	 }
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo y sin caracteristicas espe -  *
	 * ciales. En Posoción Centrada.      *
	 **************************************/
	function ventanaC(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no"
		var miVentana = window.open(url,nombre,settings);
		//alert(navigator.appName);		
		//Centrado de la ventana.
		var an, al;
		an = getScreenAvailWidth();
		al = getScreenAvailHeight();
		an -= w;
		al -= h;
		an /= 2;
		al /= 2;		
		miVentana.moveTo(an,al);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo y sin caracteristicas espe -  *
	 * ciales. En Posoción Normal.        *
	 **************************************/
	function ventanaN(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no"
		var miVentana = window.open(url,nombre,settings);
		miVentana.moveTo(0,0);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo y con la barra de estado.     *
	 * En Posoción Centrada.              *
	 **************************************/
	function ventanaStatusC(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no"
		var miVentana = window.open(url,nombre,settings);
		//alert(navigator.appName);		
		//Centrado de la ventana.
		var an, al;
		an = getScreenAvailWidth();
		al = getScreenAvailHeight();
		an -= w;
		al -= h;
		an /= 2;
		al /= 2;		
		miVentana.moveTo(an,al);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo y con la barra de estado.     *
	 * En Posoción Normal.                *
	 **************************************/
	function ventanaStatusN(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no"
		var miVentana = window.open(url,nombre,settings);				
		miVentana.moveTo(0,0);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo con barra de estado y a la se *
	 * le puede cambiar el tamaño.        *
	 * En Posoción Centrada.              *
	 **************************************/
	function ventanaResizableC(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes"
		var miVentana = window.open(url,nombre,settings);
		//alert(navigator.appName);		
		//Centrado de la ventana.
		var an, al;
		an = getScreenAvailWidth();
		al = getScreenAvailHeight();
		an -= w;
		al -= h;
		an /= 2;
		al /= 2;		
		miVentana.moveTo(an,al);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo con barra de estado y a la se *
	 * le puede cambiar el tamaño.        *
	 * En Posoción Normal.                *
	 **************************************/
	function ventanaResizableN(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes"
		var miVentana = window.open(url,nombre,settings);		
		miVentana.moveTo(0,0);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo con barra de estado y con ba- *
	 * rras de scroll.                    *
	 * En Posoción Centrada.              *
	 **************************************/
	function ventanaScrollC(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes"
		var miVentana = window.open(url,nombre,settings);
		//alert(navigator.appName);		
		//Centrado de la ventana.
		var an, al;
		an = getScreenAvailWidth();
		al = getScreenAvailHeight();
		an -= w;
		al -= h;
		an /= 2;
		al /= 2;		
		miVentana.moveTo(an,al);
	}
	
	/**************************************
	 * Presenta una ventana con un tamaño *
	 * fijo con barra de estado y con ba- *
	 * rras de scroll.                    *
	 * En Posoción Normal.                *
	 **************************************/
	function ventanaScrollN(url,nombre,h,w){
		var settings;
		settings = "height=" + h + ",width=" + w + ",status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes"
		var miVentana = window.open(url,nombre,settings);		
		miVentana.moveTo(0,0);
	}
		
	/********************************************************
	 * Información sobre tamaño de vantanas del explorador. *
	 * Las 4 funciones dan info diferente para Fire fox,    *
	 * Opera y otros; IE es un gajo asqueroso que no las ha *
	 * implementado por lo que a simple vista dan un resul- *
	 * tado igual. Nota las funcionalidad se da para IE6+   *
	 * por lo que no es compatible con versiones menores.   *
	 ********************************************************/
	 
	/********************************************
	 * Devuelve el ancho de la ventana interna. *
	 ********************************************/
	function getPageInnerWidth(ventana){		
		if(ventana.innerWidth){//Navegadores de Verdad
			return ventana.innerWidth;
		}else{//IE6+
			return ventana.document.documentElement.clientWidth;
		}
	}
	
	/*******************************************
	 * Devuelve el alto de la ventana interna. *
	 *******************************************/
	function getPageInnerHeight(ventana){		
		if(ventana.innerHeight){//Navegadores de Verdad
			return ventana.innerHeight;
		}else{//IE6+
			return ventana.document.documentElement.clientHeight;
		}
	}
	
	/********************************************
	 * Devuelve el ancho de la ventana externo. *
	 ********************************************/
	function getPageOuterWidth(ventana){
		if(ventana.outerWidth){//Navegadores de Verdad
			return ventana.outerWidth;
		}else{//IE6+
			return ventana.document.documentElement.offsetWidth;
		}
	}
	
	/*******************************************
	 * Devuelve el alto de la ventana externo. *
	 *******************************************/
	function getPageOuterHeight(ventana){
		if(ventana.outerWidth){//Navegadores de Verdad
			return ventana.outerHeight;
		}else{//IE6+
			return ventana.document.documentElement.offsetHeight;
		}		
	}
	
	/**************************************************
	 * Obtener eltamaño de la resolución del usuario. *
	 **************************************************/
	/**************************************
	 * Devuelve el ancho de la resolución *
	 * de pantalla total.                 *
	 **************************************/
	function getScreenWidth(){
		return window.screen.width;
	}

	/**************************************
	 * Devuelve el alto de la resolución  *
	 * de pantalla total.                 *
	 **************************************/
	function getScreenHeight(){
		return window.screen.height;
	}
	
	/**************************************
	 * Devuelve el ancho de la resolución *
	 * de pantalla disponible.            *
	 **************************************/	
	function getScreenAvailWidth(){
		return window.screen.availWidth;
	}

	/**************************************
	 * Devuelve el ancho de la resolución *
	 * de pantalla disponible.            *
	 **************************************/
	function getScreenAvailHeight(){
		return window.screen.availHeight;
	}
	
	/******************************************
	 * Identifica el Nombre del Navegador Web *
	 ******************************************/
	 
	function getNavegador(){
		var browser, respuesta;
		browser = navigator.appName;		
		return browser;
	}
	
	/**********************************************
	 * Permite manejar eventos de la páginas html *
	 * La función "addEvent" es de John Resing y  *
	 * la misma fue agregada a este paquete en la *
	 * fecha estelar: 10052K.7                    *
	 **********************************************/	 
	function addEvent( obj, type, fn ){  
		if (obj.addEventListener){  
			obj.addEventListener( type, fn, false ); 
		}else if (obj.attachEvent){  
			obj["e"+type+fn] = fn;  
			obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); }  
			obj.attachEvent( "on"+type, obj[type+fn] );  
		}  
	}  
	
	function removeEvent( obj, type, fn ) {
		if ( obj.detachEvent ) {
			obj.detachEvent( 'on'+type, obj[type+fn] );
			obj[type+fn] = null;
		} else {
			obj.removeEventListener( type, fn, false );
		}
	} 
//-->