﻿      dojo.require("esri.map");
      
      dojo.require("dojo.parser");
      dojo.require("dijit.form.Button");
        
      dojo.require("esri.tasks.gp");
      dojo.require("dijit.TitlePane");
      dojo.require("dijit.ProgressBar");
      dojo.require("dijit.Dialog");
			
      dojo.require("esri.toolbars.navigation");		
      dojo.require("esri.tasks.query");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("dijit.layout.TabContainer");
      dojo.require("dijit.form.FilteringSelect");
        
            
    dojo.require("dojox.grid.Grid");
    dojo.require("dojox.grid._data.model");
    dojo.require("esri.tasks.find");
    
    
    dojo.require("esri.toolbars.draw");
 dojo.require("esri.utils");
        
   dojo.require("dijit.layout.BorderContainer");
   
    dojo.require("esri.tasks.geometry");
    dojo.require("esri.geometry");

   dojo.require("dijit.form.CheckBox");
    
    
     dojo.require("dijit.Toolbar");  
     
   var activeTab, activeLayer;
   activeTab = '';
   activeLayer = 'layers';
   
   var  toolbar, geomTask;
    var queryTask,query, queryCircle;
   //var featureSet;
    var queryTaskSurroundingParcels, querySurroundingParcels;
    
      var queryTaskSurroundingParcels, querySurroundingParcels;
      var queryTaskHazardousParcel, queryHazardousParcel;
    
    var infoTemplate;
    var gsvc;
    var qtask ;
    var polygonGraphic = null;
    var queryGraphic = null;
    var findTask, findParams;
    var bufferDistanceG;
    var BufferGraphic;
    var BufferYesNo,PolygonYesNo;
    var navToolbar,  IdentityYesNo;
      var whichTool;
      var myMap,featureSet, locator, EnterpriseZones, SenateMap;
      
      var curFeature,featureSet;

      var queryTask, query;
      var mapChangeNot;
      
      var ActiveLayerID,ActiveLayerIndex,ActiveLayerName;
      
      var layer,identifyTask;
      var visible = [];
      var layer2results, layer3results, highlightSymbol,symbol;
      var LayerNames=[];
      var LayerIDs=[];
var olayer =[];
      var view,s1,s2,strLayerName,iSearchFieldID;
    
     var CentralPoint,L;
     var TestI=0;        
      var  putData=[];
      var geocodeClosest="No";
  // var aLayerNames=[];      
   var dataForGridClosest = [];              
   var smallX,bigX,smallY,bigY;
   
   var BufferOrAddressSearch="AddressSearch";
   var arrayIDs=[];
  var centerPt=[];
  var PGeopin=[];
  var sGeopin=0;
  var feature,j;  
  
  var ArrayClosestX=new Array();
var ArrayClosestY=new Array();
var ArrayClosestXg=new Array();
var ArrayClosestYg=new Array();

var ArrayClosestG=new Array();
var ArrayClosestN=new Array();
 var ArrayClosestA=new Array();
  
  var layers1 = [];
  var streetMap, tiledMapServiceLayer,iAddressOrOwnerOrTax;

  var sAddresses=[];
  var sLat=[];
  var sLon=[];

  var sNeighor=[];
  var sCouncil=[];
  var aGeopin = new Array();  

  var iAllorAddress,sAddress;   
  var ToolIndicator,graphic1,sGeopinAddress;

      function init() {
     
     	ActiveLayerIndex=-1;
     	ActiveLayerID=-1;
           
         iAddressOrOwnerOrTax="none";
       
  ToolIndicator="none";
   myMap = new esri.Map("myMapDiv", { extent: new esri.geometry.Extent(-90.239387,29.864330,-89.726552,30.179242,new esri.SpatialReference({wkid:4326}))});
     
  
        tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");
          
         myMap.addLayer(tiledMapServiceLayer);
 //        myMap.enableScrollWheelZoom();
  
 

       
  gsvc = new esri.tasks.GeometryService("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
  //gsvc = new esri.tasks.GeometryService("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
   
 s1="";   
  query = new esri.tasks.Query();  
//  query.outFields = ["SITUS_DIR","OWNER_LAST","GEOPIN","GIS_ADDRESS"];
   
      query.outFields = ["SITUS_NUMBER","SITUS_DIR","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
    
 layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer");
 
 identifyTask = new esri.tasks.IdentifyTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer");
    
locator = new esri.tasks.Locator("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer");
showResultsClosest();

 
 myMap.addLayer(layer);



dojo.connect(myMap, "onZoomEnd", getzl);

document.getElementById("infoDetails").style.display = "none";

dojo.connect(myMap, "onZoom", initMap);

document.getElementById("TaxBillNumberPane").style.display = "none";

document.getElementById("AddressSearchPane").style.display = "block";

document.getElementById("OwnerNameSearchPane").style.display = "none";

//document.getElementById("property_list").style.display = "block";

//document.getElementById("property_list").style.height = "";


        
  if (layer.loaded) {
            buildLayerList(layer);
        }
        else {
          dojo.connect(layer, "onLoad", buildLayerList);
        }

//myMap.showZoomSlider();

//myMap.enableRubberBandZoom();
mapChangeNot="Not";

IdentityYesNo="No";
whichTool="None";

  navToolbar = new esri.toolbars.Navigation(myMap);
  //dojo.connect(myMap, "onMouseMove", showCoordinateshrefProperty);
   
  toolbar = new esri.toolbars.Draw(myMap);  		
  esriConfig.defaults.io.proxyUrl = "proxy.ashx";
  esriConfig.defaults.io.alwaysUseProxy = false;      


showPanelGrid('property_list');

//document.getElementById("hrefProperty").style.display = "block";

document.getElementById("hrefProperty").style.color = "#CC6600";
   

   }


function cmdTool(aa,string)
{
//Click it
AllNoActive();
document.getElementById(string).style.borderColor = "#CC6600";
document.body.style.cursor='default';
ToolIndicator=string;


 switch (string) {
            case "ZoomIn":
         navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);          break;
            case "ZoomOut":
          navToolbar.activate(esri.toolbars.Navigation.ZOOM_OUT);       break;
            case "Previous":
         navToolbar.zoomToPrevExtent();        break;
          case "Next":
         navToolbar.zoomToNextExtent();        break;
            case "Pan":
        
        navToolbar.activate(esri.toolbars.Navigation.PAN);            break;
         case "Identity":
         cmdIdentity(); break;
       
           case "Polygon":
         Polygon_Start(); break;
         
           case "Square":
         Square_Start(); break;
         
           case "Erase":
         cmdErase(); break;
          case "Refresh":
         cmdRefresh(); break;
          }


}

function AllNoActive()
{
document.getElementById("ZoomIn").style.borderColor = "#7391A9";
document.getElementById("ZoomOut").style.borderColor = "#7391A9";


document.getElementById("Previous").style.borderColor = "#7391A9";
document.getElementById("Next").style.borderColor = "#7391A9";

document.getElementById("Pan").style.borderColor = "#7391A9";
document.getElementById("Identity").style.borderColor = "#7391A9";

document.getElementById("Polygon").style.borderColor = "#7391A9";
document.getElementById("Square").style.borderColor = "#7391A9";

document.getElementById("Erase").style.borderColor = "#7391A9";
document.getElementById("Refresh").style.borderColor = "#7391A9";

}
function cmdToolMover(aa,s){

document.getElementById(s).style.borderColor = "Yellow";

if (s==ToolIndicator){
 document.body.style.cursor='default';}
 else
 {
  document.body.style.cursor='hand';
 }
}

function toolmout(aa,s) {
document.body.style.cursor='default';
if (s==ToolIndicator){
AllNoActive();
document.getElementById(s).style.borderColor = "#CC6600";

}
else {
document.getElementById(s).style.borderColor = "#7391A9";
}



document.body.style.cursor = 'default';
}


function onWait()
{
  document.body.style.cursor='wait';   
}
function getzl(extent, zoomFactor, anchor, level){
     if ((level == 15) || (level == 14))
     {

    tiledMapServiceLayer.hide();
    }
    else
    {
   tiledMapServiceLayer.show();
   
    }
   }


function Polygon_Start(){  

       ActiveLayerID=8;
   
 document.body.style.cursor='default';  

      iAllorAddress="4";
   
        whichTool="Polygon";      
        myMap.graphics.clear();
        myMap.infoWindow.hide();
                
      
        var s0;
           
         var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
         
         var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
          
           
        toolbar.deactivate(esri.toolbars.Draw.EXTENT);       
       toolbar.activate(esri.toolbars.Draw.POLYGON);
                	     
       var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
	       
       var t2=t1+"/"+ActiveLayerID;

       qtask = new esri.tasks.QueryTask(t2);
       
       //queryTask = new esri.tasks.QueryTask(t2);
   
       showPanelGrid("list_list");
    
       dojo.connect(toolbar, "onDrawEnd", addToMap);
           
       dojo.connect(qtask, "onComplete", function(fset) {  
        var resultFeatures = fset.features;
    var  graphic = resultFeatures[0];
        //var resultFeatures = fset.features;               
          
            graphic.setSymbol(symbol);
            var fExtent = graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
     var xx=centerP.x;
     var yy=centerP.y;
     smallX=xx;
     bigX=xx;
     smallY=yy;
     bigY=yy;
     
     
   toolbar.deactivate(esri.toolbars.Draw.POLYGON);   
       
       
          
        var s1="";
        var str1,str2,str3,str4,ss1,ss2,ss3,ss4,ss5,ss6; 
        ss1="";
        ss2="";
        ss3="";
        ss4="";
        ss5="";
        ss6="";
     
      var s,j1;
  
      form1.HiddenSpatialGeopin.value="";
               
      for (var i=0, il=resultFeatures.length; i<il; i++) {
         
        
     var  graphic = resultFeatures[i];
                      
        var featureAttributes = graphic.attributes;
     
        j1=0;
     
        
            graphic.setSymbol(symbol);
            var fExtent = graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
     var xx=centerP.x;
     var yy=centerP.y;
     
       if (smallX>=xx) {
                smallX=xx;
                        }  
             
                  if (bigX<xx) {
        bigX=xx;
                }  
                
                              
        if (smallY>=yy) {
        smallY=yy; 
           
                }  
                 
                  if (bigY < yy){
               bigY = yy;
                   
         }  
     
     
            myMap.graphics.add(graphic);     
     
          if (graphic.attributes['GEOPIN']=='Null'|| graphic.attributes['GEOPIN']==undefined ) {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
       
         form1.HiddenSpatialGeopin.value=form1.HiddenSpatialGeopin.value+"/"+sGeopin;
            }
              var s1="G"+form1.HiddenSpatialGeopin.value;
var centerX=smallX+(bigX-smallX)/2;
var centerY=smallY+(bigY-smallY)/2;

var pp=new esri.geometry.Point(centerX,centerY, new esri.SpatialReference({ wkid: 4326 }));
  myMap.centerAt(pp);

CallServer(s1, "");  


          });        
          
 
 document.getElementById("grid").style.display = "none";
   
 document.getElementById("grid").style.height = '0px';
   
 document.getElementById("iAll").style.display = "block";
   
 //document.getElementById("iAll").style.height = '0px';
   
      }
 


function Square_Start(){  

       ActiveLayerID=8;
   
 //document.body.style.cursor='default';  

      iAllorAddress="4";
   
        whichTool="Square";
        
        myMap.graphics.clear();
        myMap.infoWindow.hide();
        
      
        var s0;
           
         var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
         
         var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
          
           
        toolbar.deactivate(esri.toolbars.Draw.POLYGON);       
              toolbar.activate(esri.toolbars.Draw.EXTENT);
  
                 	     
	       var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
	       
       var t2=t1+"/"+ActiveLayerID;

       qtask = new esri.tasks.QueryTask(t2);
       
       //queryTask = new esri.tasks.QueryTask(t2);
   
       showPanelGrid("list_list");
    
       dojo.connect(toolbar, "onDrawEnd", addToMap);
           
       dojo.connect(qtask, "onComplete", function(fset) {  
       
     
//   toolbar.deactivate(esri.toolbars.Draw.EXTENT);     
//  
//        var resultFeatures = fset.features;
//          
//        var s1="";
//        var str1,str2,str3,str4,ss1,ss2,ss3,ss4,ss5,ss6; 
//        ss1="";
//        ss2="";
//        ss3="";
//        ss4="";
//        ss5="";
//        ss6="";
//     
//      var s,j1;
//          
//           
//  
//        form1.HiddenSpatialGeopin.value="";
               
//      for (var i=0, il=resultFeatures.length; i<il; i++) {
//         
//        
//     var  graphic = resultFeatures[i];
//                      
//        var featureAttributes = graphic.attributes;
//     
//        j1=0;
//     
//        
//            graphic.setSymbol(symbol);
//     
//            myMap.graphics.add(graphic);     
//     
//          if (graphic.attributes['GEOPIN']=='Null'|| graphic.attributes['GEOPIN']==undefined ) {sGeopin="";}
//          else {sGeopin=graphic.attributes["GEOPIN"];}
//       
//         form1.HiddenSpatialGeopin.value=form1.HiddenSpatialGeopin.value+"/"+sGeopin;
//            }
//              var s1="G"+form1.HiddenSpatialGeopin.value;
    var resultFeatures = fset.features;
    var  graphic = resultFeatures[0];
        //var resultFeatures = fset.features;               
          
            graphic.setSymbol(symbol);
            var fExtent = graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
     var xx=centerP.x;
     var yy=centerP.y;
     smallX=xx;
     bigX=xx;
     smallY=yy;
     bigY=yy;
     
     
   toolbar.deactivate(esri.toolbars.Draw.POLYGON);   
       
       
          
        var s1="";
        var str1,str2,str3,str4,ss1,ss2,ss3,ss4,ss5,ss6; 
        ss1="";
        ss2="";
        ss3="";
        ss4="";
        ss5="";
        ss6="";
     
      var s,j1;
  
      form1.HiddenSpatialGeopin.value="";
               
      for (var i=0, il=resultFeatures.length; i<il; i++) {
         
        
     var  graphic = resultFeatures[i];
                      
        var featureAttributes = graphic.attributes;
     
        j1=0;
     
        
            graphic.setSymbol(symbol);
            var fExtent = graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
     var xx=centerP.x;
     var yy=centerP.y;
     
       if (smallX>=xx) {
                smallX=xx;
                        }  
             
                  if (bigX<xx) {
        bigX=xx;
                }  
                
                              
        if (smallY>=yy) {
        smallY=yy; 
           
                }  
                 
                  if (bigY < yy){
               bigY = yy;
                   
         }  
     
     
            myMap.graphics.add(graphic);     
     
          if (graphic.attributes['GEOPIN']=='Null'|| graphic.attributes['GEOPIN']==undefined ) {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
       
         form1.HiddenSpatialGeopin.value=form1.HiddenSpatialGeopin.value+"/"+sGeopin;
            }
              var s1="G"+form1.HiddenSpatialGeopin.value;
var centerX=smallX+(bigX-smallX)/2;
var centerY=smallY+(bigY-smallY)/2;

var pp=new esri.geometry.Point(centerX,centerY, new esri.SpatialReference({ wkid: 4326 }));
  myMap.centerAt(pp);

CallServer(s1, "");  


          });        
          
 
 document.getElementById("grid").style.display = "none";
   
 document.getElementById("grid").style.height = '0px';
   
 document.getElementById("iAll").style.display = "block";
   
 //document.getElementById("iAll").style.height = '0px';
   
 
      }
 






function cmdPolygon(){  

       ActiveLayerID=8;
       
       iAllorAddress="4";
             
 document.body.style.cursor='wait';  
 
        whichTool="Polygon";
        myMap.graphics.clear();
        myMap.infoWindow.hide();
                
      
        var s0;
           
         var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
         
         var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
          
           
              //toolbar.activate(esri.toolbars.Draw.EXTENT);
      toolbar.deactivate(esri.toolbars.Draw.EXTENT);
     toolbar.activate(esri.toolbars.Draw.POLYGON);
                 	     
	       var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
	       
       var t2=t1+"/"+ActiveLayerID;

       qtask = new esri.tasks.QueryTask(t2);
       
       //queryTask = new esri.tasks.QueryTask(t2);
   
  
        dojo.connect(toolbar, "onDrawEnd", addToMap);
           
       dojo.connect(qtask, "onComplete", function(fset) {  
       
         toggleProgressBar(); 
         
   document.getElementById('list').style.display = 'none';

document.getElementById("details").style.display = 'none';
document.getElementById("neighbor").style.display = 'none';
  
   var Titles=[];             
   document.getElementById("iAll").style.display = "none";
   
   document.getElementById("iAll").style.height = '0px';
   
   document.getElementById("property_list").style.display = "block";
   
   document.getElementById("property_list").style.height = '30px'
 
  document.getElementById("AddressSearchPane").style.display = "none"; 

  document.getElementById("grid").style.display = "block";
  //document.getElementById("grid").style.height = '300px';
  document.getElementById("grid").style.width = '694px';
    
  
          var resultFeatures = fset.features;

        var dataForGrid = [];   
        
        
        var s1="";
        var str1,str2,str3,str4,ss1,ss2,ss3,ss4,ss5,ss6; 
        ss1="";
        ss2="";
        ss3="";
        ss4="";
        ss5="";
        ss6="";
     
      var s,j1;
          
            
     var view = {		  
            cells: [
              [{name: 'Property Address', width: "25%"},{name: 'Owner Name', width: "20%"}, {name: 'Tax Bill', width: "15%"},{name: 'Council District', width: "20%"},{name: 'Neighborhood', width: "20%"}]
            ]
          };       
          var layout = [ view ];
          
           gridWidget.setStructure(layout);
 
     showPanelGrid("list_list");
        form1.HiddenSpatialGeopin.value="";
               
      for (var i=0, il=resultFeatures.length; i<il; i++) {
             
        var  graphic = resultFeatures[i];
                      
        var featureAttributes = graphic.attributes;
     
        j1=0;
     
        
            graphic.setSymbol(symbol);
     
            myMap.graphics.add(graphic);
     
     var sAddress0="";
     var st1="";
     var st2="";
     var st3="";
     var sTaxBill="";
     var sCouncilDist="";
     var sNeiborhood;
     
//         if (graphic.attributes['GIS_ADDRESS']=='Null'|| graphic.attributes['GIS_ADDRESS']==undefined ) { sAddress0="";}
//          else {sAddress0=graphic.attributes["GIS_ADDRESS"];}
//        
  if (graphic.attributes['SITUS_NUMBER']=='Null'|| graphic.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=graphic.attributes['SITUS_NUMBER']}
    
        
          if (graphic.attributes['SITUS_DIR']=='Null' || graphic.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=graphic.attributes['SITUS_DIR'];}
             
         if (graphic.attributes['SITUS_STREET']=='Null' || graphic.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=graphic.attributes['SITUS_STREET'];}
          
           if (graphic.attributes['SITUS_TYPE']=='Null' || graphic.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=graphic.attributes['SITUS_TYPE'];}
          
            sAddress0= st1+" "+st2+" "+st3+" "+st4;
           sAddress=sAddress0;
      
       if (graphic.attributes['OWNER_FIRST']=='Null'|| graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=graphic.attributes['OWNER_FIRST']}
                 
                 
         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=graphic.attributes['OWNER_MIDNAME'];}
          
         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=graphic.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (graphic.attributes['TAX_BILL']=='Null' || graphic.attributes['TAX_BILL']==undefined) {sTaxBill="";}
          else {sTaxBill=graphic.attributes['TAX_BILL']}
             
                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null' || graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']==undefined) {sCouncilDist="";}
          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
        
             if (graphic.attributes['GNOCDC_LAB']=='Null'|| graphic.attributes['GNOCDC_LAB']==undefined ) {sNeiborhood="";}
          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
          
          if (graphic.attributes['GEOPIN']=='Null'|| graphic.attributes['GEOPIN']==undefined ) {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
       
         form1.HiddenSpatialGeopin.value=form1.HiddenSpatialGeopin.value+"/"+sGeopin;
             
            var attValues = [sAddress0,sOwnerName,sTaxBill,sCouncilDist,sNeiborhood];
          
     
            dataForGrid.push(attValues);                  
                       
                        }
                        
toggleProgressBar(); 
            
          var model = new dojox.grid.data.Table(null, dataForGrid);                   
             gridWidget.setModel(model);  
     
     
iSearchFieldID="TAX_BILL";
j=999;
       // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOver", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
        
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                      selectedGraphic.setSymbol(highlightSymbol);
       
 feature=selectedGraphic;
        myMap.infoWindow.resize(340, 160);
         
       var s="";
var sAddress0;
  
//       if (feature.attributes['GIS_ADDRESS']=='Null'||feature.attributes['GIS_ADDRESS']==undefined) {sAddress0="";}
//          else {sAddress0=feature.attributes['GIS_ADDRESS']}
//  

  if (feature.attributes['SITUS_NUMBER']=='Null'|| feature.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=feature.attributes['SITUS_NUMBER']}
    


        if (feature.attributes['SITUS_DIR']=='Null' || feature.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=feature.attributes['SITUS_DIR'];}
             
         if (feature.attributes['SITUS_STREET']=='Null' || feature.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=feature.attributes['SITUS_STREET'];}
          
           if (feature.attributes['SITUS_TYPE']=='Null' || feature.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=feature.attributes['SITUS_TYPE'];}
          
            sAddress0= st1+" "+st2+" "+st3+" "+st4;
           
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
          sGeopinAddress=sGeopin+"/"+sAddress0;
           sAddress=sAddress0;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress0;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
           
            var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
      
           
              
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	                                
       
                return;
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOut", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes[ iSearchFieldID] == parcel) {
                selectedGraphic.setSymbol(symbol);
                return
              }
            }
          });               


          // Enable info window on hover
          myMap.graphics.enableMouseEvents();
          
         
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
            // This "if" ensures the buffer graphic won't try to show an info window
            
            if(evt.graphic.attributes != undefined){ 
                         
      //myMap.infoWindow.resize(310, 310);
  	      evt.graphic.setSymbol(highlightSymbol);
          myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
            var featureAttributes = evt.graphic.attributes;
            
            feature=evt.graphic;
 var i=0;
 var s="";
  //   s = s + "<tr><td align='center' style='background-color: rgb(185,220,255)'>" + att + "</td><td>" + featureAttributes[att] + "</td></tr>";
      
//       if (featureAttributes['GIS_ADDRESS']=='Null'|| featureAttributes['GIS_ADDRESS']==undefined ) { sAddress0="";}
//          else {sAddress0=featureAttributes["GIS_ADDRESS"];}
//        
        
  if (featureAttributes['SITUS_NUMBER']=='Null'|| featureAttributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=featureAttributes['SITUS_NUMBER']}
    


        
          if (featureAttributes['SITUS_DIR']=='Null' || featureAttributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=featureAttributes['SITUS_DIR'];}
             
         if (featureAttributes['SITUS_STREET']=='Null' || featureAttributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=featureAttributes['SITUS_STREET'];}
          
           if (featureAttributes['SITUS_TYPE']=='Null' || featureAttributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=featureAttributes['SITUS_TYPE'];}
          
            sAddress0= st1+" "+st2+" "+st3+" "+st4;
           
        
      
       if (featureAttributes['OWNER_FIRST']=='Null'|| featureAttributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=featureAttributes['OWNER_FIRST']}
                 
                 
         if (featureAttributes['OWNER_MIDNAME']=='Null'||featureAttributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=featureAttributes['OWNER_MIDNAME'];}
          
         if (featureAttributes['OWNER_LAST']=='Null'||featureAttributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=featureAttributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (featureAttributes['TAX_BILL']=='Null' || featureAttributes['TAX_BILL']==undefined) {sTaxBill="";}
          else {sTaxBill=featureAttributes['TAX_BILL']}
             
                if (featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null' || featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']==undefined) {sCouncilDist="";}
          else {sCouncilDist=featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
        
             if (featureAttributes['GNOCDC_LAB']=='Null'|| featureAttributes['GNOCDC_LAB']==undefined ) {sNeiborhood="";}
          else {sNeiborhood=featureAttributes["GNOCDC_LAB"];}
 
                if (featureAttributes['GEOPIN']=='Null' || featureAttributes['GEOPIN']==undefined) {var sGeopin="";}
          else {sGeopin=featureAttributes['GEOPIN']}
          
 form1.HiddenGeopinDetail.value=sGeopin;
 
 sGeopinAddress=sGeopin+"/"+sAddress0;
 
  sAddress=sAddress0;
 
    var s =  "<tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>" + sAddress0 + "</td></tr>";
      s =s+  "<tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>" + sOwnerName + "</td></tr>";
      s =s+  "<tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>" + sTaxBill + "</td></tr>";
   
      s =s+  "<tr><td align='center' style='background-color: rgb(185,220,255)'>Council District</td><td>" + sCouncilDist + "</td></tr>";
      s =s+  "<tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>" + sNeiborhood + "</td></tr>";
   
         
         var s1="<tr  style =' font-family:arial; font-size:12; font-weight:bold; text-align:center;  cell-padding:10px'>";
         
           
          var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
      
         
         var s0="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'>"
         
         s=s0+ s+ s1+s2+s3;
         
         
         i=7*14+80;
        
        myMap.infoWindow.resize(300, i);
      	myMap.infoWindow.setTitle("Layer Name:"+ActiveLayerName).setContent(s);
          	
        myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
 
                 }
         
                           
  	      });
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){
      //myMap.infoWindow.hide();
        evt.graphic.setSymbol(symbol);
         }
       });    
   
      toggleProgressBar();   
      toolbar.deactivate(esri.toolbars.Draw.POLYGON);
       });
 
    
 document.body.style.cursor='default';
 //dojo.connect(gridWidget, "onRowClick", rchandler);
      }
 
 
 
  
 

 
  function executeQueryTask(evt) {
   toggleProgressBar(); 
  if (whichTool=="Identity") {
  
    ActiveLayerID=8;
      iAllorAddress="4";
       document.body.style.cursor='wait';
       
		myMap.infoWindow.hide();
  			myMap.graphics.clear();
  			featureSet = null;
  	  		query.where = null;
  			query.geometry = evt.mapPoint;
        identifyParams = new esri.tasks.IdentifyParameters();
        identifyParams.tolerance = 1;
        identifyParams.returnGeometry = true;
        identifyParams.layerIds = [ActiveLayerID];
        identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;

  	  identifyParams.geometry = evt.mapPoint;
      identifyParams.mapExtent = myMap.extent;
   identifyTask.execute(identifyParams, function(idResults) {addToMapSpatial(idResults,evt); });     
	}
   }
        


  function addToMapSpatial(idResults, evt) {
           
 document.body.style.cursor='default';
     if (idResults.length==1) {
   	myMap.graphics.clear();
  	    mapChangeNot="Yes";
        var sParcel;
        var idResult = idResults[0];
        feature=idResult.feature;
        //feature=idResult.feature;
        var featureAttributes = idResult.attributes;
        var s,i,st1,st2,st3,sTaxBill,sCouncilDist,sGeopin,sAddress0;
        i=0;
        s="";
          //var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
          var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
  
       feature.setSymbol(highlightSymbol);
       myMap.infoWindow.resize(340, 160);
           myMap.graphics.add(feature);
             
         
     
                if (featureAttributes['GEOPIN']=='Null'|| featureAttributes['GEOPIN']==undefined ) {sGeopin="";}
          else {sGeopin=featureAttributes["GEOPIN"];}
          form1.HiddenSpatialGeopin.value=sGeopin;
          form1.HiddenGeopinDetail.value=sGeopin;
        var s1="I"+form1.HiddenSpatialGeopin.value;

       CallServer(s1, ""); 
       
        }
        
      }



        function addToMapN(idResults, evt) {
           
 document.body.style.cursor='default';
     if (idResults.length==1) {
   	myMap.graphics.clear();
  	    mapChangeNot="Yes";
        var sParcel;
        var idResult = idResults[0];
        feature=idResult.feature;
        //feature=idResult.feature;
        var featureAttributes = idResult.attributes;
        var s,i,st1,st2,st3,sTaxBill,sCouncilDist,sGeopin,sAddress0;
        i=0;
        s="";
          //var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
          var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
  
       feature.setSymbol(highlightSymbol);
       myMap.infoWindow.resize(340, 160);
           myMap.graphics.add(feature);
                   if (featureAttributes['SITUS_NUMBER']=='Null'|| featureAttributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=featureAttributes['SITUS_NUMBER']}
          
                     
         if (featureAttributes['SITUS_DIR']=='Null' || featureAttributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=featureAttributes['SITUS_DIR'];}
             
         if (featureAttributes['SITUS_STREET']=='Null' || featureAttributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=featureAttributes['SITUS_STREET'];}
          
           if (featureAttributes['SITUS_TYPE']=='Null' || featureAttributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=featureAttributes['SITUS_TYPE'];}
          
           sAddress0= st1+" "+st2+" "+st3+" "+st4;
                 
         
         
       if (featureAttributes['OWNER_FIRST']=='Null'|| featureAttributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=featureAttributes['OWNER_FIRST']}
                 
                 
         if (featureAttributes['OWNER_MIDNAME']=='Null'||featureAttributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=featureAttributes['OWNER_MIDNAME'];}
          
         if (featureAttributes['OWNER_LAST']=='Null'||featureAttributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=featureAttributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (featureAttributes['TAX_BILL']=='Null' || featureAttributes['TAX_BILL']==undefined) {sTaxBill="";}
          else {sTaxBill=featureAttributes['TAX_BILL']}
             
                if (featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null' || featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']==undefined) {sCouncilDist="";}
          else {sCouncilDist=featureAttributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
        
             if (featureAttributes['GNOCDC_LAB']=='Null'|| featureAttributes['GNOCDC_LAB']==undefined ) {sNeiborhood="";}
          else {sNeiborhood=featureAttributes["GNOCDC_LAB"];}
          
                if (featureAttributes['GEOPIN']=='Null'|| featureAttributes['GEOPIN']==undefined ) {sGeopin="";}
          else {sGeopin=featureAttributes["GEOPIN"];}
          
          
//                if (featureAttributes['GIS_ADDRESS']=='Null'|| featureAttributes['GIS_ADDRESS']==undefined ) {sAddress0="";}
//          else {sAddress0=featureAttributes["GIS_ADDRESS"];}
//                           
         j=999;
         form1.HiddenGeopinDetail.value=sGeopin;
         sGeopinAddress=sGeopin+"/"+sAddress0;
          sAddress=sAddress0;
          var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress0;
    
         
        //var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center'  style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress0;
   
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr>";
           
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
       
             s=s+s1+s2+s3;
       
        
            
        dojo.byId("OwnerInfo").innerHTML =s;
           
    
      	myMap.infoWindow.setTitle("Layer Name:"+ActiveLayerName).setContent(s);
   
        myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
        
        
         // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
            // This "if" ensures the buffer graphic won't try to show an info window
            
            if(evt.graphic.attributes != undefined){ 
                         
      
  	      evt.graphic.setSymbol(highlightSymbol);
  	      
  	   feature=evt.graphic;
        myMap.infoWindow.resize(320, 160);
         

     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
       var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
          myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	                   }
         
                           
  	      });
  	  
 
        }
        
      }
        
   
