




var mboxCopyright = "&copy; 1996-2008. Omniture, Inc. 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 + 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() { };


mboxFactory = function(y, b) {
 this.z = false;
 this.A = new mboxList();

 
 
 this.B =
 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.C = this.B;

 if (mboxGetPageParameter('mboxDisable') != null) {
 this.C = false;
 }

 
 
 if (!mboxCookies.isEnabled()) {
 this.C = false;
 }
 if (mboxCookies.getCookie('disable') == 'true') {
 this.C = false;
 }
 

 if (this.isAdmin()) {
 this.enable();
 }

 this.D = mboxGenerateId();
 this.E = new mboxSession(this.D,
 'mboxSession',
 'session', 31 * 60);
 this.F = new mboxPC(this.D,
 'PC', 63072000);

 this.w = new mboxUrlBuilder(y, b);
 this.G();

 this.H = new Date().getTime();
 this.I = this.H;

 var J = this;
 this.addOnLoad(function() { J.I = new Date().getTime(); });
 if (this.B) {
 
 
 this.addOnLoad(function() {
 J.z = true;
 J.getMboxes().each(function(K) {
 K.setFetcher(new mboxAjaxFetcher()),
 K.finalize(); });
 });

 this.limitTraffic(100, 10368000);

 if (this.C) {
 this.L();

 this.M = new mboxSignaler(function(N, c) {
 return J.create(N, c); });

 }

 }
};




mboxFactory.prototype.isEnabled = function() {
 return this.C;
};


mboxFactory.prototype.isSupported = function() {
 return this.B;
};


mboxFactory.prototype.disable = function(O) {
 if (typeof duration == 'undefined') {
 O = 60 * 60;
 }
 if (!this.isAdmin()) {
 this.C = false;
 mboxCookies.setCookie('disable', 'true', O);
 }
};

mboxFactory.prototype.enable = function() {
 this.C = true;
 mboxCookies.deleteCookie('disable');
};

mboxFactory.prototype.isAdmin = function() {
 return document.location.href.indexOf(
 'mboxEnv') != -1;
};


mboxFactory.prototype.limitTraffic = function(P, O) {

};


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.I - this.H;
};

mboxFactory.prototype.getEllapsedTimeUntil = function(Q) {
 return Q - this.H;
};


mboxFactory.prototype.getMboxes = function() {
 return this.A;
};


mboxFactory.prototype.get = function(N, R) {
 return this.A.get(N).getById(R || 0);
};


mboxFactory.prototype.update = function(N, c) {
 if (!this.isEnabled()) {
 return;
 }
 if (this.A.get(N).length() == 0) {
 throw "Mbox " + N + " is not defined";
 }
 this.A.get(N).each(function(K) {
 
 K.getUrlBuilder()
 .addParameter('mboxRandomRequestId', mboxGenerateId());
 K.load(c);
 });
};


mboxFactory.prototype.create = function(N, c, S) {
 if (!this.isSupported()) {
 return null;
 }
 var e = this.w.clone();
 e.addParameter("mboxCount", this.A.length() + 1);
 e.addParameters(c);

 var R = this.A.get(N).length();
 var T;
 if (S) {
 T = new mboxLocatorNode(S);
 } else {
 if (this.z) {
 throw 'The page has already been loaded, can\'t write marker';
 }
 T = new mboxLocatorDefault(N + '-' + R);
 }

 try {
 var J = this;
 var K = new mbox(N, R, e, T);
 if (this.C) {
 K.setFetcher(this.z ? new mboxAjaxFetcher() :
 new mboxStandardFetcher());
 }

 K.setOnError(function(U, n) {
 K.setMessage(U);
 if (n == 'standard') {
 K.activate();
 if (!K.isActivated()) {
 J.disable();
 window.location.reload(false);
 }
 } else {
 throw U;
 }

 });
 this.A.add(K);
 } catch (V) {
 this.disable();
 throw 'Failed creating mbox "' + N + '", the error was: ' + V;
 }

 return K;
};

