function DCMap(n,t,r,u,f){this.zoom=n;this.isMobileDevice=r;this.clickFunction=u;this.hoverFunction=f;this.activeLocation=null;this.locations=[];this.routePlotted={type:"",marker:null};this.maxRadius=1/120;this.map=undefined;this.markerScaleSizeX=25;this.markerScaleSizeY=35;this.markerIconBase=t;this.setMapLocations=function(n){var r,h,u,i,t,f,o,e,s;if((this.routePlotted.type="",r=this,n==null&&(n=10),h=window.location.origin,u=new google.maps.InfoWindow,this.locations!=null)&&this.locations.length>0)for(t=0;t<this.locations.length;t++)this.locations[t].lat==0&&this.locations[t].lng==0&&(f=this.addressLookup(this.locations[t].address),f!=null&&(this.locations[t].lat=f.lat,this.locations[t].lng=f.lng)),this.locations[t].lat!==0&&this.locations[t].lng!==0&&(o=this.markerIconFound,this.locations[t].lastIcon!=null&&(o=this.locations[t].lastIcon),i=new google.maps.Marker({position:new google.maps.LatLng(this.locations[t].lat,this.locations[t].lng),map:this.map,icon:this.markerIconFound}),this.locations[t].marker=i,this.isMobileDevice||(e=this.hoverFunction,google.maps.event.addListener(i,"mouseover",function(n,t){return function(){e!=null?u.setContent(e(r.locations[t])):u.setContent('<span style="color: black"><b>'+r.locations[t].name+"<\/b><\/span><br /><span>"+r.locations[t].address+"<\/span>");u.open(map,n)}}(i,t)),google.maps.event.addListener(i,"mouseout",function(){return function(){u.setMap(null)}}(i,t))),this.clickFunction!=null&&(s=this.clickFunction,google.maps.event.addListener(i,"click",function(n,t){return function(){s(r.locations[t].id,!0)}}(i,t))))};this.initialize=function(){this.locations=[];this.map=new google.maps.Map(document.getElementById("map"),{zoom:this.zoom,center:new google.maps.LatLng(38.9071923,-77.0368707),fullscreenControl:!1});this.dService=new google.maps.DirectionsService;this.dRenderer=new google.maps.DirectionsRenderer;this.markerScaledSize=new google.maps.Size(this.markerScaleSizeX,this.markerScaleSizeY);this.markerIconFound={url:this.markerIconBase+"Map-marker-found.png",scaledSize:this.markerScaledSize};this.markerIconSelected={url:this.markerIconBase+"Map-marker-selected.png",scaledSize:this.markerScaledSize};this.markerIconCompare={url:this.markerIconBase+"Map-marker-Compare.png",scaledSize:this.markerScaledSize};this.markerIconRoute={url:this.markerIconBase+"Map-marker-route.png",scaledSize:this.markerScaledSize};this.markerIconPurple={url:this.markerIconBase+"Map-marker-purple.png",scaledSize:this.markerScaledSize};this.markerIconColor={found:this.markerIconFound,active:this.markerIconSelected,routed:this.markerIconRoute,compare:this.markerIconCompare}};this.addLocation=function(n){this.locations.push(n)};this.fixAddress=function(n){var i="",r=0,t;for(n=n.trim(),t=0;t<n.length;t++)n[t]==" "||n[t]==","?r==1&&(i+="+",r=2):(i+=n[t],r=1);return i.replace("+#","")};this.addressLookup=function(n){var t=null,i=!0,r=this.fixAddress(n),u="https://maps.googleapis.com/maps/api/geocode/json?address="+this.fixAddress(r)+"&key=AIzaSyByoJrcPKEWcktqzphCxF7XV6Pc617hnoM";return $.ajax({method:"POST",url:u,async:!1}).done(function(n){t={lat:n.results[0].geometry.location.lat,lng:n.results[0].geometry.location.lng,address:r};i=!1}).fail(function(){i=!1}),t};this.setLastIcon=function(n,t){this.locations[n].lastIcon=t};this.setActiveLocation=function(n,t){this.activeLocation!=null&&(this.locations[this.activeLocation].marker.setIcon(this.locations[this.activeLocation].lastIcon),this.locations[this.activeLocation].marker.setZIndex(1e6));this.locations[n].lastIcon=this.locations[n].marker.icon;this.locations[n].marker.setIcon(t);this.locations[n].marker.setZIndex(1000001);this.activeLocation=n};this.closeActiveLocation=function(n){this.locations[n].route?this.locations[n].marker.setIcon(this.markerIconRoute):this.locations[n].compare?this.locations[n].marker.setIcon(this.markerIconCompare):this.locations[n].marker.setIcon(this.locations[n].lastIcon);this.activeLocation=null};this.setCompareLocation=function(n,t,i){i||(t?this.locations[n].marker.setIcon(this.markerIconCompare):this.locations[n].marker.setIcon(this.markerIconFound),this.locations[n].marker.setZIndex(1000001));this.locations[n].compare=t};this.clearCompareLocation=function(n){this.locations[n].route?this.locations[n].marker.setIcon(this.markerIconRoute):this.locations[n].marker.setIcon(this.markerIconFound)};this.locationsAlongRoute=function(n){var i=[],r,t,u;n.length==2?(r={provideRouteAlternatives:!0,origin:n[0].position,destination:n[1].position,travelMode:"DRIVING"},t=this,this.dService.route(r,function(r,u){var f,o,e,s;if(u=="OK"){for(t.dRenderer.suppressMarkers=!0,f=0;f<n.length;f++)(n[f].id==1||n[f].id==2)&&n[f].setMap(null);if(t.dRenderer.setMap(t.map),t.dRenderer.setDirections(r),r!=null&&r.routes.length>0){for(f=0;f<r.routes[0].legs.length;f++)for(o=r.routes[0].legs[f].steps,e=0;e<o.length;e++)s=t.calcRouteSegment(o[e].start_location,o[e].end_location),i.push(s);t.findLocationsInRoute(i)}}})):(u=this.calcRouteSegment(n[0].position,null),i.push(u),this.findLocationsInRoute(i))};this.clearRoute=function(){var n,t;for(this.routePlotted.type=="Route"&&this.dRenderer.setMap(null),this.routePlotted.marker!=null&&(this.routePlotted.marker.setMap(null),this.routePlotted.marker=null,this.routePlotted.type=""),n=0;n<this.locations.length;n++)this.locations[n].route&&(t=this.locations[n].lastIcon,this.locations[n].compare?t=this.markerIconCompare:t==null&&(t=this.markerIconFound),this.locations[n].marker.setIcon(t),this.locations[n].route=!1)};this.mapRoute=function(n,t,r){var u=0,f,c=[],s,e,o,h;return n.trim()!=""&&(f=n,u+=1),t.trim()!=""&&(f=t,u+=1),this.maxRadius=1/120,r!=null&&(this.maxRadius=r*this.maxRadius),this.routePlotted.type=="Route"?this.clearRoute():this.routePlotted.type=="Point"&&this.routePlotted.marker!=null&&this.routePlotted.marker.setMap(null),u==2?(s=new google.maps.Geocoder,n.trim()!=""&&this.geocodeRoute(s,c,this.fixAddress(n),u,"Start"),t.trim()!=""&&this.geocodeRoute(s,c,this.fixAddress(t),u,"End"),this.routePlotted.type="Route"):u==1?(e=this.addressLookup(f.trim()),e!=null&&(this.routePlotted.type="Point",o=new google.maps.Marker({position:new google.maps.LatLng(e.lat,e.lng),map:this.map,icon:this.markerIconSelected}),google.maps.event.addListener(o,"mouseover",function(n){return function(){infoWindow.setContent('<span style="color: green">Marker<\/span><br /><span>'+f+"<\/span>");infoWindow.open(map,n)}}(o,i)),this.routePlotted.marker=o,this.map.setZoom(15),this.map.setCenter(routePlotted.marker.getPosition()),h=[],h.push({position:routePlotted.marker.position}),this.locationsAlongRoute(h))):alert("A starting and/or ending location is needed to route."),u};this.geocodeRoute=function(n,t,i,r,u){if(i.trim()!=""){var f=this;n.geocode({address:i},function(n,i){if(i==="OK"){f.map.setCenter(n[0].geometry.location);var e=new google.maps.Marker({map:f.map,position:n[0].geometry.location,id:r,label:u});t.push(e)}else t.push(null);t.length==r&&f.locationsAlongRoute(t)})}};this.calcRouteSegment=function(n,t){var i={startPoint:{lat:Math.floor(n.lat()*1e7)/1e7,lng:Math.floor(n.lng()*1e7)/1e7},endPoint:null,distance:0,slope:0,iSlope:0,yIntercept:0},u,r;return t!=null&&(i.endPoint={lat:Math.floor(t.lat()*1e7)/1e7,lng:Math.floor(t.lng()*1e7)/1e7},i.distance=Math.floor(Math.sqrt(Math.pow(t.lat()-n.lat(),2)+Math.pow(t.lng()-n.lng(),2))*1e7)/1e7,u=i.endPoint.lat-i.startPoint.lat,r=i.endPoint.lng-i.startPoint.lng,r!=0&&(i.slope=u/r),i!=0&&(i.iSlope=-1/i.slope),i.yIntercept=i.startPoint.lat-i.startPoint.lng*i.slope),i};this.findLocationsInRoute=function(n){var t,i,u,r;if(this.locations!=null)for(t=0;t<this.locations.length;t++)if(typeof this.locations[t].marker!="undefined")for(i=this.locations[t].lastIcon,this.locations[t].compare?i=this.markerIconCompare:i==null&&(i=this.markerIconFound),this.locations[t].marker.setIcon(i),this.locations[t].route=!1,u={lng:this.locations[t].lng,lat:this.locations[t].lat},r=0;r<n.length;r++)if(this.calcWithinRoute(n[r],u)){this.locations[t].lastIcon==null&&(this.locations[t].lastIcon=this.locations[t].marker.icon);this.locations[t].marker.setIcon(this.markerIconRoute);this.locations[t].route=!0;break}};this.calcWithinRoute=function(n,t){var i=!1,o=Math.floor(this.maxRadius*1e3)/1e3,r=Math.floor(Math.sqrt(Math.pow(t.lng-n.startPoint.lng,2)+Math.pow(t.lat-n.startPoint.lat,2))*1e3)/1e3,u,h,c;if(r<=o&&(i=!0),n.endPoint!=null&&i==!1&&(u=Math.floor(Math.sqrt(Math.pow(t.lng-n.endPoint.lng,2)+Math.pow(t.lat-n.endPoint.lat,2))*1e3)/1e3,u<=o&&(i=!0),!i)){var s=t.lat-n.iSlope*t.lng,f=Math.floor((s-n.yIntercept)/(n.slope-n.iSlope)*1e7)/1e7,e=Math.floor((n.iSlope*f+s)*1e7)/1e7;r=Math.floor(Math.sqrt(Math.pow(e-t.lat,2)+Math.pow(f-t.lng,2))*1e7)/1e7;r<=this.maxRadius&&(r=Math.floor(Math.sqrt(Math.pow(e-n.startPoint.lat,2)+Math.pow(f-n.startPoint.lng,2))*1e7)/1e7,u=Math.floor(Math.sqrt(Math.pow(e-n.endPoint.lat,2)+Math.pow(f-n.endPoint.lng,2))*1e7)/1e7,h=Math.floor((r+u+.0005)*1e3)/1e3,c=Math.floor((n.distance+.0005)*1e3)/1e3,h<=c&&(i=!0))}return i}}function AnonymousSearch(){HideModal("dlgSearch");runSearch(createParameterObj(),"RunSearch")}function createArrayOfAreas(){}function collapseAllAccordians(){$("#collapse1").hasClass("in")?$("#collapse1").collapse("hide"):$("#collapse2").hasClass("in")?$("#collapse2").collapse("hide"):$("#collapse3").hasClass("in")?$("#collapse3").collapse("hide"):$("#collapse4").hasClass("in")?$("#collapse4").collapse("hide"):$("#collapse7").hasClass("in")?$("#collapse7").collapse("hide"):$("#collapse8").hasClass("in")&&$("#collapse8").collapse("hide")}function hideShowAnswer(n,t){$("#"+n).css("display")=="none"?($("#"+n).slideDown("slow"),$("#"+t).attr("src","../Images/TreeCollapse.png")):($("#"+n).slideUp("slow"),$("#"+t).attr("src","../Images/TreeExpand.png"))}function showCQDesignationInfoPanel(){$("#cQDesignationInfoPanel").slideDown("slow")}function hideCQDesignationInfoPanel(){$("#cQDesignationInfoPanel").slideUp("slow")}function showAccreditationInfoPanel(){$("#accreditationInfoPanel").slideDown("slow")}function hideAccreditationInfoPanel(){$("#accreditationInfoPanel").slideUp("slow")}function showCompareAccreditationInfoPanel(){$("#compareAccreditationInfoPanel").slideDown("slow")}function hideCompareAccreditationInfoPanel(){$("#compareAccreditationInfoPanel").slideUp("slow")}function showServicesInfoPanel(){$("#servicesInfoPanel").slideDown("slow")}function hideServicesInfoPanel(){$("#servicesInfoPanel").slideUp("slow")}function hideShowServicePanel(n,t){$("#"+t).html()=="More Info"?($("#"+n).slideDown("slow"),$("#"+t).html("Less Info")):($("#"+n).slideUp("slow"),$("#"+t).html("More Info"))}function setSelection(n,t,i){var r=t+" input:checkbox",u=i+" span.selected";n?($(r).prop("checked",!0),$(u).show()):(t=="#collapse3"&&resetSchedule(),t=="#collapse7"&&resetLocation(),$(r).prop("checked",!1),$(u).hide());checkSaveButton()}function resetSchedule(){$("#lblDropoff").html("");$("#selDropoff")[0].selectedIndex=0;$("#lblPickup").html("");$("#selPickup")[0].selectedIndex=0}function resetLocation(){$("#lblStreetZip").html("");$("#txtStreetZip").val("");$("#lblDistance").html("&#10004; Distance: 1 Miles&nbsp;");$("#1Miles")[0].checked=!0}function checkSaveButton(){var i=$(".ASearch:checkbox:checked"),t=$("#btnSaveSearch"),n=i.length;$("#txtFacilityName").val().length>0&&n++;$("#txtStreetZip").val().length>0&&n++;$("#selDropuff option:selected").text().indexOf("Select")!=0&&n++;$("#selPickup option:selected").text().indexOf("Select")!=0&&n++;n>0?t.prop("disabled",!1):t.prop("disabled",!0)}function flipCheckboxes(n,t,r){var u=$("input:checkbox."+n);for(i=0;i<u.length;i++)u[i].checked=t;t?$(".selected."+n).show():$(".selected."+n).hide();(r==null||r==!0)&&querySearch()}function resetAges(){flipCheckboxes("Ages",!1)}function selectAllAges(){flipCheckboxes("Ages",!0)}function resetWeek(){$("#selDropoff").data("kendoTimePicker").value(null);$("#selPickup").data("kendoTimePicker").value(null);$("#lblDropoff").hide();$("#lblPickup").hide();flipCheckboxes("week",!1,!1);flipCheckboxes("wkDays",!1,!1);flipCheckboxes("wkEnd",!1,!0)}function selectAllWeek(){flipCheckboxes("week",!0)}function setWholeWeek(n,t){var r="input:checkbox."+n,i="span.selected."+n;t?($(i+"All").show(),$(i).hide(),$(r).each(function(){this.checked=!0})):($(i+"All").hide(),$(i).hide(),$(r).each(function(){this.checked=!1}))}function resetAll(){resetFacilityName();setSelection(!1,"#collapse1","#typeCareTitle");setSelection(!1,"#collapse2","#agesTitle");setSelection(!1,"#collapse3","#schedTitle");setSelection(!1,"#collapse7","#zipsTitle");setSelection(!1,"#collapse9","#serviceTypesTitle");setSelection(!1,"#collapse8","#cQDesignationTitle");collapseAllAccordians()}function resetFacilityName(){var n=$("#txtFacilityName"),t=$("#lblFacilityName");$("#lblFacilityName").html("");$("#txtFacilityName").val("");checkSaveButton()}function showDistance(n){var t=$("#lblDistance");n!=null?t.html("&#10004; Distance: "+n.id.substr(0,1)+" "+n.id.substr(1)+"&nbsp;"):t.html("")}function setSearchText(n,t){n!=null&&n!=""&&($("#txt"+t)[0].value=n);showTextEntry(t)}function showTextEntry(n,t){var i=$("#txt"+n),r=$("#lbl"+n);i.val().trim()!=""?r.html("&#10004; "+i.val()+"&nbsp;"):r.html("");t!=null&&checkSaveButton()}function runSearch(n,t){$("#refineSearchPanel").hide();lastSearchAction=t;$.ajax({method:"POST",url:"/MyChildCare/"+t,data:n}).done(showResults)}function getResultsTableCount(){var n=0;return $("#searchResultsTable > tbody > tr").each(function(){n++}),n}function backToSearch(){$('.nav-tabs a[href="#home"]').tab("show")}function validateEmail(){resetAll();var n=!0;return $("#userName").val().trim()==""||$("#userName").val().trim()=="Enter Name ..."?($("#userName").val("Enter Name ..."),$("#userName").css("color","rgb(208,87,68)"),n=!1):$("#userName").css("color","#333"),$("#userEmail").val().trim()==""||$("#userEmail").val().trim()=="Enter Email ..."?($("#userEmail").val("Enter Email ..."),$("#userEmail").css("color","rgb(208,87,68)"),n=!1):$("#userEmail").css("color","#333"),n}function runFastSearch(){var t={name:getFacilityType(),service_schedule:getServiceSchedule(),ages:getAges(),days:getDays(),zips:getZips(),CQDesignation:geCQDesignation(),pickUpTime:getPickUpTime(),dropOffTime:getDropOffTime(),pageNo:0,isForward:!0,serviceTypes:getServiceTypes(),searchName:name,code:id},n,i;if(selectedFacilities=null,$("#compareResultsContainer").html(""),$("#srcAddress").val().trim()==""||$("#srcAddress").val().trim()=="Enter an Address ...")return $("#srcAddress").val("Enter an Address ..."),$("#srcAddress").css("color","rgb(208,87,68)"),!1;$("#srcAddress").css("color","#333");lastPageNo=0;n=0;$("#1Miles").is(":checked")?n=1:$("#3Miles").is(":checked")?n=3:$("#7Miles").is(":checked")&&(n=7);i=$("#srcAddress").val();t={address:i,pageNo:0,distance:n,isForward:!0};lastSearchParms=t;lastSearchAction="RunAddressSearch";runSearch(t,"RunAddressSearch")}function runNameSearch(n){var t,i;if(resetAll(),selectedFacilities=null,$("#compareResultsContainer").html(""),!n){if($("#srcName").val().trim()==""||$("#srcName").val().trim()=="Enter a Provider ...")return $("#srcName").val("Enter a Provider ..."),$("#srcName").css("color","rgb(208,87,68)"),!1;$("#srcName").css("color","#333")}lastPageNo=0;t="";n||(t=$("#srcName").val());i={name:t,pageNo:0,isForward:!0};lastSearchParms=i;lastSearchAction="RunNameSearch";runSearch(i,"RunNameSearch")}function runQuadSearch(){lastPageNo=0;var t=$("#selQuad").val(),n={quad:t,pageNo:0,isForward:!0};lastSearchParms=n;lastSearchAction="RunQuadSearch";runSearch(n,"RunQuadSearch")}function runZipSearch(){if(resetAll(),selectedFacilities=null,$("#compareResultsContainer").html(""),$("#srcZip").val().trim()==""||$("#srcZip").val().trim()=="Enter ZIP ...")return $("#srcZip").val("Enter ZIP ..."),$("#srcZip").css("color","rgb(208,87,68)"),!1;$("#srcZip").css("color","#333");lastPageNo=0;var t=$("#srcZip").val(),n={zip:t,pageNo:0,isForward:!0};lastSearchParms=n;lastSearchAction="RunZipSearch";runSearch(n,"RunZipSearch")}function createParameterObj(n){lastPageNo=0;var t={FacilityName:getFacilityName(),ServiceSchedule:GetSelectedSections("#collapse1","week"),CQDesignation:GetSelectedCapitalQuality("#collapse8"),ServiceType:GetSelectedSections("#collapse9"),StreetZip:getStreet(),Distance:0,Notify:getNotify(),SearchName:n,SSC_Id:ddSearchList.options[ddSearchList.selectedIndex].value,SaveSearchID:ddSearchList.options[ddSearchList.selectedIndex].value,InfantServed:$("#chkInfant").prop("checked")?!0:!1,ToddlerServed:$("#chkToddler").prop("checked")?!0:!1,PreSchoolServed:$("#chkPreSchool").prop("checked")?!0:!1,SchoolAgeServed:$("#chkSchoolAge").prop("checked")?!0:!1,BeforeCare:$("#chkBeforecare").prop("checked")?!0:!1,AfterCare:$("#chkAftercare").prop("checked")?!0:!1,Monday:$("#chkMon").prop("checked")?!0:!1,Tuesday:$("#chkTues").prop("checked")?!0:!1,Wednesday:$("#chkWed").prop("checked")?!0:!1,Thursday:$("#chkThurs").prop("checked")?!0:!1,Friday:$("#chkFri").prop("checked")?!0:!1,Saturday:$("#chkSat").prop("checked")?!0:!1,Sunday:$("#chkSun").prop("checked")?!0:!1,CACFPParticipation:$("#chkCacfp").prop("checked")?!0:!1,IsQuin:$("#chkQuin").prop("checked")?!0:!1,IsMontessori:$("#chkMontessoriProgram").prop("checked")?!0:!1,IsHeadStart:$("#chkHeadStart").prop("checked")?!0:!1,IsDCPS:$("#chkDcps").prop("checked")?!0:!1,IsOsseEceSubsidiaryProvider:$("#chkOsseEceSubsidiaryProvider").prop("checked")?!0:!1,IsFederalGovernmentFacility:$("#chkFederalGovernmentPolicy").prop("checked")?!0:!1,IsCharterSchool:$("#chkCharterSchool").prop("checked")?!0:!1,IsEarlyHeadStart:$("#chkEarlyHeadStart").prop("checked")?!0:!1,IsSignLanguage:$("#chkSignLanguage").prop("checked")?!0:!1,LanguageSpoken:$("#chkLanguageSpoken").prop("checked")?"Spanish":null,IsDCGovernmentFacility:$("#chkDCGovernmentFacility").prop("checked")?!0:!1,IsFaithBased:$("#chkFaithBased").prop("checked")?!0:!1,IsPreKEnhanced:$("#chkPreKEnhancement").prop("checked")?!0:!1,IsHomeless:$("#chkHomeless").prop("checked")?!0:!1,Quadrent:getQuadrents(),Wards:getWards(),Facilitytype:getFacilitytypes(),DropOffTime:$("#selDropoff").val(),PickUpTime:$("#selPickup").val()};return lastSearchParms=t,lastSearchAction="RunSearch",t}function getQuadrents(){var n="";return $("#chkNW").prop("checked")&&(n="NW,"),$("#chkNE").prop("checked")&&(n+="NE,"),$("#chkSE").prop("checked")&&(n+="SE,"),$("#chkSW").prop("checked")&&(n+="SW,"),n==""?"":n.substring(0,n.length-1)}function getWards(){var n="";return $("#chkWard1").prop("checked")&&(n="1,"),$("#chkWard2").prop("checked")&&(n+="2,"),$("#chkWard3").prop("checked")&&(n+="3,"),$("#chkWard4").prop("checked")&&(n+="4,"),$("#chkWard5").prop("checked")&&(n+="5,"),$("#chkWard6").prop("checked")&&(n+="6,"),$("#chkWard7").prop("checked")&&(n+="7,"),$("#chkWard8").prop("checked")&&(n+="8,"),n==""?"":n.substring(0,n.length-1)}function getFacilitytypes(){var n="";return $("#chkCDX").prop("checked")&&(n="CDC (Child Development Center),"),$("#chkCDH").prop("checked")&&(n+="CDH (Child Development Home),"),$("#chkCDC").prop("checked")&&(n+="CDX (Child Development Home Expanded),"),n==""?"":n.substring(0,n.length-1)}function GetSelectedSections(n,t){n=n+" input:checkbox";t!=null&&t!=""&&(n=n+"."+t);var i="",r="",u=$(n);return u.each(function(){this.checked==!0&&this.className.indexOf("All")==-1&&(i=i+r+"'"+this.id.substring(3)+"'",r=",")}),i}function getControlValue(n){var t=document.getElementById(n);return t.value}function getFacilityName(){var n=document.getElementById("txtQuickSearch"),t="";return n&&(t=n.value.trim()),t}function getStreet(){var n=document.getElementById("txtStreetZip"),t="";return n&&(t=n.value),t}function getDistance(n){for(var i=document.getElementsByName(n),r=1,t=0;t<i.length;t++)if(i[t].checked==!0){r=i[t].id.substr(0,1);break}return r}function getNotify(){return!0}function setScehduleTime(n,t){var u=$("#lbl"+t),f=$("#sel"+t),e=$("#btn"+t),i,r;n!=null&&n!=""&&n.indexOf("Select")<0?(i=n.substr(0,4).trim(),r=n.substr(5).trim(),f.val(i),e.html(r),u.html("&#10004; "+t.substr(0,4)+"-"+t.substr(4).toLowerCase()+": "+i+" "+r+"&nbsp ")):(u.html(""),f[0].selectedIndex=0)}function getScheduleTime(n){var t=$("#lbl"+n).html(),i=t.indexOf(":");return i>=0&&(t=t.substr(i+2),i=t.indexOf("&"),i>=0&&(t=t.substr(0,i))),t}function getFacilityType(){var n="";return $("#chkCDX").prop("checked")&&(n="'CDX',"),$("#chkCDX").prop("checked")&&(n+="'CDH',"),$("#chkCDX").prop("checked")&&(n+="'CDC',"),n==""?"":n.substring(0,n.length-1)}function getExtraServices(){var n="";return $("#chkDropIn").prop("checked")&&(n="Toddler=1 OR "),$("#chkOverNight").prop("checked")&&(n+="Infant=1 OR "),$("#chkBackUp").prop("checked")&&(n+="Pre_School=1 OR "),$("#chk24Hrs").prop("checked")&&(n+="School_Age=1 OR "),$("#chkWeekend").prop("checked")&&(n="Toddler=1 OR "),$("#chkSummer").prop("checked")&&(n+="Infant=1 OR "),$("#chkEvening").prop("checked")&&(n+="Pre_School=1 OR "),$("#chkBeforeAfter").prop("checked")&&(n+="School_Age=1 OR "),$("#chkAfter").prop("checked")&&(n+="Pre_School=1 OR "),$("#chkBefore").prop("checked")&&(n+="School_Age=1 OR "),n==""?"":n.substring(0,n.length-4)}function getServiceSchedule(){var n="";return $("#chkPartTime").prop("checked")&&(n="'PartTime',"),$("#chkFullTime").prop("checked")&&(n+="'FullTime',"),n==""?"":n.substring(0,n.length-1)}function getCQDesignation(){var n="";return $("#chkHigh-Quality").prop("checked")&&(n="'High-Quality',"),$("#chkQuality").prop("checked")&&(n+="'Quality',"),$("#chkProgressing").prop("checked")&&(n+="'Progressing',"),$("#chkDeveloping").prop("checked")&&(n+="'Developing',"),$("#chkPreliminary").prop("checked")&&(n+="'Preliminary',"),n==""?"":n.substring(0,n.length-1)}function getAges(){var n="";return $("#chkInfant").prop("checked")&&(n="'Infant',"),$("#chkToddler").prop("checked")&&(n+="'Toddler',"),$("#chkPreSchool").prop("checked")&&(n+="'PreSchool',"),$("#chkSchoolAge").prop("checked")&&(n+="'SchoolAge',"),n==""?"":n.substring(0,n.length-1)}function getDays(){var n="";return $("#chkMon").prop("checked")&&(n="'Mon',"),$("#chkTues").prop("checked")&&(n+="'Tues',"),$("#chkWed").prop("checked")&&(n+="'Wed',"),$("#chkThurs").prop("checked")&&(n+="'Thurs',"),$("#chkFri").prop("checked")&&(n+="'Fri',"),$("#chkSat").prop("checked")&&(n+="'Sat',"),$("#chkSun").prop("checked")&&(n+="'Sun',"),n==""?"":n.substring(0,n.length-1)}function getZips(){var n="";return $("#chkWard1").prop("checked")&&(n+="'Ward1',"),$("#chkWard2").prop("checked")&&(n+="'Ward2',"),$("#chkWard3").prop("checked")&&(n+="'Ward3',"),$("#chkWard4").prop("checked")&&(n+="'Ward4',"),$("#chkWard5").prop("checked")&&(n+="'Ward5',"),$("#chkWard6").prop("checked")&&(n+="'Ward6',"),$("#chkWard7").prop("checked")&&(n+="'Ward7',"),$("#chkWard8").prop("checked")&&(n+="'Ward8',"),$("#chkNE").prop("checked")&&(n+="'NE',"),$("#chkSE").prop("checked")&&(n+="'SE',"),$("#chkSW").prop("checked")&&(n+="'SW',"),$("#chkNW").prop("checked")&&(n+="'NW',"),n==""?"":n.substring(0,n.length-1)}function getServiceTypes(){var n="";return $("#chkCacfp").prop("checked")&&(n+="'Cacfp',"),$("#chkQuin").prop("checked")&&(n+="'Quin',"),$("#chkMontessoriProgram").prop("checked")&&(n+="'MontessoriProgram',"),$("#chkHeadStart").prop("checked")&&(n+="'HeadStart',"),$("#chkDcps").prop("checked")&&(n+="'Dcps',"),$("#chkOsseEceSubsidyProvider").prop("checked")&&(n+="'OsseEceSubsidyProvider',"),$("#chkFederalGovernmentPolicy").prop("checked")&&(n+="'FederalGovernmentPolicy',"),$("#chkCharterSchool").prop("checked")&&(n+="'CharterSchool',"),$("#chkEarlyHeadStart").prop("checked")&&(n+="'EarlyHeadStart',"),$("#chkSignLanguage").prop("checked")&&(n+="'SignLanguage',"),$("#chkDCGovernmentFacility").prop("checked")&&(n+="'DCGovernmentFacility',"),$("#chkFaithBased").prop("checked")&&(n+="'FaithBased',"),$("#chkPreKEnhancement").prop("checked")&&(n+="'PreKEnhancement',"),$("#chkHomeless").prop("checked")&&(n+="'Homeless',"),n==""?"":n.substring(0,n.length-1)}function showServiceTypeDescription(n){var t="",i=getServiceType(n);switch(n){case"CACFPParticipation":t="<p>The Child and Adult Care Food Program (CACFP) provides a monthly financial subsidy, training and technical assistance, nutrition education, and food safety information to child development centers, adult day care centers, sponsored day care homes, afterschool programs, and emergency shelters serving nutritious meals and snacks to eligible infants, children, and adults. CACFP meals must meet the Federal guidelines.<\/p><p>Reimbursements are provided to reduce the net cost of serving healthy meals and snacks to children 12 years of age and under in licensed child development centers and sponsored day care homes; children 18 years of age and under in afterschool programs located in eligible areas as well as in emergency shelters for homeless and runaway youth; and functionally impaired adults and adults 60 years and over in licensed adult day care centers.<\/p>";break;case"IsQuin":t="<p>The Quality Improvement Network (QIN) is a citywide effort to build capacity, increase access and enhance the quality of infant and toddler care in the District of Columbia. The Office of the State Superintendent of Education (OSSE), as the lead agency for this initiative, collaborates with other district child and family service agencies to ensure effective service coordination and support for the children and families enrolled in the QIN.<\/p><p>OSSE provides funding to three agencies: CentroNia, United Planning Organization (UPO), and Mary’s Center to serve as hubs for 14 child development centers and 14 child development homes serving over 440 children. This support includes coaching and comprehensive services for children and families – family engagement and support, health and nutrition, mental health, and early intervention.<\/p>";break;case"IsMontessori":t="<p>The Montessori program is a child-centered program focusing on each child’s interests, strengths, and talents in a multi-age classroom. The classroom facilitates independence freedom within limits, and uninterrupted work time. Children learn by making discoveries, using hands-on age appropriate education materials, and collaborative play.  Children learn at their own pace developing a positive attitude to reach their maximum potential.<\/p>";break;case"IsHeadStart":t="<p>Head Start is a federally-funded early childhood program from low-income infants, toddlers, young children ages 3-5, pregnant women, and their families. Children who attend Head receive free medical and dental care, have healthy meals and snacks, and enjoy playing indoors and outdoors in a safe setting.<\/p>";break;case"IsDCPS":t="<p>DCPS is a District of Columbia Public School that provides care and other services, supervision and guidance for children, infants, and toddlers on a regular basis, regardless of it's name. The facility serves more than twelve (12) children and generally known as a child care center, preschool, nursery school, or before-and-after school program.<\/p>";break;case"SubsidyProgramParticipation":t="<p>A Child Development Facility that has been approved by OSSE to accept child care reimbursement vouchers from eligible parents/guardians.<\/p>";break;case"IsFederalGovernmentFacility":t="<p>A Federal Government Facility is a child development facility operated by the federal government on federal government property or located within a District of Columbia government building that provides care and other services, supervision and guidance for children, infants, and toddlers on a regular basis, regardless of its name. The facility serves more than twelve (12) children and generally known as a child care center, preschool, nursery school, or before-and-after school program.<\/p>";break;case"IsCharterSchool":t="<p>A Charter School is a Child Development Facility that primarily provides care and other services, supervision and guidance before and after normal school hours to one or more enrolled children of the school that is of legal school age and under the age of fifteen (15) years.<\/p>";break;case"IsEarlyHeadStart":t="<p>Head Start is a federally-funded early childhood program from low-income infants, toddlers, young children ages 3-5, pregnant women, and their families. Children who attend Head receive free medical and dental care, have healthy meals and snacks, and enjoy playing indoors and outdoors in a safe setting.<\/p>";break;case"IsSignLanguage":t="<p>The Sign Language program teaches infants and toddlers to use signs and gestures to express their needs and wishes before they are able to speak.<\/p>";break;case"IsDCGovernmentFacility":t="<p>A DC Government Facility is a child development facility located within a District of Columbia government building that provides care and other services, supervision and guidance for children, infants, and toddlers on a regular basis, regardless of its name. The facility serves more than twelve (12) children and generally known as a child care center, preschool, nursery school, or before-and-after school program.<\/p>";break;case"IsFaithBased":t="<p>A Faith Base Program provides child care services and integrates the tenets of their faith into the curriculum of the child care program. Faith-based programs may be located in churches, synagogues, or other religious settings, private centers, or family child care homes.<\/p>";break;case"IsPreKEnhanced":t="<p>The Pre-K Enhancement Program is a Head Start or early childhood education program operated by a non-profit, for-profit, or faith-based organization, or organization that participates in local or federally-funded early childhood programs, including the subsidized child care program. The program establishes pre-kindergarten (pre-K) classrooms that provide high-quality early educational services to the children of the District of Columbia.<\/p>";break;case"IsHomeless":t="<p>The Homeless program serves “individuals who lack a fixed (permanent), regular, and adequate (acceptable) nighttime residence. The program ensures that homeless students enroll in and have full and equal opportunity to succeed in school.  Program services provided include transportation assistance dispute resolution, emergency school enrollment assistance, special projects, Homeless Awareness Month, staff development, and interagency collaboration.<\/p>"}populateModal(i,t)}function getServiceType(n){var t="";switch(n){case"CACFPParticipation":t="Child and Adult Care Food Program";break;case"IsQuin":t="Quality Improvement Network";break;case"IsMontessori":t="Montessori Program";break;case"IsHeadStart":t="Head Start";break;case"IsDCPS":t="District of Columbia Public School";break;case"SubsidyProgramParticipation":t="Accepts Vouchers";break;case"IsFederalGovernmentFacility":t="Federal/Government Facility";break;case"IsCharterSchool":t="Charter School";break;case"IsEarlyHeadStart":t="Early Head Start";break;case"IsSignLanguage":t="Sign Language";break;case"IsDCGovernmentFacility":t="DC Government Facility";break;case"IsFaithBased":t="Faith Based";break;case"IsPreKEnhanced":t="Pre-K Enhancement";break;case"IsHomeless":t="Homeless"}return t===""?n:t}function showHideSearchBtn(n){n.show();lastSearchAction=="RunQuickSearch"&&n.hide()}function getScreenWidth(){return"1"}function GetSelectedCapitalQuality(n,t){n=n+" input:checkbox";t!=null&&t!=""&&(n=n+"."+t);var i="",r="",u=$(n);return u.each(function(){this.checked==!0&&this.className.indexOf("All")==-1&&(i=i+r+this.id.substring(3),r=",")}),i}function decodeText(n){var t=document.getElementById("hdnDecoder");return t.innerHTML=n,t.innerText}function selectSearch(n){n.selectedOptions.length>0&&loadSearchCriteria(n.selectedOptions[0].value)}function SelectedSearch(n){if(n.selectedIndex!=0){var t=n.options[n.selectedIndex].value,i=n.options[n.selectedIndex].text;loadSearchCriteria(t,i)}}function helloWorld(){alert(10)}function loadSearchCriteria(n,t){return $.ajax({method:"POST",url:"/MyChildCare/GetSavedSearchCriteria?id="+n}).done(function(n){showSearchCriteria(n,!0)}).fail(function(){alert("Failed to load search criteria "+t)}),!1}function showSearchCriteria(n,t){var f,i,u,r,e;clearCriteria(!1);n!=null&&n!=""&&(n.SSC_Id==""?$("#ddSearchList").val(0):$("#ddSearchList").val(n.SSC_Id),$("#txtQuickSearch").val(n.facilityName),n.infantServed==!0||n.infantServed=="True"?($("#chkInfant").prop("checked",!0),$("#lblInfant").show()):($("#chkInfant").prop("checked",!1),$("#lblInfant").hide()),n.toddlerServed==!0||n.toddlerServed=="True"?($("#chkToddler").prop("checked",!0),$("#lblToddler").show()):($("#chkToddler").prop("checked",!1),$("#lblToddler").hide()),n.preSchoolServed==!0||n.preSchoolServed=="True"?($("#chkPreSchool").prop("checked",!0),$("#lblPreSchool").show()):($("#chkPreSchool").prop("checked",!1),$("#lblPreSchool").hide()),n.schoolAgeServed==!0||n.schoolAgeServed=="True"?($("#chkSchoolAge").prop("checked",!0),$("#lblSchoolAge").show()):($("#chkSchoolAge").prop("checked",!1),$("#lblSchoolAge").hide()),n.facilityType!=null&&(f=n.facilityType.split(","),jQuery.inArray("CDC (Child Development Center)",f)!==-1?($("#chkCDX").prop("checked",!0),$("#lblCDX").show()):($("#chkCDX").prop("checked",!1),$("#lblCDX").hide()),jQuery.inArray("CDH (Child Development Home)",f)!==-1?($("#chkCDH").prop("checked",!0),$("#lblCDH").show()):($("#chkCDH").prop("checked",!1),$("#lblCDH").hide()),jQuery.inArray("CDX (Child Development Home Expanded)",f)!==-1?($("#chkCDC").prop("checked",!0),$("#lblCDC").show()):($("#chkCDC").prop("checked",!1),$("#lblCDC").hide())),n.beforeCare==!0||n.beforeCare=="True"?($("#chkBeforecare").prop("checked",!0),$("#lblBeforecare").show()):($("#chkBeforecare").prop("checked",!1),$("#lblBeforecare").hide()),n.afterCare==!0||n.afterCare=="True"?($("#chkAftercare").prop("checked",!0),$("#lblAftercare").show()):($("#chkAftercare").prop("checked",!1),$("#lblAftercare").hide()),n.monday==!0||n.monday=="True"?($("#chkMon").prop("checked",!0),$("#lblMon").show()):($("#chkMon").prop("checked",!1),$("#lblMon").hide()),n.tuesday==!0||n.tuesday=="True"?($("#chkTues").prop("checked",!0),$("#lblTues").show()):($("#chkTues").prop("checked",!1),$("#lblTues").hide()),n.wednesday==!0||n.wednesday=="True"?($("#chkWed").prop("checked",!0),$("#lblWed").show()):($("#chkWed").prop("checked",!1),$("#lblWed").hide()),n.thursday==!0||n.thursday=="True"?($("#chkThurs").prop("checked",!0),$("#lblThurs").show()):($("#chkThurs").prop("checked",!1),$("#lblThurs").hide()),n.friday==!0||n.friday=="True"?($("#chkFri").prop("checked",!0),$("#lblFri").show()):($("#chkFri").prop("checked",!1),$("#lblFri").hide()),n.saturday==!0||n.saturday=="True"?($("#chkSat").prop("checked",!0),$("#lblSat").show()):($("#chkSat").prop("checked",!1),$("#lblSat").hide()),n.sunday==!0||n.sunday=="True"?($("#chkSun").prop("checked",!0),$("#lblSun").show()):($("#chkSun").prop("checked",!1),$("#lblSun").hide()),n.monday==!0&&n.tuesday==!0&&n.wednesday==!0&&n.thursday==!0&&n.friday==!0||n.monday=="True"&&n.tuesday=="True"&&n.wednesday=="True"&&n.thursday=="True"&&n.friday=="True"?($("#chkMon-Fri").prop("checked",!0),$("#lblMon-Fri").show(),$("#lblMon").hide(),$("#lblTues").hide(),$("#lblWed").hide(),$("#lblThurs").hide(),$("#lblFri").hide()):($("#chkMon-Fri").prop("checked",!1),$("#lblMon-Fri").hide()),n.saturday==!0&&n.sunday==!0||n.saturday=="True"&&n.sunday=="True"?($("#chkSatSun").prop("checked",!0),$("#lblSatSun").show(),$("#lblSat").hide(),$("#lblSun").hide()):($("#chkSatSun").prop("checked",!1),$("#lblSatSun").hide()),n.dropoffTime==""&&(n.dropoffTime=null),n.pickupTime==""&&(n.pickupTime=null),n.dropoffTime!=null?($("#selDropoff").kendoTimePicker({value:n.dropoffTime}),$("#lblDropoff").html("&#10004; "+n.dropoffTime),$("#lblDropoff").show()):($("#selDropoff").kendoTimePicker({value:n.dropoffTime}),$("#lblDropoff").html(""),$("#lblDropoff").hide()),n.pickupTime!=null?($("#selPickup").kendoTimePicker({value:n.pickupTime}),$("#lblPickup").html("&#10004; "+n.pickupTime),$("#lblPickup").show()):($("#selPickup").kendoTimePicker({value:n.pickupTime}),$("#lblDropoff").html(""),$("#lblPickup").hide()),n.ward!=null&&(i=n.ward.split(","),jQuery.inArray("1",i)!==-1?($("#chkWard1").prop("checked",!0),$("#lblWard1").show()):($("#chkWard1").prop("checked",!1),$("#lblWard1").hide()),jQuery.inArray("2",i)!==-1?($("#chkWard2").prop("checked",!0),$("#lblWard2").show()):($("#chkWard2").prop("checked",!1),$("#lblWard2").hide()),jQuery.inArray("3",i)!==-1?($("#chkWard3").prop("checked",!0),$("#lblWard3").show()):($("#chkWard3").prop("checked",!1),$("#lblWard3").hide()),jQuery.inArray("4",i)!==-1?($("#chkWard4").prop("checked",!0),$("#lblWard4").show()):($("#chkWard4").prop("checked",!1),$("#lblWard4").hide()),jQuery.inArray("5",i)!==-1?($("#chkWard5").prop("checked",!0),$("#lblWard5").show()):($("#chkWard5").prop("checked",!1),$("#lblWard5").hide()),jQuery.inArray("6",i)!==-1?($("#chkWard6").prop("checked",!0),$("#lblWard6").show()):($("#chkWard6").prop("checked",!1),$("#lblWard6").hide()),jQuery.inArray("7",i)!==-1?($("#chkWard7").prop("checked",!0),$("#lblWard7").show()):($("#chkWard7").prop("checked",!1),$("#lblWard7").hide()),jQuery.inArray("8",i)!==-1?($("#chkWard8").prop("checked",!0),$("#lblWard8").show()):($("#chkWard8").prop("checked",!1),$("#lblWard8").hide())),n.quadrent!=null&&(u=n.quadrent.split(","),jQuery.inArray("NW",u)!==-1?($("#chkNW").prop("checked",!0),$("#lblNW").show()):($("#chkNW").prop("checked",!1),$("#lblNW").hide()),jQuery.inArray("NE",u)!==-1?($("#chkNE").prop("checked",!0),$("#lblNE").show()):($("#chkNE").prop("checked",!1),$("#lblNE").hide()),jQuery.inArray("SE",u)!==-1?($("#chkSE").prop("checked",!0),$("#lblSW").show()):($("#chkSE").prop("checked",!1),$("#lblSW").hide()),jQuery.inArray("SW",u)!==-1?($("#chkSW").prop("checked",!0),$("#lblSE").show()):($("#chkSW").prop("checked",!1),$("#lblSE").hide())),n.cacfpParticipation==!0||n.cacfpParticipation=="True"?($("#chkCacfp").prop("checked",!0),$("#lblCacfp").show()):($("#chkCacfp").prop("checked",!1),$("#lblCacfp").hide()),n.isQuin==!0||n.isQuin=="True"?($("#chkQuin").prop("checked",!0),$("#lblQuin").show()):($("#chkQuin").prop("checked",!1),$("#lblQuin").hide()),n.isMontessori==!0||n.isMontessori=="True"?($("#chkMontessoriProgram").prop("checked",!0),$("#lblMontessoriProgram").show()):($("#chkMontessoriProgram").prop("checked",!1),$("#lblMontessoriProgram").hide()),n.isHeadStart==!0||n.isHeadStart=="True"?($("#chkHeadStart").prop("checked",!0),$("#lblHeadStart").show()):($("#chkHeadStart").prop("checked",!1),$("#lblHeadStart").hide()),n.isDCPS==!0||n.isDCPS=="True"?($("#chkDcps").prop("checked",!0),$("#lblDcps").show()):($("#chkDcps").prop("checked",!1),$("#lblDcps").hide()),n.isOsseEceSubsidiaryProvider==!0||n.isOsseEceSubsidiaryProvider=="True"?($("#chkOsseEceSubsidiaryProvider").prop("checked",!0),$("#lblOsseEceSubsidiaryProvider").show()):($("#chkOsseEceSubsidiaryProvider").prop("checked",!1),$("#lblOsseEceSubsidiaryProvider").hide()),n.isFederalGovernmentFacility==!0||n.isFederalGovernmentFacility=="True"?($("#chkFederalGovernmentPolicy").prop("checked",!0),$("#lblFederalGovernmentPolicy").show()):($("#chkFederalGovernmentPolicy").prop("checked",!1),$("#lblFederalGovernmentPolicy").hide()),n.isCharterSchool==!0||n.isCharterSchool=="True"?($("#chkCharterSchool").prop("checked",!0),$("#lblCharterSchool").show()):($("#chkCharterSchool").prop("checked",!1),$("#lblCharterSchool").hide()),n.isEarlyHeadStart==!0||n.isEarlyHeadStart=="True"?($("#chkEarlyHeadStart").prop("checked",!0),$("#lblEarlyHeadStart").show()):($("#chkEarlyHeadStart").prop("checked",!1),$("#lblEarlyHeadStart").hide()),n.isSignLanguage==!0||n.isSignLanguage=="True"?($("#chkSignLanguage").prop("checked",!0),$("#lblSignLanguage").show()):($("#chkSignLanguage").prop("checked",!1),$("#lblSignLanguage").hide()),n.languageSpoken=="Spanish"?($("#chkLanguageSpoken").prop("checked",!0),$("#lblLanguageSpoken").show()):($("#chkLanguageSpoken").prop("checked",!1),$("#lblLanguageSpoken").hide()),n.isDCGovernmentFacility==!0||n.isDCGovernmentFacility=="True"?($("#chkDCGovernmentFacility").prop("checked",!0),$("#lblDCGovernmentFacility").show()):($("#chkDCGovernmentFacility").prop("checked",!1),$("#lblDCGovernmentFacility").hide()),n.isFaithBased==!0||n.isFaithBased=="True"?($("#chkFaithBased").prop("checked",!0),$("#lblFaithBased").show()):($("#chkFaithBased").prop("checked",!1),$("#lblFaithBased").hide()),n.isPreKEnhanced==!0||n.isPreKEnhanced=="True"?($("#chkPreKEnhancement").prop("checked",!0),$("#lblPreKEnhancement").show()):($("#chkPreKEnhancement").prop("checked",!1),$("#lblPreKEnhancement").hide()),n.isHomeless==!0||n.isHomeless=="True"?($("#chkHomeless").prop("checked",!0),$("#lblHomeless").show()):($("#chkHomeless").prop("checked",!1),$("#lblHomeless").hide()),n.cqDesignation!=null&&(r=n.cqDesignation.split(","),jQuery.inArray("Preliminary",r)!==-1?($("#chkPreliminary").prop("checked",!0),$("#lblPreliminary").show()):($("#chkPreliminary").prop("checked",!1),$("#lblPreliminary").hide()),jQuery.inArray("Developing",r)!==-1?($("#chkDeveloping").prop("checked",!0),$("#lblDeveloping").show()):($("#chkDeveloping").prop("checked",!1),$("#lblDeveloping").hide()),jQuery.inArray("Progressing",r)!==-1?($("#chkProgressing").prop("checked",!0),$("#lblProgressing").show()):($("#chkProgressing").prop("checked",!1),$("#lblProgressing").hide()),jQuery.inArray("Quality",r)!==-1?($("#chkQuality").prop("checked",!0),$("#lblQuality").show()):($("#chkQuality").prop("checked",!1),$("#lblQuality").hide()),jQuery.inArray("High-Quality",r)!==-1?($("#chkHigh-Quality").prop("checked",!0),$("#lblHigh-Quality").show()):($("#chkHigh-Quality").prop("checked",!1),$("#lblHigh-Quality").hide())),t&&(e={SSC_Id:n.SSC_Id,FacilityName:n.facilityName,InfantServed:n.infantServed,ToddlerServed:n.toddlerServed,PreSchoolServed:n.preSchoolServed,SchoolAgeServed:n.schoolAgeServed,BeforeCare:n.beforeCare,AfterCare:n.afterCare,Monday:n.monday,Tuesday:n.tuesday,Wednesday:n.wednesday,Thursday:n.thursday,Friday:n.friday,Saturday:n.saturday,Sunday:n.sunday,CACFPParticipation:n.cacfpParticipation,IsQuin:n.isQuin,IsMontessori:n.isMontessori,IsHeadStart:n.isHeadStart,IsDCPS:n.isDCPS,IsOsseEceSubsidiaryProvider:n.isOsseEceSubsidiaryProvider,IsFederalGovernmentFacility:n.isFederalGovernmentFacility,IsCharterSchool:n.isCharterSchool,IsEarlyHeadStart:n.isEarlyHeadStart,IsSignLanguage:n.isSignLanguage,LanguageSpoken:n.languageSpoken==!0?"Spanish":null,IsDCGovernmentFacility:n.isDCGovernmentFacility,IsFaithBased:n.isFaithBased,IsPreKEnhanced:n.isPreKEnhanced,IsHomeless:n.isHomeless,CQDesignation:n.cqDesignation,Quadrent:n.quadrent,Wards:n.ward,Facilitytype:n.facilityType,DropOffTime:n.dropoffTime,PickUpTime:n.pickupTime},querySearch(e)))}function setScheduleTime(n,t){if(t!=undefined&&t!=null&&t!=""){var i=t.split(" "),r=n.substr(0,4)+"-"+n.substr(4).toLowerCase();$("#lbl"+n).html("&#10004; "+r+": "+t+"&nbsp ");$("#sel"+n+" option").each(function(){return $(this).text()==i[0]?($(this).attr("selected","selected"),!1):!0});$("#btn"+n).html(i[1])}}function clearCriteria(n){$("#txtQuickSearch").val("");$(".ASearch:checkbox").attr("checked",!1);$(".selected").hide();$("#lblDropoff").html("");$("#selDropoff")[0].selectedIndex=0;$("#lblPickup").html("");$("#selPickup")[0].selectedIndex=0;$("#ddSearchList")[0].selectedIndex=0;var t=$("#selDropoff").data("kendoTimePicker"),i=$("#selPickup").data("kendoTimePicker");t!==undefined&&t.value(null);i!==undefined&&i.value(null);n&&querySearch()}function setCtrlLabel(n,t){var i,r;"Mon:Tues:Wed:Thurs:Fri:Sat:Sun:Mon-Fri:SatSun".indexOf(n)>=0?setDayOfTheWeek(n,i):(i=$("#chk"+n),r=$("#lbl"+n),i!=null&&r!=null&&(i[0].checked==!0?r.show():r.hide()));t&&querySearch()}function setDayOfTheWeek(n,t){var r,i,u,f;(t==undefined||t==null)&&(t=$("#chk"+n));r=t[0].checked;i="wkEnd";n!="Sat"&&n!="Sun"&&n!="SatSun"&&(i="wkDays");n=="Mon-Fri"||n=="SatSun"?setWholeWeek(i,r):r==!0?(u=0,f=$("input."+i),f.each(function(){this.checked==r&&u++}),f.length==u?($("input."+i+"All")[0].checked=!0,$(".selected."+i).hide(),$(".selected."+i+"All").show()):$("#lbl"+n).show()):($("input."+i+"All")[0].checked=!1,$(".selected."+i+"All").hide(),$("input."+i).each(function(){this.checked==!0?$("#lbl"+this.id.substr(3)).show():$("#lbl"+this.id.substr(3)).hide()}))}function toggleAmPm(n){$("#"+n).html().trim()=="AM"?$("#"+n).html("PM"):$("#"+n).html("AM");displayScheduleTime(n.substr(3),!0)}function dropoffPickupChange(){var t=$("#selDropoff").val(),n,i,r;if(t==""&&(t=null),t!=null&&($("#lblDropoff").html("&#10004; Drop-off: "+t),$("#lblDropoff").show()),n=$("#selPickup").val(),n==""&&(n=null),n!=null&&($("#lblPickup").html("&#10004; Pick-up: "+n),$("#lblPickup").show()),i=new Date("November 13, 2013 "+t),i=i.getTime(),r=new Date("November 13, 2013 "+n),r=r.getTime(),i>r&&t!=""&&n!="")return alert("Drop-off time cannot be after pickup time."),!1;console.log(t);console.log(n);querySearch()}function displayScheduleTime(n,t){var r=n.substr(0,4)+"-"+n.substr(4).toLowerCase(),u=$("#sel"+n),i=$("#lbl"+n),f=$("#btn"+n);u.val()!="Select "+r+" Time"?i.html("&#10004; "+r+": "+u.val()+" "+f.text().trim()+"&nbsp "):i.html("");compareTimes()?t&&i.html()!=""&&querySearch():alert("Drop-off time cannot be after pickup time")}function compareTimes(){var n=$("#lblDropoff").html(),t=$("#lblPickup").html();return n==""||t==""?!0:convertToTime(n)>convertToTime(t)?!1:!0}function convertToTime(n){var r;n=n.toLowerCase().replace(/ /g,":");var t=n.split(":"),i=parseInt(t[3]),u=parseInt(t[4]);return t[5].substr(0,1)=="p"&&(i+=12),r=new Date(2020,3,3,i,u),r.getTime()}function querySearch(n){var t=n,i;return t==null&&(t=createParameterObj(name)),i=0,$.ajax({method:"POST",url:"/Home/RunSearch",data:t}).done(function(n){showResultFacilities(n)}),!1}function SaveSearch(){var t=document.getElementById("ddSearchList"),o,i,n,r,e,f,s,u,h;if(isLoggedOn){for(i=createParameterObj(),n="",t!=null&&t.selectedIndex>0&&(r=t.options[t.selectedIndex],r!=null&&(u=confirm("Do you want to update "+r.text+"?"),u==!0?(n=r.text,i.SaveSearchID=r.value):i.SaveSearchID=0));n.trim().length==0;){if(n="My saved search",t.selectedIndex>0&&(n=t[t.selectedIndex].text),n=prompt("Please enter the name to save your search",n),n==null)return!1;if(n.trim().length>0&&t!=null)for(e=t.options,f=0;f<e.length;f++)if(s=e[f].text.toLowerCase(),s==n.toLowerCase()){if(u=confirm("There is already a saved search named '"+n+"' do you want to replace that search?"),u==!1)return!1;n=e[f].text;i.SaveSearchID=0;break}}i.SearchName=n;h=0;$.ajax({method:"POST",url:"/MyChildCare/SaveSearch",data:i}).done(function(n){FinishSaveRequest(i,n)})}else if(o=confirm("In order to save the search criteria you need to be logged into My Child Care DC. Do you want to log in now?"),o)location.href="/Account/Login?returnUrl="+encodeURIComponent("/Home/SearchFacilities#SaveSearch");else return o}function FinishSaveRequest(n,t){$("#ddSearchList option").each(function(){return this.value==0?(this.text="-- Select Saved Search --",!1):this.value==t?(this.prop("selected",!0),!0):void 0});n.SaveSearchID==0&&$("#ddSearchList").append(new Option(n.SearchName,t,!0,!0));alert("Search criteria saved")}function ShowNewTab(n){var t,i,r;return(facilityDisplaying&&!isMobileDevice||isMobileDevice&&facilityDisplaying&&n!="map")&&(t=document.getElementById("facilityNameDisplay"),t!=null&&(i=t.getAttribute("facilityID"),r=$("#"+i).attr("seq"),searchMap.closeActiveLocation(r)),facilityDisplaying=!1),isMobileDevice?setTabs(n):lastActiveTab=n,!0}function setTabs(n){$("a.mobileTabSection").removeClass("active");$("#"+n).className+=" active"}function closeSide(){var n=$("#MapTab"),t=$("#closeSide"),r=$("#ShowMe"),u=$(".facilityTab"),i;r.hasClass("collapse")?(n.removeClass("col-sm-12"),n.addClass("col-sm-8"),$("#closeTab").attr("title","Hide Panel").tooltip("fixTitle").tooltip("show"),t.removeClass("glyphicon-arrow-right"),t.addClass("glyphicon-arrow-left"),r.removeClass("collapse"),$("#closeTab").attr("aria-expanded","false"),$("#closeTab").removeClass("active"),i=$(".tab-content").children(".tab-pane.active")[0].id,i!="Facility"&&($("#tab_"+i).addClass("active"),$("#tab_"+i).attr("aria-expanded","true")),u.show()):(n.removeClass("col-sm-8"),n.addClass("col-sm-12"),$("#closeTab").attr("title","Display Panel").tooltip("fixTitle").tooltip("show"),t.removeClass("glyphicon-arrow-left"),t.addClass("glyphicon-arrow-right"),r.addClass("collapse"),u.hide())}function showPosition(n){alert("Latitude: "+n.coords.latitude+"<br>Longitude: "+n.coords.longitude)}function MoveTab(n){var t,i,r;if(!n){if(t=n,t.className.indexOf("accordianTitles")<0){t=n.parentNode.firstChild;do{if(t.className,indexOf("accordianTitle")>=0)break;t=t.nextSibling}while(t)}return i=closest(t),i&&(r=document.getElementById("accordion"),i!=r.firstChild&&(r.removeChild(i),r.insertBefore(i,r.firstChild))),!0}}function closest(n){for(var t=n.parentElement;t!=null;){if(t.className.indexOf("panel-default")>=0)break;t=t.parentElement}return t}function clearComparedFacilities(){for(var r=document.getElementById("divFixedView"),i=r.getElementsByClassName("facility"),t,n=0;n<i.length;n++)t=i[n].getElementsByClassName("chkCompare")[0],t.checked&&(t.checked=!1,searchMap.clearCompareLocation(n))}function FacilityHover(n){return'<span class="ProximaSoft-Semibold" style="color: #3048fb;">'+n.name+"<\/span> <br /> <span>"+n.address+"<\/span>"}function ShowFacility(n){var r=$("#"+n).attr("seq"),t=$(".tab-pane.active.in"),u,i;return t!=null&&t[0].id!="Facility"&&(t.removeClass("active in"),u=$(".facilityTab").attr("aria-expanded","false"),$(".facilityTab").parent().removeClass("active"),$("#Facility").addClass("active in"),lastActiveTab=isMobileDevice?t:t[0].id),location.href="#"+n,i={facilityID:n},$.ajax({method:"POST",url:"/MyChildCare/FacilityDetail",data:i}).done(function(n){ShowFacilityDetails(n)}),searchMap.setActiveLocation(r,searchMap.markerIconSelected),!1}function CloseActiveFacilityTab(n){var t,i;return $("#Facility").removeClass("active in"),lastActiveTab!=null&&(t=lastActiveTab,isMobileDevice||(t=$("#"+t)),t.addClass("active in"),$("#tab_"+t[0].id).addClass("active"),$("#tab_"+t[0].id).attr("aria-expanded","true")),facilityDisplaying=!1,i=$("#"+n).attr("seq"),searchMap.closeActiveLocation(i),!0}function ShowFacilityDetails(n){var i=document.getElementById("commonDiv"),t;isMobileDevice&&(facilityDisplaying=!0);$("#facilityDetails").html(n);t=$("#facilityDetails").find("input.chkComparison");t!=null&&ProviderSearchCompare(t[0],!0)}function runQuickSearch(){var n={facilityName:getControlValue("txtQuickSearch"),distance:0};return $.ajax({method:"POST",url:"/Home/RunQuickSearch",data:n}).done(function(n){showResultFacilities(n)}),!1}function showResultFacilities(n){var t=$("#divFixedView");$("#divFixedView").html(n);mapAllLocations()}function updateFacilityText(){querySearch();goToTab("view")}function ShowRouteResults(n){$("#map").html(n)}function compareCheckView(n){var t=$("#"+n).attr("seq"),i=document.getElementById("in_"+n);compareCheck(t,i.checked,!1)}function ProviderSearchCompare(n,t){var u=n.id.substring(4),r=document.getElementById("in_"+u),i;t?n.checked=r.checked:r.checked=n.checked;i=$("#"+u).attr("seq");t||(r.checked?searchMap.setLastIcon(i,searchMap.markerIconColor.compare):searchMap.setLastIcon(i,searchMap.markerIconColor.found));compareCheck(i,n.checked,!0)}function compareCheck(n,t,i){searchMap.setCompareLocation(n,t,i);event.stopPropagation();var r=0;$("input:checkbox.chkCompare:checked").each(function(){r++});$("#btnCompare").prop("disabled",r<2)}function mapARoute(){var n=$("#txtStartLocation").val(),t=$("#txtEndLocation").val(),i=parseFloat($("input[name='rdDistance']:checked").attr("id").substring(0,3));searchMap.mapRoute(n,t,i,12);isMobileDevice&&goToTab("theMap")}function goToTab(n){var i=document.getElementById("tabChoice"),t;i!=null?(t=$(".tab-pane.active.in"),t!=null&&t[0].id!=n&&(t.removeClass("active in"),$(".mobileTabSection").removeClass("active"),$('.mobileTabSection[href="#'+n+'"]').addClass("active")),$("#"+n).addClass("active in"),lastActiveTab=t):($("#Facility").removeClass("active in"),lastActiveTab!=null&&($("#"+lastActiveTab).removeClass("active in"),$("#tab_"+lastActiveTab).removeClass("active"),$("#tab_"+lastActiveTab).attr("aria-expanded","false")),$("#"+n).addClass("active in"),$("#tab_"+n).addClass("active"),$("#tab_"+n).attr("aria-expanded","true"),lastActiveTab=n)}function mapAllLocations(){var n,t,r;for(searchMap.initialize(),n=$("#divFixedView").find("div.facility"),i=0;i<n.length;i++)$(n[i]).attr("seq",i),t=$(n[i]).attr("id"),latlng={lng:parseFloat($(n[i]).attr("lng")),lat:parseFloat($(n[i]).attr("lat")),id:parseFloat(t),seq:i,name:document.getElementById("name_"+t).innerHTML,address:document.getElementById("addr_"+t).innerHTML,height:n[i].offsetHeight,compare:!1,route:!1,lastIcon:null},searchMap.addLocation(latlng);searchMap.setMapLocations(12);n.length==0&&googleCalled&&(r='<div id="0" lng="0" lat="0"><button type="button" data-toggle="tab" disabled="true" aria-expanded="false" style="width:100%;text-align:center"><span id="name_0" style="font-size:15pt;color:green;text-align:center"><i class="glyphicon glyphicon-info-sign"><\/i>&nbsp;No Facilities Found.<\/span><br /><br /><span id="phone_0">There were no facilities found<br />based on the search criteria entered.<br /><br /><\/span><\/button>',$("#divFixedView").html(r))}function clearRouteCriteria(){$("#txtStartLocation").val("");$("#txtEndLocation").val("");$("#3Mile").attr("checked",!1);$("#7Mile").attr("checked",!1);$("#1Mile").attr("checked",!1);searchMap.clearRoute()}var lastPageNo=0,recordCount=0,lastSearchParms=null,lastSearchAction="",selectedFacilities=null;$(document).ajaxComplete(function(){$("#modalDiv").hide()});$(document).ajaxStart(function(){$("#modalDiv").show()})