function CloseTab(){
  document.getElementById("mainTabContainer").style.visibility = "hidden";
}
 
  


   function initMap(extent, zoomFactor, anchor, level) {
   var center;

center = extent.getCenter();
        //custom slider labels
        //use layer's scales to display as slider labels
        var labels = [];
        var lods = tiledMapServiceLayer.tileInfo.lods;
        for (var i=0, il=lods.length; i<il; i++) {

          labels[i] = lods[i].scale;
        }
 
        esriConfig.defaults.map.sliderLabel = {
          tick: 0,
          labels: labels,
          style: "width:2em; font-family:Verdana; font-size:65%; color:#fff; padding-left:2px;"
        };

      
      }

function doSearchPanel()
{

 document.getElementById("gridB").style.height = '0px'
 
 document.getElementById("gridB").style.display = "none";
 document.getElementById("layer_list").style.height = '0px'
 document.getElementById("layer_list").style.display = "none";

document.getElementById("TaxBillNumberPane").style.display = "none";
document.getElementById("AddressSearchPane").style.display = "none";

document.getElementById("OwnerNameSearchPane").style.display = "none";


//document.getElementById("pnlsearchoption").style.display = "block";
//document.getElementById("pnlsearchoption").style.hight = "200px";


}


function ReceiveServerData(arg)
    {
     var s=arg;
     
     document.getElementById("loading").style.display = "none";  

 var string1,string2,string3,start1,ss10;
 start1="";
 
string1=arg.substring(0,1);
        

switch (string1) {

case "G":

var  start0="<table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;' width='22%'>Property Address</td><td style='font-size:12;' width='12%'>Owner Name</td> <td style='font-size:12;' width='10%'>Tax Bill</td><td style='font-size:12;' width='23%'>Neighborhood</td><td style='font-size:12;' width='10%'>Council District</td></tr>";

var start1;
string2=arg.substring(2,arg.length);
    
//var aGeopin=new Array();

aGeopin=string2.split("~");

var LengthG=aGeopin.length;

for (var i=0, il=aGeopin.length; i<il; i++) {

var ss1=aGeopin[i];

var a2=new Array();

a2=ss1.split("/");

var ssGeopin=a2[0];
var ssAdress=a2[1];
var ssOwnerName=a2[2];
var ssTaxBill=a2[3];
var ssCouncil=a2[4];
var ssNeighor=a2[5];

start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='moverAllSpatial(this,"+ssGeopin+","+ i + " );'  onmouseout='moutAllSpatial(this);' " + " ><td align='left'>"+ssAdress+"</td>"+"<td align='left'>"+ssOwnerName+"</td>"+"<td align='left'>"+ssTaxBill+"</td>"+"<td align='left'>"+ssNeighor+"</td>"+"<td align='left'>"+ssCouncil+"</td></tr>";
//ss10="<td> <a FindItAllSpatial("+ssGeopin+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' align='center' > Zoom To </a>" +  "</td></tr>";

start1=start1;

}
 
 var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),1), new dojo.Color([255,255,0,0]));
         
 var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0.25]));
     
document.getElementById('list').style.display = 'none';
document.getElementById("details").style.display = 'none';
document.getElementById("neighbor").style.display = 'none';
  
showPanelGrid("list_list"); 
   //document.getElementById("property_list").style.display = "block";
   
  // document.getElementById("property_list").style.height = '30px'
 
  document.getElementById("AddressSearchPane").style.display = "none"; 

   document.getElementById("grid").style.display = "none";
   
   document.getElementById("iAll").style.display = "block";
    document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     

   
     
 dojo.byId("iAll").innerHTML = start0+start1+"</table>";
 
    toggleProgressBar(); 
          myMap.graphics.enableMouseEvents();
            
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
            // This "if" ensures the buffer graphic won't try to show an info window
            
            if(evt.graphic.attributes != undefined){ 
                         
      //myMap.infoWindow.resize(310, 310);
  	      evt.graphic.setSymbol(highlightSymbol);
          myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
      
      var featureAttributes = evt.graphic.attributes;
            
      feature=evt.graphic;
      
      var i=0;
      
      var s="";
        

            for(var i=0, il=LengthG-1; i<il; i++){
           
           var ss1=aGeopin[i];

           var a2=new Array();

           a2=ss1.split("/");
           var ssGeopin=a2[0];
           
              if( feature.attributes["GEOPIN"] ==ssGeopin ) {
          var sAddress1=a2[1];
           //sAddress=a2[1];
          var sOwnerName=a2[2];
          var sTaxBill=a2[3];
          var sCouncilDist=a2[4];
          var sNeiborhood1=a2[5];                
         form1.HiddenGeopinDetail.value=ssGeopin;
          sGeopinAddress=ssGeopin+"/"+sAddress1;
           sAddress=sAddress1;
         s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
              }
            }          
   
        myMap.infoWindow.resize(300, 160);
      	myMap.infoWindow.setTitle("Layer Name:"+ActiveLayerName).setContent(s);
          	
        myMap.infoWindow.show(evt.screenPoint, myMap.getInfoWindowAnchor(evt.screenPoint));
 
                 }
         
                           
  	      });
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){
      //myMap.infoWindow.hide();
        evt.graphic.setSymbol(symbol);
         }
       });    
     
  break;  
  
case "I":

var  start0="<table style='background-color:rgb(252,252,252);bordercolor:rgb(252,252,252);vertical-align: middle;border-width: 4px;'> <tr align='center' style='background-color:rgb(252,252,252);bordercolor:rgb(252,252,252);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;' width='22%'>Property Address</td><td style='font-size:12;' width='12%'>Owner Name</td> <td style='font-size:12;' width='10%'>Tax Bill</td><td style='font-size:12;' width='23%'>Neighborhood</td><td style='font-size:12;' width='10%'>Council District</td></tr>";

var string2=arg.substring(2,arg.length);
j=999;

//var aGeopin=new Array();

aGeopin=string2.split("~");

for (var i=1, il=aGeopin.length; i<il; i++) {

var ss1=aGeopin[i];

var a2=new Array();

a2=ss1.split("/");
sAddress=a2[1];
//var ssGeopin=a2[0];
var ssAdress=a2[1];
var ssOwnerName=a2[2];
var ssTaxBill=a2[3];
var ssCouncil=a2[4];
var ssNeighor=a2[5];

start1=start1+"<tr style='background-color:rgb(252,252,252);bordercolor:rgb(252,252,252);border:0px;border-width: 4px; height:24px; ' ><td align='left'>"+ssAdress+"</td>"+"<td align='left'>"+ssOwnerName+"</td>"+"<td align='left'>"+ssTaxBill+"</td>"+"<td align='left'>"+ssNeighor+"</td>"+"<td align='left'>" + ssCouncil+ "</td></tr>";
//ss10="<td> <a FindItAllSpatial("+ssGeopin+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' align='center' > Zoom To </a>" +  "</td></tr>";

//start1=start1;

}


 // var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress0;
//    
//         
//        //var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center'  style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress0;
//   
//         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr>";
//           
        var s2="<tr style='height:24px;border-width: 0px;border:4px ;border-left-width:0px; border-right-width:0px' ><td  height='36px' valign='middle' align='right' colspan='3' ><a onclick='GoDetails()'   onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200);align:center' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' colspan='2' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='align:center;text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr>";
  
        s=start0+start1+s2+s3+"</table>";

        var p=80+aGeopin.length*40;

        myMap.infoWindow.resize(400, p);

        dojo.byId("OwnerInfo").innerHTML =s;
           
    var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.graphics.enableMouseEvents();
           myMap.centerAt(centerP);
      	myMap.infoWindow.setTitle(ActiveLayerName+" Information:").setContent(s);
       myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP))); 
          
  toggleProgressBar(); 

  break;  
default:
     document.getElementById("infoDetails").style.display = "block";
   
       dojo.byId("infoDetail").innerHTML = s; 
         break;  
   // var s1=form1.HiddenFieldStreetName.value;
   
   }
  

 }



   function moverAllSpatial(aa,a,m ) {
  j=m;
    if (a>0) {
    
    var ActiveLayerName="gggg";
    
    aa.style.backgroundColor = "rgb(220,230,250)";
    
    //sAddress=sAddresses[j];
    
    var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;   
           
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["GEOPIN"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAllSpatial);
      
        }
 
   
}

               
               
function showResultsAllSpatial(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
  // graphic1.setSymbol(symbol2);
  myMap.graphics.remove(graphic1);
     
 graphic1 = new esri.Graphic(graphic.geometry, symbol2);
 
 myMap.graphics.add(graphic1);
 
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();

var ss1=aGeopin[j];

var a2=new Array();

a2=ss1.split("/");

var ssGeopin=a2[0];
var sAddress1=a2[1];
var sOwnerName=a2[2];
var sTaxBill=a2[3];
var sCouncilDist=a2[4];
var sNeiborhood1=a2[5];

sAddress=sAddress1;
 
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
       
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
                         

}
}


function getLayer(){
 var s2=form1.HiddenFieldAttributeSearch.value;
 var a1 = new Array();
 var ss1 = new Array();

 a1=s2.split("/");
 var A=a1[0];
  ActiveLayerID=A;
 s1=a1[1];
 
 var sOperator=a1[2];
 
 var sValue=a1[3];
 
 var j=sValue.indexOf("'"); 
 if (j>=1){ var p1=sValue.substr(0,j);
  sValue=p1;
 sOperator="1";
  }
 } 


function locateDatabaseAddress()
{
j=0;

iAllorAddress="1";

var s2=form1.HiddenFieldStreet.value;

if (s2.substring(0,1)=='A'){

 var Len=s2.length;
 form1.HiddenFieldStreet.value=s2.substring(1,Len);
        
                            }

else {
 alert("\n  Multiple Matches Found\n Please select from the results list");
  }
 
 

var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

//HiddenFieldGeopinAll.Value + "/" + sTaxBill;
 var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
 

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");

 
 
//var sLat = new Array();  
 var s1=form1.HiddenFieldLat.value;
 sLat=s1.split("/");
 
  // var sLon = new Array();
 var s1=form1.HiddenFieldLon.value;
 sLon=s1.split("/");
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");


  // s1=form1.HiddenFieldStreetName.value;

   showPanelGrid('list_list');
   //showPanelGrid('list');
   
    document.getElementById('tdPrintList').style.display ='block';
    document.getElementById('tdPrintDetails').style.display ='none';
  
   document.getElementById("list").style.height = "28px";
   document.getElementById("list").style.width = "120px";
   
   
    document.getElementById('idClosestFacility').style.display = 'none';
    document.getElementById("idClosestFacility").style.height = "0px";
   document.getElementById('idClosestFacility').style.width = '694px'; 

   
   document.getElementById("iAll").style.display = "block";
    document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     
   
    swapImage("list");
    
        document.getElementById('property').style.visibility = 'visible';
        document.getElementById("property_list").style.display = 'none';
        document.getElementById('loadingsearch').style.display = 'none';  
 
 
  document.getElementById("details").style.display = "none";
 
 document.getElementById("neighbor").style.display = "none";
 
 
// document.getElementById("list_list").style.width = '700px';
//  
  document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
    document.getElementById("grid").style.width = '694px';
   
   var s3="";
   
  var start1="";
  var ss10="";
   
   smallX=parseFloat(sLon[0]);
   smallY=parseFloat(sLat[0]);
 
   bigX=parseFloat(sLon[0]);
   bigY=parseFloat(sLat[0]);
 
   
     start0="<table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;' width='22%'>Property Address</td><td style='font-size:12;' width='12%'>Owner Name</td> <td style='font-size:12;' width='10%'>Tax Bill</td><td style='font-size:12;' width='23%'>Neighborhood</td><td style='font-size:12;' width='10%'>Council District</td><td style='font-size:12;' width='9%' align='center'>Find IT</td></tr>";

     var i;
var xx,yy;
       for ( i=0, il=sNeighor.length-1; i<il; i++)
         {
         xx=parseFloat(sLon[i]);
         yy=parseFloat(sLat[i]);
              if (smallX>=parseFloat(sLon[i])) {
                smallX=parseFloat(sLon[i]);
                        }  
             
                  if (bigX<parseFloat(sLon[i])) {
        bigX=parseFloat(sLon[i]);
                }  
                
                              
        if (smallY>=parseFloat(sLat[i])) {
        smallY=parseFloat(sLat[i]); 
           
                }  
                 
                  if (bigY < parseFloat(sLat[i])){
               bigY = parseFloat(sLat[i]);
           
        
         }  
         if (aG[i].length<5){
         aG[i]=0;
         }
        
  //s2= aN[i]+" "+ s1+ " "+ aD[i]+ " " + aT[i];
 if (aG[i].length>0) {
  s2=aAddress[i];
  sAddresses[i]=s2;
  start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='moverAll(this,"+aG[i]+","+ i + " );'  onmouseout='moutAll(this);' " + " ><td align='left'>"+s2+"</td>"+"<td align='left'>"+aOwnerName[i]+"</td>"+"<td align='left'>"+aTaxBill[i]+"</td>"+"<td align='left'>"+sNeighor[i]+"</td>"+"<td align='left'>"+sCouncil[i]+"</td>";
  ss10="<td> <a onclick='FindItAll("+aG[i]+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' align='center' > Find It </a>" +  "</td></tr>";
  start1=start1+ss10;
  }
  else {
   s2=aAddress[i];
  sAddresses[i]=s2;

  start0="<table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;' width='22%'>Property Address</td><td style='font-size:12;' width='12%'>Owner Name</td> <td style='font-size:12;' width='10%'>Tax Bill</td><td style='font-size:12;' width='23%'>Neighborhood</td><td style='font-size:12;' width='10%'>Council District</td><td style='font-size:12;' width='10%'>Zoom To</td></tr>";

  start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px'  onmouseover='moverAll(this,"+aG[i]+","+ i + " );'  onmouseout='moutAll(this);'  " + " ><td align='left'>"+s2+"</td>"+"<td align='left'>"+aOwnerName[i]+"</td>"+"<td align='left'>"+aTaxBill[i]+"</td>"+"<td align='left'>"+sNeighor[i]+"</td>"+"<td align='left'>"+sCouncil[i]+"</td>";
  ss10="<td> <a onclick='FindItAll("+aG[i]+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' align='center' > Zoom To </a>" +  "</td></tr>";
 
  
  start1=start1+ss10;
  
  }
    }
                  
       var ss3=start0+start1+"</table>";        
       dojo.byId("iAll").innerHTML =ss3;
       document.body.style.cursor='default';  
       var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
       myMap.setExtent(extent0);
       
       var s;
         var sTaxBill=aTaxBill[0];
         
          var sOwnerName=aOwnerName[0];
       var sAddress1=aAddress[0];
//sAddress=aAddress[0];
 form1.HiddenGeopinDetail.value="NoGeopin/"+ sAddress; 
sGeopinAddress="NoGeopin/"+sAddress;
      var sCouncilDist=sCouncil[0];    
      var sNeiborhood1=sNeighor[0];
         s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";

 ss10="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilitiesNoGeopin("+xx+","+yy+")' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr>";
     
         s=s+s1+s2+ss10+"</table></div>";
           
         //myMap.infoWindow.setTitle("Parcel Info").setContent(s);

var xx=parseFloat(sLon[0]);

var yy=parseFloat(sLat[0]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
      
      
        //myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
        
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   

   var a=aG[0];
      
      if (a==0) {
           
//   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
  var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
   
   myMap.graphics.add(graphic);  
     myMap.infoWindow.resize(290, 190);
      myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
      
      }
      
      else {
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsDatabase);

        }
             
}

function showResultsDatabase(fset)
{
             

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   var centerP = fExtent.getCenter();
  
      
       var xx=centerP.x;
       var yy=centerP.y;
   

             
var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
 
var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");
 
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");
         
            var sTaxBill=aTaxBill[0];
         
          var sOwnerName=aOwnerName[0];
       var sAddress1=aAddress[0];
sAddress=aAddress[0];

sGeopinAddress=form1.HiddenGeopinDetail.value+"/"+sAddress;

      var sCouncilDist=sCouncil[0];    
      var sNeiborhood1=sNeighor[0];
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
         
          
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
         

    // myMap.setExtent(extent0);    
      

    

}





function locateAll()
{
iAllorAddress="1";
var s2=form1.HiddenFieldStreet.value;
if (s2.substring(0,1)=='A'){

 var Len=s2.length;
 form1.HiddenFieldStreet.value=s2.substring(1,Len);
            
                            }

else {
 alert("\n  Multiple Matches Found\n Please select from the results list");
  }
 

var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");


//HiddenFieldGeopinAll.Value + "/" + sTaxBill;
 var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
 

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");

 
 
  var sLat = new Array();  
 var s1=form1.HiddenFieldLat.value;
 sLat=s1.split("/");
 
   var sLon = new Array();
 var s1=form1.HiddenFieldLon.value;
 sLon=s1.split("/");
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");


  // s1=form1.HiddenFieldStreetName.value;

   showPanelGrid('list_list');
   //showPanelGrid('list');
   
    document.getElementById('tdPrintList').style.display ='block';
    document.getElementById('tdPrintDetails').style.display ='none';
  
   document.getElementById("list").style.height = "28px";
   document.getElementById("list").style.width = "120px";
   
   
    document.getElementById('idClosestFacility').style.display = 'none';
    document.getElementById("idClosestFacility").style.height = "0px";
   document.getElementById('idClosestFacility').style.width = '694px'; 

   
   document.getElementById("iAll").style.display = "block";
    document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     
   
    swapImage("list");
    
        document.getElementById('property').style.visibility = 'visible';
        document.getElementById("property_list").style.display = 'none';
        document.getElementById('loadingsearch').style.display = 'none';  
 
 
  document.getElementById("details").style.display = "none";
 
 document.getElementById("neighbor").style.display = "none";
 
 
// document.getElementById("list_list").style.width = '700px';
//  
  document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
    document.getElementById("grid").style.width = '694px';
   
   var s3="";
   
  var start1="";
  var ss10="";
   
   smallX=parseFloat(sLon[0]);
   smallY=parseFloat(sLat[0]);
 
   bigX=parseFloat(sLon[0]);
   bigY=parseFloat(sLat[0]);
 
   
     start0="<table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;' width='22%'>Property Address</td><td style='font-size:12;' width='12%'>Owner Name</td> <td style='font-size:12;' width='10%'>Tax Bill</td><td style='font-size:12;' width='23%'>Neighborhood</td><td style='font-size:12;' width='10%'>Council District</td><td style='font-size:12;' width='9%' align='center'>Find IT</td></tr>";

     var i;

       for ( i=0, il=sNeighor.length-1; i<il; i++)
         {
              if (smallX>=parseFloat(sLon[i])) {
                smallX=parseFloat(sLon[i]);
                        }  
             
                  if (bigX<parseFloat(sLon[i])) {
        bigX=parseFloat(sLon[i]);
                }  
                
                              
        if (smallY>=parseFloat(sLat[i])) {
        smallY=parseFloat(sLat[i]); 
           
                }  
                 
                  if (bigY < parseFloat(sLat[i])){
               bigY = parseFloat(sLat[i]);
           
        
         }  
         if (aG[i].length<2){
         aG[i]=0;
         }
        
  //s2= aN[i]+" "+ s1+ " "+ aD[i]+ " " + aT[i];
 if (aG[i].length>0) {
  s2=aAddress[i];
  sAddresses[i]=s2;
  start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='moverAll(this,"+aG[i]+","+ i + " );'  onmouseout='moutAll(this);' " + " ><td align='left'>"+s2+"</td>"+"<td align='left'>"+aOwnerName[i]+"</td>"+"<td align='left'>"+aTaxBill[i]+"</td>"+"<td align='left'>"+sNeighor[i]+"</td>"+"<td align='left'>"+sCouncil[i]+"</td>";
  ss10="<td> <a onclick='FindItAll("+aG[i]+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' align='center' > Zoom To </a>" +  "</td></tr>";
  start1=start1+ss10;
  }
    }
                    
       var ss3=start0+start1+"</table>";        
 
       dojo.byId("iAll").innerHTML =ss3;
 
 document.body.style.cursor='default';  
       var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
       myMap.setExtent(extent0);
                               
}


function showResultsAll2(fset)
{

var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
            feature=graphic;     
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();
  
      
       var xx=centerP.x;
       var yy=centerP.y;
   
        smallX=centerP.x-0.001;
           
        bigX=centerP.x+0.001;
          
        smallY=centerP.y-0.001;
        bigY=centerP.y+0.001;
   
 
            
        var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
      
//      
//       if (graphic.attributes['OWNER_FIRST']=='Null'|| graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
//          else {st1=graphic.attributes['OWNER_FIRST']}
//                 
//                 
//         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
//          else { st2=graphic.attributes['OWNER_MIDNAME'];}
//          
//         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
//          else {st3=graphic.attributes['OWNER_LAST'];}
//          
//          var sOwnerName= st1+" "+st2+" "+st3;
//          
//                if (graphic.attributes['TAX_BILL']=='Null' || graphic.attributes['TAX_BILL']==undefined) {sTaxBill="";}
//          else {sTaxBill=graphic.attributes['TAX_BILL']}
//             
//                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null' || graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']==undefined) {sCouncilDist="";}
//          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
//             
//        
//             if (graphic.attributes['GNOCDC_LAB']=='Null'|| graphic.attributes['GNOCDC_LAB']==undefined ) {sNeiborhood="";}
//          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
//          
//                if (graphic.attributes['GEOPIN']=='Null'|| graphic.attributes['GEOPIN']==undefined ) {sGeopin="";}
//          else {sGeopin=graphic.attributes["GEOPIN"];}
//         
//              
//         
//         var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
//   
//  
//         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr  style =' font-family:arial; font-size:12; font-weight:bold; text-align:center;  cell-padding:10px'>";
//         
//         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Show Details </a></td>";
//        
//         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Find Facilities </a></td></tr></table></div>";
//           
//             s=s+s1+s2+s3;
//              
      
     
     
                var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");
 
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");
         
            var sTaxBill=aTaxBill[j];
         
          var sOwnerName=aOwnerName[j];
       var sAddress1=aAddress[j];
sAddress=aAddress[j];
      var sCouncilDist=sCouncil[j];    
      var sNeiborhood1=sNeighor[j];
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
      myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
                         
     myMap.setExtent(extent0);    
   
}
}




function mover2(aa){
         aa.style.color=  "rgb(73,143,250)"; 
         document.body.style.cursor = "hand";
               }
               
               
function showResultsAll(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();
  
      
       var xx=centerP.x;
       var yy=centerP.y;

 var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");
 
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");

var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
          
            var sTaxBill=aTaxBill[j];
         
          var sOwnerName=aOwnerName[j];
       var sAddress1=aAddress[j];
sAddress=aAddress[j];

 form1.HiddenGeopinDetail.value=aG[j]+"/"+ sAddress; 
  sGeopinAddress=aG[j]+"/"+sAddress;
  
var tsry=form1.HiddenGeopinDetail.value;
      var sCouncilDist=sCouncil[j];    
      var sNeiborhood1=sNeighor[j];
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
                         

}
}


function moutAllSpatial(aa) {
   myMap.graphics.remove(graphic1);
  aa.style.backgroundColor = "rgb(250,250,250)";

}



function moutAll(aa) {
//   myMap.graphics.remove(graphic1);
  aa.style.backgroundColor = "rgb(250,250,250)";

}


function mout2(aa) {
aa.style.color = "rgb(0,100,200)";
document.body.style.cursor = 'default';
}




   function moverAll(aa,a,m ) {
  j=m;
  
    if (a>0) {
    
    var ActiveLayerName="gggg";
    
    aa.style.backgroundColor = "rgb(220,230,250)";
    
    //sAddress=sAddresses[j];
    
    var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAll);
      
        }
        
      else {
      
      
  aa.style.backgroundColor = "rgb(220,230,250)";
     
myMap.graphics.clear();

sAddress=sAddresses[j];
 
   
   
var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

//HiddenFieldGeopinAll.Value + "/" + sTaxBill;
 var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
 

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");

 
 
//var sLat = new Array();  
 var s1=form1.HiddenFieldLat.value;
 sLat=s1.split("/");
 
  // var sLon = new Array();
 var s1=form1.HiddenFieldLon.value;
 sLon=s1.split("/");
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");


   
   var xx=parseFloat(sLon[j]);

   var yy=parseFloat(sLat[j]);

   var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
 
     
   var sTaxBill =aTaxBill[j];
   var sOwnerName=aOwnerName[j];
   var sCouncilDist=sCouncil[j];
   var sNeiborhood=sNeighor[j];
   var sCouncilDist=sCouncil[j];
   
   var sAddress1=aAddress[j];
    sAddress=sAddress1;
 form1.HiddenGeopinDetail.value="NoGeopin/"+ sAddress1; 
  
  sGeopinAddress="NoGeopin/"+sAddress1;
  
 myMap.infoWindow.resize(290, 190);
          
   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
   var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr>";
      var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
   var s3="<td  height='36px' valign='middle' align='center' colspan='2'><a onclick='GoFacilitiesNoGeopin("+xx+","+yy+")' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
       
   s=s+s1+s2+s3;
         
   myMap.infoWindow.setTitle("Locate:").setContent(s);
    
   myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
   myMap.graphics.add(graphic);
            
      
      }
   
}



function FindItAll(a,i)

{
j=i;
   if(a>0) {
  
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  
   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
                      
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAll2);
        }
        else {

// var xx=parseFloat(sLon[i]);
// var yy=parseFloat(sLat[i]);
//  
// var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));

// //candidate = candidates[MaxI];
//            
//  var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
//   
//  var attributes=""; 
//  var graphic = new esri.Graphic(pp, symbol,attributes);
//   
//          myMap.graphics.add(graphic);
//          
 
//   aa.style.backgroundColor = "rgb(220,230,250)";
     
myMap.graphics.clear();

sAddress=sAddresses[i];
 
//var xx=parseFloat(sLon[i]);

//var yy=parseFloat(sLat[i]);
 
var aOwnerName = new Array();
 var s1=form1.HiddenFieldOwner.value;
 aOwnerName=s1.split("/");

//HiddenFieldGeopinAll.Value + "/" + sTaxBill;
 var aG = new Array();
 var s1=form1.HiddenFieldGeopinAll.value;
 aG=s1.split("/");
 

 
 var aTaxBill = new Array();
 var s1=form1.HiddenFieldTaxBill.value;
 aTaxBill=s1.split("/");
 
 
  var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");

 
 
//var sLat = new Array();  
 var s1=form1.HiddenFieldLat.value;
 sLat=s1.split("/");
 
  // var sLon = new Array();
 var s1=form1.HiddenFieldLon.value;
 sLon=s1.split("/");
 
   var sNeighor = new Array();
 var s1=form1.HiddenFieldNeighor.value;
 sNeighor=s1.split("/");

   var sCouncil = new Array();
 var s1=form1.HiddenFieldCouncil.value;
 sCouncil=s1.split("/");


   
   var xx=parseFloat(sLon[j]);

   var yy=parseFloat(sLat[j]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
     
   var sTaxBill =aTaxBill[j];
   var sOwnerName=aOwnerName[j];
   var sCouncilDist=sCouncil[j];
   var sNeiborhood=sNeighor[j];
   var sAddress1=aAddress[j];
     
   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
    
   var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr  style =' font-family:arial; font-size:12; font-weight:bold; text-align:center;  cell-padding:10px'></tr></table></div>";
     
   //   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   //var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>  </td></tr></table></div>";

   
   s=s+s1;
         
   myMap.infoWindow.resize(240, 110);
     myMap.infoWindow.setTitle("Locate:").setContent(s);
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
     myMap.graphics.add(graphic);
     smallX=xx-0.001;
     smallY=yy-0.001;
     bigX=xx+0.001;
     bigY=yy+0.001;
 
     var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
      myMap.setExtent(extent0);
       
        }


}


function  locateAddress()
{
iAllorAddress="0";


    document.getElementById('idClosestFacility').style.display = 'none';
          document.getElementById("idClosestFacility").style.height = "0px";
   document.getElementById('idClosestFacility').style.width = '694px'; 


document.getElementById('list').style.display = 'none';

document.getElementById("details").style.display = 'none';
document.getElementById("neighbor").style.display = 'none';

document.getElementById('iAll').style.display = 'none';
document.getElementById('iAll').style.height = '0px';

if (BufferOrAddressSearch=="AddressSearch") {
 
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;

 a1=s1.split("/");
 var sNumber=a1[0];
 //var sDir=a1[1];
//var sStreet=a1[2];
// var sType=a1[3];
//var sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

s1=a1[0];

if (s1.length==0) {
alert("this address does not exist in our database");
document.getElementById('loadingsearch').style.display = 'none';  
return;
}

if (s1.length>0) {
  ActiveLayerID=8;
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
       queryA.where = "GEOPIN =  "+s1; 

       queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];

       queryTaskA.execute(queryA);
                
       dojo.connect(queryTaskA, "onComplete", showResultsAddressSearch);
        }
        
}
}

function OwnerTaxSearchStart()
{  
 
var aG = new Array();
 var s1=form1.HiddenTaxGeopin.value;
 aG=s1.split("/");
 
 var ArrayAdress = new Array();
 var s1=form1.HiddenTaxAddress.value;
 
 sAddresses=s1.split("/");
 
  var ArrayOwnerName = new Array();
 var s1=form1.HiddenTaxOwnerName.value;
 ArrayOwnerName =s1.split("/");
 
 
 var sLon = new Array();
 var s1=form1.HiddenTaxLon.value;
 sLon =s1.split("/");
 
  var sLat = new Array();
 var s1=form1.HiddenTaxLat.value;
 sLat =s1.split("/");
 
 
 var sNeighor = new Array();
 var s1=form1.HiddenTaxNeighor.value;
 sNeighor =s1.split("/");

 
 var sCouncil = new Array();
 var s1=form1.HiddenTaxCouncil.value;
 sCouncil =s1.split("/");
 
 
 
 iAllorAddress="1";

    showPanelGrid('list_list');
   //showPanelGrid('list');
  
   document.getElementById("list").style.height = "28px";
   document.getElementById("list").style.width = "120px";
   
   
   document.getElementById("iAll").style.display = "block";
  
    document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     
     
   
    swapImage("list");
    
        document.getElementById('property').style.visibility = 'visible';
        document.getElementById("property_list").style.display = 'none';
        document.getElementById('loadingsearch').style.display = 'none';  
 
 
  document.getElementById("grid").style.display = "none";
////  document.getElementById("grid").style.height = '0px';
    document.getElementById("grid").style.width = '694px';
  
   
   var s3="";
   
  var start1="";
  var ss10="";
   
   smallX=parseFloat(sLon[1]);
   smallY=parseFloat(sLat[1]);
 
   bigX=parseFloat(sLon[1]);
   bigY=parseFloat(sLat[1]);
 
   
     start0="<div><table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;width:26%'>Property Address </td><td style='font-size:12;width:13%'>Owner Name</td><td style='font-size:12;width:10%'>Tax Bill</td><td style='font-size:12;width:10%'>Neighborhood</td><td style='font-size:12;width:17%'>Council District</td><td style='font-size:12;width:10%'>Find IT</td></tr>";

     var i;
     var sTax=aG[sNeighor.length];

       for ( i=1, il=sNeighor.length; i<il; i++)
         {
         
              if (smallX>=parseFloat(sLon[i])) {
                smallX=parseFloat(sLon[i]);
                        }  
                        
                        
             
                  if (bigX<parseFloat(sLon[i])) {
        bigX=parseFloat(sLon[i]);
                }  
                
                              
        if (smallY>=parseFloat(sLat[i])) {
        smallY=parseFloat(sLat[i]); 
           
                }  
                 
                  if (bigY < parseFloat(sLat[i])){
               bigY = parseFloat(sLat[i]);
           
        
         }  
         if (aG[i].length<2){
         aG[i]=0;
         }
        
  s2= sAddresses[i];
 
  //sAddresses[i]=ArrayAdress;
  start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='moverAllTax(this,"+aG[i]+","+ i + " );'  onmouseout='moutAll(this);' " + " ><td>"+s2+"</td><td>"+ArrayOwnerName[i]+"</td><td>"+sTax+"</td><td>"+sNeighor[i]+"</td>"+"<td>"+sCouncil[i]+"</td>";
  ss10="<td> <a onclick='FindItAllTax("+aG[i]+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td></tr>";
  start1=start1+ss10;
 
   }
                        
       var ss3=start0+start1+"</table></div>";        
 
       dojo.byId("iAll").innerHTML =ss3;
   
       document.body.style.cursor='default';
   
       var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
       myMap.setExtent(extent0);
       
       if (sNeighor.length==2) {
       
     var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        var a=aG[1];
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsDatabaseTax);      
       
       }
     

}

function FindItAllTax(a,i)

{
j=i;
   if(a>0) {
  
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  
   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
                      
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAllTax);
        }
        else {

     
myMap.graphics.clear();

sAddress=sAddresses[i];
 
var xx=parseFloat(sLon[i]);

var yy=parseFloat(sLat[i]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
 
     
   var sTaxBill ="";
   var sOwnerName="";
   var sCouncilDist="";
   var sNeiborhood="";
   var sCouncilDist="";
     
   //var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   //var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr  style =' font-family:arial; font-size:12; font-weight:bold; text-align:center;  cell-padding:10px'></tr></table></div>";
     
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>  </td></tr></table></div>";

   
   s=s+s1;
         
   myMap.infoWindow.resize(240, 110);
     myMap.infoWindow.setTitle("Locate:").setContent(s);
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
     myMap.graphics.add(graphic);
     smallX=xx-0.001;
     smallY=yy-0.001;
     bigX=xx+0.001;
     bigY=yy+0.001;
 
     var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
      myMap.setExtent(extent0);
       
        }


}


   function moverAllTax(aa,a,m ) {
  j=m;
    if (a>0) {
    
    var ActiveLayerName="gggg";
    
    aa.style.backgroundColor = "rgb(220,230,250)";
    
    //sAddress=sAddresses[j];
    
    var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAllTaxNoMove);
      
        }
        
      else {
      
      
  aa.style.backgroundColor = "rgb(220,230,250)";
     
myMap.graphics.clear();

sAddress=sAddresses[j];
 
var xx=parseFloat(sLon[j]);

var yy=parseFloat(sLat[j]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
 
     
   var sTaxBill ="";
   var sOwnerName="";
   var sCouncilDist="";
   var sNeiborhood="";
   var sCouncilDist="";
   
   myMap.infoWindow.resize(240, 110);
     
   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(241,227,200)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>  </td></tr></table></div>";
     
   s=s+s1;
         
     myMap.infoWindow.setTitle("Locate:").setContent(s);
    
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
     myMap.graphics.add(graphic);
            
      
      }
   
}

function showResultsAllTaxNoMove(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();


//        smallX=centerP.x-0.001;
//           
//        bigX=centerP.x+0.001;
//          
//        smallY=centerP.y-0.001;
//        bigY=centerP.y+0.001;
//   
// 
//            
//        var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
    

var aAdress = new Array();
 var s1=form1.HiddenTaxAddress.value;
 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenTaxOwnerName.value;
 aOwnerName =s1.split("/");
  
 
 var sNeighor = new Array();
 var s1=form1.HiddenTaxNeighor.value;
 sNeighor =s1.split("/");
 
 var sCouncil = new Array();
 var s1=form1.HiddenTaxCouncil.value;
 sCouncil =s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenTaxGeopin.value;
 aTaxBill =s1.split("/");
  
  var sTaxBill=aTaxBill[aTaxBill.length-1];
       var sOwnerName=aOwnerName[j];
       var sAddress1=aAddress[j];
sAddress=aAddress[j];
      var sCouncilDist=sCouncil[j];    
      var sNeiborhood1=sNeighor[j];
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
     // myMap.setExtent(extent0);                        

}
}




function showResultsAllTax(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();


        smallX=centerP.x-0.001;
           
        bigX=centerP.x+0.001;
          
        smallY=centerP.y-0.001;
        bigY=centerP.y+0.001;
   
 
            
        var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
    

var aAdress = new Array();
 var s1=form1.HiddenTaxAddress.value;
 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenTaxOwnerName.value;
 aOwnerName =s1.split("/");
  
 
 var sNeighor = new Array();
 var s1=form1.HiddenTaxNeighor.value;
 sNeighor =s1.split("/");
 
 var sCouncil = new Array();
 var s1=form1.HiddenTaxCouncil.value;
 sCouncil =s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenTaxGeopin.value;
 aTaxBill =s1.split("/");
  
  var sTaxBill=aTaxBill[aTaxBill.length-1];
       var sOwnerName=aOwnerName[j];
       var sAddress1=aAddress[j];
sAddress=aAddress[j];
      var sCouncilDist=sCouncil[j];    
      var sNeiborhood1=sNeighor[j];
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
         var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
      myMap.setExtent(extent0);                        

}
}




function showResultsDatabaseTax(fset)
{             
j=1;
 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   var centerP = fExtent.getCenter();
  
      
       var xx=centerP.x;
       var yy=centerP.y;
   


 
 var aAdress = new Array();
 var s1=form1.HiddenTaxAddress.value;
 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenTaxOwnerName.value;
 aOwnerName =s1.split("/");
  
 
 var sNeighor = new Array();
 var s1=form1.HiddenTaxNeighor.value;
 sNeighor =s1.split("/");
 
 var sCouncil = new Array();
 var s1=form1.HiddenTaxCouncil.value;
 sCouncil =s1.split("/");

 
 var aTaxBill = new Array();
 var s1=form1.HiddenTaxGeopin.value;
 aTaxBill =s1.split("/");
  
  var sTaxBill=aTaxBill[2];
         
  var sOwnerName=aOwnerName[j];
  var sAddress1=aAddress[j];
sAddress=aAddress[j];
  var sCouncilDist=sCouncil[j];    
  var sNeiborhood1=sNeighor[j];
  var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
  var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
           
  var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
  var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
         
          
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
         

    // myMap.setExtent(extent0);    
      

    

}


function OwnerNameSearchStart()
{  
 
var aG = new Array();
 var s1=form1.HiddenGeopin.value;
 aG=s1.split("/");
 
 var sTaxBill = new Array();
 var s1=form1.HiddenGeopin.value;
 sTaxBill=s1.split("~");
 
 var ArrayAdress = new Array();
 var s1=form1.HiddenAddress.value;

 sAddresses=s1.split("/");
 
  var ArrayOwnerName = new Array();
 var s1=form1.HiddenOwnerName.value;
 ArrayOwnerName =s1.split("/");
 
 
 var sLon = new Array();
 var s1=form1.HiddenLon.value;
 sLon =s1.split("/");
 
  var sLat = new Array();
 var s1=form1.HiddenLat.value;
 sLat =s1.split("/");
 
 
 var sNeighor = new Array();
 var s1=form1.HiddenNeighor.value;
 sNeighor =s1.split("/");

 
 var sCouncil = new Array();
 var s1=form1.HiddenCouncil.value;
 sCouncil =s1.split("/");
  
 
 iAllorAddress="1";

      showPanelGrid('list_list'); 
   //showPanelGrid('list');
  
   document.getElementById("list").style.height = "28px";
   document.getElementById("list").style.width = "120px";
   
   
   document.getElementById("iAll").style.display = "block";
   document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     
   
    swapImage("list");
    
        document.getElementById('property').style.visibility = 'visible';
        document.getElementById("property_list").style.display = 'none';
        document.getElementById('loadingsearch').style.display = 'none';  
 
 
  document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
    document.getElementById("grid").style.width = '694px';
  
    document.getElementById('idClosestFacility').style.display = 'none';
    document.getElementById("idClosestFacility").style.height = "0px";
   document.getElementById('idClosestFacility').style.width = '694px'; 

   
   var s3="";
   
  var start1="";
  var ss10="";
   
   smallX=parseFloat(sLon[1]);
   smallY=parseFloat(sLat[1]);
 
   bigX=parseFloat(sLon[1]);
   bigY=parseFloat(sLat[1]);
 
   
     start0="<table style='border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;'>Property Address</td><td style='font-size:12;'>Owner Name</td><td style='font-size:12;'>Tax Bill</td><td style='font-size:12;'>Neighborhood</td><td style='font-size:12;'>Council District</td><td>Find IT</td></tr>";

     var i;

       for ( i=1, il=sNeighor.length; i<il; i++)
         {
         
              if (smallX>=parseFloat(sLon[i])) {
                smallX=parseFloat(sLon[i]);
                        }  
                        
                        
             
                  if (bigX<parseFloat(sLon[i])) {
        bigX=parseFloat(sLon[i]);
                }  
                
                              
        if (smallY>=parseFloat(sLat[i])) {
        smallY=parseFloat(sLat[i]); 
           
                }  
                 
                  if (bigY < parseFloat(sLat[i])){
               bigY = parseFloat(sLat[i]);
           
        
         }  
         if (aG[i].length<2){
         aG[i]=0;
         }
        
  s2= sAddresses[i];
  
  //sAddresses[i]=ArrayAdress;
  start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='moverAllName(this,"+aG[i]+","+ i + " );'  onmouseout='moutAll(this);' " + " ><td>"+s2+"</td><td>"+ArrayOwnerName[i]+"</td>"+"<td>"+sTaxBill[i]+"</td><td>"+sNeighor[i]+"</td>"+"<td>"+sCouncil[i]+"</td>";
  ss10="<td> <a onclick='FindItAllName("+aG[i]+","+i+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td></tr>";
  start1=start1+ss10;
  
   }
                        
 document.body.style.cursor='default';
       var ss3=start0+start1+"</table>";        
 
       dojo.byId("iAll").innerHTML =ss3;
   
       var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
       myMap.setExtent(extent0);
       
  if ((sNeighor.length==2)||( aG[1].lenth>5)) {
       
     var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        var a=aG[1];
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsDatabaseName);      
       
       }
     

}

function FindItAllName(a,i)

{
j=i;
   if(a>0) {
  
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  
   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
                      
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAllNameMove);
        }
        else {

     
myMap.graphics.clear();

sAddress=sAddresses[i];
 
var xx=parseFloat(sLon[i]);

var yy=parseFloat(sLat[i]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
 
     
   var sTaxBill ="";
   var sOwnerName="";
   var sCouncilDist="";
   var sNeiborhood="";
   var sCouncilDist="";
     
   //var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   //var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr  style =' font-family:arial; font-size:12; font-weight:bold; text-align:center;  cell-padding:10px'></tr></table></div>";
     
      var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>  </td></tr></table></div>";

   
   s=s+s1;
         
   myMap.infoWindow.resize(240, 110);
     myMap.infoWindow.setTitle("Locate:").setContent(s);
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
     myMap.graphics.add(graphic);
     smallX=xx-0.001;
     smallY=yy-0.001;
     bigX=xx+0.001;
     bigY=yy+0.001;
 
     var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
      myMap.setExtent(extent0);
       
        }


}

function showResultsAllNameMove(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();


        smallX=centerP.x-0.001;
           
        bigX=centerP.x+0.001;
          
        smallY=centerP.y-0.001;
        bigY=centerP.y+0.001;
   
 
            
        var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
    

 var aG = new Array();
 var s1=form1.HiddenGeopin.value;
 aG=s1.split("/");
 
 var aTaxBill = new Array();
 var s1=form1.HiddenGeopin.value;
 aTaxBill=s1.split("~");
 
 var aAdress = new Array();
 var s1=form1.HiddenAddress.value;

 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenOwnerName.value;
 aOwnerName =s1.split("/");
 
 
 var sLon = new Array();
 var s1=form1.HiddenLon.value;
 sLon =s1.split("/");
 
  var sLat = new Array();
 var s1=form1.HiddenLat.value;
 sLat =s1.split("/");
 
 
 var sNeighor = new Array();
 var s1=form1.HiddenNeighor.value;
 sNeighor =s1.split("/");

 
 var sCouncil = new Array();
 var s1=form1.HiddenCouncil.value;
 sCouncil =s1.split("/");
  
 
  
  var sTaxBill=aTaxBill[j];
         
  var sOwnerName=aOwnerName[j];
  var sAddress1=aAddress[j];
sAddress=aAddress[j];
  var sCouncilDist=sCouncil[j];    
  var sNeiborhood1=sNeighor[j];
  var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
  var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
           
  var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
  var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
           
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
      myMap.setExtent(extent0);                        

}
}



   function moverAllName(aa,a,m ) {
  j=m;
    if (a>0) {
    
    var ActiveLayerName="gggg";
    
    aa.style.backgroundColor = "rgb(220,230,250)";
    
    //sAddress=sAddresses[j];
    
    var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

   var queryA = new esri.tasks.Query();   
        
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        
        form1.HiddenGeopinDetail.value=a;     
        
        queryA.where = "GEOPIN ="+a; 
        
        queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
               
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAllName);
      
        }
        
      else {
      
      
  aa.style.backgroundColor = "rgb(220,230,250)";
     
myMap.graphics.clear();

sAddress=sAddresses[j];
 
var xx=parseFloat(sLon[j]);

var yy=parseFloat(sLat[j]);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
 
     
   var sTaxBill ="";
   var sOwnerName="";
   var sCouncilDist="";
   var sNeiborhood="";
   var sCouncilDist="";
   
   myMap.infoWindow.resize(240, 110);
     
   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(241,227,200)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>  </td></tr></table></div>";
     
   s=s+s1;
         
     myMap.infoWindow.setTitle("Locate:").setContent(s);
    
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
  	   	
     
     myMap.graphics.add(graphic);
            
      
      }
   
}

function showResultsAllName(fset)
{

 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

if (results.length==1) {    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   centerP = fExtent.getCenter();


//        smallX=centerP.x-0.001;
//           
//        bigX=centerP.x+0.001;
//          
//        smallY=centerP.y-0.001;
//        bigY=centerP.y+0.001;
//   
// 
//            
//        var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
    

 var aG = new Array();
 var s1=form1.HiddenGeopin.value;
 aG=s1.split("/");
 
 var aTaxBill = new Array();
 var s1=form1.HiddenGeopin.value;
 aTaxBill=s1.split("~");
 
 var aAdress = new Array();
 var s1=form1.HiddenAddress.value;

 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenOwnerName.value;
 aOwnerName =s1.split("/");
 
 
 var sLon = new Array();
 var s1=form1.HiddenLon.value;
 sLon =s1.split("/");
 
  var sLat = new Array();
 var s1=form1.HiddenLat.value;
 sLat =s1.split("/");
 
 
 var sNeighor = new Array();
 var s1=form1.HiddenNeighor.value;
 sNeighor =s1.split("/");

 
 var sCouncil = new Array();
 var s1=form1.HiddenCouncil.value;
 sCouncil =s1.split("/");
  
 
  
  var sTaxBill=aTaxBill[j];
         
  var sOwnerName=aOwnerName[j];
  var sAddress1=aAddress[j];
sAddress=aAddress[j];
  var sCouncilDist=sCouncil[j];    
  var sNeiborhood1=sNeighor[j];
  var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
  var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
           
  var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
  var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
           
           
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
      //myMap.setExtent(extent0);                        

}
}



