window.RufflePlayer = window.RufflePlayer || {};

window.RufflePlayer.config = {
	polyfills: isRuffleEnabled(),
	autoplay: "on",
	unmuteOverlay: "hidden"
};

function isRuffleEnabled() {
	if (/ruffle=(1|yes|on|true|enable)/i.test(location.hash)) {
		document.cookie = "ruffle=1";
	} else if (/ruffle=(0|no|off|false|disable)/i.test(location.hash)) {
		document.cookie = "ruffle=0";
	}
	if (document.cookie) {
		if (document.cookie.indexOf("ruffle=1") != -1) {
			return true;
		} else if (document.cookie.indexOf("ruffle=0") != -1) {
			return false;
		}
	}
	return true;
}