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 {
window.ignoreAdobeTagManager = true;
} catch(e) {
DMP.onetag.error.push(262);
}
try {
(function(){
	var p1='',run=false;
if((new RegExp("^/(cmpn/gp/co/dc/smiles1e|cmpn/gp/co/dc/smiles2e|cookies_policy/|cp/patent/|en/|Museum/english/|Museum/collections/list/|recall-search/dc/en/|its/en/|thums/|fuelcells/en/).*")).test(location.pathname)===true){
    p1='74889865-3b16-49b0-a449-a4a784c1d3aa';
    run=true;
}else if(location.pathname.indexOf("/cmpnform/")==0){
    if (location.pathname.slice(-3) === '_en') {
        p1='74889865-3b16-49b0-a449-a4a784c1d3aa';
        run=true;
    }
}else if(location.pathname.indexOf("/service/planttour/reservation/")==0){
    if((document.title?document.title:"").indexOf('TOYOTA MOTOR CORPORATION GLOBAL SITE')>=0){
        p1='74889865-3b16-49b0-a449-a4a784c1d3aa';
        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);
}
