/* Delay Page Transition for Animations */
$('.pagetransition').click(function(e) {
e.preventDefault();
var linkUrl = $(this).attr('href');
setTimeout(function(url) { window.location = url; }, 600, linkUrl);
});
$('.producttransition').click(function(e) {
e.preventDefault();
var linkUrl = $(this).attr('href');
setTimeout(function(url) { window.location = url; }, 1800, linkUrl);
});
/* Return to Product Page on Video End */
var kestrelVideoDesktop = document.getElementById("kestrelVideoDesktop");
var kestrelVideoTablet = document.getElementById("kestrelVideoTablet");
var nighthawkVideoDesktop = document.getElementById("nighthawkVideoDesktop");
var nighthawkVideoTablet = document.getElementById("nighthawkVideoTablet");
function determineBreakpoint() {
var desktopBreakpoint = document.getElementById("desktopBreakpoint");
var tabletBreakpoint = document.getElementById("tabletBreakpoint");
if (window.getComputedStyle(tabletBreakpoint).display === "none") {
return true;
} else {
return false;
}
}
if (kestrelVideoDesktop === null && kestrelVideoTablet === null) {
if (determineBreakpoint() === true) {
nighthawkVideoDesktop.addEventListener("ended", function() {
window.location.href = "https://www.loringsmarttour.com/s7-nighthawk";
});
} else {
nighthawkVideoTablet.addEventListener("ended", function() {
window.location.href = "https://www.loringsmarttour.com/s7-nighthawk";
});
}
} else {
if (determineBreakpoint() === true) {
kestrelVideoDesktop.addEventListener("ended", function() {
window.location.href = "https://www.loringsmarttour.com/s35-kestrel";
});
} else {
kestrelVideoTablet.addEventListener("ended", function() {
window.location.href = "https://www.loringsmarttour.com/s35-kestrel";
});
}
}