#3 JavaScript::Eval (size: 8520, repeated: 1) ({
"stat": "ok",
"data": {
"tcookie": "c462fdd386f8f6f1ee28",
"canopy": {
"enabled": false
},
"targeting": {
"ac15": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ac20": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ac19": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ac1": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ac7": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ac4": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
},
"ic12": {
"lastvisit": 1354151369,
"site": 1,
"value": "1"
}
},
"dcc": {
"b989": 1,
"b988": 1,
"b24179": 1,
"b987": 1,
"b918": 1,
"b850": 1,
"b852": 1,
"b183": 1,
"b181": 1,
"b187": 1,
"AT=5": 1,
"AT=1": 1,
"AQ=5": 1,
"b11453": 1,
"b540": 1,
"AQ=1": 1,
"b1151": 1,
"b136": 1,
"b134": 1,
"b133": 1,
"AR=1": 1,
"c8408": 1,
"c8409": 1,
"c8402": 1,
"b26034": 1,
"c8400": 1,
"c8401": 1,
"c8406": 1,
"c8407": 1,
"c8404": 1,
"c8405": 1,
"b345": 1,
"b347": 1,
"b346": 1,
"b228": 1,
"b229": 1,
"b226": 1,
"b227": 1,
"b224": 1,
"b225": 1,
"b222": 1,
"b348": 1,
"b220": 1,
"b221": 1,
"b851": 1,
"b538": 1,
"b539": 1,
"c8338": 1,
"c8339": 1,
"c8334": 1,
"c8335": 1,
"c8336": 1,
"c8337": 1,
"c8330": 1,
"c8331": 1,
"c8332": 1,
"c8333": 1,
"c12718": 1,
"c12719": 1,
"b405": 1,
"c12377": 1,
"c12378": 1,
"b712": 1,
"b713": 1,
"b121562": 1,
"b121563": 1,
"b716": 1,
"b717": 1,
"b719": 1,
"b835": 1,
"b833": 1,
"b832": 1,
"b831": 1,
"b123827": 1,
"pc2": 1,
"pc3": 1,
"pc1": 1,
"pc6": 1,
"pc4": 1,
"pc5": 1,
"b902": 1,
"b901": 1,
"b900": 1,
"b882": 1,
"b883": 1,
"b880": 1,
"b881": 1,
"b1080": 1,
"b1081": 1,
"b1082": 1,
"b1083": 1,
"b1084": 1,
"b1086": 1,
"b1018": 1,
"b1017": 1,
"b1016": 1,
"b1015": 1,
"b1014": 1,
"b1013": 1,
"b1012": 1,
"b1011": 1,
"b1010": 1,
"c8434": 1,
"c8433": 1,
"c8432": 1,
"c8431": 1,
"c8430": 1,
"c9430": 1,
"c9431": 1,
"c9432": 1,
"c9433": 1,
"b990": 1,
"b490": 1,
"ac100": 2,
"ac101": 5,
"c8359": 1,
"b231": 1,
"b233": 1,
"b232": 1,
"b235": 1,
"b234": 1,
"b237": 1,
"b236": 1,
"b398": 1,
"b488": 1,
"b489": 1,
"b487": 1,
"c8355": 1,
"c8349": 1,
"c8348": 1,
"c8341": 1,
"c8340": 1,
"b246": 1,
"c8342": 1,
"b240": 1,
"c8344": 1,
"c8347": 1,
"b243": 1,
"b849": 1,
"b410": 1,
"b414": 1,
"b416": 1,
"b419": 1,
"b796": 1,
"b797": 1,
"b794": 1,
"b24423": 1,
"b666": 1,
"b667": 1,
"b664": 1,
"b662": 1,
"b668": 1,
"b669": 1,
"b464": 1,
"b462": 1,
"b700": 1,
"c10636": 1,
"b761": 1,
"b760": 1,
"c12682": 1,
"b780": 1,
"b808": 1,
"b809": 1,
"b802": 1,
"b803": 1,
"b807": 1,
"b805": 1,
"b24151": 1,
"b24152": 1,
"b63274": 1,
"b63272": 1,
"b63273": 1,
"b936": 1,
"b937": 1,
"b934": 1,
"b935": 1,
"c10358": 1,
"c10359": 1,
"b899": 1,
"b898": 1,
"b895": 1,
"b894": 1,
"b897": 1,
"b891": 1,
"b890": 1,
"b893": 1,
"b149618": 1,
"b149619": 1,
"b149614": 1,
"b149615": 1,
"b149616": 1,
"b149617": 1,
"b149613": 1,
"ic19": 1,
"c8403": 1,
"ic17": 1,
"ic16": 1,
"ic15": 1,
"ic14": 1,
"ic13": 1,
"ic12": 1,
"ic11": 1,
"ic10": 1,
"b26036": 1,
"b1007": 1,
"c8420": 1,
"c8421": 1,
"c8422": 1,
"c8423": 1,
"c8424": 1,
"c8425": 1,
"c8426": 1,
"c8427": 1,
"c8428": 1,
"c8429": 1,
"b149992": 1,
"b149991": 1,
"b149990": 1,
"age_bucket": 1,
"b25783": 1,
"b25785": 1,
"b498": 1,
"b552": 1,
"b553": 1,
"b555": 1,
"b556": 1,
"b557": 1,
"b491": 1,
"b559": 1,
"b493": 1,
"b492": 1,
"b494": 1,
"c8358": 1,
"b395": 1,
"c8352": 1,
"c8353": 1,
"c8350": 1,
"c8351": 1,
"c8356": 1,
"c8357": 1,
"c8354": 1,
"b399": 1,
"b244": 1,
"b245": 1,
"c8343": 1,
"c8345": 1,
"b133779": 1,
"b242": 1,
"b783": 1,
"c8346": 1,
"b671": 1,
"b670": 1,
"b672": 1,
"ac101=1": 1,
"ac101=2": 1,
"ac101=3": 1,
"ac101=4": 1,
"ac101=5": 1,
"ac102=3": 1,
"b779": 1,
"ac102=1": 1,
"b472": 1,
"b471": 1,
"ac102=4": 1,
"b774": 1,
"b775": 1,
"b776": 1,
"b777": 1,
"b43877": 1,
"b3": 1,
"b778": 1,
"ac102=2": 1,
"b349": 1,
"b604": 1,
"b605": 1,
"b606": 1,
"b607": 1,
"b601": 1,
"b602": 1,
"b603": 1,
"b608": 1,
"b959": 1,
"b24148": 1,
"ic9": 1,
"ic8": 1,
"ic3": 1,
"b920": 1,
"ic1": 1,
"b922": 1,
"ic7": 1,
"ic6": 1,
"ic5": 1,
"ic4": 1,
"b2809": 1,
"c10460": 1,
"c10461": 1,
"c10462": 1,
"c10463": 1,
"c10464": 1,
"c10465": 1,
"b815": 1,
"b811": 1,
"b810": 1,
"b813": 1,
"b812": 1,
"b149628": 1,
"b149620": 1,
"b149623": 1,
"b149622": 1,
"b149625": 1,
"b149624": 1,
"b149627": 1,
"b149626": 1,
"ic22": 1,
"ic23": 1,
"ic20": 1,
"ic21": 1,
"ic24": 1,
"b2898": 1,
"b81": 1,
"c10459": 1,
"c10458": 1,
"b17": 1,
"b1103": 1,
"b1102": 1,
"b1105": 1,
"b1104": 1,
"b1106": 1,
"b149988": 1,
"b149989": 1,
"b18": 1,
"b19": 1,
"AA": 1,
"AC": 5,
"AB": 1,
"AE": 5,
"AD": 5,
"AG": 1,
"AF": 5,
"AI": 1,
"AH": 5,
"AK": 1,
"AJ": 1,
"AM": 5,
"AL": 1,
"AO": 5,
"AN": 5,
"AQ": 1,
"AP": 5,
"c8299": 1,
"c8298": 1,
"AU": 5,
"AT": 1,
"c8293": 1,
"c8292": 1,
"c8291": 1,
"c8290": 1,
"c8297": 1,
"c8296": 1,
"c8295": 1,
"c8294": 1,
"age": 1,
"c8367": 1,
"c8366": 1,
"c8365": 1,
"c8364": 1,
"c8363": 1,
"c8362": 1,
"c8361": 1,
"c8360": 1,
"AR=5": 1,
"c8369": 1,
"c8368": 1,
"AJ=5": 1,
"AJ=1": 1,
"AI=5": 1,
"AI=1": 1,
"AS": 5,
"gender": 1,
"AM=1": 1,
"AM=5": 1,
"AN=1": 1,
"AN=5": 1,
"AA=5": 1,
"AA=1": 1,
"AB=5": 1,
"AB=1": 1,
"b534": 1,
"b6308": 1,
"AF=1": 1,
"AF=5": 1,
"b442": 1,
"b447": 1,
"b444": 1,
"AE=1": 1,
"b448": 1,
"b449": 1,
"AE=5": 1,
"b764": 1,
"b611": 1,
"b610": 1,
"b215": 1,
"b945": 1,
"c8399": 1,
"c8394": 1,
"b123818": 1,
"c8395": 1,
"AU=1": 1,
"AU=5": 1,
"b868": 1,
"b869": 1,
"b34126": 1,
"b921": 1,
"ic2": 1,
"b923": 1,
"b925": 1,
"b924": 1,
"b1112": 1,
"c8284": 1,
"c8285": 1,
"c8286": 1,
"c8287": 1,
"c8280": 1,
"c8281": 1,
"c8282": 1,
"c8283": 1,
"c8288": 1,
"c8289": 1,
"c8370": 1,
"c8371": 1,
"c8372": 1,
"c8373": 1,
"c8374": 1,
"c8375": 1,
"c8376": 1,
"c8377": 1,
"c8378": 1,
"c8379": 1,
"c8279": 1,
"c8278": 1,
"ac15": 1,
"ac14": 1,
"ac13": 1,
"ac12": 1,
"ac11": 1,
"ac10": 1,
"c8271": 1,
"c8270": 1,
"c8273": 1,
"c8272": 1,
"c8274": 1,
"ac19": 1,
"ac18": 1,
"b21956": 1,
"c8305": 1,
"c8304": 1,
"c8307": 1,
"c8306": 1,
"c8301": 1,
"c8300": 1,
"c8303": 1,
"c8302": 1,
"c8309": 1,
"c8308": 1,
"b752": 1,
"b753": 1,
"b699": 1,
"b697": 1,
"b696": 1,
"b694": 1,
"b693": 1,
"b692": 1,
"b759": 1,
"b595": 1,
"b597": 1,
"b459": 1,
"b458": 1,
"b592": 1,
"b593": 1,
"b598": 1,
"b599": 1,
"b453": 1,
"b978": 1,
"b976": 1,
"b977": 1,
"b975": 1,
"b107086": 1,
"b205": 1,
"c10363": 1,
"c10362": 1,
"c10361": 1,
"c10360": 1,
"b208": 1,
"b560": 1,
"c8387": 1,
"b562": 1,
"b565": 1,
"c8380": 1,
"b872": 1,
"b871": 1,
"b123709": 1,
"ac20": 1,
"b6459": 1,
"b49654": 1,
"b1044": 1,
"b1045": 1,
"b1046": 1,
"b1040": 1,
"b1041": 1,
"b1042": 1,
"b1043": 1,
"b1123": 1,
"b1122": 1,
"b1121": 1,
"b1120": 1,
"b568": 1,
"c8389": 1,
"c8388": 1,
"c8385": 1,
"c8384": 1,
"b563": 1,
"c8386": 1,
"c8381": 1,
"b564": 1,
"c8383": 1,
"c8382": 1,
"c8268": 1,
"c8269": 1,
"b369": 1,
"b366": 1,
"b365": 1,
"b362": 1,
"b361": 1,
"b360": 1,
"c8316": 1,
"c8317": 1,
"c8314": 1,
"c8315": 1,
"c8312": 1,
"c8313": 1,
"c8310": 1,
"c8311": 1,
"c8318": 1,
"c8319": 1,
"AO=1": 1,
"b741": 1,
"b743": 1,
"b746": 1,
"b748": 1,
"b4629": 1,
"c10357": 1,
"b428": 1,
"b421": 1,
"b422": 1,
"c12885": 1,
"c12886": 1,
"b735": 1,
"b737": 1,
"b639": 1,
"b638": 1,
"b733": 1,
"b739": 1,
"b750": 1,
"ac104": 1,
"b991": 1,
"b992": 1,
"b993": 1,
"b994": 1,
"b995": 1,
"ac102": 5,
"ac103": 1,
"b965": 1,
"b964": 1,
"b961": 1,
"b960": 1,
"b848": 1,
"b962": 1,
"b846": 1,
"b847": 1,
"b844": 1,
"b845": 1,
"b842": 1,
"b843": 1,
"b195": 1,
"b14": 1,
"b25740": 1,
"ac17": 1,
"ac16": 1,
"b149987": 1,
"b1141": 1,
"b1140": 1,
"b1139": 1,
"b1033": 1,
"b1034": 1,
"b1037": 1,
"b1038": 1,
"ic18": 1,
"b371": 1,
"c8419": 1,
"c8418": 1,
"c8277": 1,
"c8411": 1,
"c8410": 1,
"c8413": 1,
"c8412": 1,
"c8415": 1,
"c8414": 1,
"c8417": 1,
"c8416": 1,
"ac3": 1,
"ac2": 1,
"ac1": 1,
"ac7": 1,
"ac6": 1,
"ac5": 1,
"ac4": 1,
"ac9": 1,
"ac8": 1,
"b213": 1,
"b212": 1,
"b211": 1,
"b210": 1,
"b216": 1,
"c8398": 1,
"b214": 1,
"c8396": 1,
"c8397": 1,
"b219": 1,
"b218": 1,
"c8392": 1,
"c8393": 1,
"c8390": 1,
"c8391": 1,
"b358": 1,
"b359": 1,
"b357": 1,
"b355": 1,
"AR": 1,
"AL=5": 1,
"AL=1": 1,
"ac104=1": 1,
"AS=1": 1,
"b25617": 1,
"AS=5": 1,
"c8323": 1,
"c8322": 1,
"c8321": 1,
"c8320": 1,
"c8327": 1,
"c8326": 1,
"c8325": 1,
"c8324": 1,
"b507": 1,
"c8329": 1,
"c8328": 1,
"AP=1": 1,
"AP=5": 1,
"AD=5": 1,
"AD=1": 1,
"ac100=1": 1,
"ac100=2": 1,
"AK=1": 1,
"c8276": 1,
"c12721": 1,
"c12720": 1,
"AK=5": 1,
"AH=1": 1,
"AH=5": 1,
"ac103=1": 1,
"b438": 1,
"b433": 1,
"AO=5": 1,
"b435": 1,
"AC=1": 1,
"AC=5": 1,
"ac102=5": 1,
"AG=5": 1,
"AG=1": 1,
"b721": 1,
"b640": 1,
"b641": 1,
"b642": 1,
"c10646": 1
},
"categories": {
"ac15": "1",
"ac20": "1",
"ac19": "1",
"ac1": "1",
"ac7": "1",
"ac4": "1",
"ic12": "1"
}
}
}) |
#4 JavaScript::Eval (size: 134283, repeated: 1) var _gLang = {
noPass: "Please provide a password. ",
noName: "Please provide a username. ",
signOff: "Sign off",
goOnline: "Go online",
signIn: "Sign in",
connecting: "Connecting",
loadingLink: "loading link..."
};
if (!gLang) var gLang = _gLang;
else copyProperties(gLang, _gLang);
gCIM.time("jssb0");
var lib = {};
function Class(a, b, c) {
typeof a != "string" && (c = b, b = a, a = null);
b = c ? Class.extend(b, c) : Class.create(b);
a && (c = a.lastIndexOf("."), Class.getObject(a.slice(0, Math.max(c, 0)))[a.slice(c + 1)] = b);
return b
}
function Singleton(a, b) {
return new(Class(a, b))
}
Class.create = function(a) {
function b() {
if (typeof this.initialize == "function") return this.initialize.apply(this, arguments)
}
function c(b, c, f) {
var g = a;
for (f || (f = []); g = g.prototype;) if (g[c]) return g[c].apply(b, f);
throw Error("method does not exist");
}
b.prototype = new a(c);
b.prototype.constructor = b;
b.prototype.supr = c;
return b
};
Class.extend = function(a, b) {
b.prototype = a.prototype;
return Class.create(b)
};
Class.category = function(a, b) {
var c = new b(a.prototype.supr);
for (property in c) a.prototype[property] = c[property]
};
Class.getObject = function(a, b) {
var c = a.split(".");
b || (typeof window == "undefined" ? (b = eval(c[0] + " = typeof " + c[0] + ' == "undefined" ? {} : ' + c[0] + ";"), c.shift()) : b = window);
for (; c.length;) {
var d = c.shift();
d && (b[d] || (b[d] = {}), b = b[d])
}
return b
};
Class.objectExists = function(a) {
for (var a = a.split("."), b = window; a.length;) if (b = b[a.shift()], !b) return !1;
return !0
};
Class.compose = function(a, b) {
for (var c = Class.extend(a, function() {}); b.length;) Class.category(c, b.shift());
return c
};
Class("lib.Publisher", function() {
this.initialize = function() {
this.m_subscribers = {}
};
this.subscribe = function(a, b, c) {
this._subscribe(a, b, c, Array.prototype.slice.call(arguments, 3));
return this
};
this.subscribeOnce = function(a, b, c) {
this._subscribe(a, b, c, Array.prototype.slice.call(arguments, 3), !0);
return this
};
this._subscribe = function(a, b, c, d, e) {
b || (b = this);
a = this.m_subscribers[a] || (this.m_subscribers[a] = []);
b = {
context: b,
callback: c,
fn: null,
args: d,
once: e
};
return a[a.length] = b
};
this.unsubscribe = function(a, b, c) {
if (!b) return this.m_subscribers[a] = [], this;
for (var a = this.m_subscribers[a] || (this.m_subscribers[a] = []), d = a.length - 1, e; e = a[d]; d--) e.context == b && (!c || e.callback == c) && a.splice(d, 1);
return this
};
this.publish = function(a) {
for (var b = (this.m_subscribers[a] || (this.m_subscribers[a] = [])).slice(0), c = Array.prototype.slice.call(arguments, 1), d = 0, e; e = b[d]; d++) {
if (typeof e.callback != "function" && !e.fn) e.fn = hitch(e.context, e.callback);
try {
(e.fn || e.callback).apply(e.context, e.args.concat(c))
} catch (f) {}
e.once === !0 && this.unsubscribe(a, e.context, e.callback)
}
return this
};
this.publishDeferred = function(a) {
for (var b = new lib.deferred, c = this.m_subscribers[a] || (this.m_subscribers[a] = []), d = 0, e; e = c[d]; d++) b.addBoth(hitch(e.context, e.callback));
c = Array.prototype.slice.call(arguments, 1);
b.callback.apply(b, c);
return b
}
});
Class("lib.Callback", function() {
this.m_wasFired = !1;
this.initialize = function() {
this.m_cbs = [];
this.m_waitingOn = this.m_id = 0;
this.m_stat = {}
};
this.wasFired = function() {
return this.m_wasFired
};
this.reset = function() {
this.m_args = [];
this.m_wasFired = !1
};
this.add = function(a, b) {
var c = b ? hitch.apply(this, arguments) : a;
c && (this.m_wasFired ? c.apply(this, this.m_args) : this.m_cbs.push(c));
return this
};
this.fire = function() {
if (!this.m_wasFired) {
this.m_wasFired = !0;
var a = this.m_cbs;
this.m_cbs = [];
this.m_args = arguments;
for (var b = 0, c = a.length; b < c; ++b) a[b] && a[b].apply(this, arguments)
}
};
this._decr = function(a) {
this.m_stat.hasOwnProperty(a) || (this.m_stat[a] = Array.prototype.slice.call(arguments, 1), this.m_waitingOn && --this.m_waitingOn, this.m_waitingOn || this.fire(this.m_stat))
};
this.getCallback = function(a) {
++this.m_waitingOn;
this.reset();
return hitch(this, "_decr", a || this.m_id++)
};
this.waiting = function() {
return !!this.m_waitingOn
}
});
Class("lib.ResourceManager", function() {
this.m_limit = null;
this.m_count = 0;
this.m_isRecyclable = !0;
this.initialize = function(a) {
this.m_create = a;
this.m_queue = [];
this.m_pending = []
};
this.getOne = function(a) {
this.m_queue.length ? a(this.m_queue.shift()) : this.m_limit == null || this.m_count < this.m_limit ? (this.m_count++, this.m_create(a)) : this.m_pending[this.m_pending.length] = a
};
this.add = this.recycle = function(a) {
this.m_isRecyclable && (this.m_pending.length ? this.m_pending.shift()(a) : this.m_queue.push(a))
};
this.setLimit = function(a) {
this.m_limit = a
};
this.setRecyclable = function(a) {
this.m_isRecyclable = a
};
this.allocate = function(a) {
for (var b = hitch(this, "recycle"), c = 0; c < a; ++c) {
if (this.m_count >= this.m_limit) break;
this.m_count++;
this.m_create(b)
}
}
});
typeof util == "undefined" && (util = {});
function hitch(a, b) {
function c() {
return (typeof b == "function" ? b : a[b]).apply(a, d.concat(Array.prototype.slice.call(arguments)))
}
var d = Array.prototype.slice.call(arguments, 2);
c.methodName = b;
return c
}
function hitchOnly(a, b) {
function c() {
return (typeof b == "function" ? b : a[b]).apply(a, d)
}
var d = Array.prototype.slice.call(arguments, 2);
c.methodName = b;
return c
}
function isDefined(a) {
return typeof a != "undefined"
}
function isTypeOf(a, b) {
return b == Object.prototype.toString.call(a).slice(8, -1).toLowerCase()
}
function isNumber(a) {
return isTypeOf(a, "number")
}
function isFunction(a) {
return isTypeOf(a, "function")
}
function isString(a) {
return isTypeOf(a, "string")
}
function isArray(a) {
return isTypeOf(a, "array")
}
function callee(a) {
var b = a.callee,
c = this;
return function() {
return b.apply(c, a)
}
}
function shallowCopy(a) {
var b = {},
c;
for (c in a) b[c] = a[c];
return b
}
function argsToArray(a, b) {
return Array.prototype.slice.call(a, b || 0)
}
function objectToArray(a) {
if (!a) return [];
var b = [],
c;
for (c in a) a.hasOwnProperty(c) && (b[b.length] = a[c]);
return b
}
function arrayToObject(a) {
if (!a) return {};
for (var b = {}, c = 0; c < a.length; c++) b[String(a[c])] = a[c];
return b
}
function isEmpty(a) {
if (!a) return !0;
for (var b in a) if (a[b] != null) return !1;
return !0
}
function copyProperties(a, b) {
var c = !1,
d;
for (d in b) a[d] != b[d] && (a[d] = b[d], c = !0);
return c
}
function doFunctions(a) {
if (!a) return !0;
var b = argsToArray(arguments);
b && (b = b.slice(1));
for (var c = !0, d = 0; d < a.length; d++) if (a[d]) var e = a[d].apply(this, b),
c = c && (typeof e != "boolean" || e);
return c
}
function sprintf() {
var a = arguments,
b = a.length,
c = a[0];
return !c ? void 0 : c.replace(sprintf.identifiers, function(c, e) {
if (e == "%") return "%";
e = parseInt(e);
return !isNaN(e) && e < b ? a[e] : c
})
}
sprintf.identifiers = /%(\d+|%)/g;
function runInMainContext() {
var a = hitch.apply(this, arguments);
setTimeout(function() {
try {
a()
} catch (b) {}
}, 0)
}
function createDelayedMethod(a, b, c) {
var d = function() {
this[a] = delayedMethod(this, b, c);
this[a].apply(this, arguments)
};
d.cancel = function() {};
return d
}
delayedMethod = function(a, b, c) {
var c = c || 0,
d = function() {
d.m_args = arguments;
if (!(c == 0 && d.m_timeout != null)) d.m_timeout && d.m_timeout.clear(), d.m_timeout = new util.Timeout(d.run, c)
};
d.run = function() {
d.cancel();
b.apply(a, d.m_args)
};
d.cancel = function() {
if (d.m_timeout) d.m_timeout.clear(), d.m_timeout = null
};
d.m_timeout = null;
return d
};
function createHandler(a) {
var b = "m_on" + a;
this[b] || (this[b] = []);
this["addOn" + a] = function(a) {
this[b].push(a);
return a
};
this["removeOn" + a] = function(a) {
if (a) for (var d = this[b].length; d >= 0; d--) {
if (this[b][d] == a) {
this[b].splice(d, 1);
break
}
} else this[b] = []
};
this["on" + a] = function() {
var a = argsToArray(arguments);
a.splice(0, 0, this[b].slice());
doFunctions.apply(null, a)
}
}
function createSetter(a, b) {
return function(c) {
if (this["m_" + a] != c) {
var d = this["m_" + a];
this["m_" + a] = c;
b && gPubSub.publish(this, b, c, d)
}
}
}
function memoize(a, b) {
var c = null,
d = null;
return function() {
if (!d || !a.call(this, d || [], arguments)) c = b.apply(this, arguments);
d = arguments;
return c
}
}
util.bcookie = {
value: null
};
util.bcookie.get = function() {
if (this.value) return this.value;
var a = util.cookie.load("bcookie") || util.storage.load("bcookie");
if (!a || a == "undefined") a = this.generate(), util.storage.save("bcookie", a), util.cookie.save("bcookie", a), (util.cookie.load("bcookie") || util.storage.load("bcookie")) != a && (a += "_nd");
return this.value = a
};
util.bcookie.generate = function() {
for (var a = ""; a.length < 20;) a += Math.floor(Math.random() * 1E9).toString(16);
return a = a.substr(0, 20)
};
util.bcookie.isDeDupable = function(a) {
return a && a.indexOf("_nd") == -1
};
util.cookie = {};
util.cookie.save = function(a, b, c, d, e) {
typeof c != "number" && !(c instanceof Date) && (c = 31536E6);
var f;
c instanceof
Date ? f = c : c >= 0 && (f = new Date, f.setTime(f.getTime() + c));
c = f ? "expires=" + f.toGMTString() + "; " : "";
a = a + "=" + encodeURIComponent(b) + "; ";
d = "domain=" + (d || (/(\.|^)meebo\.com$/i.test(document.domain) ? ".meebo.com" : document.domain)) + "; ";
document.cookie = a + c + d + "path=/; " + (e ? "secure; " : "")
};
util.cookie.erase = function(a, b) {
util.cookie.save(a, "", new Date(1), b, !1)
};
util.cookie.eraseFromDomains = function(a) {
for (var b = window.location.hostname.split("."), c = 0, d = b.length; c < d; ++c) {
var e = b.slice(c).join(".");
util.cookie.erase(a, e)
}
};
util.cookie.load = function(a) {
var b = document.cookie;
return b.length && (a = RegExp("(?:^|;)\\s*" + a + "=(.*?)(?:;|$)").exec(b)) && a.length ? decodeURIComponent(a[1]) : null
};
util.cookie.isEnabled = function() {
if (typeof util.cookie._enabled != "undefined") return util.cookie._enabled;
var a = location.hostname;
util.cookie.save("test", "test", 3E3, a);
util.cookie.load("test") == "test" ? (util.cookie.erase("test", a), util.cookie._enabled = !0) : util.cookie._enabled = !1;
return util.cookie._enabled
};
util.dom = {};
function $(a) {
for (var b = 0, c; c = $.docs[b]; b++) try {
var d = c.getElementById(a);
if (d) return d
} catch (e) {}
}
$.docs = [document];
$.remember = function(a) {
for (var b = 0; b < $.docs.length; ++b) if (a === $.docs[b]) return;
$.docs.push(a)
};
$.forget = function(a) {
for (var b = [], c = 0; c < $.docs.length; ++c) $.docs[c] !== a && b.push($.docs[c]);
$.docs = b
};
function gDoc(a) {
if (a) {
if (a.ownerDocument) return a.ownerDocument;
else if (a.document) return a.document;
else if (typeof a.nodeName == "string") if (a.nodeName.match(/document/i)) return a;
else if (gWin.isWindow(a)) return a.document;
if (a = a.target || a.srcElement) return gDoc(a)
}
return gDoc._doc
}
gDoc._doc = document;
function gWin(a) {
if (gWin.wins.length == 1) return gWin.wins[0];
if (gWin.isWindow(a)) return a;
for (var a = gDoc(a), b = 0; b < gWin.wins.length; b++) if (gWin.wins[b].document === a) return gWin.wins[b];
return a.parentWindow || a.defaultView || gWin.wins[0]
}
gWin.wins = [window];
gWin.isWindow = function(a) {
var b = !1;
try {
b = a && typeof a.screen == "object"
} catch (c) {
b = !0
}
return b
};
gWin.map = function(a) {
for (var b = 0; b < gWin.wins.length; ++b) a(gWin.wins[b])
};
gWin.remember = function(a) {
if (!isDefined(a._gWinPos)) a._gWinPos = gWin.wins.length, gWin.wins.push(a)
};
gWin.forget = function(a) {
if (isDefined(a._gWinPos)) {
gWin.wins.splice(a._gWinPos, 1);
for (var b = a._gWinPos; b < gWin.wins.length; b++) gWin.wins[b]._gWinPos = b;
try {
delete a._gWinPos
} catch (c) {}
}
};
function recursiveGetPart(a, b) {
if (a && b && a.hasChildNodes()) {
for (var c = a.firstChild; c;) {
if (c.id == b) return c;
var d = recursiveGetPart(c, b);
if (d) return d;
c = c.nextSibling
}
return null
}
}
function posWithRespectTo(a, b) {
var c = {
x: 0,
y: 0,
w: 0,
h: 0
};
if (a) c.w = a.offsetWidth, c.h = a.offsetHeight;
for (var d = a; d;) {
if (d === b) break;
c.x += d.offsetLeft;
c.y += d.offsetTop;
d != a && (c.x -= d.scrollLeft, c.y -= d.scrollTop);
d = d.offsetParent
}
c.left = c.x;
c.top = c.y;
return c
}
function getElementPosition(a) {
if (a) {
var b = gDoc(a),
a = posWithRespectTo(a);
if (navigator.userAgent.indexOf("Mac") != -1 && isDefined(b.body.leftMargin)) a.x += b.body.leftMargin, a.left = a.x, a.y += b.body.topMargin, a.top = a.y;
return a
}
}
function getElementOffset(a, b) {
var b = b || window,
c = a.getBoundingClientRect(),
d = a.ownerDocument,
e = d.body,
f = d.documentElement,
g = f.clientTop || e.clientTop || 0,
e = f.clientLeft || e.clientLeft || 0,
d = getScroll(b, d);
return {
y: c.top + d.top - g,
x: c.left + d.left - e,
w: c.right - c.left,
h: c.bottom - c.top
}
}
function getScroll(a, b) {
a = a || window;
b = b || a.document;
return {
top: a.pageYOffset || b.documentElement.scrollTop || b.body.scrollTop,
left: a.pageXOffset || b.documentElement.scrollLeft || b.body.scrollLeft
}
}
function getPartFromElement(a, b) {
if (a) return recursiveGetPart(a, b)
}
function removeChildren(a) {
if (a) for (var b; b = a.firstChild;) a.removeChild(b);
return a
}
function removeElement(a) {
try {
return !a || !a.parentNode ? a : a.parentNode.removeChild(a)
} catch (b) {
return util.css.setStyle(a, {
visibility: "hidden"
}, cim.world), a
}
}
util.dom.resizeFont = function(a, b, c) {
for (b = b.clientWidth; a.offsetWidth > b;) c--, util.css.setStyle(a, {
fontSize: c + "px"
}, cim.world)
};
util.dom.getAttribute = function(a, b) {
try {
return a.getAttribute ? a.getAttribute(b) : ""
} catch (c) {}
};
util.dom.insertBefore = function(a, b, c) {
return !a || !b ? void 0 : c ? a.insertBefore(b, c) : a.appendChild(b)
};
util.dom.insertAfter = function(a, b, c) {
a && b && (c ? c.nextSibling ? a.insertBefore(b, c.nextSibling) : a.appendChild(b) : a.firstChild ? a.insertBefore(b, a.firstChild) : a.appendChild(b))
};
util.dom.getDescElement = function(a, b) {
for (; b.length && a;) a = a.children[b.shift()];
return a
};
var g_currentUniqueId = 1;
function getUniqueId() {
return String(++g_currentUniqueId)
}
util.css = {};
function addClassName(a, b) {
var c = typeof a == "string";
if ((c || a) && b) {
var d = c ? a : a.className;
(" " + d + " ").indexOf(" " + b + " ") == -1 && (d += (d ? " " : "") + b);
if (!c) a.className = d;
return d
}
}
function addClassNames(a) {
for (var b = 1; b < arguments.length; b++) addClassName(a, arguments[b])
}
function removeClassName(a, b) {
var c = typeof a == "string";
if ((c || a) && b) {
var d = c ? a : a.className,
d = (" " + d + " ").replace(" " + b + " ", " ").replace(/^\s+|\s+$/g, "");
if (!c) a.className = d;
return d
}
}
function removeClassNames(a) {
for (var b = 1; b < arguments.length; b++) removeClassName(a, arguments[b])
}
function toggleClassName(a, b, c) {
b ? addClassName(a, c) : removeClassName(a, c)
}
function hasClassName(a, b) {
var c = typeof a == "string";
if ((c || a) && b) return (" " + (c ? a : a.className) + " ").indexOf(" " + b + " ") != -1
}
function roundElementCorners(a) {
if (ui.isFirefox || ui.isWebKit) addClassName(a, "roundCorners");
else {
var b = gDoc(a),
c = a.parentNode,
d = b.createElement("div");
c.removeChild(a);
d.appendChild(a);
c.appendChild(d);
addClassName(d, "stackedCorners");
addClassName(a, "stackedContent");
c = b.createElement("b");
d = b.createElement("b");
addClassName(c, "stack-top");
addClassName(d, "stack-bot");
for (var e = 1; e <= 3; e++) {
var f = b.createElement("b");
addClassName(f, "roundCorner stack" + e);
c.appendChild(f)
}
for (e = 3; e >= 1; e--) f = b.createElement("b"), addClassName(f, "roundCorner stack" + e), d.appendChild(f);
b = a.firstChild;
b || (b = a.ownerDocument.createElement("div"), a.appendChild(b));
util.css.setStyle(b, {
padding: "0 1px 0"
}, cim.world);
a.parentNode.insertBefore(c, a);
a.parentNode.appendChild(d)
}
}
util.css.getCSSProperty = function(a) {
return a.replace(/[A-Z]/g, function(a) {
return "-" + a.toLowerCase()
})
};
util.css.getDOMProperty = function(a) {
var b;
if (a == "float") a = ui.isIE ? "styleFloat" : "cssFloat";
else if (b = /^Ms([A-Z].*)$/.exec(a)) a = "ms" + b[1];
return a
};
util.css.getRelatedRules = function(a, b) {
var c = {},
d = !0;
arguments.length < 2 && (d = !1, b = !0);
switch (a) {
case "overflow":
c.overflowX = b;
c.overflowY = b;
break;
case "borderRadius":
c.WebkitBorderRadius = b;
c.MozBorderRadius = b;
break;
case "transform":
c.WebkitTransform = b;
c.MozTransform = b;
c.MsTransform = b;
break;
case "opacity":
if (ui.IECompat && ui.IECompat < 9) d ? (d = Math.max(Math.min(b, 1), 0) * 100, d >= 100 ? (c.MsFilter = '""', c.filter = "none") : (c.MsFilter = '"alpha(opacity=' + d + ')"', c.filter = "alpha(opacity=" + d + ")")) : (c.filter = b, c.MsFilter = b)
}
c[a] = b;
return c
};
util.css.setStyle = function(a, b, c) {
var d = a.style,
e = d.setProperty,
f = !e && c,
g = [],
h;
for (h in b) {
var i = util.css.getRelatedRules(h, b[h]),
j;
for (j in i) {
var k = i[j].toString();
e ? d.setProperty(util.css.getCSSProperty(j), k, c ? "important" : "") : c ? g.push(util.css.getCSSProperty(j) + ": " + k) : d[util.css.getDOMProperty(j)] = k
}
}
f && (g.push(""), d.cssText += "; " + g.join(" !important; "));
return a
};
util.css.removeStyle = function(a, b) {
var c = a.style,
d;
for (d in b) {
var e = util.css.getRelatedRules(d),
f;
for (f in e) c.removeProperty ? c.removeProperty(util.css.getCSSProperty(f)) : c[util.css.getDOMProperty(f)] = ""
}
return a
};
util.css.colorHexToDec = function(a) {
var b = [],
c = !1;
a[0] == "#" && (a = a.substr(1));
if (a.length == 3) c = !0;
else if (a.length != 6) throw "Invalid color string";
for (var d = 0; d < 3; d++) {
var e = c ? 1 : 2,
e = parseInt(a.substr(e * d, e), 16);
c && (e += e << 4);
b.push(e)
}
return b
};
Class("util.URL", function() {
this.initialize = function(a) {
if (a = String(a || "").match(/^([^:\/?#]+:)?(?:\/\/)?([^\/?#]*)([^?\s#]*)?(\?([^#]*))?(#(.*))?$/)) this.protocol = a[1], this.host = a[2], this.pathname = a[3], this.search = a[5] || "", this.hash = a[7]
};
this.get = function(a, b) {
var c = this[a];
return a == "search" || a == "hash" ? (c = util.url.uriToObject(c), b ? c[b] : c) : c
};
this.getSearch = function(a) {
return this.get("search", a)
};
this.getHash = function(a) {
return this.get("hash", a)
};
this.getRelativeUrl = function() {
var a = "";
this.pathname && (a += this.pathname);
this.search && (a += "?" + this.search);
this.hash && (a += "#" + this.hash);
return a
};
this.addTo = function(a, b) {
if (b) {
var c = util.url.uriToObject(this[a]),
d;
for (d in b) c[d] = b[d];
this[a] = util.url.objectToURI(c)
}
return this
};
this.addToHash = function(a) {
return this.addTo("hash", a)
};
this.addToSearch = function(a) {
return this.addTo("search", a)
};
this.relativeTo = function(a) {
if (!this.protocol && (a = util.url(a), this.protocol = a.protocol, !this.host)) this.host = a.host;
return this
};
this.setProtocol = function(a) {
this.protocol = a;
return this
};
this.setHost = function(a) {
this.host = a;
return this
};
this.setPath = function(a) {
this.pathname = a;
return this
};
this.toJSON = this.toString = function() {
var a = "";
this.protocol && (a += this.protocol);
this.host && (a += "//" + this.host);
a += this.getRelativeUrl();
return a
}
});
util.url = function(a) {
return new util.URL(a)
};
util.url.uriToObject = function(a) {
if (!a) return {};
for (var b = {}, a = a.split("&"), c = 0; c < a.length; c++) {
var d = a[c].split("=");
b[decodeURIComponent(d[0])] = d[1] && decodeURIComponent(d[1]) || d[1]
}
return b
};
util.url.objectToURI = function(a) {
var b = [],
c;
for (c in a) b.push(encodeURIComponent(c) + (a.hasOwnProperty(c) ? "=" + encodeURIComponent(a[c]) : ""));
return b.join("&")
};
Class("util.postMessage", lib.Publisher, function(a) {
this.initialize = function(b, c, d, e) {
a(this, "initialize", arguments);
this.m_channelName = b;
this.m_origin = d;
this.m_listener = e || window;
this.setTarget(c);
this.setPrefix(b);
this.m_prefixLength = this.m_prefix.length;
this.m_callback = hitch(this, this.onMessage);
this.openChannel()
};
this._formatPrefix = function(a) {
return a.replace(/\\:/g, function(a) {
return "\\" + a
}) + ":"
};
this.setTarget = function(a) {
this.m_target = a
};
this.setPrefix = function(a) {
this.m_prefix = this._formatPrefix(a)
};
this.setSendPrefix = function(a) {
this.m_sendPrefix = this._formatPrefix(a)
};
this.send = function(a) {
this.m_target.postMessage((this.m_sendPrefix || this.m_prefix) + a, this.m_origin)
};
this.openChannel = function() {
ui.attachEvent(this.m_listener, "message", this.m_callback)
};
this.closeChannel = function() {
ui.detachEvent(this.m_listener, "message", this.m_callback)
};
this.onMessage = function(a) {
var c = a.data;
c.substr(0, this.m_prefixLength) == this.m_prefix && this.publish("message", a.origin || "http://" + a.domain, c.substr(this.m_prefixLength))
};
this.resetMessageCount = function() {}
});
util.postMessage.enabled = !! window.postMessage;
Class("util._Timer", function() {
this.initialize = function(a, b) {
this.m_win = window;
a && this.run(a, b)
};
this.run = function(a, b) {
this.m_timer = this.m_win["set" + this.m_type](function() {
a()
}, b)
};
this.clear = function() {
if (this.m_timer) this.m_win["clear" + this.m_type](this.m_timer), this.run = this.m_timer = null
}
});
Class("util.Timeout", util._Timer, function() {
this.m_type = "Timeout"
});
Class("util.Interval", util._Timer, function() {
this.m_type = "Interval"
});
util.verifyDomain = function(a) {
var a = util.url(a).host,
b = typeof gVerifiedDomains != "undefined" ? gVerifiedDomains : [];
if (!b.length) return !0;
for (var c = 0, d; d = b[c]; c++) if (RegExp("(^|[.])" + d.replace(/\./g, "\\.") + "$", "i").test(a)) return !0;
return !1
};
util.script = function(a) {
var a = a || {},
b = a.callback ||
function() {}, c = "remove" in a ? a.remove : !0, d = "src" in a, e = (a.window || window).document, f = e.createElement("script"), g = !1, h = function() {
g || (g = !0, c && removeElement(f), b(f))
};
f.type = "text/javascript";
f.async = !0;
if (a.text) f.text = a.text;
if (d) f.src = String(a.src), f.onload = h, f.onreadystatechange = function() {
(f.readyState == "loaded" || f.readyState == "complete") && h()
};
e.getElementsByTagName("head")[0].appendChild(f);
d || h()
};
util.openPopup = function(a, b) {
var a = a || {},
c = calcWinPos(window),
d = a.loadingMsg,
e = a.url,
f = a.id = (a.id || "W" + getUniqueId()).replace(/[^A-Za-z0-9]/g, "_"),
g = Math.max(c.w - 200, 800),
h = Math.max(c.h - 150, 600),
g = {
menubar: "no",
location: "no",
toolbar: "no",
scrollbars: "yes",
status: "yes",
width: g,
height: h,
left: Math.max(c.x + 50, c.x + Math.floor((c.w - g) / 2)),
top: Math.max(c.y + 50, c.y + Math.floor((c.h - h) / 2)),
resizable: "yes"
},
c = [],
i;
for (i in g) if (!b || i in a) c.push(i + "=" + (i in a ? a[i] : g[i]));
e || (e = "", gCIM.domain && (e = "document.domain='" + gCIM.domain + "';"), e = "javascript:document.open();" + e + "document.write(\"<html><body style='font:13px tahoma,sans-serif'>" + (d || gLang.loadingLink) + '");');
try {
var j = window.open(e, f, c.join(","));
j && j.focus()
} catch (k) {}
return j
};
util.getConnectWinParams = function(a, b, c, d) {
var d = d || {},
a = calcWinPos(a),
e = Math,
d = {
width: d.width || 390,
height: d.height || 354,
loadingMsg: gLang.connecting + "\u2026",
left: a.x + e.max(e.floor((a.w - 390) / 2), 0),
top: a.y + e.max(e.floor((a.h - 354) / 2), 0)
};
if (b) d.id = b;
if (c) d.url = c;
return d
};
util.flash = {};
util.flash.m_version = null;
util.flash.getVersion = function() {
if (util.flash.m_version) return util.flash.m_version;
var a = [0, 0, 0];
try {
if (navigator.plugins && navigator.mimeTypes.length) {
var b = navigator.plugins["Shockwave Flash"];
b && b.description && (a = b.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."))
} else {
try {
var c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
} catch (d) {
try {
c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"), a = [6, 0, 21], c.AllowScriptAccess = "always"
} catch (e) {
return a[0] = 4, a
}
try {
c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
} catch (f) {}
}
c != null && (a = c.GetVariable("$version").split(" ")[1].split(","))
}
} catch (g) {}
return util.flash.m_version = {
major: a[0],
minor: a[1],
rev: a[2]
}
};
util.flash.m_movieId = 0;
util.flash.embed = function(a) {
a.win = a.win || gWin(a.parent);
a.width = a.width || 1;
a.height = a.height || 1;
a.wmode = a.wmode || "transparent";
a.id = a.id || "meeboFlashMovie" + util.flash.m_movieId++;
a.flashVars = a.flashVars || {};
if (a.onReady) {
if (!a.win.__meeboFlashCallbackManager) a.win.__meeboFlashCallbackManager = new lib.CallbackManager;
var b = a.win.__meeboFlashCallbackManager.scheduleCallback(a.onReady);
a.flashVars.callback = b
}
var b = a.win.document,
c = b.createElement("div");
a.style && util.css.setStyle(c, a.style, cim.world);
var d = util.url.objectToURI(a.flashVars),
e = a.parent || b.body,
d = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="' + a.id + '" width="' + a.width + '" height="' + a.height + '" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="' + a.swfUrl + '" /><param name="quality" value="high" /><param name="wmode" value="' + a.wmode + '" /><param name="FlashVars" value="' + d + '" /><embed wmode="' + a.wmode + '" src="' + a.swfUrl + '" FlashVars="' + d + '" quality="high" width="' + a.width + '" height="' + a.height + '" swLiveConnect=true id="' + a.id + '" name="' + a.id + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" /></object>';
a.insertBefore ? e.insertBefore(c, a.insertBefore) : e.appendChild(c);
c.innerHTML = d;
b = ui.isIE && ui.isIE < 9 ? a.win[a.id] : b[a.id];
if (!b && a.onError) a.onError();
return b
};
util.flash.getParent = function(a) {
for (; a = a.parentNode;) if (a.tagName == "DIV") return a
};
util.localSessionStorage = Singleton(function() {
this.m_sessionStorageName = "sessionstorage";
this.m_expiration = 36E5;
this.save = function(a, b, c) {
var d = this._loadStore();
d.data[a] = b;
c > 0 && (d.data[a + "__expiration__"] = (new Date).getTime() + c);
this._saveStore(d)
};
this.erase = function(a) {
var b = this._loadStore();
delete b.data[a];
this._saveStore(b)
};
this.load = function(a) {
var b = this._loadStore();
return b.data[a + "__expiration__"] < (new Date).getTime() ? null : b.data[a]
};
this._loadStore = function() {
var a;
try {
a = JSON.parse(util.storage.load(this.m_sessionStorageName)) || {}
} catch (b) {
a = {}
}
a.expiration < (new Date).getTime() && (a = {});
a.expiration = (new Date).getTime() + this.m_expiration;
a.data = a.data || {};
return a
};
this._saveStore = function(a) {
util.storage.save(this.m_sessionStorageName, JSON.stringify(a))
}
});
net = {
getTransportLayer: function() {
return this.m_transportLayer
},
use: function(a) {
this.m_transportLayer = a
},
post: function(a, b) {
a.method = "POST";
this.request(a, b)
},
get: function(a, b) {
a.method = "GET";
this.request(a, b)
},
abort: function(a) {
a && a.transport && a.transport.abort(a)
}
};
net.request = function(a, b) {
a.inflight && net.abort(a);
a.timestamp = (new Date).getTime();
a.aborted = !1;
a.id = null;
if (!a.transport) a.transport = this.m_transportLayer;
return a.transport.request(a, b)
};
net.abortOnTimeout = function(a, b) {
if (a.timeout > 0) a.timeoutTimer = setTimeout(function() {
net.abort(a);
b && b(null, new net.RequestError("request timed out", 1))
}, a.timeout)
};
net.clearTimeout = function(a) {
clearTimeout(a.timeoutTimer)
};
net.buildGetQuery = function(a) {
var b = a.url.split("?"),
c = this.buildQuery(a, b[1]);
return !c ? a.url : b[0] + "?" + c
};
net.buildQuery = function(a, b) {
var c = window.isArray ||
function(a) {
return a instanceof Array
}, d = [], e = encodeURIComponent;
b && d.push(b);
for (var f in a.args) if (f == "sessionKey") d.unshift(e(f) + "=" + e(a.args[f]));
else {
var g = a.args[f];
c(g) || (g = [g]);
for (var h = 0; h < g.length; h++) d.push(e(f) + "=" + e(g[h]))
}
return d.join("&")
};
net.Request = function(a) {
return {
inflight: !1,
aborted: !1,
err: null,
responseType: null,
args: a || {},
sync: !1,
timeout: 2E4,
timeoutTimer: null,
timestamp: null,
url: null,
transport: null
}
};
typeof net == "undefined" && (net = {});
net.REQUEST_ERROR = 1;
net.SERVER_ERROR = 2;
net.EVAL_ERROR = 3;
net.RequestError = function(a, b) {
return {
msg: a,
code: b
}
};
net.XHRTransport = new function() {
function a(a, b) {
if (a.readyState != 4) return null;
var e = a.status;
if (e >= 400 && e < 600) throw new net.RequestError("status was 5xx", 2);
if (e != 200) throw new net.RequestError("status was " + e, 1);
var e = b.responseType,
f = (a.getResponseHeader("Content-Type") || "").match(/[-a-z]+\/[-a-z]+/i);
if (f) f = f[0];
else if (!e) throw new net.RequestError("could not access content type", 1);
try {
var g = f == "text/xml" ? a.responseXML : a.responseText
} catch (h) {
throw new net.RequestError("could not examine responseText", 1);
}
if (e != "text/plain") if (e == "application/json") try {
g = eval("(" + g + ")")
} catch (i) {
throw e = new net.RequestError("eval error", 3), e.e = i, e.response = g, e;
} else(f == "text/javascript" || f == "application/javascript" || f == "application/x-javascript") && eval(g);
return g
}
function b(b, d, e) {
if (!d.aborted) try {
var f = a(b, d);
if (f != null) net.clearTimeout(d), d.inflight = !1, e(f), this.recycleXHR(b)
} catch (g) {
if (typeof net != "undefined") net.clearTimeout(d), d.inflight = !1, e(null, g)
}
}
this.m_id = 0;
this.m_xhrs = {};
this.XHRResource = new lib.ResourceManager(function(a) {
try {
var b = new XMLHttpRequest
} catch (e) {}
try {
b = b || new ActiveXObject("Msxml2.XMLHTTP")
} catch (f) {}
try {
b = b || new ActiveXObject("Microsoft.XMLHTTP")
} catch (g) {}
a(b)
});
this.recycleXHR = function(a) {
a.onreadystatechange = function() {};
this.XHRResource.recycle(a)
};
this.abort = function(a) {
if (a) {
var b = this.m_xhrs[a.xhrId];
if (b) {
delete this.m_xhrs[a.xhrId];
if (!a.aborted) {
a.xhrId = null;
a.aborted = !0;
try {
b.abort()
} catch (e) {}
}
net.clearTimeout(a);
a.inflight = !1
}
}
};
this.request = function(a, d, e) {
if (!e || e.readyState != 4 && e.readyState != 0) this.XHRResource.getOne(hitch(this, "request", a, d));
else {
d || (d = function() {});
if (!/^https?:/i.test(a.url)) a.url = location.protocol + "//" + document.domain + (location.port ? ":" + location.port : "") + a.url;
var f = "X" + this.m_id++;
this.m_xhrs[f] = e;
a.xhrId = f;
a.inflight = !0;
a.method == "POST" ? e.open(a.method, a.url, !a.sync) : e.open("GET", net.buildGetQuery(a), !a.sync);
e.onreadystatechange = hitch(this, b, this.m_xhrs[f], a, d);
e.setRequestHeader("If-Modified-Since", new Date(0));
a.args && a.method == "POST" && e.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
try {
net.abortOnTimeout(a, d), e.send(a.method == "POST" ? net.buildQuery(a) : null)
} catch (g) {
throw a.err = new net.RequestError("could not send", 1), this.abort(a), a.err;
}
}
};
this.destroy = function() {
for (var a in this.m_xhrs) this.m_xhrs[a].abort()
}
};
net.getTransportLayer() || net.use(net.XHRTransport);
var ui = {
KEY_BACKSPACE: 8,
KEY_TAB: 9,
KEY_RETURN: 13,
KEY_ESC: 27,
KEY_LEFT: 37,
KEY_UP: 38,
KEY_RIGHT: 39,
KEY_DOWN: 40,
KEY_DELETE: 46,
KEY_SPACEBAR: 32,
m_isEnabled: !0
};
ui.enableEvents = function() {
ui.m_isEnabled = !0
};
ui.disableEvents = function() {
ui.m_isEnabled = !1
};
ui.globalEvents = {};
ui.connectGlobalEvent = function(a, b, c) {
var d = ui.retrieveEventId(a.documentElement);
this.globalEvents[d] || (this.globalEvents[d] = {});
this.globalEvents[d][b] && ui.disconnectGlobalEvent(a, b);
this.globalEvents[d][b] = c;
ui.attachEvent(a.documentElement, b, c, !0)
};
ui.disconnectGlobalEvent = function(a, b) {
var c = ui.retrieveEventId(a.documentElement);
if (this.globalEvents[c] && this.globalEvents[c][b]) {
var d = gWin(a),
e = a.documentElement;
if (ui.isIE && !arguments.callee.disconnecting && d.event && d.event.type == b && d.event.srcElement != e) arguments.callee.disconnecting = !0, this.globalEvents[c][b](d.event), arguments.callee.disconnecting = !1;
ui.detachEvent(e, b, this.globalEvents[c][b], !0);
delete this.globalEvents[c][b]
}
};
ui.m_uid = 0;
ui.retrieveEventId = function(a) {
if (a) {
var b;
a.getAttribute ? (b = a.getAttribute("ev_id"), b || (b = ++ui.m_uid, a.setAttribute("ev_id", b))) : b = ui.getElementEventId(a);
ui.connectedEvents[b] || (ui.connectedEvents[b] = {
el: a
});
return b
}
};
ui.getElementEventId = function(a) {
for (var b = 0, c; c = ui.elementIdMap[b]; ++b) if (c.el == a) return c.id;
b = ++ui.m_uid;
ui.elementIdMap[ui.elementIdMap.length] = {
el: a,
id: b
};
return b
};
ui.elementIdMap = [];
ui.hookEvents = new lib.Publisher;
ui.connectedEvents = {};
ui.connectEvent = function(a, b, c, d, e, f) {
if (a && b && c && d) {
var g = Array.prototype.slice.call(arguments, 6),
h = function(b) {
if (typeof ui != "undefined" && ui.m_isEnabled) {
var h = b || gWin(a).event,
h = (e ? f ? [h, a] : [h] : f ? [a] : []).concat(g),
h = hitch(c, d).apply(c, h);
typeof eventlog != "undefined" && eventlog(a.id + " " + b);
return h
}
},
i = ui.retrieveEventId(a);
ui.connectedEvents[i][b] && ui.disconnectEvent(a, b, ui.connectedEvents[i][b]);
ui.connectedEvents[i][b] = h;
ui.attachEvent(a, b, h)
}
};
ui.disconnectEvent = function(a, b) {
if (a && b) {
var c = ui.retrieveEventId(a),
d = ui.connectedEvents[c][b];
d && (delete ui.connectedEvents[c][b], ui.detachEvent(a, b, d))
}
};
ui.disconnectAllEvents = function(a) {
var b = ui.retrieveEventId(a),
c;
for (c in ui.connectedEvents[b]) if (c != "el") try {
ui.detachEvent(a, c, ui.connectedEvents[b])
} catch (d) {}
delete ui.connectedEvents[b];
c = gDoc(a);
if (a == c) for (b in ui.connectedEvents) a = ui.connectedEvents[b].el, (c == document || c == gDoc(a)) && arguments.callee(a)
};
ui.normalizeEvent = function(a, b, c) {
if (b == "mousewheel" && a.addEventListener) return {
element: a,
event: "DOMMouseScroll",
useCapture: c
};
if (b != "focus" && b != "blur" && b != "focusie7") return {
element: a,
event: b,
useCapture: c
};
var d = gWin(a);
if (a == d) {
var e = gDoc(a);
switch (b) {
case "focus":
isDefined(e.onfocusin) ? (b = "focusin", a = e) : isDefined(d.onfocus) ? b = "focus" : (b = "focus", a = e, c = !0);
break;
case "blur":
isDefined(e.onfocusout) ? (b = "focusout", a = e) : isDefined(d.onblur) ? b = "blur" : (b = "blur", a = e, c = !0);
break;
case "focusie7":
b = "focus", a = d
}
}
return {
element: a,
event: b,
useCapture: c
}
};
ui.attachEvent = function(a, b, c, d) {
if (a && b && c) {
d = ui.normalizeEvent(a, b, d);
a = d.element;
b = d.event;
d = d.useCapture;
if (a.addEventListener) {
if (b == "contextmenu" && ui.isFirefox && ui.isMac) var b = "mouseup",
e = c,
c = function(a) {
a.button == 2 && e(a)
};
a.addEventListener(b, c, !! d)
} else a.attachEvent && a.attachEvent("on" + b, c);
return c
}
};
ui.detachEvent = function(a, b, c, d) {
if (a && b && c) d = ui.normalizeEvent(a, b, d), a = d.element, b = d.event, d = d.useCapture, a.removeEventListener ? a.removeEventListener(b, c, !! d) : a.detachEvent && a.detachEvent("on" + b, c)
};
ui.attachIEMouseEvent = function(a, b, c) {
if (ui.isIE) return ui.attachEvent(a, b, c);
var d;
if (b == "mouseleave") b = "mouseout", d = "mouseover";
else if (b == "mouseeenter") b = "mouseover", d = "mouseout";
else return;
c = delayedMethod(this, c, 0);
c = ui.attachEvent(a, b, c);
a = ui.attachEvent(a, d, hitch(c, "cancel"));
return {
callback: c,
counterCallback: a
}
};
ui.detachIEMouseEvent = function(a, b, c) {
if (ui.isIE) return ui.detachEvent(a, b, c);
ui.detachEvent(a, b, c.callback);
ui.detachEvent(a, b, c.counterCallback)
};
ui.setEventHandled = function(a, b) {
if (!a) a = window.event;
b || ui.hookEvents.publish(a.type, a);
a && a.preventDefault ? a.stopPropagation() : a.cancelBubble = !0;
ui.preventDefault(a)
};
ui.preventDefault = function(a) {
a.preventDefault ? a.preventDefault() : a.returnValue = !1
};
ui.getCursorPos = function(a) {
return {
x: ui.getCursorX(a),
y: ui.getCursorY(a)
}
};
ui.getCursorX = function(a) {
var b = gDoc(a && (a.target || a.srcElement));
return ui.isIE || ui.isOpera ? a.clientX + b.documentElement.scrollLeft + b.body.scrollLeft - (b.documentElement.clientLeft + b.body.clientLeft) : a.clientX + gWin(b).scrollX
};
ui.getCursorY = function(a) {
var b = gDoc(a && (a.target || a.srcElement));
return ui.isIE || ui.isOpera ? a.clientY + b.documentElement.scrollTop + b.body.scrollTop - (b.documentElement.clientTop + b.body.clientTop) : a.clientY + gWin(b).scrollY
};
ui.getMouseButton = function(a) {
var b = gWin(a);
if (!a) a = b.event;
a = a.button;
if (ui.isIE || ui.isWebKit) a & 1 ? a = 0 : a & 2 ? a = 2 : a & 4 && (a = 1);
return a
};
ui.getClientRect = function(a) {
var a = gWin(a),
b = a.document.documentElement;
return new ui.rect(0, 0, a.innerWidth || b.clientWidth, a.innerHeight || b.clientHeight)
};
ui.getClientCenter = function(a) {
a = ui.getClientRect(a);
return {
x: parseInt(a.w / 2),
y: parseInt(a.h / 2)
}
};
ui.cleanUp = function(a) {
a = gDoc(a);
ui.disconnectAllEvents(a);
for (var a = a.getElementsByTagName("DIV"), b = 0; b < a.length; b++) if (a[b].ptr) a[b].ptr = null
};
typeof ui == "undefined" && (ui = {});
(function() {
function a(a) {
var b = navigator.userAgent,
c = b.indexOf(a);
return c >= 0 && (ui.m_version = parseFloat(b.substr(c + a.length + 1)))
}
function b(a) {
return navigator.userAgent.toLowerCase().indexOf(a) >= 0
}
ui.isWebKit = a("WebKit");
ui.isChrome = a("Chrome");
ui.isSafari = !ui.isChrome && a("Safari") && (ui.m_version = a("Version") || 2);
ui.isFluid = window.fluid != null;
ui.isPrism = window.platform != null;
ui.isIPhone = navigator.userAgent.indexOf("iPhone") >= 0;
ui.isIE = a("MSIE");
ui.isOpera = a("Opera");
ui.isNS = a("Netscape6/");
ui.isGecko = !ui.isWebKit && a("Gecko");
ui.isFirefox = a("Firefox");
ui.isMac = b("mac");
ui.isWin = b("win");
ui.isLinux = b("linux") || b("x11");
ui.isHttps = location.protocol == "https:";
ui.isIP = !/.+\.meebo\.com$/i.test(location.hostname);
var c = window.document;
ui.IECompat = ui.isIE && !ui.isOpera ? c && c.documentMode || ui.isIE : !1;
ui.cssVendorPrefix = ui.isWebKit ? "-webkit-" : ui.isGecko ? "-moz-" : ui.isIE ? "-ms-" : ui.isOpera ? "-o-" : ""
})();
ui.isQuirksMode = function(a) {
return !a.compatMode || a.compatMode == "BackCompat"
};
ui.isBorderBox = function(a, b) {
var c = a.compatMode,
d = (ui.isGecko ? "-moz-" : ui.isWebKit ? "-webkit-" : "") + "box-sizing";
return ui.isIE && (c == "BackCompat" || c == "QuirksMode" || ui.isIE < 6) || b && getCSSProp(b, d) == "border-box"
};
ui.getVersion = function() {
return ui.m_version
};
ui.getClient = function() {
return ui.isChrome ? "Chrome" : ui.isSafari ? "Safari" : ui.isIPhone ? "iPhone" : ui.isIE ? "MSIE" : ui.isOpera ? "Opera" : ui.isNS ? "Netscape" : ui.isFirefox ? "Firefox" : ui.isGecko ? "Gecko" : ui.isWebKit ? "WebKit" : "unknown"
};
ui.getOS = function() {
return ui.isMac ? "Mac" : ui.isWin ? "Windows" : ui.isLinux ? "Linux" : "unknown"
};
Class("ui.Element", lib.Publisher, function(a) {
this.initialize = function() {
a(this, "initialize", arguments);
this.m_element = this.m_parent = this.m_win = null
};
this.create = function(a, c) {
this.m_parent = a || this.m_parent;
var d = this.m_parent.m_win || this.m_parent;
if (this.m_win != d || !this.m_element) {
this.uncreate();
this.m_win = d;
this.m_element = c || this.m_win.document.createElement("m");
if (this.m_id) this.m_element.id = this.m_id;
this.createContent()
}
return this
};
this.uncreate = function() {
if (this.m_element) this.uncreateContent(), removeElement(this.m_element), this.m_win = this.m_parent = this.m_element = null
};
this.dom = function(a, c) {
var d = this.m_win.document.createElement(c || "m");
if (c && c != "m_span") d.className = "meebo-0" + (a ? " " + a : "");
else if (a) d.className = a;
return d
};
this.createContent = function() {
throw Error("abstract method");
};
this.uncreateContent = function() {};
this.setParent = function(a) {
if (this.m_parent != a) this.m_element ? this.create(a) : (this.m_parent = a, this.m_win = a.m_win)
};
this.getWindow = function() {
return this.m_win
};
this.getElement = function() {
return this.m_element
};
this.getId = function() {
return this.m_id || this.m_element && this.m_element.id || ""
};
this.setId = function(a) {
this.m_element.id = a;
return this
};
this.getParent = function() {
return this.m_parent
};
this.setTitle = function(a) {
this.m_element.title = a;
return this
};
this.getTitle = function() {
return this.m_title
};
this.addClassName = function(a) {
addClassName(this.m_element, a);
return this
};
this.removeClassName = function(a) {
removeClassName(this.m_element, a);
return this
};
this.hasClassName = function(a) {
return hasClassName(this.m_element, a)
};
this.setWidth = function(a) {
util.css.setStyle(this.m_element, {
width: a + "px"
}, cim.world);
return this
};
this.setDisplay = function(a) {
this.m_element && util.css.setStyle(this.m_element, {
display: a ? "block" : "none"
}, cim.world);
return this
};
this.getDisplay = function() {
return this.m_element && this.m_element.style.display != "none"
};
this.getBoundingClientRect = function() {
return this.m_element.getBoundingClientRect()
}
});
Class("ui.TrackingPixel", function() {
this.initialize = function(a, b, c, d) {
a = a || {};
keyValues = [];
for (var e in a) keyValues.push(e + "=" + encodeURIComponent(a[e]));
c || keyValues.push("tm=" + Math.floor(Math.random() * 1E6));
this.m_keyValues = keyValues;
b ? this.m_baseUrls = isArray(b) ? b : [b] : (this.m_baseUrls = [document.location.protocol + "//rd.meebo.com/b.gif"], a.bcookie = a.bcookie || util.bcookie.get(), a.skin = cim.skin.name);
this.m_useScriptTag = d
};
this.setParent = function(a) {
this.m_parent = a;
return this
};
this.create = function(a) {
this.m_win = a || window;
setTimeout(hitch(this, function() {
this.applyToUrls(hitch(this, this.m_useScriptTag ? "createScript" : "createPixel"))
}), 0)
};
this.createPixel = function(a) {
var b = this.m_win.document,
c = b.createElement("img");
util.css.setStyle(c, {
position: "absolute",
top: "-1000px",
left: "-1000px"
}, cim.world);
c.onload = hitch(this, function() {
c.onload = null;
removeElement(c)
});
c.src = a;
(this.m_parent || b.body).appendChild(c)
};
this.createScript = function(a) {
var b = this.m_win.document,
c = b.createElement("script");
c.type = "text/javascript";
c.src = a;
(this.m_parent || b.body).appendChild(c)
};
this.applyToUrls = function(a) {
for (var b = window.document, c = this.m_keyValues.length ? "?" + this.m_keyValues.join("&") : "", c = c.replace(/=undefined/g, "").replace(/=&/g, "&"), d = 0, e; e = this.m_baseUrls[d]; d++) b.location.protocol == "https:" && (e = e.replace("http:", "https:")), a(e + c)
};
this.getUrls = function() {
var a = [];
this.applyToUrls(hitch(a, "push"));
return a
}
});
ui.innerHTML = ui.isIE ?
function(a, b) {
for (var c = a.parentNode; c && c.id != "meebo";) c = c.parentNode;
if (!c) {
var d = a.parentNode,
e = a.nextSibling,
f = a.ownerDocument || a.document || document,
g = f.createElement("div");
g.style.display = "none";
util.dom.insertBefore(f.body, g, f.body.firstChild);
g.appendChild(a)
}
a.innerHTML = b;
d && util.dom.insertBefore(d, a, e);
g && f.body.removeChild(g);
return a
} : function(a, b) {
a.innerHTML = b;
return a
};
Class("ui.TabPane", ui.Element, function(a) {
this.initialize = function(b) {
a(this, "initialize", arguments);
if (b) {
if (b.width) this.m_width = b.width;
if (b.height) this.m_height = b.height
}
};
this.getWidth = function() {
return this.m_width
};
this.getHeight = function() {
return this.m_height
};
this.canClose = function() {
return !1
};
this.focus = function() {};
this.blur = function() {};
this.resize = function() {};
this.onShow = function() {
this.m_tab && this.m_tab.setSelected(!0)
};
this.onHide = function() {
this.m_tab && this.m_tab.setSelected(!1)
};
this.appendElementTo = function(a) {
this.m_element.parentNode != a && a.appendChild(this.m_element)
};
this.removeElement = function() {
removeElement(this.m_element)
};
this.getParent = function() {
return this.m_parent
};
this.isShowing = function() {
return this.m_parent && this.m_parent.isShowing() && this.m_parent.getCurrentView() == this
};
this.getTab = function() {
return this.m_tab
};
this.setTab = function(a) {
this.m_tab = a.subscribe("Click", this, "toggle", a).subscribe("Close", this, "remove").subscribe("Move", this, function() {
this.isShowing() && this.m_parent.position()
});
return this
};
this.getTitle = function() {
return this.m_title
};
this.setTitle = function(a) {
if (this.m_title != a && (this.m_title = a, this.m_parent)) this.m_parent.onTitleChange(this, this.m_title)
};
this.getId = function() {
if (!this.m_id) this.m_id = "TabPane" + ui.TabPane.m_id++;
return this.m_id
};
this.setId = function(a) {
this.m_id = a
};
this.getViewId = function() {
return this.m_viewId
};
this.show = function() {
this.m_parent && this.m_parent.showView({
view: this
})
};
this.hide = function() {
this.m_parent && this.m_parent.hideView({
view: this
})
};
this.remove = function() {
this.m_parent && this.m_parent.removeView({
view: this
})
};
this.toggle = function(a) {
this.m_parent && this.m_parent.toggleView({
view: this,
buttonOffset: getElementOffset(a.getElement())
})
}
});
ui.TabPane.m_id = 0;
window.meebo = {};
gConfig = new function() {
this.m_meeboAppImagePath = "/skin/default/img/";
this.m_imageServer = "/cim/skin_v108_cim_11_33_7/img/";
this.m_version = "108_cim_11_33_7";
this.m_releaseT = "stage";
this.m_timeStamp = "1347301578";
this.m_soundPath = "/skin/default/sound/";
this.getCDN = function(a) {
var b = typeof gCIM == "object" && gCIM.protocol || window.location.protocol;
return typeof gCDNs == "object" && gCDNs[a] ? b + "//" + gCDNs[a] : ""
};
this.getVersion = function() {
return this.m_version
};
this.getTimeStamp = function() {
return this.m_timeStamp
};
this.getReleaseType = function() {
return this.m_releaseT
};
this.getImageServer = function() {
return this.getCDN("img") + this.m_imageServer
};
this.getImageURL = function(a) {
return a.substr(0, 1) == "/" ? a : this.getImageServer() + a
};
this.getSoundPath = function() {
return this.getCDN("img") + this.m_soundPath
};
this.getMeeboAppImageURL = function(a) {
return this.getCDN("img") + this.m_meeboAppImagePath + a
}
};
Class("meebo.Protocol", function() {
this.initialize = function(a, b, c) {
this.m_id = a;
this.m_isJabberBased = b;
this.m_defaultGroup = c || "Buddies"
};
this.toJSON = this.getId = this.toString = function() {
return this.m_id
};
this.toLowerCase = function() {
return this.m_id.toLowerCase()
};
this.isJabberBased = function() {
return this.m_isJabberBased
}
});
gProtocols = {
msn: new meebo.Protocol("msn", !1, "Individuals"),
aim: new meebo.Protocol("aim"),
icq: new meebo.Protocol("icq"),
yahoo: new meebo.Protocol("yahoo", !1, "Friends"),
jabber: new meebo.Protocol("jabber", !0),
gtalk: new meebo.Protocol("gtalk", !0),
facebook: new meebo.Protocol("facebook"),
myspace: new meebo.Protocol("myspace"),
twitter: new meebo.Protocol("twitter")
};
Class("meebo.Network", function() {
this.initialize = function(a) {
this.m_id = a.id;
this.m_protocol = gProtocols[a.protocol];
this.m_name = a.name;
this.m_cimPartner = a.cimPartner || !1;
this.m_domains = a.domains || [];
this.m_live = "live" in a ? a.live : !0;
this.m_profileUrl = a.profileUrl || "";
this.m_forgotPasswordUrl = a.forgotPasswordUrl;
this.m_loginIsEmail = a.loginIsEmail || !1;
this.m_loginUrl = a.loginUrl || null;
a = a.supports || {};
this.m_supports = {
add: "add" in a ? a.add : !0,
remove: "remove" in a ? a.remove : !0,
groups: "groups" in a ? a.groups : !0,
block: "block" in a ? a.block : !0,
invisible: "invisible" in a ? a.invisible : !0,
groupchat: "groupchat" in a ? a.groupchat : !0,
chatrooms: "groupchat" in a && !a.groupchat ? !1 : "chatrooms" in a ? a.chatrooms : !0,
customalias: "customalias" in a ? a.customalias : !0,
chatlogs: "chatlogs" in a ? a.chatlogs : !0,
icon: "icon" in a ? a.icon : !0
}
};
this.getId = this.toString = function() {
return this.m_id
};
this.getProtocol = function() {
return this.m_protocol
};
this.getName = function() {
return this.m_name
};
this.getIcon = function(a, b, c) {
return gConfig.getMeeboAppImageURL("network/" + this.m_id + ("_" + (b || 14)) + (c ? "_" + c : "") + ("." + (a || "gif")))
};
this.isCIMPartner = function() {
return this.m_cimPartner
};
this.isCIMJabberSite = function() {
return this.m_cimPartner && this.m_domains.length
};
this.getDomains = function() {
return this.m_domains
};
this.loginIsEmail = function() {
return this.m_loginIsEmail
};
this.getForgotPasswordUrl = function() {
return this.m_forgotPasswordUrl
};
this.getProfileUrl = function() {
return this.m_profileUrl
};
this.getLoginUrl = function() {
return this.m_loginUrl
};
this.isLive = function() {
return this.m_live
};
this.makeLive = function() {
return this.m_live = !0
};
this.supports = function(a) {
return this.m_supports[a]
};
this.getIconURL = function() {
return "network/" + this.getId() + "_14_online.gif"
}
});
Class("meebo.CIMNetwork", meebo.Network, function(a) {
this.initialize = function(b) {
b.protocol = "jabber";
a(this, "initialize", arguments);
this.m_cimPartner = !0;
this.m_supports.remove = !1;
this.m_supports.groups = !1;
this.m_supports.block = !0;
this.m_supports.invisible = !1;
this.m_supports.groupchat = !1;
this.m_supports.chatrooms = !1;
this.m_supports.customalias = !1;
this.m_hasHideBtn = "hideBtn" in b ? b.hideBtn : !1;
this.m_singleSubdomain = "singleSubdomain" in b ? b.singleSubdomain : !1;
this.m_isBarVisible = "imBarVisible" in b ? b.imBarVisible : !1;
this.m_friendsSafetyBar = "friendsSafetyBar" in b ? b.friendsSafetyBar : !1;
this.m_imFriendsOnly = "imFriendsOnly" in b ? b.imFriendsOnly : !1;
this.m_noTooltips = "noTooltips" in b ? b.noTooltips : !1;
this.m_showAds = "showAds" in b ? b.showAds : !1;
this.m_controlsAds = "controlsAds" in b ? b.controlsAds : !1;
this.m_fbKey = "fbKey" in b ? b.fbKey : !1;
this.m_fbXDR = "fbXDR" in b ? b.fbXDR : null;
this.m_revenueId = "revenueId" in b ? b.revenueId : null;
this.m_btoptout = "btoptout" in b ? b.btoptout : {};
this.m_adprefs = "adprefs" in b ? b.adprefs : {}
};
this.hasHideBtn = function() {
return this.m_hasHideBtn
};
this.singleSubdomain = function() {
return this.m_singleSubdomain
};
this.isBarVisible = function() {
return this.m_isBarVisible
};
this.friendsSafetyBar = function() {
return this.m_friendsSafetyBar
};
this.imFriendsOnly = function() {
return this.m_imFriendsOnly
};
this.tooltipsDisabled = function() {
return this.m_noTooltips
};
this.getRevenueId = function() {
return this.m_revenueId
};
this.getFbKey = function() {
return this.m_fbKey
};
this.getFbXdr = function() {
return this.m_fbXDR
};
this.getBTOptOut = function() {
return this.m_btoptout
};
this.getAdPrefs = function() {
return this.m_adprefs
};
this.partnerControlsAds = function() {
return this.m_controlsAds
};
this.canShowAds = function() {
return this.m_showAds
}
});
gNetworks = {};
meebo.Network.reload = function() {
if (typeof gNetworksData != "undefined") for (var a in gNetworksData) {
var b = gNetworksData[a];
if (b.protocol in gProtocols && !(a in gNetworks)) b.id = a, gNetworks[a] = new meebo.Network(b)
} else new meebo.Network({
id: "jabber",
name: "Jabber",
protocol: "jabber",
supports: {
block: !1,
invisible: !1,
icon: !1
},
domains: ["jabber.org"]
});
if (typeof gCIM != "undefined" && gCIM.networkDefs) for (a = 0; b = gCIM.networkDefs[a]; a++) b.id in gNetworks || (gNetworks[b.id] = new meebo.CIMNetwork(b))
};
meebo.Network.reload();
meebo.util = {};
meebo.util.request = function(a, b, c, d, e) {
d = d ||
function() {};
b = new net.Request(b);
b.url = a;
b.responseType = e || "application/json";
b.transport = net.XHRTransport;
try {
switch (a = function(a, b) {
d(a, !b && typeof a != "undefined" && (typeof a != "object" || a.stat != "fail"))
}, c.toLowerCase()) {
case "post":
net.post(b, a);
break;
default:
net.get(b, a)
}
} catch (f) {
d(null, !1)
}
};
meebo.util.cmd = function(a, b, c) {
meebo.util.request("/cmd/" + a, b, "post", c)
};
meebo.util.cmdOrMCMD = function(a, b, c) {
var d = window.gApp && gApp.getGateways({
connected: !0
})[0];
d ? d.cmd(a, b, c) : meebo.util.cmd(a, b, c)
};
meebo.util.isICQ = function(a) {
if (!a || !a.length || isEmail(a)) return !1;
a = a.charAt(0);
a = parseInt(a, 10);
return isNaN(a) ? !1 : !0
};
meebo.util.getDefaultGroup = function(a) {
switch (String(a)) {
case "yahoo":
a = "Friends";
break;
case "msn":
a = "Individuals";
break;
case "meebome":
a = "meebome";
break;
default:
a = "Buddies"
}
for (var b = gBuddyList.getGroups(), c = 0, d; d = b[c]; c++) if (d.getName().toLowerCase() == a.toLowerCase()) {
a = d.getName();
break
}
return a
};
meebo.util.stripJabber = function(a) {
if (!a) return "";
var b = a.indexOf("/");
b != -1 && (b = a.substr(0, b), gBuddyList.isJabberGroup(b) || (a = b));
return a
};
meebo.util.stripMeebo = function(a) {
var b = a.indexOf("@meebo.org");
return b > -1 ? a.substr(0, b) : a
};
meebo.util.getMeeboShareLink = function(a) {
return (a = /^https?:\/\/[^\/]*\.meebo\.com\/share\/([^\/#\?]*)\/?(\?.*)?/.exec(a)) && a[1] ? {
share: a[1],
query: (a[2] || "").substr(1)
} : null
};
meebo.util.generateMeeboShareLink = function(a, b) {
return util.url("http://www.meebo.com/share/" + a).addToSearch(b)
};
meebo.util.getOriginContentPath = function() {
return "http" + (ui.isHttps ? "s" : "") + "://" + (ui.isHttps || ui.isIP ? "origin-" : "") + "share.meebo.com/content/"
};
meebo.util.getWallpaperUrl = function(a, b, c) {
return meebo.util.getOriginContentPath() + a + "/wallpapers/" + (c || "1024x768") + "/" + b + ".jpg"
};
meebo.util.getWallpaperThumbUrl = function(a, b) {
return meebo.util.getWallpaperUrl(a, b, "67x50")
};
meebo.util.getWallpaperPreviewUrl = function(a, b) {
return meebo.util.getWallpaperUrl(a, b, "130x98")
};
meebo.util.createAccount = function(a, b, c, d) {
a = stripWhitespace(String(a));
if (!a) return gLang.noName;
if (!c) return gLang.noPass;
b == "meebo" && (b = "meebome");
b = gNetworks[b];
if (b.isCIMPartner()) return d = gLogon.addCIMAccount(a, c, b), d.setPassword(c), d;
b = meebo.util.normalizeLogon(a, b, c);
if (b.error) return error;
a = b.name;
b = b.network;
if (b == "meebome") return a = meebo.util.stripMeebo(a), gLogon.addMeeboAccount(a, c);
a = gLogon.addLogon(a, b);
b == "facebook" || d ? a.setAuthToken(c) : a.setPassword(c);
return a
};
meebo.util.normalizeLogon = function(a, b, c) {
b == "meebo" && (b = "meebome");
if (b = gNetworks[b]) switch (b.getId()) {
case "gtalk":
case "jabber":
case "meebome":
var d = (a || "").replace(/^[^@]*@/, "").replace(/\/.*$/, ""),
e;
for (e in gNetworks) if (e = gNetworks[e], e.getProtocol().isJabberBased() && d in arrayToObject(e.getDomains())) {
b = e;
break
}
}
if (a) a.indexOf("@") == -1 && b.getDomains().length && (a = normalizeString(a + "@" + b.getDomains()[0])), b == "yahoo" && (a = a.replace(/@yahoo\.com$/i, ""));
else var f = gLang.noName;
if (!f && typeof c == "string" && !c) f = gLang.noPass;
return {
error: f,
name: a,
network: b
}
};
meebo.util.createTrackingPixel = function(a, b, c, d, e) {
if (b) {
b instanceof
Array || (b = [b]);
for (var f = 0; f < b.length; f++) a["ln" + f] = b[f].getName(), a["lp" + f] = b[f].getProtocol()
}
if (c) {
c instanceof
Array || (c = [c]);
for (f = 0; f < c.length; f++) a["bn" + f] = c[f].getName(), a["bp" + f] = c[f].getProtocol()
}
if (e && "gTargeting" in window) {
var b = gTargeting.getTargeting(),
c = [],
g;
for (g in b) a.targetingProp ? c.push(g + "=" + b[g]) : a[g] = b[g];
a.targetingProp && (a[a.targetingProp] = c.join(";"), delete a.targetingProp)
}
if ("gCIM" in window) a.instance = gCIM.sentinel;
(new ui.TrackingPixel(a, d)).create()
};
meebo.util.defaultIcon = function(a) {
a.match(/@meebo\.org$/) || (a += "@meebo.org");
for (var b = 0, c = 0; c < a.length; c++) b += a.charCodeAt(c);
return "//" + (location.protocol == "https:" ? "s-ssl" : "s") + ".meebocdn.net/icons/stock/bubbles-0" + b % 8 + ".png"
};
meebo.util.slt = {};
meebo.util.slt.KEY = "slts";
meebo.util.slt.sessionStorage = new function() {
this.load = function(a) {
return util.cookie.load(a)
};
this.save = function(a, b) {
return util.cookie.save(a, b, -1)
};
this.erase = function(a) {
util.cookie.erase(a)
}
};
meebo.util.slt.slts = function(a) {
var a = a ? meebo.util.slt.sessionStorage : util.storage,
b = JSON.parse(util.cookie.load("slt"));
b && (util.cookie.eraseFromDomains("slt"), meebo.util.slt.add(b, b.type == "session"));
try {
var c = JSON.parse(a.load(meebo.util.slt.KEY))
} catch (d) {}
for (var c = c && c.length ? c : [], b = c.length - 1, e; e = c[b]; b--) e.slt.expiration * 1E3 < (new Date).getTime() && c.splice(b, 1);
a.save(meebo.util.slt.KEY, JSON.stringify(c));
return c
};
meebo.util.slt.accounts = function(a, b) {
for (var a = a || meebo.util.slt.slts(b), c = [], d = 0, e; e = a[d]; d++) {
var f = e.network == "meebo" ? gLogon.addMeeboAccount(e.user) : gLogon.addLogon(e.user, gNetworks[e.network]);
f.setSLT(e.slt);
c.push(f)
}
return c
};
meebo.util.slt.accountInfo = function(a) {
if (!a.getAccountType) return a;
var b = a.getName(),
c = a.getSLT(),
d, e;
a.getAccountType() == "meebo.MeeboAccount" ? d = e = "meebo" : (d = a.getNetwork().getId(), e = a.getProtocol().getId());
d != "meebo" && a.isJabberBased() && (b = meebo.util.stripJabber(b));
b = normalizeString(b);
return {
user: b,
network: d,
protocol: e,
slt: c
}
};
meebo.util.slt.add = function(a, b) {
var c = meebo.util.slt.accountInfo(a);
if (c.slt) {
for (var d = b ? meebo.util.slt.sessionStorage : util.storage, e = meebo.util.slt.slts(b), f = c.user, g = c.network, h = c.protocol, i = e.length - 1, j; j = e[i]; i--)(j.network == "meebo" && g == "meebo" || j.user == f && j.network == g) && e.splice(i, 1);
j = {
user: f,
network: g,
protocol: h,
slt: c.slt
};
e.push(j);
d.save(meebo.util.slt.KEY, JSON.stringify(e));
return j
}
};
meebo.util.slt.remove = function(a, b) {
for (var c = meebo.util.slt.accountInfo(a), d = b ? meebo.util.slt.sessionStorage : util.storage, e = meebo.util.slt.slts(b), f = e.length - 1, g; g = e[f]; f--) g.user == c.user && g.network == c.network && e.splice(f, 1);
d.save(meebo.util.slt.KEY, JSON.stringify(e))
};
meebo.util.slt.clear = function(a) {
(a ? meebo.util.slt.sessionStorage : util.storage).erase(meebo.util.slt.KEY)
};
Class("meebo.util.SLTXD", function() {
this.initialize = function(a) {
this.m_redirectURL = a;
this.m_slts = null;
if (util.postMessage.enabled) this.m_channel = new util.postMessage("slt", null, location.hostname), this.m_channel.subscribe("message", this, "_onPostMessage")
};
this.load = function(a, b) {
location.protocol == "https:" ? a(meebo.util.slt.slts()) : !b && this.m_slts ? a(this.m_slts) : this._cmd("loadSLTs", {}, hitch(this, function(b) {
this.m_slts = b;
a(b)
}))
};
this.add = function(a, b) {
location.protocol == "https:" ? (meebo.util.slt.add(a), b && b()) : (this._cmd("addSLT", meebo.util.slt.accountInfo(a), b), this.m_slts = null)
};
this.remove = function(a, b) {
location.protocol == "https:" ? (meebo.util.slt.remove(a), b && b()) : (this._cmd("removeSLT", meebo.util.slt.accountInfo(a), b), this.m_slts = null);
a.setSLT(null)
};
this.clear = function(a) {
location.protocol == "https:" ? (meebo.util.slt.clear(), a && a()) : (this._cmd("clearSLTs", {}, a), this.m_slts = null)
};
this.watchForSLTCookie = function(a) {
if (location.protocol == "https:") {
var b = JSON.parse(util.cookie.load("slt"));
b ? (util.cookie.eraseFromDomains("slt"), b = meebo.util.slt.add(b, b.type == "session"), a(b)) : setTimeout(callee.call(this, arguments), 250)
} else this._cmd("watchForSLTCookie", {}, a), this.m_slts = null
};
this._cmd = function(a, b, c) {
var d = meebo.util.SLTXD.callbacks;
b.cmd = a;
b.bcookie = util.bcookie.get();
b.callbacks = "meebo.util.SLTXD.callbacks";
b.callbackId = d.length;
b.sltKey = meebo.util.slt.KEY;
d.push(hitch(this, function(a) {
removeElement(e);
c && c(a.data)
}));
var e = document.createElement("iframe");
e.style.cssText = "position: absolute; left: -999px";
document.body.appendChild(e);
e.src = util.url(this.m_redirectURL).addToHash(b).toString()
};
this._onPostMessage = function(a, b) {
if (a == "https://" + location.hostname) try {
var c = JSON.parse(b);
meebo.util.SLTXD.callbacks[c.callbackId](c)
} catch (d) {}
}
});
meebo.util.SLTXD.callbacks = [];
meebo.util.sitetoken = {};
meebo.util.sitetoken.load = function() {
return util.cookie.load("sitetoken")
};
meebo.util.sitetoken.save = function(a, b, c) {
b && (b = new Date(c.getLocalizedDate(b)));
util.cookie.save("sitetoken", a, b, location.hostname)
};
meebo.util.sitetoken.erase = function() {
util.cookie.erase("sitetoken", location.hostname)
};
meebo.util.sitetoken.require = function(a) {
return function() {
var b = arguments;
if (meebo.util.sitetoken.load()) return a.apply(this, b);
var c = gLogon.getMeeboAccount();
c && c.getState() == "online" ? c.requestSiteToken(hitch(this, function() {
a.apply(this, b)
})) : gPubSub.subscribe("meebo.MeeboAccount::changeState", this, function(c, e, f) {
f == "online" && (gPubSub.unsubscribe("meebo.MeeboAccount::changeState", this), c.requestSiteToken(hitch(this, function() {
a.apply(this, b)
})))
})
}
};
meebo.util.session = {};
meebo.util.session.SESSION_KEY_COOKIE = "sessionkey";
meebo.util.session.LOCATION_ID_COOKIE = "location";
meebo.util.session.storage = util.cookie.isEnabled() ? util.cookie : util.localSessionStorage;
meebo.util.session.load = function() {
var a = meebo.util.session.loadSessionKey();
return !a ? null : {
sessionKey: a,
locationId: meebo.util.session.loadLocationId()
}
};
meebo.util.session.save = function() {
var a = gIMGateway,
b = gClient.getServerTimeout(),
c = location.hostname;
a.getSessionKey() && (meebo.util.session.storage.save(meebo.util.session.SESSION_KEY_COOKIE, a.getSessionKey(), b, c), meebo.util.session.storage.save(meebo.util.session.LOCATION_ID_COOKIE, a.getLocationId(), b, c))
};
meebo.util.session.clear = function() {
meebo.util.session.storage.erase(meebo.util.session.SESSION_KEY_COOKIE, location.hostname);
meebo.util.session.storage.erase(meebo.util.session.LOCATION_ID_COOKIE, location.hostname)
};
meebo.util.session.loadSessionKey = function() {
return meebo.util.session.storage.load(meebo.util.session.SESSION_KEY_COOKIE)
};
meebo.util.session.loadLocationId = function() {
return meebo.util.session.storage.load(meebo.util.session.LOCATION_ID_COOKIE)
};
gCIM.time("sb:__init__");
cim = {};
cim.trackActiveUser = function() {
var a = cim.storage.load("tracked", !0);
a || (a = {});
gCIM.network in a || (a[gCIM.network] = !0, cim.storage.save("tracked", a, !0), a = window.gApp && gApp.getLogon(), cim.util.track.action({
event: "userActive",
mcim: a && a.getPassword() ? 1 : 0
}))
};
cim.storage = new function() {
function a() {
try {
var a = JSON.parse(util.storage.load(c))
} catch (d) {}
if (!a) return {
sessionId: e,
data: {},
sessionData: {}
};
if (a.sessionId != e) a.sessionData = {}, a.sessionId = e, b(a);
return a
}
function b(a) {
return util.storage.save(c, JSON.stringify(a))
}
var c = "meebo-cim",
d = util.cookie.isEnabled() ? util.cookie : util.localSessionStorage,
e = d.load("meebo-cim-session");
e || (e = util.bcookie.generate(), d.save("meebo-cim-session", e, -1, location.host));
this.eraseAll = function() {
return util.storage.erase(c)
};
this.load = function(b, c) {
var d = a()[c ? "sessionData" : "data"];
return b in d ? d[b] : null
};
this.save = function(c, d, e) {
var i = a();
i[e ? "sessionData" : "data"][c] = d;
return b(i)
};
this.erase = function(c, d) {
var e = a();
delete e[d ? "sessionData" : "data"][c];
return b(e)
}
};
cim.util = {};
cim.util.getIconURL = function(a) {
return /^https?:|^\/\//.test(a) ? a : a.substr(0, 1) == "/" ? "//" + gCDNs.img + a : gCIM.imageURL + a
};
cim.util.getFaviconURL = function(a) {
return gCIM.protocol + "//" + gCIM.hostname + "/site/" + a + "/favicon"
};
cim.util.normalizeDomain = function(a) {
return a.replace(/^www\.([\w-]+\.[\w\.]+)$/, "$1")
};
cim.util.openWindow = function(a) {
var b = calcWinPos(window),
a = a || {},
c = a.loadingMsg,
d = a.url,
e = a.id,
f = Math.max(b.w - 200, 800),
g = Math.max(b.h - 150, 600);
delete a.loadingMsg;
delete a.url;
delete a.id;
b = {
menubar: "no",
location: "no",
toolbar: "no",
scrollbars: "yes",
status: "yes",
width: f,
height: g,
left: Math.max(b.x + 50, b.x + Math.floor((b.w - f) / 2)),
top: Math.max(b.y + 50, b.y + Math.floor((b.h - g) / 2)),
resizable: "yes"
};
copyProperties(b, a);
var a = [],
h;
for (h in b) a.push(h + "=" + b[h]);
h = a.join(",");
d || (d = "", gCIM.domain && (d = "document.domain='" + gCIM.domain + "';"), d = "javascript:document.open();" + d + "document.write(\"<html><body style='font:13px tahoma,sans-serif'>" + (c || gLang.loadingLink) + '");');
e || (e = "W" + getUniqueId());
e = e.replace(/[^A-Za-z0-9]/g, "_");
try {
var i = window.open(d, e, h);
i && i.focus()
} catch (j) {}
return i
};
cim.util.getCSSLocation = function(a, b) {
var c = util.url(gCIM.cssURL),
d = ui.IECompat;
w3c = !(!ui.isOpera && ui.isIE) || d >= 9;
quirks = !w3c && ui.isQuirksMode(b);
browser = w3c ? "w3c" : "ie" + Math.max(Math.floor(d), 7);
postfix = "." + browser + (quirks ? ".quirks" : "");
ieExtension = w3c ? "" : "." + c.protocol.replace(/:$/, "") + "." + c.host;
src = c + a + postfix + ieExtension + ".css";
return src
};
cim.util.loadCSS = function(a, b, c) {
var d = a.document,
a = cim.util.getCSSLocation(b, d),
e, f;
f = d.createElement("link");
f.rel = "stylesheet";
f.type = "text/css";
f.media = "screen";
f.href = a;
if (c) ui.isIE ? f.onload = c : (e = (new Date).getTime(), function h() {
if (f.sheet) for (var a = d.styleSheets, b, k = 0; b = a[k]; k++) if ((b = b.ownerNode ? b.ownerNode : b.owningElement) && b == f) {
c();
return
}(new Date).getTime() - e <= 3E4 && setTimeout(h, 100)
}());
d.getElementsByTagName("head")[0].appendChild(f)
};
cim.util.getIconURL = function(a) {
return /^https?:|^\/\//.test(a) ? a : a.substr(0, 1) == "/" ? gCDNs.img + a : gCIM.imageURL + a
};
cim.util.getFaviconURL = function(a) {
return "/site/" + a + "/favicon"
};
cim.util.getVersion = function() {
return gCIM.version.split("cim_")[1]
};
cim.util.getChannel = function() {
var a = ((parseInt(cim.storage.load("channel")) || Math.floor(Math.random() * 500)) + 1) % 500;
cim.storage.save("channel", a);
return a
};
cim.util.addIEHost = function(a) {
a = a || {};
if (ui.isIE && ui.isIE < 8) {
var b = util.url(gClient.getURL());
b.protocol = "https:";
b.host = b.host.replace(/^\d+/, cim.util.getChannel());
a.host = b.toString()
}
return a
};
cim.util.getAdFilterRegex = function() {
if (this.m_adFilterRegex) return this.m_adFilterRegex;
var a = "googleads.com|doubleclick.net|ad.yieldmanager.com|pointroll.com|atdmt.com".replace(/\./g, "\\.");
return this.m_adFilterRegex = RegExp("^https?://[^/]*(" + a + ")/", "i")
};
cim.util.isLogonActive = function(a) {
return a.getState() == "online" || a.hasPassword() || a.isMeeboLogon() || a == gApp.getLogon()
};
cim.util.getActiveNetworks = function() {
var a = [],
b = [gNetworks.meebome];
a.meebome = !0;
gCIM.network && gNetworks[gCIM.network].isCIMJabberSite() && (a[gCIM.network] = !0, b.push(gNetworks[gCIM.network]));
if (window.gLogon) for (var c = gLogon.getLogons(), d = 0, e; e = c[d]; ++d) if (cim.util.isLogonActive(e)) {
var f = e.getNetwork();
f in a || (a[f] = !0, a[e.isOnline() ? "unshift" : "push"](f))
}
c = ["gtalk"];
for (d = 0; e = c[d]; ++d) e in a || a.push(gNetworks[e]);
return b.concat(a)
};
cim.util.connect = function() {
gCIM.isJabber && (gCIM.mcim ? gFrameMgr.connect() : cim.util.login())
};
cim.util.login = function() {
gFrameMgr.frameCmd("login")
};
cim.util.meeboConnect = function(a) {
var b = util.getConnectWinParams(window, "checkin", null, {
width: 800,
height: 680
}),
c = util.openPopup(b),
a = a || "";
cim.util.loadCode("im", hitch(this, function() {
gApp.prepareConnect(hitch(gApp, "loadPopup", c, b, {}, "https://" + gCIM.hostname + "/" + a + "?ref=bar&source=menu"));
gSLTXD.watchForSLTCookie(function(a) {
gApp.loginWithSLTs([a])
})
}))
};
(function() {
var a = new lib.Callback,
b = !1;
cim.util.loadNetworks = function(c) {
a.add(c);
b || (b = !0, util.script({
src: gCIM.protocol + "//" + gCIM.hostname + "/cim?network=" + gCIM.network + "&getNetworks=cim.util.onLoadNetworks"
}))
};
cim.util.onLoadNetworks = function() {
meebo.Network.reload();
a.fire()
}
})();
(function() {
function a(b) {
for (var d = e[b]; d.length;) a(d.pop());
c.push(b)
}
var b = cim.util.loadCallbacks = {},
c = [],
d = cim.util.requestedModules = {},
e = {
base: [],
im: ["feeds", "base"],
feeds: ["base"]
},
f;
for (f in e) b[f] = new lib.Callback;
cim.util.loadCode = function(e, f) {
function i() {
for (; c.length;) {
var a = c.shift();
if (!d[a]) {
d[a] = !0;
b[a].add(i);
jsCache.load(a);
break
}
}
}
a(e);
b[e].add(f);
var j = !1,
k;
for (k in b) j = j || d[k] && !b[k].wasFired();
j || i()
}
})();
cim.util.matchDomain = function(a, b) {
var c = cim.util.normalizeDomain(b);
if (isString(a)) {
if (a == c || a == b) return a
} else if (isArray(a)) {
if (util.array.indexOf(a, c) != -1) return c;
if (util.array.indexOf(a, b) != -1) return b
} else if (typeof a == "object") for (var d in a) if (d == c || d == b) return d
};
if (!cim.util) cim.util = {};
cim.util.track = Singleton(function() {
this.initialize = function() {
var a = cim.storage.load("trackingPixels"),
b = !1;
if (a) {
var c = a.length;
if (b = c >= 0) for (var d = 0; d < c; d++) {
var e = a[d];
if (!e || !e.data || !(e.actions && e.actions.length >= 0)) {
b = !1;
break
}
}
}
b || (a = [], cim.storage.erase("trackingPixels"));
e = a[a.length - 1];
b = gCIM.network;
b = {
partner: b,
live: gNetworks[b].isLive(),
version: gConfig.getVersion(),
bcookie: util.bcookie.get()
};
if (c = !! e) {
var d = e.data,
f;
for (f in b) if (b[f] != d[f]) {
c = !1;
break
}
}
c || (e = {
data: b,
actions: []
}, a.push(e));
this.m_session = e;
this.m_sessions = a
};
this.data = function(a, b) {
a._baseUrl = b;
this.m_session.actions.push(a);
cim.storage.save("trackingPixels", this.m_sessions);
this.trigger()
};
this.action = function(a, b) {
var c = cim.storage.load("tracked", !0),
d = typeof gApp != "undefined" && gApp,
e = [];
if (d) for (var f = d.getGateways({
connected: !0
}), g = 0, h; h = f[g]; g++) e.push(h.getLogKey());
c = {
logkey: e.join(","),
meeboConnect: Boolean(d && d.isMeeboConnected()),
uid: Boolean(d && d.getLogon()),
active: c && c[gCIM.network] || 0,
instance: gCIM.sentinel
};
if ("buckets" in gCIM) for (var i in gCIM.buckets) c["buckets_" + i] = encodeURIComponent(gCIM.buckets[i]);
if (a) for (var j in a) c[j] = a[j];
this.data(c, b)
};
this.UIAction = function(a, b) {
this.action({
event: "lfu",
area: a.area,
element: a.element,
extIsActive: !1,
isMini: !1
}, b)
};
this.trigger = function() {
if (!this.m_triggerTimer) this.m_triggerTimer = setTimeout(hitch(this, "_trigger"), 500)
};
this._trigger = function() {
for (var a = this.m_sessions, b = a.length, c = 0; c < b; c++) for (var d = a[c], e = d.data, d = d.actions, f = d.length, g = 0; g < f; g++) {
var h = d[g],
i = h._baseUrl,
j = {};
delete h._baseUrl;
for (var k in e) j[k] = e[k];
for (k in h) j[k] = h[k];
(new ui.TrackingPixel(j, i)).create()
}
this.m_session.actions = [];
this.m_sessions = [this.m_session];
cim.storage.erase("trackingPixels");
this.m_triggerTimer = null
}
});
Class("cim.util.ieWindowChannel", lib.Publisher, function(a) {
this.initialize = function(b, c, d) {
a(this, "initialize", arguments);
this.m_channelName = b;
this.m_origin = d;
this.setTarget(c);
this.m_acked = this.m_outgoingIndex = this.m_incomingIndex = 0;
this.m_pending = {};
this.m_resend = null;
this.m_dataName = "postMessageData_" + this.m_channelName;
this.m_receiveInterrupt = this.m_sendInterrupt = !1;
if (gFrameMgr) {
var e = !(!cim || !(cim.FrameMgr && gFrameMgr instanceof cim.FrameMgr));
this.m_sendInterrupt = !e;
this.m_receiveInterrupt = e;
this.m_resizerName = "postMessageResizer_" + this.m_channelName;
e ? gFrameMgr.setupFrame(this.m_resizerName, this, this.sandboxOnResizerLoad) : (this.m_resizeState = 0, this.m_resizer = gFrameMgr.addFrame(new cim.world.Frame(this.m_resizerName, {
iframe: gFrameMgr.getIframe(this.m_resizerName, {})
})), util.css.setStyle(this.m_resizer.m_frame, {
height: 0,
width: "1px"
}, cim.world))
}
this.m_receiveInterrupt || setInterval(hitch(this, this.onTrigger), 100);
if (document.body) this.onReady();
else ui.attachEvent(window, "load", hitch(this, this.onReady))
};
this.setTarget = function(a) {
this.m_target = a
};
this.send = function(a) {
this.m_pending[this.m_outgoingIndex] = a;
this.sendCommand("m", this.m_outgoingIndex, a);
this.m_outgoingIndex++;
this.triggerTarget()
};
this.onReady = function() {
this.m_data = document.createElement(ui.isIE ? '<iframe name="' + this.m_dataName + '"></iframe>' : "iframe");
this.m_data.name = this.m_dataName;
ui.attachEvent(this.m_data, "load", hitch(this, this.onDataLoad));
util.css.setStyle(this.m_data, {
display: "none"
}, cim.world);
document.body.appendChild(this.m_data);
try {
this.m_data.contentWindow["t:0"] = !0
} catch (a) {
this.m_data.src = "javascript:d=document.open();d.domain='" + document.domain + "';d.close();"
}
};
this.onDataLoad = function() {
for (var a = this.m_acked; a < this.m_outgoingIndex; a++) this.sendCommand("m", a, this.m_pending[a]);
this.sendAck();
this.isPending() && this.triggerTarget()
};
this.sandboxOnResizerLoad = function(a) {
this.m_resizer = a;
ui.attachEvent(a.m_win, "resize", hitch(this, this.onTrigger));
this.onTrigger()
};
this.isPending = function() {
return this.m_acked < this.m_outgoingIndex
};
this.clearData = function() {
this.m_data.contentWindow.location.reload(!1)
};
this.sendCommand = function() {
this.m_data && (this.m_data.contentWindow["m:" + Array.prototype.join.call(arguments, ":")] = !0)
};
this.sendAck = function() {
this.sendCommand("a", this.m_incomingIndex)
};
this.triggerTarget = function() {
if (this.m_sendInterrupt) clearTimeout(this.m_resend), this.m_resizeState = (this.m_resizeState + 1) % 2, util.css.setStyle(this.m_resizer.m_frame, {
width: this.m_resizeState + 20 + "px"
}, cim.world), this.m_resend = this.isPending() ? setTimeout(hitch(this, this.triggerTarget), 100) : null
};
this.onTrigger = function() {
var a = this.m_target[this.m_dataName];
if (a) {
var c = !1,
d, e;
for (e in a) if (d = /^m:([^:]*)(?::|$)([\s\S]*)/.exec(e)) {
var f = {
a: this.onAck,
m: this.onMessage
}[d[1]];
f && (c = f.call(this, d[2]) || c)
}
c && (this.sendAck(), this.triggerTarget())
}
};
this.onAck = function(a) {
for (a = parseInt(a); this.m_acked < a; this.m_acked++) delete this.m_pending[this.m_acked], this.isPending() || (this.clearData(), clearTimeout(this.m_resend))
};
this.onMessage = function(a) {
var c;
if ((c = /([^:]*):([\s\S]*)/.exec(a)) && parseInt(c[1]) == this.m_incomingIndex) return this.m_incomingIndex++, this.publish("message", this.m_origin, c[2]), !0
}
});
cim.util.createWindowChannel = function(a, b, c) {
var d;
if (util.postMessage.enabled) d = util.postMessage;
else if (ui.isIE >= 6) d = cim.util.ieWindowChannel;
else return null;
return new d(a, b, c)
};
(function() {
var a = gCIM.skin || "main",
b = 0,
c = {
main: "meebo-17-main",
dark: "meebo-17-dark"
},
d;
for (d in c) b++;
cim.skin = {
name: a,
className: c[a],
all: c,
length: b
}
})();
Class("cim.Frame", ui.Element, function(a) {
this.initialize = function(b) {
a(this, "initialize");
this.m_id = b
};
this.createContent = function() {
this.addClassName(cim.skin.className);
var a = this.m_win;
a.onresize = hitch(this, "onResize");
a.document.onmousedown = hitch(this, "publish", "MouseDown");
a.frame = this.m_id;
a.document.createElement("m_span");
ui.vector.init(this.m_win.document);
this.onResize()
};
this.showLoader = function() {
var a = this.m_element;
a.innerHTML = '<div class="meebo-_contentBorder" style="position: absolute; top: 22px; margin: 3px"><div style="position:absolute;float:none" class="meebo-123"></div></div>';
this.m_loader = a.firstChild;
this.positionLoader()
};
this.positionLoader = function() {
var a = this.m_loader;
if (a) {
var c = this.m_height - 22 - 8,
d = this.m_width - 8,
e = a.firstChild.style;
a.style.height = c + "px";
a.style.width = d + "px";
e.left = Math.floor((d - 16) / 2) + "px";
e.top = Math.floor((c - 17) / 2) + "px"
}
};
this.hideLoader = function() {
removeElement(this.m_loader);
this.m_loader = null
};
this.showOverlay = function() {
if (!this.m_overlay) this.m_overlay = this.m_element.appendChild(this.dom("meebo-4 meebo-99")), ui.connectEvent(this.m_overlay, "click", this, "publish", !1, !1, "OverlayClick");
this.m_overlay.style.display = "block"
};
this.hideOverlay = function() {
if (this.m_overlay) this.m_overlay.style.display = "none"
};
this.onResize = function() {
var a = this.m_win.document.documentElement,
a = {
w: a.clientWidth,
h: a.clientHeight
};
a.dw = a.w - this.m_width;
a.dh = a.h - this.m_height;
this.m_width = a.w;
this.m_height = a.h;
this.positionLoader();
this.publish("Resize", a)
};
this.getWidth = function() {
return this.m_width || (this.m_width = this.m_win.document.documentElement.clientWidth)
};
this.getHeight = function() {
return this.m_height || (this.m_height = this.m_win.document.documentElement.clientHeight)
};
this.blur = function() {}
});
Class("cim.FrameMgr", lib.Publisher, function(a) {
this.getStyle = function(a) {
return a ? Class.getObject("cim.style." + a) : this.m_style
};
this.initialize = function() {
a(this, "initialize", arguments);
this.m_listeners = {};
this.m_isDark = !! util.url(window.location).getHash("isDark");
this.m_worldOverlayShowing = !1;
this.m_createReqs = {};
this.m_frames = {};
this.m_frameCmdCallbacks = {};
this.m_frameDefs = {
im: "im",
meeboMenu: "meeboMenu",
tray: "tray",
overlay: "share"
};
cim.util.loadCallbacks.im.add(this, "onLoadIM");
this.parseUrl();
cim.util.track.trigger()
};
this.create = function() {
this.m_transportReady = new lib.Callback;
this.m_sandboxUIReady = new lib.Callback;
this.m_world = cim.util.createWindowChannel("manager", gWorldWindow, gCIM.location.protocol + "//" + gCIM.location.host);
this.m_world.subscribe("message", this, "onMessage");
this.m_world.subscribe("message", this, function(a, c) {
c == "world-ready" && (this.m_world.unsubscribe("message", this, arguments.callee), this.m_world.send("sandbox-ready"), this.postCreate())
});
this.m_world.send("sandbox-ready")
};
this.createSandboxUI = function(a) {
a && this.m_sandboxUIReady.add(a);
if (!this.m_sandboxUIRequested) this.m_sandboxUIRequested = !0, cim.util.loadCode("base", hitch(this, function() {
this.m_style = cim.style;
ui.vector.init(document, hitch(this, function() {
this.createFrame("bar", window);
this.m_sandboxUIReady.fire();
this.frameCmd("sandboxUIReady")
}))
}))
};
this.onSandboxUIReady = function(a) {
this.m_sandboxUIReady.add(a);
return this
};
this.getSound = function() {
return this.m_sound
};
this.onLoadIM = function() {
this.createApp("im");
this.m_channel = new cim.Channel(window);
for (id in this.m_frames) this.m_channel.registerWindow(this.m_frames[id].getWindow());
this.m_sound = new cim.Sound(this.m_channel);
this.upgradeFrame("tray", "cim.Tray");
this.upgradeFrame("overlay", "cim.Overlay");
ui.isIE == 7 && this.upgradeFrame("resize", "cim.ResizeFrame")
};
this.onFocus = function() {
this.publish("Focus");
if (this.m_channel) this.m_channel.onFocus()
};
this.onBlur = function() {
this.publish("Blur");
if (this.m_channel) this.m_channel.onBlur()
};
this.withIM = function(a, c) {
cim.util.loadCallbacks.im.add(function() {
gCIM.apps.im.withFrames(gCIM.apps.im, a, c)
})
};
this.getChannel = function() {
return this.m_channel
};
this.parseUrl = function() {
var a = util.url(window.location).getHash();
gCIM.location = util.url(a.loc);
gCIM.canon = a.canon ? a.canon : null;
gCIM.mcim = a.mcim && decodeURIComponent(a.mcim);
gCIM.dref = a.dref;
gCIM.title = a.title;
gCIM.sentinel = a.sentinel
};
this.postCreate = function() {
if (!util.verifyDomain(document.referrer || gCIM.location)) {
this.frameCmd("remove");
var a = gCIM.location.host;
setTimeout(function() {
throw "Meebo says: The domain " + a + ' has not been verified. Please visit http://dashboard.meebo.com/ and add "' + gCIM.location.host + '" to your list of verified domains. If this is not your Meebo Bar, get your own at http://bar.meebo.com/';
}, 0)
}
gCIM.mcim && cim.util.loadCode("im", hitch(this, "publish", "MCIM", gCIM.mcim));
this.m_sandboxUIReady.add(this, function() {
cim.util.requestedModules.im || this.m_frames.bar.showStatus()
});
this.createApp("feeds").createApp("share").createApp("ads");
gAdServer.setLoadProfiles();
this.addListener("userActive", cim, "trackActiveUser").addListener("track", cim.util.track, "action").addListener("trackUIAction", cim.util.track, "UIAction").addListener("logTimes", this, "_logTimes").addListener("onShowBar", this, "onShowBar").addListener("onHideBar", this, "onHideBar").addListener("minimizeAll", this, "withIM", "minimizeAll").addListener("minimize", this, "minimize").addListener("savePaletteHeight", this, "savePaletteHeight").addListener("onPageLoad", this, "logPageLoad").addListener("mousedown", this, "onWorldMouseDown").addListener("Focus", this, "onFocus").addListener("Blur", this, "onBlur").addListener("reset", jsCache, "reset").addListener("loadCode", this, "loadCode").addListener("toggleLoginMenu", this, "_toggleLoginMenu").addListener("connect", this, "connect").addListener("prepareConnect", cim.util, "meeboConnect", "").addListener("showOverlays", this, "showOverlays").addListener("hideOverlays", this, "hideOverlays").addListener("onHideShadow", this, "onHideShadow").addListener("onShowShadow", this, "onShowShadow").addListener("showSponsored", this, "showSponsored").addListener("showSponsoredOverlay", this, "showSponsoredOverlay");
this.m_transportReady.fire();
cim.uistate.track("cIM", this, "onUIState", {}, "local")
};
this.loadCode = function(a) {
cim.util.loadCode(a.module, hitch(this, "frameCmd", a.callbackId))
};
this._toggleLoginMenu = function() {
gCIM.apps.im ? (this.m_tmpTray && gCIM.apps.im.withFrames(this, function() {
this.m_tmpTray.hideLoader();
this.m_tmpTray = null
}), gCIM.apps.im.toggleLoginMenu()) : this.setupFrame("tray", hitch(this, function() {
this.m_tmpTray = this.showFrame("tray");
this.m_tmpTray.showLoader();
this.frameCmd("toggleStatus", !0);
setTimeout(hitch(cim.util, "loadCode", "im", hitch(this, "_toggleLoginMenu")))
}))
};
this.connect = function() {
cim.util.loadCode("im", hitch(this, function() {
gApp.connect()
}))
};
this.showSponsored = function(a) {
if (gNetworks[gCIM.network].canShowAds()) {
var c = {
type: "Sponsored"
};
if (a = a.adId) c.adId = a;
gAdServer.load(c)
}
};
this.showSponsoredOverlay = function(a) {
a = hitch(this, "showSLogo", a);
this.m_sponsorTimeout = setTimeout(a, 1E3)
};
this.showSLogo = function(a) {
gFrameMgr.getFrame("overlay") && (gFrameMgr.getFrame("overlay").showSponsored(a.text, a.imgsrc), clearTimeout(this.m_sponsorTimeout))
};
this.logPageLoad = function(a) {
var c = cim.storage.load("pageLoads") || [];
c.push(a);
cim.storage.save("pageLoads", c)
};
this._logTimes = createDelayedMethod("_logTimes", function(a) {
var c = a.times,
a = a.buttons,
d = gCIM.m_times,
e = [];
if (c && d) {
this.m_worldStartTime = c[0];
var f = shallowCopy(c),
g = d[0] - c[0];
e.push(f[0]);
e.push(f[1]);
d[0] = c[0];
for (var h in d) h != 0 && (d[h] += g, f[h] = d[h]);
f.sandbox = d[0] = g;
for (h in f) h != 0 && h != 1 && (e.push(h), e.push(f[h]));
gFrameMgr.frameCmd("logTimes", f)
}
c = cim.storage.load("pageLoads");
cim.storage.erase("pageLoads");
(gCIM.mcim || meebo.util.session.load()) && cim.util.loadCode("im", hitch(this, function() {
gApp.subscribe("ChangeState", this, function j(a) {
a != "online" && a != "offline" || (gApp.unsubscribe("ChangeState", this, j), cim.util.track.action({
event: "imReady"
}))
})
}));
cim.util.track.action({
event: "cimLoad1",
times: (e || []).join("|"),
pageLoads: c && c.join ? c.join("|") : "",
buttons: a
})
});
this.onShowShadow = function() {
this.m_worldShadowShowing = !0
};
this.onHideShadow = function() {
this.m_worldShadowShowing = !1;
this.publish("onHideShadow")
};
this.isWorldShadowShowing = function() {
return this.m_worldShadowShowing
};
this.isDark = function() {
return this.m_isDark
};
this.onShowBar = function(a) {
this.m_isBarHidden = !1;
a && (cim.uistate.set("cIM", {
isHidden: !1
}, "local"), cim.util.track.action({
event: "showBar"
}), cim.util.track.UIAction({
area: "overall",
element: "meeboMenu"
}))
};
this.onHideBar = function(a) {
this.m_isBarHidden = !0;
a && (cim.uistate.set("cIM", {
isHidden: !0
}, "local"), cim.util.track.action({
event: "hideBar"
}), cim.util.track.UIAction({
area: "overall",
element: "hideBtn"
}))
};
this.isBarHidden = function() {
return this.m_isBarHidden
};
this.onUIState = function(a) {
!this.m_isBarHidden && a.isHidden == !0 ? this.frameCmd("hideBar") : this.m_isBarHidden && a.isHidden == !1 && this.frameCmd("showBar")
};
this.onMessage = function(a, c) {
var d = gCIM.location.protocol + "//" + gCIM.location.host;
if (!(a.toLowerCase() != d.toLowerCase() || c.substring(0, 7) != "_MEEBO_")) try {
this.onCmd(JSON.parse(c.substring(7)))
} catch (e) {}
};
this.addListener = function(a, c, d) {
this.m_listeners[a] = hitch.apply(window, Array.prototype.slice.call(arguments, 1));
return this
};
this.onCmd = function(a) {
var c = a.name,
a = a.data,
d = this.m_frameCmdCallbacks[c];
if (d) delete this.m_frameCmdCallbacks[c], d(a);
else if (this.m_listeners[c]) this.m_listeners[c](a)
};
this.frameCmd = function(a, c, d) {
this.m_transportReady.add(hitch(this, "doCmd", a, c, d))
};
this.doCmd = function(a, c, d) {
if (typeof d == "function") c.callbackId = getUniqueId(), this.m_frameCmdCallbacks[c.callbackId] = d;
this.m_world.send("_MEEBO_" + JSON.stringify({
name: a,
data: c
}))
};
this.hideFrame = function(a, c) {
var a = typeof a == "string" ? this.m_frames[a] : a,
c = c || {},
d = a.getId();
if (!(d == "tray" && c.swappingViews)) return this.frameCmd("hide", {
id: d
}), a
};
this.showFrame = function(a, c, d) {
var a = typeof a == "string" ? this.m_frames[a] : a,
e = {
id: a.getId()
};
if (c) {
if ("left" in c) e.left = c.left;
if ("right" in c) e.right = c.right;
if ("buttonOffset" in c) e.buttonOffset = c.buttonOffset
}
this.m_isShowingOverlays && a.showOverlay();
this.frameCmd("show", e, d);
return a
};
this.createApp = function(a) {
var b;
b = gCIM.apps[a] = new cim.apps[a](this), a = b;
a.create && a.create(cim.api);
return this
};
this.createFrame = function(a, c, d) {
switch (a) {
case "bar":
d = cim.Bar;
break;
case "meeboMenu":
d = cim.meeboMenu.View;
break;
case "im":
d = cim.IMPlt;
break;
case "tray":
d = cim.Tray;
break;
case "overlay":
d = cim.Overlay;
break;
case "resize":
d = cim.ResizeFrame
}
d = d || cim.Frame;
this.m_channel && this.m_channel.registerWindow(c);
var e = (new d(a)).create(c, c.document.body).subscribe("Focus", this, hitch(this, "onFrameFocus", e)).subscribe("OverlayClick", this, "onOverlayClick").subscribe("MouseDown", this, hitch(this, "onFrameMouseDown", e));
return this.m_frames[a] = e
};
this.upgradeFrame = function(a, c) {
typeof c == "string" && (c = Class.getObject(c));
var d = this.m_frames[a];
return !d ? void 0 : d instanceof
c ? d : this.createFrame(a, d.getWindow(), c)
};
this.onFrameFocus = function(a) {
if (a != this.m_focusedFrame) this.m_focusedFrame && this.m_focusedFrame.blur(), this.m_focusedFrame = a
};
this.onFrameMouseDown = function(a) {
ui.isIE && this.frameCmd("checkSelection");
this.publish("MouseDown", a)
};
this.getFrame = function(a) {
return this.m_frames[a]
};
this.setupFrame = function(a, c, d) {
var e = this.m_createReqs[a];
e || (this.frameCmd("create", {
id: a
}), this.m_createReqs[a] = e = new lib.Callback);
e.add.apply(e, Array.prototype.slice.call(arguments, 1));
return e
};
this.onFrameReady = function(a) {
var c = util.url(a.location.href).getHash("id"),
d = this.m_frameDefs[c],
e = this.m_createReqs[c] = this.m_createReqs[c] || new lib.Callback,
f = new lib.Callback;
!d && /^partner-/.test(c) && (d = "tray");
d ? cim.util.loadCSS(a, d, f.getCallback()) : f.fire();
f.add(hitch(this, function() {
this.createSandboxUI(hitch(this, function() {
var d = this.m_frames[c] = this.createFrame(c, a);
e.fire(d)
}))
}))
};
this.getFramePos = function(a) {
var c = this.m_frames,
d = this.getStyle(),
e = c.bar,
f = c.overlay.getWidth() - e.getWidth() - d.bar.margin,
g = d.bar.margin,
d = c.overlay.getHeight() - e.getHeight();
switch (c[a].getId()) {
case "overlay":
return {
x: 0,
y: 0
};
case "bar":
return {
x: f,
y: d
};
case "tray":
return {
x: f + e.getTrayOffset() - g * 2,
y: d - c.tray.getHeight()
};
case "im":
return a = c.im, c = a.getTabOffset(), {
x: c.x + c.w - a.getWidth(),
y: d - a.getHeight()
}
}
};
this.onOverlayClick = function() {
this.m_currentMenu && this.m_currentMenu.close();
this.hideOverlays();
this.publish("OverlayClick")
};
this.onWorldMouseDown = function() {
this.m_currentMenu && this.m_currentMenu.close();
this.publish("MouseDown")
};
this.showOverlays = function() {
this.m_isShowingOverlays = !0;
for (var a in this.m_frames) this.m_frames[a].showOverlay && this.m_frames[a].showOverlay()
};
this.hideOverlays = function() {
this.m_isShowingOverlays = !1;
for (var a in this.m_frames) this.m_frames[a].hideOverlay && this.m_frames[a].hideOverlay()
};
this.onOpenMenu = function(a) {
this.m_currentMenu && this.m_currentMenu.close();
this.m_currentMenu = a;
this.showOverlays()
};
this.onCloseMenu = function(a) {
if (a == this.m_currentMenu) this.m_currentMenu = null, this.hideOverlays()
};
this.showPopupURL = function(a) {
this.frameCmd("showPopupURL", a)
};
this.setDragHoverPopupURL = function(a) {
if (!this.m_hoverState || this.m_hoverState.popupURL != a) a == !0 ? this.setDragHoverState({
showLoadingPopup: !0
}) : this.setDragHoverState({
popupURL: a
})
};
this.getDragHoverState = function() {
return this.m_hoverState
};
this.setDragHoverState = function(a) {
if (this.m_hoverState != a) this.m_hoverState = a, this.sendDragHoverState()
};
this.clearDragHoverState = function() {
this.m_hoverState = null;
this.sendDragHoverState()
};
this.sendDragHoverState = createDelayedMethod("sendDragHoverState", function() {
this.frameCmd("hoverStateChange", this.m_hoverState)
});
this.minimize = function(a) {
a == "tray" && (this.getFrame("tray").getCurrentView() instanceof
cim.feeds.LiveUpdatesView ? cim.util.track.UIAction({
area: "lupdate",
element: "minimize"
}) : this.getFrame("tray").getCurrentView() instanceof
cim.BuddyList && cim.util.track.UIAction({
area: "msngr",
element: "minimize"
}));
this.getFrame(a).hideView({
origin: "world"
})
};
this.savePaletteHeight = function(a) {
this.getFrame(a.id).setHeightState(a.height)
};
this.minimizeEverything = function(a) {
this.onCmd({
name: "minimizeAll",
data: a
});
this.frameCmd("minimizeAll", a)
};
this.restoreEverything = function(a) {
this.onCmd({
name: "restoreAll",
data: a
});
this.frameCmd("restoreAll", a)
}
});
gFrameMgr = new cim.FrameMgr;
Class("cim.Bar", cim.Frame, function(a) {
this.initialize = function() {
this.m_statusShowing = !0;
a(this, "initialize", arguments);
cim.util.track.trigger()
};
this.createContent = function() {
a(this, "createContent", arguments);
this.m_fadeAnimation = new ui.Animation({
duration: 300,
subject: hitch(gFrameMgr, "publish", "ButtonHighlight")
});
this.m_fadeAnimation.jumpTo(0);
gFrameMgr.addListener("setHighlight", this, function(a) {
var c = this.m_fadeAnimation;
a ? c.seekTo(1) : c.seekTo(0)
})
};
this.addElement = function(a) {
this.m_element.appendChild(a.getElement())
};
this.addButton = function(a) {
this.addElement(a.create(this.m_win))
};
this.showStatus = function(a) {
this.m_statusShowing = !0;
gFrameMgr.frameCmd("showStatus", a)
};
this.hideStatus = function() {
this.m_statusShowing = !1;
gFrameMgr.frameCmd("hideStatus")
};
this.collapseStatus = function() {
gFrameMgr.frameCmd("collapseStatus")
};
this.expandStatus = function() {
gFrameMgr.frameCmd("expandStatus")
};
this.setStatusToggled = function(a) {
gFrameMgr.frameCmd("toggleStatus", a)
};
this.isStatusShowing = function() {
return this.m_statusShowing
};
this.getTrayOffset = function() {
return this.getWidth() - gFrameMgr.getFrame("tray").getWidth()
}
});
cim.session = Singleton(function() {
this.m_sessionCache = {};
this.load = function() {
if (!meebo.util.session.load()) return {};
var a = cim.storage.load(cim.session.KEY);
a && typeof a == "object" ? copyProperties(a, this.m_sessionCache) : a = this.m_sessionCache;
return a
};
this.save = function(a, b) {
this.m_sessionCache[a] = b;
this._save()
};
this._save = createDelayedMethod("_save", function() {
var a = this.load();
cim.storage.save(cim.session.KEY, a);
this.m_sessionCache = {}
});
this.erase = function() {
cim.storage.erase(cim.session.KEY);
this.m_sessionCache = {}
}
});
cim.session.KEY = "sessionCache";
Class("cim.Palette", cim.Frame, function(a) {
this.initialize = function(b) {
a(this, "initialize", arguments);
this.m_views = {};
this.m_currentView = null;
this.m_isShowing = !1;
this.m_titleText = "";
this.m_hasCustomHeight = !1;
this.m_group = 0;
this.subscribeOnce("ViewShow", this, "onFirstShow");
gPubSub.subscribe("cim.Palette::ViewShow", this, "globalOnViewShow")
};
this.getTabContainer = function() {
return this.m_tabContainer
};
this.getDropTargetElement = function() {
return this.m_content
};
this.hasCustomHeight = function() {
return this.m_hasCustomHeight
};
this.createContent = function() {
a(this, "createContent");
gFrameMgr.getStyle();
this.m_content = this.m_element.appendChild(this.dom("meebo-110"));
this.m_titlebar = this.m_element.appendChild(this.dom("meebo-111", "a"));
ui.connectEvent(this.m_content, "mousedown", this, "focus")
};
this.setTabContainer = function(a) {
this.m_tabContainer = a;
return this
};
this.removeTitlebar = function() {
removeElement(this.m_titlebar);
this.m_titlebar = null;
this.m_content.style.top = "0px";
return this
};
this.onFirstShow = function() {
this.m_titlebar && disableSelection(this.m_titlebar, !0)
};
this.onTitleChange = function(a, c) {
a == this.m_currentView && this.setTitle(c)
};
this.getGroup = function() {
return this.m_group
};
this.setGroup = function(a) {
this.m_group = a;
return this
};
this.setTitle = function(a) {
if (this.m_titlebar) return this.m_titleText = a, this.m_titlebar && a && (ui.isGecko ? setTruncatedText(this.m_win, this.m_titlebar, a, 195) : setText(this.m_titlebar, a)), disableSelection(this.m_titlebar, !0), this
};
this.setTitleLink = function(a) {
this.m_titlebar.href = a;
this.m_titlebar.target = "_new"
};
this.getTitleLink = function() {
return this.m_titlebar
};
this.setPreferredHeight = function(a, c) {
a != this.m_height && (gFrameMgr.frameCmd("resize", {
id: this.m_id,
height: a
}), c || this.setHeightState(a))
};
this.setHeightState = function(a) {
a = a || this.m_height;
a != gFrameMgr.getStyle().palette.height && cim.uistate.set("@" + this.m_id, {
height: a
})
};
this.onHeightState = function(a) {
(a = a && a.height) && a != this.m_height && this.setPreferredHeight(a, !0)
};
this.getContentLeft = function() {
return this.m_contentLeft || 0
};
this.getContentHeight = function() {
var a = gFrameMgr.getStyle().palette;
return this.getHeight() - (this.m_titlebar ? a.titlebar.height : 0)
};
this.onResize = function() {
a(this, "onResize", arguments);
this.resize()
};
this.resize = function() {
this.m_isShowing && this.m_currentView && this.getContentHeight() > 0 && this.m_currentView.resize()
};
this.position = function() {
var a = {};
this.setFramePosition && this.setFramePosition(a);
gFrameMgr.showFrame(this, a)
};
this.globalOnViewShow = function(a) {
a != this && this.m_group == a.m_group && this.minimize()
};
this.focus = function(a) {
this.publish("Focus");
this.m_currentView && this.m_currentView.focus(a && a.dontFocus)
};
this.showView = function(a) {
if (isNumber(a.view)) {
var c = this.m_tabContainer.getTabs().length;
if (a.view < 0) a.view = a.view % c + c;
c = this.m_tabContainer.getTab(a.view % c);
if (c.getData) a.view = c.getData()
}
if (isString(a.view) && (a.view = this.m_views[a.view], !a.view)) return !1;
this.m_currentView == a.view ? this.m_isShowing ? a.callback && a.callback() : this.showViewCallback(a) : (this.m_views[a.view.getId()] || this.addView(a.view), a.view.create(this), this.publish("BeforeViewShow", a), c = hitch(this, "showViewCallback", a), this.m_tabContainer && a.view.getTab() && this.m_tabContainer.scrollTo ? this.m_tabContainer.scrollTo(a.view.getTab(), c) : c())
};
this.showViewCallback = function(a) {
if (this.m_currentView && this.m_currentView != a.view) {
var c = shallowCopy(a);
c.view = this.m_currentView;
c.newView = a.view;
c.swappingViews = !0;
this.hideView(c)
}
this.m_currentView = a.view;
a.view.appendElementTo(this.m_content);
a.view.setDisplay(!0);
this.setTitle(a.view.getTitle());
this.m_element.style.visibility = "hidden";
this.m_element.style.display = "block";
this.m_isShowing = !0;
this.resize();
this.setFramePosition && this.setFramePosition(a);
gFrameMgr.showFrame(this, a, hitch(this, function() {
this.focus(a)
}));
cim.trackActiveUser();
gPubSub.publish(this, "cim.Palette::ViewShow");
this.publish("ViewShow", a);
if (a.view.onShow) a.view.onShow(a);
a.callback && a.callback();
this.m_element.style.visibility = "visible"
};
this.hasView = this.getView = function(a) {
return this.m_views[a]
};
this.addView = function(a, c, d) {
var e = a.getViewId();
if (this.m_views[e]) return a;
this.m_views[e] = a;
a.setParent(this);
e = a.getTab();
this.m_tabContainer && e && (e.getParent() != this.m_tabContainer && e.setParent(this), isNumber(c) || (c = this.m_tabContainer.getHighSortIndex() + 1), this.m_tabContainer.addTab(e, c, d), this.m_tabContainer.redraw(), this.setButton(e), (e = a.getTab()) && e.setData && e.setData(a));
return a
};
this.removeView = function(a) {
a || (a = {});
if (!a.view) a.view = this.m_currentView;
var c = a.view;
if (c && (removeElement(a.view.m_element), a.view == this.m_currentView && this.hideView(a), delete this.m_views[c.getId()], this.m_tabContainer && this.m_tabContainer.removeTab(c.getTab()), this.publish("ViewRemove", a), this.m_currentView == c && (this.m_currentView = null, this.m_isShowing))) this.m_element.style.display = "none", this.m_isShowing = !1
};
this.minimize = function(a) {
this.m_isShowing && this.hideView(a)
};
this.yield = function() {
this.m_yieldedView = this.isShowing() ? this.getCurrentView() : null;
this.minimize()
};
this.restore = function() {
if (this.m_yieldedView) this.showView({
view: this.m_yieldedView
}), this.m_yieldedView = null
};
this.showNextView = function() {
var a = this.m_tabContainer.getNextTab(this.m_currentView.getTab());
a && a.getData().show();
return !!a
};
this.showPrevView = function() {
var a = this.m_tabContainer.getPrevTab(this.m_currentView.getTab());
a && a.getData().show();
return !!a
};
this.toggleView = function(a) {
!this.m_isShowing || this.m_currentView != a.view ? this.showView(a) : this.hideView(a)
};
this.hideView = function(a) {
a || (a = {});
if (!a.view) {
if (!this.m_currentView) return;
a.view = this.m_currentView
}
a.origin != "world" && gFrameMgr.hideFrame(this, a);
if (a.view.onBeforeHide) a.view.onBeforeHide();
this.publish("BeforeViewHide", a);
if (a.swappingViews) a.view.setDisplay(!1), this.m_currentView = null;
else if (this.m_isShowing && a.view == this.m_currentView) this.m_element.style.display = "none", this.m_isShowing = !1;
if (a.view.onHide) a.view.onHide(a);
this.publish("ViewHide", a)
};
this.isShowing = function() {
return this.m_isShowing && this.m_currentView
};
this.getCurrentView = function() {
return this.m_currentView
};
this.setButton = function(a) {
if (a != this.m_button)(this.m_button = a) && a.setPalette(this);
this.onResizeButton();
return this
};
this.setButtonOffset = function(a) {
var c = this.m_buttonOffset;
if (!c || a.x != c.x || a.w != c.w) this.m_buttonOffset = a, gFrameMgr.frameCmd("setButtonOffset", {
id: this.m_id,
offset: a
});
return this
};
this.onResizeButton = function() {
var a = this.m_button;
a && this.setButtonOffset(getElementOffset(a.getElement()))
}
});
cim.Palette.numGroups = 1;
cim.Palette.newGroup = function() {
return cim.Palette.numGroups++
};
cim.Palette.groupTray = cim.Palette.newGroup();
Class("cim.meeboMenu.View", ui.Element, function(a) {
this.initialize = function() {
a(this, "initialize", arguments);
gFrameMgr.addListener("meeboMenu", this, "handleMeeboMenuData")
};
this.createContent = function() {
var b;
this.addClassName(cim.skin.className);
this.handleMeeboMenuData({
open: !0
});
this.addClassName("meebo-0");
gPubSub.subscribe("meebo.Logon::changeState", this, "_renderAccountInfo");
this.m_element.innerHTML = "<ul></ul>";
var a = this.m_list = this.m_element.children[0];
a.innerHTML = '<li><a href="#">' + sprintf(gLang.signOff, gCIM.partnerName) + "</a></li>";
var c = this.m_online = a.children[0];
ui.attachEvent(c.children[0], "click", function(a) {
ui.preventDefault(a || window.event);
gApp.disconnect()
});
a.removeChild(this.m_online);
a.innerHTML = '<li><a href="#">.</a></li>';
b = (this.m_offline = a.children[0]).children[0], a = b;
ui.attachEvent(a, "click", function(a) {
ui.preventDefault(a || window.event);
cim.util.connect()
});
this.m_offlineText = a.firstChild;
this.m_active = this.m_offline;
this._renderAccountInfo()
};
this._renderAccountInfo = function() {
var a = !! cim.session.load().online;
if (this.m_accountSignedOn !== a) {
this.m_accountSignedOn = a;
this.m_list.removeChild(this.m_active);
this.m_list.appendChild(this.m_active = a ? this.m_online : this.m_offline);
if (!a) this.m_offlineText.nodeValue = sprintf(gCIM.mcim ? gLang.goOnline : gLang.signIn, gCIM.partnerName);
gFrameMgr.frameCmd("meeboMenu", {
show: a
})
}
};
this.handleMeeboMenuData = function(a) {
var c = gFrameMgr.getFrame("tray");
c && a.open === !0 && c.minimize()
}
});
Class("ads.AdView", function() {
this.initialize = function(a, b) {
this.m_props = a;
this.setProp("share", b);
this.setUrl(a.url)
};
this.isDirectResponse = function() {
return this.m_props.type == "bulk"
};
this.getUrl = function() {
return this.m_url
};
this.setUrl = function(a) {
this.m_url = new util.URL(a);
this.setProp("url", a);
return this
};
this.getProps = function() {
return this.m_props
};
this.getProp = function(a) {
return this.m_props[a]
};
this.setProp = function(a, b) {
this.m_props[a] = b;
return this
};
this.setPropsDefault = function(a) {
var b, c = this.m_props;
for (b in a) b in c || (c[b] = c[b] || a[b])
};
this.getType = function() {
return isArray(this.m_props.type) ? this.m_props.type : [this.m_props.type]
}
});
Class("ads.Ad", function() {
this._adViewCtor = ads.AdView;
this.m_productNameMap = {
AnimatedMediaAlert: "ama",
BorderlessCanvas: "borderless",
bulk: "dr",
DRELightbox: "dre",
DRMediaAlert: "dr",
Elevator: "elevatedFeature",
LightboxedCanvas: "lightbox",
MediaAlert: "ma",
MediaAlertPlus: "map",
MediumRect: "useDimensions",
RectInvitation: "useDimensions"
};
this.m_interstitialNameMap = {
BorderlessCanvas: "canopy",
Elevator: "elevatedPreview"
};
this.initialize = function(a, b) {
this.m_location = a;
this.m_props = b;
b.gen = b.gen || 1;
if (!b.blank && a == "MediaAlert") this.m_invitation = new this._adViewCtor(this.m_props.invitation, b.share), this.m_engaged = new this._adViewCtor(this.m_props.engaged, b.share), this.m_interstitial = this.m_props.interstitial && new this._adViewCtor(this.m_props.interstitial, b.share)
};
this.getLocation = function() {
return this.m_location
};
this.getProp = function(a) {
return this.m_props[a]
};
this.getProps = function() {
return this.m_props
};
this.getInvitation = function() {
return this.m_invitation
};
this.getEngaged = function() {
return this.m_engaged
};
this.getInterstitial = function() {
return this.m_interstitial
};
this.getTooltip = function() {
return this.m_tooltip
};
this.getState = function() {
return this.m_state
};
this.setState = function(a) {
this.m_state = a;
return this
};
this.getProduct = function() {
return this.m_currentProduct
};
this.getPreviousProduct = function() {
return this.m_previousProduct
};
this.setProduct = function(a, b) {
this.m_previousProduct = this.m_currentProduct;
this.m_currentProduct = this.formatProduct(a, b);
return this
};
this.getAdPack = function() {
if (this.m_adPack) return this.m_adPack.join("-");
var a = this.m_adPack = [],
b = this.m_interstitial,
c = this.m_engaged;
b && a.push(this.formatProduct(b.getType(), "interstitial"));
a.push(this.formatProduct(this.m_invitation.getType(), "invitation"));
c && a.push(this.formatProduct(c.getType(), "engaged"));
return a.join("-")
};
this.formatProduct = function(a, b) {
for (var a = isArray(a) ? a : [a], b = b || this.getState(), c = function(a) {
return 50 * Math.round(a / 50)
}, d = 0, e; d < a.length; d++) e = a[d], e = b == "interstitial" && this.m_interstitialNameMap[e] || this.m_productNameMap[e], e == "useDimensions" ? (e = this["m_" + b], a[d] = c(e.getProp("width")) + "x" + c(e.getProp("height"))) : e && (a[d] = e);
return a.join("/")
};
this.hasInterstitial = function() {
return !!this.m_interstitial
};
this.isDirectResponse = function() {
return this.m_engaged.isDirectResponse()
};
this.setProp = function(a, b) {
this.m_props[a] = b
};
this.pushToArrProp = function(a, b) {
this.m_props[a] || (this.m_props[a] = []);
this.m_props[a] = this.m_props[a].concat(b)
};
this.track = function(a, b, c) {
var d = {
component: this.m_location,
tcookie: gTargeting.getTCookie()
},
e = a.type && a.type == "impression";
if (this.m_props.share) d.shareId = this.m_props.share;
copyProperties(d, gAdServer.getTrackingParams());
copyProperties(d, a);
meebo.util.createTrackingPixel(d, b || window.gLogon && gLogon.getLogons() || [], c, null, e);
return d
};
this.trackEvent = function(a) {
a.tcookie = gTargeting.getTCookie();
a.bcookie = gCIM.bcookie;
a.partner = gCIM.network;
a.shareId = this.getProp("share");
a.orderId = this.getProp("orderId");
a.adId = this.getProp("adId");
a.creativeId = this.getProp("creativeId");
a.targetingProp = "signal";
meebo.util.createTrackingPixel(a, null, null, "//rd.meebo.com/a/a.gif", a.eventType && a.eventType == "initialLoad")
};
this.trackImpression = function(a) {
var b = {};
this._trackRDImpression(a);
(a = this.m_props.impressionUrl || this.m_props.impression) && (new ui.TrackingPixel(b, a, !0)).create();
this.m_props.partnerImpression && (new ui.TrackingPixel({}, this.m_props.partnerImpression, !0)).create()
};
this._trackRDImpression = function(a) {
var b = {
type: "impression",
tcookie: gTargeting.getTCookie()
};
copyProperties(b, a);
this.track(b)
};
this.hasProps = function() {
return !!this.m_props
}
});
Class("ads.Targeting", lib.Publisher, function(a) {
this.initialize = function() {
a(this, "initialize");
this.m_targeting = {};
this.m_dclkTargeting = {};
this.m_providerPlacementTimes = {};
this.m_tcookie = "";
this.m_hasTransferedCookies = !1;
this.m_data = {
skipPublish: !1
};
this.m_useLocalStorage = !! window.localStorage;
this.loadTCookie();
this.m_published = !1;
this._subscribeToEvents()
};
this._subscribeToEvents = function() {
gApp.subscribe("ChangeState", this, "onAppChangeState");
gClient.subscribe("info::targeting", this, "setTargeting")
};
this.clearTStore = function() {};
this.getTCookie = function() {
return this.m_tcookie
};
this.isOptOut = function() {
return this.m_tcookie == "OPT_OUT"
};
this.getTargeting = function() {
return this.m_targeting
};
this.getProviderTimes = function() {
return this.m_providerPlacementTimes
};
this.loadTCookie = function() {
if (!this.m_tcookie) {
var a = util.cookie.load("tcookie");
if (!a || a == "undefined") a = util.bcookie.generate() + "&false", util.cookie.save("tcookie", a), this.clearTStore();
a = a.split("&");
this.m_tcookie = a[0];
this.m_hasTransferedCookies = a[1] == "true";
for (var c = 2; c < a.length; c++) {
var d = a[c].split("=");
/^pts/.test(d[0]) && (this.m_providerPlacementTimes[d[0].substring(4)] = parseInt(d[1]))
}
}
};
this.saveTCookie = function() {
if (!this.isOptOut()) {
var a = [this.m_tcookie, this.m_hasTransferedCookies],
c;
for (c in this.m_targeting) a.push(c + "=" + encodeURIComponent(this.m_targeting[c]));
for (c in this.m_providerPlacementTimes) a.push("pts_" + c + "=" + this.m_providerPlacementTimes[c]);
util.cookie.save("tcookie", a.join("&"))
}
};
this.setTargeting = function(a, c) {
for (var d in a) d in this.m_targeting || (this.m_targeting[d] = a[d].value || a[d]);
if ("age" in this.m_targeting && !("age_bucket" in this.m_targeting)) {
var e = this.m_targeting.age,
f = null;
e >= 55 ? f = "55over" : e >= 50 ? f = "50-54" : e >= 45 ? f = "45-49" : e >= 35 ? f = "35-44" : e >= 25 ? f = "25-34" : e >= 21 ? f = "21-24" : e >= 18 ? f = "18-20" : e >= 16 ? f = "16-17" : e >= 13 && (f = "13-15");
f ? this.m_targeting.age_bucket = f : delete this.m_targeting.age
}
if (this.m_useLocalStorage) {
if (!this.m_dclkCategories) try {
this.m_dclkCategories = JSON.parse(cim.storage.load("dcc", !0))
} catch (g) {}
this.m_dclkCategories = this.m_dclkCategories || {};
for (d in this.m_targeting) d in this.m_dclkCategories && (this.m_dclkTargeting[d] = this.m_targeting[d])
}
this.saveTCookie();
if (!c && !this.m_published) this.publish("ready"), this.m_published = !0
};
this.setProviderTimes = function(a) {
this.m_providerPlacementTimes = a
};
this.trackCategory = function(a, c) {
return this.isOptOut() ? (c || this.publish("ready"), this.clearTStore(), !0) : !1
};
this.onTrackCategory = function() {
this.m_hasTransferedCookies = !! this.m_data.tcookie;
this.setTargeting(this.m_data.targeting || this.m_data.categories || {}, this.m_data.skipPublish)
};
this.onAppChangeState = function() {
gApp.unsubscribe("ChangeState", this, "onAppChangeState");
setTimeout(hitch(this, "setTargeting", {}), 4E3)
}
});
Class("ads.TargetingPixelMgr", lib.Publisher, function(a) {
this.initialize = function(b, c) {
a(this, "initialize");
this.m_providerTimes = gTargeting.getProviderTimes();
this.m_partnerExclusions = b || {};
this.m_isSSL = window.location.protocol == "https:";
this.m_urlReplacements = {
tcookie: gTargeting.getTCookie(),
url: "",
timezone: (new Date).getTimezoneOffset(),
referrer: ""
};
c && copyProperties(this.m_urlReplacements, c)
};
this.placeProviderPixels = function() {
for (var a = gCIM.btproviders, c, d, e, f = 0; f < a.length; f++) if (c = a[f], (d = this.m_isSSL ? c.sslUrl : c.url) && this._shouldPixelBePlaced(c)) d = new util.URL(d), e = this._urlSubstitution(util.url.uriToObject(d.search), this.m_urlReplacements), delete d.search, (new ui.TrackingPixel(e, d.toString(), !1, c.useScriptTag)).create(window), c.interval && (this.m_providerTimes[c.code] = (new Date).getTime());
gTargeting.setProviderTimes(this.m_providerTimes);
gTargeting.saveTCookie()
};
this._urlSubstitution = function(a, c) {
var d, e;
for (d in a) d ? typeof a[d] != "undefined" && (e = a[d].substring(2, a[d].length - 2), e in c && (a[d] = c[e])) : delete a[d];
return a
};
this._shouldPixelBePlaced = function(a) {
var c = a.percentage || 1,
d = (new Date).getTime();
return !(this.m_partnerExclusions[a.code] || !(a.interval && d - (this.m_providerTimes[a.code] || 0) > a.interval || a.percentage && c >= Math.random()))
}
});
Class("ads.Server", function() {
this.initialize = function(a, b) {
this.m_defaultCallbackId = "unspecifiedShareCallback";
this.m_pendingCallbacks = {};
this.m_loadProfiles = a;
this.m_defaultTrackingParams = b || {};
this.m_adCtor = ads.Ad
};
this.load = function(a) {
a instanceof
Array || (a = [a]);
for (var b = (new Date).getTime(), c = a.length > 1, d = 0, e; e = a[d]; d++) e.type in this.m_loadProfiles && (c && copyProperties(e, {
tile: d + 1,
ord: b
}), this.m_pendingCallbacks[e.shareId && e.shareId != "static" ? e.shareId + this.m_loadProfiles[e.type].location : this.m_defaultCallbackId + this.m_loadProfiles[e.type].location] = e.callback || this.m_loadProfiles[e.type].callback, e.shareId && e.shareId.length == 32 ? this.loadFromAdShare(this.m_loadProfiles[e.type].location, e.shareId) : this.m_loadProfiles[e.type].load(e))
};
this.loadFromAdShare = function(a, b) {
var c = hitch(this, function(b, c) {
if (c && b.stat == "ok" && b.data) this.onAdLoaded(a, b.data)
});
meebo.util.cmd("adshare", {
shareid: b
}, c)
};
this.loadDoubleClickAd = function(a, b) {
DoubleClick.loadAd(a, b)
};
this.getTrackingParams = function() {
return this.m_defaultTrackingParams
};
this.onAdLoaded = function(a, b) {
a == "MediaBar" && this.normalize(b);
document.location.protocol == "https:" && this.requireHttps(b);
b.isSharable = !b.notSharable;
if (b.blank) b.share = "blank";
var c = new this.m_adCtor(a, a == "MediaAlert" ? this.translateAd(b) : b),
d = this.m_pendingCallbacks[b.share + a] || this.m_pendingCallbacks[this.m_defaultCallbackId + a];
delete this.m_pendingCallbacks[this.m_defaultCallbackId + a];
delete this.m_pendingCallbacks[b.share + a];
d && d(c)
};
this.shareClick = function(a, b, c, d) {
if (a.share.length != 32) return d();
a = {
site: b,
shareid: a.share
};
b = hitch(this, function(a, b) {
!b || a.stat != "ok" || !a.data ? d() : c(a.data)
});
meebo.util.cmd("adshare", a, b)
};
this.requireHttps = function(a) {
var b = /^http:\/\/share.meebo.com/i,
c = /^http:\/\//gi,
d;
for (d in a) if (a[d] instanceof
Array) for (var e = 0; e < a[d].length; e++) a[d][e].replace && (a[d][e] = a[d][e].replace(b, "https://s-ssl.meebocdn.net/share/"), a[d][e] = a[d][e].replace(c, "https://"));
else if (typeof a[d] == "string") a[d] = a[d].replace(b, "https://s-ssl.meebocdn.net/share/"), a[d] = a[d].replace(c, "https://");
else if (typeof a[d] == "object") for (var f in a[d]) a[d][f].replace && (a[d][f] = a[d][f].replace(b, "https://s-ssl.meebocdn.net/share/"), a[d][f] = a[d][f].replace(c, "https://"))
};
this.normalize = function(a) {
a.impression = a.impression || a.impressionUrl;
a.leaderboard = a.leaderboard || a.leaderboardUrl;
a.engaged = a.engaged || a.engagedUrl;
a.buddyIcons = a.buddyIcons || a.buddyIconUrls;
a.wallpapers = a.wallpapers || a.wallpaperUrls;
a.wallpaperThumbnails = a.wallpaperThumbnails || a.wallpaperThumbnailUrls;
a.click = a.click || a.clickUrl
};
this.translateAd = function(a) {
var b = a.gen || 1;
if (a.blank) return a;
for (; b < this.adTranslators.length;) a = this.adTranslators[b++](a);
return a
};
this.adTranslators = [null, function(a) {
a = shallowCopy(a);
a.gen = 2;
typeof a.icon == "string" ? (a.invitation = {
type: a.type == "bulk" ? "DRMediaAlert" : "MediaAlert",
icon: a.icon,
title: a.title,
text: a.text,
disableIconResize: a.disableIconResize
}, delete a.icon, delete a.title, delete a.text, delete a.disableIconResize) : typeof a.icon == "object" ? (a.invitation = {
type: "AnimatedMediaAlert",
icon: a.icon.img,
swf: a.icon.swf,
title: a.title,
text: a.text
}, delete a.icon, delete a.title, delete a.text) : a.type == "standard" ? (a.invitation = {
type: "RectInvitation",
url: a.invitationUrl,
text: a.text,
exposureTime: a.exposureTime
}, a.engaged = {
type: "bulk"
}, delete a.invitationUrl, delete a.text, delete a.exposureTime) : (a.invitation = {
type: "MediaAlertPlus",
url: a.invitationUrl,
height: a.invitationHeight,
width: a.invitationWidth,
forceClickCatcher: !(!a.forceClickCatcher && !a.engaged && !a.engagedUrl && !a.link),
noHover: a.type == "bulk"
}, delete a.invitationUrl);
switch (a.type) {
case "standard":
break;
case "bulk":
a.engaged = {
type: "bulk",
url: a.engaged || a.link
};
delete a.link;
break;
case "bulkexpandable":
a.engaged = {
type: "DRELightbox",
url: a.engaged || a.link,
domain: a.domain
};
delete a.link;
delete a.domain;
break;
case "animated_borderless":
case "borderless":
a.engaged = {
type: "BorderlessCanvas",
engagedHTML: a.engagedHTML,
userParams: a.userParams,
url: a.engaged || a.engagedUrl,
width: a.width,
height: a.height
};
delete a.engagedHTML;
delete a.userParams;
delete a.engagedUrl;
delete a.width;
delete a.height;
break;
default:
a.engaged = {
type: "LightboxedCanvas",
engagedHTML: a.engagedHTML,
userParams: a.userParams,
url: a.engaged || a.engagedUrl,
width: a.width,
height: a.height
}, delete a.engagedHTML, delete a.userParams, delete a.engagedUrl, delete a.height, delete a.width
}
if (a.engaged_interstitial) a.interstitial = {
type: a.engaged.type,
url: a.engaged_interstitial,
width: a.interstitial_width,
height: a.interstitial_height,
exposureTime: a.exposure_time,
msgPrefix: "canopy"
}, delete a.engaged_interstitial, delete a.interstitial_width, delete a.interstitial_height, delete a.exposure_time;
return a
}]
});
Class("ads.DoubleClick", function() {
this.MEDIABAR = "MediaBar";
this.SPARK = "Spark";
this.MEDIAALERT = "MediaAlert";
this.MOBILE = "Mobile";
this.m_sizes = {
Spark: "47x47",
MediaBar: "728x90",
MediaAlert: "24x24",
Mobile: "3x3"
};
this.m_positions = {
Spark: 1,
MediaBar: 1,
MediaAlert: 1,
Mobile: 1
};
this.m_limits = {
kvs: 1E3,
total: 2E3
};
this.m_impressionRegex = /imp;v\d+;[a-z]+;(\d+);\d+(-\d+)?;\d+;\d+;\d+(\/|\|)\d+;\d+(\/|\|)(\d+)(\/|\|)\d+;/i;
this.m_deprecatedTrackingPrefs = ["ama_allowed", "borderless_allowed"];
this.initialize = function() {
this.m_url = document.location.protocol + "//ad.doubleclick.net"
};
this.getAdTypes = function() {
return [this.SPARK, this.MEDIABAR, this.MEDIAALERT]
};
this.setPosition = function(a, b) {
this.m_positions[a] = b
};
this.getPosition = function(a) {
return this.m_positions[a]
};
this.getOrderId = function(a) {
return a.getProp("orderId")
};
this.getAdId = function(a) {
return a.getProp("adId") || this.getImpressionGroup(a, 1)
};
this.getCreativeId = function(a) {
return a.getProp("creativeId") || this.getImpressionGroup(a, 5)
};
this.getImpressionGroup = function(a, b) {
var c = (a.getProp("impression") || a.getProp("impressionUrl") || "").match(this.m_impressionRegex);
if (c && c[b]) return c[b]
};
this.loadAd = function(a, b) {
util.script({
src: this.getUrl(a, b)
})
};
this.getUrl = function(a, b, c) {
var b = b || {},
c = c || "pfadx",
d = b.shareId,
e = shallowCopy(gTargeting.getTargeting(!0)),
f = gCIM.apps.ads.getSessionInfo(),
g = b.site,
h = b.subnetwork || "",
i = ";ord=" + (b.ord || (new Date).getTime()) + "?",
j = ";u=ip*" + gCIM.clientIP,
k = b.tile,
m = b.keyValuePairs || {},
n = this.m_deprecatedTrackingPrefs;
b.targeting && copyProperties(e, b.targeting);
if (f) e.pvs = f.pvs, e.direct = f.direct;
for (var b = 0, l; b < n.length; b++) l = n[b], l in m && l in e && delete e[l];
g || (g = a == this.MOBILE ? "meebomobile" : a == this.MEDIABAR && util.flash.getVersion().major < 7 ? "meebostatic" : d ? "meeboshare" : window.location.protocol == "https:" ? "meebo.comsecure" : "meebo.com");
c = this.m_url + "/" + c + "/" + g + "/" + h + ";";
b = [];
g = [];
this.addKV(b, "dcmt", "text/javascript", !1);
this.addKV(b, "sz", this.m_sizes[a]);
k && this.addKV(b, "tile", k);
if (d) return this.addKV(b, "dcove", "o"), this.addKV(b, "share", d), c + b.join(";") + i;
else {
m.position = this.m_positions[a] > 4 ? "other" : this.m_positions[a];
this.m_positions[a]++;
for (l in m) this.addKV(b, l, m[l]);
a = c.length + j.length + i.length;
d = b.join(";");
for (l in e) this.addKV(g, l, e[l]);
for (b = 0; b < g.length; b++) {
e = ";" + g[b];
if (!this.shouldAddKV(e.length, d.length, a)) break;
d += e
}
return c + d + j + i
}
};
this.shouldAddKV = function(a, b, c) {
b += a;
return !(b > this.m_limits.kvs || c + b > this.m_limits.total)
};
this.addKV = function(a, b, c, d) {
c = d === !1 ? c : encodeURIComponent(c);
a.push(b + "=" + c)
};
this.onAdLoaded = function() {
gAdServer.onAdLoaded.apply(gAdServer, arguments)
}
});
Class("ads.Mindset", lib.Publisher, function(a) {
this.initialize = function(b) {
a(this, "initialize", arguments);
this.m_mindsetLoaded = !1;
this.m_referrer = b || ""
};
this.create = function(a) {
if (!this.m_mindsetLoaded) {
this.m_mindsetLoaded = !0;
var c = (document.location.protocol == "https:" ? "https://ssl." : "http://") + "syndication.mmismm.com/tntwo.php",
a = a || gWin(window.parent).location.toString(),
d = (new Date).getTimezoneOffset(),
a = util.url(c).addToSearch({
mm_pub: 7333,
u: a,
r: this.m_referrer,
t: d
});
util.script({
src: a
})
}
};
this.handleResponse = function(a) {
var c = a.split(";"),
d = {};
if (a.length > 0) for (a = 0; a < c.length; a++) {
var e = c[a].split("=");
d[e[0]] = e[1]
}
gTargeting.setTargeting(d, !0);
this.publish("Data", d)
};
this.setDocumentReferrer = function(a) {
this.m_referrer = a || ""
}
});
cim.ads = {};
cim.ads.STORAGE_NAME = "meebo-activeAd:" + gCIM.network;
cim.ads.processAd = function(a, b) {
var c = typeof a == "string" ? JSON.parse(a) : null;
c && c.expiration && (new Date).getTime() > c.expiration && (b(), c = null);
if (c) c.isCachedLoad = !0;
return c
};
cim.ads.eraseActiveAd = function() {
util.storage.erase(cim.ads.STORAGE_NAME)
};
cim.ads.loadActiveAd = function() {
return cim.ads.processAd(util.storage.load(cim.ads.STORAGE_NAME), cim.ads.eraseActiveAd)
};
cim.ads.saveActiveAd = function(a) {
util.storage.save(cim.ads.STORAGE_NAME, JSON.stringify(a))
};
Class("cim.apps.ads", function() {
this.m_ad = null;
this.m_adDuration = 180;
this.initialize = function(a) {
this.m_frameMgr = a;
this.m_expandedAd = !1;
a = gNetworks[gCIM.network].getBTOptOut();
this.m_targetingPixelMgr = new ads.TargetingPixelMgr(a, {
referrer: gCIM.dref,
url: gCIM.location.toString()
});
this.m_adGiven = !1;
cim.util.loadCallbacks.im.add(this, function() {
gNetworks[gCIM.network].partnerControlsAds() || (gClient.subscribe("info::rotation", this, "onRotationRateChange"), gApp.subscribe("Attached", this, "onAttach"))
});
cim.storage.load("ad-start-time", !0) || cim.storage.save("ad-start-time", (new Date).getTime(), !0);
this.m_readyCallback = new lib.Callback;
this.m_readyCallback.add(this, "onAdsReady");
this.targetingReady = this.m_readyCallback.getCallback();
this.adParamsReady = this.m_readyCallback.getCallback();
this.m_adParams = {
partnerAdPayload: null,
partnerTakeover: null,
partnerDisableAds: !1
};
this.m_adForced = !0;
gFrameMgr.addListener("setAdParams", this, "setAdParams").addListener("trackAd", this, "trackAd").addListener("trackAdEvent", this, "trackAdEvent").addListener("saveInAdShare", this, "saveInAdShare").addListener("setExpandedAd", this, "setExpandedAd").subscribe("MouseDown", this, "onGlobalMouseDown")
};
this.getSessionInfo = function() {
if (this.m_sessionInfo) return this.m_sessionInfo;
var a = util.cookie.isEnabled() ? util.cookie : util.localSessionStorage,
b = gCIM.network,
c;
try {
c = JSON.parse(a.load("network-session"))
} catch (d) {}
if (!c || c.network != b) c = {
network: b,
pvs: 0
};
c.direct = !c.pvs && !gCIM.dref;
c.pvs++;
this.m_sessionInfo = c;
a.save("network-session", JSON.stringify(c), -1);
return c
};
this.setAdParams = function(a) {
for (prop in a) prop in this.m_adParams && (this.m_adParams[prop] = a[prop]);
this.m_adForced = !1;
this.adParamsReady()
};
this.trackAd = function(a) {
delete a.loc;
this.m_ad.track(a)
};
this.trackAdEvent = function(a) {
delete a.loc;
this.m_ad.trackEvent(a)
};
this.onAttach = function(a) {
if ("rotationInterval" in a) this.m_adDuration = a.rotationInterval
};
this.create = function() {
cim.util.loadCallbacks.im.add(this, function() {
gClient.subscribe("info::drad", this, function(a) {
if (a.stat != "error" && a.stat != "fail") this.onLoadAd(new cim.ads.Ad("MediaAlert", a.data.advertisement))
})
});
gCountry == "US" && !gTargeting.isOptOut() && gNetworks[gCIM.network].isLive() && this.m_targetingPixelMgr.placeProviderPixels();
gFrameMgr.frameCmd("getAdParams", {}, hitch(this, "setAdParams"));
if (gTargeting.isOptOut()) this.targetingReady();
else {
gTargeting.subscribeOnce("ready", this, "targetingReady");
var a = cim.storage.load("meebo-offline", !0);
gTargeting.trackCategory(gCIM.network, util.cookie.load("mcim") && (!a || a == "0"))
}
};
this.onAdsReady = function() {
var a = gNetworks[gCIM.network],
b = [],
c = a.partnerControlsAds();
a.isLive() && !gFrameMgr.isBarHidden() && (!c && !this.m_ad && !this.m_adParams.partnerAdPayload && b.push("MediaAlert"), this.makeAdRequest(b, !1, !1, c))
};
this.makeAdRequest = function(a, b, c, d) {
if (this.shouldLoadAd(b)) {
for (var e, b = [], f = c ? "click" : "page"; c = a.shift();) {
switch (c) {
case "MediaAlert":
e = this.requestMediaAlert()
}
if (e) e.keyValuePairs = e.keyValuePairs || {}, e.keyValuePairs.refresh = f, b.push(e)
}
b.length > 0 && gAdServer.load(b, d)
}
};
this.setExpandedAd = createDelayedMethod("setExpandedAd", function(a) {
this.m_expandedAd = a
}, 100);
this.requestMediaAlert = function() {
var a = cim.ads.loadActiveAd();
if (this.m_adParams.partnerTakeover) return {
type: "PartnerTakeover",
targeting: this.m_adParams.partnerTakeover
};
else if (this.m_adParams.partnerDisableAds) return {
type: "Killshot"
};
else if (a) {
if (util.flash.getVersion().major || a.type == "bulk") this.m_ad = new cim.ads.Ad("MediaAlert", a), this.createAd(this.m_ad, !0)
} else return util.flash.getVersion().major ? {
type: "MediaAlert"
} : {
type: "MediaAlert",
shareId: "static"
}
};
this.onGlobalMouseDown = function() {
if (!this.m_adForced && !gFrameMgr.isWorldShadowShowing() && gNetworks[gCIM.network].isLive() && !gNetworks[gCIM.network].partnerControlsAds()) {
var a = this.m_ad,
a = a && a.getProp && a.getProp("expiration");
!this.m_expandedAd && (new Date).getTime() > a && this.makeAdRequest(["MediaAlert"], !1, !0)
}
};
this.onRotationRateChange = function(a) {
this.m_adDuration = a.interval;
this.m_ad && this.m_ad.saveAsActiveAd(this.m_adDuration * 1E3 - Math.max(0, (new Date).getTime() - this.m_ad.getProp("loadTime")))
};
this.shouldLoadAd = function(a) {
return !(cim.storage.load("hidden") || !a && (!gNetworks[gCIM.network].canShowAds() || !gCIM.showAds))
};
this.loadAd = function(a, b) {
cim.storage.load("ad-position", !0);
var c = b.shareId,
d = b.force,
e = b.tracking,
f = {
type: a
};
if (!(cim.storage.load("hidden") || !d && (!gCIM.showAds || !gNetworks[gCIM.network].canShowAds()))) {
if (a == "MediaAlert") {
if (c) f.shareId = c
} else if (a == "DRMediaAlert") {
if (c) f.adId = c;
if (e) {
if (e.impression) f.impression = e.impression;
if (e.click) f.click = e.click
}
copyProperties(f, {
operating_system: ui.getOS(),
user_agent: ui.getClient() + " " + ui.getVersion()
})
} else if (a == "Vendor") f.ad = b.ad, f.callback = hitch(this, function(a) {
var c = b.ad,
d = {
fan: {
bulkexpandable: {
link: "engaged"
}
}
}[c.getProp("vendor")];
if (d) {
var d = d[c.getProp("type")] || {},
e;
for (e in a.getProps()) d[e] ? c.setProp(d[e], a.getProp(e)) : c.setProp(e, a.getProp(e));
c.deleteProp("request");
c.deleteProp("vendor");
a = c.getProps();
if (a.title && a.text && a.icon) this.onLoadAd(c)
}
});
gAdServer.load(f)
}
};
this.onLoadAd = function(a, b) {
var c = a.getProp("type");
if (c == "DRMediaAlert") return this.loadAd(c, {
shareId: a.getProp("share"),
force: !1,
tracking: {
impression: a.getProp("impression"),
click: a.getProp("click")
}
});
else if (a.getProp("vendor") == "fan") return this.loadAd("Vendor", {
shareId: a.getProp("share"),
force: !1,
ad: a
});
a.getProp("share") != "killshot" && cim.storage.save("ad-position", DoubleClick.getPosition("MediaAlert"), !0);
a.trackImpression({
partner: gCIM.network
});
this.setDoubleClickIDs(a);
if (!this.m_adParams.partnerDisableAds || b) {
this.m_ad = a;
a.setProp("loadTime", (new Date).getTime());
if (!gNetworks[gCIM.network].partnerControlsAds()) c = shallowCopy(gTargeting.getTargeting()), c.shareid = a.getProp("share") || "house", c.partner = gCIM.network, c.clientType = "cim-imbar", meebo.util.cmdOrMCMD("getrotate", c, hitch(this, function(a, b) {
if (b && a != "success" && "data" in a) this.onRotationRateChange(a.data)
})), a.saveAsActiveAd(this.m_adDuration * 1E3);
this.createAd(a)
}
};
this.saveInAdShare = function() {
this.m_ad.saveInAdShare()
};
this.createAd = function(a, b) {
!a.getProp("blank") && a.getProp("share") && a.getProp("gen") == 2 && gFrameMgr.frameCmd("createAd", {
ad: a.getProps(),
skipAnimation: !! b
})
};
this.setDoubleClickIDs = function(a) {
a.setProp("orderId", DoubleClick.getOrderId(a));
a.setProp("adId", DoubleClick.getAdId(a));
a.setProp("creativeId", DoubleClick.getCreativeId(a))
}
});
Class("cim.ads.Server", ads.Server, function(a) {
this.initialize = function() {
a(this, "initialize", [{},
this.getTrackingParams()]);
this.m_adCtor = cim.ads.Ad;
Mindset.subscribe("Data", this, function(a) {
cim.storage.save("mindset", a, !0)
});
gFrameMgr.addListener("loadAd", this, "load");
this.m_partnerAdTimestamp = 0;
this.m_partnerAdTimeout = null;
this.m_requestedAds = {};
this.m_ignoreDelay = !1;
this.m_delayTimeout = null;
this.m_loadingAds = {
MediaAlert: !1
}
};
this.getTrackingParams = function() {
return {
partner: gCIM.network
}
};
this.load = function(a, c) {
for (var d, a = isArray(a) ? a : [a], e = 0; e < a.length; ++e) d = this.m_loadProfiles[a[e].type].location, (!d in this.m_loadingAds || this.m_loadingAds[d]) && a.splice(e, 1);
if (!c || this.m_ignoreDelay) this._load(a);
else {
for (e = 0; e < a.length; ++e) d = a[e], this.m_requestedAds[d.type] = d;
this.m_delayTimeout && clearTimeout(this.m_delayTimeout);
this.m_delayTimeout = setTimeout(hitch(this, "_load"), 500)
}
};
this._load = function(b) {
var c;
b || (b = objectToArray(this.m_requestedAds));
for (var d = 0; d < b.length; ++d) c = this.m_loadProfiles[b[d].type].location, this.m_loadingAds[c] = !0;
this.m_ignoreDelay = !0;
delete this.m_delayTimeout;
a(this, "load", [b])
};
this.loadDoubleClickAd = function(b, c) {
c = c || {};
c.keyValuePairs = c.keyValuePairs || {};
c.keyValuePairs.secure = String(window.location.protocol == "https:");
c.keyValuePairs.canopy_allowed = gTargeting.isCanopyAllowed();
c.keyValuePairs.skin = cim.skin.name;
copyProperties(c.keyValuePairs, gNetworks[gCIM.network].getAdPrefs());
var d = gCIM.network.split(":");
if (d[1]) c.subnetwork = d[1];
a(this, "loadDoubleClickAd", [b, c])
};
this.onAdLoaded = function(b) {
this.m_loadingAds[b] = !1;
a(this, "onAdLoaded", arguments)
};
this.giveAd = function(a) {
this.onAdLoaded("MediaAlert", a)
};
this.callDrads = function(a, c) {
var d = cim.storage.load("ad-position", !0) || 1,
e = gTargeting.getTCookie(),
f = util.url.objectToURI(cim.storage.load("mindset", !0)),
g = (new Date).getTime(),
g = Math.floor((g - (cim.storage.load("ad-start-time", !0) || g)) / 1E3),
d = {
mindset: f,
referrer: gCIM.dref,
partner: gCIM.network,
tcookie: e,
impression_num: d,
session_time: g,
active: cim.storage.load("tracked", !0) ? 1 : 0,
secure: String(window.location.protocol == "https:"),
clientVersion: cim.util.getVersion(),
type: a
};
copyProperties(d, c);
meebo.util.cmdOrMCMD("drads", d, function(a, b) {
if (b && a.data) gCIM.apps.ads.onLoadAd(new cim.ads.Ad("MediaAlert", a.data.advertisement))
})
};
this.clearLoadingAds = function(a) {
for (var a = isArray(a) ? a : [a], c = 0, d; c < a.length; ++c) d = a[c], this.m_loadingAds[d] = !1
};
this.setLoadProfiles = function() {
this.m_loadProfiles = {
MediaAlert: {
load: function(a) {
var c = cim.storage.load("ad-position", !0) || 1;
DoubleClick.setPosition("MediaAlert", c);
copyProperties(a, {
site: gNetworks[gCIM.network].getRevenueId()
});
gAdServer.loadDoubleClickAd("MediaAlert", a)
},
location: "MediaAlert",
callback: hitch(gCIM.apps.ads, "onLoadAd")
},
DRMediaAlert: {
load: hitch(this, "callDrads", "DRMediaAlert"),
location: "MediaAlert"
},
Sponsored: {
load: hitch(this, "callDrads", "Sponsored"),
location: "MediaAlert"
},
Killshot: {
load: function(a) {
gNetworks[gCIM.network].m_showAds && gCIM.showAds && (cim.ads.eraseActiveAd(), a.partnerGiven ? (new ui.TrackingPixel({}, DoubleClick.getUrl("MediaAlert", {
site: gNetworks[gCIM.network].getRevenueId(),
shareId: "partnerkillshot"
}, "adj"))).create() : gAdServer.loadDoubleClickAd("MediaAlert", {
site: gNetworks[gCIM.network].getRevenueId(),
shareId: "killshot"
}), a.impression && (new ui.TrackingPixel({}, a.impression)).create(), (new ui.TrackingPixel({
component: "MediaAlert",
type: "killshot",
partner: gCIM.network,
url: gCIM.location.toString(),
shareId: (a.partnerGiven ? gCIM.network : "") + "killshot",
instance: gCIM.sentinel
})).create())
},
location: "MediaAlert",
callback: hitch(gCIM.apps.ads, "onLoadAd")
},
House: {
load: function(a) {
var c = a.adTypes || ["MediaAlert"];
(new ui.TrackingPixel({}, a.impression)).create();
gAdServer.clearLoadingAds(c);
gCIM.apps.ads.makeAdRequest(c, !1, !1, !0)
},
location: "MediaAlert"
},
Partner: {
load: hitch(this, function(a) {
var c = new cim.ads.Ad("MediaAlert", this.translateAd(a.ad));
if (gCIM.network != "meebo-site") {
if (this.m_partnerAdTimeout) return;
var d = (new Date).getTime(),
e = Math.max(0, this.m_partnerAdTimestamp + 15E3 - d);
if (e) {
this.m_partnerAdTimeout = setTimeout(hitch(this, function() {
this.m_partnerAdTimeout = null;
gAdServer.load(a)
}, e));
return
}
this.m_partnerAdTimestamp = d;
this._generatePartnerPixels("MediaAlert", c)
}
gCIM.apps.ads.onLoadAd(c, !0)
}),
location: "MediaAlert"
},
PartnerTakeover: {
load: function(a) {
a.site = gNetworks[gCIM.network].getRevenueId();
gAdServer.loadDoubleClickAd("MediaAlert", a)
},
location: "MediaAlert",
callback: hitch(gCIM.apps.ads, "onLoadAd")
},
Vendor: {
load: function(a) {
util.script({
src: a.ad.getProp("request")
})
},
location: "MediaAlert"
}
}
};
this._generatePartnerPixels = function(a, c) {
var d = DoubleClick.getUrl(a, {
shareId: "partnersoldinvite",
site: gNetworks[gCIM.network].getRevenueId()
}, "adj"),
e = (new ui.TrackingPixel({
component: a,
type: "impression",
shareId: gCIM.network + "soldinvite",
partner: gCIM.network,
instance: gCIM.sentinel
})).getUrls()[0],
f = DoubleClick.getUrl(a, {
shareId: "partnersoldengaged",
site: gNetworks[gCIM.network].getRevenueId()
}, "adj"),
g = (new ui.TrackingPixel({
component: a,
type: "impression",
shareId: gCIM.network + "soldengaged",
partner: gCIM.network,
instance: gCIM.sentinel
})).getUrls()[0];
c.pushToArrProp("partnerImpression", [d, e]);
c.pushToArrProp("partnerImpression_engaged", [f, g])
}
});
Class("cim.ads.AdView", ads.AdView, function(a) {
this.setUrl = function() {
a(this, "setUrl", arguments);
this.m_url.addToSearch({
type: "cim",
shareId: this.getProp("share")
})
}
});
Class("cim.ads.Ad", ads.Ad, function(a) {
this._adViewCtor = cim.ads.AdView;
this.initialize = function() {
a(this, "initialize", arguments);
var b = this.m_props.type;
if (b == "bulk" || b == "bulkexpandable") this.m_location = "DRMediaAlert";
else if (this.m_props.engaged_interstitial) this.m_location = "Canopy";
this.m_props.gen > 1 && (this.m_engaged && this.m_engaged.setPropsDefault({
isSharable: this.isSharable(),
renderLocation: "overlay"
}), this.m_interstitial && this.m_interstitial.setPropsDefault({
isSharable: this.isSharable()
}))
};
this.deleteProp = function(a) {
delete this.m_props[a]
};
this._trackRDImpression = function(b) {
if (this.m_props.type != "DRMediaAlert") {
if ("buckets" in gCIM) for (var c in gCIM.buckets) b["buckets_" + c] = encodeURIComponent(gCIM.buckets[c]);
a(this, "_trackRDImpression", [b])
}
};
this.serialize = function() {
var a = {},
c, d, e;
for (e in this.m_props) e.search(/impression|expiration|loadTime|interstitial/i) > -1 || (c = e.search(/(click|engaged)Url/i) > -1 ? e.replace("Url", "") : e, d = typeof this.m_props[e] == "object" ? shallowCopy(this.m_props[e]) : this.m_props[e], a[c] = d);
return a
};
this.saveAsActiveAd = function(a) {
var c = this.serialize(),
d = c.invitation;
c.loadTime = this.m_props.loadTime;
c.expiration = this.m_props.expiration = (new Date).getTime() + a;
if (!this.m_props.noCache) {
if (!c.blank && d.type == "AnimatedMediaAlert") delete d.swf, d.type = "MediaAlert";
cim.ads.saveActiveAd(c)
}
};
this.isSharable = function() {
var a = this.m_props.sharable;
return typeof a == "undefined" ? !0 : a
};
this.saveInAdShare = function() {
if (this.getProp("share").indexOf("timeinc_") == 0 && !this.m_hasSavedInAdShare) meebo.util.cmd("adshare", {
saveext: 1,
payload: JSON.stringify(this.serialize())
}), this.m_hasSavedInAdShare = !0
}
});
Class("cim.ads.Targeting", ads.Targeting, function(a) {
this.initialize = function() {
a(this, "initialize");
this.m_setTargeting = new lib.Callback;
this.m_setTargeting.add(this, "onTrackCategory");
this.m_pageTargeting = {};
this.m_canopy = null;
this.m_canopyKey = gCIM.network + "canopy";
var b = gNetworks[gCIM.network].getAdPrefs();
this.m_partnerOptOut = b.disableTargeting;
this.m_pageContext = b.pageContext
};
this.getTargeting = function(a) {
if (this.isOptOut()) return {};
targeting = shallowCopy(a && this.m_useLocalStorage ? this.m_dclkTargeting : this.m_targeting);
copyProperties(targeting, this.m_pageTargeting);
return targeting
};
this.isOptOut = function() {
return a(this, "isOptOut") || this.m_partnerOptOut || cim.storage.load("tstore") == "OPT_OUT"
};
this.clearTStore = function(a) {
this.m_useLocalStorage && (a ? cim.storage.save("tstore", "OPT_OUT", !0) : cim.storage.erase("tstore"))
};
this.trackCategory = function(b, c) {
var d, e;
if (!a(this, "trackCategory", arguments)) {
try {
d = JSON.parse(cim.storage.load("tc", !0))
} catch (f) {
d = null
}
try {
e = JSON.parse(cim.storage.load("tstore", !0))
} catch (g) {
e = null
}
try {
if ((this.m_canopy = JSON.parse(cim.storage.load(this.m_canopyKey, !0))) && 36E5 < (new Date).getTime() - this.m_canopy.timestamp) cim.storage.erase(this.m_canopyKey, !0), this.m_canopy = null
} catch (h) {}
if (e || d) this.setTargeting(e || d, !0);
this.m_data.skipPublish = c;
var i = this.m_canopy && d;
if (!i) {
d = {
canopy: !this.m_canopy,
categories: !this.m_canopy,
dcc: !! this.m_useLocalStorage
};
if (!this.m_hasTransferedCookies && gCIM.bcookie) d.bcookie = gCIM.bcookie;
if (this.m_tcookie) d.tcookie = this.m_tcookie;
b && (d.partner = b);
if (this.m_useLocalStorage && !e && this.m_hasTransferedCookies) {
e = {};
for (var j in this.m_targeting) e[j + "=" + this.m_targeting[j]] = {}
}
d.targeting = JSON.stringify(e || {});
meebo.util.cmd("tc", d, hitch(this, "_handleResponse", this.m_setTargeting.getCallback()))
}
meebo.util.cmd("cx", {
partner: b,
referer: gCIM.location
}, hitch(this, function(a, b) {
gCIM.clientIP = a.cip;
this.m_pageContext ? this._handleResponse(this.m_setTargeting.getCallback(), a, b) : i && !c && this.setTargeting({}, !1)
}))
}
};
this._handleResponse = function(a, c, d) {
if (d) for (var e in c.data) this.m_data[e] = c.data[e];
a()
};
this._subscribeToEvents = function() {
cim.util.loadCallbacks.im.add(this, function() {
a(this, "_subscribeToEvents")
})
};
this.onTrackCategory = function() {
var b = this.m_data;
if (b.canopy) b.canopy.timestamp = (new Date).getTime(), cim.storage.save(this.m_canopyKey, JSON.stringify(b.canopy), !0), this.m_canopy = b.canopy;
b.categories && cim.storage.save("tc", JSON.stringify(b.categories), !0);
b.targeting && cim.storage.save("tstore", JSON.stringify(b.targeting), !0);
b.dcc && cim.storage.save("dcc", JSON.stringify(b.dcc), !0);
if (b.pagecontext) this.m_pageTargeting = b.pagecontext;
a(this, "onTrackCategory")
};
this.isCanopyAllowed = function() {
var a = this.m_canopy;
if (!a || !a.enabled) return !1;
if (!a.whitelist || !a.whitelist.length) return !0;
for (var c = 0, d; d = a.whitelist[c]; c++) try {
if (RegExp("^" + d + "$").test(gCIM.location.toString())) return !0
} catch (e) {}
return !1
}
});
Class("cim.ads.Sponsored", ui.Element, function(a) {
this.initialize = function(b, c) {
a(this, "initialize", arguments);
this.m_text = b || "This experience brought to you by";
this.m_imgsrc = c
};
this.createContent = function() {
this.addClassName("meebo-_shareSponsored");
setText(this.m_element, this.m_text);
this.m_element.style.cssText = "position: absolute,bottom: 60px,left: 12px,width: 240px,font: Tahoma 11px,color: #fff,".split(",").join(cim.world ? " !important; " : "; ");
this.m_logo = this.dom("meebo-_sponsoredLog", "img");
this.m_logo.src = this.m_imgsrc;
this.m_logo.style.cssText = ["width: 240px", "height: 40px", "margin: 10px 0", ""].join(cim.world ? " !important; " : "; ");
this.m_element.appendChild(this.m_logo)
}
});
Class("cim.share.Preview", ui.Element, function() {
this.createContent = function() {
this.addClassName("meebo-40");
this.m_preview = this.m_element.appendChild(this.dom("meebo-42"));
this.m_element.appendChild(this.dom("meebo-43"));
this.m_element.appendChild(this.dom("meebo-44"))
};
this.draw = function(a, b) {
var b = b || {
noThumb: !1,
noQuote: !1,
embedded: !1
},
c = isSubDomainOf(a.host, this.m_win.location.hostname),
d = a.thumbnail,
e = cim.share.Preview.getDefaults(),
c = !b.noThumb && d && d != e.thumbnail && !a.title && c;
this.m_preview.innerHTML = "";
toggleClassName(this.m_preview, c, "meebo-45");
toggleClassName(this.m_preview, a.quote, "meebo-51");
b.noThumb || this.m_preview.appendChild(this.getPreviewThumb(a, c));
c || this.m_preview.appendChild(this.getPreviewText(a, !b.noQuote));
this.m_preview.appendChild(this.dom("meebo-97"));
if (!b.embedded) {
if (!this.m_rounded) this.m_rounded = new ui.RoundedRect(this);
this.setHighlight(!1)
}
return this
};
this.getPreviewThumb = function(a, b) {
var c = a.thumbnailWidth,
d = a.thumbnailHeight,
e = {
width: c,
height: d
},
f = a.thumbnail,
g = b ? 120 : 70;
f ? e = a.type == "ad" ? this.constrainDimensions(c, d, g, g) : c < g || d < g ? {
width: c,
height: d
} : c < d ? {
width: g,
height: Math.round(d * (g / c))
} : {
width: Math.round(c * (g / d)),
height: g
} : (e = cim.share.Preview.getDefaults(), f = e.thumbnail, e = {
width: e.thumbnailWidth,
height: e.thumbnailHeight
});
Math.min(g, e.height);
Math.min(g, e.width);
c = this.dom("meebo-48");
d = c.appendChild(this.dom("meebo-46", "img"));
util.css.setStyle(c, {
width: g + "px",
height: g + "px",
overflow: "hidden"
}, cim.world);
b && util.css.setStyle(c, {
padding: "0 0 10px 0"
}, cim.world);
d.src = f;
util.css.setStyle(d, {
width: e.width + "px",
height: e.height + "px",
marginLeft: Math.floor(g / 2 - e.width / 2) + "px",
marginTop: Math.floor(g / 2 - e.height / 2) + "px"
}, cim.world);
return c
};
this.getPreviewText = function(a, b) {
var c = this.dom("meebo-49"),
d = c.appendChild(this.dom("meebo-16"));
setText(d, a.title || "");
b && a.quote && (d = c.appendChild(this.dom("meebo-52")), setText(d, '"' + truncateEnd(a.quote, 100) + '"'));
d = c.appendChild(this.dom("meebo-47"));
setText(d, a.title ? a.host : a.url);
return c
};
this.constrainDimensions = function(a, b, c, d) {
d || (d = c);
return a > c || b > d ? a < b ? {
width: a * d / b,
height: d
} : {
width: c,
height: b * c / a
} : {
width: a,
height: b
}
};
this.setHighlight = function(a) {
var b = gFrameMgr.getStyle().sharePreview;
a ? this.m_rounded.setStyle(b.Active) : this.m_rounded.setStyle(b.Normal)
}
});
cim.share.Preview.m_defaults = {
minWidth: 100,
minHeight: 100,
thumbnail: gCIM.imageURL + "share/default-video.png",
thumbnailWidth: 60,
thumbnailHeight: 60
};
cim.share.Preview.getDefaults = function() {
return cim.share.Preview.m_defaults
};
cim.share.Preview.setDefaults = function(a) {
var b = cim.share.Preview.m_defaults;
if (a.thumbnail) b.thumbnail = a.thumbnail;
if (a.thumbnailWidth) b.thumbnailWidth = a.thumbnailWidth;
if (a.thumbnailHeight) b.thumbnailHeight = a.thumbnailHeight
};
Class("cim.apps.share", function() {
this.initialize = function() {
this.m_meeboEmbedCache = {};
gFrameMgr.addListener("shareStart", this, "onShareStart").addListener("shareDrag", this, "onShareDrag").addListener("share", this, "onShare").addListener("requestMeeboEmbed", this, "onRequestMeeboEmbed").addListener("setPreviewDefaults", this, "onSetPreviewDefaults").frameCmd("onShareInit")
};
this.onShareStart = function(a) {
var b = new lib.Callback;
cim.util.loadCode("im", b.getCallback());
gFrameMgr.setupFrame("overlay", b.getCallback());
ui.isIE == 7 && gFrameMgr.setupFrame("resize", b.getCallback());
b.add(function() {
cim.share.startDrag(a.isDrag);
ui.isIE == 7 && gFrameMgr.getFrame("resize").setResizeHandler(hitch(cim.share, "onDrag"))
})
};
this.onShareDrag = function(a) {
cim.util.loadCallbacks.im.add(function() {
cim.share.onDrag(a)
})
};
this.onShare = function(a) {
var b = new lib.Callback;
gFrameMgr.setupFrame("overlay", b.getCallback());
cim.util.loadCode("im", b.getCallback());
b.add(function() {
if (a && a.via) cim.share.shareVia(a.via, a);
else cim.share.onDrop(a)
})
};
this.onRequestMeeboEmbed = function(a) {
var b = a.embedUrl,
c = this.m_meeboEmbedCache,
d = c[b];
d ? gFrameMgr.frameCmd(a.callbackId, d) : meebo.util.cmd("meeboembed", {
url: a.embedUrl
}, hitch(this, function(d) {
c[b] = d;
gFrameMgr.frameCmd(a.callbackId, d)
}))
};
this.onSetPreviewDefaults = function(a) {
cim.share.Preview.setDefaults(a)
}
});
Class("cim.apps.feeds", function() {
this.initialize = function() {
this.m_feedViews = {};
gFrameMgr.addListener("startFeed", this, "startFeed").addListener("showFeed", this, "showFeed");
cim.util.loadCallbacks.feeds.add(this, function() {
gFeedMgr.subscribe("NewNotification", this, "onNewNotification").subscribe("LastSeen", this, "onLastNotificationSeen");
gFrameMgr.addListener("markNotificationSeen", gFeedMgr, "markLastSeen")
})
};
this.onNewNotification = function(a) {
gFrameMgr.frameCmd("showFeedNotification", a.serialize())
};
this.onLastNotificationSeen = function() {
gFrameMgr.frameCmd("hideFeedNotification")
};
this.startFeed = function(a) {
cim.util.loadCode("feeds", hitch(this, function() {
gFeedMgr.addFeedById(a.feedId, !0)
}))
};
this.showFeed = function(a) {
var b = new lib.Callback,
c = "partner-" + a.id;
cim.util.loadCode("feeds", b.getCallback());
gFrameMgr.setupFrame(c, b.getCallback());
b.add(hitch(this, function() {
var b = gFeedMgr.addFeedById(a.feedId, !0),
e = gFrameMgr.upgradeFrame(c, "cim.Palette"),
f = this.getFeedView(b, a);
b.setTitle(a.feedTitle);
e.setDisplay(!0).showView({
view: f
})
}))
};
this.getFeedView = function(a, b) {
var c = a.getId(),
d = this.m_feedViews;
return d[c] ? c : d[c] = new cim.feeds.FeedView(a, b.feedIcon)
}
});
cim.uistate = Singleton(lib.Publisher, function(a) {
this.initialize = function() {
a(this, "initialize");
this.m_onLoaded = new lib.Callback;
this.m_baseScope = "global";
this._onStateReceived({});
cim.util.loadCallbacks.im.add(this, function() {
gUIState.subscribe("ChangeState", this, "_handleChange", "global")
});
this.m_tracks = {}
};
this.require = function(a) {
var c = this;
return function() {
c.m_onLoaded.add(this, a)
}
};
this.get = function(a) {
return shallowCopy(this.m_state[a])
};
this._copyState = function(a, c) {
var d = !1;
c == null ? (this.m_state[a] && (d = !0), delete this.m_state[a]) : (this.m_state[a] || (this.m_state[a] = {}, d = !0), d = copyProperties(this.m_state[a], c) || d);
return d
};
this.set = function(a, c, d) {
d = d || this.m_baseScope;
this._copyState(a, c) && d == "global" && (c ? gUIState.set(a, c) : gUIState.clear(a))
};
this.clear = function(a, c) {
this.set(a, null, c)
};
this.track = function(a, c, d, e, f) {
f = f || this.m_baseScope;
f == "global" && (this.m_tracks[a] = !0);
this.subscribe("Change::" + a, c, d);
this.m_onLoaded.add(this, function() {
if (e) {
this.m_state[a] || (this.m_state[a] = {});
for (var f in e) this.m_state[a][f] == null && (this.m_state[a][f] = e[f])
}
hitch(c, d)(this.m_state[a])
})
};
this.watch = function(a, c) {
this.subscribe("BeforeChangeWatch", a, c)
};
this._onChangeReceived = function(a) {
this._handleChange("local", a.id, a.state)
};
this._handleChange = function(a, c, d) {
this.publish("BeforeChangeWatch", c, d, a);
(a != "global" || this.m_tracks[c]) && this.updateState(c, d, a)
};
this.updateState = function(a, c, d) {
this._copyState(a, c) && (c = this.m_state[a], this.publish("Change::" + a, c, d), this.publish("Change", c, d))
};
this._onStateReceived = function(a) {
if (this.m_onLoaded.wasFired()) for (var c in a) this.updateState(c, a[c], "local");
else this.m_state = a, this.m_onLoaded.fire()
}
});
gCIM.time("sb:main");
gCIM.currentDomain = "meebo.com";
gCIM.channel = cim.util.getChannel();
gCIM.apps = {};
gCIM.bcookie = util.bcookie.get();
if (ui.isIE && ui.isIE < 9) window.onunload = function() {
try {
window.onunload = null;
var a = function(b) {
for (var d in b) if (b[d]) if (b[d].tagName || b[d].window || b[d].ownerDocument) b[d] = null;
else if (typeof b == "object") try {
var e = b[d];
b[d] = null;
a(e)
} catch (f) {}
};
gCIM.location = null;
a(gFrameMgr);
a(gCIM);
gCIM = a = null;
CollectGarbage()
} catch (b) {}
};
initCIMGlobals();
if (gFrameMgr.isDark()) {
var postfix = "-dark-" + gCIM.network;
meebo.util.session.SESSION_KEY_COOKIE += postfix;
meebo.util.session.LOCATION_ID_COOKIE += postfix;
meebo.util.slt.KEY += postfix;
cim.session.KEY += postfix
}
if (util.url(util.url(window.location).getHash("loc")).getHash("cookiesDisabled")) gCIM.cookiesDisabled = !0, meebo.util.session.storage = util.localSessionStorage;
meebo.util.session.load() ? cim.util.loadCode("im") : gSLTXD.load(function(a) {
a.length && cim.util.loadCode("im")
});
function initCIMGlobals() {
gWorldWindow = window.parent;
gBrowser = {};
Mindset = new ads.Mindset;
gAdServer = new cim.ads.Server;
DoubleClick = new ads.DoubleClick;
gTargeting = new cim.ads.Targeting;
gCIM.time("sb:gFrameMgr.create");
gFrameMgr.create();
gBar = gFrameMgr.getFrame("bar");
gFrameMgr.frameCmd("sandboxReady");
gSLTXD = new meebo.util.SLTXD(util.url(gCIM.redirectURL).setProtocol("https:"))
}
gNetworks.facebook.makeLive();
gCIM.time("jssb1");
//@ sourceURL=http://s.meebocdn.net/cim/script/sandbox_v108_cim_11_33_7.en.js?1347306828 |