if(typeof(DMP) === 'undefined') {
	window.DMP = {};
}
if(typeof(DMP.onetag) === 'undefined') {
	DMP.onetag = {};
}

if(typeof(DMP.onetag.system) === 'undefined') {
	DMP.onetag.system = {};

	DMP.onetag.system.pageName = function(){
		var pageName = (location.hostname + location.pathname).replace(/\//g, ':');
		var addPageName = (typeof(window.s_AddPageName) === 'undefined') ? '' : '_' + window.s_AddPageName;
		return pageName + addPageName;
	};

}

if(typeof(DMP.onetag.site) === 'undefined') {
	DMP.onetag.site = {};
}

DMP.onetag.error = [];
try {
(function(){
	var p1='',run=false;
if(location.pathname.indexOf('/en/') === 0){
    p1='670f693f-7422-43a3-b48d-bfd4c8b2f4a3';
    run=true;
}
	if (!p1 || !run) return;	
	(function(){
		var e=document.createElement("script"), s=document.getElementsByTagName("script")[0];
		e.type="text/javascript";
		e.id="Cookiebot";
		e.src="https://consent.cookiebot.com/uc.js";
		e.setAttribute("data-cbid",p1);
		e.async=true;
		s.parentNode.insertBefore(e,s);
	})();
	(function(w){
		var p=[], s=[], m=[];
		w.dataLayer=w.dataLayer||[];
		w.CookieControl=w.CookieControl||{};
		w.CookieControl.OTGFNC = {
			addPreferences: function(f){ p.push(f) },
			addStatistics: function(f){ s.push(f) },
			addMarketing: function(f){ m.push(f) }
		};
		w.CookiebotCallback_OnAccept = function() {
			var l = function(a, b) {
				for (var i=0; i<a.length; i++) {
					if (typeof a[i] === "function")try{a[i]()}catch(e){}
				}
				w.dataLayer.push({event:"DMPonetag1543_"+b});
			};
			if (Cookiebot.consent.preferences) l(p,'preferences');
			if (Cookiebot.consent.statistics) l(s,'statistics');
			if (Cookiebot.consent.marketing) l(m,'marketing');
		};
		window.addEventListener("CookiebotOnDialogInit",function(){CookieConsentDialog.multiAcceptText="I Accept"});
	})(window);
})();
} catch(e) {
DMP.onetag.error.push(2246);
}
try {
(function() {
  var p1 = '',p2 = '',cid = '',run = false;

if(location.pathname.indexOf('/en/') !== 0){
    p1='3011';
    p2='0000';
    cid='toyotatimes_top';
    run=true;    
}
if(location.pathname.indexOf('/sports/') === 0){
    run=false;
}
  if (!p1 || !p2 || !cid || !run) return;
  var e=document.createElement("script"), s=document.getElementsByTagName("script")[0];
  e.type = "text/javascript";
  e.src = "https://linc-sdk.interactive-circle.jp/js/vr/stay_survey_adhoc.js";
  e.setAttribute('id', "vr_survey_tag");
  e.setAttribute('vr_tagid1', p1);
  e.setAttribute('vr_tagid2', p2);
  e.setAttribute('contents_id', cid);
  e.setAttribute('survey_seconds', 10);
  s.parentNode.insertBefore(e,s);
})();
} catch(e) {
DMP.onetag.error.push(1823);
}
