/* © 2010-2011 - Insite Innovations and Properties B.V., an Adversitement group company. All rights reserved. */

/**
 * Aegon TNT (buttons)
 * 
 * Created by: 			Stefan Leever
 * Created on: 			2010-07-29
 * Last modified: 		2011-05-27
 * Last modified by: 		Stefan Leever
 * Version:			1.1.0
 * 
 * Changelog:
 * 
 * 20100729: Created the base file for the floating mbox. Also added the mbox requests.
 * 20100730: Updated the floating mbox to the latest version.
 * 20110527: Updated the s_code with Floating Elements 2.0.0
 * 
 */

var mboxCopyright = "Copyright 1996-2010. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder = function(a, b) { this.a = a; this.b = b; this.c = new Array(); this.d = function(e) { return e; }; this.f = null;};mboxUrlBuilder.prototype.addParameter = function(g, h) { var i = new RegExp('(\'|")'); if (i.exec(g)) { throw "Parameter '" + g + "' contains invalid characters"; } for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; if (k.name == g) { k.value = h; return this; } } var l = new Object(); l.name = g; l.value = h; this.c[this.c.length] = l; return this;};mboxUrlBuilder.prototype.addParameters = function(c) { if (!c) { return this; } for (var j = 0; j < c.length; j++) { var m = c[j].indexOf('='); if (m == -1 || m == 0) { continue; } this.addParameter(c[j].substring(0, m), c[j].substring(m + 1, c[j].length)); } return this;};mboxUrlBuilder.prototype.setServerType = function(n) { this.o = n;};mboxUrlBuilder.prototype.setBasePath = function(f) { this.f = f;};mboxUrlBuilder.prototype.setUrlProcessAction = function(p) { this.d = p;};mboxUrlBuilder.prototype.buildUrl = function() { var q = this.f ? this.f : '/m2/' + this.b + '/mbox/' + this.o; var r = document.location.protocol == 'file:' ? 'http:' : document.location.protocol; var e = r + "//" + this.a + q; var s = e.indexOf('?') != -1 ? '&' : '?'; for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; e += s + encodeURIComponent(k.name) + '=' + encodeURIComponent(k.value); s = '&'; } return this.t(this.d(e));};mboxUrlBuilder.prototype.getParameters = function() { return this.c;};mboxUrlBuilder.prototype.setParameters = function(c) { this.c = c;};mboxUrlBuilder.prototype.clone = function() { var u = new mboxUrlBuilder(this.a, this.b); u.setServerType(this.o); u.setBasePath(this.f); u.setUrlProcessAction(this.d); for (var j = 0; j < this.c.length; j++) { u.addParameter(this.c[j].name, this.c[j].value); } return u;};mboxUrlBuilder.prototype.t = function(v) { return v.replace(/\"/g, '&quot;').replace(/>/g, '&gt;');};mboxStandardFetcher = function() { };mboxStandardFetcher.prototype.getType = function() { return 'standard';};mboxStandardFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); document.write('<' + 'scr' + 'ipt src="' + w.buildUrl() + '" language="JavaScript"><' + '\/scr' + 'ipt>');};mboxStandardFetcher.prototype.cancel = function() { };mboxAjaxFetcher = function() { };mboxAjaxFetcher.prototype.getType = function() { return 'ajax';};mboxAjaxFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); var e = w.buildUrl(); this.x = document.createElement('script'); this.x.src = e; document.body.appendChild(this.x);};mboxAjaxFetcher.prototype.cancel = function() { };mboxMap = function() { this.y = new Object(); this.z = new Array();};mboxMap.prototype.put = function(A, h) { if (!this.y[A]) { this.z[this.z.length] = A; } this.y[A] = h;};mboxMap.prototype.get = function(A) { return this.y[A];};mboxMap.prototype.remove = function(A) { this.y[A] = undefined;};mboxMap.prototype.each = function(p) { for (var j = 0; j < this.z.length; j++ ) { var A = this.z[j]; var h = this.y[A]; if (h) { var B = p(A, h); if (B === false) { break; } } }};mboxFactory = function(C, b, D) { this.E = false; this.C = C; this.D = D; this.F = new mboxList(); mboxFactories.put(D, this); this.G = typeof document.createElement('div').replaceChild != 'undefined' && (function() { return true; })() && typeof document.getElementById != 'undefined' && typeof (window.attachEvent || document.addEventListener || window.addEventListener) != 'undefined' && typeof encodeURIComponent != 'undefined'; this.H = this.G && mboxGetPageParameter('mboxDisable') == null; var I = D == 'default'; this.J = new mboxCookieManager( 'mbox' + (I ? '' : ('-' + D)), (function() { return mboxCookiePageDomain(); })()); this.H = this.H && this.J.isEnabled() && (this.J.getCookie('disable') == null); if (this.isAdmin()) { this.enable(); } this.K = mboxGenerateId(); this.L = mboxScreenHeight(); this.M = mboxScreenWidth(); this.N = mboxBrowserWidth(); this.O = mboxBrowserHeight(); this.P = mboxScreenColorDepth(); this.Q = mboxBrowserTimeOffset(); this.R = new mboxSession(this.K, 'mboxSession', 'session', 31 * 60, this.J); this.S = new mboxPC('PC', 1209600, this.J); this.w = new mboxUrlBuilder(C, b); this.T(this.w, I); this.U = new Date().getTime(); this.V = this.U; var W = this; this.addOnLoad(function() { W.V = new Date().getTime(); }); if (this.G) { this.addOnLoad(function() { W.getMboxes().each(function(X) { X.setFetcher(new mboxAjaxFetcher()); X.finalize(); }); }); this.limitTraffic(100, 10368000); if (this.H) { this.Y(); this.Z = new mboxSignaler(function(_, c) { return W.create(_, c); }, this.J); } }};mboxFactory.prototype.isEnabled = function() { return this.H;};mboxFactory.prototype.getDisableReason = function() { return this.J.getCookie('disable');};mboxFactory.prototype.isSupported = function() { return this.G;};mboxFactory.prototype.disable = function(ab, bb) { if (typeof ab == 'undefined') { ab = 60 * 60; } if (typeof bb == 'undefined') { bb = 'unspecified'; } if (!this.isAdmin()) { this.H = false; this.J.setCookie('disable', bb, ab); }};mboxFactory.prototype.enable = function() { this.H = true; this.J.deleteCookie('disable');};mboxFactory.prototype.isAdmin = function() { return document.location.href.indexOf('mboxEnv') != -1;};mboxFactory.prototype.limitTraffic = function(cb, ab) {};mboxFactory.prototype.addOnLoad = function(p) { if (window.addEventListener) { window.addEventListener('load', p, false); } else if (document.addEventListener) { document.addEventListener('load', p, false); } else if (document.attachEvent) { window.attachEvent('onload', p); }};mboxFactory.prototype.getEllapsedTime = function() { return this.V - this.U;};mboxFactory.prototype.getEllapsedTimeUntil = function(db) { return db - this.U;};mboxFactory.prototype.getMboxes = function() { return this.F;};mboxFactory.prototype.get = function(_, eb) { return this.F.get(_).getById(eb || 0);};mboxFactory.prototype.update = function(_, c) { if (!this.isEnabled()) { return; } if (this.F.get(_).length() == 0) { throw "Mbox " + _ + " is not defined"; } this.F.get(_).each(function(X) { X.getUrlBuilder() .addParameter('mboxPage', mboxGenerateId()); X.load(c); });};mboxFactory.prototype.create = function( _, c, fb) { if (!this.isSupported()) { return null; } var e = this.w.clone(); e.addParameter('mboxCount', this.F.length() + 1); e.addParameters(c); var eb = this.F.get(_).length(); var gb = this.D + '-' + _ + '-' + eb; var hb; if (fb) { hb = new mboxLocatorNode(fb); } else { if (this.E) { throw 'The page has already been loaded, can\'t write marker'; } hb = new mboxLocatorDefault(gb); } try { var W = this; var ib = 'mboxImported-' + gb; var X = new mbox(_, eb, e, hb, ib); if (this.H) { X.setFetcher(this.E ? new mboxAjaxFetcher() : new mboxStandardFetcher()); } X.setOnError(function(jb, n) { X.setMessage(jb); X.activate(); if (!X.isActivated()) { W.disable(60 * 60, jb); window.location.reload(false); } }); this.F.add(X); } catch (kb) { this.disable(); throw 'Failed creating mbox "' + _ + '", the error was: ' + kb; } var lb = new Date(); e.addParameter('mboxTime', lb.getTime() - (lb.getTimezoneOffset() * 60000)); return X;};mboxFactory.prototype.getCookieManager = function() { return this.J;};mboxFactory.prototype.getPageId = function() { return this.K;};mboxFactory.prototype.getPCId = function() { return this.S;};mboxFactory.prototype.getSessionId = function() { return this.R;};mboxFactory.prototype.getSignaler = function() { return this.Z;};mboxFactory.prototype.getUrlBuilder = function() { return this.w;};mboxFactory.prototype.T = function(e, I) { e.addParameter('mboxHost', document.location.hostname) .addParameter('mboxSession', this.R.getId()); if (!I) { e.addParameter('mboxFactoryId', this.D); } if (this.S.getId() != null) { e.addParameter('mboxPC', this.S.getId()); } e.addParameter('mboxPage', this.K); e.addParameter('screenHeight', this.L); e.addParameter('screenWidth', this.M); e.addParameter('browserWidth', this.N); e.addParameter('browserHeight', this.O); e.addParameter('browserTimeOffset', this.Q); e.addParameter('colorDepth', this.P); e.setUrlProcessAction(function(e) { e += '&mboxURL=' + encodeURIComponent(document.location); var mb = encodeURIComponent(document.referrer); if (e.length + mb.length < 2000) { e += '&mboxReferrer=' + mb; } e += '&mboxVersion=' + mboxVersion; return e; });};mboxFactory.prototype.nb = function() { return "";};mboxFactory.prototype.Y = function() { document.write('<style>.' + 'mboxDefault' + ' { visibility:hidden; }</style>');};mboxFactory.prototype.isDomLoaded = function() { return this.E;};mboxSignaler = function(ob, J) { this.J = J; var pb = J.getCookieNames('signal-'); for (var j = 0; j < pb.length; j++) { var qb = pb[j]; var rb = J.getCookie(qb).split('&'); var X = ob(rb[0], rb); X.load(); J.deleteCookie(qb); }};mboxSignaler.prototype.signal = function(sb, _ ) { this.J.setCookie('signal-' + sb, mboxShiftArray(arguments).join('&'), 45 * 60);};mboxList = function() { this.F = new Array();};mboxList.prototype.add = function(X) { if (X != null) { this.F[this.F.length] = X; }};mboxList.prototype.get = function(_) { var B = new mboxList(); for (var j = 0; j < this.F.length; j++) { var X = this.F[j]; if (X.getName() == _) { B.add(X); } } return B;};mboxList.prototype.getById = function(tb) { return this.F[tb];};mboxList.prototype.length = function() { return this.F.length;};mboxList.prototype.each = function(p) { if (typeof p != 'function') { throw 'Action must be a function, was: ' + typeof(p); } for (var j = 0; j < this.F.length; j++) { p(this.F[j]); }};mboxLocatorDefault = function(g) { this.g = 'mboxMarker-' + g; document.write('<div id="' + this.g + '" style="visibility:hidden;display:none">&nbsp;</div>');};mboxLocatorDefault.prototype.locate = function() { var ub = document.getElementById(this.g); while (ub != null) { if (ub.nodeType == 1) { if (ub.className == 'mboxDefault') { return ub; } } ub = ub.previousSibling; } return null;};mboxLocatorDefault.prototype.force = function() { var vb = document.createElement('div'); vb.className = 'mboxDefault'; var wb = document.getElementById(this.g); wb.parentNode.insertBefore(vb, wb); return vb;};mboxLocatorNode = function(xb) { this.ub = xb;};mboxLocatorNode.prototype.locate = function() { return typeof this.ub == 'string' ? document.getElementById(this.ub) : this.ub;};mboxLocatorNode.prototype.force = function() { return null;};mboxCreate = function(_ ) { var X = mboxFactoryDefault.create( _, mboxShiftArray(arguments)); if (X) { X.load(); } return X;};mboxDefine = function(fb, _ ) { var X = mboxFactoryDefault.create(_, mboxShiftArray(mboxShiftArray(arguments)), fb); return X;};mboxUpdate = function(_ ) { mboxFactoryDefault.update(_, mboxShiftArray(arguments));};mbox = function(g, yb, w, zb, ib) { this.Ab = null; this.Bb = 0; this.hb = zb; this.ib = ib; this.Cb = null; this.Db = new mboxOfferContent(); this.vb = null; this.w = w; this.message = ''; this.Eb = new Object(); this.Fb = 0; this.yb = yb; this.g = g; this.Gb(); w.addParameter('mbox', g) .addParameter('mboxId', yb); this.Hb = function() {}; this.Ib = function() {}; this.Jb = null;};mbox.prototype.getId = function() { return this.yb;};mbox.prototype.Gb = function() { if (this.g.length > 250) { throw "Mbox Name " + this.g + " exceeds max length of " + "250 characters."; } else if (this.g.match(/^\s+|\s+$/g)) { throw "Mbox Name " + this.g + " has leading/trailing whitespace(s)."; }};mbox.prototype.getName = function() { return this.g;};mbox.prototype.getParameters = function() { var c = this.w.getParameters(); var B = new Array(); for (var j = 0; j < c.length; j++) { if (c[j].name.indexOf('mbox') != 0) { B[B.length] = c[j].name + '=' + c[j].value; } } return B;};mbox.prototype.setOnLoad = function(p) { this.Ib = p; return this;};mbox.prototype.setMessage = function(jb) { this.message = jb; return this;};mbox.prototype.setOnError = function(Hb) { this.Hb = Hb; return this;};mbox.prototype.setFetcher = function(Kb) { if (this.Cb) { this.Cb.cancel(); } this.Cb = Kb; return this;};mbox.prototype.getFetcher = function() { return this.Cb;};mbox.prototype.load = function(c) { if (this.Cb == null) { return this; } this.setEventTime("load.start"); this.cancelTimeout(); this.Bb = 0; var w = (c && c.length > 0) ? this.w.clone().addParameters(c) : this.w; this.Cb.fetch(w); var W = this; this.Lb = setTimeout(function() { W.Hb('browser timeout', W.Cb.getType()); }, 15000); this.setEventTime("load.end"); return this;};mbox.prototype.loaded = function() { this.cancelTimeout(); if (!this.activate()) { var W = this; setTimeout(function() { W.loaded(); }, 100); }};mbox.prototype.activate = function() { if (this.Bb) { return this.Bb; } this.setEventTime('activate' + ++this.Fb + '.start'); if (this.show()) { this.cancelTimeout(); this.Bb = 1; } this.setEventTime('activate' + this.Fb + '.end'); return this.Bb;};mbox.prototype.isActivated = function() { return this.Bb;};mbox.prototype.setOffer = function(Db) { if (Db && Db.show && Db.setOnLoad) { this.Db = Db; } else { throw 'Invalid offer'; } return this;};mbox.prototype.getOffer = function() { return this.Db;};mbox.prototype.show = function() { this.setEventTime('show.start'); var B = this.Db.show(this); this.setEventTime(B == 1 ? "show.end.ok" : "show.end"); return B;};mbox.prototype.showContent = function(Mb) { if (Mb == null) { return 0; } if (this.vb == null || !this.vb.parentNode) { this.vb = this.getDefaultDiv(); if (this.vb == null) { return 0; } } if (this.vb != Mb) { this.Nb(this.vb); this.vb.parentNode.replaceChild(Mb, this.vb); this.vb = Mb; } this.Ob(Mb); this.Ib(); return 1;};mbox.prototype.hide = function() { this.setEventTime('hide.start'); var B = this.showContent(this.getDefaultDiv()); this.setEventTime(B == 1 ? 'hide.end.ok' : 'hide.end.fail'); return B;};mbox.prototype.finalize = function() { this.setEventTime('finalize.start'); this.cancelTimeout(); if (this.getDefaultDiv() == null) { if (this.hb.force() != null) { this.setMessage('No default content, an empty one has been added'); } else { this.setMessage('Unable to locate mbox'); } } if (!this.activate()) { this.hide(); this.setEventTime('finalize.end.hide'); } this.setEventTime('finalize.end.ok');};mbox.prototype.cancelTimeout = function() { if (this.Lb) { clearTimeout(this.Lb); } if (this.Cb != null) { this.Cb.cancel(); }};mbox.prototype.getDiv = function() { return this.vb;};mbox.prototype.getDefaultDiv = function() { if (this.Jb == null) { this.Jb = this.hb.locate(); } return this.Jb;};mbox.prototype.setEventTime = function(Pb) { this.Eb[Pb] = (new Date()).getTime();};mbox.prototype.getEventTimes = function() { return this.Eb;};mbox.prototype.getImportName = function() { return this.ib;};mbox.prototype.getURL = function() { return this.w.buildUrl();};mbox.prototype.getUrlBuilder = function() { return this.w;};mbox.prototype.Qb = function(vb) { return vb.style.display != 'none';};mbox.prototype.Ob = function(vb) { this.Rb(vb, true);};mbox.prototype.Nb = function(vb) { this.Rb(vb, false);};mbox.prototype.Rb = function(vb, Sb) { vb.style.visibility = Sb ? "visible" : "hidden"; vb.style.display = Sb ? "block" : "none";};mboxOfferContent = function() { this.Ib = function() {};};mboxOfferContent.prototype.show = function(X) { var B = X.showContent(document.getElementById(X.getImportName())); if (B == 1) { this.Ib(); } return B;};mboxOfferContent.prototype.setOnLoad = function(Ib) { this.Ib = Ib;};mboxOfferAjax = function(Mb) { this.Mb = Mb; this.Ib = function() {};};mboxOfferAjax.prototype.setOnLoad = function(Ib) { this.Ib = Ib;};mboxOfferAjax.prototype.show = function(X) { var Tb = document.createElement('div'); Tb.id = X.getImportName(); Tb.innerHTML = this.Mb; var B = X.showContent(Tb); if (B == 1) { this.Ib(); } return B;};mboxOfferDefault = function() { this.Ib = function() {};};mboxOfferDefault.prototype.setOnLoad = function(Ib) { this.Ib = Ib;};mboxOfferDefault.prototype.show = function(X) { var B = X.hide(); if (B == 1) { this.Ib(); } return B;};mboxCookieManager = function mboxCookieManager(g, Ub) { this.g = g; this.Ub = Ub == '' || Ub.indexOf('.') == -1 ? '' : '; domain=' + Ub; this.Vb = new mboxMap(); this.loadCookies();};mboxCookieManager.prototype.isEnabled = function() { this.setCookie('check', 'true', 60); this.loadCookies(); return this.getCookie('check') == 'true';};mboxCookieManager.prototype.setCookie = function(g, h, ab) { if (typeof g != 'undefined' && typeof h != 'undefined' && typeof ab != 'undefined') { var Wb = new Object(); Wb.name = g; Wb.value = escape(h); Wb.expireOn = Math.ceil(ab + new Date().getTime() / 1000); this.Vb.put(g, Wb); this.saveCookies(); }};mboxCookieManager.prototype.getCookie = function(g) { var Wb = this.Vb.get(g); return Wb ? unescape(Wb.value) : null;};mboxCookieManager.prototype.deleteCookie = function(g) { this.Vb.remove(g); this.saveCookies();};mboxCookieManager.prototype.getCookieNames = function(Xb) { var Yb = new Array(); this.Vb.each(function(g, Wb) { if (g.indexOf(Xb) == 0) { Yb[Yb.length] = g; } }); return Yb;};mboxCookieManager.prototype.saveCookies = function() { var Zb = new Array(); var _b = 0; this.Vb.each(function(g, Wb) { Zb[Zb.length] = g + '#' + Wb.value + '#' + Wb.expireOn; if (_b < Wb.expireOn) { _b = Wb.expireOn; } }); var ac = new Date(_b * 1000); document.cookie = this.g + '=' + Zb.join('|') + '; expires=' + ac.toGMTString() + '; path=/' + this.Ub;};mboxCookieManager.prototype.loadCookies = function() { this.Vb = new mboxMap(); var bc = document.cookie.indexOf(this.g + '='); if (bc != -1) { var cc = document.cookie.indexOf(';', bc); if (cc == -1) { cc = document.cookie.indexOf(',', bc); if (cc == -1) { cc = document.cookie.length; } } var dc = document.cookie.substring( bc + this.g.length + 1, cc).split('|'); var ec = Math.ceil(new Date().getTime() / 1000); for (var j = 0; j < dc.length; j++) { var Wb = dc[j].split('#'); if (ec <= Wb[2]) { var fc = new Object(); fc.name = Wb[0]; fc.value = Wb[1]; fc.expireOn = Wb[2]; this.Vb.put(fc.name, fc); } } }};mboxSession = function(gc, hc, qb, ic, J) { this.hc = hc; this.qb = qb; this.ic = ic; this.J = J; this.jc = false; this.yb = typeof mboxForceSessionId != 'undefined' ? mboxForceSessionId : mboxGetPageParameter(this.hc); if (this.yb == null || this.yb.length == 0) { this.yb = J.getCookie(qb); if (this.yb == null || this.yb.length == 0) { this.yb = gc; this.jc = true; } } J.setCookie(qb, this.yb, ic);};mboxSession.prototype.getId = function() { return this.yb;};mboxSession.prototype.forceId = function(kc) { this.yb = kc; this.J.setCookie(this.qb, this.yb, this.ic);};mboxPC = function(qb, ic, J) { this.qb = qb; this.ic = ic; this.J = J; this.yb = typeof mboxForcePCId != 'undefined' ? mboxForcePCId : J.getCookie(qb); if (this.yb != null) { J.setCookie(qb, this.yb, ic); }};mboxPC.prototype.getId = function() { return this.yb;};mboxPC.prototype.forceId = function(kc) { if (this.yb != kc) { this.yb = kc; this.J.setCookie(this.qb, this.yb, this.ic); return true; } return false;};mboxGetPageParameter = function(g) { var B = null; var lc = new RegExp(g + "=([^\&]*)"); var mc = lc.exec(document.location); if (mc != null && mc.length >= 2) { B = mc[1]; } return B;};mboxSetCookie = function(g, h, ab) { return mboxFactoryDefault.getCookieManager().setCookie(g, h, ab);};mboxGetCookie = function(g) { return mboxFactoryDefault.getCookieManager().getCookie(g);};mboxCookiePageDomain = function() { var Ub = (/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1]; var nc = /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/; if (!nc.exec(Ub)) { var oc = (/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(Ub); if (oc) { Ub = oc[0]; } } return Ub ? Ub: "";};mboxShiftArray = function(pc) { var B = new Array(); for (var j = 1; j < pc.length; j++) { B[B.length] = pc[j]; } return B;};mboxGenerateId = function() { return (new Date()).getTime() + "-" + Math.floor(Math.random() * 999999);};mboxScreenHeight = function() { return screen.height;};mboxScreenWidth = function() { return screen.width;};mboxBrowserWidth = function() { return (window.innerWidth) ? window.innerWidth : document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth;};mboxBrowserHeight = function() { return (window.innerHeight) ? window.innerHeight : document.documentElement ? document.documentElement.clientHeight : document.body.clientHeight;};mboxBrowserTimeOffset = function() { return -new Date().getTimezoneOffset();};mboxScreenColorDepth = function() { return screen.pixelDepth;};mboxDomReady = { DOMContentLoaded: null, isReady: false, readyBound: false, ready: function() { if (!mboxDomReady.isReady) { if (!document.body) { return setTimeout(mboxDomReady.ready, 13); } mboxDomReady.isReady = true; mboxDomReady.readyFunction(); } }, readyFunction: function(){}, setup: function() { if (mboxDomReady.readyBound) { return; } mboxDomReady.readyBound = true; if (document.readyState === "complete") { return mboxDomReady.ready(); } if (document.addEventListener) { mboxDomReady.DOMContentLoaded = function() { document.removeEventListener("DOMContentLoaded", mboxDomReady.DOMContentLoaded, false); mboxDomReady.ready(); }; document.addEventListener("DOMContentLoaded", mboxDomReady.DOMContentLoaded, false); window.addEventListener("load", mboxDomReady.ready, false); } else if (document.attachEvent) { DOMContentLoaded = function() { if (document.readyState === "complete") { document.detachEvent("onreadystatechange", mboxDomReady.DOMContentLoaded); mboxDomReady.ready(); } }; document.attachEvent("onreadystatechange", DOMContentLoaded); window.attachEvent("onload", mboxDomReady.ready); var toplevel = false; try { toplevel = (window.frameElement == null); } catch(e) {} if (document.documentElement.doScroll && toplevel) { mboxDomReady.doScrollCheck(); } } }, doScrollCheck: function() { if (mboxDomReady.isReady) { return; } try { document.documentElement.doScroll("left"); } catch( error ) { setTimeout(mboxDomReady.doScrollCheck, 1); return; } mboxDomReady.ready(); }};if (typeof mboxVersion == 'undefined') { var mboxVersion = 39; var mboxFactories = new mboxMap(); var mboxFactoryDefault = new mboxFactory('aegon.tt.omtrdc.net', 'aegon', 'default'); mboxDomReady.readyFunction = function(){mboxFactoryDefault.E=true;}; mboxDomReady.setup();};if (mboxGetPageParameter("mboxDebug") != null || mboxFactoryDefault.getCookieManager() .getCookie("debug") != null) { setTimeout(function() { if (typeof mboxDebugLoaded == 'undefined') { alert('Could not load the remote debug.\nPlease check your connection' + ' to Test&amp;Target servers'); } }, 60*60); document.write('<' + 'scr' + 'ipt language="Javascript1.2" src=' + '"http://admin5.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=aegon.tt.omtrdc.net' + '&clientCode=aegon"><' + '\/scr' + 'ipt>');};mboxScPluginFetcher = function(b, qc) { this.b = b; this.qc = qc;};mboxScPluginFetcher.prototype.rc = function(w) { w.setBasePath('/m2/' + this.b + '/sc/standard'); this.sc(w); var e = w.buildUrl(); e += '&scPluginVersion=1'; return e;};mboxScPluginFetcher.prototype.sc = function(w) { var tc = [ "dynamicVariablePrefix","visitorID","vmk","ppu","charSet", "visitorNamespace","cookieDomainPeriods","cookieLifetime","pageName", "currencyCode","variableProvider","channel","server", "pageType","transactionID","purchaseID","campaign","state","zip","events", "products","linkName","linkType","resolution","colorDepth", "javascriptVersion","javaEnabled","cookiesEnabled","browserWidth", "browserHeight","connectionType","homepage","pe","pev1","pev2","pev3", "visitorSampling","visitorSamplingGroup","dynamicAccountSelection", "dynamicAccountList","dynamicAccountMatch","trackDownloadLinks", "trackExternalLinks","trackInlineStats","linkLeaveQueryString", "linkDownloadFileTypes","linkExternalFilters","linkInternalFilters", "linkTrackVars","linkTrackEvents","linkNames","lnk","eo" ]; for (var j = 0; j < tc.length; j++) { this.uc(tc[j], w); } for (var j = 1; j <= 50; j++) { this.uc('prop' + j, w); this.uc('eVar' + j, w); this.uc('hier' + j, w); }};mboxScPluginFetcher.prototype.uc = function(g, w) { var h = this.qc[g]; if (typeof(h) === 'undefined' || h === null || h === '') { return; } w.addParameter(g, h);};mboxScPluginFetcher.prototype.cancel = function() { };mboxStandardScPluginFetcher = function(b, qc) { mboxScPluginFetcher.call(this, b, qc);};mboxStandardScPluginFetcher.prototype = new mboxScPluginFetcher;mboxStandardScPluginFetcher.prototype.getType = function() { return 'standard';};mboxStandardScPluginFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); var e = this.rc(w); document.write('<' + 'scr' + 'ipt src="' + e + '" language="JavaScript"><' + '\/scr' + 'ipt>');};mboxAjaxScPluginFetcher = function(b, qc) { mboxScPluginFetcher.call(this, b, qc);};mboxAjaxScPluginFetcher.prototype = new mboxScPluginFetcher;mboxAjaxScPluginFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); var e = this.rc(w); this.x = document.createElement('script'); this.x.src = e; document.body.appendChild(this.x);};mboxAjaxScPluginFetcher.prototype.getType = function() { return 'ajax';};function mboxLoadSCPlugin(qc) { if (!qc) { return null; } qc.m_tt = function(qc) { var vc = qc.m_i('tt'); vc.H = true; vc.b = 'aegon'; vc['_t'] = function() { if (!this.isEnabled()) { return; } var X = this.xc(); if (X) { var Kb = mboxFactoryDefault.isDomLoaded() ? new mboxAjaxScPluginFetcher(this.b, this.s) : new mboxStandardScPluginFetcher(this.b, this.s); X.setFetcher(Kb); X.load(); } }; vc.isEnabled = function() { return this.H && mboxFactoryDefault.isEnabled(); }; vc.xc = function() { var _ = this.yc(); var vb = document.createElement('DIV'); return mboxFactoryDefault.create(_, new Array(), vb); }; vc.yc = function() { var zc = this.s.events && this.s.events.indexOf('purchase') != -1; return 'SiteCatalyst: ' + (zc ? 'purchase' : 'event'); }; }; return qc.loadModule('tt');};

