(function (w, d) {
w.tsUpdateMetaDescription = function () {
var existingTitle = document.querySelector('title').innerText;
document.querySelector('title').innerText = "***** Rating: 4.9 - 89 Reviews - " + existingTitle;
var existingDesc = document.querySelector('meta[name="description"]').getAttribute("content");
document.querySelector('meta[name="description"]').setAttribute("content", "***** Rating: 4.9 - 89 Reviews - " + existingDesc);
};
var timestamp = document.createElement("meta");
timestamp.setAttribute("name", "ts-timestamp");
timestamp.setAttribute("content", new Date().toLocaleString());
document.head.appendChild(timestamp);
var businessKey = "5k4ydqnd";
var locationKey = "55r71640";
var tenantKey = "";
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnRpdHlJZCI6IjU1cjcxNjQwIiwiZXhwIjoxNzgzMTY4OTUxLCJpc3MiOiJUcnVzdGlzdCIsImF1ZCI6IldpZGdldHMifQ.732Dik6zePiEDFnNGcmBcUtJ2bPscdgtXVj6dWDKBTQ";
function start(f) { /in/.test(document.readyState) ? setTimeout(start, 5, f) : f(); }
tsAddCssTag("https://widgetassets.trustist.com/css/cleanslate.css");
tsAddCssTag("https://widgetassets.trustist.com/css/header.css");
w.trustist ??= {};
w.trustist.header = {
draw: function () {
if (d.getElementById("ts-json") === null) {
var filter = Array.prototype.filter;
var els = d.querySelectorAll('h1,title,h2');
var productName = "Home Instead Yeovil, Sherborne & Bridport";
var field = filter.call(els, function (node) {
return node.innerText != "";
})[0];
if (typeof field !== "undefined") {
productName = field.innerText;
}
var json = "[{\"@type\":\"Product\",\"@id\":\"{{url}}#trustist\",\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\",\"image\":[\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\"],\"name\":\"{{productName}}\",\"alternateName\":null,\"hasMap\":null,\"geo\":null,\"telephone\":null,\"url\":\"{{url}}\",\"address\":null,\"branchOf\":null,\"openingHoursSpecification\":null,\"sameAs\":[\"https://www.trustist.com/local-reviews/Review-home-instead-Yeovil-Sherborne--Bridport-Reviews-41086.html\"],\"@context\":\"http://schema.org\",\"brand\":{\"@type\":\"Organization\",\"@id\":null,\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\",\"image\":[\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\"],\"name\":\"Home Instead\",\"alternateName\":null,\"hasMap\":null,\"geo\":null,\"telephone\":null,\"url\":\"https://www.homeinstead.co.uk/\",\"address\":null,\"branchOf\":null,\"openingHoursSpecification\":null,\"sameAs\":null},\"aggregateRating\":{\"@type\":\"AggregateRating\",\"ratingValue\":4.9,\"bestRating\":5,\"worstRating\":1,\"reviewCount\":89},\"review\":{\"@type\":\"Review\",\"url\":\"https://www.trustist.com/local-reviews/Review-home-instead-Yeovil-Sherborne--Bridport-Reviews-41086.html\",\"author\":{\"@type\":\"Person\",\"name\":\"JA S\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":null,\"addressLocality\":null,\"addressRegion\":null,\"postalCode\":null,\"addressCountry\":null}},\"datePublished\":\"2025-09-10T11:45:20.000Z\",\"headline\":\"\",\"isBasedOn\":null,\"reviewBody\":\"We cannot recommend Home Instead in Yeovil more highly. They provided support and care for my mother in the last two weeks of her life with compassion, efficiency and discretion as well as being a tremendous support to myself and my sister. Mum\u0027s condition deteriorated quickly. The situation changed daily and with it the requirements for care. Home Instead, Alexia and Julie, were brilliant at coping with this and at the end were providing 24 hour care. We had a team of six carers who were each introduced personally to mum and ourselves and every one of them became a friend. They rotated and took over from each other seamlessly. The communication was brilliant. They talked to mum, cared for her, gave us hugs and ultimately enabled mum to die peacefully at home as she wanted. We cannot thank them enough.\",\"reviewRating\":{\"@type\":\"Rating\",\"ratingValue\":5,\"bestRating\":5,\"worstRating\":1},\"publisher\":{\"@type\":\"Organization\",\"name\":\"Trustist\",\"sameAs\":\"https://www.trustist.com\"},\"reply\":null,\"replyDate\":null,\"subject\":null},\"mpn\":\"{{url}}\",\"sku\":\"{{url}}\"},{\"@type\":\"LocalBusiness\",\"@id\":\"https://www.trustist.com/local-reviews/Review-home-instead-Yeovil-Sherborne--Bridport-Reviews-41086.html\",\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\",\"image\":[\"https://content.trustist.com/brandlogos/fd8f863c-aa15-4ee7-b2b2-1cc8fb89f783.png\"],\"name\":\"Home Instead\",\"alternateName\":\"Home Instead Yeovil, Sherborne \u0026 Bridport\",\"hasMap\":\"https://maps.google.com/maps?cid=12482864162763738579\",\"geo\":{\"@type\":\"GeoCoordinates\",\"latitude\":\"\",\"longitude\":\"\"},\"telephone\":\"\",\"url\":\"https://www.homeinstead.co.uk/\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"\",\"addressLocality\":\"\",\"addressRegion\":null,\"postalCode\":null,\"addressCountry\":null},\"branchOf\":{\"@type\":\"Organization\",\"name\":\"Home Instead\",\"sameAs\":\"https://www.homeinstead.co.uk/\"},\"openingHoursSpecification\":[{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"17:00:00\",\"dayOfWeek\":\"http://schema.org/Monday\",\"opens\":\"09:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"17:00:00\",\"dayOfWeek\":\"http://schema.org/Tuesday\",\"opens\":\"09:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"17:00:00\",\"dayOfWeek\":\"http://schema.org/Wednesday\",\"opens\":\"09:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"17:00:00\",\"dayOfWeek\":\"http://schema.org/Thursday\",\"opens\":\"09:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"17:00:00\",\"dayOfWeek\":\"http://schema.org/Friday\",\"opens\":\"09:00:00\"}],\"sameAs\":[\"https://www.facebook.com/100793993107249\",\"https://maps.google.com/maps?cid=12482864162763738579\",\"https://www.homecare.co.uk/homecare/agency.cfm/id/65432224621\"],\"@context\":\"http://schema.org\",\"aggregateRating\":null,\"review\":null,\"paymentAccepted\":null,\"makesOffer\":null}]";
var a = d;
var c = a.createElement("script");
c.type = 'application/ld+json';
c.id = 'ts-json';
c.innerText = json
.replace(new RegExp("{{url}}", 'g'), w.location.href)
.replace("{{productName}}", productName)
.replace("\"{{productDesc}}\"", JSON.stringify((d.body.innerText || d.body.textContent).replace(/[^ -~]+/g, "").substring(0, 200) + "..."));
a = a.getElementsByTagName("head")[0];
a.appendChild(c);
}
// iterate over all widgets on the page and render
var div = document.querySelector("[ts-headerWidget],div.ts-headerWidget");
if (div) {
tsDisplayWidget(div, businessKey, locationKey, tenantKey);
}
else {
}
}
};
start(w.trustist.header.draw);
function tsDisplayWidget(target) {
// get options before cleanslate
var options = tsReadAttributes(target);
// draw the main template
target.innerHTML = '
4.9 /5.0
Based on 89 Customer Reviews ';
// draw the dropdown
var dropdownDiv = d.createElement('div');
dropdownDiv.setAttribute("id", "ts-style");
dropdownDiv.setAttribute("class", "cleanslate");
dropdownDiv.innerHTML = ' ';
d.body.appendChild(dropdownDiv);
// draw the reviews
var xhr = new XMLHttpRequest();
var url = tsBuildUrl(options);
xhr.open("GET", url);
xhr.onload = function () {
if (xhr.status === 200 && xhr.responseText !== "") {
var reviews = JSON.parse(xhr.responseText);
tsDrawReviews(dropdownDiv, reviews, options);
tsWireUp(options);
} else {
}
};
xhr.send();
}
function tsBuildUrl(options) {
var url = "https://widget.trustist.com/reviewlistdata?v=1&accessToken=" + accessToken + "&pageNum=1&pageSize=" + options.pageSize;
if (typeof tenantKey !== "undefined" && tenantKey !== "") url += "&tenantKey=" + tenantKey;
if (typeof businessKey !== "undefined" && businessKey !== "") url += "&businessKey=" + businessKey;
if (typeof locationKey !== "undefined" && locationKey !== "") url += "&locationKey=" + locationKey;
if (options.ratingsAbove > 0) url += "&ratingFrom=" + options.ratingsAbove;
if (options.exclude > '') url += "&exclude=" + options.exclude;
return url;
}
function tsDrawReviews(target, reviews, options) {
var reviewContent = '';
var template = '
/5.0 ';
var textTemplate = ' ';
var replyTemplate = '';
reviews.forEach(function (review) {
var d = new Date(review.datePublished);
var reviewDate = d.getDate() + ' ' + months[d.getMonth()] + ' ' + d.getFullYear();
var thisReview = template
.replace('{{reviewSourceLogo}}', review.image)
.replace('', review.author.name)
.replace('', reviewDate)
.replace('', (review.reviewRating.ratingValue / 2).toFixed(1));
if (review.reviewBody > '') {
thisReview = thisReview.replace(
'',
textTemplate.replace('', review.reviewBody));
}
if (review.reply > '') {
var replyDate = new Date(review.replyDate);
var replyDateString = replyDate.getDate() + " " + months[replyDate.getMonth()] + " " + replyDate.getFullYear();
thisReview = thisReview.replace(
'',
replyTemplate
.replace('', review.reply)
.replace('', replyDateString));
}
reviewContent += thisReview;
});
target.innerHTML = target.innerHTML.replace('', reviewContent).replace('', reviews.length);
}
function tsReadAttributes(target) {
return {
pageSize: target.getAttribute("ts-page-size") || 20,
position: target.getAttribute("ts-position") || "absolute", // fixed or absolute
ratingsAbove: parseInt(target.getAttribute("ts-ratings-above")) || 0,
exclude: target.getAttribute("ts-exclude") || "",
};
}
function tsAddCssTag(url) {
var includedAlready = tsCheckIfIncluded(url);
var head = d.getElementsByTagName("head")[0];
if (!includedAlready) {
var tag = d.createElement("link");
tag.rel = "stylesheet";
tag.type = "text/css";
tag.href = url;
head.appendChild(tag);
}
}
function tsCheckIfIncluded(file) {
var links = d.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
if (links[i].href?.substr(-file.length) === file)
return true;
}
var scripts = d.getElementsByTagName("script");
for (var j = 0; j < scripts.length; j++) {
if (scripts[j].src?.substr(-file.length) === file)
return true;
}
return false;
}
function tsSetStyle(element, value) {// Specific old IE
if (document.all) {
element.style.setAttribute('cssText', value);
} else {
element.setAttribute('style', value);
}
}
function tsAddEventToMany(controls, eventName, action) {
for (var i = 0; i < controls.length; i++) {
controls[i].addEventListener(eventName, action);
}
}
function tsSetArrowPosition(options) {
var TSDropArrow = d.getElementById('ts-top-arrow');
var TSDropArrowRect = TSDropArrow.getBoundingClientRect();
var TSHeaderRect = d.getElementById('ts-review-drop-trigger').getBoundingClientRect();
var TSStarsRect = d.getElementById('ts-stars').getBoundingClientRect();
var TSDropRect = d.getElementById('ts-review-dropdown').getBoundingClientRect();
var middle = TSStarsRect.left + (TSStarsRect.width / 2) - (TSDropArrowRect.width / 2);
if (options.position === 'fixed') {
tsSetStyle(TSDropArrow, 'left: ' + middle + 'px !important; top: ' + (TSHeaderRect.top + TSHeaderRect.height) + 'px !important;');
} else {
var arrowOffset = middle - TSDropRect.left;
tsSetStyle(TSDropArrow, 'left: ' + arrowOffset + 'px !important;');
}
}
var resizeTimer;
function tsSetDropDownDimensions(options) {
var screenWidth = w.innerWidth;
var TSDrop = d.getElementById('ts-review-dropdown');
var TSDropRect = TSDrop.getBoundingClientRect();
var TSHeaderRect = d.getElementById('ts-review-drop-trigger').getBoundingClientRect();
var TSDropArrowRect = d.getElementById('ts-top-arrow').getBoundingClientRect();
var TSStarsRect = d.getElementById('ts-stars').getBoundingClientRect();
var middle = TSStarsRect.left + (TSStarsRect.width / 2) - (TSDropArrowRect.width / 2);
var dropTop = 'top: ' + (TSHeaderRect.top + TSHeaderRect.height + TSDropArrowRect.height) + 'px !important;';
if (TSDropRect.width + 20 >= screenWidth) {
tsSetStyle(TSDrop, 'left: 0 !important; right: 0 !important; ' + dropTop);
} else if (middle <= (screenWidth / 3)) {
// console.log("init left side " + middle);
tsSetStyle(TSDrop, 'left: 20px !important; right: auto !important; ' + dropTop);
} else if (middle > (screenWidth / 3) && middle <= ((screenWidth / 3) * 2)) {
// console.log("init middle " + middle);
tsSetStyle(TSDrop, 'left: ' + ((screenWidth / 2) - (TSDropRect.width / 2)) + 'px !important; right: auto !important; ' + dropTop);
} else if (middle > ((screenWidth / 3) * 2)) {
// console.log("init right side " + middle);
tsSetStyle(TSDrop, 'left: auto !important; right: 20px !important; ' + dropTop);
}
clearTimeout(resizeTimer);
resizeTimer = setTimeout(tsSetArrowPosition, 250, options);
}
function tsWireUp(options) {
// var TSHeader = d.getElementById('ts-review-drop-trigger');
var TSDrop = d.getElementById('ts-review-dropdown');
var TSDropArrow = d.getElementById('ts-top-arrow');
// position the dynamic elements according to header type
var position = options.position === 'fixed' ? 'ts-fixed' : 'ts-absolute';
TSDrop.classList.add(position);
TSDropArrow.classList.add(position);
//// create a hidden element to allow the mouse to transition between the header and the dynamic areas
//var dummyDiv = d.createElement('div');
//dummyDiv.id = "ts-style";
//dummyDiv.classList.add("ts-review-drop");
//dummyDiv.classList.add("ts-fixed")
//dummyDiv.offsetLeft = TSHeader.offsetLeft;
//dummyDiv.offsetWidth = TSHeader.offsetWidth;
//dummyDiv.offsetTop = TSHeader.offsetTop + TSHeader.offsetHeight;
//dummyDiv.offsetHeight = TSDropArrow.offsetHeight;
//TSDrop.appendChild(dummyDiv);
// set initial dimensions left to right
tsSetDropDownDimensions(options);
// wire up events
var mouseAreas = d.querySelectorAll('.ts-review-drop');
tsAddEventToMany(mouseAreas, 'mouseover', function (e) {
TSDrop.classList.add('ts-drop-active');
setTimeout(function () {
TSDrop.classList.add('ts-can-close');
}, 600);
});
tsAddEventToMany(mouseAreas, 'mouseout', function (e) {
TSDrop.classList.remove('ts-drop-active');
TSDrop.classList.remove('ts-can-close');
});
d.getElementById('ts-mobile-close').addEventListener('click', function (e) {
TSDrop.classList.remove('ts-drop-active');
TSDrop.classList.remove('ts-can-close');
});
w.addEventListener('resize', function () { tsSetDropDownDimensions(options); });
}
})(window, document);