mboxFactory.prototype.getPageId = function() {
 return this.D;
};

mboxFactory.prototype.getPCId = function() {
 return this.F;
};

mboxFactory.prototype.getSessionId = function() {
 return this.E;
};


mboxFactory.prototype.getSignaler = function() {
 return this.M;
};


mboxFactory.prototype.getUrlBuilder = function() {
 return this.w;
};

mboxFactory.prototype.G = function() {
 var e = this.w;
 e.addParameter('mboxHost', document.location.hostname)
 .addParameter('mboxSession', this.E.getId());
 if (this.F.getId() != null) {
 e.addParameter('mboxPC', this.F.getId());
 }
 e.addParameter('mboxPage', this.D);
 var W = mboxCookies.getCookie('edge');
 if (W != null) {
 e.addParameter('edge', W);
 }



 e.setUrlProcessAction(function(e) {

 e += '&mboxURL=' + escape(document.location);
 var X = escape(document.referrer);
 if (e.length + X.length < 2000) {
 e += '&mboxReferrer=' + X;
 }

 e += '&mboxVersion=' + mboxVersion;
 return e;
 });
};

mboxFactory.prototype.Y = function() {
 return "";
};


mboxFactory.prototype.L = function() {
 document.write('<style>.' + 'mboxDefault'
 + ' { visibility:hidden; }</style>');
};



mboxSignaler = function(Z) {
 var _ =
 mboxCookies.getCookieNames('signal-');
 for (var j = 0; j < _.length; j++) {
 var ab = _[j];
 var bb = mboxCookies.getCookie(ab).split('&');
 var K = Z(bb[0], bb);
 K.load();
 mboxCookies.deleteCookie(ab);
 }
};


mboxSignaler.prototype.signal = function(cb, N ) {
 mboxCookies.setCookie('signal-' +
 cb, mboxShiftArray(arguments).join('&'), 45 * 60);
};



mboxList = function() {
 this.A = new Array();
};

mboxList.prototype.add = function(K) {
 if (K != null) {
 this.A[this.A.length] = K;
 }
};


mboxList.prototype.get = function(N) {
 var db = new mboxList();
 for (var j = 0; j < this.A.length; j++) {
 var K = this.A[j];
 if (K.getName() == N) {
 db.add(K);
 }
 }
 return db;
};

mboxList.prototype.getById = function(eb) {
 return this.A[eb];
};

mboxList.prototype.length = function() {
 return this.A.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.A.length; j++) {
 p(this.A[j]);
 }
};





mboxLocatorDefault = function(g) {
 this.g = 'mboxMarker-' + g;

 document.write('<div id="' + this.g +
 '" style="visibility:hidden;display:none"></div>');
};

mboxLocatorDefault.prototype.locate = function() {
 var fb = document.getElementById(this.g);
 while (fb != null) {
 
 if (fb.nodeType == 1) {
 if (fb.className == 'mboxDefault') {
 return fb;
 }
 }
 fb = fb.previousSibling;
 }

 return null;
};

mboxLocatorDefault.prototype.force = function() {
 
 var gb = document.createElement('div');
 gb.className = 'mboxDefault';

 var hb = document.getElementById(this.g);
 hb.parentNode.insertBefore(gb, hb);

 return gb;
};

mboxLocatorNode = function(ib) {
 this.fb = ib;
};

mboxLocatorNode.prototype.locate = function() {
 return typeof this.fb == 'string' ?
 document.getElementById(this.fb) : this.fb;
};

mboxLocatorNode.prototype.force = function() {
 return null;
};


mboxCreate = function(N ) {
 var K = mboxFactoryDefault.create(N, mboxShiftArray(arguments));
 if (K) {
 K.load();
 }
 return K;
};