/**
 * Adversitement floating mbox
 * Created by: 			Stefan Leever
 * Created on: 			19-03-10
 * Last modified: 		$Date: 2011-11-03 $
 * Last modified by: 	$Author: Anita Lusiani $
 * Version:				1.3.0
 * 
 * Changelog:
 * 
 * 20100727: Base floating mbox
 * 20100730: Added a fix which fixes the message "document.body is null"
 * 20100813: Added a new function checkElementByIdUsingJQ which adds jQuery support to the floating Mbox. By using jQuery you can check elements which are hard to reach more easily.
 * 20110927: Added afMbox.url_arr
 * 20111005: bugfix onClick
 * 20111103: Updated the mbox to add new URLs for Social Proof test and remove 'bankspaarhypotheek' URL.
 */

var afMbox = new Object(); 
/**
 * checkElementById
 * 
 * Check the availability of a element by ID.
 * It will call the callback method when the element is available.
 * 
 * @param {Object} element
 * @param {Object} callback
 */
afMbox.checkElementById = function(element, callback) {
	var intervalID = setInterval(
		(function(element, callback){return function() {
			var el = document.getElementById(element);
			if (typeof(el) != "undefined" && el != null) {
				clearInterval(intervalID);
				var classObject = window[callback];
				return classObject.callBack(el);
			}
			else {
				afMbox.intervalIDs[afMbox.intervalIDsNum] = intervalID;
				afMbox.intervalIDsNum++;
			}
		}})(element, callback), 100 
	);
}

/**
 * checkElementByIdUsingJQ
 * 
 * Check the availability of a element by ID using jQuery.
 * It will call the callback method when the element is available.
 * 
 * @param {Object} element
 * @param {Object} callback
 */
afMbox.checkElementByIdUsingJQ = function(elementString, callback, multipleElements) {
	// Check whether we've jQuery
	if (typeof($) == "undefined") {
		return false;
	}
	if (typeof(multipleElements) == "undefined" || multipleElements == "") {
		multipleElements = false;
	}
	var intervalID = setInterval(
		(function(elementString, callback){return function() {
			var el = $(elementString);
			if (typeof(el) != "undefined" && el != null) {
				clearInterval(intervalID);
				var classObject = window[callback];
				if (!multipleElements) {
					return classObject.callBack(el[0]);
				}else{
					return classObject.callBack(el);
				}
			}
			else {
				afMbox.intervalIDs[afMbox.intervalIDsNum] = intervalID;
				afMbox.intervalIDsNum++;
			}
		}})(elementString, callback), 100 
	);
}

afMbox.checkElementByIdUsingJQUpd = function(elementString, callback, multipleElements) {
	// Check whether we've jQuery
	if (typeof($) == "undefined") {
		return false;
	}
	var intervalID = setInterval(
		(function(elementString, callback){return function() {
			var el = $(elementString);
			var length = el.length;
			var elements = new Array();
			var j = 0;
			for (var i=0;i<length;i++) {
				if (typeof(el[i]) != "undefined") {
					elements[j] = el[i];
					j++;
				}
			}
			if (typeof(elements) != "undefined" && elements.length>0) {
				clearInterval(intervalID);
				var classObject = window[callback];
				if (!multipleElements) {
					return classObject.callBack(elements[0]);
				}else{
					return classObject.callBack(elements);
				}
			}
			else {
				afMbox.intervalIDs[afMbox.intervalIDsNum] = intervalID;
				afMbox.intervalIDsNum++;
			}
		}})(elementString, callback), 100 
	);
}
	/**
	 * checkElementByClass
	 * 
	 * Check the availability of a element by Classname.
	 * It will call the callback method when the element is available.
	 * 
	 * @param {Object} elementID
	 * @param {Object} elementTag
	 * @param {Object} className
	 * @param {Object} callback
	 */
afMbox.checkElementByClass = function(elementID, elementTag, className, callback, multipleElements) {
	if (typeof(multipleElements) == "undefined" || multipleElements == "") {
		multipleElements = false;
	}
	var intervalID = setInterval(
		(function(elementID, elementTag, className, callback) {
		  return function() {
			var el = document.getElementById(elementID);
			if (typeof(el) != "undefined" && el != null) {
				var classElement = afMbox.getElementsByClassName(el, elementTag, className);
				if (classElement.length > 0) {
					clearInterval(intervalID);
					var classObject = window[callback];
					
					if (!multipleElements) {
						return classObject.callBack(classElement[0]);
					}else{
						return classObject.callBack(classElement);
					}
				}
			}
			else {
				afMbox.intervalIDs[afMbox.intervalIDsNum] = intervalID;
				afMbox.intervalIDsNum++;
			}
		}})(elementID, elementTag, className, callback), 100
	);
}
	
afMbox.addOnload = function(functionName) {
	if (typeof(afMbox.functionNames) == "undefined") {
		afMbox.functionNames = new Array();
	}
	afMbox.functionNames.push(functionName);
}
	
afMbox.runOnload = function(functionName) {
	if (typeof(afMbox.functionNames) == "undefined") {
		return false;
	}else{
		for (var i=0;i<afMbox.functionNames.length; i++) {
			eval([afMbox.functionNames[i]]+"()"); 
		}
	}
}
	
