Petey came to EHR along with his brother Wagner when they were puppies. Both were adopted but now Petey has been returned to EHR's care. Being back at the kennel has been very stressful for Petey, but he has some great volunteer friends who have nothing but good things to say about him. He has lost his confidence and can be nervous with new places & things, but gives you unconditional love once he trusts. He looks to his people for direction and confidence, so he would benefit from experienced owners who can help him with this. He has gone through obedience training and is a fun loving boy. He absolutely loves going for car rides, too! Petey gets along with other dogs, but we think he would do best in a home without children right now. Can you help Petey get his second chance at finding a true forever home? If so, please fill out an application at EHRDOGS.ORG and be sure to ask for him by name! You will not be sorry you did!
(function () {
// Only on animal detail pages
if (!//animals/detail/i.test(location.pathname)) return;
// Debounce to avoid double-fire (touchend + click, etc.)
var lastNavAt = 0;
function toFullSize(url) {
try {
var u = new URL(url, location.href);
u.searchParams.delete('width');
u.searchParams.delete('height');
return u.toString();
} catch (e) {
return url || '';
}
}
function looksLikeAnimalPhoto(url) {
return //pictures/animals/\d+/\d+/[^?#]+.(jpg|jpeg|png|gif)/i.test(url || '');
}
function handler(e) {
var el = e.target;
if (!el) return;
// Find the closest anchor or image in the click path
var a = el.closest ? el.closest('a') : null;
var img = el.closest ? el.closest('img') : null;
var url = '';
// Prefer anchor href if it points to an animal photo
if (a && a.getAttribute) {
var href = a.getAttribute('href') || '';
if (href && (href.indexOf('/pictures/animals/') !== -1 || looksLikeAnimalPhoto(href))) {
url = href;
}
}
// Otherwise fall back to the image src
if (!url && img && img.getAttribute) {
var src = img.getAttribute('src') || '';
if (src && (src.indexOf('/pictures/animals/') !== -1 || looksLikeAnimalPhoto(src))) {
url = src;
}
}
if (!url) return;
// Absolute URL + full-size version
try { url = new URL(url, location.href).toString(); } catch (_) {}
url = toFullSize(url);
// Stop PrettyPhoto (and any other delegated click handlers)
e.preventDefault();
e.stopPropagation();
if (e.stopImmediatePropagation) e.stopImmediatePropagation();
// Debounce
var now = Date.now();
if (now - lastNavAt < 500) return;
lastNavAt = now;
// SAME TAB navigation to the full-size image
location.href = url;
}
// Capture phase is the key: we get the event before PrettyPhoto.
['click', 'pointerup', 'touchend'].forEach(function (evt) {
document.addEventListener(evt, handler, true);
});
})();