Skip to content

Instantly share code, notes, and snippets.

@skyisle
Created May 1, 2013 00:35
Show Gist options
  • Save skyisle/5492954 to your computer and use it in GitHub Desktop.
Save skyisle/5492954 to your computer and use it in GitHub Desktop.
(function () {
var f = !0,
g = null,
h = !1,
aa = function (a, b, c) {
return a.call.apply(a.bind, arguments)
}, ba = function (a, b, c) {
if (!a) throw Error();
if (2 < arguments.length) {
var d = Array.prototype.slice.call(arguments, 2);
return function () {
var c = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(c, d);
return a.apply(b, c)
}
}
return function () {
return a.apply(b, arguments)
}
}, l = function (a, b, c) {
l = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? aa : ba;
return l.apply(g, arguments)
};
var m = (new Date).getTime();
var n = function (a) {
a = parseFloat(a);
return isNaN(a) || 1 < a || 0 > a ? 0 : a
}, ca = /^([\w-]+\.)*([\w-]{2,})(\:[0-9]+)?$/,
da = function (a, b) {
if (!a) return b;
var c = a.match(ca);
return c ? c[0] : b
};
var ea = n("0.15"),
fa = n("0.01"),
ga = n("1.0"),
ha = n("0.005"),
ia = n("0.01");
var q = function () {
return "r20130425"
}, ja = /^true$/.test("false") ? f : h,
ka = /^true$/.test("false") ? f : h;
var la = function () {
return da("", "pagead2.googlesyndication.com")
};
var ma = /&/g,
na = /</g,
oa = />/g,
pa = /\"/g,
qa = {
"\x00": "\\0",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
"\x0B": "\\x0B",
'"': '\\"',
"\\": "\\\\"
}, r = {
"'": "\\'"
};
var ta = window,
u, ua = g,
w = document.getElementsByTagName("script");
w && w.length && (ua = w[w.length - 1].parentNode);
u = ua;
la();
var va = function (a, b) {
for (var c in a) Object.prototype.hasOwnProperty.call(a, c) && b.call(g, a[c], c, a)
}, x = function (a) {
return !!a && "function" == typeof a && !! a.call
}, wa = function (a, b) {
if (!(2 > arguments.length)) for (var c = 1, d = arguments.length; c < d; ++c) a.push(arguments[c])
};
function xa(a, b) {
ya(a, "load", b)
}
var ya = function (a, b, c, d) {
return a.addEventListener ? (a.addEventListener(b, c, d || h), f) : a.attachEvent ? (a.attachEvent("on" + b, c), f) : h
}, za = function (a, b, c, d) {
c = l(d, c);
return ya(a, b, c, void 0) ? c : g
}, Aa = function (a, b, c) {
a.removeEventListener ? a.removeEventListener(b, c, h) : a.detachEvent && a.detachEvent("on" + b, c)
}, y = function (a, b) {
if (!(1E-4 > Math.random())) {
var c = Math.random();
if (c < b) return a[Math.floor(c / b * a.length)]
}
return g
}, Ba = function (a) {
try {
return !!a.location.href || "" === a.location.href
} catch (b) {
return h
}
};
var Ca = g,
Da = function () {
if (!Ca) {
for (var a = window, b = a, c = 0; a != a.parent;) if (a = a.parent, c++, Ba(a)) b = a;
else break;
Ca = b
}
return Ca
};
var z, A = function (a) {
this.c = [];
this.b = a || window;
this.a = 0;
this.d = g
}, Ea = function (a, b) {
this.l = a;
this.win = b
};
A.prototype.p = function (a, b) {
0 == this.a && 0 == this.c.length && (!b || b == window) ? (this.a = 2, this.f(new Ea(a, window))) : this.g(a, b)
};
A.prototype.g = function (a, b) {
this.c.push(new Ea(a, b || this.b));
Fa(this)
};
A.prototype.q = function (a) {
this.a = 1;
a && (this.d = this.b.setTimeout(l(this.e, this), a))
};
A.prototype.e = function () {
1 == this.a && (this.d != g && (this.b.clearTimeout(this.d), this.d = g), this.a = 0);
Fa(this)
};
A.prototype.r = function () {
return f
};
A.prototype.nq = A.prototype.p;
A.prototype.nqa = A.prototype.g;
A.prototype.al = A.prototype.q;
A.prototype.rl = A.prototype.e;
A.prototype.sz = A.prototype.r;
var Fa = function (a) {
a.b.setTimeout(l(a.o, a), 0)
};
A.prototype.o = function () {
if (0 == this.a && this.c.length) {
var a = this.c.shift();
this.a = 2;
a.win.setTimeout(l(this.f, this, a), 0);
Fa(this)
}
};
A.prototype.f = function (a) {
this.a = 0;
a.l()
};
var Ga = function (a) {
try {
return a.sz()
} catch (b) {
return h
}
}, Ha = function (a) {
return !!a && ("object" == typeof a || "function" == typeof a) && Ga(a) && x(a.nq) && x(a.nqa) && x(a.al) && x(a.rl)
}, Ia = function () {
if (z && Ga(z)) return z;
var a = Da(),
b = a.google_jobrunner;
return Ha(b) ? z = b : a.google_jobrunner = z = new A(a)
}, Ja = function (a, b) {
Ia().nq(a, b)
}, Ka = function (a, b) {
Ia().nqa(a, b)
};
var La = /MSIE [2-7]|PlayStation|Gecko\/20090226|Android 2\./i,
Ma = /Android|Opera/;
var Na = function (a, b, c) {
c || (c = ka ? "https" : "http");
return [c, "://", a, b].join("")
};
var Oa = function () {}, Qa = function (a, b, c) {
switch (typeof b) {
case "string":
Pa(b, c);
break;
case "number":
c.push(isFinite(b) && !isNaN(b) ? b : "null");
break;
case "boolean":
c.push(b);
break;
case "undefined":
c.push("null");
break;
case "object":
if (b == g) {
c.push("null");
break
}
if (b instanceof Array) {
var d = b.length;
c.push("[");
for (var e = "", k = 0; k < d; k++) c.push(e), Qa(a, b[k], c), e = ",";
c.push("]");
break
}
c.push("{");
d = "";
for (e in b) b.hasOwnProperty(e) && (k = b[e], "function" != typeof k && (c.push(d), Pa(e, c), c.push(":"), Qa(a, k, c), d =
","));
c.push("}");
break;
case "function":
break;
default:
throw Error("Unknown type: " + typeof b);
}
}, Ra = {
'"': '\\"',
"\\": "\\\\",
"/": "\\/",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
"\x0B": "\\u000b"
}, Sa = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g,
Pa = function (a, b) {
b.push('"');
b.push(a.replace(Sa, function (a) {
if (a in Ra) return Ra[a];
var b = a.charCodeAt(0),
e = "\\u";
16 > b ? e += "000" : 256 > b ? e += "00" : 4096 > b && (e += "0");
return Ra[a] = e + b.toString(16)
}));
b.push('"')
};
var B = "google_ad_block google_ad_channel google_ad_client google_ad_format google_ad_height google_ad_host google_ad_host_channel google_ad_host_tier_id google_ad_output google_ad_override google_ad_region google_ad_section google_ad_slot google_ad_type google_ad_width google_adtest google_allow_expandable_ads google_alternate_ad_url google_alternate_color google_analytics_domain_name google_analytics_uacct google_bid google_city google_color_bg google_color_border google_color_line google_color_link google_color_text google_color_url google_container_id google_contents google_country google_cpm google_ctr_threshold google_cust_age google_cust_ch google_cust_gender google_cust_id google_cust_interests google_cust_job google_cust_l google_cust_lh google_cust_u_url google_disable_video_autoplay google_ed google_eids google_enable_ose google_encoding google_font_face google_font_size google_frame_id google_gl google_hints google_image_size google_kw google_kw_type google_lact google_language google_loeid google_max_num_ads google_max_radlink_len google_mtl google_num_radlinks google_num_radlinks_per_unit google_num_slots_to_rotate google_only_ads_with_video google_only_pyv_ads google_only_userchoice_ads google_override_format google_page_url google_previous_watch google_previous_searches google_referrer_url google_region google_reuse_colors google_rl_dest_url google_rl_filtering google_rl_mode google_rt google_safe google_sc_id google_scs google_sui google_skip google_tag_info google_targeting google_tdsma google_tfs google_tl google_ui_features google_ui_version google_video_doc_id google_video_product_type google_with_pyv_ads google_yt_pt google_yt_up".split(" "),
Ta = function () {
var a = C;
a.google_page_url && (a.google_page_url = String(a.google_page_url));
var b = [];
va(a, function (a, d) {
if (a != g) {
var e;
try {
var k = [];
Qa(new Oa, a, k);
e = k.join("")
} catch (s) {}
e && wa(b, d, "=", e, ";")
}
});
return b.join("")
};
var Ua = /\.((google(|groups|mail|images|print))|gmail)\./,
Va = function () {
var a = D,
b = Ua.test(a.location.host);
return !(!a.postMessage || !a.localStorage || !a.JSON || b)
};
var Wa = function (a) {
this.b = a;
a.google_iframe_oncopy || (a.google_iframe_oncopy = {
handlers: {}
});
this.m = a.google_iframe_oncopy
}, Xa;
var F = "var i=this.id,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){w.location.replace(h)}}";
/[&<>\"]/.test(F) && (-1 != F.indexOf("&") && (F = F.replace(ma, "&amp;")), -1 != F.indexOf("<") && (F = F.replace(na, "&lt;")), -1 != F.indexOf(">") && (F = F.replace(oa, "&gt;")), -1 != F.indexOf('"') && (F = F.replace(pa, "&quot;")));
Xa = F;
Wa.prototype.set = function (a, b) {
this.m.handlers[a] = b;
this.b.addEventListener && !/MSIE/.test(navigator.userAgent) && this.b.addEventListener("load", l(this.n, this, a), h)
};
Wa.prototype.n = function (a) {
a = this.b.document.getElementById(a);
var b = a.contentWindow.document;
if (a.onload && b && (!b.body || !b.body.firstChild)) a.onload()
};
var Ya = function (a) {
a = a.google_unique_id;
return "number" == typeof a ? a : 0
}, Za = function () {
var a = "script";
return ["<", a, ' src="', Na(la(), ["/pagead/js/", q(), "/r20130206/show_ads_impl.js"].join(""), ""), '"></', a, ">"].join("")
}, $a = function (a, b, c, d) {
return function () {
var e = h;
d && Ia().al(3E4);
try {
if (Ba(a.document.getElementById(b).contentWindow)) {
var k = a.document.getElementById(b).contentWindow,
s = k.document;
if (!s.body || !s.body.firstChild) s.open(), k.google_async_iframe_close = f, s.write(c)
} else {
var T = a.document.getElementById(b).contentWindow,
ra;
k = c;
k = String(k);
if (k.quote) ra = k.quote();
else {
for (var s = ['"'], U = 0; U < k.length; U++) {
var V = k.charAt(U),
cb = V.charCodeAt(0),
cc = s,
dc = U + 1,
sa;
if (!(sa = qa[V])) {
var E;
if (31 < cb && 127 > cb) E = V;
else {
var t = V;
if (t in r) E = r[t];
else if (t in qa) E = r[t] = qa[t];
else {
var p = t,
v = t.charCodeAt(0);
if (31 < v && 127 > v) p = t;
else {
if (256 > v) {
if (p = "\\x", 16 > v || 256 < v) p += "0"
} else p = "\\u", 4096 > v &&
(p += "0");
p += v.toString(16).toUpperCase()
}
E = r[t] = p
}
}
sa = E
}
cc[dc] = sa
}
s.push('"');
ra = s.join("")
}
T.location.replace("javascript:" + ra)
}
e = f
} catch (pc) {
T = Da().google_jobrunner, Ha(T) && T.rl()
}
e && (new Wa(a)).set(b, $a(a, b, c, h))
}
}, ab = function () {
var a = ["<iframe"];
va(G, function (b, c) {
a.push(" " + c + '="' + (b == g ? "" : b) + '"')
});
a.push("></iframe>");
return a.join("")
}, eb = function (a, b) {
var c = bb,
d = b ? '"' : "",
e = d + "0" + d;
a.width = d + db + d;
a.height = d + c + d;
a.frameborder = e;
a.marginwidth = e;
a.marginheight = e;
a.vspace = e;
a.hspace = e;
a.allowtransparency =
d + "true" + d;
a.scrolling = d + "no" + d
}, fb = Math.floor(1E6 * Math.random()),
gb = function (a) {
for (var b = a.data.split("\n"), c = {}, d = 0; d < b.length; d++) {
var e = b[d].indexOf("="); - 1 != e && (c[b[d].substr(0, e)] = b[d].substr(e + 1))
}
b = c[3];
if (c[1] == fb && (window.google_top_js_status = 4, a.source == top && 0 == b.indexOf(a.origin) && (window.google_top_values = c, window.google_top_js_status = 5), window.google_top_js_callbacks)) {
for (a = 0; a < window.google_top_js_callbacks.length; a++) window.google_top_js_callbacks[a]();
window.google_top_js_callbacks.length =
0
}
};
var hb = function (a, b, c) {
this.x = a;
this.y = b;
this.z = c
}, ib = function (a, b, c) {
this.beta = a;
this.gamma = b;
this.alpha = c
}, kb = function () {
var a = H,
b = jb;
this.deviceAccelerationWithGravity = this.deviceAccelerationWithoutGravity = g;
this.deviceMotionEventCallbacks = [];
this.deviceOrientation = g;
this.deviceOrientationEventCallbacks = [];
this.isDeviceOrientationEventListenerRegistered = this.isDeviceMotionEventListenerRegistered = this.didDeviceOrientationCallbacksTimeoutExpire = this.didDeviceMotionCallbacksTimeoutExpire = h;
this.registeredMozOrientationEventListener =
this.registeredDeviceOrientationEventListener = this.registeredDeviceMotionEventListener = g;
this.sensorsExperiment = b;
this.stopTimeStamp = this.startTimeStamp = g;
this.win = a
}, I = function (a) {
this.a = a;
this.a.win.DeviceOrientationEvent ? (this.a.registeredDeviceOrientationEventListener = za(this.a.win, "deviceorientation", this, this.j), this.a.isDeviceOrientationEventListenerRegistered = f) : this.a.win.OrientationEvent && (this.a.registeredMozOrientationEventListener = za(this.a.win, "MozOrientation", this, this.k), this.a.isDeviceOrientationEventListenerRegistered =
f);
this.a.win.DeviceMotionEvent && (this.a.registeredDeviceMotionEventListener = za(this.a.win, "devicemotion", this, this.i), this.a.isDeviceMotionEventListenerRegistered = f)
};
I.prototype.i = function (a) {
a.acceleration && (this.a.deviceAccelerationWithoutGravity = new hb(a.acceleration.x, a.acceleration.y, a.acceleration.z));
a.accelerationIncludingGravity && (this.a.deviceAccelerationWithGravity = new hb(a.accelerationIncludingGravity.x, a.accelerationIncludingGravity.y, a.accelerationIncludingGravity.z));
lb(this.a.deviceMotionEventCallbacks);
Aa(this.a.win, "devicemotion", this.a.registeredDeviceMotionEventListener)
};
I.prototype.j = function (a) {
this.a.deviceOrientation = new ib(a.beta, a.gamma, a.alpha);
lb(this.a.deviceOrientationEventCallbacks);
Aa(this.a.win, "deviceorientation", this.a.registeredDeviceOrientationEventListener)
};
I.prototype.k = function (a) {
this.a.deviceOrientation = new ib(-90 * a.y, 90 * a.x, g);
lb(this.a.deviceOrientationEventCallbacks);
Aa(this.a.win, "MozOrientation", this.a.registeredMozOrientationEventListener)
};
var lb = function (a) {
for (var b = 0; b < a.length; ++b) a[b]();
a.length = 0
};
window.google_loader_used = f;
(function (a) {
"google_onload_fired" in a || (a.google_onload_fired = h, xa(a, function () {
a.google_onload_fired = f
}))
})(window);
if (!window.google_top_experiment && (window.google_top_experiment = y(["jp_c", "jp_zl", "jp_wfpmr"], ea), "jp_zl" === window.google_top_experiment || "jp_wfpmr" === window.google_top_experiment)) {
var mb = window,
nb = 2;
try {
mb.top.document == mb.document ? nb = 0 : Ba(mb.top) && (nb = 1)
} catch (ob) {}
if (2 !== nb) window.google_top_js_status = 0;
else if (top.postMessage) {
var pb;
try {
pb = top.frames.google_top_static_frame ? f : h
} catch (qb) {
pb = h
}
if (pb) {
ya(window, "message", gb);
window.google_top_js_status = 3;
var rb = {
0: "google_loc_request",
1: fb
}, sb = [],
tb;
for (tb in rb) sb.push(tb + "=" + rb[tb]);
top.postMessage(sb.join("\n"), "*")
} else window.google_top_js_status = 2
} else window.google_top_js_status = 1
}
var ub = h;
if (navigator && navigator.userAgent) var vb = navigator.userAgent,
ub = 0 != vb.indexOf("Opera") && -1 != vb.indexOf("WebKit") && -1 != vb.indexOf("Mobile");
if (ub) {
var H = window;
if (!(0 != Ya(H) || H.google_sensors)) {
var jb, wb = g,
xb = H;
xb.google_top_experiment && "jp_c" != xb.google_top_experiment || (wb = y(["ds_c", "ds_zl", "ds_wfea"], ia));
if (jb = wb) H.google_sensors = new kb, "ds_c" != jb && new I(H.google_sensors)
}
}
var yb;
if (window.google_enable_async === h) yb = 0;
else {
var zb;
var Ab = navigator.userAgent;
La.test(Ab) ? zb = h : (void 0 === window.google_async_for_oa_experiment && (Ma.test(navigator.userAgent) && !La.test(navigator.userAgent)) && (window.google_async_for_oa_experiment = y(["C", "E"], ha)), zb = Ma.test(Ab) ? "E" === window.google_async_for_oa_experiment : f);
yb = zb && !window.google_container_id && (!window.google_ad_output || "html" == window.google_ad_output)
}
if (yb) {
var Bb = window;
Bb.google_unique_id ? ++Bb.google_unique_id : Bb.google_unique_id = 1;
for (var D = window, C, Cb = {}, Db = 0, Eb = B.length; Db < Eb; Db++) {
var Fb = B[Db];
D[Fb] != g && (Cb[Fb] = D[Fb])
}
C = Cb;
for (var Gb = 0, Hb = B.length; Gb < Hb; Gb++) D[B[Gb]] = g;
var db = C.google_ad_width,
bb = C.google_ad_height,
J = {};
eb(J, f);
J.onload = '"' + Xa + '"';
for (var K, Ib = C, Jb = D.document, L = J.id, Kb = 0; !L || Jb.getElementById(L);) L = "aswift_" + Kb++;
J.id = L;
J.name = L;
var Lb = Ib.google_ad_width,
Mb = Ib.google_ad_height,
M = ["<iframe"],
N;
for (N in J) J.hasOwnProperty(N) &&
wa(M, N + "=" + J[N]);
M.push('style="left:0;position:absolute;top:0;"');
M.push("></iframe>");
var Nb = "border:none;height:" + Mb + "px;margin:0;padding:0;position:relative;visibility:visible;width:" + Lb + "px";
Jb.write(['<ins style="display:inline-table;', Nb, '"><ins id="', J.id + "_anchor", '" style="display:block;', Nb, '">', M.join(" "), "</ins></ins>"].join(""));
K = J.id;
var Ob = Ta(),
O = C,
Pb = O.google_ad_output,
P = O.google_ad_format;
if (!P && ("html" == Pb || Pb == g)) P = O.google_ad_width + "x" + O.google_ad_height;
P = P && (!O.google_ad_slot ||
O.google_override_format) ? P.toLowerCase() : "";
O.google_ad_format = P;
var Q, R = C || ta,
Qb = [R.google_ad_slot, R.google_ad_format, R.google_ad_type, R.google_ad_width, R.google_ad_height];
if (u) {
var Rb;
if (u) {
for (var Sb = [], Tb = 0, S = u; S && 25 > Tb; S = S.parentNode, ++Tb) Sb.push(9 != S.nodeType && S.id || "");
Rb = Sb.join()
} else Rb = "";
Rb && Qb.push(Rb)
}
var Ub = 0;
if (Qb) {
var Vb = Qb.join(":"),
Wb = Vb.length;
if (0 == Wb) Ub = 0;
else {
for (var W = 305419896, Xb = 0; Xb < Wb; Xb++) W ^= (W << 5) + (W >> 2) + Vb.charCodeAt(Xb) & 4294967295;
Ub = 0 < W ? W : 4294967296 + W
}
}
Q = Ub.toString();
e: {
var X = C,
Y = D.google_async_slots;
Y || (Y = D.google_async_slots = {});
var Z = String(Ya(D));
if (Z in Y && (Z += "b", Z in Y)) break e;
Y[Z] = {
sent: h,
w: X.google_ad_width || "",
h: X.google_ad_height || "",
adk: Q,
type: X.google_ad_type || "",
slot: X.google_ad_slot || "",
fmt: X.google_ad_format || "",
cli: X.google_ad_client || "",
saw: []
}
}
var $;
Va() && void 0 === D.google_ad_handling_experiment && (D.google_ad_handling_experiment = y(ja && "dev" != q() ? ["PC"] : ["X", "XN", "PC"], ja && "dev" != q() ? ga : fa));
$ = D.google_ad_handling_experiment ? String(D.google_ad_handling_experiment) :
g;
var Yb;
var Zb = C;
if (Va() && 1 == D.google_unique_id && "XN" != $) {
var $b = "zrt_ads_frame" + D.google_unique_id,
ac, bc = Zb.google_page_url;
if (!bc) {
var ec;
o: {
var fc = D.document,
gc = db || D.google_ad_width,
hc = bb || D.google_ad_height;
if (D.top == D) ec = h;
else {
var ic = fc.documentElement;
if (gc && hc) {
var jc = 1,
kc = 1;
D.innerHeight ? (jc = D.innerWidth, kc = D.innerHeight) : ic && ic.clientHeight ? (jc = ic.clientWidth, kc = ic.clientHeight) : fc.body && (jc = fc.body.clientWidth, kc = fc.body.clientHeight);
if (kc > 2 * hc || jc > 2 * gc) {
ec = h;
break o
}
}
ec = f
}
}
bc = ec ? D.document.referrer : D.document.URL
}
ac = encodeURIComponent(bc);
var lc = g;
"PC" == $ && (lc = "K-" + (ac + "/" + Q + "/" + D.google_unique_id));
var G = {};
eb(G, h);
G.style = "display:none";
var mc = lc;
G.id = $b;
G.name = $b;
G.src = Na(da("", "googleads.g.doubleclick.net"), ["/pagead/html/", q(), "/r20130206/zrt_lookup.html", mc ? "#" + encodeURIComponent(mc) : ""].join(""));
Yb = ab()
} else Yb = g;
var nc = (new Date).getTime(),
oc = D.google_top_experiment,
qc = D.google_async_for_oa_experiment,
rc = ["<!doctype html><html><body>", Yb, "<script>", Ob, "google_show_ads_impl=true;google_unique_id=", D.google_unique_id, ';google_async_iframe_id="', K, '";google_ad_unit_key="', Q, '";google_start_time=', m, ";", oc ? 'google_top_experiment="' + oc + '";' : "", $ ? 'google_ad_handling_experiment="' + $ + '";' : "", qc ? 'google_async_for_oa_experiment="' + qc + '";' : "", "google_bpp=", nc > m ? nc - m : 1, ";\x3c/script>", Za(), "</body></html>"].join("");
(D.document.getElementById(K) ? Ja : Ka)($a(D, K, rc, f))
} else window.google_start_time = m, document.write(Za());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment