Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
- <script type="text/javascript">
- document.write("<div id=\"footerad\"><div id=\"footerad1\"><\/div><\/div>");
- var DFP_ticker = {
- //CHANGE USUALLY NOT REQUIRED
- click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
- width: "[%Width%]",
- height: "[%Height%]",
- mode: "[%ModoFlash%]", //alterar por transparent, se desejado
- utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
- utm: false, //alterar para false se não queremos por algum motivo usar utm
- utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
- //LAYER SPECIFICS
- //DO NOT CHANGE BELOW
- dfpmacro: "%%CLICK_URL_ESC%%",
- pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},
- utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
- utm_source_value: document.domain, //default is document value
- utm_build: function(){return this.pre_utm_build()+'utm_source%3D'+this.utm_source_value+'%26utm_medium%3D'+this.utm_medium_value+'%26utm_content%3D'+this.utm_content_value()+'%26utm_campaign%3D'+this.utm_campaign_value+''},
- zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
- debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
- swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
- pixelTop: function(){return DFP_ticker.validate("$descreve", "100")},
- pixelLeft: function(){return DFP_ticker.validate("$iframesrc", "0")},
- destroyCounter: function(){return DFP_ticker.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 = DFP_ticker.srcMacro(p);
- img.style.display="none";
- return img;
- }
- },
- Image: function(file, selector, w, h, click){
- if(!click){click = unescape(DFP_ticker.zclk())}
- DFP_ticker.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
- },
- Banner: function(file, selector, w1, h1, mode, click){
- var r=Math.floor(Math.random()*110)
- DFP_ticker.domSwf("temp"+r, selector);
- DFP_ticker.gen(file, "temp"+r, w1, h1, mode, click);
- },
- 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 = escape(DFP_ticker.zclk())}
- var flashvars = {
- ad: "DFP_ticker.AS2JS223",
- 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") {
- DFP_ticker.getAd(file, selector, w1, h1, mode, click);
- }else{
- DFP_ticker.load(DFP_ticker.swfOurl);
- DFP_ticker.getAd(file, selector, w1, h1, mode, click);
- }
- },
- srcMacro: function (src){
- var ord=Math.floor(Math.random()*10001)
- if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
- //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_ticker.zclk());}
- return src;
- },
- mycounter: function(who, what){
- if (document.getElementById(who)){
- switch(what){
- case "destroy":
- // var el = document.getElementById(who);
- // el.parentNode.removeChild(el);
- $("#"+who).fadeOut('slow', function() {
- $("#"+who).remove();
- document.body.style.overflow = 'scroll';
- $('#barraIOL').fadeIn();
- });
- 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(223);
- }
- break;
- default:
- var el = document.getElementById(who);
- el.parentNode.removeChild(el);
- };
- };
- },
- //event control from actionscript
- AS2JS223: function (what) {
- if(what == "close"){
- try{console.log("close");}catch(e){};
- DFP_ticker.mycounter("zahirWrapper223", "destroy")
- }else if(what == "open"){
- try{console.log("open");}catch(e){};
- DFP_ticker.Layer("body", "$width", "$height", DFP_ticker.pixelTop(), DFP_ticker.pixelLeft() , DFP_ticker.destroyCounter());
- DFP_ticker.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
- }
- }
- }
- //START EDITING
- function hideTicker() {
- $("#footer_ad").fadeOut()
- }
- head.ready(function() {
- if (typeof oop === "undefined"){
- $("body").append("<div id='footer_ad' style='position:fixed;left:0px;bottom:0px;height:410px;width:100%;z-index: 10000;background-color:transparent !important;text-align: center;margin: auto;'></div>")
- DFP_ticker.Banner('%%FILE:SWF1%%', 'footer_ad', '1600', '410', 'transparent')
- }
- oop = 1;
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement