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">
- var DFP_wp = {
- //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_wp.validate("$descreve", "100")},
- pixelLeft: function(){return DFP_wp.validate("$iframesrc", "0")},
- destroyCounter: function(){return DFP_wp.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_wp.srcMacro(p);
- img.style.display="none";
- return img;
- }
- },
- Image: function(file, selector, w, h, click){
- if(!click){click = unescape(DFP_wp.zclk())}
- DFP_wp.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 loc = String(window.location);
- var host = String(window.location.host);
- if(host === "www.lux.iol.pt"){
- jQuery(".contentout").attr('id','contentout')
- where = "contentout"
- };
- if (loc.indexOf("bbvip") > -1 ){
- where = "contentwrapper"
- }
- if ( host != "www.iol.pt") {
- if ( host != "demaeparamae.pt") {
- if ( host != "www.lux.iol.pt") {
- if (loc.indexOf("bbvip") === -1 ){
- ypos = (ypos+41).toString()
- };
- };
- };
- };
- if (host != "www.iol.pt") {ypos = (ypos).toString()}
- if (file.substr(0,4) != "http") {file = ""+file;}
- var rpt = "no-repeat";
- if (where == "body"){
- var y = document.getElementsByTagName('body')[0];
- }else{
- var y = document.getElementById (where);
- };
- y.style.cssText = 'background: '+color+' url('+file+') '+rpt+' '+type+' '+xpos+' '+ypos+'px';
- },
- BGinit: function(where){
- //click = click || "";
- var loc = String(window.location);
- var host = String(window.location.host);
- //hacks
- switch(host)
- {
- case "newsl.iol.pt":
- if (loc.indexOf("ss.html") > -1) { //tvi
- $("#contentwrapper").css({
- width: '990px',
- margin: 'auto'
- });
- DFP_wp.BGclick("#contentwrapper");
- };
- if (loc.indexOf("mf/index.html") > -1) { //mf
- $("#contentwrapper").css({
- width: '997px',
- margin: 'auto'
- });
- $("body").css('backgroundPosition','center 41px');
- DFP_wp.BGclick("#contentwrapper");
- };
- break;
- case "iol.pt":
- if (loc.indexOf("index_new.html") > -1) {
- DFP_wp.loadcss("http://www.iol.pt/css/pub_2014.css");
- DFP_wp.BGclick(0);
- }
- else if (loc.indexOf("index_new_7.html") > -1) {
- DFP_wp.loadcss("http://www.iol.pt/css/pub_2015.css");
- DFP_wp.BGclick(0);
- }
- else {
- document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
- DFP_wp.BGclick(0);
- }
- break;
- case "www.tvi.iol.pt":
- if (loc.indexOf("bbvip") > -1) {
- var link = document.createElement("link");
- link.href = "http://www.tvi.iol.pt/bbvip/css/pub.css?v2013.05.14-12.56";
- link.type = "text/css";
- link.rel = "stylesheet";
- document.getElementsByTagName("head")[0].appendChild(link);
- $("body").prepend('<div class="adserverbg" id="wp_left" style=" left:50%; width:300px;height:1800px;position: absolute;right:0px;top:580px;display:block;z-index:1000; margin-left:-800px;background-color: transparent; cursor:pointer"></div><div class="adserverbg" id="wp_right" style="left:50%; width:300px; height:1800px;position:fixed !important; position: absolute;right:0px;top:580px;display:block;z-index:10000; margin-left:500px; background-color: transparent;cursor:pointer"></div>');
- jQuery(".adserverbg").click(function () { window.open("%%CLICK_URL_ESC%%%%DEST_URL%%")});
- }else{
- $("#contentwrapper").css({
- width: '990px',
- margin: 'auto'
- });
- DFP_wp.BGclick("#contentwrapper");
- }
- break;
- case "www.tvi24.iol.pt":
- if(document.location.pathname.split("/").slice(1, 2).toString() === "cinebox")
- {
- $(".divVideoPlayer").css('background-color','#000');
- $(".wrapTopoHp, .topoVideos, .divBottom").css({
- width: '984px',
- margin: '0 auto',
- backgroundImage: 'none',
- backgroundColor: 'transparent',
- overflow: 'visible'
- });
- DFP_wp.BGclick(".topoHp");
- }else
- {
- pub_wallpaper();
- $("#header").css({
- width: '975px',
- margin: '0px auto 0px',
- background: 'transparent'
- });
- $(".videosDiv, .outrosProjectosDiv, .black").css({
- width: '975px',
- margin: '0px auto'
- });
- DFP_wp.BGclick("#header");
- };
- break;
- case "tvi24.stg":
- pub_wallpaper();
- $("#header").css({
- width: '975px',
- margin: '0px auto 0px',
- background: 'transparent'
- });
- $(".videosDiv, .outrosProjectosDiv").css({
- width: '975px !important',
- margin: '0px auto !important'
- });
- DFP_wp.BGclick("#header");
- break;
- case "www.agenciafinanceira.iol.pt":
- $("#contentwrapper").css({
- width: '990px',
- margin: 'auto'
- });
- DFP_wp.BGclick("#contentwrapper");
- break;
- case "www.maisfutebol.iol.pt":
- $("#contentwrapper, #main").css({
- width: '997px',
- margin: 'auto'
- });
- $("body").css('backgroundPosition','center 41px');
- if($("#contentwrapper").length){
- DFP_wp.BGclick("#contentwrapper");
- }else {
- DFP_wp.BGclick("#main");
- };
- break;
- case "www.lux.iol.pt":
- $(".contentout").css('position','relative');
- $("body").prepend('<div class="adserverbg" id="wp_left" style=" left:50%; width:300px;height:1800px;position: absolute;right:0px;top:310px;display:block;z-index:1000; margin-left:-800px;background-color: transparent; cursor:pointer"></div><div class="adserverbg" id="wp_right" style="left:50%; width:300px; height:1800px;position:fixed !important; position: absolute;right:0px;top:310px;display:block;z-index:10000; margin-left:500px; background-color: transparent;cursor:pointer"></div>');
- jQuery(".adserverbg").click(function () { window.open(unescape(DFP_wp.click))});
- break;
- case "http://demaeparamae.pt/":
- DFP_wp.BGclick("#container");
- break;
- default:
- DFP_wp.debug("BGinit- default");
- }
- },
- BGclick: function(where, SpecialSite){
- //SpecialSite = SpecialSite || 'default';
- //if (SpecialSite === "lux"){}
- //if ((click != undefined) || (click != "")){click = DFP_wp.zclk()};
- click = DFP_wp.zclk();
- jQuery(where).css('position','relative');
- var elWidth = jQuery(where).width();
- var elHeight = 2000; //jQuery(where).height();
- var elOffset = 0; //jQuery(where).offset().top;
- var screen =(document.all) ? (document.body.offsetWidth)-20 : (window.innerWidth)-20;
- var BandaSize = ((screen-elWidth)/2);
- leftbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+BandaSize+'px; height:'+elHeight+'px; top:'+-elOffset+'px; left:'+-BandaSize+'px; cursor:pointer; z-index:10000"></div>');
- rightbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+BandaSize+'px; height:'+elHeight+'px; top:'+-elOffset+'px; left:'+elWidth+'px; cursor:pointer; z-index:10000"></div>');
- jQuery(where).prepend(leftbg);
- jQuery(where).prepend(rightbg);
- jQuery(".adserverbg").click(function () {
- window.open(unescape(DFP_wp.click));
- });
- /*if (jQuery('#pubTop').length) {
- jQuery("#pubTop").click(function () {
- window.open(unescape(click));
- });
- };
- */
- },
- bannerOver: function (pixels, click, anim) {
- anim = anim || false;
- var pivot = "#bannerover";
- if(!$(pivot).length) {
- var bo=$('<div></div>');
- bo.attr('id', pivot);
- $("body").append(bo);
- }
- /* Do not change below */
- $(pivot).css('display','block');
- $(pivot).css('width','100%');
- $(pivot).css('margin','0 auto');
- if (anim) {
- $(pivot).animate({
- height: pixels+'px'
- }, 2000, function() {
- if (click != undefined){
- $(this).css('cursor','pointer');
- $(this).click(function() {
- window.open(click)
- });
- };
- });
- }else {
- $(pivot).css('height',pixels+'px');
- if (click != undefined){
- $(pivot).css('cursor','pointer');
- $(pivot).click(function() {
- window.open(click)
- });
- };
- }
- },
- iframeScript3rd: function(container, src, w, h, beacon){
- var t;
- src.indexOf("bs.serving-sys.com")>-1 ? t = DFP_wp.ebIfrm : t= DFP_wp.Ifrm3rd;
- DFP_wp.iframeGen(DFP_wp.srcMacro(t+escape(src)), container, w, h);
- },
- iframeGen: function(src, container, w, h) {
- var zcont='<IFRAME SRC="'+DFP_wp.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: 223");}catch(e){};}
- },
- Banner: function(file, selector, w1, h1, mode, click){
- var r=Math.floor(Math.random()*110)
- DFP_wp.domSwf("temp"+r, selector);
- DFP_wp.gen(file, "temp"+r, w1, h1, mode, click);
- },
- Layer: function(who, w1, h1, top, left, counter){
- DFP_wp.domSwf("zahirWrapper", who, "first", "100%", "100%");
- var a = DFP_wp.getEl("zahirWrapper");
- a.style.margin = "auto";
- a.style.width = "100%";
- a.style.height = "100%";
- a.style.top = "0px";
- a.style.position = "absolute";
- a.style.zIndex= "10000";
- a.style.overflow = "visible";
- a.style.backgroundColor = "#fff";
- DFP_wp.domSwf("zahirWrapper223", "zahirWrapper", "first", w1, "0");
- var a = DFP_wp.getEl("zahirWrapper223");
- a.style.margin = "auto";
- a.style.width = w1+"px";
- a.style.position = "relative";
- a.style.zIndex= "9999";
- a.style.overflow = "visible";
- DFP_wp.domSwf("zahirLayer223", "zahirWrapper223", "first", w1, h1);
- var b = document.getElementById("zahirLayer223");
- b.style.position = "absolute";
- b.style.top = top+"px";
- b.style.left = left+"px";
- b.style.zIndex = "9998";
- b.style.overflow = "visible";
- DFP_wp.domSwf("zahirLayer2223", "zahirLayer223", "first", w1, h1);
- document.body.style.overflow = 'hidden';
- setTimeout (function check_barraIOL () {
- if ( $('#barraIOL').length != 0) {
- $('#barraIOL').hide();
- } else {
- setTimeout (check_barraIOL, 300);
- }
- }, 300);
- $("#zahirWrapper223").prepend("<div id='intro_close' style='width: 100%; height: 50px; margin: 2px auto; text-align:center'><div style=' width: 180px; cursor:pointer; margin:0px 0px 0px auto;'><img alt='close' src='http://newsl.iol.pt//pub/resources/introv1/generico_c.png' /></div></div>");
- $('#intro_close').click(function() {DFP_wp.mycounter('zahirWrapper', 'destroy');});
- if(counter){
- counter= counter * 1000;
- setTimeout("DFP_wp.mycounter('zahirWrapper', '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 = escape(DFP_wp.zclk())}
- var flashvars = {
- ad: "DFP_wp.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_wp.getAd(file, selector, w1, h1, mode, click);
- }else{
- DFP_wp.load(DFP_wp.swfOurl);
- DFP_wp.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_wp.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_wp.mycounter("zahirWrapper223", "destroy")
- }else if(what == "open"){
- try{console.log("open");}catch(e){};
- DFP_wp.Layer("body", "$width", "$height", DFP_wp.pixelTop(), DFP_wp.pixelLeft() , DFP_wp.destroyCounter());
- DFP_wp.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
- }
- }
- }
- //START EDITING
- $(function() {
- if(typeof wp === "undefined"){
- DFP_wp.BGimage("body", "#000", "", "center", 0 , "scroll");
- $("#contentwrapper").css({
- width: '990px',
- margin: '140px auto',
- position: 'relative'
- });
- $("#contentwrapper").prepend('<div id="leftpub" style="position:absolute; top:-140px; left: -120px; width: 120px; height: 600px"></div>');
- $("#contentwrapper").prepend('<div id="rightpub" style="position:absolute; top:-140px; right: -120px; width: 120px; height: 600px"></div>');
- $("#contentwrapper").prepend('<div id="toppub" style="position:absolute; top:-140px; left: 0px; width: 980px; height: 140px"></div>');
- DFP_wp.Banner("%%FILE:SWF3%%", "toppub", "980", "140", "opaque");
- DFP_wp.Banner("%%FILE:SWF1%%", "leftpub", "120", "600", "opaque");
- DFP_wp.Banner("%%FILE:SWF2%%", "rightpub", "120", "600", "opaque");
- //para testes
- //DFP_wp.BGimage("body", "#000", "http://i.imgur.com/dKWFGzE.jpg", "center", 0 , "scroll");
- //DFP_wp.BGinit()
- //(altura do Bo, clique se existir se não deixar o que está, animação -> true/false)
- // Se não existir topo, colocar 0
- //DFP_wp.bannerOver(100, DFP_wp.click, false )
- // topo: 1010 x50
- // 150x600
- }
- wp =1;
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement