/ Published in: JavaScript
Este é o pedaço de código que deve ser sempre incluÃdo em freetext
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ZAHIR$sitio = function () { return{ zclk: "$zahir/pl/click.pl%3fskey=$skey", swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js", ebIfrm: "$zahir/eyeblaster.php?src=", Ifrm3rd: "$zahir/iframe.php?s=", pixelTop: function(){return ZAHIR$sitio.validate("$descreve", "100")}, pixelLeft: function(){return ZAHIR$sitio.validate("$iframesrc", "0")}, destroyCounter: function(){return ZAHIR$sitio.validate("$scriptsrc", "30")}, validate: function (param, default_value){ if (param == ""){param = default_value} return param; }, getEl: function (i){return document.getElementById(i)}, pixel: function(p) { if(p){ img = new Image(1,1) img.src = ZAHIR$sitio.srcMacro(p); img.style.display="none"; return img; } }, Image: function(file, selector, w, h, click){ if(!click){click = unescape(ZAHIR$sitio.zclk)} ZAHIR$sitio.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>'; }, BGimage: function(where, color, file, xpos, ypos, type ){ var rpt = "no-repeat"; if (where == "body"){ var y = document.getElementsByTagName('body')[0]; }else{ var y = document.getElementById (where); }; //y.style.backgroundColor = color; //y.backgroundImage = url(file); y.style.background=''+color+' url('+file+') '+type+' '+rpt+' '+xpos+' '+ypos+''; }, BGclick: function(where, click){ if(!click){click = ZAHIR$sitio.zclk}; jQuery(where).css('position','relative'); var elWidth = jQuery(where).width(); var screen=(document.all) ? document.body.offsetWidth : window.innerWidth; var height = 1000;var bandas = 150; leftbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+bandas+'px; height:'+height+'px; top:-25px; left:'+-bandas+'px; cursor:pointer"></div>'); rightbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+bandas+'px; height:'+height+'px; top:-25px; left:'+elWidth+'px; cursor:pointer"></div>'); jQuery(where).prepend(leftbg); jQuery(where).prepend(rightbg); jQuery(".adserverbg").click(function () { window.open(unescape(click)); }); if (jQuery('#pubTop').length) { jQuery("#pubTop").click(function () { window.open(unescape(click)); }); }; }, iframeScript3rd: function(container, src, w, h, beacon){ var t; src.indexOf("bs.serving-sys.com")>-1 ? t = ZAHIR$sitio.ebIfrm : t= ZAHIR$sitio.Ifrm3rd; ZAHIR$sitio.iframeGen(ZAHIR$sitio.srcMacro(t+escape(src)), container, w, h); }, iframeGen: function(src, container, w, h) { var zcont='<IFRAME SRC="'+ZAHIR$sitio.srcMacro(t+escape(src))+'" WIDTH="'+w+'" HEIGHT="'+h+'" MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no"></iframe>'; if (document.getElementById(container)){ document.getElementById(container).innerHTML = zcont; }else{try{console.log("Adserver_Error: I'm trying to append content to an inexistent container: tag id: $sitio");}catch(e){};} }, Banner: function(file, selector, w1, h1, mode, click){ var r=Math.floor(Math.random()*110) ZAHIR$sitio.domSwf("temp"+r, selector); ZAHIR$sitio.gen(file, "temp"+r, w1, h1, mode, click); }, Layer: function(who, w1, h1, top, left, counter){ ZAHIR$sitio.domSwf("zahirWrapper$sitio", who, "first", w1, "0"); var a = ZAHIR$sitio.getEl("zahirWrapper$sitio"); a.style.margin = "auto"; a.style.width = w1+"px"; a.style.position = "relative"; a.style.zIndex= "10000"; a.style.overflow = "visible"; ZAHIR$sitio.domSwf("zahirLayer$sitio", "zahirWrapper$sitio", "first", w1, h1); var b = document.getElementById("zahirLayer$sitio"); b.style.position = "absolute"; b.style.top = top+"px"; b.style.left = left+"px"; b.style.zIndex = "10000"; b.style.overflow = "visible"; ZAHIR$sitio.domSwf("zahirLayer2$sitio", "zahirLayer$sitio", "first", w1, h1); if(counter){ counter= counter * 1000; setTimeout("ZAHIR$sitio.mycounter('zahirWrapper$sitio', 'destroy')", counter) } }, domSwf: function(el, who, where, w, h ){ var newEl = document.createElement("div"); newEl.id = el; if (who == "body"){ var y = document.getElementsByTagName('body')[0]; }else{ var y = document.getElementById (who); } if(where == "first"){ y.insertBefore(newEl, y.firstChild); }else{ y.appendChild(newEl); } }, getAd: function(file, selector, w1, h1, mode, click){ var t = setInterval(function() { if (typeof swfobject != "undefined") { if (swfobject.hasFlashPlayerVersion("8.0.0")) { if(!click){click = ZAHIR$sitio.zclk} var flashvars = { ad: "ZAHIR$sitio.AS2JS$sitio", clickTag: click, clickTAG: click, clicktag: click } var params = { menu: "false", quality: "high", wmode: mode, AllowScriptAccess: "always" } var attributes = {id: selector} swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes); }; clearInterval(t); t = null; } }, 250); }, load: function (what) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.type = "text/javascript"; script.src = what; head.appendChild(script); }, gen: function(file, selector, w1, h1, mode, click){ if (typeof swfobject != "undefined") { ZAHIR$sitio.getAd(file, selector, w1, h1, mode, click); }else{ ZAHIR$sitio.load(ZAHIR$sitio.swfOurl); ZAHIR$sitio.getAd(file, selector, w1, h1, mode, click); } }, srcMacro: function (src){ var ord=Math.floor(Math.random()*101) if(src.indexOf("zahirord")>-1){src= src.replace(/zahirord/gi, ord);} if(src.indexOf("zahirclick")>-1){src= src.replace(/zahirclick/gi, ZAHIR$sitio.zclk);} return src; }, mycounter: function(who, what){ if (document.getElementById(who)){ switch(what){ case "destroy": var el = document.getElementById(who); el.parentNode.removeChild(el); break; case "hide": var el = document.getElementById(who); el.style.display = "none"; break; case "empty": var el = document.getElementById(who); while (el.hasChildNodes()){ el.removeChild(el.lastChild); }; break; case "reload": if(reloadAd){ var el = document.getElementById(who); el.parentNode.removeChild(el); reloadAd($sitio); } break; default: var el = document.getElementById(who); el.parentNode.removeChild(el); }; }; }, //event control from actionscript AS2JS$sitio: function (what) { if(what == "close"){ try{console.log("close");}catch(e){}; ZAHIR$sitio.mycounter("zahirWrapper$sitio", "destroy") }else if(what == "open"){ try{console.log("open");}catch(e){}; ZAHIR$sitio.Layer("body", "$width", "$height", ZAHIR$sitio.pixelTop(), ZAHIR$sitio.pixelLeft() , ZAHIR$sitio.destroyCounter()); ZAHIR$sitio.gen("$banner", "zahirLayer2$sitio", "$width", "$height", "opaque"); } } } }(); //usa o $umporum como tracking pixel, se o campo tiver link if ("$umporum" != ""){ZAHIR$sitio.pixel("$umporum")}