-->
`;
const embedded = createRawHtml(rawHtml);
embedded.appendChild(appendScript("https://platform.twitter.com/widgets.js"));
return embedded;
}
function processSingleContentElement(contentElement) {
switch (contentElement.displayType) {
case 'section': return contentElement.elements.map(it => processSingleContentElement(it));
case 'paragraph': return createSimpleTextElement(contentElement.text);
case 'header': return createSimpleTextElement(contentElement.text, 'h' + contentElement.level);
case 'image': return createImage(contentElement);
case 'twitter': return createTwitter(contentElement);
case 'youtube': return createYoutube(contentElement);
default: return createSimpleTextElement(JSON.stringify(contentElement));
}
}
function fillContentIntoElement(createdElement, htmlEl) {
try {
console.log(createdElement, htmlEl);
if (createdElement.length) {
createdElement.forEach(ch => htmlEl.appendChild(ch));
} else {
htmlEl.appendChild(createdElement);
}
} catch (e) {
console.error(e.message);
}
}
function fillContent(contentElementsList, htmlElements) {
const contentElements = Array.from(contentElementsList);
console.log(contentElements);
const lastElementIndex = htmlElements.length - 1;
htmlElements.forEach((htmlEl, index) => {
htmlEl.innerHTML = '';
if(contentElements.length > index) {
if(index === lastElementIndex) {
contentElements.slice(index).forEach(ce => fillContentIntoElement(processSingleContentElement(ce),htmlEl))
} else {
const createdElement = processSingleContentElement(contentElements[index]);
fillContentIntoElement(createdElement, htmlEl);
}
}
});
}
function createSlides(slides) {
const templateWrapper = document.getElementById('slide-template');
const template = templateWrapper.content.querySelector(".slide-template");
return slides.map((it, index) => {
const cloned = template.cloneNode(true);
const contentPlaceholders = cloned.querySelectorAll(".content-placeholder");
fillContent(it.elements, contentPlaceholders)
if (infiniteLayout) {
cloned.querySelectorAll(".adslot").forEach(slot => {
slot.id = slot.id + '_' + index;
});
}
return cloned;
});
}
var slides = [{"elements":[{"text":"According to the workers, the orangutans are like human toddlers in that they often get tired and don't feel like walking.","level":3,"displayType":"header"},{"elements":[{"text":"Though a \"wheelbarrow full of orangutans\" might sound like a page from children's pop-up book or flashcard, in Indonesia, it actually exists. Rolling around at the International Animal Rescue Centre in Indonesia are about 80 orangutans, most of which were rescued from captivity. The animals are brought there to learn survival skills that will help them excel when they are reintroduced back into the wild. The trouble is, a lot of the young orangutans are too lazy to walk to their daily activities. Thus, the workers at the centre are forced to wheel them to and fro in big piles. We're not complaining though. In fact, it would be awesome to be behind the wheel of this little troupe.","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/ec1881fc-12c7-38f6-85e0-48d001ccb749.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"The obvious solution? Put them all in a wheelbarrow and take them where they need to go.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/703cb9aa-a926-3f81-9e23-2441165e4c26.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Think of it as a kind of multi-seat stroller for baby apes.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/3010978b-8894-3eda-bd42-016964379d63.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"When they're taken to their daily training, they learn how to forage for food and build nests. Sometimes, the orangutans even take it upon themselves to sleep in the forest for the night, which is a great sign of progress.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/a0391510-bc76-3f75-8e3a-0088a3a86ffd.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Unfortunately, because the workers at the center push the little guys around so much, the wheelbarrows tend to give out.\"We're constantly appealing for more funds to buy new wheelbarrows,\" said on worker. \"It's no fun pushing a barrow full of primates around with a flat tire, that's for sure.\"","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/211e72c7-d54d-3753-a287-10b7c382e31b.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Somehow, the orangutans don't seem to mind that their presence is hard on their preferred method of conveyance.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/6cc0f6bc-2e5d-3d36-98d9-d383923daa5a.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"And, if we're being honest: If a broken wheelbarrow is the worst thing that comes from pushing around these adorable scamps, so be it.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/814d11b3-4009-31d1-a391-ffb65572b79a.jpeg","caption":"","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]}];
var slide_index = parseInt(0);
var slide_json = createSlides(slides);
var initial_slide = slide_index;
var initial_url = location.pathname + location.search;
var base_url = '/orangutans';
var next_gallery = '/bird-panhandling';
var first_load = true;
var has_scrolled = false;
var title = "A Wheelbarrow Full Of Baby Orangutans Is EXACTLY As Cute As It Sounds.";
var path = base_url
var utm_campaign, utm_subid, utm_source, utm_content, utm_term = 'n/a';
// try {
// var url = new URL(window.location.href);
// utm_campaign = encodeURIComponent(url.searchParams.get("utm_campaign"));
// utm_source = encodeURIComponent(url.searchParams.get("utm_source"));
// utm_content = encodeURIComponent(url.searchParams.get("utm_content"));
// utm_term = encodeURIComponent(url.searchParams.get("utm_term"));
// utm_medium = encodeURIComponent(url.searchParams.get("utm_medium"));
// if (utm_content && utm_campaign){
// var googletag = googletag || {};
// googletag.cmd = googletag.cmd || [];
// googletag.cmd.push(function() {
// googletag.pubads().setTargeting("utm_subid", utm_term);
// googletag.pubads().setTargeting("utm_subid_c", utm_campaign);
// });
// }
// } catch (e) {
// }