Advertisement
anatolionobre

WP+BO 1 SWF

Oct 4th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
  2.  
  3.  
  4. <script type="text/javascript">
  5.  
  6. if(typeof DFP_wp === "undefined"){
  7. var DFP_wp =   {
  8.                 clickHeight: 750, //altura da área de click
  9.                 clickWidth: 300, //largura da área de clcik
  10.  
  11.                 BgColor: "#fff", //cor do background
  12.                 Scroll: "scroll",  //escolher entre scroll e fixed
  13.                
  14.                 topHeight: 0, //altura da área de topo clicável , se existir. Se não existir, colocar "0"
  15.                 topHeightAnim: false, //Se existir altura de topo, configurar se queremos animação a descer se não (true/false): default = false
  16.  
  17.                 //CHANGE USUALLY NOT REQUIRED
  18.                 siteWidth: 990, //largura do site (normalmente sempre 990)
  19.                                 File: "%%FILE:JPG1%%", //ficheiro de imagem
  20.                            
  21.                                 destUrl: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  22.                                
  23.                                 dynamicUrl: false, //ativa a substituição dinâmica da string tvi pelo site onde passa a pub
  24.                                
  25.                                 getDynamicUrl: function(){
  26.                                         var hostDfp = String(window.location.host).replace('www.', '');
  27.                                         if (hostDfp.indexOf("iol") >-1) {
  28.                                                 //Tem dominio IOL
  29.                                                 //é o IOl.pt?
  30.                                                 if(hostDfp.split(".")[0] ==="iol") {
  31.                                                         return "iol.pt";
  32.                                                 }else{
  33.                                                         return hostDfp.split(".")[0];
  34.                                                 }
  35.                                         }else {
  36.                                         //fora do domínio IOL -> retorna dominio
  37.                                                 return hostDfp.split(".")[0];
  38.                                         };
  39.                                 },
  40.                                
  41.                                 click: function () {
  42.                                         if(DFP_wp.dynamicUrl){
  43.                                          return unescape(DFP_wp.destUrl.replace(/tvi-/g,DFP_wp.getDynamicUrl()));
  44.                                         }else{
  45.                                         return "%%CLICK_URL_ESC%%%%DEST_URL%%";
  46.                                         }
  47.                                
  48.                                 },
  49.                                                                
  50.                                
  51.                 utm: false, //alterar para false se não queremos por algum motivo usar utm
  52.                 utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
  53.                 utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
  54.                 //DO NOT CHANGE BELOW
  55.                 dfpmacro: "%%CLICK_URL_ESC%%",
  56.                 pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},  
  57.                 utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  58.                 utm_source_value: document.domain, //default is document value
  59.                 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+''},
  60.                 zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  61.                 debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  62.                 swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  63.        
  64.                 validate: function (param, default_value){
  65.                         if (param == ""){param = default_value}
  66.                         return param;
  67.                 },
  68.                 getEl: function (i){return document.getElementById(i)},
  69.                 pixel: function(p) {
  70.                         if(p){
  71.                                 img = new Image(1,1)
  72.                                 img.src = DFP_wp.srcMacro(p);
  73.                                 img.style.display="none";
  74.                                 return img;
  75.                         }
  76.                 },
  77.                 Image: function(file, selector, w, h, click){
  78.                         if(!click){click = unescape(DFP_wp.zclk())}
  79.                         DFP_wp.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  80.                 },
  81.                 BGimage: function(color, file, xpos, ypos, type ){
  82.                                 var loc = String(window.location);
  83.                                 var host = String(window.location.host).replace('www.', '')
  84.                                 var where = "body"
  85.                         //hacks
  86.  
  87.                         //ypos -> barra do IOL (41px, com exceções)
  88.                         if (( host != "iol.pt") && (host != "demaeparamae.pt")){
  89.                                                         ypos = (ypos+41)
  90.                          };
  91.                                                  
  92.                                                  
  93.                                                  
  94.                                                 if (loc.indexOf("masterchef") > -1){
  95.                                                         ypos = 0;
  96.                          };
  97.                                                  
  98.  
  99.                                                  
  100.                                                  if (loc.indexOf("melhor-do-que-falecer") > -1){
  101.                                                         ypos = 0;
  102.                          };
  103.                                                  
  104.                                                 if (loc.indexOf("mulheres") > -1){
  105.                                                         ypos = 0;
  106.                          };
  107.                                                  
  108.                         ypos = (ypos).toString()
  109.                         //container exceptions
  110.                         if (loc.indexOf("bbvip") > -1 ){where = "contentwrapper"}
  111.                         // hack for local file testing
  112.                         if (file.substr(0,4) != "http") {file = ""+file;}
  113.                         //apply BG
  114.                         var rpt =  "no-repeat";
  115.                         if (where == "body"){var y = document.getElementsByTagName('body')[0];
  116.                         }else{var y = document.getElementById (where);};
  117.                         y.style.cssText = 'background: '+color+' url('+file+') '+rpt+' '+type+' '+xpos+' '+ypos+'px';
  118.                 },
  119.                 BGclick: function(t, click){
  120.                         LeftMargin = ((DFP_wp.siteWidth + 10)/2) + DFP_wp.clickWidth;
  121.                         RightMargin = ((DFP_wp.siteWidth + 10)/2);
  122.                         click = click || DFP_wp.click();
  123.                        
  124.                        
  125.                        
  126.                         son = document.createElement("div");
  127.                         son.innerHTML = '<div class="adserverbg" id="wp_left" style=" left:50%; width:'+DFP_wp.clickWidth+'px;height:'+DFP_wp.clickHeight+'px;position: absolute;right:0px;top:'+t+'px;display:block;z-index:1000; margin-left:'+-LeftMargin+'px;background-color: transparent; cursor:pointer"></div>'
  128.                         document.body.insertBefore(son, document.body.firstChild);
  129.        
  130.                                                
  131.                                                 document.getElementById('wp_left').onclick = function(e){
  132.                                                         window.open(DFP_wp.click());
  133.                                                         e.stopPropagation();
  134.                                                 }
  135.                                                
  136.                         son = document.createElement("div");
  137.                         son.innerHTML = '<div class="adserverbg" id="wp_right" style="left:50%; width:'+DFP_wp.clickWidth+'px; height:'+DFP_wp.clickHeight+'px; position: absolute;right:0px;top:'+t+'px;display:block;z-index:10000; margin-left:'+RightMargin+'px; background-color: transparent;cursor:pointer"></div>'
  138.                         document.body.insertBefore(son, document.body.firstChild);                    
  139.                        
  140.                                                 document.getElementById('wp_right').onclick = function(e){
  141.                                                         window.open(DFP_wp.click());
  142.                                                         e.stopPropagation();
  143.                                                 }
  144.  
  145.                        
  146.                        
  147.                 },
  148.                 BGcssHack: function(where){
  149.                                 var loc = String(window.location);
  150.                                 var host = String(window.location.host).replace('www.', '')
  151.                                 var path = String(window.location.pathname);
  152.                                 //hacks
  153.                                 switch(host)
  154.                                         {
  155.                                         case "iol.pt":
  156.                                
  157.                                         document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  158.  
  159.                                                 DFP_wp.BGclick(0);
  160.                                           break;
  161.                                         case "newsl.iol.pt":
  162.                                                 //http://newsl.iol.pt/pub/testes-wp/ss4.html
  163.                                                 //http://newsl.iol.pt/pub/testes-wp/iloveit.html
  164.                                                 //http://newsl.iol.pt/pub/testes-wp/belmonte.html
  165.                                         if (loc.indexOf("bbvip") > -1) {
  166.                                                 DFP_wp.BGclick(580);
  167.                                         }else if(loc.indexOf("ss4") > -1){
  168.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  169.                                                 DFP_wp.BGclick(41);
  170.                                         }else if(loc.indexOf("iloveit") >-1){
  171.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
  172.                                                 DFP_wp.BGclick(41);
  173.                                         }else if (loc.indexOf("belmonte")  > -1){
  174.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  175.                                                 DFP_wp.BGclick(41);
  176.                                         }else{
  177.                                        
  178.                                                 document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  179.                                                 DFP_wp.BGclick(41);
  180.                                         };
  181.                                          break;
  182.                                         case "maisfutebol.iol.pt":
  183.                                                                                         DFP_wp.loadcss("http://www.maisfutebol.iol.pt/css/1024.css?v65");
  184.                                                                                        
  185.                                                                                         DFP_wp.BGclick(41);
  186.                                         break;
  187.                                                                                
  188.                                                                                 case "tvi.iol.pt":
  189.                                                                                
  190.                                                                                
  191.                                                                                        
  192.                                         if (loc.indexOf("bbvip") > -1) {
  193.                                                 DFP_wp.BGclick(580);
  194.                                         }else if(loc.indexOf("ss4") > -1){
  195.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  196.                                                 DFP_wp.BGclick(41);
  197.                                         }else if(loc.indexOf("iloveit") >-1){
  198.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
  199.                                                 DFP_wp.BGclick(41);
  200.                                                                                 }else if(loc.indexOf("desafio-final2") >-1){
  201.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  202.                                                 DFP_wp.BGclick(41);            
  203.                                                                                 }else if (loc.indexOf("/belmonte/")  > -1){
  204.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  205.                                                 DFP_wp.BGclick(41);
  206.                                                                                 }else if (loc.indexOf("/o-beijo-do-escorpiao/")  > -1){
  207.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  208.                                                 DFP_wp.BGclick(41);
  209.                                                                                 }else if (loc.indexOf("/mulheres/")  > -1){
  210.                                                                                         DFP_wp.loadcss("http://www.tvi.iol.pt/mulheres/css/pub.css?v20140717");
  211.                                                                                        
  212.                                                 DFP_wp.BGclick(0);            
  213.                                                                                                
  214.                                                                                
  215.                                                                                 }else if (loc.indexOf("masterchef")  > -1){
  216.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px"
  217.                                                 DFP_wp.BGclick(41);            
  218.                                                                                                
  219.                                                                                 }else if (loc.indexOf("/risingstar/")  > -1){          
  220.                                                                                         $(".top-nav-wraper").css("backgroundColor","#333")
  221.                                                                                         $(".row").css("backgroundColor","#fff")
  222.                                                                                                 DFP_wp.BGclick(41);            
  223.                                                                                                
  224.                                                                                                
  225.                                                                                                
  226.                                                                                                
  227.                                                                                 }else if (loc.indexOf("/melhor-do-que-falecer/")  > -1){
  228.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px";
  229.                                                                                                 $(".nav-home").css('maxWidth','980px');
  230.                                                                                                 $(".nav-home").css('height','45%');
  231.                                                                                                 $(".back_vid").css('display','none');
  232.                                                                                                 $( "#fullscreen" ).after( "<div id='bannerover' style='max-width:980x; margin:auto'></div>" );
  233.                                                                                                 $('.wise_message').css('display','none');
  234.                                                                                                
  235.                                                                                                
  236.                                                                                                
  237.                                                                                                
  238.                                                                                                
  239.                                                                                                
  240.                                                 DFP_wp.BGclick(0);            
  241.                                                                                                
  242.                                                                                                 }
  243.                                                                                
  244.                                                        
  245.                                                                                
  246.                                                                                 else{
  247.                                                                                          document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  248.                                                 DFP_wp.BGclick(41);
  249.                                                                                 if (typeof pub_ativar_wallpaper != "undefined") {
  250.                                                                                                 pub_ativar_wallpaper();
  251.  
  252.                                                                                         };
  253.  
  254.                                         }
  255.                                          break;
  256.                                                                                  
  257.                                                                                 case "tvi.pt":
  258.                                                                                                                        
  259.                                         if (loc.indexOf("bbvip") > -1) {
  260.                                                 DFP_wp.BGclick(580);
  261.                                         }else if(loc.indexOf("ss4") > -1){
  262.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  263.                                                 DFP_wp.BGclick(41);
  264.                                         }else if(loc.indexOf("iloveit") >-1){
  265.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
  266.                                                 DFP_wp.BGclick(41);
  267.                                                                                 }else if(loc.indexOf("desafio-final2") >-1){
  268.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  269.                                                 DFP_wp.BGclick(41);            
  270.                                                                                 }else if (loc.indexOf("/belmonte/")  > -1){
  271.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  272.                                                 DFP_wp.BGclick(41);
  273.                                                                                 }else if (loc.indexOf("/o-beijo-do-escorpiao/")  > -1){
  274.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  275.                                                 DFP_wp.BGclick(41);
  276.                                                                                 }else if (loc.indexOf("/mulheres/")  > -1){
  277.                                                                                         DFP_wp.loadcss("http://www.tvi.iol.pt/mulheres/css/pub.css?v20140717");
  278.                                                                                        
  279.                                                 DFP_wp.BGclick(0);            
  280.                                                                                                
  281.                                                                                
  282.                                                                                 }else if (loc.indexOf("masterchef")  > -1){
  283.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px"
  284.                                                 DFP_wp.BGclick(41);            
  285.                                                                                                
  286.                                                                                 }else if (loc.indexOf("/risingstar/")  > -1){          
  287.                                                                                         $(".top-nav-wraper").css("backgroundColor","#333")
  288.                                                                                         $(".row").css("backgroundColor","#fff")
  289.                                                                                                 DFP_wp.BGclick(41);            
  290.                                                                                                
  291.                                                                                                
  292.                                                                                                
  293.                                                                                                
  294.                                                                                 }else if (loc.indexOf("/melhor-do-que-falecer/")  > -1){
  295.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px";
  296.                                                                                                 $(".nav-home").css('maxWidth','980px');
  297.                                                                                                 $(".nav-home").css('height','45%');
  298.                                                                                                 $(".back_vid").css('display','none');
  299.                                                                                                 $( "#fullscreen" ).after( "<div id='bannerover' style='max-width:980x; margin:auto'></div>" );
  300.                                                                                                 $('.wise_message').css('display','none');
  301.                                                                                                
  302.                                                                                                
  303.                                                                                                
  304.                                                                                                
  305.                                                                                                
  306.                                                                                                
  307.                                                 DFP_wp.BGclick(0);            
  308.                                                                                                
  309.                                                                                                 }
  310.                                                                                
  311.                                                        
  312.                                                                                
  313.                                                                                 else{
  314.                                                                                          document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  315.                                                 DFP_wp.BGclick(41);
  316.                                                                                 if (typeof pub_ativar_wallpaper != "undefined") {
  317.                                                                                                 pub_ativar_wallpaper();
  318.  
  319.                                                                                         };
  320.  
  321.                                         }
  322.                                          break;
  323.                                          break;
  324.                                                                                  
  325.                                                                                 case "spotmais.iol.pt":
  326.                                                                                         DFP_wp.loadcss("http://newsl.iol.pt/pub/resources/css/spotmais-wp.css");
  327.                                                                                         DFP_wp.BGclick(41);
  328.                                                                                 break;
  329.                                                                                
  330.                                                                                 case "autoportal.iol.pt":
  331.                                                         dad = document.getElementById( "pagina" ) ;
  332.                                                         son = document.createElement("div");
  333.                                                         son.innerHTML = '<div id="bannerover"></div>'
  334.                                                         dad.insertBefore(son, dad.firstChild);
  335.                                                                                
  336.                                         document.getElementById("pagina").style.cssText = "border:0";
  337.                                
  338.                                         DFP_wp.BGclick(41);
  339.                                        
  340.                                         break;
  341.                                         case "tvi24.iol.pt":
  342.                                                 if(document.location.pathname.split("/").slice(1, 2).toString() === "cinebox"){
  343.                                                
  344.                                                         if (window.jQuery) {
  345.                                                                 $(".divVideoPlayer").css('background-color','#000');
  346.                                                                 $(".wrapTopoHp, .topoVideos, .divBottom").css({
  347.                                                                         width: '984px',
  348.                                                                         margin: '0 auto',
  349.                                                                         backgroundImage: 'none',
  350.                                                                         backgroundColor: 'transparent',
  351.                                                                         overflow: 'visible'
  352.                                                                 });
  353.                                                                         DFP_wp.BGclick(41);
  354.  
  355.                                                         }
  356.                                                 }else{
  357.                                                         if (window.jQuery) {
  358.                                                                  pub_wallpaper();
  359.                                                                  $("#header").css({
  360.                                                                                 width: '975px',
  361.                                                                                 margin: '0px auto 0px',
  362.                                                                                 background: 'transparent'
  363.                                                                         });
  364.                                                                         $(".videosDiv, .outrosProjectosDiv, .black").css({
  365.                                                                                 width: '975px',
  366.                                                                                 margin: '0px auto'
  367.                                                                         });
  368.                                                                 DFP_wp.BGclick(41);
  369.                                                         };
  370.                                                 };
  371.                                          break;
  372.                                         case "lux.iol.pt":
  373.                                                                                         DFP_wp.loadcss("http://www.lux.iol.pt/css/pub.css?v201401272028");
  374.                                                                                         DFP_wp.BGclick(41);
  375.                                         DFP_wp.BGclick(210);
  376.                                         break;  
  377.                                         case "http://demaeparamae.pt/":
  378.                                         DFP_wp.BGclick(0);
  379.                                          break;
  380.                                         default:
  381.                                           DFP_wp.debug("BGCssHack- default");
  382.                                         }
  383.                 },
  384.  
  385.                 loadjs: function (what) {
  386.                         var head = document.getElementsByTagName("head")[0];
  387.                         var script = document.createElement("script");
  388.                         script.type = "text/javascript";
  389.                         script.src = what;
  390.                         head.appendChild(script);
  391.                 },
  392.                 loadcss: function (what) {
  393.                         var head = document.getElementsByTagName("head")[0];
  394.                         var link = document.createElement("link");
  395.                         link.type = "text/css";
  396.                         link.rel = "stylesheet";
  397.                         link.href = what;
  398.                         head.appendChild(link);
  399.                 },
  400.                 srcMacro: function (src){
  401.                         var ord=Math.floor(Math.random()*10001)
  402.                         if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  403.                         //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_wp.zclk());}
  404.                         return src;
  405.                 },
  406.                
  407.                 bannerOver: function (pixels, click, anim) {
  408.                         anim = anim || false;
  409.                         var pivot = document.getElementById("bannerover");
  410.                 //      document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  411.                         if(!document.getElementById("bannerover")) {
  412.                        
  413.  
  414.                         son = document.createElement("div");
  415.                         son.innerHTML = '<div id="bannerover"></div>'
  416.                         document.body.insertBefore(son, document.body.firstChild);
  417.  
  418.                         };
  419.                         document.getElementById("bannerover").style.cssText = "display:block; width: 990px; margin: 0 auto; background: transparent;";
  420.                         if ((anim) && (window.jQuery)){
  421.                         $(pivot).animate({
  422.                                 height: pixels+'px'
  423.                         }, 2000, function() {
  424.                                 if (click != undefined){
  425.                                         $(this).css('cursor','pointer');
  426.                                         $(this).click(function() {
  427.                                                 window.open(click)
  428.                                         });
  429.                                 };
  430.                         });
  431.                         }else {
  432.                                 if (window.jQuery){
  433.                        
  434.                                 $(pivot).css('height',pixels+'px');
  435.                                         if (click != undefined){
  436.                                                 $(pivot).css('cursor','pointer');
  437.                                                 $(pivot).click(function() {
  438.                                                         window.open(click)
  439.                                                 });
  440.                                         };
  441.                                 }else {
  442.                                                                
  443.                                                                         document.getElementById("bannerover").style.height= pixels+'px';
  444.                                                                         document.getElementById("bannerover").style.cursor= 'pointer';
  445.                                                                         document.getElementById('bannerover').onclick = function(e){
  446.                                          window.open(DFP_wp.click());
  447.                                          e.stopPropagation();
  448.                                     }
  449.                                                                
  450.                                                                 };  
  451.                         };
  452.                 },
  453.                                
  454.                                
  455.                                
  456.                          isMobile: function () {
  457.                                         var userAgent = navigator.userAgent||navigator.vendor||window.opera;
  458.                                         if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|android|ipad|playbook|silk|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0,4)))
  459.                                                 return true;
  460.                                         else
  461.                                                 return false;
  462.                                 },
  463.                                
  464.                                 isIOS: function () {
  465.                                         var userAgent = navigator.userAgent||navigator.vendor||window.opera;
  466.                                         if(/ip(hone|od|ad)/i.test(userAgent))
  467.                                                 return true;
  468.                                         else
  469.                                                 return false;
  470.                                 }
  471.                          
  472.        
  473.                                                
  474.                                
  475. }
  476.    
  477.  
  478.                
  479.                 //init
  480.                                
  481.                                 if (!DFP_wp.isMobile()) {
  482.                                
  483.                                         if (window.jQuery){
  484.                                                 $( document ).ready(function() {
  485.                                                         DFP_wp.BGcssHack()
  486.                                                         DFP_wp.BGimage(DFP_wp.BgColor, DFP_wp.File, "center", 0 , DFP_wp.Scroll);
  487.                                                         //DFP_wp.BGimage(DFP_wp.BgColor, "http://i.imgur.com/P5CEyvj.jpg", "center", 0 , DFP_wp.Scroll);
  488.                                                         DFP_wp.bannerOver(DFP_wp.topHeight, DFP_wp.click(), DFP_wp.topHeightAnim );
  489.                                                 });
  490.                                        
  491.                                         }else {
  492.                                        
  493.                                                                        
  494.                         DFP_wp.BGcssHack()
  495.                         DFP_wp.BGimage(DFP_wp.BgColor, DFP_wp.File, "center", 0 , DFP_wp.Scroll);
  496.                         DFP_wp.bannerOver(DFP_wp.topHeight, DFP_wp.click(), DFP_wp.topHeightAnim );
  497.                                        
  498.                                        
  499.                                         }
  500.  
  501.                                 };    
  502.        
  503.  
  504.        
  505. }
  506. </script>
  507.  
  508.  
  509.  
  510. <!-- BANNEROVER
  511. 31/01
  512. -->
  513.  
  514.  
  515. <img src="http://trackingpixel.com" width="1" height="1" style="display:none"/>
  516.  
  517. <script type="text/javascript">
  518.  
  519. var DFP_bo =   {
  520.                 //CHANGE USUALLY NOT REQUIRED
  521.  
  522.                 click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  523.                
  524.                 //normal
  525.                 width: "980",
  526.                 height: "430",
  527.                
  528.                 //expandido
  529.                 width2: "980",
  530.                 height2: "430",
  531.                
  532.                 mode: "opaque", //alterar por transparent, se desejado
  533.  
  534.                 //LAYER SPECIFICS
  535.                
  536.                 //DO NOT CHANGE BELOW
  537.                 dfpmacro: "%%CLICK_URL_ESC%%",
  538.                 pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},  
  539.                 utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  540.                 utm_source_value: document.domain, //default is document value
  541.                 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+''},
  542.                 zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  543.                 debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  544.                 swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  545.                 pixelTop: function(){return DFP_bo.validate("$descreve", "100")},
  546.                 pixelLeft: function(){return DFP_bo.validate("$iframesrc", "0")},
  547.                 destroyCounter: function(){return DFP_bo.validate("$scriptsrc", "30")},                
  548.                
  549.                 validate: function (param, default_value){
  550.                         if (param == ""){param = default_value}
  551.                         return param;
  552.                 },
  553.  
  554.                 getEl: function (i){return document.getElementById(i)},
  555.                
  556.                 pixel: function(p) {
  557.                         if(p){
  558.                                 img = new Image(1,1)
  559.                                 img.src = DFP_bo.srcMacro(p);
  560.                                 img.style.display="none";
  561.                                 return img;
  562.                         }
  563.                 },
  564.  
  565.  
  566.                 Image: function(file, selector, w, h, click){
  567.                         if(!click){click = unescape(DFP_bo.zclk())}
  568.                         DFP_bo.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  569.                
  570.                 },
  571.                        
  572.                                        
  573.                         bannerOver: function (pixels, click, anim) {
  574.                         anim = anim || false;
  575.                
  576.                        
  577.                         var pivot = "#bannerover";
  578.                         if(!$(pivot).length) {
  579.                                 var bo=$('<div></div>');
  580.                                 bo.attr('id', pivot);  
  581.                                 $("body").append(bo);
  582.                         }
  583.                  
  584.                         /* Do not change below */
  585.                         $(pivot).css('display','block');
  586.                         $(pivot).css('width','100%');
  587.                         $(pivot).css('margin','0 auto');
  588.                        
  589.                         if (anim) {
  590.                         $(pivot).animate({
  591.  
  592.  
  593.                                 height: pixels+'px'
  594.                        
  595.                         }, 2000, function() {
  596.                                 if (click != undefined){
  597.                                         $(this).css('cursor','pointer');
  598.                                         $(this).click(function() {
  599.                                                 window.open(click)
  600.                                         });
  601.                                 };
  602.                         });
  603.  
  604.                         }else {
  605.                         $(pivot).css('height',pixels+'px');
  606.                                 if (click != undefined){
  607.                                         $(pivot).css('cursor','pointer');
  608.                                         $(pivot).click(function() {
  609.                                                 window.open(click)
  610.                                         });
  611.                                 };
  612.                         }
  613.  
  614.                 },
  615.                
  616.                
  617.                 iframeScript3rd: function(container, src, w, h, beacon){
  618.                         var t;
  619.                         src.indexOf("bs.serving-sys.com")>-1 ? t = DFP_bo.ebIfrm : t= DFP_bo.Ifrm3rd;
  620.                         DFP_bo.iframeGen(DFP_bo.srcMacro(t+escape(src)), container, w, h);
  621.                 },
  622.                
  623.                
  624.                 iframeGen: function(src, container, w, h) {
  625.                         var zcont='<IFRAME SRC="'+DFP_bo.srcMacro(t+escape(src))+'" WIDTH="'+w+'" HEIGHT="'+h+'" MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no"></iframe>';
  626.                         if (document.getElementById(container)){
  627.                                 document.getElementById(container).innerHTML = zcont;
  628.                         }else{try{console.log("Adserver_Error: I'm trying to append content to an inexistent container: tag id: 223");}catch(e){};}
  629.                 },
  630.                
  631.        
  632.        
  633.                 Banner: function(file, selector, w1, h1, mode, click){
  634.                         var r=Math.floor(Math.random()*110)
  635.                         DFP_bo.domSwf("temp"+r, selector);
  636.                         DFP_bo.gen(file, "temp"+r, w1, h1, mode, click);
  637.                 },
  638.        
  639.  
  640.                
  641.                
  642.                 domSwf: function(el, who, where, w, h ){
  643.                        
  644.                         var newEl = document.createElement("div");
  645.                         newEl.id = el;
  646.  
  647.                         if (who == "body"){
  648.                                 var y = document.getElementsByTagName('body')[0];
  649.                         }else{
  650.                                 var y = document.getElementById (who);
  651.                         }
  652.                         if(where == "first"){
  653.                                 y.insertBefore(newEl, y.firstChild);
  654.                         }else{
  655.                                 y.appendChild(newEl);
  656.                         }
  657.                 },
  658.                
  659.                 getAd: function(file, selector, w1, h1, mode, click){
  660.                
  661.                         var t = setInterval(function() {
  662.                                 if (typeof swfobject != "undefined") {
  663.                                         if (swfobject.hasFlashPlayerVersion("8.0.0")) {
  664.                                                 if(!click){click = escape(DFP_bo.zclk())}
  665.                                                 var flashvars = {
  666.                                                         ad: "DFP_bo.AS2JS223",
  667.                                                         clickTag: click,
  668.                                                         clickTAG: click,
  669.                                                         clicktag: click
  670.                                                 }
  671.                                                 var params = {
  672.                                                         menu: "false",
  673.                                                         quality: "high",
  674.                                                         wmode: mode,
  675.                                                         AllowScriptAccess: "always"
  676.                                                 }
  677.                                                 var attributes = {id: selector}
  678.                                                 swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes);
  679.                                         };
  680.                                         clearInterval(t);
  681.                                         t = null;
  682.                                 }
  683.                         }, 250);
  684.                 },
  685.                
  686.                                
  687.                 load: function (what) {
  688.                         var head = document.getElementsByTagName("head")[0];
  689.                         var script = document.createElement("script");
  690.                         script.type = "text/javascript";
  691.                         script.src = what;
  692.                         head.appendChild(script);
  693.                 },
  694.                
  695.                 gen: function(file, selector, w1, h1, mode, click){
  696.                         if (typeof swfobject != "undefined") {
  697.                                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  698.                         }else{
  699.                                 DFP_bo.load(DFP_bo.swfOurl);
  700.                                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  701.                         }
  702.                 },
  703.                
  704.                 srcMacro: function (src){
  705.                         var ord=Math.floor(Math.random()*10001)
  706.                         if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  707.                         //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_bo.zclk());}
  708.                         return src;
  709.                 },    
  710.  
  711.         mycounter: function(who, what){
  712.                 if (document.getElementById(who)){
  713.                                 switch(what){
  714.                                         case "destroy":
  715.                                         //      var el = document.getElementById(who);
  716.                                         //      el.parentNode.removeChild(el);
  717.                                         $("#"+who).fadeOut('slow', function() {
  718.                                                 $("#"+who).remove();
  719.                                                 document.body.style.overflow = 'scroll';
  720.                                                 $('#barraIOL').fadeIn();
  721.                                         });
  722.                                                
  723.                                         break;
  724.                                         case "hide":
  725.                                                 var el = document.getElementById(who);
  726.                                                 el.style.display = "none";
  727.                                                
  728.                                         break;
  729.                                         case "empty":
  730.                                                 var el = document.getElementById(who);
  731.                                                 while (el.hasChildNodes()){
  732.                                                         el.removeChild(el.lastChild);
  733.                                                 };
  734.                                                
  735.                                         break;
  736.                                         case "reload":
  737.                                                 if(reloadAd){
  738.                                                 var el = document.getElementById(who);
  739.                                                 el.parentNode.removeChild(el);
  740.                                                 reloadAd(223);
  741.                                                 }
  742.                                         break;
  743.                                         default:
  744.                                                 var el = document.getElementById(who);
  745.                                                 el.parentNode.removeChild(el);
  746.                                
  747.                                 };
  748.                         };
  749.                 },
  750.                
  751.                
  752.                 //event control from actionscript
  753.                 AS2JS223: function (what) {
  754.                
  755.                         if(what == "close"){
  756.                                 try{console.log("close");}catch(e){};
  757.                                         DFP_bo.mycounter("zahirWrapper223", "destroy")
  758.                                
  759.                        
  760.                         }else if(what == "open"){
  761.                                 try{console.log("open");}catch(e){};
  762.                                 DFP_bo.Layer("body", "$width", "$height", DFP_bo.pixelTop(), DFP_bo.pixelLeft() , DFP_bo.destroyCounter());
  763.                                 DFP_bo.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
  764.                         }
  765.                 }
  766.  
  767.  
  768.  
  769. }
  770.  
  771.  
  772.  
  773.         function pub_open() {
  774.                 DFP_bo.debug("pub_open f called");
  775.                 $("#bannerover").animate({
  776.                                         height: DFP_bo.height2+'px'
  777.                                         }, 3000, function() {
  778.  
  779.  
  780.                                 });
  781.                        
  782.        
  783.                        
  784.                        
  785.                 };
  786.  
  787.         function pub_close() {
  788.         DFP_bo.debug("closeThis called");
  789.         $("#bannerover").animate({
  790.  
  791.  
  792.                                         height: '100px'
  793.                                
  794.                                 }, 2000, function() {
  795.                                        
  796.                                                
  797.                                 });
  798.  
  799.  
  800.  
  801.  
  802.         }
  803.  
  804.  
  805.         $(function() {
  806.        
  807.         $("#bannerover").css('display','block');
  808.          $("#bannerover").css('height','100px');
  809.          $("#bannerover").css('textAlign','center');
  810.         DFP_bo.Banner("%%FILE:SWF1%%", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
  811.         // teste
  812.         //DFP_bo.Banner("http://newsl.iol.pt/pub/dfp/universobebe_980X430_IOL.swf", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
  813.     });
  814.  
  815.  
  816. DFP_bo.debug("continente - v2");
  817.        
  818. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement