var AJAX_VALIDATION_RESPONSE=0;var AJAX_NEARBY_STORES_RESPONSE=1;var AJAX_GRAND_OPENING_RESPONSE=2;
var AJAX_STORE_DETAIL_RESPONSE=3;var NEARBY_STORES_ZOOM_LEVEL=8;var STORE_DETAIL_ZOOM_LEVEL=15;
var LOCATION_LIST_ITEM_COLLAPSE_HEIGHT=30;var LOCATION_LIST_ITEM_COLLAPSE_DOUBLE_HEIGHT=43;
var LOCATION_LIST_ITEM_EXPAND_HEIGHT=175;var LOCATION_LIST_ITEM_EXPAND_COLLAPSE_STEP_VALUE=10;
var map=null;var currentStoreDetails=null;var currentExpandedLocationId=null;function GetMap(mapPlaceholderID){try{if(map==null){map=new VEMap(mapPlaceholderID);
map.LoadMap();var printOpt=new VEPrintOptions(true);map.SetPrintOptions(printOpt);
document.getElementById("MSVE_obliqueNotification").innerHTML="";document.getElementById("MSVE_navAction_FlatlandMapMode").innerHTML="2D";
document.getElementById("MSVE_navAction_View3DMapMode").innerHTML="3D";document.getElementById("MSVE_navAction_RoadMapStyle").innerHTML="Road";
document.getElementById("MSVE_navAction_AerialMapStyle").innerHTML="Aerial";document.getElementById("MSVE_navAction_ObliqueMapView").innerHTML="Bird's eye";
document.getElementById("MSVE_navAction_showLabels").innerHTML="Labels";}}catch(e){alert("GetMap error: "+e);
}}function AddPushpin(latitude,longitude,title,description,customImageSource){if(map==null){GetMap("MapPanel");
}var shape=new VEShape(VEShapeType.Pushpin,new VELatLong(latitude,longitude));if(title!=""){shape.SetTitle(title);
}if(description!=""){shape.SetDescription(description);}if(customImageSource!=""){shape.SetCustomIcon(customImageSource);
}map.AddShape(shape);}function clearMap(mapDivId){document.getElementById(mapDivId).innerHTML="";
}function DeleteAllShape(){map.DeleteAllShapes();}function PrintMap(){window.print();
}function showRouteAndDirectionUsingAddress(fromAddress,toLatitude,toLongitude,drivingItineraryPlaceholderId){var options=new VERouteOptions();
options.RouteCallback=showDirection;map.GetDirections([fromAddress,new VELatLong(toLatitude,toLongitude)],options);
function showDirection(route){var legs=route.RouteLegs;var distance=route.Distance.toFixed(2);
var duration=(route.Time/60).toFixed(0);var numTurns=0;var leg=null;var resultHtml='<table style="width:100%;">'+'<tr><td colspan="2"><b>Total distance: </b>'+distance+" miles</td></tr>"+'<tr><td colspan="2"><b>Estimated driving time: </b>'+duration+" minutes</td></tr>"+'<tr><td colspan="2" style="height:15px;"></td></tr>'+'<tr><td><b>Directions</b></td><td style="text-align:right;"><b>Miles</b></td></tr>';
for(var i=0;i<legs.length;i++){leg=legs[i];var turn=null;for(var j=0;j<leg.Itinerary.Items.length;
j++){turn=leg.Itinerary.Items[j];numTurns++;var currLegText=numTurns+".\t"+turn.Text;
var currLegDuration=turn.Distance.toFixed(2);resultHtml=resultHtml+"<tr><td>"+currLegText+'</td><td style="text-align:right;">'+currLegDuration+"</td></tr>";
}}resultHtml=resultHtml+"</table>";document.getElementById(drivingItineraryPlaceholderId).innerHTML=resultHtml;
}}function showRouteAndDirectionUsingLatLong(fromLatitude,fromLongitude,toLatitude,toLongitude,drivingItineraryPlaceholderId){var options=new VERouteOptions();
options.RouteCallback=showDirection;map.GetDirections([new VELatLong(fromLatitude,fromLongitude),new VELatLong(toLatitude,toLongitude)],options);
function showDirection(route){var legs=route.RouteLegs;var distance=route.Distance.toFixed(2);
var duration=(route.Time/60).toFixed(0);var numTurns=0;var leg=null;var resultHtml='<table style="width:100%;">'+'<tr><td colspan="2"><b>Total distance: </b>'+distance+" miles</td></tr>"+'<tr><td colspan="2"><b>Estimated driving time: </b>'+duration+" minutes</td></tr>"+'<tr><td colspan="2" style="height:15px;"></td></tr>'+'<tr><td><b>Directions</b></td><td style="text-align:right;"><b>Miles</b></td></tr>';
for(var i=0;i<legs.length;i++){leg=legs[i];var turn=null;for(var j=0;j<leg.Itinerary.Items.length;
j++){turn=leg.Itinerary.Items[j];numTurns++;var currLegText=numTurns+".\t"+turn.Text;
var currLegDuration=turn.Distance.toFixed(2);resultHtml=resultHtml+"<tr><td>"+currLegText+'</td><td style="text-align:right;">'+currLegDuration+"</td></tr>";
}}resultHtml=resultHtml+"</table>";document.getElementById(drivingItineraryPlaceholderId).innerHTML=resultHtml;
}}function updateNearbyStoresMap(jsonLocationResults,focusLatitude,focusLongitude){if(jsonLocationResults==null){return ;
}var result="";var name="";var locations=new Array;locations.push(new VELatLong(focusLatitude,focusLongitude));
for(var i=0;i<jsonLocationResults.length;i++){var currResult=jsonLocationResults[i];
var name=currResult.Name;var storeId=currResult.StoreId;var description=currResult.Address+"<br/>"+(currResult.City).replace(/\s/g,"&nbsp;")+", "+currResult.State+" "+currResult.PostalCode+"<br/>"+currResult.PhoneNumber+"<br/><br/>"+"<a href="+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>Get Directions</a> | <a href="+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>Details</a>";
var latitude=currResult.LatLong.Latitude;var longitude=currResult.LatLong.Longitude;
var iconPath=GetNearbyStoresMapIconPath(currResult);AddPushpin(latitude,longitude,name,description,iconPath);
locations.push(new VELatLong(latitude,longitude));}map.SetMapView(locations);}function GetNearbyStoresMapIconPath(jsonLocation){var iconPath="/assets/locator/petco_icon_small.gif";
if(jsonLocation==null){return iconPath;}if(jsonLocation.HasUnleashedbyPETCO=="1"){iconPath="/assets/locator/unleashed_small.gif";
}return iconPath;}function updateStoreDetailMap(jsonLocation){if(jsonLocation==null){return ;
}var name=jsonLocation.Name;var latitude=jsonLocation.LatLong.Latitude;var longitude=jsonLocation.LatLong.Longitude;
var description=jsonLocation.Address+"<br/>"+(jsonLocation.City).replace(/\s/g,"&nbsp;")+", "+jsonLocation.State+" "+jsonLocation.PostalCode+"<br/>"+jsonLocation.PhoneNumber;
var iconPath=GetStoreDetailMapIconPath(jsonLocation);AddPushpin(latitude,longitude,name,description,iconPath);
map.SetCenterAndZoom(new VELatLong(latitude,longitude),STORE_DETAIL_ZOOM_LEVEL);}function GetStoreDetailMapIconPath(jsonLocation){var iconPath="/assets/locator/petco_icon.gif";
if(jsonLocation==null){return iconPath;}if(jsonLocation.HasUnleashedbyPETCO=="1"){iconPath="/assets/locator/unleashed.gif";
}return iconPath;}function ResponseHandler(response){try{ajaxResponse=eval("("+response+")");
responseType=ajaxResponse.Type;if(responseType==AJAX_VALIDATION_RESPONSE){if(ajaxResponse.IsValidAddress==1){if(ajaxResponse.RequestOrigin=="home"){query="?city="+ajaxResponse.City+"&state="+ajaxResponse.State+"&zip="+ajaxResponse.Zip+"&origin=home";
if(document.getElementById("chkAllStores").checked==true){query=query+"&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0";
}else{query=query+"&veterinary="+boolToInt(document.getElementById("chkVaccinations").checked)+"&fullGrooming="+boolToInt(document.getElementById("chkFullGrooming").checked)+"&selfGrooming="+boolToInt(document.getElementById("chkSelfDogWash").checked)+"&education="+boolToInt(document.getElementById("chkCanineEducation").checked)+"&photography="+boolToInt(document.getElementById("chkPhotography").checked)+"&aquatics="+boolToInt(document.getElementById("chkAquatics").checked)+"&dnabreedtesting="+boolToInt(document.getElementById("chkDnaBreedTesting").checked)+"&unleashedbypetco="+boolToInt(document.getElementById("chkUnleashed").checked);
}window.location=searchResultPageUrl+query+"&Nav=2";}else{if(ajaxResponse.RequestOrigin=="searchResult"){query="?city="+ajaxResponse.City+"&state="+ajaxResponse.State+"&zip="+ajaxResponse.Zip+"&origin=searchResult";
window.location=searchResultPageUrl+query+"&Nav=2";}else{if(ajaxResponse.RequestOrigin=="storeDetails"){var fromLatitude=ajaxResponse.LatLong.Latitude;
var fromLongitude=ajaxResponse.LatLong.Longitude;var fromAddress="";var fromCity="";
var fromState="";var fromZip="";if(document.getElementById("txtAddress")!=null){fromAddress=document.getElementById("txtAddress").value;
}if(document.getElementById("txtCity")!=null){fromCity=document.getElementById("txtCity").value;
}if(document.getElementById("txtState")!=null){fromState=document.getElementById("ddlState").value;
}if(document.getElementById("txtZip")!=null){fromZip=document.getElementById("txtZip").value;
}var toLatitude=currentStoreDetails.LatLong.Latitude;var toLongitude=currentStoreDetails.LatLong.Longitude;
if(fromZip!=""){showRouteAndDirectionUsingLatLong(fromLatitude,fromLongitude,toLatitude,toLongitude,"drivingItineraryPanel");
showMultiLineFromAddress(fromAddress,fromCity,fromState,fromZip,"fromAddressPanel");
}else{checkAmbiguationAndShowRouteAndDirection(fromAddress,fromCity,fromState,fromZip,toLatitude,toLongitude,"fromAddressPanel","drivingItineraryPanel","warningBoxPanel","warningMessagePanel");
}}}}}else{showErrorMessage("&nbsp;Sorry, we were unable to find this location. Please enter a valid ZIP Code or City and State combination.","errorBoxPanel","errorMessagePanel");
if(ajaxResponse.RequestOrigin=="searchResult"){window.scroll(0,0);}}}}catch(e){}}function checkAmbiguationAndShowRouteAndDirection(fromAddress,fromCity,fromState,fromZip,toLatitude,toLongitude,fromAddressPlaceholderId,drivingItineraryPlaceholderId,disambiguationMessageBoxPlaceholderId,disambiguationMessagePlaceholderId){var where=fromAddress+", "+fromCity+", "+fromState+", "+fromZip;
map.Find(null,where,null,null,null,null,false,false,false,null,checkDisambiguationCallback);
function checkDisambiguationCallback(layer,resultsArray,places,hasMore,veErrorMessage){if(places!=null&&places.length>=1){if(places[0].MatchConfidence==0){showRouteAndDirectionUsingAddress(places[0].Name,toLatitude,toLongitude,drivingItineraryPlaceholderId);
showMultiLineFromAddress(fromAddress,fromCity,fromState,fromZip,fromAddressPlaceholderId);
}else{var results="";for(x=0;x<places.length;x++){var link="<a href=\"javascript:hide('"+disambiguationMessageBoxPlaceholderId+"');showRouteAndDirectionUsingAddress('"+places[x].Name+"', '"+toLatitude+"', '"+toLongitude+"', '"+drivingItineraryPlaceholderId+"');showSingleLineFromAddress('"+places[x].Name+"', '"+fromAddressPlaceholderId+"')\">"+places[x].Name+"</a><br>";
results+=link;}document.getElementById(disambiguationMessagePlaceholderId).innerHTML=results;
show(disambiguationMessageBoxPlaceholderId);}}}}function validateStoreSearchInput(city,state,zip,errorBoxPlaceholderId,errorMessagePlaceholderId,requestOrigin){if((trim(city)!=""&&trim(state)!="")||trim(zip)!=""){InvokeValidationASHX("findNearby.ashx","",city,state,zip,requestOrigin);
}else{showErrorMessage("Please enter a valid ZIP Code or City and State combination.",errorBoxPlaceholderId,errorMessagePlaceholderId);
}}function validateDirectionSearchInput(address,city,state,zip,errorBoxPlaceholderId,errorMessagePlaceholderId,requestOrigin){if((trim(city)!=""&&trim(state)!="")||trim(zip)!=""){InvokeValidationASHX("findNearby.ashx",address,city,state,zip,requestOrigin);
}else{showErrorMessage("Please enter a valid ZIP Code or City and State combination.",errorBoxPlaceholderId,errorMessagePlaceholderId);
}}function showErrorMessage(message,errorBoxPlaceholderId,errorMessagePlaceholderId){document.getElementById(errorMessagePlaceholderId).innerHTML=message;
show(errorBoxPlaceholderId);}function showSingleLineFromAddress(fullAddress,fromAddressPlaceholderId){var fromAddress="";
var resultHtml="<table><tr><td><b>From:</b><br/>";resultHtml=resultHtml+fullAddress;
resultHtml=resultHtml+"<td></tr></table>";document.getElementById(fromAddressPlaceholderId).innerHTML=resultHtml;
}function showMultiLineFromAddress(address,city,state,zip,fromAddressPlaceholderId){var fromAddress="";
var resultHtml="<table><tr><td><b>From:</b><br/>";if(address!=""&&city!=""&&state!=""&&zip!=""){resultHtml=resultHtml+address+"<br/>"+city+", "+state+" "+zip;
}else{if(address==""&&city!=""&&state!=""&&zip==""){resultHtml=resultHtml+city+", "+state;
}else{if(address!=""&&city!=""&&state!=""&&zip==""){resultHtml=resultHtml+address+"<br/>"+city+", "+state;
}else{if((address==""||city==""||state=="")&&zip!=""){resultHtml=resultHtml+zip;}}}}resultHtml=resultHtml+"<td></tr></table>";
document.getElementById(fromAddressPlaceholderId).innerHTML=resultHtml;}function showStoreDetail(Location,newSearchPlaceholderId,storeNamePlaceholderId,storeHoursPlaceholderId,storeStatusPlaceholderId,storeFeaturePlaceholderId,storeLinkPlaceholderId){var name=Location.Name;
var address=Location.Address;var city=Location.City;var state=Location.State;var postalCode=Location.PostalCode;
var phoneNumber=Location.PhoneNumber;var storeId=Location.StoreId;var newSearchLinkHtml='<a class="newSearchLink" href="'+homepageUrl+'?Nav=2">Start a New Search</a>';
var storeNameHtml="<b>"+name+"</b><br/>"+address+"<br/>"+city+", "+state+" "+postalCode+"<br/>"+phoneNumber;
var storeHoursHtml=getStoreHours(Location);var storeFeatureHtml=getServices(Location);
var storeStatusHtml=getGrandOpeningStatus(Location);var storeLinkHtml="<a href=/Content/StoreEventsCalendar.aspx?storenum="+storeId+">Store Events Calendar</a><br/>"+"<a href=http://search.petfinder.com/awo/index.cgi?location="+postalCode+' target="_blank">PetFinder Nearby Shelters</a><br/>'+"<a href=http://petco.shoplocal.com/petco/new_user_entry.aspx?SiteID=691&PretailerID=-99165&StoreRef="+storeId+"&adref=petco_store_locator>Store Circular</a>";
document.getElementById(newSearchPlaceholderId).innerHTML=newSearchLinkHtml;document.getElementById(storeNamePlaceholderId).innerHTML=storeNameHtml;
document.getElementById(storeHoursPlaceholderId).innerHTML=storeHoursHtml;document.getElementById(storeStatusPlaceholderId).innerHTML=storeStatusHtml;
document.getElementById(storeFeaturePlaceholderId).innerHTML=storeFeatureHtml;document.getElementById(storeLinkPlaceholderId).innerHTML=storeLinkHtml;
}function showGrandOpeningList(response){showGrandOpeningsLocations(response.Locations,"grandOpeningPanel");
}function showNearbyStoresList(response){if(response.Locations!=null){showLocations(response.Locations,"resultLocationsPanel",response.RequestOrigin);
}else{showErrorMessage("&nbsp;Sorry, we were unable to find this location. Please try again.","errorBoxPanel","errorMessagePanel");
}}function setCurrentStoreDetails(response){currentStoreDetails=response.StoreDetails;
}function showStoreDetails(response){currentStoreDetails=response.StoreDetails;if(currentStoreDetails!=null){showStoreDetail(response.StoreDetails,"newSearchPanel","storeInfoPanel","storeHoursPanel","storeStatusPanel","storeFeaturePanel","storeLinkPanel");
}else{showErrorMessage("&nbsp;Sorry, we were unable to find this location. Please try again.","errorBoxPanel","errorMessagePanel");
}}function showGrandOpeningsLocations(jsonLocationResult,locationPlaceholderId){var resultHtml="";
for(var i=0;i<jsonLocationResult.length;i++){var currResult=jsonLocationResult[i];
var name=currResult.Name;var storeId=currResult.StoreId;var controlName="divStore"+storeId;
var address=currResult.Address;var city=currResult.City;var state=currResult.State;
var postalCode=currResult.PostalCode;var phoneNumber=currResult.PhoneNumber;var services=getServices(currResult);
var grandOpeningStatus=getGrandOpeningStatus(currResult);var storeHours=getStoreHours(currResult);
var expandDisplayMode="none";var collapseDisplayMode="block";var tableHeight=LOCATION_LIST_ITEM_COLLAPSE_HEIGHT;
var displayRoundedCornerBoxBorder=false;var nameColor="#1161a0";if(services.indexOf("Information Resource Center")>-1){services.replace("Information Resource Center",'<a href="/Page.aspx?PC=irc&Nav=1">Information Resource Center</a>');
}var itemHtml='<div id="'+controlName+'" class="locationListContent" style="height:'+tableHeight+'px;">'+'<table style="width:100%; height:100%;">'+"<tr>"+'<td style="width:170px;"><a id="'+controlName+'NameLink" href="javascript:expand(\''+controlName+'\')" class="locationListNameLink"><b id="'+controlName+'Name" style="color:'+nameColor+';">'+name+"</b></a></td>"+'<td style="width:364px;"><div style="display:'+collapseDisplayMode+';" id="'+controlName+'SingleLineAddress" class="locationPanelSingleLineAddress">'+address+", "+city+", "+state+"</div></td>"+'<td style="width:20px;"><img style="display:'+expandDisplayMode+'; margin-left:auto;" id="'+controlName+'CollapseButton" alt="collapse" src="/assets/locator/collapse.gif" onmouseover="this.style.cursor=\'pointer\';" onclick="collapse(\''+controlName+'\')"/><img style="display:'+collapseDisplayMode+'; margin-left:auto;" id="'+controlName+'ExpandButton" alt="expand" src="/assets/locator/expand.gif" onmouseover="this.style.cursor=\'pointer\';" onclick="expand(\''+controlName+"')\"/></td>"+"</tr>"+'<tr ><td colspan="3"><hr id="'+controlName+'LocationListHr" class="locationListHr" style="display:'+collapseDisplayMode+';"></td></tr>'+"<tr>"+'<td colspan="3">'+'<table id="'+controlName+'DetailInfo" style="width:100%;height:100%;display:'+expandDisplayMode+';"><tr>'+'<td style="width:200px;">'+address+"<br/>"+(city).replace(/\s/g,"&nbsp;")+", "+state+" "+postalCode+"<br/>"+phoneNumber+"<br/><br/>"+storeHours+"</td>"+'<td style="width:10px;"></td>'+'<td style="width:160px;">'+services+"</td>"+'<td style="width:10px;"></td>'+'<td style="width:174px;">'+grandOpeningStatus+"</td>"+"</tr></table>"+"</td>"+"</tr>"+"<tr>"+'<td colspan="3" style="text-align:center;vertical-align:bottom;">'+'<table  id="'+controlName+'Links" style="width:100%;display:'+expandDisplayMode+';"><tr>'+'<td class="locationListLink"><a class="locationPanelLink" href='+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>MAPS & DIRECTIONS</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=/Content/StoreEventsCalendar.aspx?storenum='+storeId+">STORE EVENTS</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=http://search.petfinder.com/awo/index.cgi?location='+postalCode+' target="_blank">PETFINDER SHELTERS</a></td>'+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=http://petco.shoplocal.com/petco/new_user_entry.aspx?SiteID=691&PretailerID=-99165&StoreRef='+storeId+"&adref=petco_store_locator>STORE CIRCULAR</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href='+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>DETAILS</a></td>"+"</tr></table>"+"</td>"+"</tr>"+"</table>"+"</div>";
itemHtml=insertIntoRoundedCornerBox(itemHtml,controlName,displayRoundedCornerBoxBorder);
itemHtml+='<div id="'+controlName+'BottomSpacing" style="display:'+expandDisplayMode+'; width:100%;height:15px;background-color:transparent;"></div>';
resultHtml=resultHtml+itemHtml;}document.getElementById(locationPlaceholderId).innerHTML="<br/>"+resultHtml+"<br/>";
for(var i=0;i<jsonLocationResult.length;i++){var controlName="divStore"+jsonLocationResult[i].StoreId;
if(!isSingleLined(controlName+"SingleLineAddress")){document.getElementById(controlName).style.height=LOCATION_LIST_ITEM_COLLAPSE_DOUBLE_HEIGHT+"px";
}}}function showLocations(jsonLocationResult,locationPlaceholderId,requestOrigin){var resultHtml="";
for(var i=0;i<jsonLocationResult.length;i++){var currResult=jsonLocationResult[i];
var name=currResult.Name;var storeId=currResult.StoreId;var controlName="divStore"+storeId;
var address=currResult.Address;var city=currResult.City;var state=currResult.State;
var postalCode=currResult.PostalCode;var phoneNumber=currResult.PhoneNumber;var services=getServices(currResult);
var drivingDistance=currResult.DrivingDistance;var grandOpeningStatus=getGrandOpeningStatus(currResult);
var storeHours=getStoreHours(currResult);var expandDisplayMode="none";var collapseDisplayMode="block";
var tableHeight=LOCATION_LIST_ITEM_COLLAPSE_HEIGHT;var displayRoundedCornerBoxBorder=false;
var nameColor="#1161a0";var nameLink="javascript:expand('"+controlName+"')";if(i==0){expandDisplayMode="block";
collapseDisplayMode="none";tableHeight=LOCATION_LIST_ITEM_EXPAND_HEIGHT;currentExpandedLocationId=controlName;
displayRoundedCornerBoxBorder=true;nameColor="black";nameLink=storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2";
}var itemHtml='<div id="'+controlName+'" class="locationListContent" style="height:'+tableHeight+'px;">'+'<table style="width:100%; height:100%;">'+"<tr>"+'<td style="width:170px;"><a id="'+controlName+'NameLink" href="'+nameLink+'" class="locationListNameLink"><b id="'+controlName+'Name" style="color:'+nameColor+';">'+name+"</b></a></td>"+'<td style="width:364px;"><div style="display:'+collapseDisplayMode+';" id="'+controlName+'SingleLineAddress" class="locationPanelSingleLineAddress">'+address+", "+city+", "+state+" | <b>"+drivingDistance+" mi</b></div></td>"+'<td style="width:20px;"><img style="display:'+expandDisplayMode+'; margin-left:auto;" id="'+controlName+'CollapseButton" alt="collapse" src="/assets/locator/collapse.gif" onmouseover="this.style.cursor=\'pointer\';" onclick="collapse(\''+controlName+'\')"/><img style="display:'+collapseDisplayMode+'; margin-left:auto;" id="'+controlName+'ExpandButton" alt="expand" src="/assets/locator/expand.gif" onmouseover="this.style.cursor=\'pointer\';" onclick="expand(\''+controlName+"')\"/></td>"+"</tr>"+'<tr ><td colspan="3"><hr id="'+controlName+'LocationListHr" class="locationListHr" style="display:'+collapseDisplayMode+';"></td></tr>'+"<tr>"+'<td colspan="3">'+'<table id="'+controlName+'DetailInfo" style="width:100%;height:100%;display:'+expandDisplayMode+';"><tr>'+'<td style="width:195px;">'+address+"<br/>"+(city).replace(/\s/g,"&nbsp;")+", "+state+" "+postalCode+"<br/>"+phoneNumber+"<br/><br/>"+storeHours+"</td>"+'<td style="width:5px;"></td>'+'<td style="width:140px;">'+services+"</td>"+'<td style="width:5px;"></td>'+'<td style="width:130px;">'+grandOpeningStatus+"</td>"+'<td style="width:5px;"></td>'+'<td style="width:74px;"><b>'+drivingDistance+" miles</b></td>"+"</tr></table>"+"</td>"+"</tr>"+"<tr>"+'<td colspan="3" style="text-align:center;vertical-align:bottom;">'+'<table  id="'+controlName+'Links" style="width:100%;display:'+expandDisplayMode+';"><tr>'+'<td class="locationListLink"><a class="locationPanelLink" href='+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>MAPS & DIRECTIONS</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=/Content/StoreEventsCalendar.aspx?storenum='+storeId+">STORE EVENTS</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=http://search.petfinder.com/awo/index.cgi?location='+postalCode+' target="_blank">PETFINDER SHELTERS</a></td>'+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href=http://petco.shoplocal.com/petco/new_user_entry.aspx?SiteID=691&PretailerID=-99165&StoreRef='+storeId+"&adref=petco_store_locator>STORE CIRCULAR</a></td>"+'<td class="locationListLinkDivider"></td>'+'<td class="locationListLink"><a class="locationPanelLink" href='+storeDetailsPageUrl+"?storeId="+storeId+"&Nav=2>DETAILS</a></td>"+"</tr></table>"+"</td>"+"</tr>"+"</table>"+"</div>";
itemHtml=insertIntoRoundedCornerBox(itemHtml,controlName,displayRoundedCornerBoxBorder);
itemHtml+='<div id="'+controlName+'BottomSpacing" style="display:'+expandDisplayMode+'; width:100%;height:15px;background-color:transparent;"></div>';
resultHtml=resultHtml+itemHtml;}if(resultHtml.length==0){if(requestOrigin=="home"){window.location=homepageUrl+"?MessageID=100555&";
}else{if(requestOrigin=="searchResult"){window.location=searchResultPageUrl+"?MessageID=100555&";
}}}document.getElementById(locationPlaceholderId).innerHTML="<br/>"+resultHtml+"<br/>";
for(var i=0;i<jsonLocationResult.length;i++){var controlName="divStore"+jsonLocationResult[i].StoreId;
if(!isSingleLined(controlName+"SingleLineAddress")&&i>0){document.getElementById(controlName).style.height=LOCATION_LIST_ITEM_COLLAPSE_DOUBLE_HEIGHT+"px";
}}}function getGrandOpeningStatus(Location){result="";if(Location.GrandOpeningBeginDate==""||Location.GrandOpeningEndDate==""){return result;
}var grandOpeningBeginDate=Location.GrandOpeningBeginDate.split("-");var grandOpeningEndDate=Location.GrandOpeningEndDate.split("-");
var beginYear=grandOpeningBeginDate[0];var beginMonth=""+(grandOpeningBeginDate[1]-1);
var beginDay=(grandOpeningBeginDate[2].split(" "))[0];var endYear=grandOpeningEndDate[0];
var endMonth=""+(grandOpeningEndDate[1]-1);var endDay=(grandOpeningEndDate[2].split(" "))[0];
var beginDate=new Date(beginYear,beginMonth,beginDay);var endDate=new Date(endYear,endMonth,endDay);
var endDatePlusOne=new Date(endDate.getTime()+86400000);var today=new Date();var todayPlusFour=new Date();
todayPlusFour.setDate(today.getDate()+4);var showGrandOpening=false;showGrandOpening=(beginDate>today)||(beginDate<=today&&today<=endDatePlusOne);
beginMonth=""+(parseInt(beginMonth,10)+1);endMonth=""+(parseInt(endMonth,10)+1);if(beginMonth.length==1){beginMonth="0"+beginMonth;
}if(endMonth.length==1){endMonth="0"+endMonth;}if(beginDate<=todayPlusFour){result+="NOW OPEN<br/>";
}if(showGrandOpening){result+="Grand Opening Weekend:<br/>"+beginMonth+"/"+beginDay+"/"+beginYear.substr(2,2)+" - "+endMonth+"/"+endDay+"/"+endYear.substr(2,2)+"<br/>"+'<a target="_blank" href="http://www.petco.com/assets/go/'+Location.StoreId+'.pdf">Event Info (PDF)</a><br/><br/>';
}return result;}function getStoreHours(Location){var result="";var monOpenTime=trim(Location.OpenTimeMonday);
var monCloseTime=trim(Location.CloseTimeMonday);var tuesOpenTime=trim(Location.OpenTimeTuesday);
var tuesCloseTime=trim(Location.CloseTimeTuesday);var wedOpenTime=trim(Location.OpenTimeWednesday);
var wedCloseTime=trim(Location.CloseTimeWednesday);var thursOpenTime=trim(Location.OpenTimeThursday);
var thursCloseTime=trim(Location.CloseTimeThursday);var friOpenTime=trim(Location.OpenTimeFriday);
var friCloseTime=trim(Location.CloseTimeFriday);var satOpenTime=trim(Location.OpenTimeSaturday);
var satCloseTime=trim(Location.CloseTimeSaturday);var sunOpenTime=trim(Location.OpenTimeSunday);
var sunCloseTime=trim(Location.CloseTimeSunday);if(monOpenTime==""||tuesOpenTime==""||wedOpenTime==""||thursOpenTime==""||friOpenTime==""||satOpenTime==""||sunOpenTime==""||monCloseTime==""||tuesCloseTime==""||wedCloseTime==""||thursCloseTime==""||friCloseTime==""||satCloseTime==""||sunCloseTime==""){result="Please call for Store Hours.<br/>";
return result;}else{if(tuesOpenTime==monOpenTime&&wedOpenTime==monOpenTime&&thursOpenTime==monOpenTime&&friOpenTime==monOpenTime&&tuesCloseTime==monCloseTime&&wedCloseTime==monCloseTime&&thursCloseTime==monCloseTime&&friCloseTime==monCloseTime){result="Monday - Friday "+getTimeIn12HourNotation(monOpenTime)+" - "+getTimeIn12HourNotation(monCloseTime)+"<br/>";
}else{result=result+"Monday "+getTimeIn12HourNotation(monOpenTime)+" - "+getTimeIn12HourNotation(monCloseTime)+"<br/>";
result=result+"Tuesday "+getTimeIn12HourNotation(tuesOpenTime)+" - "+getTimeIn12HourNotation(tuesCloseTime)+"<br/>";
result=result+"Wednesday "+getTimeIn12HourNotation(wedOpenTime)+" - "+getTimeIn12HourNotation(wedCloseTime)+"<br/>";
result=result+"Thursday "+getTimeIn12HourNotation(thursOpenTime)+" - "+getTimeIn12HourNotation(thursCloseTime)+"<br/>";
result=result+"Friday "+getTimeIn12HourNotation(friOpenTime)+" - "+getTimeIn12HourNotation(friCloseTime)+"<br/>";
}}result=result+"Saturday "+getTimeIn12HourNotation(satOpenTime)+" - "+getTimeIn12HourNotation(satCloseTime)+"<br/>";
result=result+"Sunday "+getTimeIn12HourNotation(sunOpenTime)+" - "+getTimeIn12HourNotation(sunCloseTime);
return result;}function getServices(Location){var result="";if(Location.HasVeterinaryServices=="1"){result=result+"Vaccinations<br/>";
}if(Location.HasFullServiceGrooming=="1"){result=result+"Full-Service Grooming<br/>";
}if(Location.HasDoggieDayCamp=="1"){result=result+"Doggie Day Camp<br/>";}if(Location.HasCanineEducation=="1"){result=result+"Dog Training<br/>";
}if(Location.HasPetPhotography=="1"){result=result+"Pet Photography<br/>";}if(Location.HasSelfServiceGrooming=="1"){result=result+"Self-Service Dog Wash<br/>";
}if(Location.HasAquatics=="1"){result=result+"Aquatics Department<br/>";}if(Location.HasDNABreedTesting=="1"){result=result+"DNA Breed Testing<br />";
}if(Location.HasUnleashedbyPETCO=="1"){result=result+"Unleashed by PETCO<br />";}return result;
}function updateMapLabel(city,state,zip,mapLabelPlaceholderId){var location;if(trim(zip)==""){location=city+", "+state;
}else{location=zip;}document.getElementById(mapLabelPlaceholderId).innerHTML="The PETCO stores nearest "+location+" are:";
}function getTimeIn12HourNotation(timeIn24HourNotation){var result="";var time=parseInt(timeIn24HourNotation,10)/100;
var hasDecimal=((time.toString()).indexOf(".")!=-1);if(time>=12){time=time-12;if(hasDecimal){time=time.toFixed(2);
}result=time+"PM";}else{if(hasDecimal){time=time.toFixed(2);}result=time+"AM";}result=result.replace(".",":");
return result;}function setBackgroundColor(elementId,color){document.getElementById(elementId).style.backgroundColor=color;
}function trim(stringToTrim){if(stringToTrim==null){return"";}return stringToTrim.replace(/^\s+|\s+$/g,"");
}function hide(elementId){document.getElementById(elementId).style.display="none";
}function show(elementId){document.getElementById(elementId).style.display="block";
}function uncheck(checkboxId){document.getElementById(checkboxId).checked=false;}function check(checkboxId){document.getElementById(checkboxId).checked=true;
}function uncheckGroup(groupName){var checkGroup=document.getElementsByName(groupName);
for(i=0;i<checkGroup.length;i++){checkGroup[i].checked=false;}}function boolToInt(bool){if(bool){return 1;
}else{return 0;}}function setFontColor(elementId,color){document.getElementById(elementId).style.color=color;
}function insertIntoRoundedCornerBox(html,elementId,isBorderVisibleInitially){var result="";
var roundedCornerBoxClass="roundedCornerBox";var roundedCornerBoxTopClass="roundedCornerBoxTop";
var roundedCornerBoxContentClass="roundedCornerBoxContent";var roundedCornerBoxBottomClass="roundedCornerBoxBottom";
if(isBorderVisibleInitially==false){roundedCornerBoxClass="";roundedCornerBoxTopClass="";
roundedCornerBoxContentClass="";roundedCornerBoxBottomClass="";}result+='<div id="'+elementId+'roundedCornerBox" class="'+roundedCornerBoxClass+'">'+'<div id="'+elementId+'roundedCornerBoxTop" class="'+roundedCornerBoxTopClass+'"><div></div></div>'+'<div id="'+elementId+'roundedCornerBoxContent" class="'+roundedCornerBoxContentClass+'">'+html+"</div>"+'<div id="'+elementId+'roundedCornerBoxBottom" class="'+roundedCornerBoxBottomClass+'"><div></div></div>'+"</div>";
return result;}function showRoundedCornerBoxBorder(elementId){document.getElementById(elementId+"roundedCornerBox").className="roundedCornerBox";
document.getElementById(elementId+"roundedCornerBoxTop").className="roundedCornerBoxTop";
document.getElementById(elementId+"roundedCornerBoxContent").className="roundedCornerBoxContent";
document.getElementById(elementId+"roundedCornerBoxBottom").className="roundedCornerBoxBottom";
}function hideRoundedCornerBoxBorder(elementId){document.getElementById(elementId+"roundedCornerBox").className="";
document.getElementById(elementId+"roundedCornerBoxTop").className="";document.getElementById(elementId+"roundedCornerBoxContent").className="";
document.getElementById(elementId+"roundedCornerBoxBottom").className="";}function expand(elementId){if(document.getElementById(currentExpandedLocationId)!=null){collapse(currentExpandedLocationId);
}currentExpandedLocationId=elementId;hide(elementId+"SingleLineAddress");hide(elementId+"ExpandButton");
hide(elementId+"LocationListHr");show(elementId+"DetailInfo");show(elementId+"Links");
show(elementId+"BottomSpacing");showRoundedCornerBoxBorder(elementId);setFontColor(elementId+"Name","black");
document.getElementById(elementId+"NameLink").href=storeDetailsPageUrl+"?storeId="+elementId.substring(8,elementId.length)+"&Nav=2";
var currH=LOCATION_LIST_ITEM_COLLAPSE_HEIGHT;var anim=window.setInterval(function(){currH+=LOCATION_LIST_ITEM_EXPAND_COLLAPSE_STEP_VALUE;
document.getElementById(elementId).style.height=currH+"px";if(currH>=LOCATION_LIST_ITEM_EXPAND_HEIGHT){window.clearInterval(anim);
document.getElementById(elementId).style.height=LOCATION_LIST_ITEM_EXPAND_HEIGHT+"px";
show(elementId+"CollapseButton");}},20);}function collapse(elementId){currentExpandedLocationId=null;
hide(elementId+"CollapseButton");var currH=LOCATION_LIST_ITEM_EXPAND_HEIGHT;var anim=window.setInterval(function(){currH-=LOCATION_LIST_ITEM_EXPAND_COLLAPSE_STEP_VALUE;
document.getElementById(elementId).style.height=currH+"px";if(currH<=LOCATION_LIST_ITEM_COLLAPSE_HEIGHT){window.clearInterval(anim);
document.getElementById(elementId).style.height=LOCATION_LIST_ITEM_COLLAPSE_HEIGHT+"px";
show(elementId+"ExpandButton");show(elementId+"SingleLineAddress");show(elementId+"LocationListHr");
hide(elementId+"DetailInfo");hide(elementId+"Links");hide(elementId+"BottomSpacing");
hideRoundedCornerBoxBorder(elementId);setFontColor(elementId+"Name","#1161a0");document.getElementById(elementId+"NameLink").href="javascript:expand('"+elementId+"')";
if(!isSingleLined(elementId+"SingleLineAddress")){document.getElementById(elementId).style.height=LOCATION_LIST_ITEM_COLLAPSE_DOUBLE_HEIGHT+"px";
}}},20);}function isSingleLined(elementId){var height=document.getElementById(elementId).offsetHeight;
return(height<=16);}function detectSubmit(event,pageType){if(event.keyCode==13&&!(event.srcElement&&(event.srcElement.tagName.toLowerCase()=="textarea"))){event.cancelBubble=true;
if(event.stopPropagation){event.stopPropagation();}fireSubmit(pageType);return false;
}return true;}function fireSubmit(pageType){if(pageType=="home"){hide("errorBoxPanel");
validateStoreSearchInput(document.getElementById("txtCity").value,document.getElementById("ddlState").value,document.getElementById("txtZip").value,"errorBoxPanel","errorMessagePanel","home");
}else{if(pageType=="searchResult"){hide("errorBoxPanel");validateStoreSearchInput(document.getElementById("txtCity").value,document.getElementById("ddlState").value,document.getElementById("txtZip").value,"errorBoxPanel","errorMessagePanel","searchResult");
}else{if(pageType=="storeDetails"){hide("warningBoxPanel");hide("errorBoxPanel");
validateDirectionSearchInput(document.getElementById("txtAddress").value,document.getElementById("txtCity").value,document.getElementById("ddlState").value,document.getElementById("txtZip").value,"errorBoxPanel","errorMessagePanel","storeDetails");
}}}}