mmcore.SetCookie('mmid','1227843419|AgAAAAoCrQslnw0AAA==',365,1);mmcore.SetCookie('pd','1227843419|AgAAAAoCrQslnw0AAA==',365);mmcore.SetCookie('srv','nycvwcgeu02',365);(function(){mmcore.custAttrs = {};if(typeof(mmcore.GenInfo)!='object')mmcore.GenInfo={};mmcore.EH=function(e){var s=e.message+'\r\n';if(!window.mm_error)window.mm_error=s;else window.mm_error+=s;};
try{
// Maxymiser Core - Attach Style v0.0.0 http://gitlab.maxymiser.net/gts/mmcore-attach-style/tree/master
(function(){'use strict';mmcore.AttachStyle=function(){var c={STYLE_ID:"mm-style",createStyle:function(){var b=document.createElement("style");b.type="text/css";return b},appendCssToStyle:function(){var b,a;"styleSheet"in c.createStyle()?(b=function(a){return a.styleSheet.cssText},a=function(a,b){a.styleSheet.cssText=b}):(b=function(a){return a.innerHTML},a=function(a,b){a.innerHTML=b});return(c.appendCssToStyle=function(c,d){a(d,b(d)+c)}).apply(this,arguments)}};return function(b){var a=document.getElementById(c.STYLE_ID);a||(a=c.createStyle(),a.id=c.STYLE_ID,function(){this.parentNode.insertBefore(a,this)}.call(document.getElementsByTagName("head")[0].lastChild));c.appendCssToStyle(b,a)}}()})();
}catch(err){mmcore.EH(err);}
try{
/**
 * 11.09.2014
 * Track all campaigns automatically
 * A. Tytskiy
 *
 * Dependencies: [Plugin_Essentials.js:mmcore.waitFor,
 * 				  Plugin_Helpers.js:mmcore.helpers]
 */
(function (mmcore) {
	'use strict';

	var TIMEOUT = 4000;
	var track = function () {

		mmcore.ijento = mmcore.ijento || {};

		mmcore.AddDocLoadHandler(function () {
			if (!mmcore.GenInfo || !mmcore.waitFor) {
				return;
			}

			if (mmcore.helpers && window.si && window.si.sendAdditionalTracer) {
				mmcore.helpers.iJentoTag();
			} else {
				mmcore
					.waitFor(function () {
						return mmcore.helpers && window.si && window.si.sendAdditionalTracer;
					}, { isNotStoppedOnDocumentReadiness: true, timeout: TIMEOUT })
					.done(function () {
						mmcore.helpers.iJentoTag();
					});
			}
		});
	};

	track();
	track = null;
}(window.mmcore));

}catch(err){mmcore.EH(err);}
try{
;
(function T40_PlugHelper() {
	mmcore.T40 = {};

	mmcore.T40.setData = function (dataName, dataValue) {
		if (window.localStorage) {
			localStorage.setItem(dataName, (dataValue !== undefined) ? dataValue : true);
		} else {
			mmcore.SetCookie(dataName, true, 90, true);
		}
	};

	mmcore.T40.getData = function (dataName) {
		var dataValue;
		if (window.localStorage) {
			dataValue = localStorage.getItem(dataName);
		} else {
			dataValue = mmcore.GetCookie(dataName, true);
		}
		return dataValue;
	};

	if (mmcore.T40.getData('mm_t40_last_page') !== location.href) {
		mmcore.T40.setData('mm_t40_last_page', location.href);
		mmcore.T40.setData('mm_t40_expanded', '');
	}
}());
}catch(err){mmcore.EH(err);}
try{
;(function(mmcore) {
	var trackPageViewAction = function(){
		mmcore.SetAction('PageViews', 1);
		mmcore.mediator.trigger('PageViews', {});
		mmcore.request();
	};

	if (window.addEventListener) {
		window.addEventListener('load', trackPageViewAction);
	} else {
		window.attachEvent('onload', trackPageViewAction);
	}
})(window.mmcore);

}catch(err){mmcore.EH(err);}
try{
;
(function T40_Checker() {
	var isHomePage = location.pathname.match(/\/home\//),
		isUserSubscribed = mmcore.GetCookie('FTSession', 1),

		showThreeTimesCookie = parseInt(mmcore.T40.getData('mm_t40_counter', 1) || 0, 10),

		isB2B = mmcore.siteTools.getAYSCCookieField(97) &&
			mmcore.siteTools.getAYSCCookieField(97).toLowerCase() === 'c',
		trackSession = function () {
			mmcore.SetAction('T40_Session', 1);
			mmcore.request();

			mmcore.SetCookie('mm_t40_s', '1', 0, true);
		},
		isLoggetIn = /_Tools_P0_(:|$)|_P0_Tools_(:|$)/.test(mmcore.GetCookie('FT_User', 1));

	//if FTSession cookie present and it is not B2B user generate test
	if (!isLoggetIn && isHomePage && !mmcore.T40.getData('mm_t40_closed')) {
		if (isUserSubscribed && !isB2B && showThreeTimesCookie < 3) {
			mmcore
				.request('T40')
				.done(function () {
					mmcore.T40.setData('mm_t40_gen', true);
					if (!mmcore.GetCookie('mm_t40_s', true)) {
						trackSession();
					}
				});
		} else if (mmcore.T40 && mmcore.T40.getData('mm_t40_gen') && !mmcore.GetCookie('mm_t40_s', true)) {
			trackSession();
		}
	} else {
		var value_session_cookie = mmcore.GetCookie('mm_t40_s', true) || '';

		if (mmcore.T40 && mmcore.T40.getData('mm_t40_gen') && !value_session_cookie) {
			trackSession();
		}
	}

}());
}catch(err){mmcore.EH(err);}
try{
(function T40_ActHPClicks () {
    var isHomePage = location.pathname.match(/home\//),
        actionName = 'T40_HPClicks';
    if (isHomePage) {
        mmcore.waitFor(function () {
            return window.jQuery;
        }).done(function () {
            var $ = window.jQuery,
                $document = $(document),
                mapForHpClick = [{
                    selector: '.topten .article a[href*="cms/s/"],' +
                    '.topten .article a[href*="blogs.ft.com"], .feedBoxes ul a',
                    attr: 'Article'
                }, {
                    selector: '#highlights a',
                    attr: 'Article'
                }, {
                    selector: '.top5 .top5-column-primary a[href*="cms/s/"], .top5 .top5-column-primary a[href*="blogs.ft.com"], ' +
                    '.top5 .top5-column-secondary .ft-title a',
                    attr: 'Article'
                }, {
                    selector: '.fastft a, #marketsDataHomepageWidget .mdw-tabcontent a, #popularContent .comp-body a, .editorialDoublet a, ' +
                    '.railList a, .toolsandservices a:not(.rss), #marketsDataHomepageWidget .mdw-footerLinks a',
                    attr: 'sidebar'
                }, {
                    selector: '#nav-ftcom a:not([href="http://www.ft.com/rss/home/uk"])',
                    attr: 'globalnav'
                }, {
                    selector: '#header a, #skyline a, .ft-overlay-credit, .article .ft-link:not([href*="cms"]), ' +
                    '#content a, .triplet.marketing a, .sitepageShare a, .jobsBox a, div[data-track-comp-name="bestComments"] a,' +
                    '.triplet a, #ftLogin-yourAccount, .railMiniVideo a, .midriff.midriffDouble a, .feedBoxes h4 a',
                    attr: ''
                }, {
                    selector: '#cookie-consent-overlay a',
                    attr: ''
                }];

            $.each(mapForHpClick, function (index, item) {
                $document.on('click', item.selector, function (e) {
                    var currentTarget = e.currentTarget,
                        href = currentTarget.href,
                        attr = item.attr;

                    if (href) {
                        if (href.match(/cms\/s/)) {
                            mmcore.$Action(actionName, 1, attr);
                        } else {
                            e.preventDefault();
                            e.stopPropagation();

                            mmcore.SetAction(actionName, 1, attr);
                            mmcore
                                .request()
                                .done(function () {
                                    location.hash = 'mm';
                                    location.href = href;
                                });
                        }
                    }
                });
            });

            //search on top navigation and sign out link
            $document.on('mousedown', '#wsod-symbolSearch button, #ftLogin-logout', function (e) {
                if (e.which === 1) {
                    mmcore.$Action(actionName, 1);
                }
            });

            $(document).on('click', '.jobsBoxSearchButton', function (e) {
                e.preventDefault();
                e.stopPropagation();

                mmcore.SetAction(actionName, 1);
                mmcore
                    .request()
                    .done(function () {
                        var form = $('.jobsBoxSearch').get(0);
                        if (form) {
                            form.submit();
                        }
                    });
            });

            //fix for conflict with test 18
            $document.on('mousedown', '.mm_t18_topics_wrapper a', function (e) {
                if (e.which === 1) {
                    mmcore.SetAction(actionName, 1, 'sidebar');
                }
            });
        });
    }
}());
}catch(err){mmcore.EH(err);}
try{
(function T28_ActSessions(mmcore, tools) {
	window.addEventListener('load', function () {
		try {
			tools.startSession('T28_WelcomeProgrammeWave3', function () {
				mmcore.SetAction('T28_Sessions', 1, '');
				mmcore.request();
			});
		} catch (err) {
			mmcore.EH(new Error('T28_ActSessions.js. Message: ' + err));
		}
	});

}(window.mmcore, window.mmcore.siteTools));
}catch(err){mmcore.EH(err);}
try{
/**
 * Created by Iuliia on 6/16/2015.
 */
;(function(mmcore) {
	mmcore.AddDocLoadHandler(function() {
		mmcore.waitFor(function() {
			var r_jQuery = '';
			try {
				r_jQuery = require("jquery");
			} catch (o_0) {}
			var $ = window.jQuery || (window.require && typeof(r_jQuery) == "function");

			return typeof $ == "function" && ($('.topten') || $('.nav-items-l2-flyout').length);

		}).done(function() {

			var $ = window.jQuery || (window.require && window.require("jquery")),
				mainPartOfURL = (window.location.hostname + window.location.pathname).replace(/\/$/, ''),
				pagesDataArray = [
					{
						actionName: "T28_Portfolio",
						cookiePostfix: "p",
						pageMasks: ["portfolio.ft.com/dashboard"]
					},
					{
						actionName: "T28_fastFT",
						cookiePostfix: "f",
						selectorToHandle: '.nav-items-l2-flyout li:contains(fastFT) a, .fastft-introtext a, .fastft-list a'
					},
					{
						actionName: "T28_SpecReports",
						cookiePostfix: "r",
						pageMasks: ['www.ft.com/reports',
							'www.ft.com/intl/reports']
					},
					{
						actionName: "T28_Apps",
						cookiePostfix: "a",
						selectorToHandle: '.nav-items-l3 li:contains(Mobile) a'
					},
					{
						actionName: "T28_EmailBriefings",
						cookiePostfix: "m",
						pageMasks: ["nbe.ft.com/nbe/profile.cfm"],
						checkCondition: function() {
							return $(".topten").text().toLowerCase().indexOf("sign up for email alerts now") + 1
						}
					}
				],
				actionAttr = '', actualPageData = null, i, j, linksToHandle,
				pageIsCheckedByURL, maskCheckIsValid;

			var trackAction = function(actionName, actionAttr, callback) {
				mmcore._async = true;
				mmcore.SetPageID("mmevents");
				mmcore.SetAction(actionName, 1, actionAttr);
				mmcore.CGRequest(callback)
			};

			mmcore.waitFor(function () {
				return window.jQuery && window.jQuery('#nbe-iframe').length;
				/*document.getElementById('nbe-iframe').contentWindow.document.getElementsByTagName('form')[0] &&
					document.getElementById('nbe-iframe').contentWindow.document.getElementsByTagName('form')[0].length;*/
			}, {
				isNotStoppedOnDocumentReadiness: true,
				timeout: 8000
			})
				.done(function () {
					window.jQuery('#nbe-iframe').load(function(){
						var attr = mmcore.GetCookie("mm_t28_m", true),
							isThankYouPage = window.jQuery('#nbe-iframe').contents().find(".topten").length &&
								window.jQuery('#nbe-iframe').contents().find(".topten").text().toLowerCase().indexOf("sign up for email alerts now") + 1 &&
								window.jQuery('#nbe-iframe').contents().find(".topten").text().toLowerCase().indexOf("thank you for updating") + 1,
							isUnsubscribe = window.jQuery('#nbe-iframe').contents().find(".topten").length &&
								window.jQuery('#nbe-iframe').contents().find(".topten").text().toLowerCase().indexOf("you have successfully unsubscribed") + 1;

						if (!attr) {
							attr = "Blank";
						} else {
							attr = (attr === "b") ? "Banner" : "Tooltip";
						}

						if (isThankYouPage && !isUnsubscribe) {
							trackAction("T28_EmailBriefings", attr);
						}
					});
				});

			for (i = 0; i < pagesDataArray.length; i++) {

				actualPageData = pagesDataArray[i];
				pageIsCheckedByURL = actualPageData.pageMasks;
				maskCheckIsValid = false;

				// Onload actions processing, we check by URL
				if (pageIsCheckedByURL) {

					// Mapping validation processing
					for(j = 0; j < actualPageData.pageMasks.length; j++) {
						if (actualPageData.pageMasks[j] === mainPartOfURL) {
							maskCheckIsValid = true;
						}
					}

					// Mapping conditions are met
					if (maskCheckIsValid) {

						actionAttr = mmcore.GetCookie("mm_t28_" + actualPageData.cookiePostfix, true);
						if (!actionAttr) {
							actionAttr = "Blank";
						} else {
							actionAttr = (actionAttr === "b") ? "Banner" : "Tooltip";
						}

						if (actualPageData.checkCondition) {
							if (actualPageData.checkCondition()) {
								trackAction(actualPageData.actionName, actionAttr);
							}
						} else {
							trackAction(actualPageData.actionName, actionAttr);
						}

					}

					// Onclick actions processing, we check by selector
				} else {
					(function(actionName, cookiePostfix) {
						if (typeof $.fn.on == 'function') {
							$('body').on('click', actualPageData.selectorToHandle, function (e) {

								var currentLink = $(this),
									currentLinkHref = currentLink.attr('href');

								e.preventDefault();

								actionAttr = mmcore.GetCookie("mm_t28_" + cookiePostfix, true);
								if (!actionAttr) {
									actionAttr = "Blank";
								} else {
									actionAttr = (actionAttr === "b") ? "Banner" : "Tooltip";
								}


								trackAction(actionName, actionAttr, function () {
									location.assign(currentLinkHref);
								});

								setTimeout(function () {
									location.assign(currentLinkHref);
								}, 2000);

							});
						}
					})(actualPageData.actionName, actualPageData.cookiePostfix);

				}

			}

		})
	})

})(window.mmcore);
}catch(err){mmcore.EH(err);}
if(typeof mmcore._callback=='object'&&typeof mmcore._callback[2]=='function'){try{mmcore._callback[2]();}catch(err){mmcore.EH(err);}
finally{mmcore._callback[2]=null;}}
})();