      var identifyTask, identifyParams, symbol;
      var layer2results, layer3results, layer4results;	 
	 
	  
	  function initFunctionality2(map) {
        
		dojo.disconnect(objectconnections[0]);
		dojo.disconnect(objectconnections[1]);
		dojo.disconnect(objectconnections[2]);
		dojo.disconnect(objectconnections[3]);
		
		objectconnections[1] = dojo.connect(map, "onClick", doIdentify2);
 
        identifyTask = new esri.tasks.IdentifyTask("http://74.93.16.209:443/Arcserver/rest/services/Southington/Admin_V/MapServer");
 
 
        identifyParams = new esri.tasks.IdentifyParameters();
        identifyParams.tolerance = 3;
        identifyParams.returnGeometry = true;
        identifyParams.layerIds = [7,8,9];
        identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
 
        map.infoWindow.resize(415, 200);
        map.infoWindow.setContent(dijit.byId("tabs2").domNode);
        map.infoWindow.setTitle("Sanitary Sewer Information");
 
        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.5]));
      }
 
      function doIdentify2(evt) {
        map.graphics.clear();
        identifyParams.geometry = evt.mapPoint;
        identifyParams.mapExtent = map.extent;
        identifyTask.execute(identifyParams, function(idResults) { addToMap2(idResults, evt); });
      }
 
      function addToMap2(idResults, evt) {
        layer2results = {displayFieldName:null,features:[]};
        layer3results = {displayFieldName:null,features:[]};
        layer4results = {displayFieldName:null,features:[]};
 
        for (var i=0, il=idResults.length; i<il; i++) {

          var idResult = idResults[i];

          if (idResult.layerId === 7) {

            if (!layer2results.displayFieldName) {layer2results.displayFieldName = idResult.displayFieldName};

            layer2results.features.push(idResult.feature);

          } else if (idResult.layerId === 8) {

            if (!layer3results.displayFieldName) {layer3results.displayFieldName = idResult.displayFieldName};

            layer3results.features.push(idResult.feature);

          } else if (idResult.layerId === 9) {

            if (!layer4results.displayFieldName) {layer4results.displayFieldName = idResult.displayFieldName};

            layer4results.features.push(idResult.feature);

          }

        }

        dijit.byId("layer2Tab2").setContent(layerTabContent2(layer2results,"layer2results"));

        dijit.byId("layer3Tab2").setContent(layerTabContent2(layer3results,"layer3results"));

        dijit.byId("layer4Tab2").setContent(layerTabContent2(layer4results,"layer4results"));



        map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));

      }

      function layerTabContent2(layerResults, layerName) {

        var content = "";
		

		switch (layerName) {

          case "layer2results":

            for (var i=0, il=layerResults.features.length; i<il; i++) {

			  content+="<b>Manhole ID: </b>"+layerResults.features[i].attributes['ID']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Streetname : </b>"+layerResults.features[i].attributes['STREETNAME']+"</br>";
              content+="<br /><br /><b>Owner : </b>"+layerResults.features[i].attributes['OWNER_CODE']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Date Installed: </b>"+layerResults.features[i].attributes['DATEINSTAL']+"</br>";
			  content+="<br /><b>Top Elevation : </b>"+layerResults.features[i].attributes['TOPELEV']+"</br>";
			  content+="<br /><b>Comment : </b>"+layerResults.features[i].attributes['FILECOMMEN']+"</br>";
            }
		
            content+="</tr>";
            break;
          case "layer3results":

            for (var i=0, il=layerResults.features.length; i<il; i++) {

			  content+="<b>Structure ID: </b>"+layerResults.features[i].attributes['ID']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Streetname : </b>"+layerResults.features[i].attributes['STREETNAME']+"</br>";
              content+="<br /><br /><b>Owner : </b>"+layerResults.features[i].attributes['OWNER_CODE']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Date Installed: </b>"+layerResults.features[i].attributes['DATEINSTALLED']+"</br>";
			  content+="<br /><b>Structure Type : </b>"+layerResults.features[i].attributes['BLOCKNAME']+"</br>";
			  content+="<br /><b>Comment : </b>"+layerResults.features[i].attributes['FILECOMMENT']+"</br>";
			  
            }
            content+="</tr>";
            break;
          case "layer4results":

            for (var i=0, il=layerResults.features.length; i<il; i++) {
			
				var HSCODE1 = "\"return hs.htmlExpand(this, { objectType: 'ajax'} )\""
			
			  content+="<b>ID: </b>"+layerResults.features[i].attributes['ID']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Streetname : </b>"+layerResults.features[i].attributes['STREETNAME']+"</br>";
              content+="<br/><br/><b>Owner : </b>"+layerResults.features[i].attributes['OWNER_CODE']+"&nbsp;&nbsp;&nbsp;&nbsp;<b>Year Built: </b>"+layerResults.features[i].attributes['YEARblt']+"</br>";
			  content+="<br/><b>Pipe Size : </b>"+layerResults.features[i].attributes['LINEDIAMETER_CODE']+"&nbsp;&nbsp;&nbsp;<b>Make: </b>"+layerResults.features[i].attributes['MATERIAL_CODE']+"&nbsp;&nbsp;&nbsp;<b>Length: </b>"+layerResults.features[i].attributes['LINELENGTH']+"</br>";
			  content+="<br/><b>Invert In : </b>"+layerResults.features[i].attributes['INVERT_IN']+"&nbsp;&nbsp;&nbsp;<b>Invert Out: </b>"+layerResults.features[i].attributes['INVERT_OUT']+"</br>";
			  content+="<br/><b>Slope : </b>"+layerResults.features[i].attributes['SLOPE']+"</br>";
			  content+="<br/><br/><a href=javascript:showSanitaryVideo('"+  layerResults.features[i].attributes['ID'] + "')>Sanitary Pipe Video</a>";
              content+="<br/><br/><a href='http://www.southingtongis.com/public_works/Sanitary_video.asp?ID=01_1Pipe' onclick=\"return hs.htmlExpand(this, { objectType: 'ajax', width: 600} )\"> Pipe Video test </a>"
			}
            content+="</tr></table>";
            break;
        }
        return content;
      }
 
      function showFeature_pw2(feature) {
        map.graphics.clear();
        feature.setSymbol(symbol);
        map.graphics.add(feature);
      }
	  
	  function showSanitaryVideo(SanID) {
	  
	    //var reportURL = "http://www.southingtongis.com/public_works/Sanitary_video.asp?ID=" + SanID;
		var reportURL = "http://www.southingtongis.com/public_works/Sanitary_video.asp?ID=01_1Pipe";
  	 	dojo.byId("SanitaryVideoPage").src = reportURL;
        dijit.byId("SanitaryVideo").show();
			
        }