
            function OnNodeClick(idRegion, isRoot)
            {
                var estado = document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaUbicacion1_DDLEstadoTransaccion').value;  
                CtrlHPBusquedaUbicacion.ObtenerIdTransaccionesRegion(idRegion, estado, [100,105,52,20,64,18,106,44,24,93,53,72,5,1,116,37,80,21,9,27,3,12,110,29,6,8,15,43,25,49,19,10,2,71,7,103,16,13,28,42,98,17,4,11,120,26,101], isRoot, PostOnNodeClick);
                CtrlHPBusquedaUbicacion.ObtenerBreadCrumb(idRegion, isRoot, SetBreadCrumb);
            }

            function PostOnNodeClick(resultado)
            {
                ListarTransacciones(resultado.value);
            }
            
            function ListarTransacciones(idTransacciones)
            {
                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').innerHTML='<table style=\'width:100%\'><tr><td style=\'height:120\'></td></tr><tr><td align=\'center\'><img src=\'img/loader_simple.gif\'></td></tr><tr><td align=\'center\' style=\'font-size: 8pt; font-family: Arial\'>Por favor espere...</td></tr></table>'
                CtrlHPListaDesarrollos.Draw(idTransacciones, PostDraw);
            }

            function PostDraw(resultado)
            {
                var div=document.createElement('div');                            
                div.innerHTML=resultado.value;

                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').innerHTML='';                            
                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').appendChild(div);                
            }
            
            function ListarTransaccionesAleatorias()
            {
                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').innerHTML='<table style=\'width:100%\'><tr><td style=\'height:120\'></td></tr><tr><td align=\'center\'><img src=\'img/loader_simple.gif\'></td></tr><tr><td align=\'center\' style=\'font-size: 8pt; font-family: Arial\'>Por favor espere...</td></tr></table>'
                CtrlHPListaDesarrollos.DrawAleatorios([100,105,52,20,64,18,106,44,24,93,53,72,5,1,116,37,80,21,9,27,3,12,110,29,6,8,15,43,25,49,19,10,2,71,7,103,16,13,28,42,98,17,4,11,120,26,101], PostDrawAleatorias);
                SetBreadCrumb('Algunos de nuestros inmuebles');
            }

            function PostDrawAleatorias(resultado)
            {
                var div=document.createElement('div');                            
                div.innerHTML=resultado.value;

                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').innerHTML='';                            
                document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPListaDesarrollos1_PanelContent').appendChild(div);   
            }
            
            function SetBreadCrumb(texto)
            {                
                if(texto.value == undefined)
                    document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_LMostrando').innerText=texto;
                else
                    document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_LMostrando').innerText=texto.value;                
            }            
            
            function CriteriosChanged()
            {
                if(document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_rbNombre').checked)
                    controls.BusquedaSemantica.getBusquedaSemantica('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_BSProyectos').parametros.setValue('tipo','N');                
                else if(document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_rbUbicacion').checked)
                    controls.BusquedaSemantica.getBusquedaSemantica('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_BSProyectos').parametros.setValue('tipo','U');  
                else if(document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_rbCodigo').checked)
                    controls.BusquedaSemantica.getBusquedaSemantica('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaDirecta1_BSProyectos').parametros.setValue('tipo','C'); 
            }
            
            function OficinaChanged()
            {
                var combo=document.getElementById('ControlPrincipal1_MyContentControlASPascx_ctrlhomeprimario_ctrlhomeprimario_ascx_CtrlHPBusquedaOficina1_DDLOficinas');
                var oficina =combo.value;  
                CtrlHPBusquedaOficina.ObtenerIdTransaccionesOficinas(oficina, PostOficinaChanged);  
                SetBreadCrumb('ofc. '+combo.options[combo.selectedIndex].text);
            }

            function PostOficinaChanged(resultado)
            {
                ListarTransacciones(resultado.value);
            }
            
            function CenterX()
            {
                var scrollXT=0;
                var clientWidth=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollXT = window.pageXOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollXT = document.body.scrollLeft;
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollXT = document.body.scrollLeft; 
	            } 
	            if (document.body.clientHeight){
	                clientWidth=document.body.clientWidth;
	            }
	            else if (window.innerHeight){
	                clientWidth=window.innerWidth;
	            }
                return (scrollXT)+clientWidth/2;
            }
            
            function CenterY()
            {
                var scrollYT=0;
                var clientHeight=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollYT = window.pageYOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollYT = document.documentElement.scrollTop; 
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollYT = document.body.scrollTop; 
	            } 
	            if (document.body.clientHeight){
	                clientHeight=document.body.clientHeight;
	            }
	            else if (window.innerHeight){
	                clientHeight=window.innerHeight;
	            }
                return (scrollYT)+clientHeight/2;
            }
            
            function ClientTop()
            {
                var scrollYT=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollYT = window.pageYOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollYT = document.documentElement.scrollTop; 
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollYT = document.body.scrollTop; 
	            } 
                return (scrollYT);
            }
            
            function ClientLeft()
            {
                var scrollXT=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollXT = window.pageXOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollXT = document.body.scrollLeft;
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollXT = document.body.scrollLeft; 
	            } 
                return (scrollXT);
            }
            
            function ClientRight()
            {
                var scrollXT=0;
                var clientWidth=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollXT = window.pageXOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollXT = document.body.scrollLeft;
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollXT = document.body.scrollLeft; 
	            } 
	            if (document.body.clientHeight){
	                clientWidth=document.body.clientWidth;
	            }
	            else if (window.innerHeight){
	                clientWidth=window.innerWidth;
	            }
                return (scrollXT)+clientWidth;
            }
            
            function ClientBottom()
            {
                var scrollYT=0;
                var clientHeight=0;
                if (typeof(window.pageYOffset) == 'number') { 
		            scrollYT = window.pageYOffset; 
	            } 
	            else if (document.body && document.documentElement && document.documentElement.scrollTop) { 
		            scrollYT = document.documentElement.scrollTop; 
	            }
	            else if (document.body && typeof(document.body.scrollTop) == 'number') { 
		            scrollYT = document.body.scrollTop; 
	            } 
	            if (document.body.clientHeight){
	                clientHeight=document.body.clientHeight;
	            }
	            else if (window.innerHeight){
	                clientHeight=window.innerHeight;
	            }
                return (scrollYT)+clientHeight;
            }
            
            var msgBoxZIndex=8000;
            function MessageBox(id,msg,titulo,icon,navigateTo,hideBack)
            {
                myId=id;
                var iframe=document.createElement('iframe');
                var table=document.createElement('table');
                var tableTapa=document.createElement('table');

                var rowSup=table.insertRow(0);
                var cellText=rowSup.insertCell(0);
                var cellIcon=rowSup.insertCell(0);
                var rowInf = table.insertRow(table.rows.length);
                var cellBoton=rowInf.insertCell(0);

                rowTableTapa =tableTapa.insertRow(0).insertCell(0);

                table.style.position='absolute';

                table.style.left=iframe.style.left=0;
                table.style.top=iframe.style.top=0;
                table.style.width=400;
                table.style.height=130;
                table.style.zIndex=(msgBoxZIndex+=3);
                table.style.backgroundColor='white';

                table.style.borderWidth='1px';
                table.style.borderStyle='solid';
                table.style.borderColor='gainsboro';

                table.style.fontFamily='Arial';
                table.style.fontSize='12px';
                table.id=myId;
                table.navigateTo=navigateTo;
                table.iFrame=iframe;
                table.tableTapa=tableTapa;

                tableTapa.style.position='absolute';
                tableTapa.style.zIndex=table.style.zIndex-1; 
                if (!hideBack)
                    tableTapa.style.backgroundImage='url(img/transparent.gif)';
                else
                    tableTapa.style.backgroundColor='white';

                iframe.style.position='absolute';
                iframe.style.zIndex=table.style.zIndex-2; 
                iframe.style.filter='alpha(opacity=1)';             

                cellBoton.colSpan=2;
                cellBoton.align='center';

                var img=document.createElement('img');
                img.src=icon;
                cellIcon.appendChild(img);
                
                var spanTitle=document.createElement('span');
                spanTitle.style.fontWeight='bold';
                spanTitle.innerHTML=titulo+'<br>';
                cellText.appendChild(spanTitle);

                var spanText=document.createElement('span');
                spanText.innerHTML=msg;
                cellText.appendChild(spanText);
                cellText.style.width='100%';

                var btnAceptar=document.createElement('input');
                btnAceptar.type='button';
                btnAceptar.value='Aceptar';
                btnAceptar.id='Aceptar';
                btnAceptar.msgBoxTable=table;
                btnAceptar.onclick=function()
                {
                    var table=this.msgBoxTable;
                    if (table.navigateTo!=null && table.navigateTo!='')
                        window.location=table.navigateTo;
                    else
                    {
                        table.tableTapa.style.display='none';
                        table.iFrame.style.display='none';
                        table.style.display='none';
                    }
                }
                cellBoton.appendChild(btnAceptar);

                document.body.insertBefore(table, document.body.firstChild);
                document.body.insertBefore(iframe, table);
                document.body.insertBefore(tableTapa, iframe);
                centerMessageBox(id);
         
                document.getElementById('Aceptar').focus();
                var messageBoxShowing=true;
 
                return myId;
            }
            
            function showSelects(value)
            {
	            var oSelects=document.getElementsByTagName('select');
	            for(var i=0;i<oSelects.length;i++)
		            oSelects[i].style.display=(value?'':'none');
            }

            function centerMessageBox(id)
            {
                var msgBox=document.getElementById(id);
                msgBox.style.left=CenterX()-msgBox.offsetWidth/2;
                msgBox.style.top=CenterY()-msgBox.offsetHeight/2;
                msgBox.tableTapa.style.top=msgBox.iFrame.style.top=ClientTop();
                msgBox.tableTapa.style.left=msgBox.iFrame.style.left=ClientLeft();
                msgBox.tableTapa.style.width=msgBox.iFrame.style.width=ClientRight() - ClientLeft();
                msgBox.tableTapa.style.height=msgBox.iFrame.style.height=ClientBottom() - ClientTop();
            }

            