mboxDefine = function(S, N ) {
 var K = mboxFactoryDefault.create(N,
 mboxShiftArray(mboxShiftArray(arguments)), S);

 return K;
};

mboxUpdate = function(N ) {
 mboxFactoryDefault.update(N, mboxShiftArray(arguments));
};


mbox = function(g, jb, w, kb) {
 this.lb = null;
 this.mb = 0;
 this.nb = null;
 this.T = kb;
 this.ob = null;

 this.pb = new mboxOfferContent();
 this.gb = this.getDefaultDiv();

 this.w = w;

 
 this.message = '';
 this.qb = new Object();
 this.rb = 0;

 this.jb = jb;
 this.g = g;

 this.sb();

 w.addParameter('mbox', g)
 .addParameter('mboxId', jb);

 this.tb = function() {};
 this.ub = function() {};
};

mbox.prototype.getId = function() {
 return this.jb;
};

mbox.prototype.sb = 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.parameters = function() {
 return this.w.getParameters();
};


mbox.prototype.setOnLoad = function(p) {
 this.ub = p;
 return this;
};

mbox.prototype.setMessage = function(U) {
 this.message = U;
 return this;
};


mbox.prototype.setOnError = function(tb) {
 this.tb = tb;
 return this;
};

mbox.prototype.setFetcher = function(vb) {
 if (this.ob) {
 this.ob.cancel();
 }
 this.ob = vb;
 return this;
};

mbox.prototype.getFetcher = function() {
 return this.ob;
};


mbox.prototype.load = function(c) {
 if (this.ob == null) {
 return this;
 }


 this.setEventTime("load.start");

 this.cancelTimeout();

 var w = (c && c.length > 0) ?
 this.w.clone().addParameters(c) : this.w;
 this.ob.fetch(w);

 var J = this;
 this.wb = setTimeout(function() {
 J.tb('Fetch of mbox timed out', J.ob.getType());
 }, 15000);


 this.setEventTime("load.end");


 return this;
};


mbox.prototype.loaded = function(c) {
 this.cancelTimeout();
 if (!this.activate()) {
 var J = this;
 setTimeout(function() {
 J.loaded();
 }, 100);
 }
};


mbox.prototype.activate = function() {
 if (this.mb) {
 return this.mb;
 }

 this.setEventTime('activate' + ++this.rb + '.start');


 if (this.show()) {
 this.cancelTimeout();
 this.mb = 1;
 }


 this.setEventTime('activate' + this.rb + '.end');

 return this.mb;
};


mbox.prototype.isActivated = function() {
 return this.mb;
};


mbox.prototype.setOffer = function(pb) {
 if (pb && pb.show && pb.setOnLoad) {
 this.pb = pb;
 } else {
 throw 'Invalid offer';
 }
 return this;
};

mbox.prototype.getOffer = function() {
 return this.pb;
};


mbox.prototype.show = function() {

 this.setEventTime('show.start');


 var db = this.pb.show(this);


 this.setEventTime(db == 1 ? "show.end.ok" : "show.end");


 return db;
};


mbox.prototype.showContent = function(xb) {
 if (xb == null) {
 
 return 0;
 }
 if (this.gb == null) {
 this.gb = this.getDefaultDiv();
 if (this.gb == null) {
 
 return 0;
 }
 }

 if (this.gb != xb) {
 this.yb(this.gb);
 this.gb.parentNode.replaceChild(xb, this.gb);
 this.gb = xb;
 }

 this.zb(xb);

 this.ub();

 
 return 1;
};


mbox.prototype.hide = function() {

 this.setEventTime('hide.start');


 var db = this.showContent(this.getDefaultDiv());


 this.setEventTime(db == 1 ? 'hide.end.ok' : 'hide.end.fail');


 return db;
};


mbox.prototype.finalize = function() {

 this.setEventTime('finalize.start');


 this.cancelTimeout();

 if (this.getDefaultDiv() == null) {
 if (this.T == null) {
 this.setMessage('No locator specified');
 } else {
 if (this.T.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.wb) {
 clearTimeout(this.wb);
 }
 if (this.ob != null) {
 this.ob.cancel();
 }
};

mbox.prototype.getDiv = function() {
 return this.gb;
};

mbox.prototype.getDefaultDiv = function() {
 if (this.nb != null) {
 return this.nb;
 }

 if (this.T == null) {
 return null;
 }

 this.nb = this.T.locate();
 return this.nb;
};

mbox.prototype.setEventTime = function(Ab) {
 this.qb[Ab] = (new Date()).getTime();
};

mbox.prototype.getEventTimes = function() {
 return this.qb;
};

mbox.prototype.getURL = function() {
 return this.w.buildUrl();
};

mbox.prototype.getUrlBuilder = function() {
 return this.w;
};

mbox.prototype.Bb = function(gb) {
 return gb.style.display != 'none';
};

mbox.prototype.zb = function(gb) {
 this.Cb(gb, true);
};

mbox.prototype.yb = function(gb) {
 this.Cb(gb, false);
};

mbox.prototype.Cb = function(gb, Db) {
 gb.style.visibility = Db ? "visible" : "hidden";
 gb.style.display = Db ? "block" : "none";
};

mboxOfferContent = function() {
 this.ub = function() {};
};

mboxOfferContent.prototype.show = function(K) {
 var db = K.showContent(document.getElementById(
 this.Eb(K)));
 if (db == 1) {
 this.ub();
 }
 return db;
};

mboxOfferContent.prototype.setOnLoad = function(ub) {
 this.ub = ub;
};

mboxOfferContent.prototype.Eb = function(K) {
 return 'mboxImported-' + K.getName() + '-' +
 K.getId();
};


mboxOfferAjax = function(xb) {
 this.xb = xb;
 this.ub = function() {};
};

mboxOfferAjax.prototype.setOnLoad = function(ub) {
 this.ub = ub;
};

mboxOfferAjax.prototype.show = function(K) {
 var Fb = document.createElement('div');

 Fb.id = 'mboxImported-' +
 K.getName() + '-' + K.getId();
 Fb.innerHTML = this.xb;

 var db = K.showContent(Fb);
 if (db == 1) {
 this.ub();
 }
 return db;
};


mboxOfferDefault = function() {
 this.ub = function() {};
};

mboxOfferDefault.prototype.setOnLoad = function(ub) {
 this.ub = ub;
};

mboxOfferDefault.prototype.show = function(K) {
 var db = K.hide();
 if (db == 1) {
 this.ub();
 }
 return db;
};

mboxCookieManager = function mboxCookieManager(g, Gb) {
 this.g = g;
 
 this.Gb = Gb == '' || Gb.indexOf('.') == -1 ? '' :
 '; domain=' + Gb;
 this.loadCookies();
};

mboxCookieManager.prototype.isEnabled = function() {
 this.setCookie('check', 'true', 60);
 this.loadCookies();
 return this.getCookie('check') == 'true';
};


mboxCookieManager.prototype.setCookie = function(g, h, O) {
 if (typeof g != 'undefined' && typeof h != 'undefined' &&
 typeof O != 'undefined') {

 var eb = this.Hb.length;
 for (var j = 0; j < this.Hb.length; j++) {
 if (this.Hb[j].name == g) {
 eb = j;
 break;
 }
 }
 var Ib = new Object();
 Ib.name = g;
 Ib.value = escape(h);
 
 Ib.expireOn = Math.ceil(O + new Date().getTime() / 1000);

 this.Hb[eb] = Ib;
 this.saveCookies();
 }
};

mboxCookieManager.prototype.getCookie = function(g) {
 for (var j = 0; j < this.Hb.length; j++) {
 var Ib = this.Hb[j];
 if (Ib.name == g) {
 return unescape(Ib.value);
 }
 }
 return null;
};

mboxCookieManager.prototype.deleteCookie = function(g) {
 var Jb = new Array();
 for (var j = 0; j < this.Hb.length; j++) {
 var Ib = this.Hb[j];
 if (Ib.name != g) {
 Jb[Jb.length] = Ib;
 }
 }
 this.Hb = Jb;
 this.saveCookies();
};

mboxCookieManager.prototype.getCookieNames = function(Kb) {
 var Lb = new Array();
 for (var j = 0; j < this.Hb.length; j++) {
 var Ib = this.Hb[j];
 if (Ib.name.indexOf(Kb) == 0) {
 Lb[Lb.length] = Ib.name;
 }
 }
 return Lb;
};

mboxCookieManager.prototype.saveCookies = function() {

 var Mb = new Array();
 var Nb = 0;
 for (var j = 0; j < this.Hb.length; j++) {
 var Ib = this.Hb[j];
 Mb[Mb.length] = Ib.name + '#' + Ib.value +
 '#' + Ib.expireOn;
 if (Nb < Ib.expireOn) {
 Nb = Ib.expireOn;
 }
 }
 var Ob = new Date(Nb * 1000);
 document.cookie = this.g + '=' + Mb.join('|') +
 
 '; expires=' + Ob.toGMTString() +
 '; path=/' + this.Gb;

};

mboxCookieManager.prototype.loadCookies = function() {
 this.Hb = new Array();
 var Pb = document.cookie.indexOf(this.g + '=');
 if (Pb != -1) {
 var Qb = document.cookie.indexOf(';', Pb);
 if (Qb == -1) {
 Qb = document.cookie.indexOf(',', Pb);
 if (Qb == -1) {
 Qb = document.cookie.length;
 }
 }
 var Rb = document.cookie.substring(
 Pb + this.g.length + 1, Qb).split('|');

 var Sb = Math.ceil(new Date().getTime() / 1000);
 for (var j = 0; j < Rb.length; j++) {
 var Ib = Rb[j].split('#');
 if (Sb <= Ib[2]) {
 var Tb = new Object();
 Tb.name = Ib[0];
 Tb.value = Ib[1];
 Tb.expireOn = Ib[2];
 this.Hb[this.Hb.length] = Tb;
 }
 }
 }
};


mboxSession = function(Ub, Vb, ab, Wb) {
 this.Vb = Vb;
 this.ab = ab;
 this.Wb = Wb;

 this.Xb = false;

 this.jb = typeof mboxForceSessionId != 'undefined' ?
 mboxForceSessionId : mboxGetPageParameter(this.Vb);

 if (this.jb == null || this.jb.length == 0) {
 this.jb = mboxCookies.getCookie(ab);
 if (this.jb == null || this.jb.length == 0) {
 this.jb = Ub;
 this.Xb = true;
 }
 }

 mboxCookies.setCookie(ab, this.jb, Wb);
};


mboxSession.prototype.getId = function() {
 return this.jb;
};

mboxSession.prototype.forceId = function(Yb) {
 this.jb = Yb;

 mboxCookies.setCookie(this.ab, this.jb, this.Wb);
};


mboxPC = function(Ub, ab, Wb) {
 this.ab = ab;
 this.Wb = Wb;

 this.jb = typeof mboxForcePCId != 'undefined' ?
 mboxForcePCId : mboxCookies.getCookie(ab);
 if (this.jb != null) {
 mboxCookies.setCookie(ab, this.jb, Wb);
 }

};


mboxPC.prototype.getId = function() {
 return this.jb;
};


mboxPC.prototype.forceId = function(Yb) {
 if (this.jb != Yb) {
 this.jb = Yb;
 mboxCookies.setCookie(this.ab, this.jb, this.Wb);
 return true;
 }
 return false;
};

mboxGetPageParameter = function(g) {
 var db = null;
 var Zb = new RegExp(g + "=([^\&]*)");
 var _b = Zb.exec(document.location);

 if (_b != null && _b.length >= 2) {
 db = _b[1];
 }
 return db;
};

mboxSetCookie = function(g, h, O) {
 return mboxCookies.setCookie(g, h, O);
};

mboxGetCookie = function(g) {
 return mboxCookies.getCookie(g);
};

mboxCookiePageDomain = function() {
 var Gb = (/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];
 var ac = /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;

 if (!ac.exec(Gb)) {
 var bc =
 (/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(Gb);
 if (bc) {
 Gb = bc[0];
 }
 }

 return Gb ? Gb: "";
};

mboxShiftArray = function(cc) {
 var db = new Array();
 for (var j = 1; j < cc.length; j++) {
 db[db.length] = cc[j];
 }
 return db;
};

mboxGenerateId = function() {
 return (new Date()).getTime() + "-" + Math.floor(Math.random() * 999999);
};

if (typeof mboxVersion == 'undefined') {
 var mboxVersion = 32;
 var mboxCookies = new mboxCookieManager("mbox",
 (function() { return mboxCookiePageDomain(); })());

 var mboxFactoryDefault = new mboxFactory('mbox4.offermatica.com', 'j2global');
};






mboxDisplayDebugInfo = function() {
 mboxDebugger.show();
};

mboxCookieIsEnabled = function() {
 mboxCookies.setCookie('check', "true", 60);
 return mboxCookies.getCookie('check') == "true"
};


mboxDebug = function(dc, ec, fc) {
 this.gc = dc;
 this.p = null;

 var hc = mboxGetPageParameter(ec);
 if (hc == null) {
 hc = mboxCookies.getCookie(this.gc);
 }

 if (hc != null) {
 if (hc.indexOf("x") == 0) {
 
 this.p = new mboxDebugActionNone();

 document.write('<' + 'scr' + 'ipt language="Javascript1.2" src='
 + '"http://admin4.offermatica.com/admin/mbox/mbox_debug_' + hc + '.jsp?mboxServerHost=mbox4.offermatica.com&clientCode=j2global&'
 + 'session=' + mboxCookies.getCookie('session')
 + '"><' + '\/scr' + 'ipt>');
 }
 else if (hc.indexOf("log") == 0) {
 this.p = new mboxDebugActionLog(hc);
 }
 else if (hc == "reset") {
 hc = null;
 }
 else {
 this.p = new mboxDebugActionDefault();
 }
 }

 if (this.p != null) {
 if (fc.isSupported()) {
 fc.addOnLoad(mboxDisplayDebugInfo);
 }
 else {
 alert("mbox functionality is not supported on this browser");
 this.disable();
 }
 }

 if (hc != null) {
 mboxCookies.setCookie(this.gc, hc, 45 * 60);
 }
 else {
 this.disable()
 }
};

mboxDebug.prototype.isEnabled = function() {
 return this.p != null;
};


mboxDebug.prototype.disable = function() {
 mboxCookies.deleteCookie(this.gc);
};

mboxDebug.prototype.setShowAction = function(p) {
 this.p = p;
};

mboxDebug.prototype.show = function() {
 if (this.p != null) {
 this.p.show();
 }
};


mboxDebugActionLog = function(hc) {
 this.hc = hc;
 this.ic = (new Date()).getTime();
};

mboxDebugActionLog.prototype.show = function() {
 var jc = (new Date()).getTime();

 var kc = new mboxDebugWindow("Debug Log");

 kc.putPageStart();
 
 kc.put("<img sr" + "c='"
 + document.location.protocol + "//mbox4.offermatica.com/ima" + "ges/log.gif"
 + "?mboxDebug=" + this.hc
 + "&mboxClient=j2global"
 + "&mboxPageLoadTime=" + (jc - this.ic) + "'/>");

 kc.put("<br />");

 kc.putCloseButton();
 kc.putPageEnd();
};



mboxDebugActionNone = function() {
};

mboxDebugActionNone.prototype.show = function() {
 alert("Debug mode not defined"
 + "\n('x-mode' not supported when debug is remote in mbox.js)");
};


mboxDebugActionDefault = function() {
};

mboxDebugActionDefault.prototype.show = function() {
 var window = new mboxDebugWindow("Debug");

 window.putPageStart();
 window.put("  <b>Mbox Debug Window (version:" + mboxVersion + ")</b></br>");

 window.put("<p/>");
 window.put("<b>Page</b>: " + document.location);

 window.put(" <ul>");

 if (mboxFactoryDefault.isEnabled()) {
 window.put("  <li>Enabled: true</li>");
 } else {
 window.put(
 '  <li>Enabled: <span style="color:red"><b>false</b></span></li>');
 }

 window.put("  <li>Cookies enabled: " + mboxCookieIsEnabled() + "</li>");
 window.put("  <li>Page URL: '" + document.location + "'</li>");
 window.put("  <li>Cookies: '" + document.cookie + "'</li>");


 mboxFactoryDefault.getMboxes().each(function(K) {
 var R = K.getName();
 window.put("  <li>mbox: '" + R + "'");
 window.put("   <ul>");

 if (K.message != '') {
 window.put('   <li><span style="color: red"><b>Error: '
 + K.message + '</b></span></li>');
 }

 if (K.getDefaultDiv() == null) {
 window.put('    <li><span style="color: red">'
 + '<b>Error: cannot find mbox in dom</b></span></li>');
 }

 window.put('    <li><a href="' + K.getURL() + '">'
 + K.getURL() + '</a></li>');

 window.put("   </ul>");
 window.put("  </li>");
 });

 window.put(" </ul>");

 window.putCloseButton();
 window.putPageEnd();
};

mboxDebugWindow = function(g) {
 this.g = g + " " + document.location.hostname;

 var lc = /\W/g;
 var mc = this.g.replace(lc, '_');

 this.kc = window.open("", "mboxDebugWindow" + mc,
 "width=600,height=300,resizable,scrollbars=yes,toolbar=yes");

 if (this.kc == null) {
 alert("Unable to open Omniture Test&amp;Target's mboxDebugWindow Window.\n"
 + "Are you blocking popups?\n");
 }
};

mboxDebugWindow.prototype.put = function(oc) {
 if (this.kc == null) {
 return;
 }

 try {
 this.kc.document.writeln(oc);
 this.kc.scrollBy(0, 1000);
 } catch (e) {
 alert("Unable to write to the current mboxDebug window.\n"
 + "Please close any open debug window");
 this.kc = null;
 }
};

mboxDebugWindow.prototype.putCloseButton = function() {
 this.put("<a href=\"javascript:mboxDebugWindowClose()\">"
 + "click here to close debug window</a>");
};

mboxDebugWindow.prototype.putPageStart = function() {
 this.put("<html><head>"
 + " <title>" + this.g + "</title>"
 + "  <" + "scr" + "ipt>"
 + "   function mboxDebugWindowClose() {"
 + "     try {"
 + "       window.opener.mboxDebugger.disable();"
 + "     } catch(e) {"
 + "       alert('Could not disable debug mode.\\n'"
 + "         + 'Browse to a page containing an mbox and\\n'"
 + "         + 'click on close link.');"
 + "     }"
 + "     window.close();"
 + "   }"
 + "  <" + "\/scr" + "ipt>"
 + " </head>"
 + " <body>");
};

mboxDebugWindow.prototype.putPageEnd = function() {
 this.put("</body></html>");

 if (this.kc != null) {
 this.kc.document.close();
 }
};

if (typeof mboxDebugger == 'undefined') {
 mboxDebugger = new mboxDebug("debug",
 "mboxDebug", mboxFactoryDefault);
}
