/**
 * @package GeoDatum
 * Proyecto	:	GeoDatum - Sistema de Informacion Territorial
 * Archivo	:	Divisor.class.js
 *
 * @link http://www.siigsa.cl
 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
 * @since 25-05-2009
 * @version 1.0.12
 * 
 * Clase que crea divisores flotantes como capas dinamicas dentro del html
 *
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 10-12-2008
 * @version 6
 * setEventoMouse();
 * 
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 10-12-2008
 * @version 7
 * setPosicionDivisor();
 * 
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 10-12-2008
 * @version 8
 * crearDivisor();
 * 
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 12-12-2008
 * @version 9
 * Al final de la clase se cambio "document.onmousemove = this.setEventoMouse;" por "document.body.onmousemove = this.setEventoMouse;" 
 * el evento se cambia del documento al body
 * 
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 16-12-2008
 * @version 10
 * agregarEvento()
 * 
 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl> 
 * @since 31-03-2009
 * @version 11
 * setImagen()
 
 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
 * @since 25-05-2009
 * @version 12
 * Se cambia la funcion que permite el movimiento del divisor por problemas de compatibilidad ( new Zapatec.Utils.Draggable = Drag.init ).
 * Tambien se cambio el intanciado de la clase del titulo por problemas de compatibilidad
 * crearDivisor()
 * setTitulo()
 * 
 */

 
	/**
	 * @link http://www.siigsa.cl
   * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
	 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
	 * @since 21-06-2008
	 * @version 1.0.4
	 *
	 * Constructor de la clase de divisores flotantes
	 * 
	 */
	function Divisor(){
		
		var iObj					= this;
		
		this.cima					= '270px';
		this.izquierda		= '450px';
		this.ancho				= '450px';
		this.alto					= '290px';
		this.posicionAuto	= true;
		
		this.pagina				= null;
		this.parametros		= null;
		
		this.items				= 0;
		
		this.unico				= true;
		
		var oAjax					= new ObjAjax();
		
		var tTC 					= new Array();
		var tDT 					= new Array();
		
		var tDF 					= new Array();
		var tDC 					= new Array();
		
		var tBC 					= new Array();
		var tIC 					= new Array();
		
		var _cant					= 0; 
		var _evt 					= null;
	
		
	/**
	 * @link http://www.siigsa.cl
   * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
   * @since 10-12-2008
   * @version 1.0.6
	 * 
	 * Crea un divisor flotante en tiempo de ejecucion
	 * 
	 */
		this.crearDivisor = function (_tit, _btn_cerrar){
			
			try{
				
				if(typeof(_btn_cerrar) == 'undefined'){
					_btn_cerrar = GC_BULEANO_V;
				}
				
				_cant = parseInt(_cant) + 1;
				
				if (this.unico == true){
					
					if (_cant > 1){
						_cant = parseInt(_cant) - 1;
						tDF[this.get('items')].focus();
						return false;
					}
					
				}
				
				this.set('items',parseInt(this.get('items')) + 1)
				
				if (this.get('posicionAuto')){this.setPosicionDivisor();}
				
				this.setDivisor();
				this.setTitulo();
				if(_btn_cerrar == GC_BULEANO_V){this.setBoton();}
				this.setImagen();
				
				document.body.appendChild(tDF[this.get('items')]);
									
				tDF[this.get('items')].appendChild(tDC[this.get('items')]);
				tDF[this.get('items')].appendChild(tDT[this.get('items')]);
				tDT[this.get('items')].appendChild(tTC[this.get('items')]);
					
				//tDF[this.get('items')].appendChild(tTC[this.get('items')]);
				if(_btn_cerrar == GC_BULEANO_V){
					tDF[this.get('items')].appendChild(tBC[this.get('items')]);
					tDF[this.get('items')].appendChild(tIC[this.get('items')]);
				}
				
				this.cargarTitulo(_tit);
								
//				new Zapatec.Utils.Draggable('tDivFondo_' + this.get('items'),{handler:'tDivTitulo_' + this.get('items'),dragCSS:'dragging'});
//				new Zapatec.Utils.Draggable('tDivFondo_' + this.get('items'),{handler:'tTituloContenido_' + this.get('items'),dragCSS:'dragging'});
				Drag.init(document.getElementById('tTituloContenido_' + this.get('items')),document.getElementById('tDivFondo_' + this.get('items')));
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
		

		/**
		 * @link http://www.siigsa.cl
 		 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
		 * @since 10-12-2008
		 * @version 1.0.2
		 *
		 * Funcion que asigna las propiedades de eventos del mouse
		 * 
		 */
		this.setEventoMouse = function(ev){
			
			try{
				
				if (!ev) ev = window.event; 
				_evt = ev;
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
			
			}
			
		}

		
		/**
		 * @link http://www.siigsa.cl
 		 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
		 * @since 10-12-2008
		 * @version 1.0.1
		 *
		 * Funcion que asigna las posiciones del divisor
		 * 
		 */
		this.setPosicionDivisor = function(){
			
			try{
					
				var _af = _evt.clientX;
				var _at = parseInt(_evt.clientX) + parseInt(this.get('ancho'));
				if (_at > screen.width){
					_af = parseInt(_af) - parseInt(this.get('ancho'));
				}
				
				this.set('cima',_evt.clientY + document.documentElement.scrollTop + 'px');
				this.set('izquierda', _af + 'px');
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
			
			}
			
		}

		
		/**
		 * @link http://www.siigsa.cl
 		 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 21-06-2008
		 * @version 1.0.3
		 *
		 * Funcion que asigna las propiedades y estilo para el divisor
		 * 
		 */
		this.setDivisor = function(){
					
			try{
				
				tDF[this.get('items')] = document.createElement("div");
				tDT[this.get('items')] = document.createElement("div");
				tDC[this.get('items')] = document.createElement("div");
				
				/*SETEO DEL PRIMER DIVISOR FONDO*/
				this.setAtributoObjeto(tDF[this.get('items')],'id','tDivFondo_' + this.get('items'));
				this.setEstiloObjeto(tDF[this.get('items')],'border','2px outset');
				this.setEstiloObjeto(tDF[this.get('items')],'position','absolute');
				this.setEstiloObjeto(tDF[this.get('items')],'top',this.get('cima'));
				this.setEstiloObjeto(tDF[this.get('items')],'left',this.get('izquierda'));
				this.setEstiloObjeto(tDF[this.get('items')],'width',this.get('ancho'));
				this.setEstiloObjeto(tDF[this.get('items')],'height',this.get('alto'));
//				this.setEstiloObjeto(tDF[this.get('items')],'zIndex','1');																			/*Jose Luis Meneses*/
				this.setEstiloObjeto(tDF[this.get('items')],'zIndex','101');
				this.setEstiloObjeto(tDF[this.get('items')],'backgroundColor','#BDCBE7');
//				this.setEstiloObjeto(tDF[this.get('items')],'overflow','no');																			/*auto->no Jose Luis Meneses*/
				this.setEstiloObjeto(tDF[this.get('items')],'visibility','visible');
				
				/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
				
				/*SETEO DEL SEGUNDO DIVISOR TITULO*/
				this.setAtributoObjeto(tDT[this.get('items')],'id','tDivTitulo_' + this.get('items'));
				this.setEstiloObjeto(tDT[this.get('items')],'border','0px solid red');
				this.setEstiloObjeto(tDT[this.get('items')],'position','absolute');
				this.setEstiloObjeto(tDT[this.get('items')],'top','0px');
				this.setEstiloObjeto(tDT[this.get('items')],'left','0px');
				this.setEstiloObjeto(tDT[this.get('items')],'width',this.get('ancho'));
				this.setEstiloObjeto(tDT[this.get('items')],'height','20px');
//				this.setEstiloObjeto(tDT[this.get('items')],'zIndex','3');
				this.setEstiloObjeto(tDT[this.get('items')],'zIndex','103');
				/*this.setEstiloObjeto(tDT[this.get('items')],'backgroundColor','#FFFFFF');*/											/*Jose Luis Meneses*/
//				this.setEstiloObjeto(tDT[this.get('items')],'overflow','no');																			/*hidden->no Jose Luis Meneses*/
				this.setEstiloObjeto(tDT[this.get('items')],'visibility','visible');
				
				/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
				
				/*SETEO DEL TERCER DIVISOR CONTENIDO*/
				this.setAtributoObjeto(tDC[this.get('items')],'id','tDivContenido_' + this.get('items'));
				this.setEstiloObjeto(tDC[this.get('items')],'border','0px solid red');
				this.setEstiloObjeto(tDC[this.get('items')],'position','relative');
				this.setEstiloObjeto(tDC[this.get('items')],'top','20px');
				this.setEstiloObjeto(tDC[this.get('items')],'left','0px');
				this.setEstiloObjeto(tDC[this.get('items')],'width',this.get('ancho'));
				this.setEstiloObjeto(tDC[this.get('items')],'height',parseInt(this.get('alto')) - 45 + 'px');
//				this.setEstiloObjeto(tDC[this.get('items')],'zIndex','2');																			/*Jose Luis Meneses*/
				this.setEstiloObjeto(tDC[this.get('items')],'zIndex','102');
				this.setEstiloObjeto(tDC[this.get('items')],'backgroundColor','#FFFFFF');
				this.setEstiloObjeto(tDC[this.get('items')],'overflow','auto');
				this.setEstiloObjeto(tDC[this.get('items')],'visibility','visible');
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}

		}
		
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 20-06-2008
		 * @version 1.0.1
		 *
		 * Funcion de ajax el cual muestra el contenido en el divisor
		 *
		 * @param string _param : parametros que se requieren para la seccion del modulo
		 * @param string _patch : ruta en la que se encuentra el modulo a buscar
		 * 
		 */
		this.setContenido = function(_patch,_param,_cont){
			
			try{
			
				if (typeof(_cont)!="undefined"){
					
					tDC[iObj.get('items')].innerHTML = _cont;
					
				}else{
					
					_res_general = true;
					oAjax.open("POST", GC_WEB_DIR + _patch , true);
					oAjax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
					oAjax.send(_param);
					
					oAjax.onreadystatechange=function(){			
						if (oAjax.readyState==4 && oAjax.status==200){
							tDC[iObj.get('items')].innerHTML = oAjax.responseText;
//							alert(tDC[iObj.get('items')].innerHTML);
						}
					}
					
				}
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que asigna los atributos y propiedades del boton cerrar del divisor
		 * 
		 */
		this.setBoton = function(_btn_cerrar){
			
			try{
			
				var _ic = iObj.get('items');
			
				tBC[this.get('items')] = document.createElement("input");
				
				this.setAtributoObjeto(tBC[this.get('items')],'id','tBotonCerrar_' + this.get('items'));
				this.setAtributoObjeto(tBC[this.get('items')],'type','button');
				this.setAtributoObjeto(tBC[this.get('items')],'value','Cerrar');
				this.setAtributoObjeto(tBC[this.get('items')],'title','Cerrar');
				
				this.setEstiloObjeto(tBC[this.get('items')],'position','absolute');
				this.setEstiloObjeto(tBC[this.get('items')],'width','65px');
				this.setEstiloObjeto(tBC[this.get('items')],'top',(parseInt(this.get('alto')) - 20) + 'px');
				this.setEstiloObjeto(tBC[this.get('items')],'left',(parseInt(this.get('ancho')) - 70) + 'px');
			
				tBC[this.get('items')].onclick = function(){
					iObj.cerrarDivisor(_ic);
				}
					
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}			
			
		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que inserta un titulo para el divisor
		 *
		 * @param string _tnomb : Titulo del divisor, tiene que ser enviado seteandolo antes del llamado al divisor.
		 * 												De no ser asi quedara el divisor sin titulo
		 * 
		 */
		this.setTitulo = function(){

			try{
			
				tTC[this.get('items')] = document.createElement("label");
				this.setAtributoObjeto(tTC[this.get('items')],'id','tTituloContenido_' + this.get('items'));
				
//				if(qNav){
//					this.setAtributoObjeto(tTC[this.get('items')],'className','titulo');
//				}else{
//					this.setAtributoObjeto(tTC[this.get('items')],'class','titulo');
//				}
				
				if (oNavegador.isIE && oNavegador.version == "7"){
					this.setAtributoObjeto(tTC[this.get('items')],'className','titulo');
				}else if (oNavegador.isIE && oNavegador.version == "8"){
					this.setAtributoObjeto(tTC[this.get('items')],'class','titulo');
				}else{
					this.setAtributoObjeto(tTC[this.get('items')],'class','titulo');
				}
				
				this.setEstiloObjeto(tTC[this.get('items')],'position','absolute');
				this.setEstiloObjeto(tTC[this.get('items')],'border','0px solid red');
				this.setEstiloObjeto(tTC[this.get('items')],'top','4px');
				this.setEstiloObjeto(tTC[this.get('items')],'left','2px');
				this.setEstiloObjeto(tTC[this.get('items')],'width','95%');
				this.setEstiloObjeto(tTC[this.get('items')],'zIndex','3');
			
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}	
				
		}
		
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que carga un titulo para el divisor en tiempo de ejecucion
		 *
		 * @param string _tit : Titulo del divisor
		 * 
		 */
		this.cargarTitulo = function( _tit ){
		
			try{
			
				if (typeof(_tit)=="undefined"){
					tTC[this.get('items')].innerHTML = "";
				}else{
					tTC[this.get('items')].innerHTML = "&nbsp;" + _tit;
				}
			
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
				
		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que asigna atributos y propiedades para el boton imagen cerrar 
		 * 
		 */
		this.setImagen = function(){
			
			try{
				
				var _ic = iObj.get('items');
				
//				tIC[this.get('items')] = document.createElement("img");
//				this.setAtributoObjeto(tIC[this.get('items')],'id','tImagenCerrar_' + this.get('items'));
//				this.setAtributoObjeto(tIC[this.get('items')],'src', GC_WEB_IMG + '/x.gif');
//				this.setAtributoObjeto(tIC[this.get('items')],'alt', 'Cerrar');
				
				tIC[this.get('items')] = document.createElement("input");
				this.setAtributoObjeto(tIC[this.get('items')],'type','image');
				this.setAtributoObjeto(tIC[this.get('items')],'id','tImagenCerrar_' + this.get('items'));
				this.setAtributoObjeto(tIC[this.get('items')],'value','Cerrar');
				this.setAtributoObjeto(tIC[this.get('items')],'alt','Cerrar');
				this.setAtributoObjeto(tIC[this.get('items')],'title','Cerrar');
				this.setAtributoObjeto(tIC[this.get('items')],'src', GC_WEB_IMG + '/x.gif');
				
				this.setEstiloObjeto(tIC[this.get('items')],'position','absolute');
				this.setEstiloObjeto(tIC[this.get('items')],'top','4px');
				this.setEstiloObjeto(tIC[this.get('items')],'left',(parseInt(this.get('ancho')) - 17) + 'px');
				this.setEstiloObjeto(tIC[this.get('items')],'zIndex','200');
				this.setEstiloObjeto(tIC[this.get('items')],'cursor','pointer');
				this.setEstiloObjeto(tIC[this.get('items')],'border','0px solid red');
				
				tIC[this.get('items')].onclick = function(){
					iObj.cerrarDivisor(_ic);
				}
			
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}

		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que permite setear los atributos propios de los divisores
		 * 
		 * @param objeto _obj  : objeto divisor
		 * @param string _nomb : nombre del atributo a setear
		 * @param string _val  : valor que que se le asigna al atributo a setear 
		 *
		 */
		this.setAtributoObjeto = function(_obj, _nomb, _val){
			
			try{
				
				_obj.setAttribute( _nomb , _val );
			
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}

		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl>
		 * @since 06-06-2008
		 * @version 1.0.0
		 *
		 * Funcion que permite setear el estilo propios de los divisores
		 * 
		 * @param objeto _obj  : objeto divisor
		 * @param string _nomb : nombre del estilo a setear
		 * @param string _val  : valor que se le asigna al estilo a setear
		 *
		 */
		this.setEstiloObjeto = function(_obj, _nomb, _val){
			
			try{
				
				_obj.style[_nomb] = _val;
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}

		}
	 	
		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Jose Meneses Gonzalez <jmeneses@siigsa.cl> 
		 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
		 * @since 21-06-2008
		 * @version 1.0.2
		 *
		 * Funcion que oculta el divisor que reemplaza a los popup's del sistema
		 * 
		 */
		this.cerrarDivisor = function(_index){
			
			try{
				
				tDF[_index].removeChild(tDC[_index]);
				
				tDT[_index].removeChild(tTC[_index]);
				tDF[_index].removeChild(tDT[_index]);
				
				/*tDF[_index].removeChild(tDT[_index]);
				tDF[_index].removeChild(tTC[_index]);*/
				
				tDF[_index].removeChild(tBC[_index]);
				tDF[_index].removeChild(tIC[_index]);
				document.body.removeChild(tDF[_index]);
				
				_cant = parseInt(_cant) - 1;
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}

		
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	 	 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
   	 * @since 21-06-2008
	   * @version 1.0.1
	   * 
	   * Retorna tag del divisor principal
	   * 
	   */
		this.getTagDivisor = function(){
			
			var _res = false;
			
			try{
			
				if (tDF[iObj.get('items')]) {
					
					_res = tDF[iObj.get('items')];
					
				}
				
				return _res;
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
		
	 	
		/**
		 * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	 	 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
   	 * @since 21-06-2008
	   * @version 1.0.1
	   * 
	   * Retorna tag del divisor de contenidos
	   * 
	   */
		this.getTagContenido = function(){
			
			var _res = false;
			
			try{
			
				if (tDC[iObj.get('items')]) {
					
					_res = tDC[iObj.get('items')];
					
				}
				
				return _res;
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
		
	 	
    /**
	   * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	   * @author Gonzalo Arenas Flores <garenas@siigsa.cl>
   	 * @since 13-06-2008
	   * @version 1.0.1
	   * 
	   * Debug para JS
	   * 
	   * @param string $pag		:	Pagina de donde se rescataran los datos
	   * @param string $param	:	Parametros necesarios
	   * @param string $_cont	:	mensaje como html
	   * 
	   */
		this.debug = function(pag,param,_cont){
			
			try{
			
				this.crearDivisor('DEBUG JS');
				this.setContenido(pag,param,_cont);
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
		

		/**
	   * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	   * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
 	   * @since 06-06-2008
	   * @version 1.0.1
	   * 
	   * Establece un valor determinado a una variable (propiedad) de la clase
	   * 
	   * @param string $propiedad Nombre de la Propiedad
	   * @param mixed Valor de la Propiedad
	   * 
	   */
		this.set = function (propiedad, valor){
			
			try{
				
				eval('this.' + propiedad + ' = "' + valor + '"');
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}
	 	

	  /**
	   * @link http://www.siigsa.cl
   	 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
 	   * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
   	 * @since 06-06-2008
	   * @version 1.0.1
	   * 
	   * Retorna el valor actual de una variable (propiedad) de la clase
	   * 
	   * @param string $propiedad Nombre de la Propiedad
	   * 
	   * @return mixed Valor de la Propiedad
	   * 
	   */
		this.get = function (propiedad){
			
			try{
				
				return eval('this.' + propiedad);
				
			}catch(e){
				
				alert(e.name + " - " + e.message);
				
			}
			
		}

		
		/**
		 * @link http://www.siigsa.cl
 		 * @copyright ŠSIIGSA - Registro Propiedad Intelectual Nē 172.560 - Derechos Reservados
		 * @author Patricio Cifuentes Ithal <pcifuentes@siigsa.cl>
		 * @since 16-12-2008
		 * @version 1.0.1
		 *
		 * Funcion que asigna eventos a objetos
		 * 
		 */
		this.agregarEvento = function (obj, event_id, func){
			
			if (obj.addEventListener){
				obj.addEventListener(event_id, func, false)
			}else if(obj.attachEvent){
				event_id = 'on'+event_id;
				obj.attachEvent(event_id, func)
			}else{
				obj[event_id] = func; 
			}
			
		}

		this.agregarEvento(document.body,'mousemove',this.setEventoMouse);
				
	}