;(function() {
// It is a main call
requestVersion(loadPlayer)
function s4() {
Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1)
}
function guid() {
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4()
}
function createRequest(method, url) {
var xhr = new XMLHttpRequest()
if ("withCredentials" in xhr) {
xhr.open(method, url, true)
} else if (typeof XDomainRequest !== "undefined") {
xhr = new XDomainRequest()
xhr.open(method, url)
} else {
xhr = null
}
return xhr
}
function requestVersion(cb) {
var xhr = createRequest(
"GET",
"https://d3vft14fnnsz21.cloudfront.net/stable.txt" + "?_v=" + guid()
)
if (!xhr) {
cb && cb("REL/60")
return
}
xhr.onload = function() {
cb && cb(xhr.responseText)
}
xhr.send()
}
function loadPlayer(ver) {
var player = document.createElement("script")
player.src =
"https://d3vft14fnnsz21.cloudfront.net/" + ver + "/player.js"
player.onload = function() {
new GCVPlayer(document.getElementById("player"), {
tour: getTourName(),
contentPathPrefix: "https://d9pqyg0o3u7z4.cloudfront.net/orders/"
})
}
document.body.appendChild(player)
}
function getTourName() {
var list = document.location.href.split("?")
var params = list[list.length - 1].split("&").map(function(el) {
return el.split("=")
})
for (var i = 0; i < params.length; i++) {
if (params[i][0] === "id") {
return params[i][1]
}
}
return "od7lvfnvPEmWkcaNqz99IQ"
}
})()