var url='http://mobile-click.biz/click/go.html?id_hash=6d6442d4c7d54ebe14a8b294f7d05f09&mbclk_id=I1W2ucaeSm6mZuLrk-NcrUr4_wb2WnvH'; var idSpace='6d6442d4c7d54ebe14a8b294f7d05f09'; var available_advertisers = 2; var mbclk_id='nbdelakfjhigmc'; var cookie_name = 'mbclk_used'; function getCookie(a){var b=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return b?decodeURIComponent(b[1]):void 0} function setCookie(a,b,c){c=c||{};var d=c.expires;if("number"==typeof d&&d){var e=new Date;e.setTime(e.getTime()+1e3*d),d=c.expires=e}d&&d.toUTCString&&(c.expires=d.toUTCString()),b=encodeURIComponent(b);var f=a+"="+b;for(var g in c){f+="; "+g;var h=c[g];h!==!0&&(f+="="+h)}document.cookie=f} var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var c,d,e,f,g,h,i,b="",j=0;for(a=Base64._utf8_encode(a);j>2,g=(3&c)<<4|d>>4,h=(15&d)<<2|e>>6,i=63&e,isNaN(d)?h=i=64:isNaN(e)&&(i=64),b=b+Base64._keyStr.charAt(f)+Base64._keyStr.charAt(g)+Base64._keyStr.charAt(h)+Base64._keyStr.charAt(i);return b},decode:function(a){var c,d,e,f,g,h,i,b="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,d=(15&g)<<4|h>>2,e=(3&h)<<6|i,b+=String.fromCharCode(c),64!=h&&(b+=String.fromCharCode(d)),64!=i&&(b+=String.fromCharCode(e));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c127&&d<2048?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c191&&d<224?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&c2),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&c2)<<6|63&c3),c+=3);return b}}; var hookEvent=function(){function b(a,b,c){return a.addEventListener(b,c,!1),a}function c(a,b,c){return a.attachEvent("on"+b,function(b){b=b||window.event,b.preventDefault=d,b.stopPropagation=e,c.call(a,b)}),a}function d(){this.returnValue=!1}function e(){this.cancelBubble=!0}var a;if(a=document.createElement("div"),a.addEventListener)return a=void 0,b;if(a.attachEvent)return a=void 0,c;throw"Event mechanisms not supported by this browser."}(); function setCookieCounter(value) { var end = new Date(); end.setHours(23,59,59,999); var current = new Date(); time = end.getTime()-current.getTime() time = time.toString(); time = time.substring(0, time.length - 3); setCookie(cookie_name, value, {expires: parseInt(time)}); } function mbclkEvent() { used_counter = getCookie(cookie_name); if (used_counter==undefined || used_counter == 0) { (elem=document.getElementById(mbclk_id)).parentNode.removeChild(elem) return; } used_counter = used_counter - 1; setCookieCounter(used_counter); (elem=document.getElementById(mbclk_id)).parentNode.removeChild(elem) url=url+'&ref=' + Base64.encode(window.location.href) var a =window.open(url, '_blank'); a.focus(); //a.opener.focus(); return true; } (function mbclkFunc() { var mbclk_el = document.createElement('div') mbclk_el.id = mbclk_id; mbclk_el.style.cssText = 'position: fixed; top: 0; bottom: 0; right: 0; left: 0;z-index: 100000'; v_body = document.body; v_body.appendChild(mbclk_el); setCookieCounter(available_advertisers); hookEvent(document.getElementById(mbclk_id), 'click', mbclkEvent); img = new Image(); img.src = 'http://mobile-click.biz/click/verify.html?id_hash='+idSpace; })();