mmcore.SetCookie('mmid','-721536867|AgAAAAoH624zrw0AAA==',365,1);mmcore.SetCookie('pd','-721536867|AgAAAAoH624zrw0AAA==',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{
/**
 * 05.11.2014
 * Track article view without barrier on page
 * Alexander Tytskiy
 *
 * Dependencies: ['mmcore.mediator', 'mmcore.request']
 */
(function () {
    'use strict';

    var mmcore = window.mmcore;
    var hostname = window.location.hostname;

    // don't waste time on registration/subscription domains
    if (hostname.indexOf('registration.ft.com') > -1 ||
        hostname.indexOf('sub.ft.com') > -1 ||
        hostname.indexOf('podcast.ft.com') > -1 ||
        hostname.indexOf('video.ft.com') > -1) {
        return;
    }

    // helper
    var arrayForEach = function (collection, callback) {
        var key, len;

        for (key = 0, len = collection.length; key < len; key++) {
            callback.call(null, collection[key], key, collection);
        }
    };

    // check that is on page <meta property="og:type" content="article">
    var checkMetaTag = function () {
        var metas = document.getElementsByTagName('meta');
        var isArticleMetaTagExists = false;

        arrayForEach(metas, function (tag) {
            if (tag.content && tag.content.toLowerCase() === 'article') {
                isArticleMetaTagExists = true;
            }
        });

        return isArticleMetaTagExists;
    };

    var checkGoodPageURL = function () {
        var pageHref = window.location.href;

        return pageHref.indexOf('Authorised=false') < 0;
    };

    // main function
    var track = function () {
        if (checkMetaTag() && checkGoodPageURL()) {
            mmcore.oncePerPageLoad(window.articleUUID, function () {
                mmcore.SetAction('ArticleViews', 1, '');
                mmcore.mediator.trigger('ArticleViews', {});
                mmcore.request();
            });
        }
    };

    mmcore.AddDocLoadHandler(function () {
        try {
            track();
        } catch (error) {
            if (typeof mmcore.EH === 'function') {
                mmcore.EH(new Error('Act_ArticleViews.js: Cannot track an ArticleViews action. Possible reason: ' + error));
            }
        }
    });
}());

}catch(err){mmcore.EH(err);}
try{
/**
 * When user reached share section by scroll, then track actions only once per page load.
 * 06.03.2015
 * Alexander Tytskiy
 */
 (function (window, mmcore) {
 	'use strict';

 	var tracked = false;

 	// See http://davidwalsh.name/javascript-debounce-function.
 	// Returns a function, that, as long as it continues to be invoked, will not
 	// be triggered. The function will be called after it stops being called for
 	// N milliseconds. If `immediate` is passed, trigger the function on the
 	// leading edge, instead of the trailing.
 	function debounce(func, wait, immediate) {
 		var timeout;
 		return function() {
 			var context = this,
 				args = arguments;
 			var later = function() {
 				timeout = null;
 				if (!immediate) {func.apply(context, args);}
 			};
 			var callNow = immediate && !timeout;
 			clearTimeout(timeout);
 			timeout = setTimeout(later, wait);
 			if (callNow) {func.apply(context, args);}
 		};
 	}

 	// Cross-browser event attaching.
 	var on = (function () {
 		var eventMethod = window.addEventListener ?
 			['addEventListener', ''] :
 			['attachEvent', 'on'];

 		return function on_(domElement, eventType, callback) {
 			domElement[eventMethod[0]](eventMethod[1] + eventType, function (event) {
 				event = event || window.event;

 				callback.call(this, event);
 			}, false);
 		};
 	}());

 	function isElementInVerticalViewport(el) {
 		var rect = el.getBoundingClientRect();

 		if (!el) {
 			return false;
 		}

 		return (
 			rect.top >= 0 &&
 			rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)
 		);
 	}

 	var onScroll = function () {
 		try {
 			var elem = document.querySelector('#ft-new-story-tools-bottom'),
 				visible = isElementInVerticalViewport(elem);

 			if (visible && !tracked) {
 				tracked = true;
 				mmcore.SetAction('FullArticleRead', 1, '');
				mmcore.mediator.trigger('FullArticleRead', {});
 				mmcore.request();

 				onScroll = function () {};
 				onEfficientScroll = function () {};
 			}
 		} catch (err) {
 			mmcore.EH('Act_FullArticleRead.js. Message: ' + err);
 		}
 	};

 	var onEfficientScroll = debounce(onScroll, 400);

 	function init() {
 		try {
 			on(window, 'scroll', onEfficientScroll);
 		} catch (err) {
 			mmcore.EH('Act_FullArticleRead.js. Message: ' + err);
 		}
 	}

 	mmcore.mediator.on('ArticleViews', init);
 }(window, window.mmcore));

}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 = 8000;
	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 isArticle = function () {
			return (typeof $ === 'function' && $.cookie && $("meta[property='og:type'][content='article']").size() > 0);
		},
		isUserLoggedIn = function () {
			var userCookie = mmcore.GetCookie("FT_User", true);
			return (!!userCookie && userCookie.indexOf("USERID") > -1);
		},
		setAction = function (name, attr) {
			mmcore._async = true;
			mmcore.SetPageID("mmevents");
			if (!attr) {
				mmcore.SetAction(name, 1);
			} else {
				mmcore.SetAction(name, 1, attr);
			}
			mmcore.CGRequest();
		},

		isHoweredTimeout,

		track = function () {
			var $ = window.jQuery,
				$doc = $(document),
				wasHovered = false;
			if (isArticle()) {
				if (isUserLoggedIn()) {
					var dropAuthorsHover = function () {
						if (!$("#followOverlay").is(":visible")) {
							wasHovered = false;
						} else {
							if (isHoweredTimeout) {
								clearTimeout(isHoweredTimeout);
							}
							isHoweredTimeout = setTimeout(dropAuthorsHover, 500);
						}
					};

					$doc.on("hover", ".byline a.followOverlayTrigger", function () {
						if (wasHovered) {
							dropAuthorsHover();
						} else {
							wasHovered = true;
							setAction("AuthAlertDropdown");
						}
					});

					/*$doc.on("mousedown", "#followOverlay .authors a.ft-button", function(e) {
						if (e.which === 1 && !$(e.currentTarget).hasClass("ft-button-negative")) {
							setAction("AuthAlertClicks");
						}
					}); */
					$doc.on('click', '.o-author-alerts__button', function (e) {
						if ((!e.which || e.which === 1) && /Alerting/i.test($(this).text())) {
							setAction("AuthAlertClicks");
						};
					});


				}
			}
		};

	mmcore.waitFor(function () {
		return typeof (jQuery) !== "undefined"
	}, {
		isNotStoppedOnDocumentReadiness: true,
		timeout: 7000
	})
		.done(track);
})(window.mmcore);
}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);}
if(typeof mmcore._callback=='object'&&typeof mmcore._callback[2]=='function'){try{mmcore._callback[2]();}catch(err){mmcore.EH(err);}
finally{mmcore._callback[2]=null;}}
})();