/* Minification failed. Returning unminified contents.
(1,10): run-time error CSS1031: Expected selector, found 'doFindParcel('
(1,10): run-time error CSS1025: Expected comma or open brace, found 'doFindParcel('
(7,10): run-time error CSS1031: Expected selector, found 'showParcelSearchResults('
(7,10): run-time error CSS1025: Expected comma or open brace, found 'showParcelSearchResults('
 */
function doFindParcel(pin) {
    //Set the search text to the value in the box    
    ParcelSearchFindParameters.searchText = pin;//dojo.byId("txtParcelNumber").value;
    ParcelSearchFindTask.execute(ParcelSearchFindParameters, showParcelSearchResults);    
}

function showParcelSearchResults(results) {    
        if (results[0] !== undefined) {
            //Commenting for production release
            /*Set the parcel quick view template by using following function.  This function is present in Common.js file*/
            if (App != "Grading") {
                showParcelQuickViewDetail(results[0].feature, true);
            }
            else {
                parcelSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
                    new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
                      new Color([0, 255, 255]), 2),
                    new Color([0, 255, 255, 0.25]));
               //gradingParcels.push(results[0].feature.attributes.PIN);
                lastSelectedParcelFeature = results[0].feature;
                isAddGradingPointClicked = false;
                /*Set feature layer symbol*/
                results[0].feature.setSymbol(parcelSymbol);
                $("#selectedParcelCount").html(gradingParcels.length);
                showParcelQuickViewDetail(results[0].feature, true);
                if (POINT_X == "" && POINT_Y == "") {
                    if (Group_ID == "") {
                        showGradingQuickView();
                    }
                }
                
                /*******Code for highlighting the grading point**********/
                //var query = new Query();                
                //query.where = "POINT_X = '" + (getURLVars()["X"] !== undefined ? getURLVars()["X"] : '') + "' AND POINT_Y = '" + (getURLVars()["X"] !== undefined ? getURLVars()["Y"] : '') + "'";
                //gradingFeatureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {
                //    if (features.length > 0) {
                        
                //        updateFeature = features[0];
                //        gradingParcels.push(updateFeature.attributes.PIN);
                //        addAddressMarker(updateFeature.geometry);
                //    }
                //    else {
                //        map.infoWindow.hide();
                //    }
                //});

                /*add feature in the graphics of the map*/
                map.graphics.add(results[0].feature);
                map.setExtent(results[0].feature.geometry.getExtent(), true);
            }
            
            /************Hide progress bar**************/
            hideProgress();
            
        }
        else {
            /************Hide progress bar**************/
            hideProgress();
            
            if (IsRequestFromPCIS) {
                if (isNaN(PCIS_bld_id)) {
                    $("#divPCISQuckiView").css("display", "block");
                    $("#divPCISPopup").css("display", "block");
                    $("#lnkPCISPopup").css("background", "#000");
                    $("#lnkPCISPopup").css("border", "2px dotted white");
                    $("#divParcelQuckiView").css("left", "969px");
                    $("#divParcelQuckiView").css("top", "123px");
                } else if (bldgType == "" && PCIS_bld_id.toLowerCase() != "na" && PCIS_bld_id.toLowerCase() != "n/a" && App != "Grading") {
                    map.addLayer(searchFeatureLayer);
                    addToTOC(searchFeatureLayer, true);
                    legendLayers.push({ layer: searchFeatureLayer, title: 'New Features' });

                    //map.addLayer(searchBuildingFeatureUrl);
                    //addToTOC(searchBuildingFeatureUrl, true);
                    //legendLayers.push({ layer: searchBuildingFeatureUrl, title: 'New Building Features' });
                    $("#divAddNewBuilding").css("display", "block");
                    $("#btnAddNewBuilding").css("background", "#000");
                    $("#btnAddNewBuilding").css("border", "2px dotted white");
                    $('#lnkResidential').css('cursor', 'pointer');
                    $('#lnkMultiapt').css('cursor', 'pointer');
                    $('#lnkCommercial').css('cursor', 'pointer');


                }
                /*If parcel is not found then search for the address present in the PCIS URL*/
                addressLocator(streetnumber, direction, street, suffix, zip);
            }
            else {
                confirmDialog(ValidationMessages.noRecordFoundPINSearch, "ok", false)
            }
            
        }
}