afMbox.addCSS = function(def) {
  var ss = document.createElement('style');
  ss.setAttribute("type", "text/css");
  if (ss.textContent) {    
      ss.textContent = def;
      var head = document.getElementsByTagName('head')[0];
      head.appendChild(ss);
  } else if(ss.styleSheet) {
      ss.styleSheet.cssText = def;
      var head = document.getElementsByTagName('head')[0];
      head.appendChild(ss);
  } else {
     var style = document.createElement('style');
	 style.setAttribute("type", "text/css");
     style.innerHTML = def;
	 var head = document.getElementsByTagName('head')[0];
     head.appendChild(style);
  }
}
	
	/**
	 * Written by Jonathan Snook, http://www.snook.ca/jonathan
	 * Add-ons by Robert Nyman, http://www.robertnyman.com
	 * */

afMbox.getElementsByClassName = function(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

afMbox.intervalIDsNum 	= 0;
afMbox.intervalIDs 		= new Array();

afMbox.url_arr = new Array(
"/particulier/verzekeren/woon-vrije-tijd-pakket/",
"/particulier/verzekeren/autoverzekering-online/",
"/particulier/verzekeren/auto-verzekeren/",
"/particulier/sparen/spaarrekening/",
"/particulier/sparen/e-rekening/",
"/particulier/sparen/deposito-sparen/",
"/particulier/sparen/",
"/particulier/hypotheek/",
"/particulier/hypotheek/spaar-hypotheek/",
"/particulier/hypotheek/aflossingsvrije-hypotheek/",
"/particulier/hypotheek/annuiteiten-hypotheek/",
"/particulier/hypotheek/levensloop-hypotheek/",
"/particulier/hypotheek/krediet-hypotheek/",
"/particulier/hypotheek/combinatie-hypotheek/");

for(var i = 0; i < afMbox.url_arr.length; i++){
	if (typeof(document.location.pathname) != "undefined" && document.location.pathname == afMbox.url_arr[i]) {
		document.write('<div class="mboxDefault"></div>');
		mboxCreate('product_pages');
	}
}

// Generate mbox requests based on page:
if (typeof(document.location) != "undefined" && document.location.toString().indexOf("verzekeren/auto-verzekeren/") > -1) {
	document.write('<div class="mboxDefault"></div>');
	mboxCreate('button_particulier_verzekeren_autoverzekeren');
}

if (typeof(document.location) != "undefined" && document.location.toString().indexOf("hypotheek/aflossingsvrije-hypotheek/") > -1) {
	document.write('<div class="mboxDefault"></div>');
	mboxCreate('button_particulier_hypotheek_aflossingsvrijehypotheek');
}

if (typeof(document.location) != "undefined" && document.location.toString().indexOf("pensioen-inkomen/levensloop/") > -1) {
	document.write('<div class="mboxDefault"></div>');
	mboxCreate('button_particulier_pensioeninkomen_levensloop');
}

if (typeof(document.location) != "undefined" && document.location.toString().indexOf("pensioen-inkomen/lijfrente-rekening/") > -1) {
	document.write('<div class="mboxDefault"></div>');
	mboxCreate('button_particulier_pensioeninkomen_lijfrenterekening');
}

if (typeof(document.location) != "undefined" && document.location.toString().indexOf("pensioen-inkomen/verzekeren-beleggen-pensioen/") > -1) {
	document.write('<div class="mboxDefault"></div>');
	mboxCreate('button_particulier_pensioeninkomen_verzekerenbeleggenpensioen');
}

/**
 * When certain elements cannot be found. Unset them when the page has loaded.
 */

function deactivateIntervals() {
	if (afMbox.intervalIDs.length > 0) {
		for (var i=0; i < afMbox.intervalIDs.length; i++) {
			clearInterval(afMbox.intervalIDs[i]);
		}
	}
}

afMbox.addOnload("deactivateIntervals");

/* Floating Elements v2.0.0 <http://www.adversitement.nl> - (C) 2011 Adversitement */
/* Makes use of Sly v1.0rc2 <http://sly.digitarald.com> - (C) 2009 Harald Kirschner <http://digitarald.de> - Open source under MIT License */

function FloatingElement(){var a=function(){function i(a,b,c,d){return a?d?function(d,e){return b(d,c,e)&&a(d,e)}:function(d,e){return a(d,e)&&b(d,c,e)}:function(a,d){return b(a,c,d)}}var a={};var b=function(c,d,e,f){c=typeof c=="string"?c.replace(/^\s+|\s+$/,""):"";var g=a[c]||(a[c]=new b.initialize(c));return d==null?g:g.search(d,e,f)};b.initialize=function(a){this.text=a};var c=b.initialize.prototype=b.prototype;b.implement=function(a,c){for(var d in c){b[a][d]=c[d]}};var d=b.support={};(function(){var a=document.createElement("div"),b=(new Date).getTime();a.innerHTML='<a name="'+b+'" class="€ b"></a>';a.appendChild(document.createComment(""));d.byTagAddsComments=a.getElementsByTagName("*").length>1;d.hasQsa=!!(a.querySelectorAll&&a.querySelectorAll(".€").length);d.hasByClass=function(){if(!a.getElementsByClassName||!a.getElementsByClassName("b").length){return false}a.firstChild.className="c";return a.getElementsByClassName("c").length==1}();var c=document.documentElement;c.insertBefore(a,c.firstChild);d.byIdAddsName=!!document.getElementById(b);c.removeChild(a)})();var e=function(){return true};c.search=function(a,c,f){f=f||{};var g,h,i;if(!a){a=document}else{if(a.nodeType!=1&&a.nodeType!=9){if(typeof a=="string"){a=b.search(a);g=true}else{if(Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&a.item){var j=[];for(h=0;i=a[h];h++){if(i.nodeType==1||i.nodeType==9){j.push(i)}}g=j.length>1;a=g?j:j[0]||document}}}}var k,l,m,n={},o={};var p=n;var q=b.getUid;var r=function(a){var b=q(a);return p[b]?null:p[b]=true};if(c&&c.length){for(h=0;i=c[h];h++){r(i)}}if(d.hasQsa&&!g&&a.nodeType==9&&!/\[/.test(this.text)){try{var s=a.querySelectorAll(this.text)}catch(t){}if(s){if(!c){return b.toArray(s)}for(h=0;i=s[h];h++){if(r(i)){c.push(i)}}if(!f.unordered){c.sort(b.compare)}return c}}var u=this.parse();if(!u.length){return[]}for(var h=0,v;v=u[h];h++){var w=r;if(v.first){if(!c){w=e}else{k=true}if(g){m=a}else{if(v.combinator){m=[a]}}}if(v.last&&c){p=n;l=c}else{p={};l=[]}if(!v.combinator&&!g){l=v.combine(l,a,v,o,w,!l.length)}else{for(var x=0,y=m.length;x<y;x++){l=v.combine(l,m[x],v,o,w)}}if(v.last){if(l.length){c=l}}else{m=l}}if(!f.unordered&&k&&c){c.sort(b.compare)}return c||[]};c.find=function(a,b,c){return this.search(a,b,c)[0]};c.match=function(a,b){var c=this.parse();if(c.length==1){return!!this.parse()[0].match(a,{})}if(!b){b=a;while(b.parentNode){b=b.parentNode}}var d=this.search(b),e=d.length;if(!(e--)){return false}while(e--){if(d[e]==a){return true}}return false};c.filter=function(a){var b=[],c=this.parse()[0].match;for(var d=0,e;e=a[d];d++){if(c(e)){b.push(e)}}return b};var f;b.recompile=function(){var a,c=[","],d=["!"];for(a in q){if(a!=" "){c[a.length>1?"unshift":"push"](b.escapeRegExp(a))}}for(a in s){d.push(a)}f=new RegExp("[\\w\\u00a1-\\uFFFF][\\w\\u00a1-\\uFFFF-]*|[#.](?:[\\w\\u00a1-\\uFFFF-]|\\\\:|\\\\.)+|[ \\t\\r\\n\\f](?=[\\w\\u00a1-\\uFFFF*#.[:])|[ \\t\\r\\n\\f]*("+c.join("|")+")[ \\t\\r\\n\\f]*|\\[([\\w\\u00a1-\\uFFFF-]+)[ \\t\\r\\n\\f]*(?:(["+d.join("")+"]?=)[ \\t\\r\\n\\f]*(?:\"([^\"]*)\"|'([^']*)'|([^\\]]*)))?]|:([-\\w\\u00a1-\\uFFFF]+)(?:\\((?:\"([^\"]*)\"|'([^']*)'|([^)]*))\\))?|\\*|(.+)","g")};var g=function(a){return{ident:[],classes:[],attributes:[],pseudos:[],combinator:a}};var h=function(a){return a};c.parse=function(a){var c=a?"plain":"parsed";if(this[c]){return this[c]}var d=this.text;var e=a?h:this.compute;var i=[],j=g(null);j.first=true;var k=function(a){i.push(e(j));j=g(a)};f.lastIndex=0;var l,m;while(l=f.exec(d)){if(l[11]){if(b.verbose){throw SyntaxError('Syntax error, "'+m+'" unexpected at #'+f.lastIndex+' in "'+d+'"')}return this[c]=[]}m=l[0];switch(m.charAt(0)){case".":j.classes.push(m.slice(1).replace(/\\/g,""));break;case"#":j.id=m.slice(1).replace(/\\/g,"");break;case"[":j.attributes.push({name:l[2],operator:l[3]||null,value:l[4]||l[5]||l[6]||null});break;case":":j.pseudos.push({name:l[7],value:l[8]||l[9]||l[10]||null});break;case" ":case"\t":case"\r":case"\n":case"\f":l[1]=l[1]||" ";default:var n=l[1];if(n){if(n==","){j.last=true;k(null);j.first=true;continue}if(j.first&&!j.ident.length){j.combinator=n}else{k(n)}}else{if(m!="*"){j.tag=m}}}j.ident.push(m)}j.last=true;i.push(e(j));return this[c]=i};var j=function(){return true};var k=function(a,b){return a.id==b};var l=function(a,b){return a.nodeName.toUpperCase()==b};var m=function(a){return new RegExp("(?:^|[ \\t\\r\\n\\f])"+a+"(?:$|[ \\t\\r\\n\\f])")};var n=function(a,b){return a.className&&b.test(a.className)};var o=function(a){a.getter=b.lookupAttribute(a.name)||b.getAttribute;if(!a.operator||!a.value){return a}var c=s[a.operator];if(c){a.escaped=b.escapeRegExp(a.value);a.pattern=new RegExp(c(a.value,a.escaped,a))}return a};var p=function(a,b){var c=b.getter(a,b.name);switch(b.operator){case null:return c;case"=":return c==b.value;case"!=":return c!=b.value}if(!c&&b.value){return false}return b.pattern.test(c)};c.compute=function(a){var c,e,f,g,h,q,s=a.tag,t=a.id,u=a.classes;var v=s?s.toUpperCase():null;if(t){q=true;h=i(null,k,t);g=function(a){if(a.getElementById){var b=a.getElementById(t);return b&&(!v||b.nodeName.toUpperCase()==v)&&(!d.getIdAdds||b.id==t)?[b]:[]}var c=a.getElementsByTagName(s||"*");for(var e=0,f;f=c[e];e++){if(f.id==t){return[f]}}return[]}}if(u.length>0){if(!g&&d.hasByClass){for(c=0;e=u[c];c++){h=i(h,n,m(e))}var w=u.join(" ");g=function(a){return a.getElementsByClassName(w)}}else{if(!g&&u.length==1){q=true;var x=m(u[0]);h=i(h,n,x);g=function(a){var b=a.getElementsByTagName(s||"*");var c=[];for(var d=0,e;e=b[d];d++){if(e.className&&x.test(e.className)){c.push(e)}}return c}}else{for(c=0;e=u[c];c++){f=i(f,n,m(e))}}}}if(s){if(!g){h=i(h,l,v);g=function(a){return a.getElementsByTagName(s)}}else{if(!q){f=i(f,l,v)}}}else{if(!g){g=function(a){var b=a.getElementsByTagName("*");if(!d.byTagAddsComments){return b}var c=[];for(var e=0,f;f=b[e];e++){if(f.nodeType===1){c.push(f)}}return c}}}for(c=0;e=a.pseudos[c];c++){if(e.name=="not"){var y=b(e.value);f=i(f,function(a,b){return!b.match(a)},y.parse().length==1?y.parsed[0]:y)}else{var z=r[e.name];if(z){f=i(f,z,e.value)}}}for(c=0;e=a.attributes[c];c++){f=i(f,p,o(e))}if(a.simple=!f){a.matchAux=j}else{a.matchAux=f;h=i(h,f)}a.match=h||j;a.combine=b.combinators[a.combinator||" "];a.search=g;return a};var q=b.combinators={" ":function(a,c,d,e,f,g){var h=d.search(c);if(g&&d.simple){return b.toArray(h)}for(var i=0,j,k=d.matchAux;j=h[i];i++){if(f(j)&&k(j,e)){a.push(j)}}return a},">":function(a,b,c,d,e){var f=c.search(b);for(var g=0,h;h=f[g];g++){if(h.parentNode==b&&e(h)&&c.matchAux(h,d)){a.push(h)}}return a},"+":function(a,b,c,d,e){while(b=b.nextSibling){if(b.nodeType==1){if(e(b)&&c.match(b,d)){a.push(b)}break}}return a},"~":function(a,b,c,d,e){while(b=b.nextSibling){if(b.nodeType==1){if(!e(b)){break}if(c.match(b,d)){a.push(b)}}}return a}};var r=b.pseudos={"first-child":function(a){return r.index(a,0)},"last-child":function(a){while(a=a.nextSibling){if(a.nodeType===1){return false}}return true},"only-child":function(a){var b=a;while(b=b.previousSibling){if(b.nodeType===1){return false}}var c=a;while(c=c.nextSibling){if(c.nodeType===1){return false}}return true},"nth-child":function(a,c,d){var e=b.parseNth(c||"n");if(e.special!="n"){return r[e.special](a,e.a,d)}d=d||{};d.positions=d.positions||{};var f=b.getUid(a);if(!d.positions[f]){var g=0;while(a=a.previousSibling){if(a.nodeType!=1){continue}g++;var h=d.positions[b.getUid(a)];if(h!=undefined){g=h+g;break}}d.positions[f]=g}return d.positions[f]%e.a==e.b},empty:function(a){return!(a.innerText||a.textContent||"").length},contains:function(a,b){return(a.innerText||a.textContent||"").indexOf(b)!=-1},index:function(a,b){var c=1;while(a=a.previousSibling){if(a.nodeType==1&&++c>b){return false}}return c==b},even:function(a,b,c){return r["nth-child"](a,"2n+1",c)},odd:function(a,b,c){return r["nth-child"](a,"2n",c)}};r.first=r["first-child"];r.last=r["last-child"];r.nth=r["nth-child"];r.eq=r.index;var s=b.operators={"*=":function(a,b){return b},"^=":function(a,b){return"^"+b},"$=":function(a,b){return a+"$"},"~=":function(a,b){return"(?:^|[ \\t\\r\\n\\f])"+b+"(?:$|[ \\t\\r\\n\\f])"},"|=":function(a,b){return"(?:^|\\|)"+b+"(?:$|\\|)"}};var t={"class":"className"};b.lookupAttribute=function(a){var b=t[a];if(b){return function(a){return a[b]}}var c=/^(?:src|href|action)$/.test(a)?2:0;return function(b){return b.getAttribute(a,c)}};b.getAttribute=function(a,b){return a.getAttribute(b)};var u=Array.slice||function(a){return Array.prototype.slice.call(a)};try{u(document.documentElement.childNodes)}catch(v){u=function(a){if(a instanceof Array){return a}var b=a.length,c=new Array(b);while(b--){c[b]=a[b]}return c}}b.toArray=u;b.compare=document.compareDocumentPosition?function(a,b){return 3-(a.compareDocumentPosition(b)&6)}:function(a,b){return a.sourceIndex-b.sourceIndex};var w=1;b.getUid=window.ActiveXObject?function(a){return(a.$slyUid||(a.$slyUid={id:w++})).id}:function(a){return a.$slyUid||(a.$slyUid=w++)};var x={};b.parseNth=function(a){if(x[a]){return x[a]}var b=a.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!b){return false}var c=parseInt(b[1],10),d=(parseInt(b[3],10)||0)-1;if(c=isNaN(c)?1:c){while(d<1){d+=c}while(d>=c){d-=c}}switch(b[2]){case"n":b={a:c,b:d,special:"n"};break;case"odd":b={a:2,b:0,special:"n"};break;case"even":b={a:2,b:1,special:"n"};break;case"first":b={a:0,special:"index"};break;case"last":b={special:"last-child"};break;case"only":b={special:"only-child"};break;default:b={a:c?c-1:d,special:"index"}}return x[a]=b};b.escapeRegExp=function(a){return a.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&")};b.generise=function(a){b[a]=function(c){var d=b(c);return d[a].apply(d,Array.prototype.slice.call(arguments,1))}};var y=["parse","search","find","match","filter"];for(var z=0;y[z];z++){b.generise(y[z])}b.recompile();return b}();return{css:function(a){var b=document.createElement("style");b.setAttribute("type","text/css");if(b.textContent){b.textContent=a;var c=document.getElementsByTagName("head")[0];c.appendChild(b)}else if(b.styleSheet){b.styleSheet.cssText=a;var c=document.getElementsByTagName("head")[0];c.appendChild(b)}else{var d=document.createElement("style");d.setAttribute("type","text/css");d.innerHTML=a;var c=document.getElementsByTagName("head")[0];c.appendChild(d)}},selector:function(){return a},findAndExecute:function(b,c,d){if(typeof d!="undefined"){d()}var e=0,f=false;var g=setInterval(function(b,c,d){return function(){var b=a.search(d),h=b.length,i=new Array,j=0;for(var k=0;k<h;k++){if(typeof b[k]!="undefined"){i[j]=b[k];j++}}if(typeof i!="undefined"&&i.length>0){clearInterval(g);c(i)}if(e>=20||f){clearInterval(g);e=0}e++}}(this.Sly,c,b),100)}}}

var advMXClick = function(tag) {
  var pauseComp = function(millis) {
    var date = new Date();
    var curDate = null;
    
    do { curDate = new Date(); }
    while(curDate-date < millis);
  };
  var sendMbox = function(name, value) {
    var d = document.createElement('div');
    d.style.display = "none";
    document.body.appendChild(d);
       mboxDefine(d, name, "clickPosition=" + value);
    var mboxes = mboxFactoryDefault.getMboxes();
    for(var i=0; i<mboxes.length; i++) {
      var Q = mboxes[i];
        Q.setFetcher(new mboxAjaxFetcher());
        Q.finalize();
    }
    if(window.addEventListener){window.addEventListener((navigator.userAgent.indexOf("AppleWebKit")>-1?'before':'') + 'unload', function(){
      mboxUpdate(name, "clickPosition=" + (value||"click"));
      pauseComp(600);
    }, false);
    } else if(window.attachEvent){
      window.attachEvent('onunload', function(){
        mboxUpdate(name, "clickPosition=" + (value||"click"));
        pauseComp(600);
      });
    };
  };
  sendMbox('Onclick_MBox: '+tag);
};