function showResultsDatabaseName(fset)
{             
j=1;
 var results = fset.features;
var st1,st2,st3,sGeopin,sNeiborhood,sCouncilDist,sTaxBill;

    
   myMap.graphics.clear();
   var graphic = results[0];     
   var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
               
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
   feature=graphic;
 
   var fExtent = graphic.geometry.getExtent();
 
   var centerP = fExtent.getCenter();
  
      
       var xx=centerP.x;
       var yy=centerP.y;
   

var aG = new Array();
 var s1=form1.HiddenGeopin.value;
 aG=s1.split("/");
 
 var aTaxBill = new Array();
 var s1=form1.HiddenGeopin.value;
 aTaxBill=s1.split("~");
 
 var aAdress = new Array();
 var s1=form1.HiddenAddress.value;

 aAddress=s1.split("/");
 
  var aOwnerName = new Array();
 var s1=form1.HiddenOwnerName.value;
 aOwnerName =s1.split("/");
 
 
 var sLon = new Array();
 var s1=form1.HiddenLon.value;
 sLon =s1.split("/");
 
  var sLat = new Array();
 var s1=form1.HiddenLat.value;
 sLat =s1.split("/");
 
 
 var sNeighor = new Array();
 var s1=form1.HiddenNeighor.value;
 sNeighor =s1.split("/");

 
 var sCouncil = new Array();
 var s1=form1.HiddenCouncil.value;
 sCouncil =s1.split("/");
  
 
  
  var sTaxBill=aTaxBill[j];
         
  var sOwnerName=aOwnerName[j];
  var sAddress1=aAddress[j];
sAddress=aAddress[j];
  var sCouncilDist=sCouncil[j];    
  var sNeiborhood1=sNeighor[j];
  var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress1;
  var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood1+ "</td></tr><tr>";
           
  var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
  var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
         s=s+s1+s2+s3;
           
         
          
     myMap.infoWindow.resize(320, 160);
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
       
      myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
         

    // myMap.setExtent(extent0);    
      

    

}


function  locateOwner()
{
iAddressOrOwnerOrTax="Owner";

iAllorAddress="4";
document.getElementById('list').style.display = 'none';
document.getElementById("details").style.display = 'none';
document.getElementById("neighbor").style.display = 'none';

 
var a1 = new Array();
 var s1=form1.HiddenGeopin.value;
 a1=s1.split("/");
 var ii=a1.length-1;

var a2 = new Array();
 var s2=form1.HiddenLat.value;
 a2=s2.split("/");
 
 if (a2.length>100){
//alert("there are " +ii+" parcels!");
alert("\n  Multiple Matches Found\n Please select from the results list");

}
 
if (a2.length>=2){
OwnerNameSearchStart();

}

if (a2.length<2){
alert(" the owner is not in our database");
document.body.style.cursor='default';
     document.getElementById('loadingsearch').style.display = 'none';  
     return;
                    
}

//if (a2.length==2) {

//  L=1;
//  s1=a1[L];

//  ActiveLayerID=8;
//   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
//  //var extent0= new esri.geometry.Extent(-13669046, 5696984, -13666179, 5698895, new esri.SpatialReference({wkid: 102113}));

//iAllorAddress="0";
//   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));

//   var queryA = new esri.tasks.Query();   
//        queryA.extent = extent0;

//        queryA.returnGeometry = true;
//        
//       queryA.where = "GEOPIN =  "+s1; 

//       queryA.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];

//       queryTaskA.execute(queryA);
//                
//       dojo.connect(queryTaskA, "onComplete", showResultsOwnerSearch);
//        }
//        

}



function  locateTax()
{
iAddressOrOwnerOrTax="Tax";
iAllorAddress="4";
document.getElementById('list').style.display = 'none';
document.getElementById("details").style.display = 'none';
document.getElementById("neighbor").style.display = 'none';

 
var a1 = new Array();
 var s1=form1.HiddenTaxGeopin.value;
 a1=s1.split("/");
 
 if (a1.length>290){
 alert("There are too many parcel, please narrow search");
    
 document.body.style.cursor='default';
 
  document.getElementById('loadingsearch').style.display = 'none';  
  return;
  
 }

if (a1.length>2){
OwnerTaxSearchStart();
return;
}
if (a1.length<2){
alert("Tax bill number not in our database");
 document.getElementById('loadingsearch').style.display = 'none';  
document.body.style.cursor='default'; 
return;
}
if (a1.length==2) {
alert("Tax bill number not in our database")
 document.getElementById('loadingsearch').style.display = 'none';  
    
 document.body.style.cursor='default';
return;
 

        }
        

}



function showResultsAddressSearch0(fset)
{

 var results = fset.features;
   
 document.getElementById("grid").style.display = "block";
     document.getElementById("grid").style.width = '694px';

 document.getElementById("property_list").style.display = "none";
 document.getElementById("property_list").style.height = '0px';
 
  document.getElementById("AddressSearchPane").style.display = "none"; 

 
   
 var view1 = {		  
            cells: [
              [{name: 'Property Address', width: "20%"},{name: 'Owner Name', width: "20%"},{name: 'Tax Bill', width: "20%"},{name: 'Council District', width: "15%"},{name: 'Neighborhood', width: "15%"}]
            ]
          };
    var layout = [ view1 ];
    gridWidget.setStructure(layout);
   
smallX=-9999999;
smallY=-9999999;
bigX=9999999;
bigY=9999999;
 myMap.graphics.clear();
  var dataForGrid = [];
  
 
        var  symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
 
   
  for (var i=0, il=results.length; i<il; i++) {
          //var curFeature = results[i];
          //var graphic = curFeature.feature;
               var graphic = results[i];     
        
          var fExtent = graphic.geometry.getExtent();
            centerP = fExtent.getCenter();
           centerPt[i] = fExtent.getCenter();
          
      if (i==0){
         smallX=centerPt[0].x;
          smallY=centerPt[0].y;
          bigX=centerPt[0].x;
          bigY=centerPt[0].y;}
         
                     
        if (smallX>=centerP.x) {
                smallX=centerP.x;
                        }  
                        
                 
                  if (bigX<centerP.x) {
        bigX=centerP.x;
                }  
                
                              
        if (smallY>=centerP.y) {
        smallY=centerP.y;
    
                }  
                 
                  if (bigY<centerP.y) {
        bigY=centerP.y;
                        }  


             
          graphic.setSymbol(symbol);
          myMap.graphics.add(graphic);
          
            if (graphic.attributes['SITUS_NUMBER']=='Null'|| graphic.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=graphic.attributes['SITUS_NUMBER']}
                 
         if (graphic.attributes['SITUS_DIR']=='Null' || graphic.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=graphic.attributes['SITUS_DIR'];}
          
         if (graphic.attributes['SITUS_STREET']=='Null' || graphic.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=graphic.attributes['SITUS_STREET'];}
          
           if (graphic.attributes['SITUS_TYPE']=='Null' || graphic.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=graphic.attributes['SITUS_TYPE'];}
          
           sAddress= st1+" "+st2+" "+st3+" "+st4;
          
   
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
 sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

      
       if (graphic.attributes['OWNER_FIRST']=='Null'||graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=graphic.attributes['OWNER_FIRST']}
                 
         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=graphic.attributes['OWNER_MIDNAME'];}
          
         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=graphic.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (graphic.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=graphic.attributes['TAX_BILL']}
             
                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
          //var sCouncilDist=graphic.attributes["COUNCIL_DISTRICTS_COUNCILDIS"];
       
          // var sNeiborhood=graphic.attributes["TAX_BILL"];
       
             if (graphic.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
          
                if (graphic.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
                   
            
            PGeopin[i]=sGeopin;
              var s3="<font color='blue'>Details</font>";
            var attValues = [sAddress,sOwnerName,sTaxBill,sCouncilDist,sNeiborhood];
            dataForGrid.push(attValues); 
            
        }

    var model = new dojox.grid.data.Table(null, dataForGrid);
  
        gridWidget.setModel(model);
        
        
      var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);
          
               
        var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,255]),4), new dojo.Color([255,0,255,0]));
      
                // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOver", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
        
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                      selectedGraphic.setSymbol(highlightSymbol);
                   
  	      
  	      
  	   feature=selectedGraphic;
        myMap.infoWindow.resize(290, 210);
         
       var s="";
    if (feature.attributes['SITUS_NUMBER']=='Null'|| feature.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=feature.attributes['SITUS_NUMBER']}
                 
         if (feature.attributes['SITUS_DIR']=='Null' || feature.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=feature.attributes['SITUS_DIR'];}
          
         if (feature.attributes['SITUS_STREET']=='Null' || feature.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=feature.attributes['SITUS_STREET'];}
          
           if (feature.attributes['SITUS_TYPE']=='Null' || feature.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=feature.attributes['SITUS_TYPE'];}
          
          //var sAddress= st1+" "+st2+" "+st3+" "+st4;
          
   
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
 sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
           sGeopinAddress=sGeopin+"/"+sAddress;
           
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
           
            
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
     
           
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	                         
                      
                return;
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOut", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                selectedGraphic.setSymbol(symbol);
                return
              }
            }
          });               
        
         // Enable info window on hover
          myMap.graphics.enableMouseEvents();
          
         
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
            // This "if" ensures the buffer graphic won't try to show an info window
            
            if(evt.graphic.attributes != undefined){ 
                         
      
  	      evt.graphic.setSymbol(highlightSymbol);
  	      
  	   feature=evt.graphic;
        myMap.infoWindow.resize(320, 160);
         
       var s="";
    if (feature.attributes['SITUS_NUMBER']=='Null'|| feature.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=feature.attributes['SITUS_NUMBER']}
                 
         if (feature.attributes['SITUS_DIR']=='Null' || feature.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=feature.attributes['SITUS_DIR'];}
          
         if (feature.attributes['SITUS_STREET']=='Null' || feature.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=feature.attributes['SITUS_STREET'];}
          
           if (feature.attributes['SITUS_TYPE']=='Null' || feature.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=feature.attributes['SITUS_TYPE'];}
          
         // var sAddress= st1+" "+st2+" "+st3+" "+st4;
          
   
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
 sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
           sGeopinAddress=sGeopin+"/"+sAddress;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
              
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
     
           s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = evt.graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	                   }
         
                           
  	      });
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){
      
        evt.graphic.setSymbol(symbol);
         }
       });    
//document.getElementById('loadingsearch').style.display = 'none'; 
 document.body.style.cursor='default';
      showPanelGrid("list_list");
 
        document.body.style.cursor='default';
  

}




  function rowCh(e) {
     
var a= this.getCell(1, e.rowIndex).getNode(e.rowIndex).innerHTML ;
    myMap.infoWindow.resize(250, 200);
 j=  e.rowIndex;
var pontCenter=  centerPt[j];
    //var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));
 var sAddress=this.getCell(0, e.rowIndex).getNode(e.rowIndex).innerHTML ;
 
  var sOwnerName=this.getCell(1, e.rowIndex).getNode(e.rowIndex).innerHTML ;


  var sTaxBill=this.getCell(2, e.rowIndex).getNode(e.rowIndex).innerHTML ;
  
   var sCouncilDist=this.getCell(3, e.rowIndex).getNode(e.rowIndex).innerHTML ;
   
 var sNeiborhood=this.getCell(4, e.rowIndex).getNode(e.rowIndex).innerHTML ;
 
 var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),9), new dojo.Color([0,255,255,0.9]));
      
  
   form1.HiddenFieldGeopin.value=PGeopin[j];
   form1.HiddenGeopinDetail.value=PGeopin[j];
    sGeopinAddress=PGeopin[j]+"/"+sAddress;
 
  var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
   
  
   var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
   
    
         var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
     
            
             s=s+s1+s2+s3;
   //   layer.setVisibleLayers([8],[9]);

      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
           myMap.infoWindow.show(myMap.toScreen(pontCenter),myMap.getInfoWindowAnchor(myMap.toScreen(pontCenter)));  
  	   	
  

smallX=pontCenter.x-0.001;
smallY=pontCenter.y-0.001;
bigX=pontCenter.x+0.001;
bigY=pontCenter.y+0.0001;


 var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);
          
}    



function GoDetails()
{
 
  document.getElementById('loading').style.display = 'none';  
     document.getElementById('infoDetail').style.display = 'block';
       dojo.byId("infoDetail").innerHTML = "";
     
 document.getElementById('loadingsearch').style.display = 'block';  
//document.getElementById('list_list').style.display = 'none';
//document.getElementById('list_list').style.height = '0px';
                   
document.getElementById('grid').style.display = 'none';
document.getElementById('grid').style.height = '0px';

document.getElementById('iAll').style.display = 'none';
document.getElementById('iAll').style.height = '0px';

if (j>=0) {

var s1="D"+form1.HiddenGeopinDetail.value;
 sGeopinAddress="D"+sGeopinAddress;

CallServer(sGeopinAddress, "");   

document.getElementById('loadingsearch').style.display = 'none';  
            
 
showPanelGrid("details_list");

}

else {

 var fExtent = feature.geometry.getExtent();
         
 var pontCenter = fExtent.getCenter();
 
 var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
 
                       smallX=pontCenter.x-0.001;
                       smallY=pontCenter.y-0.001;
                       bigX=pontCenter.x+0.001;
                    bigY=pontCenter.y+0.0001;
          
 var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
 myMap.setExtent(extent0);
        
 var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),9), new dojo.Color([0,255,255,0.9])); 
 
 sGeopin=form1.HiddenGeopinDetail.value;
 form1.HiddenFieldGeopin.value= form1.HiddenGeopinDetail.value;
                    
var s1="D"+form1.HiddenGeopinDetail.value;
 sGeopinAddress="D"+sGeopinAddress;
CallServer(sGeopinAddress, "");   
      document.getElementById('loadingsearch').style.display = 'none';  
                   
showPanelGrid("details_list");

}
}



function showResultsAddressSearch(fset)
{
 var results = fset.features;
 
 
  document.getElementById("property_list").style.display = "block";
   document.getElementById("property_list").style.height = '30px';
 
 
if (results.length==0)
{

alert("Sorry, we could not find your property(ies). Please find similar matches below.");


 var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];

  ActiveLayerID=8;
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
 
   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));
   var queryA = new esri.tasks.Query();   
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        queryA.where =  "SITUS_STREET = '"+sStreet+"' ";
        queryA.outFields = ["SITUS_NUMBER","SITUS_DIR","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAddressSearch0);
        
return;
}


if (results.length==1) {    
  
document.getElementById("AddressSearchPane").style.display = "none"; 
document.getElementById("AddressSearchPane").style.height = "0px";


document.getElementById("OwnerNameSearchPane").style.display = "none"; 
document.getElementById("OwnerNameSearchPane").style.height = "0px";


document.getElementById("TaxBillNumberPane").style.display = "none"; 
document.getElementById("TaxBillNumberPane").style.height = "0px";

document.getElementById("iAll").style.display = "none";
document.getElementById("iAll").style.height = '0px';

//  document.getElementById("list_list").style.display = "none";
//  document.getElementById("list_list").style.height = '0px';
//  //document.getElementById("list_list").style.width = '700px';
  
  document.getElementById("grid").style.display = "block";
  document.getElementById("grid").style.height = '100px';
  document.getElementById("grid").style.width = '694px';

   
 var view1 = {		  
            cells: [
              [{name: 'Property Address', width: "20%"},{name: 'Owner Name', width: "20%"},{name: 'Tax Bill', width: "20%"},{name: 'Council District', width: "15%"},{name: 'Neighborhood', width: "15%"}]
            ]
          };
    var layout = [ view1 ];
    gridWidget.setStructure(layout);
   
smallX=-9999999;
smallY=-9999999;
bigX=9999999;
bigY=9999999;
  var dataForGrid = [];

  
               var graphic = results[0];     
 //                var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]),3), new dojo.Color([255,255,255,0]));
          var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
 
            var fExtent = graphic.geometry.getExtent();
            centerP = fExtent.getCenter();
        
        feature=graphic;         
                
        smallX=centerP.x-0.001;
           
        bigX=centerP.x+0.001;
          
        smallY=centerP.y-0.001;
        bigY=centerP.y+0.0001;
       
           
 
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
          var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
//sAddress= form1.HiddenFieldStreet.value;
   sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

       if (graphic.attributes['OWNER_FIRST']=='Null'||graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=graphic.attributes['OWNER_FIRST']}
                 
         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=graphic.attributes['OWNER_MIDNAME'];}
          
         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=graphic.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (graphic.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=graphic.attributes['TAX_BILL']}
             
                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
          //var sCouncilDist=graphic.attributes["COUNCIL_DISTRICTS_COUNCILDIS"];
       
          // var sNeiborhood=graphic.attributes["TAX_BILL"];
       
             if (graphic.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
          
                if (graphic.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
         
          //  var sGeopin=graphic.attributes["GEOPIN"];
            
             var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
   
  
   var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
   
      var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
             
             s=s+s1+s2+s3;
    
       myMap.infoWindow.resize(340, 160);
       
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
         
  	   
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	
            
            PGeopin[i]=sGeopin;
              var s3="<font color='blue'>Details</font>";
                form1.HiddenFieldGeopin.value=sGeopin;
   form1.HiddenGeopinDetail.value=sGeopin;
   
            var attValues = [sAddress,sOwnerName,sTaxBill,sCouncilDist,sNeiborhood];
            
            dataForGrid.push(attValues); 
    
    var model = new dojox.grid.data.Table(null, dataForGrid);
  
        gridWidget.setModel(model);
        
        
            var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);

  document.getElementById('loadingsearch').style.display = 'none';  
    document.getElementById('loadingsearch').style.height = '0px';  
            
              
          var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,255]),3), new dojo.Color([255,0,255,0]));
      
                // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOver", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
        
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                      selectedGraphic.setSymbol(highlightSymbol);
       
 feature=selectedGraphic;
        myMap.infoWindow.resize(340, 160);
         
       var s="";

      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
           
            var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
        
         var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
           
              
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	                                
       
                return;
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOut", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                selectedGraphic.setSymbol(symbol2);
                return
              }
            }
          });               
        
         // Enable info window on hover
          myMap.graphics.enableMouseEvents();
          
         
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
               
            if(evt.graphic.attributes != undefined){ 
    
  	      evt.graphic.setSymbol(highlightSymbol);
  	      
            
  	   feature=evt.graphic;
        myMap.infoWindow.resize(320, 160);
         
       var s="";

       
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
           var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
            
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = evt.graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	
   
                 }
         
                           
  	      });
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){

        evt.graphic.setSymbol(symbol2);
         }
       });    
         
document.body.style.cursor='default';
  showPanelGrid("list_list","0");
        

 
    
}
}

 


function showResultsOwnerSearch(fset)
{
 var results = fset.features;
 document.body.style.cursor='default';
 
  document.getElementById("property_list").style.display = "block";
   document.getElementById("property_list").style.height = '30px';
 
 
if (results.length==0)
{alert("Sorry, we could not find your property(ies). Please find similar matches below.");

if (iAddressOrOwnerOrTax=="Owner"){
 var s1=form1.HiddenAddress.value;
 }

 if (iAddressOrOwnerOrTax=="Tax"){
 var s1=form1.HiddenTaxAddress.value;
 }


 var a1 = new Array();
 //var s1=form1.HiddenAddress.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];

  ActiveLayerID=8;
   var queryTaskA = new esri.tasks.QueryTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/8");
 
   var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));
   var queryA = new esri.tasks.Query();   
        queryA.extent = extent0;

        queryA.returnGeometry = true;
        queryA.where =  "SITUS_STREET = '"+sStreet+"' ";
        queryA.outFields = ["SITUS_NUMBER","SITUS_DIR","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
        queryTaskA.execute(queryA);
                
        dojo.connect(queryTaskA, "onComplete", showResultsAddressSearch0);
        
return;
}


if (results.length==1) {    

  

   //document.getElementById("showResultsAddressSearch").style.display = "none";
   //document.getElementById("showResultsAddressSearch").style.height = '0px'
   
  
  document.getElementById("AddressSearchPane").style.display = "none"; 

 // document.getElementById("list_list").style.display = "block";
 // document.getElementById("list_list").style.height = '100px';
  //document.getElementById("list_list").style.width = '700px';
  
  document.getElementById("grid").style.display = "block";
  document.getElementById("grid").style.height = '100px';
  document.getElementById("grid").style.width = '694px';
    
   
  
   
   
 var view1 = {		  
            cells: [
              [{name: 'Property Address', width: "20%"},{name: 'Owner Name', width: "20%"},{name: 'Tax Bill', width: "20%"},{name: 'Council District', width: "15%"},{name: 'Neighborhood', width: "15%"}]
            ]
          };
    var layout = [ view1 ];
    gridWidget.setStructure(layout);
   
smallX=-9999999;
smallY=-9999999;
bigX=9999999;
bigY=9999999;
  var dataForGrid = [];

  
               var graphic = results[0];     
 //                var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]),3), new dojo.Color([255,255,255,0]));
          var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
 
            var fExtent = graphic.geometry.getExtent();
            centerP = fExtent.getCenter();
        
        feature=graphic;         
                
        smallX=centerP.x-0.001;
           
        bigX=centerP.x+0.001;
          
        smallY=centerP.y-0.001;
        bigY=centerP.y+0.0001;
       
           
 
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
          var a1 = new Array();
 
 if (iAddressOrOwnerOrTax=="Owner"){
 var s1=form1.HiddenAddress.value;
 }
 if (iAddressOrOwnerOrTax=="Tax"){
 var s1=form1.HiddenTaxAddress.value;
 }
 
 
 a1=s1.split("/");
 
sAddress= a1[L];
          

       if (graphic.attributes['OWNER_FIRST']=='Null'||graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=graphic.attributes['OWNER_FIRST']}
                 
         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=graphic.attributes['OWNER_MIDNAME'];}
          
         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=graphic.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (graphic.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=graphic.attributes['TAX_BILL']}
             
                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
          //var sCouncilDist=graphic.attributes["COUNCIL_DISTRICTS_COUNCILDIS"];
       
          // var sNeiborhood=graphic.attributes["TAX_BILL"];
       
             if (graphic.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
          
                if (graphic.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
         
          //  var sGeopin=graphic.attributes["GEOPIN"];
            
             var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
   
  
   var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
              
             var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
             s=s+s1+s2+s3;
    
       myMap.infoWindow.resize(340, 160);
       
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
         
  	   
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	
            
            PGeopin[i]=sGeopin;
              var s3="<font color='blue'>Details</font>";
                form1.HiddenFieldGeopin.value=sGeopin;
   form1.HiddenGeopinDetail.value=sGeopin;
   
            var attValues = [sAddress,sOwnerName,sTaxBill,sCouncilDist,sNeiborhood];
            
            dataForGrid.push(attValues); 
    
    var model = new dojox.grid.data.Table(null, dataForGrid);
  
        gridWidget.setModel(model);
        
        
            var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);

  document.getElementById('loadingsearch').style.display = 'none';  
    document.getElementById('loadingsearch').style.height = '0px';  
            
              
          var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,255]),3), new dojo.Color([255,0,255,0]));
      
                // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOver", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
        
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                      selectedGraphic.setSymbol(highlightSymbol);
       
 feature=selectedGraphic;
        myMap.infoWindow.resize(340, 160);
         
       var s="";

      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
                     
             var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	                                
       
                return;
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOut", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                selectedGraphic.setSymbol(symbol2);
                return
              }
            }
          });               
        
         // Enable info window on hover
          myMap.graphics.enableMouseEvents();
          
         
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
               
            if(evt.graphic.attributes != undefined){ 
    
  	      evt.graphic.setSymbol(highlightSymbol);
  	      
            
  	   feature=evt.graphic;
        myMap.infoWindow.resize(320, 160);
         
       var s="";

       
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
                  
             var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Facilities </a></td></tr></table></div>";
      
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = evt.graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	
   
                 }
         
                           
  	      });
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){

        evt.graphic.setSymbol(symbol2);
         }
       });    
        
 document.body.style.cursor='default';
  showPanelGrid("list_list","0");
        
 
    
}
}

 





function AllPanehide()
{
document.getElementById("TaxBillNumberPane").style.display = "none";
document.getElementById("AddressSearchPane").style.display = "none";

//document.getElementById("gridOwner").style.display = "none";

document.getElementById("grid").style.display = "none";

document.getElementById("iAll").style.display = "none";

document.getElementById("details_list").style.display = "none";

document.getElementById("neighbor_list").style.display = "none";


document.getElementById("OwnerNameSearchPane").style.display = "none";



}


function cellCh(e) {
//var a= this.getCell(e.cellIndex, e.rowIndex).getNode(e.rowIndex).innerHTML ;
var s1=e.cellIndex;
if (s1==0)
{

var j=  e.rowIndex;
var pontCenter=  centerPt[j];
 
  var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
           //var fExtent = graphic.geometry.getExtent();
            //centerP = fExtent.getCenter();
                      smallX=pontCenter.x-0.001;
                       smallY=pontCenter.y-0.001;
                       bigX=pontCenter.x+0.0001;
                       
                       bigY=pontCenter.y+0.0001;
                       
                       
            var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);
          
           
    //myMap.centerAt(pontCenter);
     
          
 var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),9), new dojo.Color([0,255,255,0.9])); 
   sGeopin=form1.HiddenGeopinDetail.value;
   form1.HiddenFieldGeopin.value=PGeopin[j];
   form1.HiddenGeopinDetail.value=PGeopin[j];
var s1="D"+form1.HiddenGeopinDetail.value;
 document.getElementById('loadingsearch').style.display = 'block'; 
CallServer(s1, "");   
 document.getElementById('loadingsearch').style.display = 'none'; 
showPanelGrid("details_list");
 //document.getElementById('neighbor').style.visibility = 'visible';
//showPanelGrid("neighbor_list");
}     

}


  function cellCh1(e) {
//var a= this.getCell(e.cellIndex, e.rowIndex).getNode(e.rowIndex).innerHTML ;
var s1=e.cellIndex;
if (s1==0)
{

var j=  e.rowIndex;
//var pontCenter=  centerPt[j];
    //var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));
 
 var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,0]),9), new dojo.Color([0,255,255,0.9])); 
 document.getElementById('loadingsearch').style.display = 'block';    

var s1="D"+form1.HiddenGeopinDetail.value;

CallServer(s1, "");   
 document.getElementById('loadingsearch').style.display = 'none'; 
showPanelGrid("details_list");
}     

}

   
function cmdTaxBillSearch(){

//document.getElementById("addressLoading").style.display = "block";  


    document.getElementById('idClosestFacility').style.display = 'none';
          document.getElementById("idClosestFacility").style.height = "0px";
   document.getElementById('idClosestFacility').style.width = '694px'; 

document.getElementById("loadingsearch").style.display = "block";  
document.getElementById("myMapDiv").style.display = "block";
document.getElementById("layer_list").style.display = "block";
  //document.getElementById("list_list").style.display = "block";
    document.getElementById("grid").style.display = "block";
  
 //document.getElementById("navToolbar").style.display = "block";
 myMap.showZoomSlider();
 myMap.enableRubberBandZoom();
// layer.setVisibleLayers([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
  
       ActiveLayerID=8;
       
        findTask = new esri.tasks.FindTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer");

          //create find parameters and define known values
          var findParams = new esri.tasks.FindParameters();
           findParams.outFields = ["SITUS_NUMBER","SITUS_DIR","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL"];
   
          findParams.returnGeometry = true;
          findParams.layerIds = [ActiveLayerID];
          findParams.searchFields = ["TAX_BILL"];
          var s1= document.getElementById("txtTaxBill").value;
          
          
         findParams.searchText = s1;

        findTask.execute(findParams,showResultsTaxBill);

}


function showResultsTaxBill(results)
{
if (results.length==0)
{
alert("Sorry, we could not find your property(ies). Please find similar matches below.");

return;
}
 
    
 // var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]),3), new dojo.Color([255,255,255,0]));
        var  symbol2 = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,0,0,0]));
 
  var view1 = {		  
            cells: [
              [{name: 'Property Address', width: "20%"},{name: 'Owner Name', width: "20%"},{name: 'Tax Bill', width: "20%"},{name: 'Council District', width: "10%"},{name: 'Neighborhood', width: "10%"},{name: 'geopin', width: "10%"}]
            ]
          };
    var layout = [ view1 ];
    gridWidget.setStructure(layout);
 
    
var st1,st2,st3,st4;

 myMap.graphics.clear();

  var dataForGrid = [];
  for (var i=0, il=results.length; i<il; i++) {
          var curFeature = results[i];
          var graphic = curFeature.feature;
                 
             if (graphic.attributes['SITUS_NUMBER']=='Null') {st1="";}
          else {st1=graphic.attributes['SITUS_NUMBER']}
                 
         if (graphic.attributes['SITUS_DIR']=='Null') { st2="";  }
          else { st2=graphic.attributes['SITUS_DIR'];}
          
         if (graphic.attributes['SITUS_STREET']=='Null') {st3="";}
          else {st3=graphic.attributes['SITUS_STREET'];}
          
           if (graphic.attributes['SITUS_TYPE']=='Null') {st4="";}
          else {st4=graphic.attributes['SITUS_TYPE'];}
          
          //var sAddress= st1+" "+st2+" "+st3+" "+st4;
           
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
var sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

  
          //var sAddress= graphic.attributes['SITUS_NUMBER']+" "+graphic.attributes['SITUS_DIR']+" "+graphic.attributes['SITUS_STREET']+" "+graphic.attributes['SITUS_TYPE'];
   
       if (graphic.attributes['OWNER_FIRST']=='Null'||graphic.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=graphic.attributes['OWNER_FIRST']}
                 
         if (graphic.attributes['OWNER_MIDNAME']=='Null'||graphic.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=graphic.attributes['OWNER_MIDNAME'];}
          
         if (graphic.attributes['OWNER_LAST']=='Null'||graphic.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=graphic.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (graphic.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=graphic.attributes['TAX_BILL']}
             
                if (graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=graphic.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
               
             if (graphic.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=graphic.attributes["GNOCDC_LAB"];}
          
                if (graphic.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=graphic.attributes["GEOPIN"];}
         
                   
            PGeopin[i]=sGeopin;
              var s3="<font color='blue'>Details</font>";
                form1.HiddenFieldGeopin.value=sGeopin;
   form1.HiddenGeopinDetail.value=sGeopin;
   
         
          graphic.setSymbol(symbol2);
          myMap.graphics.add(graphic);
          
          
            var attValues = [sAddress,sOwnerName,sTaxBill,sCouncilDist,sNeiborhood];
            dataForGrid.push(attValues); 
            
    

    var model = new dojox.grid.data.Table(null, dataForGrid);
  
        gridWidget.setModel(model);
        
        
          var fExtent = graphic.geometry.getExtent();
            centerP = fExtent.getCenter();
                      smallX=centerP.x-0.001;
                       smallY=centerP.y-0.001;
                       bigX=centerP.x+0.001;
                       
                       bigY=centerP.y+0.0001;
                       
                       
            var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);
          
       
          var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,255]),3), new dojo.Color([255,0,255,0]));
      
                // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOver", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
        
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                      selectedGraphic.setSymbol(highlightSymbol);
                            
  	   feature=selectedGraphic;
        myMap.infoWindow.resize(290, 160);
         
       var s="";
    if (feature.attributes['SITUS_NUMBER']=='Null'|| feature.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=feature.attributes['SITUS_NUMBER']}
                 
         if (feature.attributes['SITUS_DIR']=='Null' || feature.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=feature.attributes['SITUS_DIR'];}
          
         if (feature.attributes['SITUS_STREET']=='Null' || feature.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=feature.attributes['SITUS_STREET'];}
          
           if (feature.attributes['SITUS_TYPE']=='Null' || feature.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=feature.attributes['SITUS_TYPE'];}
          
          //var sAddress= st1+" "+st2+" "+st3+" "+st4;
           
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
var sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

  
      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
            
            var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' >Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
      
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = feature.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
                      
                return
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(gridWidget, "onRowMouseOut", function(e){
            var parcel = gridWidget.model.data[e.rowIndex][2];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes["TAX_BILL"] == parcel) {
                selectedGraphic.setSymbol(symbol2);
                return
              }
            }
          });               
        
         // Enable info window on hover
          myMap.graphics.enableMouseEvents();
          
         
          // Show info window when mouse goes over a parcel
          dojo.connect(myMap.graphics, "onMouseOver", function(evt) {
                    
            // This "if" ensures the buffer graphic won't try to show an info window
            
            if(evt.graphic.attributes != undefined){ 
                         
      
  	   feature=evt.graphic;
        myMap.infoWindow.resize(290, 160);
         
       var s="";
    if (feature.attributes['SITUS_NUMBER']=='Null'|| feature.attributes['SITUS_NUMBER']==undefined) {st1="";}
          else {st1=feature.attributes['SITUS_NUMBER']}
                 
         if (feature.attributes['SITUS_DIR']=='Null' || feature.attributes['SITUS_DIR']==undefined) { st2="";  }
          else { st2=feature.attributes['SITUS_DIR'];}
          
         if (feature.attributes['SITUS_STREET']=='Null' || feature.attributes['SITUS_STREET']==undefined) {st3="";}
          else {st3=feature.attributes['SITUS_STREET'];}
          
           if (feature.attributes['SITUS_TYPE']=='Null' || feature.attributes['SITUS_TYPE']==undefined) {st4="";}
          else {st4=feature.attributes['SITUS_TYPE'];}
          
          //var sAddress= st1+" "+st2+" "+st3+" "+st4;
           
var a1 = new Array();
 var s1=form1.HiddenFieldStreet.value;
 a1=s1.split("/");
 var sNumber=a1[0];
 var sDir=a1[1];
var sStreet=a1[2];
 var sType=a1[3];
var sAddress= a1[1]+" "+a1[2]+" "+a1[3] + " "+a1[4];

  
      
       if (feature.attributes['OWNER_FIRST']=='Null'||feature.attributes['OWNER_FIRST']==undefined) {st1="";}
          else {st1=feature.attributes['OWNER_FIRST']}
                 
         if (feature.attributes['OWNER_MIDNAME']=='Null'|| feature.attributes['OWNER_MIDNAME']==undefined) { st2="";  }
          else { st2=feature.attributes['OWNER_MIDNAME'];}
          
         if (feature.attributes['OWNER_LAST']=='Null'||feature.attributes['OWNER_LAST']==undefined) {st3="";}
          else {st3=feature.attributes['OWNER_LAST'];}
          
          var sOwnerName= st1+" "+st2+" "+st3;
          
                if (feature.attributes['TAX_BILL']=='Null') {sTaxBill="";}
          else {sTaxBill=feature.attributes['TAX_BILL']}
             
                if (feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']=='Null') {sCouncilDist="";}
          else {sCouncilDist=feature.attributes['COUNCIL_DISTRICTS_COUNCILDIS']}
             
                
             if (feature.attributes['GNOCDC_LAB']=='Null') {sNeiborhood="";}
          else {sNeiborhood=feature.attributes["GNOCDC_LAB"];}
          
          if (feature.attributes['GEOPIN']=='Null') {sGeopin="";}
          else {sGeopin=feature.attributes["GEOPIN"];}
                     
          form1.HiddenGeopinDetail.value=sGeopin;
         j=-1;
           s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Owner Name</td><td>"+sOwnerName+"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Tax Bill</td><td>"+sTaxBill +"</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
           var s1="</td></tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Council Districts</td><td>"+sCouncilDist+ "</tr><tr><td align='center' style='background-color: rgb(185,220,255)'>Neighborhood</td><td>"+sNeiborhood+ "</td></tr><tr>";
            
            var s2="<td  height='36px' valign='middle' align='right' ><a onclick='GoDetails()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Details </a></td>";
           var s3="<td  height='36px' valign='middle' align='center' ><a onclick='GoFacilities2()' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;color: rgb(0,100,200)' > Facilities </a></td></tr></table></div>";
      
             s=s+s1+s2+s3;
      
     myMap.infoWindow.setTitle("Parcel Info").setContent(s);
      
        var fExtent = evt.graphic.geometry.getExtent();   
  	   var centerP = fExtent.getCenter();
           myMap.infoWindow.show(myMap.toScreen(centerP),myMap.getInfoWindowAnchor(myMap.toScreen(centerP)));  
  	   	
                 }
         
                           
  	      });
  	  
  	  
     
          // Remove info window when map goes off the parcel
      dojo.connect(myMap.graphics, "onMouseOut", function(evt) {
        if(evt.graphic.attributes != undefined){
   
        evt.graphic.setSymbol(symbol2);
         }
       });    
       
   
          document.getElementById('loadingsearch').style.display = 'none'; 
          iAllorAddress = "0";
     showPanelGrid("list_list");
  //dojo.connect(gridWidget, "onRowClick", rowCh);  
                          
}           
      

}

function cmdGeocodeBuffer()
{
AllPanehide();
BufferOrAddressSearch="Buffer";
document.getElementById("AddressSearchPane").style.display = "block";

}

function cmdPropertyAddress()
{
AllPanehide();
BufferOrAddressSearch="AddressSearch";
document.getElementById("AddressSearchPane").style.display = "block";
document.getElementById("AddressSearchPane").style.height = "200px";
document.getElementById("hrefProperty").style.color = "#CC6600";
document.getElementById("hrefOwner").style.color = "#002758";
document.getElementById("hrefTaxBill").style.color = "#002758"; 
document.getElementById("AddressTips").style.display = "block";
document.getElementById("OwnerTips").style.display = "none";
document.getElementById("TaxBillTips").style.display = "none";


}

function cmdGeography(){
AllPanehide();

document.getElementById("hrefProperty").style.color = "#002758";
document.getElementById("hrefOwner").style.color = "#002758";
document.getElementById("hrefTaxBill").style.color = "#002758";   
document.getElementById("AddressTips").style.display = "none";
document.getElementById("OwnerTips").style.display = "none";
document.getElementById("TaxBillTips").style.display = "none";
}

function cmdOwnerName(){
AllPanehide();
document.getElementById("OwnerNameSearchPane").style.display = "block";
document.getElementById('OwnerNameSearchPane').style.height = '120px';
document.getElementById("hrefProperty").style.color = "#002758";
document.getElementById("hrefOwner").style.color = "#CC6600";
document.getElementById("hrefTaxBill").style.color = "#002758";   
document.getElementById("AddressTips").style.display = "none";
document.getElementById("OwnerTips").style.display = "block";
document.getElementById("TaxBillTips").style.display = "none";
}

function cmdTaxBillNumber(){
AllPanehide();
document.getElementById("TaxBillNumberPane").style.display = "block";
document.getElementById('TaxBillNumberPane').style.visibility = 'visible';
document.getElementById('TaxBillNumberPane').style.height = '120px';
document.getElementById("hrefProperty").style.color = "#002758";
document.getElementById("hrefOwner").style.color = "#002758";
//document.getElementById("hrefGeography").style.color = "#002758";

document.getElementById("hrefTaxBill").style.color = "#CC6600"; 
document.getElementById("AddressTips").style.display = "none";
document.getElementById("OwnerTips").style.display = "none";
document.getElementById("TaxBillTips").style.display = "block";  

}


 
   
     function cmdPolygonT(){
      toolbar.activate(esri.toolbars.Draw.POLYGON);
     dojo.connect(toolbar, "onDrawEnd", addToMapT);
         
      }

  function doFindClosest()
      {
      
      if   (sGeopin!=form1.HiddenGeopinDetail.value ){
      return;     }
      
      sGeopin=0;
       myMap.graphics.clear();
                ActiveLayerID=8;
   //document.getElementById("Report").style.display = "none";
            
  //document.getElementById("center").style.display = "block";
      document.getElementById("layer_list").style.height = '0px'; 
      document.getElementById("layer_list").style.display = "none";
           
           document.getElementById("layer_list").style.display = "none";
   document.getElementById("layer_list").style.height = '0px'
 
  //document.getElementById("pnlsearchoption").style.display = "none";
  // document.getElementById("pnlsearchoption").style.height = '0px'
 
 AllPanehide();
 //document.getElementById("center").style.display = "block";
 
  //document.getElementById("center").style.height = '600px';
  
  document.getElementById("grid").style.display = "none";
 
  document.getElementById("grid").style.height = '120px';


  document.getElementById("AddressSearchPane").style.display = "none"; 

 document.getElementById("OwnerNameSearchPane").style.display = "none"; 
 
   
  
             var view = {
		              cells: [
              [{name: 'FACILITY Type'},{name: 'Facility Name'}, {name: 'Address'},{name: 'Facility ID'}   ]
            ]
          };
           myMap.graphics.clear();
          var layout = [ view ];
           gridWidget.setStructure(layout);      
          findTask = new esri.tasks.FindTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer");
          //create find parameters and define known values
          
          findParams = new esri.tasks.FindParameters();
          findParams.returnGeometry = true;
          findParams.layerIds = [ActiveLayerID];
          
          findParams.searchFields = ["GEOPIN"];
          var s1=form1.HiddenFieldGeopin.value;
          
          if (s1.length>1) {
          findParams.searchText = s1;
          findTask.execute(findParams,showResultsClosest);
          }
          else {
          
          var xx;
          var yy;
          var xSmall;
          var xBig;
          var ySmall;
          var yBig;
          xx= form1.HiddenFieldX.value;
          yy=form1.HiddenFieldY.value;
          
          xSmall=xx-0.011;
          xBig=xx+0.011;
          ySmall=yy-0.006;
          yBig=yy+0.006;
        
           var fExtent= new esri.geometry.Extent(xSmall,ySmall,xBig,yBig,new esri.SpatialReference({wkid:4326}));
          myMap.setExtent(fExtent);
        
        //  myMap.centerAt(centerPt);
			 
          
          }
   
      }
      

              

     
     function rowchClosest(e)
     {
       var xx;
          var yy;
          var xSmall;
          var xBig;
          var ySmall;
          var yBig;
          var p=parseInt(e.rowIndex)+1;
        
            xx=centerPt[p].x;
            yy=centerPt[p].y;
          
          xSmall=xx-0.011;
          xBig=xx+0.011;
          ySmall=yy-0.006;
          yBig=yy+0.006;
        
           var fExtent= new esri.geometry.Extent(xSmall,ySmall,xBig,yBig,new esri.SpatialReference({wkid:4326}));
          myMap.setExtent(fExtent);
        
     }
     
     
     
       function rchandler(e) {
      
 if (e.cellIndex==3) {
       var a= this.getCell(1, e.rowIndex).getNode(e.rowIndex).innerHTML ; 
      var b= this.getCell(1, e.rowIndex).getNode(e.rowIndex).innerHTML ; 
       
       
       
       var ss,s1;
     s1=form1.HiddenFieldStreet.value+",New Orleans,LA";
    
    ss="GoogleMap.aspx?" +b+"?"+s1+" to "+a +",New Orleans,LA";
    //ss="GoogleMap.aspx?" +s1+" to "+a +",New Orleans,LA";
    
    
    window.open(ss,"Window1","width=1100,height=860,resizable=yes,location=1");

       }
       
       }     



function GotoMap() 
{

document.getElementById("myMapDiv").style.display = "block";
document.getElementById("layer_list").style.display = "block";
 //document.getElementById("navToolbar").style.display = "block";
 myMap.showZoomSlider();
 myMap.enableRubberBandZoom();
// layer.setVisibleLayers([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
  
       
        findTask = new esri.tasks.FindTask("http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer");

          //create find parameters and define known values
          var findParams = new esri.tasks.FindParameters();
          findParams.returnGeometry = true;
          findParams.layerIds = [ActiveLayerID];
          findParams.searchFields = ["GEOPIN"];
          var s1=form1.HiddenFieldGeopin.value;
          
         findParams.searchText = s1;

        findTask.execute(findParams,showResults);



}
   
  
     function showResults(results) {
        //find results return an array of findResult.
        myMap.graphics.clear();
       

        for (var i=0, il=results.length; i<il; i++) {
          var curFeature = results[i];
          var graphic = curFeature.feature;
          var layerName = curFeature.layerName;
          var layerId = curFeature.layerId;
          var foundFieldName = curFeature.foundFieldName;
          var foundFieldValue = graphic.attributes[foundFieldName];
          //var attValues = [layerName,layerId,foundFieldName,foundFieldValue];
       
          switch (graphic.geometry.type) {
            case "point":
              var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 1), new dojo.Color([0,255,0,0.25]));
              break;
            case "polyline":
              var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255,0,0]), 1);
              break;
            case "polygon":
              var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));
              break;
          }
          graphic.setSymbol(symbol);
          myMap.graphics.add(graphic);
        }

   
 //var fExtent = geometry.getExtent();
          var fExtent=graphic.geometry.getExtent();
                        
          myMap.setExtent(fExtent);
       
      }

   
   
   
   
    function showFeature(feature,evt) {
            myMap.graphics.clear();
              myMap.infoWindow.hide();
            
  			//curFeature = feature;
            var fExtent = feature.geometry.getExtent();
            
  			var centerPt = fExtent.getCenter();
  			var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));
  			
  			feature.setSymbol(symbol);
  			
     
          if (mapChangeNot=="Not") {
            myMap.infoWindow.resize(380, 210);
  				
  			 myMap.infoWindow.setContent(dojo.byId("tabs"));
             myMap.infoWindow.setTitle("Parcel Info");
             }
             mapChangeNot="Yes";
             
             var sParcel;
             
             sParcel="<table><tr><td>Geopin:"+feature.attributes['GEOPIN']+"</td><td>TAX_BILL:"+feature.attributes['TAX_BILL'] +"</tr> <tr><td>Street:"+feature.attributes['SITUS_STRE']+"</td></tr></table>";
             dojo.byId("idParcel").innerHTML = sParcel;
             
  	        dojo.byId("idLOT").innerHTML = "Owner:"+feature.attributes["Owner"];
  	        dojo.byId("idSquare").innerHTML = "TAX_BILL:"+feature.attributes["TAX_BILL"];
  	
  	       myMap.graphics.add(feature);
  	       
  	        if (evt != null){
  			    (evt) ? myMap.infoWindow.show(evt.screenPoint,myMap.getInfoWindowAnchor(evt.screenPoint)) : null;
            }
		    else
		    {
                myMap.infoWindow.show(myMap.toScreen(centerPt),myMap.getInfoWindowAnchor(myMap.toScreen(centerPt)));   
            }
            
        }
        
      
        
	 
	 		function showFeatureSet(fset,evt) {
  		   
  			myMap.graphics.clear();
  			  myMap.infoWindow.hide();
  			var screenPoint = evt.screenPoint;
  	 
  			featureSet = fset;
  	 
  			var numFeatures = featureSet.features.length;
  	 
  			//QueryTask returns a featureSet.  Loop through features in the featureSet and add them to the infowindow.
  			var title = "You have selected " + numFeatures + " fields. &nbsp;Please select desired field from the list below.";
  			var content = "";
  	 
  			for (var i=0; i<numFeatures; i++) {
  			    var graphic = featureSet.features[i];
  			    content = content + graphic.attributes.FIELD_NAME + " Field (<A href='javascript:showFeature(featureSet.features[" + i + "]);'>show</A>)<br/>";
            }
  			myMap.infoWindow.setTitle(title);
  			    if (mapChangeNot=="Not"){
            myMap.infoWindow.resize(380, 210);
  		   myMap.infoWindow.setContent(dojo.byId("tabs"));
  		    myMap.infoWindow.setTitle("Parcel Info");
  		    }
  		    mapChangeNot="Yes";
  			//myMap.infoWindow.setContent(content);
  			myMap.infoWindow.show(screenPoint,myMap.getInfoWindowAnchor(evt.screenPoint));
  			//dijit.byId('control_panel').toggle();
        }
		   
			
			 
	
    
		function centerMap(feature, ddValue){
		   
            var fExtent = feature.geometry.getExtent();
            var centerPt = new esri.geometry.Point;
            centerPt = fExtent.getCenter();
          var xx;
          var yy;
          var xSmall;
          var xBig;
          var ySmall;
          var yBig;
          xx=centerPt.x;
          yy=centerPt.y;
          xSmall=xx-0.011;
          xBig=xx+0.011;
          ySmall=yy-0.006;
          yBig=yy+0.006;
       
          myMap.centerAt(centerPt);
			 
        }
      
   
     function createToolbarCircle(myMap)
    {
        toolbar = new esri.toolbars.Draw(myMap);
        dojo.connect(toolbar, "onDrawEnd", addToMapCircle);
    }

    
function addToMap(geometry) {
    
       switch (geometry.type) {
        
          case "polygon":
          
           var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0]));
         var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),3), new dojo.Color([255,255,0,0]));
        
              break;   
            
              case "extent":
         
           var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0]));
         var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),3), new dojo.Color([255,255,0,0]));
              break;   
           default:

            alert("nothing");
            return;
                           }
    
    var graphic = new esri.Graphic(geometry, symbol);

        myMap.graphics.add(graphic);
        
         if (whichTool=="Square"){
          var fExtent=geometry;
         }
         else{
         var fExtent = geometry.getExtent();
         }
          
          // myMap.setExtent(fExtent);
            
        
             	//dojo.byId("progresstext").innerHTML = "Locating features...";
          toggleProgressBar(); 
    
   
  	 query = new esri.tasks.Query();
  	 query.returnGeometry = true;
  	  //query.outFields = ["SITUS_DIR","OWNER_LAST","GEOPIN","GIS_ADDRESS"];

      query.outFields = ["SITUS_DIR","SITUS_NUMBER","SITUS_STREET","SITUS_TYPE","COUNCIL_DISTRICTS_COUNCILDIS","GNOCDC_LAB","GEOPIN","OWNER_FIRST","OWNER_LAST","OWNER_MIDNAME","TAX_BILL","GIS_ADDRESS"];
    
      query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
      query.geometry = graphic.geometry;
      qtask.execute(query);
      
     
      }



 function showResultsGeocode(candidates) {
   
   
        var candidate;
        //var symbol = new esri.symbol.SimpleMarkerSymbol();
        var infoTemplate = new esri.InfoTemplate("Location", "Address: ${address}<br />Score: ${score}<br />Source locator: ${locatorName}");

        //symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND);
        //symbol.setColor(new dojo.Color([255,0,0,0.75]));

      //  myMap.graphics.clear();
        
        
        var points =  new esri.geometry.Multipoint(myMap.spatialReference);
        
        var MaxV,MaxI;
        
        MaxI=0;
        MaxV= candidates[0].score;
        
        var i;
        
         for ( i=0, il=candidates.length; i<il; i++) {
         candidate = candidates[i];
         var tt=candidate.address;
          
          if (candidate.score >= MaxV && tt.length>19 ) {
           MaxI=i;
                     
           MaxV=candidate.score;
                   
          }
        }
                  
             
          candidate = candidates[MaxI];
          var symbol = new esri.symbol.PictureMarkerSymbol("pushpin_red.gif", 40, 40);
                      
          var attributes = { address: candidate.address, score:candidate.score, locatorName:candidate.attributes.Loc_name };
          
          var graphic = new esri.Graphic(candidate.location, symbol, attributes, infoTemplate);
 
        
          myMap.graphics.add(graphic);
            myMap.graphics.add(new esri.Graphic(candidate.location, new esri.symbol.TextSymbol(attributes.address).setOffset(0, 8)));
           // points.addPoint(candidate.location);


if (geocodeClosest=="Yes") {
CentralPoint=graphic.geometry;
 var arrayIDs=[7,8,9];
     
  
  
    var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));
          var view1 = { cells: [
              [{name:"Feature Name"},{name:"NAME"},{name:"ID"},{name:"ADDRESS"},{name:"HOUSE NUMBER"},{name:"REPAIR"}  ]
            ]
          };   
          
      var layout = [ view1 ];
     GWGeocodeClosest.setStructure(layout);
  L=0;
  

                                  
   for (var j=0; j<arrayIDs.length; j++){
                      
     var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
     
     var t2=t1+"/"+arrayIDs[j];
   
     s1=LayerNames[j];
   
     var qtaskC = new esri.tasks.QueryTask(t2);
   	 var queryC = new esri.tasks.Query(); 
   	    	  
  	  queryC.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
     
      queryC.geometry = extent0;
     
      queryC.outFields = ["NAME","ID","ADDRESS"];
                   
      queryC.returnGeometry = true;
      
      qtaskC.execute(queryC);
  
      
      dojo.connect(qtaskC, "onComplete", queryGeocodeClosest); 

          
      }


   var highlightSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 18, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,255,255]),5 ), new dojo.Color([0,255,0,0.25]));
   var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 12, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 1), new dojo.Color([0,255,0,0.25]));
         
        
                // Highli粑ht the feature when the mouse hovers over the corresponding grid row
          dojo.connect(GWGeocodeClosest, "onRowMouseOver", function(e){
            var parcel = GWGeocodeClosest.model.data[e.rowIndex][1];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
          
              if((selectedGraphic.attributes) && selectedGraphic.attributes["NAME"] == parcel) {
                selectedGraphic.setSymbol(highlightSymbol);
                return
              }
            }
          });
          
          // Remove feature highlight when mouse goes off the corresponding grid row
          dojo.connect(GWGeocodeClosest, "onRowMouseOut", function(e){
            var parcel = GWGeocodeClosest.model.data[e.rowIndex][1];
            for(var i=0, il=myMap.graphics.graphics.length; i<il; i++){
              var selectedGraphic = myMap.graphics.graphics[i];
              if((selectedGraphic.attributes) && selectedGraphic.attributes["NAME"] == parcel) {
                selectedGraphic.setSymbol(symbol);
                return
              }
            }
          });               
        
      

}

else
{


   var x1=candidate.location.x-0.011;
   var x2=candidate.location.x+0.011;

   var y1=candidate.location.y-0.006;
   var y2=candidate.location.y+0.006;
  
        var xmin = parseFloat(x1);
        var ymin = parseFloat(y1);
        var xmax = parseFloat(x2);
        var ymax = parseFloat(y2);
         
  var env = new esri.geometry.Extent(xmin,ymin,xmax,ymax,new esri.SpatialReference({ wkid: 4326 }));
  myMap.setExtent(env);   

 }  


      }




function call_function(arg){
  document.getElementById("layer_list").style.display = "none";
  
document.getElementById("AddressSearchPane").style.display = "none"; 
   //document.getElementById("center").style.display = "none";
 document.getElementById("gridB").style.display = "none";
   document.getElementById("gridB").style.height = '0px'
   
document.getElementById(arg).style.display = "block";
if (arg=="pnlsearchoption"){
//document.getElementById("pnlsearchoption").style.height = "200px";
}


}

             
      
       function buildLayerList(layer) {
        var infos = layer.layerInfos, info;    
        var sss = "";
        var s1 = "";
        var s2 = "";
        var s3 = ""; 
        var s4 = "";
        var s5 = "";
        var s6 = "";
        var s7 = "";
        var items1 = "";
        var items2 = "";
        var items3 = "";
        var items4 = "";
        var items5 = "";
        var items6 = "";
        ActiveLayerID=8;
        ActiveLayerName="Parcel";
        
        var cityFac = new Array();
        var adminBound = new Array();
        var landBase = new Array();
        var planDev = new Array();
        var baseMap = new Array();
        var microe = new Array();

        cityFac = ['Fire Stations','NOPD District Stations','Libraries'];
        adminBound = ['Council Districts','Neighborhoods','Zipcodes'];
        landBase = ['Parcels','Squares'];
        planDev = ['FEMA Flood Zones','Target Recovery Areas','Elevation_Contours','Housing Opportunity Zones','Renewal Communities','LA Enterprise Zones','Zoning'];
        baseMap = ['Streets','Parks','Parish_Boundary'];
        
        //baseMap = ['Streets','Parks','Parish_Boundary'];
        //microe = ['Microsoft Virtual Earth'];
        microe = [];
        for (var i=0, il=infos.length; i<il; i++) {
          info = infos[i];
            if (i==8) {
                visible.push(info.id);
            }
             if (i==20) {
                visible.push(info.id);
            }
             if (i==4) {
                visible.push(info.id);
            }
            
        LayerNames[i]=info.name ;
        LayerIDs[i]=info.id ;
        
            for (var j=0, jl=cityFac.length; j<jl; j++) {
                if (cityFac[j] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                            s2 = s2+ "<tr  style='font:11px arial;font-weight: bold;height:5px;' ><td  style='height:5px;width:30px' width='20px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td>";
                            s2 = s2 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items1[j]+s2;
                            continue;
                    }
                }
                
            }
            for (var k=0, kl=adminBound.length; k<kl; k++) {
                if (adminBound[k] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                            s3 =s3+  "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s3 = s3 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items2[j]+s3;
//                     
                            continue;
                    }
                }
            }
            for (var h=0, hl=landBase.length; h<hl; h++) {
                if (landBase[h] == info.name) {
                    switch (info.id) {
                    
                        case 8:
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
//                         
                            //sss=sss+items3[j]+s4;
                            continue;
//                            
//                            case 12:
//                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
//                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
//                            //sss=sss+items3[j]+s4;
//                            continue;
         
                          case 12:
                       
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items3[j]+s4;
                            continue;
                    }
                }
            }
//            for (var h=0, hl=microe.length; h<hl; h++) {
//                if (microe[h] == info.name) {
//                    switch (info.id) {
//                    
//                                
//                        default:
//                       
//                            s7 = s7 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
//                            s7 = s7 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
//                            //sss=sss+items3[j]+s4;
//                            continue;
//                    }
//                }
//            }
            for (var g=0, gl=planDev.length; g<gl; g++) {
                if (planDev[g] == info.name) {
                    switch (info.id) {
         
                        default:

                            s5 = s5 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s5 = s5 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                              
                            continue;
                    }
                }
            }
            for (var f=0, fl=baseMap.length; f<fl; f++) {
                if (baseMap[f] == info.name) {
                    switch (info.id) {
                        case 4:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";

                            continue;
                            
                              case 19:
                          s6 = s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                      
                            continue;
                            
                            case 20:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + "Parish Boundary " + "</label></td></tr>";

                            continue;
                    }
                }
            }
        }
                            items4 = "<tr><td colspan=2><font size=1><b><u>Planning and Development</u></b></font></td></tr>";
                            //items6 = "<tr><td colspan=2><font size=1><b><u>Microsoft Virtual Earth</u></b></font></td></tr>";
                            items6 = "";
                            items5 = "<tr><td colspan=2><font size=1><b><u>Base Map</u></b></font></td></tr>";
                            items3 = "<tr><td colspan=2><font size=1><b><u>Land Base</u></b></font></td></tr>";
                            items2 = "<tr><td colspan=2><font size=1><b><u>Administrative Boundaries</u></b></font></td></tr>";
                            
                            items1 = "<tr valign='top'><td colspan=2 valign='top'><font size=1><b><u>City Facilities</u></b></font></td></tr>";

       sss = "<table  height=100% valign='top' style='margin-top:0;margin-bottom:0;vertical-align:top;height:400px'>"+ items1 + s2+items2+ s3+items3+s4+items4+s5+items5+s6+"</table>";
       
    
       dojo.byId("layer_list").innerHTML = sss ;
       
    
    
       layer.setVisibleLayers(visible);
        
     //  myMap.addLayer(layer);
       
            
      }
      
      
      
      function buildLayerList8(layer) {
        var infos = layer.layerInfos, info;    
        var sss = "";
        var s1 = "";
        var s2 = "";
        var s3 = ""; 
        var s4 = "";
        var s5 = "";
        var s6 = "";
        var s7 = "";
        var items1 = "";
        var items2 = "";
        var items3 = "";
        var items4 = "";
        var items5 = "";
        var items6 = "";
        ActiveLayerID=8;
        ActiveLayerName="Parcel";
        
        var cityFac = new Array();
        var adminBound = new Array();
        var landBase = new Array();
        var planDev = new Array();
        var baseMap = new Array();
        var microe = new Array();

        cityFac = ['Fire Stations','NOPD District Stations','Libraries'];
        adminBound = ['Council Districts','Neighborhoods','Zipcodes'];
        landBase = ['Parcels','Squares'];
        planDev = ['FEMA Flood Zones','Target Recovery Areas','Elevation_Contours','Housing Opportunity Zones','Renewal Communities','LA Enterprise Zones','Zoning'];
        baseMap = ['Streets','Parks','Parish_Boundary'];
        
        //baseMap = ['Streets','Parks','Parish_Boundary'];
        //microe = ['Microsoft Virtual Earth'];
        microe = [];
        for (var i=0, il=infos.length; i<il; i++) {
          info = infos[i];
            if (i==0) {
                visible.push(info.id);
            }
             if (i==1) {
                visible.push(info.id);
            }
             if (i==2) {
                visible.push(info.id);
            }
            
            if (i==8) {
                visible.push(info.id);
            }
             if (i==20) {
                visible.push(info.id);
            }
             if (i==4) {
                visible.push(info.id);
            }
            
        LayerNames[i]=info.name ;
        LayerIDs[i]=info.id ;
        
            for (var j=0, jl=cityFac.length; j<jl; j++) {
                if (cityFac[j] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                    
                          s2 = s2 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s2 = s2 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                    
                            //s2 = s2+ "<tr  style='font:11px arial;font-weight: bold;height:5px;' ><td  style='height:5px;width:30px' width='20px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td>";
                            //s2 = s2 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items1[j]+s2;
                            continue;
                    }
                }
                
            }
            for (var k=0, kl=adminBound.length; k<kl; k++) {
                if (adminBound[k] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                            s3 =s3+  "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s3 = s3 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items2[j]+s3;
//                     
                            continue;
                    }
                }
            }
            for (var h=0, hl=landBase.length; h<hl; h++) {
                if (landBase[h] == info.name) {
                    switch (info.id) {
                    
                        case 8:
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                           continue;
         
                          case 12:
                       
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items3[j]+s4;
                            continue;
                    }
                }
            }
           for (var g=0, gl=planDev.length; g<gl; g++) {
                if (planDev[g] == info.name) {
                    switch (info.id) {
         
                        default:

                            s5 = s5 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s5 = s5 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                              
                            continue;
                    }
                }
            }
            for (var f=0, fl=baseMap.length; f<fl; f++) {
                if (baseMap[f] == info.name) {
                    switch (info.id) {
                        case 4:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";

                            continue;
                            
                              case 19:
                          s6 = s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                      
                            continue;
                            
                            case 20:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + "Parish Boundary " + "</label></td></tr>";

                            continue;
                    }
                }
            }
        }
                            items4 = "<tr><td colspan=2><font size=1><b><u>Planning and Development</u></b></font></td></tr>";
                            //items6 = "<tr><td colspan=2><font size=1><b><u>Microsoft Virtual Earth</u></b></font></td></tr>";
                            items6 = "";
                            items5 = "<tr><td colspan=2><font size=1><b><u>Base Map</u></b></font></td></tr>";
                            items3 = "<tr><td colspan=2><font size=1><b><u>Land Base</u></b></font></td></tr>";
                            items2 = "<tr><td colspan=2><font size=1><b><u>Administrative Boundaries</u></b></font></td></tr>";
                            
                            items1 = "<tr valign='top'><td colspan=2 valign='top'><font size=1><b><u>City Facilities</u></b></font></td></tr>";

       sss = "<table  height=100% valign='top' style='margin-top:0;margin-bottom:0;vertical-align:top;height:400px'>"+ items1 + s2+items2+ s3+items3+s4+items4+s5+items5+s6+"</table>";
       
    
       dojo.byId("layer_list").innerHTML = sss ;
       
    
    
       layer.setVisibleLayers(visible);
        
     //  myMap.addLayer(layer);
       
            
      }
      
      
function AllNoVisible(){
  myMap.graphics.clear();
  visible = [];
  ActiveLayerIndex=-1;
  
    layer.setVisibleLayers(visible);
     var infos = layer.layerInfos, info;
        var sss="";
        var s1,s2,ss;
        var items = [];
        
        for (var i=0, il=infos.length; i<il; i++) {
         
          info = infos[i];
        
       switch (info.id) {
        
                
         default:
               
        items[i] = "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' "  + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td>";
         
         s1= "<td style='height:5px'><input type='radio' NAME='ActiveLayer'  onClick='tt("+info.id+")'/></td> ";
          
          s2="<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>" ;
          
          sss=sss+items[i]+s1+s2;
   
         continue;          }
                          
        }
  
      dojo.byId("layer_list").innerHTML = "<table style='margin-top:0;margin-bottom:0' ><tr style='font:11px arial;font-weight: bold;'><td>Visible</td><td>Active</td><td>Layer Name</td></tr>"+sss+"</table>";
   
}      
      

function tt(i)
{

ActiveLayerName=LayerNames[i];
ActiveLayerID=i;
  var inputs = dojo.query(".list_item"), input;
  //inputs[i].checked=true;
  updateLayerVisibility();  
   
  //renderNo(ActiveLayerName);
  
  //ActiveLayerID =LayerIDs[i];
 // myMap.graphics.clear();
var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer/";
var t2=t1+"/"+ActiveLayerID;

  qtask = new esri.tasks.QueryTask(t2);
 queryTask = new esri.tasks.QueryTask(t2);
  
  if (ActiveLayerID<0){
  alert("Please choose an active layer");
  return;
  }
 getViewOutfields(ActiveLayerID)
  
query.returnGeometry = true;
 

}



function getViewOutfields(i){

 switch (i) {
      case 0:
       query.outFields = ["ALT_NAME", "FACILITY_N","ADDR","FACILITY_I","DEPARTMENT"];
         view = { cells: [
              [{name:"NAME"},,{name:"ADDRESS"},{name:"ID"},{name:"HOUSE NUMBER"},{name:"ALT_NAME"}  ]
            ]
          };
              break;  
     
  
     
            
              case 8:
             //query.outFields = ["OWNER_LAST","GEOPIN","GIS_ADDRESS"];
            view = {
		              cells: [
              [{name:"NAME"},{name:"ID"},{name:"ADDRESS"} ]
            ]
          }; 
          
            break;  
          
              case 24:
             query.outFields = ["COUNTYNAME","CTY_KEY","AREA","CY022071","CY022071_I"];
              view = {
		              cells: [
              [{name:"COUNTY NAME"},{name:"CTY_KEY"},{name:"AREA"},{name:"CY022071"},{name:"CY022071_I"}  ]
            ]
          }; 
            break;  
            
                     
                           }


}
     function updateLayerVisibility() {
         var inputs = dojo.query(".list_item"), input;
         

       visible = [];
        for (var i=0, il=inputs.length; i<il; i++) {
     
         if (inputs[i].checked) {
            visible.push(inputs[i].id);

          }
        }
        layer.setVisibleLayers(visible);
//        for (var i=0, il=inputs.length; i<il; i++) {
//        if (visible[i] = '10') {
//        olayer.setVisibleLayers([0]);
//        olayer.show();
//        }
//        }
      }  
        
   function updateLayerVisibility1() {
         var inputs = dojo.query(".list_item"), input;
         
//     
//            if (ActiveLayerID>23 ) {
//     inputs[ActiveLayerID-4].checked=true;
//    }
       visible1 = [];
       olayerlist = [];
        for (var i=0, il=inputs.length; i<il; i++) {
     
         if (inputs[i].checked) {
            visible1.push(inputs[i].id);
          }
        }
        if (visible1[i] == '7') {
        layer.setVisibleLayers([7]);
        }
        //        for (var i=0, il=olayerlist.length; i<il; i++) {
//        olayerlist.splice(olayerlist[i]);
//        }
        for (var i=0, il=visible1.length; i<il; i++) {
        if (visible1[i] == '11') {
        olayerlist[0] = '0'
        }
//        else
//        {
//        olayerlist.splice(0);   
//        }
        if (visible1[i] == '13') {
        olayerlist[1] = '1'
        }
//        else
//        {
//        olayerlist.splice(1);   
//        }
if (visible1[i] == '14') {
        olayerlist[2] = '2'
        }
//        if (visible1[i] == '15') {
//        olayerlist[0] = '3'
//        }
        }
        
        olayer.setVisibleLayers(olayerlist);
        olayer.show();
       }
   
      
   function cmdIdentity(){
   
   myMap.infoWindow.hide();
  
   myMap.graphics.clear();
   
   whichTool="Identity";
   toolbar.deactivate(esri.toolbars.Draw.POLYGON);
   toolbar.deactivate(esri.toolbars.Draw.EXTENT);
   //dojo.byId("progresstext").innerHTML = "Locating features...";
   
    //myMap.graphics.enableMouseEvents();
  
   dojo.connect(myMap, "onClick", executeQueryTask);
    
   
   }
   
        function toggleProgressBar() {
        
		    var progressbar_container = dojo.byId("progressbar_container");
					
			if (progressbar_container.style.display=="block") {
			    progressbar_container.style.display="none";
            }
            else {
                progressbar_container.style.display="block";
            }
        }
        
        
function cmdRefresh(){
 window.location.href = "http://cno-gisweb02.cityofno.com/CNOPropertyviewer/Main.aspx";
 }





        function addToMapC(idResults,evt) {
       
if (idResults.length==1)     {
   
  	    mapChangeNot="Yes";
        var sParcel;
        
        var idResult = idResults[0];
          
           
           var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),2), new dojo.Color([255,255,0,0]));
         var  highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]),3), new dojo.Color([255,255,0,0]));
                    
    
    var graphic = new esri.Graphic(results[0].value.features[0] , highlightSymbol);

        myMap.graphics.add(graphic);
        
        var featureAttributes = idResult.attributes;
        var featureGraphic = idResult.graphic;
       
        var s,i;
        i=0;
        s="";
        
          //var graphic = new esri.Graphic(geometry, symbol);
         //  	dojo.byId("progresstext").innerHTML = "Locating features...";
        //    toggleProgressBar();
     var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
     
     var t2=t1+"/"+ActiveLayerID;
     
     var qtaskC = new esri.tasks.QueryTask(t2);
  
  	 var queryC = new esri.tasks.Query();
   
      queryC.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
queryC.outFields = ["NAME", "ID"];
 
      queryC.geometry = idResult.geometry;
      queryC.returnGeometry = true;

      qtaskC.execute(queryC);
      
    
       dojo.connect(qtaskC, "onComplete", function(fset) {  
             
          var resultFeatures = fset.features;

        var dataForGrid = [];   
        var contents=[];
        
        var s1="";
        var str1,str2,str3,str4,ss1,ss2,ss3,ss4,ss5,ss6; 
        ss1="";
        ss2="";
        ss3="";
        ss4="";
        ss5="";
        ss6="";
        var s,j;
        
  
             
        //var  graphic = resultFeatures[i];
        
        });
                      
      }
      }
     
    

   
    function showCoordinates(evt) {
              var mp = evt.mapPoint;
           // dojo.byId("info").innerHTML = mp.x + ", " + mp.y;
      }
      
   

dojo.addOnLoad(init);

            
       
            
   

      function changeMap(layers) {
        hideImageTiledLayers(layers);
        for (var i=0; i<layers.length; i++) {
          layers[i].show();
        }
      }

      function hideImageTiledLayers(layers) {
        for (var j=0, jl=myMap.layerIds.length-1; j<jl; j++) {
          var layer = myMap.getLayer(myMap.layerIds[j]);
          if (dojo.indexOf(layers, layer) == -1) {
            layer.hide();
          }
        }
      }

function redirect(list) {
if (list.selectedIndex == 0) return;
var url = list.value;
if (url.substring(0,4).toLowerCase() == 'http') { 
	window.open(url, "_blank");
	list.selectedIndex = 0;
} else
	location = url;
}

function swapImage(theID) {
    
    if (theID != 'layers' || theID != 'legend' )
    { 
       activeTab = theID;
      //alert('swapImage' +' ' + theID); 
        document.getElementById(theID).style.backgroundColor = '#EFEFEF';
        document.getElementById(theID).style.borderwidth ='1px';
        document.getElementById(theID).style.borderstyle = 'solid';
        document.getElementById(theID).style.bordercolor = '#7391A9';
        document.getElementById(theID).style.textdecoration = 'none';
        document.getElementById(theID).style.fontsize = '12';
        document.getElementById(theID).style.fontfamily = 'Helvetica';
        document.getElementById(theID).style.color = '#0A345B';
        document.getElementById(theID).style.cursor='default' ;
        if( theID == 'neighbor')
         {
            form1.facilityResult.value = 'neighbor';
            document.getElementById('property').style.padding = '10px 17px 10px 17px';
            document.getElementById('list').style.padding = '10px 17px 10px 17px';
            document.getElementById('details').style.padding = '10px 17px 10px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 10px 17px';
         }
         if( theID == 'property' )
         {
            form1.getResults.value = 'property';
            
            document.getElementById('property').style.padding = '10px 17px 10px 17px';
            document.getElementById('list').style.padding = '10px 17px 10px 17px';
            document.getElementById('details').style.padding = '10px 17px 10px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 10px 17px';
         }
          if( theID == 'list' || theID == 'details' )
         {
            if( theID == 'list')
               { form1.listResults .value = 'list'; }
            if( theID == 'details' )
               { form1.detailResult.value ='details';}
                
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
         }
        
        document.getElementById(theID).style.display = 'inline';
        document.getElementById(theID).style.verticalalign = 'middle';
        document.getElementById(theID).style.textalign = 'justify';
        
        
    } 
    if (theID == 'layers' || theID == 'legend' )
     {
        document.getElementById(theID).src = 'Images/active_' + theID + '.PNG';    
        activeLayer = theID; 
    }
}

function swapImageOut(theID) {
//    document.getElementById(theID).src = 'Images/inactive_' + theID + '.PNG';
//        alert('swapImageOut' +' ' + theID); 
        document.getElementById(theID).style.backgroundColor = '#0A345B';
        document.getElementById(theID).style.borderwidth ='1px';
        document.getElementById(theID).style.borderstyle = 'solid';
        document.getElementById(theID).style.bordercolor = '#FFFFFF';
        document.getElementById(theID).style.textdecoration = 'none';
        document.getElementById(theID).style.fontsize = '12';
        document.getElementById(theID).style.fontfamily = 'Helvetica';
        document.getElementById(theID).style.color = '#FFFFFF';
        document.getElementById(theID).style.cursor='pointer' ;
//         if( theID == 'neighbor')
//         {document.getElementById(theID).style.padding = '10px 17px 11px 17px';}
//         else
//         {document.getElementById(theID).style.padding = '10px 17px 16px 18px';}
        if( theID == 'neighbor')
         {
            document.getElementById('property').style.padding = '10px 17px 10px 17px';
            document.getElementById('list').style.padding = '10px 17px 10px 17px';
            document.getElementById('details').style.padding = '10px 17px 10px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 10px 17px';
         }
         if( theID == 'property' )
         {
            document.getElementById('property').style.padding = '10px 17px 13px 17px';
            document.getElementById('list').style.padding = '10px 17px 13px 17px';
            document.getElementById('details').style.padding = '10px 17px 13px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 13px 17px';
         }
          if( theID == 'list' || theID == 'details' )
         {
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
         }
        document.getElementById(theID).style.verticalalign = 'middle';
        document.getElementById(theID).style.textalign = 'justify';
        //document.getElementById(theID).style.display = 'none';
}

function showPanel(divid) {
    document.getElementById(divid).style.display = 'block';
    document.getElementById(divid).style.height = '400px';
    
    if (divid == 'layer_list') {
        //document.getElementById('help_list').style.display = 'none';
        //document.getElementById('help_list').style.height = '0px';
        document.getElementById('legend_list').style.display = 'none';
        document.getElementById('legend_list').style.height = '0px';
        document.getElementById('legend_list').style.cursor='default';
        swapImage("layers");
         
        swapImageOut("legend");
        //swapImageOut("help");
    }
    if (divid == 'legend_list') {
        document.getElementById('layer_list').style.display = 'none';
        document.getElementById('layer_list').style.height = '0px';
        document.getElementById('legend_list').style.cursor='default';
        //document.getElementById('help_list').style.display = 'none';
        //document.getElementById('help_list').style.height = '0px';
        swapImage("legend");
        swapImageOut("layers");
        //swapImageOut("help");
    }
//    if (divid == 'help_list') {
//        document.getElementById('layer_list').style.display = 'none';
//        document.getElementById('layer_list').style.height = '0px';
//        document.getElementById('legend_list').style.display = 'none';
//        document.getElementById('legend_list').style.height = '0px';
//        swapImage("help");
//        swapImageOut("layers");
//        swapImageOut("legend");
//    }
}

function AllImagesOut()
{
swapImageOut("property");
swapImageOut("list");
swapImageOut("details");
swapImageOut("neighbor");

}

function cmdAddressSearchJavascript()
{
  document.getElementById("infoDetails").style.display ='none';
  document.getElementById("loading").style.display = 'block'; 
  document.getElementById("loading").style.width = '50px';  
}

 function mseOver(id, change)
{
    if (activeLayer != id)
    {
        document.getElementById(id).style.backgroundColor ='#8FB9D1';
        document.getElementById(id).style.fontFamily = 'Helvetica';
        document.getElementById(id).style.fontWeight='bolder';
        document.getElementById(id).style.fontSize ='12px';
        document.getElementById(id).style.color ='#0A345B';
        document.getElementById(id).style.verticalAlign ='middle';
        document.getElementById(id).style.textAlign ='justify'; 
        document.getElementById(id).style.textdecoration='none'; 
        document.getElementById(id).style.borderStyle ='none'; 
        document.getElementById(id).style.display='inline';
        document.getElementById(id).style.padding='7px 17px 5px 17px';
        document.getElementById(id).style.margin = '0px 0px -3px 0px';
        document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
    }
    
    //document.getElementById(id).src = 'Images/' + change + '.PNG';
}
 function mseOut(id)
{

   if (activeLayer == '')
       { activeLayer = 'layers'; }
     
    if (id == 'layers') 
    {   
      if (activeLayer =='layers')
         {  
                //active
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='7px 17px 5px 17px';
                document.getElementById(id).style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
                
                //In active
                document.getElementById('legend').style.backgroundColor ='#0A345B';
                document.getElementById('legend').style.fontFamily = 'Helvetica';
                document.getElementById('legend').style.fontWeight='bolder';
                document.getElementById('legend').style.fontSize ='12px';
                document.getElementById('legend').style.color ='#FFFFFF';
                document.getElementById('legend').style.verticalAlign ='middle';
                document.getElementById('legend').style.textAlign ='justify'; 
                document.getElementById('legend').style.textdecoration='none'; 
                document.getElementById('legend').style.border ='1px solid #0A345B'; 
                document.getElementById('legend').style.display='inline';
                document.getElementById('legend').style.padding='7px 17px 5px 17px';
                document.getElementById('legend').style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
        }
        else
        { 
                document.getElementById('layers').style.backgroundColor ='#0A345B';
                document.getElementById('layers').style.fontFamily = 'Helvetica';
                document.getElementById('layers').style.fontWeight='bolder';
                document.getElementById('layers').style.fontSize ='12px';
                document.getElementById('layers').style.color ='#FFFFFF';
                document.getElementById('layers').style.verticalAlign ='middle';
                document.getElementById('layers').style.textAlign ='justify'; 
                document.getElementById('layers').style.textdecoration='none'; 
                document.getElementById('layers').style.border ='1px solid #0A345B'; 
                document.getElementById('layers').style.display='inline';
                document.getElementById('layers').style.padding='7px 17px 5px 17px';
                document.getElementById('layers').style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
        }
    }
    
    if (id == 'legend') 
    {
         if (activeLayer =='legend')
         {
                //active
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='7px 17px 5px 17px';
                document.getElementById(id).style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
                
                //In active
                document.getElementById('layers').style.backgroundColor ='#0A345B';
                document.getElementById('layers').style.fontFamily = 'Helvetica';
                document.getElementById('layers').style.fontWeight='bolder';
                document.getElementById('layers').style.fontSize ='12px';
                document.getElementById('layers').style.color ='#FFFFFF';
                document.getElementById('layers').style.verticalAlign ='middle';
                document.getElementById('layers').style.textAlign ='justify'; 
                document.getElementById('layers').style.textdecoration='none'; 
                document.getElementById('layers').style.border ='1px solid #0A345B'; 
                document.getElementById('layers').style.display='inline';
                document.getElementById('layers').style.padding='7px 17px 5px 17px';
                document.getElementById('layers').style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
        }
        else
        { 
                document.getElementById('legend').style.backgroundColor ='#0A345B';
                document.getElementById('legend').style.fontFamily = 'Helvetica';
                document.getElementById('legend').style.fontWeight='bolder';
                document.getElementById('legend').style.fontSize ='12px';
                document.getElementById('legend').style.color ='#FFFFFF';
                document.getElementById('legend').style.verticalAlign ='middle';
                document.getElementById('legend').style.textAlign ='justify'; 
                document.getElementById('legend').style.textdecoration='none'; 
                document.getElementById('legend').style.border ='1px solid #0A345B'; 
                document.getElementById('legend').style.display='inline';
                document.getElementById('legend').style.padding='7px 17px 5px 17px';
                document.getElementById('legend').style.margin = '5px 1px -3px 0px';
                document.getElementById('divLayersTab').style.margin = '0px 0px -2px 0px';
        }
    }
}

function TabMseOut (id)
{
    if (id == 'property') 
        {   
            if (activeTab =='property')
            {
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                
                //document.getElementById(id).style.cursor='default' ;
//               SetTabActive ('property');
//               if (form1.facilityResult.value == 'list')
//                { SetTabInActive ('list'); }
//               if (form1.detailResult.value == 'details')
//                { SetTabInActive ('details'); }
//               if (form1.facilityResult.value == 'neighbor')
//                { SetTabInActive ('neighbor'); }
               
//               if (getResults == '')
//               {
//                 document.getElementById('list').style.display='none';
//                 document.getElementById('details').style.display='none';
//                 document.getElementById('neighbor').style.display='none';
//               }
               
           }
           else
            { 
                //SetTabInActive ('property'); 
                document.getElementById(id).style.backgroundColor ='#0A345B';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#FFFFFF';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #0A345B'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='pointer';
            }
                
        }
       
    if (id == 'list') {
        if (activeTab =='list')
            {
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='default' ;
//               SetTabInActive ('property');
//               SetTabActive ('list');
//               if (form1.detailResult.value == 'details')
//                { SetTabInActive ('details'); }
//               if (form1.facilityResult.value == 'neighbor')
//                { SetTabInActive ('neighbor');}
               
            }
            else
             {
                document.getElementById(id).style.backgroundColor ='#0A345B';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#FFFFFF';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #0A345B'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='pointer';
//                SetTabInActive ('list'); 
            }
        
    }
    
    
    
    if (id == 'details') {
        if (activeTab =='details')
        {
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='default' ;
//               SetTabInActive ('property');
//               SetTabInActive ('list');
//               SetTabActive ('details');
//               if (form1.facilityResult.value == 'neighbor')
//                { SetTabInActive ('neighbor'); }
        }
        else
         { 
                document.getElementById(id).style.backgroundColor ='#0A345B';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#FFFFFF';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #0A345B'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='pointer';
//            SetTabInActive ('details');
         }
       
        
   }
   
    if (id == 'neighbor') 
    {
         if (activeTab =='neighbor')
         {
             
                document.getElementById(id).style.backgroundColor ='#EFEFEF';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #7391A9'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='default' ;
//               SetTabInActive ('property');
//               SetTabInActive ('list');
//               if (form1.detailResult.value == 'details')
//                { SetTabInActive ('details'); }
//               SetTabActive ('neighbor');
               
        }
        else
        { 
                document.getElementById(id).style.backgroundColor ='#0A345B';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#FFFFFF';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.border ='1px solid #0A345B'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
                //document.getElementById(id).style.cursor='pointer';
//            SetTabInActive ('neighbor');
        }
    }
    
    if(id =='property' || id == 'neighbor')
    {
        if ( activeTab == 'list' || activeTab == 'details' )
        {
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
        }
    }
}

function TabMseOver(id)
{
    if(id =='property' || id == 'neighbor')
    {
        if ( activeTab == 'list' || activeTab == 'details' )
        {
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
        }
    }
 
    if (activeTab == 'list' || activeTab == 'details' || activeTab == 'neighbor')
    {
        if(activeTab != id)
        {
//            if(id =='property')
//            {
//                document.getElementById(id).style.backgroundColor ='#8FB9D1';
//                document.getElementById(id).style.fontFamily = 'Helvetica';
//                document.getElementById(id).style.fontWeight='bolder';
//                document.getElementById(id).style.fontSize ='12px';
//                document.getElementById(id).style.color ='#0A345B';
//                document.getElementById(id).style.verticalAlign ='middle';
//                document.getElementById(id).style.textAlign ='justify'; 
//                document.getElementById(id).style.textdecoration='none'; 
//                document.getElementById(id).style.borderStyle ='none'; 
//                document.getElementById(id).style.display='inline';
//                document.getElementById(id).style.padding='10px 17px 15px 17px';
//            }
//            else
//            {
                document.getElementById(id).style.backgroundColor ='#8FB9D1';
                document.getElementById(id).style.fontFamily = 'Helvetica';
                document.getElementById(id).style.fontWeight='bolder';
                document.getElementById(id).style.fontSize ='12px';
                document.getElementById(id).style.color ='#0A345B';
                document.getElementById(id).style.verticalAlign ='middle';
                document.getElementById(id).style.textAlign ='justify'; 
                document.getElementById(id).style.textdecoration='none'; 
                document.getElementById(id).style.borderStyle ='none'; 
                document.getElementById(id).style.display='inline';
                document.getElementById(id).style.padding='10px 17px 12px 17px';
//            }
        }
    }
    
     if (activeTab == 'property')
    {
        if(activeTab != id)
        {
            document.getElementById(id).style.backgroundColor ='#8FB9D1';
            document.getElementById(id).style.fontFamily = 'Helvetica';
            document.getElementById(id).style.fontWeight='bolder';
            document.getElementById(id).style.fontSize ='12px';
            document.getElementById(id).style.color ='#0A345B';
            document.getElementById(id).style.verticalAlign ='middle';
            document.getElementById(id).style.textAlign ='justify'; 
            document.getElementById(id).style.textdecoration='none'; 
            document.getElementById(id).style.borderStyle ='none'; 
            document.getElementById(id).style.display='inline';
            document.getElementById(id).style.padding='10px 17px 15px 17px';
        }   
    }
    
//     if( id == 'property')
//         {
//            document.getElementById('property').style.padding = '10px 17px 19px 17px';
//            document.getElementById('list').style.padding = '10px 17px 19px 17px';
//            document.getElementById('details').style.padding = '10px 17px 19px 17px';
//            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
//         }
    
//     if (getResults == '')
//       {
//         document.getElementById('list').style.display='none';
//         document.getElementById('details').style.display='none';
//         document.getElementById('neighbor').style.display='none';
//       }
}

function SetTabActive (id)
{
    document.getElementById(id).style.backgroundColor ='#EFEFEF';
    document.getElementById(id).style.fontFamily = 'Helvetica';
    document.getElementById(id).style.fontWeight='bolder';
    document.getElementById(id).style.fontSize ='12px';
    document.getElementById(id).style.color ='#0A345B';
    document.getElementById(id).style.verticalAlign ='middle';
    document.getElementById(id).style.textAlign ='justify'; 
    document.getElementById(id).style.textdecoration='none'; 
    document.getElementById(id).style.border ='1px solid #7391A9'; 
    document.getElementById(id).style.display='inline';
    //document.getElementById(id).style.padding='10px 17px 12px 17px';
    
     if( id == 'list' || id == 'details' )
         {
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
         }
      if( id == 'property' || id == 'neighbor' )
         {
            document.getElementById('property').style.padding = '10px 17px 12px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 12px 17px';
         }

//    if( id == 'list' || id == 'details' )
//         {
//            document.getElementById('property').style.padding = '10px 17px 19px 17px';
//            document.getElementById('list').style.padding = '10px 17px 19px 19px';
//            document.getElementById('details').style.padding = '10px 17px 19px 17px';
//            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
//         }
//      if( id == 'property' || id == 'neighbor' )
//         {
//            document.getElementById('property').style.padding = '10px 17px 19px 17px';
//            document.getElementById('list').style.padding = '10px 17px 19px 17px';
//            document.getElementById('details').style.padding = '10px 17px 19px 17px';
//            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
//         }
         
}

function SetTabInActive (id)
{
    document.getElementById(id).style.backgroundColor ='#0A345B';
    document.getElementById(id).style.fontFamily = 'Helvetica';
    document.getElementById(id).style.fontWeight='bolder';
    document.getElementById(id).style.fontSize ='12px';
    document.getElementById(id).style.color ='#FFFFFF';
    document.getElementById(id).style.verticalAlign ='middle';
    document.getElementById(id).style.textAlign ='justify'; 
    document.getElementById(id).style.textdecoration='none'; 
    document.getElementById(id).style.border ='1px solid #0A345B'; 
    document.getElementById(id).style.display='inline';
    //document.getElementById(id).style.padding='10px 17px 12px 17px';
    
     if( id == 'list' || id == 'details' )
         {
            document.getElementById('property').style.padding = '10px 17px 19px 17px';
            document.getElementById('list').style.padding = '10px 17px 19px 17px';
            document.getElementById('details').style.padding = '10px 17px 19px 17px';
            document.getElementById('neighbor').style.padding = '10px 17px 19px 17px';
         }
     if( id == 'property' || id == 'neighbor' )
     {
        document.getElementById('property').style.padding = '10px 17px 12px 17px';
        document.getElementById('list').style.padding = '10px 17px 19px 17px';
        document.getElementById('details').style.padding = '10px 17px 19px 17px';
        document.getElementById('neighbor').style.padding = '10px 17px 12px 17px';
     }
         
}

function showPanelGrid(divid,det) {

   
  
   if(divid=="list_list") {}
   else
    {
        document.getElementById(divid).style.display = 'block';
        document.getElementById(divid).style.height = '140px';
    }

       AllImagesOut();

    if (divid == 'property_list') {
    
        document.getElementById('searchtips').style.display = 'block';
        document.getElementById('listview').style.display = 'none';
        document.getElementById('detailsview').style.display = 'none';
        
        document.getElementById('iAll').style.display = 'none';
        document.getElementById('iAll').style.height = '0px';
        
  document.getElementById('idClosestFacility').style.display = 'none';
        document.getElementById('idClosestFacility').style.height = '0px';
document.getElementById('idClosestFacility').style.width = '694px'; 


   document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
  
        
        
  document.getElementById("OwnerNameSearchPane").style.display = "none";
  document.getElementById("OwnerNameSearchPane").style.height = '0px';
 
        
        document.getElementById('details_list').style.display = 'none';
        document.getElementById('details_list').style.height = '0px';
        document.getElementById('neighbor_list').style.display = 'none';
        document.getElementById('neighbor_list').style.height = '0px';
        
          document.getElementById('property').style.visibility = 'visible';
          
               swapImage("property");        
               document.getElementById("AddressSearchPane").style.display = "block";
                document.getElementById("AddressSearchPane").style.visibility = "visible";
               
                 document.getElementById("property_list").style.display = 'block';
                               
                  
                  document.getElementById("AddressSearchPane").style.height = '140px';
                  
                  document.getElementById("TaxBillNumberPane").style.display = "none";
                document.getElementById("TaxBillNumberPane").style.visibility = "hidden";
                
                 document.getElementById('tdPrintList').style.display ='none';
                document.getElementById('tdPrintDetails').style.display ='none';
              
       }
       
    if (divid == 'list_list') {
    
        //SetTabActive ('list');
        document.getElementById('searchtips').style.display = 'none';
        document.getElementById('listview').style.display = 'block';
        document.getElementById('detailsview').style.display = 'none';
     
     document.getElementById('tdPrintList').style.display ='block';
     document.getElementById('tdPrintDetails').style.display ='none';
     
     document.getElementById("OwnerNameSearchPane").style.display = "none";
  document.getElementById("OwnerNameSearchPane").style.height = '0px';
        
        document.getElementById('property_list').style.display = 'none';
        document.getElementById('property_list').style.height = '0px';
        document.getElementById('details_list').style.display = 'none';
        document.getElementById('details_list').style.height = '0px';
        document.getElementById('neighbor_list').style.display = 'none';
        document.getElementById('neighbor_list').style.height = '0px';
         //document.getElementById('list').style.visibility = 'visible';
         document.getElementById('list').style.display = 'block';
 
    
    
    document.getElementById('idClosestFacility').style.display = 'none';
          document.getElementById("idClosestFacility").style.height = "0px";
    document.getElementById('idClosestFacility').style.width = '694px'; 

document.getElementById('Image1').style.display = "none";
document.getElementById('Image2').style.display = "none";
        document.getElementById('iAll').style.display = 'block';
          document.getElementById("iAll").style.height = "240px";
   document.getElementById("iAll").style.width = "694px";     

     //   document.getElementById('iAll').style.height = '0px';
     
   if (iAllorAddress == "1")
        {
//   document.getElementById('list_list').style.display = 'none';
//    document.getElementById('list_list').style.height = '0px';
    document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
  
   document.getElementById('iAll').style.display = 'block';
    //document.getElementById('iAll').style.height = '0px';
    
         }
    
     if (iAllorAddress == "0") {
       
  
 document.getElementById('iAll').style.display = 'none';
 document.getElementById('iAll').style.height = '0px';
       
 // document.getElementById("list_list").style.width = '700px';
  
  document.getElementById("grid").style.display = "block";
  document.getElementById("grid").style.height = '100px';
  document.getElementById("grid").style.width = '694px';     

//  document.getElementById("gridOwner").style.display = "none";
//  document.getElementById("gridOwner").style.height = '0px';
//    //document.getElementById("gridOwner").style.width = '700px'
    
       } 
       
        if (iAllorAddress == "3") {
  
   document.getElementById('iAll').style.display = 'none';
    document.getElementById('iAll').style.height = '0px';
       
//      document.getElementById("list_list").style.display = "block";
// document.getElementById("list_list").style.height = '100px';
// document.getElementById("list_list").style.width = '700px';
  
  
  document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
    //document.getElementById("grid").style.width = '0px'; 
  
//  document.getElementById("gridOwner").style.display = "block";
//  document.getElementById("gridOwner").style.height = '100px';
//  document.getElementById("gridOwner").style.width = '700px';     
//  
       } 
       
            
        if (iAllorAddress == "4") {
  
   document.getElementById('grid').style.display = 'block';
     document.getElementById("grid").style.height = '300px';
  document.getElementById("grid").style.width = '694px';  
  
    //document.getElementById('iAll').style.height = '0px';
       
//      document.getElementById("list_list").style.display = "block";
// document.getElementById("list_list").style.height = '100px';
// document.getElementById("list_list").style.width = '700px';
  
  
  document.getElementById("iAll").style.display = "none";
  document.getElementById("iAll").style.height = '0px';
    //document.getElementById("grid").style.width = '0px'; 
  
//  document.getElementById("gridOwner").style.display = "block";
//  document.getElementById("gridOwner").style.height = '100px';
//  document.getElementById("gridOwner").style.width = '700px';     
//  
       } 
       
       if (det=="1"){
       

 //document.getElementById('iAll').style.height = '0px';
       
 // document.getElementById("list_list").style.width = '700px';
 //alert("2222222222222");
   document.getElementById('idClosestFacility').style.display = 'none';
       document.getElementById("idClosestFacility").style.height = "0px";
  document.getElementById("grid").style.display = "none";
      document.getElementById("grid").style.height = "0px";
   document.getElementById('iAll').style.display = 'block';
 document.getElementById('iAll').style.height = '600px';
       
  document.getElementById("iAll").style.width = '680px';
   
  //document.getElementById("grid").style.height = '100px';
  //document.getElementById("grid").style.width = '694px';     
       
       
       }
       
         if (det == "2") {
  
  
   //document.getElementById('iAll').style.display = 'block';
  //document.getElementById('iAll').style.height = '0px';
       
//  document.getElementById("list_list").style.display = "none";
// document.getElementById("list_list").style.height = '0px';
 //document.getElementById("list_list").style.width = '700px';
  
  
  //document.getElementById("grid").style.display = "none";
 // document.getElementById("grid").style.height = '0px';
    //document.getElementById("grid").style.width = '0px'; 
  
//  document.getElementById("gridOwner").style.display = "block";
//  document.getElementById("gridOwner").style.height = '100px';
//  document.getElementById("gridOwner").style.width = '700px';     
//  
       } 
         swapImage("list");
    }
    
    
    
    if (divid == 'details_list') {
    
        //SetTabActive ('details');
    
        document.getElementById('searchtips').style.display = 'none';
        document.getElementById('listview').style.display = 'none';
        document.getElementById('detailsview').style.display = 'block';
    
        document.getElementById('tdPrintList').style.display ='none';
        document.getElementById('tdPrintDetails').style.display ='block';
     
 document.getElementById('idClosestFacility').style.display = 'none';
          document.getElementById("idClosestFacility").style.height = "0px";
     document.getElementById('idClosestFacility').style.width = '694px'; 

    
    document.getElementById("OwnerNameSearchPane").style.display = "none";
  document.getElementById("OwnerNameSearchPane").style.height = '0px';
  
  document.getElementById('iAll').style.display = 'none';
    document.getElementById('iAll').style.height = '0px';
    
    document.getElementById('grid').style.display = 'none';
    document.getElementById('grid').style.height = '0px';
   //document.getElementById('trSearchOptions').style.display = 'none';
 
        if (det == "1")
        {
            document.getElementById("loading").style.display = 'none'; 
            document.getElementById('infoDetails').style.display='block';
        }
        else
        {   
        
            document.getElementById("loading").style.display = 'block'; 
            document.getElementById("loading").style.width = '50px';  
            
            document.getElementById('infoDetails').style.display='none';   
        }
       
        document.getElementById('property_list').style.display = 'none';
        document.getElementById('property_list').style.height = '0px';
//        document.getElementById('list_list').style.display = 'none';
//        document.getElementById('list_list').style.height = '0px';
        document.getElementById('neighbor_list').style.display = 'none';
        document.getElementById('neighbor_list').style.height = '0px';
        document.getElementById("details").style.display = 'block';
        document.getElementById('details_list').style.height = '30px';
        swapImage("details");
        
   }
   
    if (divid == 'neighbor_list') {
    
        document.getElementById('searchtips').style.display = 'none';
        document.getElementById('listview').style.display = 'none';
        document.getElementById('detailsview').style.display = 'none';
    
    document.getElementById("OwnerNameSearchPane").style.display = "none";
  document.getElementById("OwnerNameSearchPane").style.height = '0px';
 
    document.getElementById('idClosestFacility').style.display = 'block';
          document.getElementById("idClosestFacility").style.height = "300px";
   document.getElementById('idClosestFacility').style.width = '694px'; 

     document.getElementById('iAll').style.display = 'none';
        document.getElementById('iAll').style.height = '0px';
        
         document.getElementById('grid').style.display = 'none';
        document.getElementById('grid').style.height = '0px';
        
        document.getElementById('property_list').style.display = 'none';
        document.getElementById('property_list').style.height = '0px';
       
        document.getElementById('neighbor_list').style.display = 'none';
        document.getElementById('neighbor_list').style.height = '0px';
       
        document.getElementById('details_list').style.display = 'none';
        document.getElementById('details_list').style.height = '0px';
          document.getElementById('neighbor').style.visibility = 'visible';
              document.getElementById('neighbor').style.display = 'block';
              
              document.getElementById('tdPrintDetails').style.display = 'none';
              document.getElementById('tdPrintList').style.display = 'none';
              
        swapImage("neighbor");
            }
}

  function PSearch(){
       var try1=form1.HiddenFieldFilter.value;
       
        var aa=[];
        var sLayer;
        aa=try1.split("?");
       var sBoundaryType=aa[0]; 
       
       
//       if (form1.HiddenBoundaryType.value==7)
//       {sLayer=1;
//       }
//       
       
       var sBoundaryValue=aa[1]; 
       
        var sStartDay=aa[2]; 
       var sEndDay=aa[3]; 
         var sNarrowLayer=aa[4]; 
        var sRadius=aa[5]; 
      
        
      //create find task with url to map service
          var findTask = new esri.tasks.FindTask("http://199.0.171.158/ArcGIS/rest/services/crime/MapServer");

          //create find parameters and define known values
          var findParams = new esri.tasks.FindParameters();
          findParams.returnGeometry = true;
          findParams.layerIds = [sLayer];
          findParams.searchFields = ["NOPD_DISTRICT"];

 //set the search text to find parameters
        findParams.searchText = form1.HiddenBoundaryValue.value;
        
             
        findTask.execute(findParams,showResultsP);
  
         
   }
   
    function moverF(aa){
         aa.style.color=  "rgb(73,143,250)"; 
               }


  function moutF(aa) {
aa.style.color = "rgb(0,100,200)";
        }
        
        
   
   
   
function disclaimer() {
	alert('CITY OF NEW ORLEANS - DISCLAIMER\n\nThis information is derived from the City of New Orleans Enterprise GIS Database. The data are not a survey-quality product and the end user assumes the risk of utilizing it. The City of New Orleans does not assume any liability for damages arising from errors, omissions, or use of this information. End users are advised to be aware of the published accuracy, date, compilation methods, and cartographic format as described in the accompanying metadata, and are advised to utilize these data appropriately.');
}


    

 function buildLayerList2(layer) {
        var infos = layer.layerInfos, info;    
        var sss = "";
        var s1 = "";
        var s2 = "";
        var s3 = ""; 
        var s4 = "";
        var s5 = "";
        var s6 = "";
        var items1 = "";
        var items2 = "";
        var items3 = "";
        var items4 = "";
        var items5 = "";
        ActiveLayerID=8;
        ActiveLayerName="Parcel";
        
        var cityFac = new Array();
        var adminBound = new Array();
        var landBase = new Array();
        var planDev = new Array();
        var baseMap = new Array();
        
        cityFac = ['Fire Stations','NOPD District Stations','Libraries'];
        adminBound = ['Council Districts','Neighborhoods','Zipcodes'];
        landBase = ['Addresses','Parcels','Lots','Squares'];
        planDev = ['Orleans Parish Zoning ','FEMA Flood Zones','Target Recovery Areas','Housing Opportunity Zones','Renewal Communities','LA Enterprise Zones'];
        baseMap = ['Streets','Parks','Imagery'];
        
        for (var i=0, il=infos.length; i<il; i++) {
   
          info = infos[i];
            if (i==8 || i==0 || i==1 || i==2) {
                visible.push(info.id);
            }
        LayerNames[i]=info.name ;
        LayerIDs[i]=info.id ;
        
            for (var j=0, jl=cityFac.length; j<jl; j++) {
                if (cityFac[j] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                          s2 = s2 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                        
                        //    s2 = s2+ "<tr  style='font:11px arial;font-weight: bold;height:5px;' ><td  style='height:5px;width:30px' width='20px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td>";
                            s2 = s2 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items1[j]+s2;
                            continue;
                    }
                }
                
            }
            for (var k=0, kl=adminBound.length; k<kl; k++) {
                if (adminBound[k] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                            s3 =s3+  "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s3 = s3 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items2[j]+s3;
                            continue;
                    }
                }
            }
            for (var h=0, hl=landBase.length; h<hl; h++) {
                if (landBase[h] == info.name) {
                    switch (info.id) {
                    
                        case 8:
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items3[j]+s4;
                            continue;
                            
                            case 9:
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items3[j]+s4;
                            continue;
         
                        default:
                            s4 = s4 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s4 = s4 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items3[j]+s4;
                            continue;
                    }
                }
            }
            
            for (var g=0, gl=planDev.length; g<gl; g++) {
                if (planDev[g] == info.name) {
                    switch (info.id) {
                       
         
                        default:
                            s5 = s5 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s5 = s5 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items4[j]+s5;
                            continue;
                    }
                }
            }
            for (var f=0, fl=baseMap.length; f<fl; f++) {
                if (baseMap[f] == info.name) {
                    switch (info.id) {
                        case 4:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' checked='true'" + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";          
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items5[j]+s6;
                            continue;
         
                        default:
                            s6= s6 + "<tr  style='font:11px arial;font-weight: bold;height:5px' ><td  style='height:5px'><input type='checkbox' class='list_item' " + "' id='" + info.id + "' onclick='updateLayerVisibility()' /></td> ";
                            s6 = s6 + "<td style='height:5px'><label for='" + info.id + "'>" + info.name + "</label></td></tr>";
                            //sss=sss+items5[j]+s6;
                            continue;
                    }
                }
            }
        }
                            items4 = "<tr><td colspan=2><font size=1><b><u>Planning and Development</u></b></font></td></tr>";
                            items5 = "<tr><td colspan=2><font size=1><b><u>Base Map</u></b></font></td></tr>";
                            items3 = "<tr><td colspan=2><font size=1><b><u>Land Base</u></b></font></td></tr>";
                            items2 = "<tr><td colspan=2><font size=1><b><u>Administrative Boundaries</u></b></font></td></tr>";
                            
                            items1 = "<tr valign='top'><td colspan=2 valign='top'><font size=1><b><u>City Facilities</u></b></font></td></tr>";

       sss = "<table  height=100% valign='top' style='margin-top:0;margin-bottom:0;vertical-align:top;height:400px'>"+ items1 + s2+items2+ s3+items3+s4+items4+s5+items5+s6+"</table>";
       
    
       dojo.byId("layer_list").innerHTML = sss ;
       
    
    
       layer.setVisibleLayers(visible);
        
       myMap.addLayer(layer);
            
       
            
      }
      
      
      
     function showResultsClosest(){
  
       L=-1;   

    arrayIDs=[0,1,2];

//var extent1= new esri.geometry.Extent(-90.239387,29.864330,-89.726552,30.179242,new esri.SpatialReference({wkid:4326}));

//var extent0= new esri.geometry.Extent(-90.1369023835124,29.9255038028229,-90.0413153315501,30.0196849440074,new esri.SpatialReference({wkid:4326}));


  var extent0= new esri.geometry.Extent(-90.239387,29.824330,-89.726552,30.139242,new esri.SpatialReference({wkid:4326}));

                                  
   for (var j=0; j<arrayIDs.length; j++){
                      
       
     var t1="http://199.0.171.158/ArcGIS/rest/services/CNOProperty/MapServer";
     
     
     var t2=t1+"/"+arrayIDs[j];
         
     var qtaskC = new esri.tasks.QueryTask(t2);
   	 var queryC = new esri.tasks.Query(); 
   
     queryC.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
     
     queryC.geometry = extent0;
     queryC.outFields = ["FACILITY_N","ADDR","XMIN","YMIN","X","Y"];
      
                   
      queryC.returnGeometry = true;
    
    
      qtaskC.execute(queryC);
      
      dojo.connect(qtaskC, "onComplete", queryClosest); 
      
      }        
      
      }    
      
              
function queryClosest(fset) {
   var st1="";
            var resultFeatures = fset.features;
            
        L=L+1;

         ArrayClosestX[L] =new Array();
          ArrayClosestY[L] =new Array();
          
           ArrayClosestXg[L] =new Array();
          ArrayClosestYg[L] =new Array();
          
           
            ArrayClosestN[L] =new Array();
             ArrayClosestA[L] =new Array();
    
    
        for (var i=0, il=resultFeatures.length; i<il; i++) {
      
       var graphic = resultFeatures[i];
        ArrayClosestXg[L][i]=graphic.geometry.x;
        
        
        
        ArrayClosestYg[L][i]=graphic.geometry.y;
       
              
       ArrayClosestX[L][i]=graphic.attributes["X"];
             
       ArrayClosestY[L][i]=graphic.attributes["Y"];
               
     if (graphic.attributes['FACILITY_N']=='Null'|| graphic.attributes['FACILITY_N']==undefined) {st1="";}
          else {st1=graphic.attributes['FACILITY_N']}
      ArrayClosestN[L][i]=st1;
       
       
       if (graphic.attributes['ADDR']=='Null'|| graphic.attributes['ADDR']==undefined) {st1="";}
          else {st1=graphic.attributes['ADDR']}
        ArrayClosestA[L][i]=st1;
                 
              }  
              
              
               
       }
           
           
function GoFacilities2()
{


   buildLayerList8(layer);
  var fExtent1 = feature.geometry.getExtent();   
  var point = fExtent1.getCenter();
  var xx=point.x;
  var yy=point.y;

smallX=point.x;
smallY=point.y;
bigX=point.x;
bigY=point.y;

     var graphic = new esri.Graphic(point, symbol);
      var outSR = new esri.SpatialReference({ wkid: 102682});
       var pt=null;
        var k,i ;
        var disFireStation;
      

    gsvc.project([ graphic ], outSR, function(features) {
   
     
      pt = features[0].geometry;
       var x=pt.x;
      
      var y=pt.y;

      showPanelGrid('neighbor_list');

document.getElementById('grid').style.display = 'none'; 

document.getElementById('grid').style.height = '0px'; 


document.getElementById('AddressSearchPane').style.display = 'none'; 

document.getElementById('AddressSearchPane').style.height = '0px'; 


document.getElementById('iAll').style.display = 'none'; 

document.getElementById('iAll').style.height = '0px'; 


document.getElementById('neighbor_list').style.display = 'none'; 

document.getElementById('neighbor_list').style.height = '0px'; 

document.getElementById('tdPrintDetails').style.display = 'none'; 
document.getElementById('tdPrintList').style.display = 'none';

document.getElementById('idClosestFacility').style.display = 'block'; 

document.getElementById('idClosestFacility').style.height = '300px'; 

document.getElementById('idClosestFacility').style.width = '694px'; 
    
     
         
     var ArrayDa0=[];
     var ArrayDb0=[];
    
      k=0;
      i=0;
     var dis0,ss0,ss1,ss2,start1,start0,DIS;
     
     DIS=9.9999;
     
     start0="<table style='width:100%;height:72px;border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;'>Type</td><td style='font-size:12;'>Facility Name</td><td style='font-size:12;'>Address</td><td style='font-size:12;'> Straight Distance</td><td style='font-size:12;cursor:pointer;'>Zoom To</td><td style='font-size:12;cursor:pointer;'>Get There</td></tr>";
     
     start1="";
   //  document.getElementById("idClosestFacility").style.display = "block";
     // document.getElementById("idClosestFacility").style.height = "0px";
      var m=0;
         
      for (var i=0, il=34; i<il; i++) {
         ArrayDa0[i]=Math.sqrt((x-ArrayClosestX[0][i])*(x-ArrayClosestX[0][i])+(y-ArrayClosestY[0][i])*(y-ArrayClosestY[0][i]))/5280;
         ArrayDb0[i]=ArrayDa0[i];
      }
                 
         
        ArrayDa0.sort(); 
                      
            m=0;
         
      for (var i=0, il=34; i<il; i++) {
         
        for (var k=0,il=34;k<il;k++) 
        {
         if (ArrayDb0[k]<=DIS & ArrayDb0[k]==ArrayDa0[i] & m<2 )
          {
                     if (smallX>=ArrayClosestXg[0][i]) {
                smallX=ArrayClosestXg[0][i];
                        }  
             
                  if (bigX<ArrayClosestXg[0][i]) {
        bigX=ArrayClosestXg[0][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[0][i]) {
        smallY=ArrayClosestYg[0][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[0][i]) {
        bigY=ArrayClosestYg[0][i];
                        }  
          
          m=m+1;
         
        var sGeopin=feature.attributes["GEOPIN"];
        
                 if (m==1) {
          dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
    
          var st1=ArrayClosestN[0][k];
         
         
      start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+");'  onmouseout='mout(this);' " + " ><td >Fire Station</td><td>"+st1+"</td><td>"+ArrayClosestA[0][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
         var ss11="<td> <a onclick='Highlightfeature("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
               }
              if (m>1 && m<3)  { 
              dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[0][k];
      
   start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[0][k]+"</td><td align='center'>"+sL+"</td>";
   
     
         var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;cursor:pointer;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
         var ss11="<td> <a onclick='Highlightfeature("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;cursor:pointer;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
   }
   
       }
               
        }
        
        }
         
           var  ArrayDa1=[];

  for (var i=0, il=14; i<il; i++) {
                      
         ArrayDa1[i]=Math.sqrt((x-ArrayClosestX[1][i])*(x-ArrayClosestX[1][i])+(y-ArrayClosestY[1][i])*(y-ArrayClosestY[1][i]))/5280;
       
         ArrayDb0[i]=ArrayDa1[i];
                   
        }
         
        ArrayDa1.sort(); 
                
        
            m=0;
         
      for (var i=0, il=14; i<il; i++) {
         
        for (var k=0,il=14;k<il;k++) 
        {
         if (ArrayDb0[k]<=DIS & ArrayDb0[k]==ArrayDa1[i])
          {
          
             if (smallX>=ArrayClosestXg[1][i]) {
                smallX=ArrayClosestXg[1][i];
                        }  
             
                  if (bigX<ArrayClosestXg[1][i]) {
        bigX=ArrayClosestXg[1][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[1][i]) {
        smallY=ArrayClosestYg[1][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[0][i]) {
        bigY=ArrayClosestYg[1][i];
                        }  
          
          m=m+1;
       
            if (m==1) {
          dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[1][k];
           start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+");'  onmouseout='mout(this);' " + " ><td >Library</td><td>"+st1+"</td><td>"+ArrayClosestA[1][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature1("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
      
               }
              if (m>1 && m<3)  { dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[1][k];
           
         start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[1][k]+"</td><td align='center'>"+sL+"</td>";
    
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature1("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
 }
 }
               
        }
        
        }
        
       var ArrayD3=[];
var  ArrayDa2=[];
for (var i=0, il=9; i<il; i++) {
                      
         ArrayDa2[i]=Math.sqrt((x-ArrayClosestX[2][i])*(x-ArrayClosestX[2][i])+(y-ArrayClosestY[2][i])*(y-ArrayClosestY[2][i]))/5280;
                       
         ArrayD3[i]=ArrayDa2[i];
                          
        }
         
        ArrayDa2.sort(); 
                
        
            m=0;
         
      for (var i=0, il=9; i<il; i++) {
            
        for (var k=0,il=9;k<il;k++) 
        {
       
         if (ArrayD3[k]<=DIS & ArrayD3[k]==ArrayDa2[i])
          {
          
             if (smallX>=ArrayClosestXg[2][i]) {
                smallX=ArrayClosestXg[2][i];
                        }  
             
                  if (bigX<ArrayClosestXg[2][i]) {
        bigX=ArrayClosestXg[2][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[2][i]) {
        smallY=ArrayClosestYg[2][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[2][i]) {
        bigY=ArrayClosestYg[2][i];
                        }  
          
          m=m+1;
       
                 if (m==1) {
          dis0=ArrayD3[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
    
          var st1=ArrayClosestN[2][k];
     
        start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+");'  onmouseout='mout(this);' " + " ><td >NOPD Police</td><td>"+st1+"</td><td>"+ArrayClosestA[2][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; cursor:pointer;font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature2("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
    
               }
               
           if (m>1 && m<3)  { dis0=ArrayD3[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
          var st1=ArrayClosestN[2][k];
           
             start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[2][k]+"</td><td align='center'>"+sL+"</td>";
   
           var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature2("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
 
      }
      
        }
               
        }
        
        }
                  
     
       ss3=start0+start1+"</table>";        
           dojo.byId("idClosestFacility").innerHTML =ss3;
                      
           var smallX0=xx-(bigX-smallX)/2;
            var bigX0=xx+(bigX-smallX)/2;
            var smallY0=yy-(bigY-smallY)/2;
            var bigY0=yy+(bigY-smallY)/2;
            var extent0= new esri.geometry.Extent(smallX0,smallY0,bigX0,bigY0,new esri.SpatialReference({wkid:4326}));
                          
          myMap.setExtent(extent0);
      });
    
     

}



function GoFacilitiesNoGeopin(xx,yy)
{

buildLayerList8(layer);

var smallX=xx;
var smallY=yy;
var bigX=xx;
var bigY=yy;

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));

 var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );

     var graphic = new esri.Graphic(pp, symbol);
     var outSR = new esri.SpatialReference({ wkid: 102682});
     var pt=null;
        var k,i ;
        var disFireStation;
      

     gsvc.project([ graphic ], outSR, function(features) {
   
      pt = features[0].geometry;
    
      var x=pt.x;
      
      var y=pt.y;


      showPanelGrid('neighbor_list');

document.getElementById('grid').style.display = 'none'; 

document.getElementById('grid').style.height = '0px'; 


document.getElementById('AddressSearchPane').style.display = 'none'; 

document.getElementById('AddressSearchPane').style.height = '0px'; 


document.getElementById('iAll').style.display = 'none'; 

document.getElementById('iAll').style.height = '0px'; 


document.getElementById('neighbor_list').style.display = 'none'; 

document.getElementById('neighbor_list').style.height = '0px'; 

document.getElementById('tdPrintDetails').style.display = 'none'; 
document.getElementById('tdPrintList').style.display = 'none';

document.getElementById('idClosestFacility').style.display = 'block'; 

document.getElementById('idClosestFacility').style.height = '300px'; 

document.getElementById('idClosestFacility').style.width = '694px'; 
    
     
         
     var ArrayDa0=[];
     var ArrayDb0=[];
    
      k=0;
      i=0;
     var dis0,ss0,ss1,ss2,start1,start0,DIS;
     
     DIS=9.9999;
     
     start0="<table style='width:100%;height:72px;border:1px; bordercolor:rgb(255,255,128);vertical-align: middle'> <tr align='center' style='background-color:rgb(230,230,230);font-family: Arial, Helvetica, sans-serif; font-weight: bold;height:22'><td style='font-size:12;'>Type</td><td style='font-size:12;'>Facility Name</td><td style='font-size:12;'>Address</td><td style='font-size:12;'> Straight Distance</td><td style='font-size:12;cursor:pointer;'>Zoom To</td><td style='font-size:12;cursor:pointer;'>Get There</td></tr>";
     
     start1="";
   //  document.getElementById("idClosestFacility").style.display = "block";
     // document.getElementById("idClosestFacility").style.height = "0px";
      var m=0;
         
      for (var i=0, il=34; i<il; i++) {
         ArrayDa0[i]=Math.sqrt((x-ArrayClosestX[0][i])*(x-ArrayClosestX[0][i])+(y-ArrayClosestY[0][i])*(y-ArrayClosestY[0][i]))/5280;
         ArrayDb0[i]=ArrayDa0[i];
      }
                 
         
        ArrayDa0.sort(); 
                      
            m=0;
         
      for (var i=0, il=34; i<il; i++) {
         
        for (var k=0,il=34;k<il;k++) 
        {
         if (ArrayDb0[k]<=DIS & ArrayDb0[k]==ArrayDa0[i] & m<2 )
          {
                     if (smallX>=ArrayClosestXg[0][i]) {
                smallX=ArrayClosestXg[0][i];
                        }  
             
                  if (bigX<ArrayClosestXg[0][i]) {
        bigX=ArrayClosestXg[0][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[0][i]) {
        smallY=ArrayClosestYg[0][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[0][i]) {
        bigY=ArrayClosestYg[0][i];
                        }  
          
          m=m+1;
         
        //var sGeopin=feature.attributes["GEOPIN"];
        
                 if (m==1) {
          dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
    
          var st1=ArrayClosestN[0][k];
         
         
      start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+");'  onmouseout='mout(this);' " + " ><td >Fire Station</td><td>"+st1+"</td><td>"+ArrayClosestA[0][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
         var ss11="<td> <a onclick='Highlightfeature("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
               }
              if (m>1 && m<3)  { 
              dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[0][k];
      
   start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[0][k]+"</td><td align='center'>"+sL+"</td>";
   
     
         var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;cursor:pointer;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
         var ss11="<td> <a onclick='Highlightfeature("+k+","+ ArrayClosestXg[0][k]+","+ ArrayClosestYg[0][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; font-size:12;cursor:pointer;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
   }
   
       }
               
        }
        
        }
         
           var  ArrayDa1=[];

  for (var i=0, il=14; i<il; i++) {
                      
         ArrayDa1[i]=Math.sqrt((x-ArrayClosestX[1][i])*(x-ArrayClosestX[1][i])+(y-ArrayClosestY[1][i])*(y-ArrayClosestY[1][i]))/5280;
       
         ArrayDb0[i]=ArrayDa1[i];
                   
        }
         
        ArrayDa1.sort(); 
                
        
            m=0;
         
      for (var i=0, il=14; i<il; i++) {
         
        for (var k=0,il=14;k<il;k++) 
        {
         if (ArrayDb0[k]<=DIS & ArrayDb0[k]==ArrayDa1[i])
          {
          
             if (smallX>=ArrayClosestXg[1][i]) {
                smallX=ArrayClosestXg[1][i];
                        }  
             
                  if (bigX<ArrayClosestXg[1][i]) {
        bigX=ArrayClosestXg[1][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[1][i]) {
        smallY=ArrayClosestYg[1][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[0][i]) {
        bigY=ArrayClosestYg[1][i];
                        }  
          
          m=m+1;
       
            if (m==1) {
          dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[1][k];
           start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+");'  onmouseout='mout(this);' " + " ><td >Library</td><td>"+st1+"</td><td>"+ArrayClosestA[1][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature1("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
      
               }
              if (m>1 && m<3)  { dis0=ArrayDb0[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
           var st1=ArrayClosestN[1][k];
           
         start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[1][k]+"</td><td align='center'>"+sL+"</td>";
    
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature1("+k+","+ ArrayClosestXg[1][k]+","+ ArrayClosestYg[1][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
 }
 }
               
        }
        
        }
        
       var ArrayD3=[];
var  ArrayDa2=[];
for (var i=0, il=9; i<il; i++) {
                      
         ArrayDa2[i]=Math.sqrt((x-ArrayClosestX[2][i])*(x-ArrayClosestX[2][i])+(y-ArrayClosestY[2][i])*(y-ArrayClosestY[2][i]))/5280;
                       
         ArrayD3[i]=ArrayDa2[i];
                          
        }
         
        ArrayDa2.sort(); 
                
        
            m=0;
         
      for (var i=0, il=9; i<il; i++) {
            
        for (var k=0,il=9;k<il;k++) 
        {
       
         if (ArrayD3[k]<=DIS & ArrayD3[k]==ArrayDa2[i])
          {
          
             if (smallX>=ArrayClosestXg[2][i]) {
                smallX=ArrayClosestXg[2][i];
                        }  
             
                  if (bigX<ArrayClosestXg[2][i]) {
        bigX=ArrayClosestXg[2][i];
                }  
                
                              
        if (smallY>=ArrayClosestYg[2][i]) {
        smallY=ArrayClosestYg[2][i];
    
                }  
                 
                  if (bigY<ArrayClosestYg[2][i]) {
        bigY=ArrayClosestYg[2][i];
                        }  
          
          m=m+1;
       
                 if (m==1) {
          dis0=ArrayD3[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
    
          var st1=ArrayClosestN[2][k];
     
        start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px' onmouseover='mover(this,"+ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+");'  onmouseout='mout(this);' " + " ><td >NOPD Police</td><td>"+st1+"</td><td>"+ArrayClosestA[2][k]+"</td><td align='center'>"+sL+ "</td>";
          var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline; cursor:pointer;font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature2("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
    
               }
               
           if (m>1 && m<3)  { dis0=ArrayD3[k];
          var sD=dis0.toString();
          var sL=sD.substring(0,6)+" miles";
          var st1=ArrayClosestN[2][k];
           
             start1=start1+"<tr style='background-color:rgb(252,252,252);height:24px; border:1px' onmouseover='mover(this,"+ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+");'  onmouseout='mout(this);' " + " ><td></td><td>"+st1+"</td><td>"+ArrayClosestA[2][k]+"</td><td align='center'>"+sL+"</td>";
   
           var ss10="<td> <a onclick='FindIt("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Zoom To </a>" +  "</td>";
         
            var ss11="<td> <a onclick='Highlightfeature2("+k+","+ ArrayClosestXg[2][k]+","+ ArrayClosestYg[2][k]+") ;' onmouseout='mout2(this);'  onmouseover='mover2(this);' style='text-decoration: underline;cursor:pointer; font-size:12;color: rgb(0,100,200)' > Get There </a>" +  "</td></tr>";
            
         start1=start1 + ss10 + ss11;
 
      }
      
        }
               
        }
        
        }
                  
     
       ss3=start0+start1+"</table>";        
           dojo.byId("idClosestFacility").innerHTML =ss3;
                      
           var smallX0=xx-(bigX-smallX)/2;
            var bigX0=xx+(bigX-smallX)/2;
            var smallY0=yy-(bigY-smallY)/2;
            var bigY0=yy+(bigY-smallY)/2;
            var extent0= new esri.geometry.Extent(smallX0,smallY0,bigX0,bigY0,new esri.SpatialReference({wkid:4326}));
                
          myMap.setExtent(extent0);
      });
    
     

}

  function mover(aa,a,b) {
      //    myMap.infoWindow.resize(200, 200);
         //myMap.infoWindow.hide();
         
    var ActiveLayerName="gggg";
    aa.style.backgroundColor = "rgb(220,230,250)";
    var pp=new esri.geometry.Point(a,b, new esri.SpatialReference({ wkid: 4326 }));
    //var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 20, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 1), new dojo.Color([0,255,0,0.25]));
    var  highlightSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]), 6), new dojo.Color([0,255,0,0.25]));
       
    //var attributes = { address: "hhhh", score:"candidate.score", locatorName:"candidate.attributes.Loc_name" };

       graphic1 = new esri.Graphic(pp, highlightSymbol);
          
       myMap.graphics.add(graphic1);

}

function mout(aa) {
//graphicMove.hide();

   myMap.graphics.remove(graphic1);
  aa.style.backgroundColor = "rgb(250,250,250)";


}


 function FindIt(k,xx,yy)
     {
                      
            var smallX0=xx-0.001;
            var bigX0=xx+0.001;
            var smallY0=yy-0.001;
            var bigY0=yy+0.001;
         
            var extent0= new esri.geometry.Extent(smallX0,smallY0,bigX0,bigY0,new esri.SpatialReference({wkid:4326}));
                          
            myMap.setExtent(extent0);
              
         
     }    
     
 
function Highlightfeature2(k,a,b)
{

smallX=a-0.001;
smallY=b-0.001;
bigX=a+0.001;
bigY=b+0.0001;
 
   myMap.graphics.remove(graphic1);

 var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
           
 var a= sAddress+",New Orleans,LA";

      var b= ArrayClosestN[2][k] ; 
     
       var ss,s1;
       
     s1=ArrayClosestA[2][k]+",New Orleans,LA";
       
      var c="From "+sAddress  +  " To " +ArrayClosestA[2][k]+ "( "+ b + " )" ;
      
    ss="GoogleMap.aspx?" + c + "?" + a +" to "+ s1 ;
   
  window.open(ss,"window1","left=200,top=140,width=920,directories=no,height=640,resizable=no,location=no");


}

     
function Highlightfeature1(k,a,b)
{

smallX=a-0.001;
smallY=b-0.001;
bigX=a+0.001;
bigY=b+0.0001;
 
   myMap.graphics.remove(graphic1);

 var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
           
 var a= sAddress+",New Orleans,LA";

      var b= ArrayClosestN[1][k] ; 
     
       var ss,s1;
       
     s1=ArrayClosestA[1][k]+",New Orleans,LA";
       
      var c="From "+sAddress  +  " To " +ArrayClosestA[1][k]+ "( "+ b + " )" ;
      
    ss="GoogleMap.aspx?" + c + "?" + a +" to "+ s1 ;
   
   //window.open(ss,"window1","width=300,height=200,resizable=yes,location=1");
    window.open(ss,"window1","left=200,top=140,width=920,directories=no,height=640,resizable=no,location=no");


}

function Highlightfeature(k,a,b)
{

smallX=a-0.001;
smallY=b-0.001;
bigX=a+0.001;
bigY=b+0.0001;
 
   myMap.graphics.remove(graphic1);

 var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
           
 var a= sAddress+",New Orleans,LA";

      var b= ArrayClosestN[0][k] ; 
     
       var ss,s1;
       
     s1=ArrayClosestA[0][k]+",New Orleans,LA";
       
      var c="From "+sAddress  +  " To " +ArrayClosestA[0][k]+ "( "+ b + " )" ;
      
    ss="GoogleMap.aspx?" + c + "?" + a +" to "+ s1 ;
   
   window.open(ss,"window1","left=200,top=140,width=920,directories=no,height=640,resizable=no,location=no");

}

function locateAddressNoGeopin()
{
myMap.graphics.clear();

var aAddress = new Array();
 var s1=form1.HiddenFieldStreet.value;
 aAddress=s1.split("/");
sAddress=aAddress[0]+ " "+ aAddress[1]+ " " +aAddress[2]+" "+ aAddress[3]+" "+aAddress[4];


var xx=parseFloat(form1.HiddenFieldLon.value);

var yy=parseFloat(form1.HiddenFieldLat.value);

var pp=new esri.geometry.Point(xx,yy, new esri.SpatialReference({ wkid: 4326 }));
    
           
   var symbol = new esri.symbol.SimpleMarkerSymbol( esri.symbol.SimpleMarkerSymbol.STYLE_CROSS, 14, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2)  );
   
   var graphic = new esri.Graphic(pp, symbol);
    
    
   myMap.infoWindow.resize(240, 110);
     
   var s="<div style='width:100%;height:100%;align:center;vertical-align: middle;background-color:rgb(212,212,212)'><table align='center' valign='middle' style='background-color:white'><tr><td align='center' style='background-color: rgb(185,220,255)'>Address</td><td>"+sAddress;
    
   //var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>there are no corresponding parcel with the address.  </td></tr></table></div>";
  var s1="</td></tr><tr style='height:20px;align:center;vertical-align: middle;'><td></td><td  style='height:40px;align:center'>There are no corresponding parcels for this address.  </td></tr></table></div>";
     
   s=s+s1;
         
     myMap.infoWindow.setTitle("Locate:").setContent(s);
    
     myMap.infoWindow.show(myMap.toScreen(pp),myMap.getInfoWindowAnchor(myMap.toScreen(pp)));  
 document.getElementById('loadingsearch').style.display = 'none';      
     myMap.graphics.add(graphic);
     
     smallX=xx-0.001;
     smallY=yy-0.001;
     bigX=xx+0.001;
     bigY=yy+0.001;
 
     var extent0= new esri.geometry.Extent(smallX,smallY,bigX,bigY,new esri.SpatialReference({wkid:4326}));
                          
      myMap.setExtent(extent0);           
}

function cmdErase() {
  myMap.graphics.clear();
  myMap.infoWindow.hide();
 
 document.getElementById("mainTabContainer").style.display = "none";
 
   document.getElementById('iAll').style.display = 'none';
        document.getElementById('iAll').style.height = '0px';
        
  document.getElementById('idClosestFacility').style.display = 'none';
        document.getElementById('idClosestFacility').style.height = '0px';
document.getElementById('idClosestFacility').style.width = '694px'; 


   document.getElementById("grid").style.display = "none";
  document.getElementById("grid").style.height = '0px';
  
        
        
  document.getElementById("OwnerNameSearchPane").style.display = "none";
  document.getElementById("OwnerNameSearchPane").style.height = '0px';
 
 

 
  document.getElementById("TaxBillNumberPane").style.display = "none";
  
        document.getElementById('list').style.display = 'none';
        document.getElementById('details_list').style.display = 'none';
        document.getElementById('details_list').style.height = '0px';
        document.getElementById('neighbor_list').style.display = 'none';
        document.getElementById('neighbor_list').style.height = '0px';
        
         document.getElementById('neighbor').style.display = 'none';
 
 
 
 document.getElementById('property_list').style.display = 'block';
  document.getElementById('AddressSearchPane').style.display = 'block';
       document.getElementById('AddressSearchPane').style.height = '160px';
 
 document.getElementById("hrefProperty").style.color = "#CC6600";
 
 //document.getElementById("hrefProperty").style.color = "#CC6600";
document.getElementById("hrefOwner").style.color = "#002758";
document.getElementById("hrefTaxBill").style.color = "#002758"; 
 
 
 
   document.getElementById('tdPrintList').style.display = 'none';
 
 
 
   document.getElementById('tdPrintDetails').style.display = 'none';
   
                
  
}