Advertisement
anatolionobre

WP+BO 2 SWF

Oct 4th, 2013
160
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.  
  7.  
  8.  
  9. if(typeof DFP_wp === "undefined"){
  10. var DFP_wp =   {
  11.                 clickHeight: 750, //altura da área de click
  12.                 clickWidth: 200, //largura da área de clcik
  13.  
  14.                 BgColor: "#fff", //cor do background
  15.                 Scroll: "scroll",  //escolher entre scroll e fixed
  16.                
  17.                 topHeight: 0, //altura da área de topo clicável , se existir. Se não existir, colocar "0"
  18.                 topHeightAnim: false, //Se existir altura de topo, configurar se queremos animação a descer se não (true/false): default = false
  19.  
  20.                 //CHANGE USUALLY NOT REQUIRED
  21.                 siteWidth: 990, //largura do site (normalmente sempre 990)
  22.                                 File: "%%FILE:JPG1%%", //ficheiro de imagem
  23.                            
  24.                                 destUrl: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  25.                                
  26.                                 dynamicUrl: false, //ativa a substituição dinâmica da string tvi pelo site onde passa a pub
  27.                                
  28.                                 getDynamicUrl: function(){
  29.                                         var hostDfp = String(window.location.host).replace('www.', '');
  30.                                         if (hostDfp.indexOf("iol") >-1) {
  31.                                                 //Tem dominio IOL
  32.                                                 //é o IOl.pt?
  33.                                                 if(hostDfp.split(".")[0] ==="iol") {
  34.                                                         return "iol.pt";
  35.                                                 }else{
  36.                                                         return hostDfp.split(".")[0];
  37.                                                 }
  38.                                         }else {
  39.                                         //fora do domínio IOL -> retorna dominio
  40.                                                 return hostDfp.split(".")[0];
  41.                                         };
  42.                                 },
  43.                                
  44.                                 click: function () {
  45.                                         if(DFP_wp.dynamicUrl){
  46.                                          return unescape(DFP_wp.destUrl.replace(/tvi-/g,DFP_wp.getDynamicUrl()));
  47.                                         }else{
  48.                                         return "%%CLICK_URL_ESC%%%%DEST_URL%%";
  49.                                         }
  50.                                
  51.                                 },
  52.                                                                
  53.                                
  54.                 utm: false, //alterar para false se não queremos por algum motivo usar utm
  55.                 utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
  56.                 utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
  57.                 //DO NOT CHANGE BELOW
  58.                 dfpmacro: "%%CLICK_URL_ESC%%",
  59.                 pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},  
  60.                 utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  61.                 utm_source_value: document.domain, //default is document value
  62.                 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+''},
  63.                 zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  64.                 debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  65.                 swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  66.        
  67.                 validate: function (param, default_value){
  68.                         if (param == ""){param = default_value}
  69.                         return param;
  70.                 },
  71.                 getEl: function (i){return document.getElementById(i)},
  72.                 pixel: function(p) {
  73.                         if(p){
  74.                                 img = new Image(1,1)
  75.                                 img.src = DFP_wp.srcMacro(p);
  76.                                 img.style.display="none";
  77.                                 return img;
  78.                         }
  79.                 },
  80.                 Image: function(file, selector, w, h, click){
  81.                         if(!click){click = unescape(DFP_wp.zclk())}
  82.                         DFP_wp.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  83.                 },
  84.                 BGimage: function(color, file, xpos, ypos, type ){
  85.                                 var loc = String(window.location);
  86.                                 var host = String(window.location.host).replace('www.', '')
  87.                                 var where = "body"
  88.                         //hacks
  89.  
  90.                         //ypos -> barra do IOL (40px, com exceções)
  91.                         if (( host != "iol.pt") && (host != "demaeparamae.pt")){
  92.                                                         ypos = (ypos+40)
  93.                          };
  94.                                                  
  95.                                                  
  96.                                                  
  97.                                                 if (loc.indexOf("masterchef") > -1){
  98.                                                         ypos = 0;
  99.                          };
  100.                                                  
  101.  
  102.                                                  
  103.                                                  if (loc.indexOf("melhor-do-que-falecer") > -1){
  104.                                                         ypos = 0;
  105.                          };
  106.                                                  
  107.                                                 if (loc.indexOf("mulheres") > -1){
  108.                                                         ypos = 0;
  109.                          };
  110.                                                  
  111.                         ypos = (ypos).toString()
  112.                         //container exceptions
  113.                         if (loc.indexOf("bbvip") > -1 ){where = "contentwrapper"}
  114.                         // hack for local file testing
  115.                         if (file.substr(0,4) != "http") {file = ""+file;}
  116.                         //apply BG
  117.                         var rpt =  "no-repeat";
  118.                         if (where == "body"){var y = document.getElementsByTagName('body')[0];
  119.                         }else{var y = document.getElementById (where);};
  120.                         y.style.cssText = 'background: '+color+' url('+file+') '+rpt+' '+type+' '+xpos+' '+ypos+'px';
  121.                 },
  122.                 BGclick: function(t, click){
  123.                         LeftMargin = ((DFP_wp.siteWidth + 10)/2) + DFP_wp.clickWidth;
  124.                         RightMargin = ((DFP_wp.siteWidth + 10)/2);
  125.                         click = click || DFP_wp.click();
  126.                        
  127.                        
  128.                        
  129.                         son = document.createElement("div");
  130.                         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>'
  131.                         document.body.insertBefore(son, document.body.firstChild);
  132.        
  133.                                                
  134.                                                 document.getElementById('wp_left').onclick = function(e){
  135.                                                         window.open(DFP_wp.click());
  136.                                                         e.stopPropagation();
  137.                                                 }
  138.                                                
  139.                         son = document.createElement("div");
  140.                         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>'
  141.                         document.body.insertBefore(son, document.body.firstChild);                    
  142.                        
  143.                                                 document.getElementById('wp_right').onclick = function(e){
  144.                                                         window.open(DFP_wp.click());
  145.                                                         e.stopPropagation();
  146.                                                 }
  147.  
  148.                        
  149.                        
  150.                 },
  151.                 BGcssHack: function(where){
  152.                                 var loc = String(window.location);
  153.                                 var host = String(window.location.host).replace('www.', '')
  154.                                 var path = String(window.location.pathname);
  155.                                 //hacks
  156.                                 switch(host)
  157.                                         {
  158.                                         case "iol.pt":
  159.                                
  160.                                         document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  161.  
  162.                                                 DFP_wp.BGclick(0);
  163.                                           break;
  164.                                         case "newsl.iol.pt":
  165.                                                 //http://newsl.iol.pt/pub/testes-wp/ss4.html
  166.                                                 //http://newsl.iol.pt/pub/testes-wp/iloveit.html
  167.                                                 //http://newsl.iol.pt/pub/testes-wp/belmonte.html
  168.                                         if (loc.indexOf("bbvip") > -1) {
  169.                                                 DFP_wp.BGclick(580);
  170.                                         }else if(loc.indexOf("ss4") > -1){
  171.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  172.                                                 DFP_wp.BGclick(40);
  173.                                         }else if(loc.indexOf("iloveit") >-1){
  174.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
  175.                                                 DFP_wp.BGclick(40);
  176.                                         }else if (loc.indexOf("belmonte")  > -1){
  177.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  178.                                                 DFP_wp.BGclick(40);
  179.                                         }else{
  180.                                        
  181.                                                 document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  182.                                                 DFP_wp.BGclick(40);
  183.                                         };
  184.                                          break;
  185.                                         case "maisfutebol.iol.pt":
  186.                                                                                         DFP_wp.loadcss("http://www.maisfutebol.iol.pt/css/1024.css?v65");
  187.                                                                                        
  188.                                                                                         DFP_wp.BGclick(40);
  189.                                         break;
  190.                                                                                
  191.                                     case "tvi.iol.pt":
  192.                                                                                
  193.                                                                              
  194.                                                                                        
  195.                                         if (loc.indexOf("bbvip") > -1) {
  196.                                                 DFP_wp.BGclick(580);
  197.                                         }else if(loc.indexOf("ss4") > -1){
  198.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  199.                                                 DFP_wp.BGclick(40);
  200.                                         }else if(loc.indexOf("secretstory") > -1){
  201.                                                 DFP_wp.loadcss("http://newsl.iol.pt/pub/code/pubcss5.css");
  202.                                                 DFP_wp.BGclick(40);
  203.                                         }else if(loc.indexOf("jardinsproibidos") >-1){
  204.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/jardinsproibidos/css/pub.css?v20140904");
  205.                                                 DFP_wp.BGclick(40);
  206.                                         }else if(loc.indexOf("desafio-final2") >-1){
  207.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  208.                                                 DFP_wp.BGclick(40);            
  209.                                                                                 }else if (loc.indexOf("/belmonte/")  > -1){
  210.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  211.                                                 DFP_wp.BGclick(40);
  212.                                                                                 }else if (loc.indexOf("/o-beijo-do-escorpiao/")  > -1){
  213.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  214.                                                 DFP_wp.BGclick(40);
  215.                                                                                 }else if (loc.indexOf("/mulheres/")  > -1){
  216.                                                                                         DFP_wp.loadcss("http://www.tvi.iol.pt/mulheres/css/pub.css?v20140717");
  217.                                                                                        
  218.                                                 DFP_wp.BGclick(0);            
  219.                                                                                                
  220.                                                                                
  221.                                                                                 }else if (loc.indexOf("masterchef")  > -1){
  222.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px"
  223.                                                 DFP_wp.BGclick(40);            
  224.                                                                                                
  225.                                                                                 }else if (loc.indexOf("/risingstar/")  > -1){          
  226.                                                                                         $(".top-nav-wraper").css("backgroundColor","#333")
  227.                                                                                         $(".row").css("backgroundColor","#fff")
  228.                                                                                                 DFP_wp.BGclick(40);            
  229.                                                                                                
  230.                                                                                                
  231.                                                                                                
  232.                                                                                                
  233.                                                                                 }else if (loc.indexOf("/melhor-do-que-falecer/")  > -1){
  234.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px";
  235.                                                                                                 $(".nav-home").css('maxWidth','980px');
  236.                                                                                                 $(".nav-home").css('height','45%');
  237.                                                                                                 $(".back_vid").css('display','none');
  238.                                                                                                 $( "#fullscreen" ).after( "<div id='bannerover' style='max-width:980x; margin:auto'></div>" );
  239.                                                                                                 $('.wise_message').css('display','none');
  240.                                                                                                
  241.                                                                                                
  242.                                                                                                
  243.                                                                                                
  244.                                                                                                
  245.                                                                                                
  246.                                                 DFP_wp.BGclick(0);            
  247.                                                                                                
  248.                                                                                                 }
  249.                                                                                
  250.                                                        
  251.                                                                                
  252.                                                                                 else{
  253.                                                                                          document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  254.                                                 DFP_wp.BGclick(40);
  255.                                                                                 if (typeof pub_ativar_wallpaper != "undefined") {
  256.                                                                                                 pub_ativar_wallpaper();
  257.  
  258.                                                                                         };
  259.  
  260.                                         }
  261.                                          break;
  262.                                                                                  
  263.                                                                                 case "tvi.pt":
  264.                                                                                                                        
  265.                                         if (loc.indexOf("bbvip") > -1) {
  266.                                                 DFP_wp.BGclick(580);
  267.                                         }else if(loc.indexOf("ss4") > -1){
  268.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  269.                                                 DFP_wp.BGclick(40);
  270.                                         }else if(loc.indexOf("iloveit") >-1){
  271.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
  272.                                                 DFP_wp.BGclick(40);
  273.                                                                                 }else if(loc.indexOf("desafio-final2") >-1){
  274.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
  275.                                                 DFP_wp.BGclick(40);            
  276.                                                                                 }else if (loc.indexOf("/belmonte/")  > -1){
  277.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  278.                                                 DFP_wp.BGclick(40);
  279.                                                                                 }else if (loc.indexOf("/o-beijo-do-escorpiao/")  > -1){
  280.                                                 DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
  281.                                                 DFP_wp.BGclick(40);
  282.                                                                                 }else if (loc.indexOf("/mulheres/")  > -1){
  283.                                                                                         DFP_wp.loadcss("http://www.tvi.iol.pt/mulheres/css/pub.css?v20140717");
  284.                                                                                        
  285.                                                 DFP_wp.BGclick(0);            
  286.                                                                                                
  287.                                                                                
  288.                                                                                 }else if (loc.indexOf("masterchef")  > -1){
  289.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px"
  290.                                                 DFP_wp.BGclick(40);            
  291.                                                                                                
  292.                                                                                 }else if (loc.indexOf("/risingstar/")  > -1){          
  293.                                                                                         $(".top-nav-wraper").css("backgroundColor","#333")
  294.                                                                                         $(".row").css("backgroundColor","#fff")
  295.                                                                                                 DFP_wp.BGclick(40);            
  296.                                                                                                
  297.                                                                                                
  298.                                                                                                
  299.                                                                                                
  300.                                                                                 }else if (loc.indexOf("/melhor-do-que-falecer/")  > -1){
  301.                                                                                                 document.getElementById("contentwrapper").style.maxWidth = "980px";
  302.                                                                                                 $(".nav-home").css('maxWidth','980px');
  303.                                                                                                 $(".nav-home").css('height','45%');
  304.                                                                                                 $(".back_vid").css('display','none');
  305.                                                                                                 $( "#fullscreen" ).after( "<div id='bannerover' style='max-width:980x; margin:auto'></div>" );
  306.                                                                                                 $('.wise_message').css('display','none');
  307.                                                                                                
  308.                                                                                                
  309.                                                                                                
  310.                                                                                                
  311.                                                                                                
  312.                                                                                                
  313.                                                 DFP_wp.BGclick(0);            
  314.                                                                                                
  315.                                                                                                 }
  316.                                                                                
  317.                                                        
  318.                                                                                
  319.                                                                                 else{
  320.                                                                                          document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  321.                                                 DFP_wp.BGclick(40);
  322.                                                                                 if (typeof pub_ativar_wallpaper != "undefined") {
  323.                                                                                                 pub_ativar_wallpaper();
  324.  
  325.                                                                                         };
  326.  
  327.                                         }
  328.                                          break;
  329.                                          break;
  330.                                                                                  
  331.                                                                                 case "spotmais.iol.pt":
  332.                                                                                         DFP_wp.loadcss("http://newsl.iol.pt/pub/resources/css/spotmais-wp.css");
  333.                                                                                         DFP_wp.BGclick(40);
  334.                                                                                 break;
  335.                                                                                
  336.                                                                                 case "autoportal.iol.pt":
  337.                                                         dad = document.getElementById( "pagina" ) ;
  338.                                                         son = document.createElement("div");
  339.                                                         son.innerHTML = '<div id="bannerover"></div>'
  340.                                                         dad.insertBefore(son, dad.firstChild);
  341.                                                                                
  342.                                         document.getElementById("pagina").style.cssText = "border:0";
  343.                                
  344.                                         DFP_wp.BGclick(40);
  345.                                        
  346.                                         break;
  347.                                         case "tvi24.iol.pt":
  348.                                                 if(document.location.pathname.split("/").slice(1, 2).toString() === "cinebox"){
  349.                                                
  350.                                                         if (window.jQuery) {
  351.                                                                 $(".divVideoPlayer").css('background-color','#000');
  352.                                                                 $(".wrapTopoHp, .topoVideos, .divBottom").css({
  353.                                                                         width: '984px',
  354.                                                                         margin: '0 auto',
  355.                                                                         backgroundImage: 'none',
  356.                                                                         backgroundColor: 'transparent',
  357.                                                                         overflow: 'visible'
  358.                                                                 });
  359.                                                                         DFP_wp.BGclick(40);
  360.  
  361.                                                         }
  362.                                                 }else{
  363.                                                         if (window.jQuery) {
  364.                                                                  pub_wallpaper();
  365.                                                                  $("#header").css({
  366.                                                                                 width: '975px',
  367.                                                                                 margin: '0px auto 0px',
  368.                                                                                 background: 'transparent'
  369.                                                                         });
  370.                                                                         $(".videosDiv, .outrosProjectosDiv, .black").css({
  371.                                                                                 width: '975px',
  372.                                                                                 margin: '0px auto'
  373.                                                                         });
  374.                                                                 DFP_wp.BGclick(40);
  375.                                                         };
  376.                                                 };
  377.                                          break;
  378.                                         case "lux.iol.pt":
  379.                                                                                         DFP_wp.loadcss("http://www.lux.iol.pt/css/pub.css?v201401272028");
  380.                                                                                         DFP_wp.BGclick(40);
  381.                                         DFP_wp.BGclick(210);
  382.                                         break;  
  383.                                         case "http://demaeparamae.pt/":
  384.                                         DFP_wp.BGclick(0);
  385.                                          break;
  386.                                         default:
  387.                                           DFP_wp.debug("BGCssHack- default");
  388.                                         }
  389.                 },
  390.  
  391.                 loadjs: function (what) {
  392.                         var head = document.getElementsByTagName("head")[0];
  393.                         var script = document.createElement("script");
  394.                         script.type = "text/javascript";
  395.                         script.src = what;
  396.                         head.appendChild(script);
  397.                 },
  398.                 loadcss: function (what) {
  399.                         var head = document.getElementsByTagName("head")[0];
  400.                         var link = document.createElement("link");
  401.                         link.type = "text/css";
  402.                         link.rel = "stylesheet";
  403.                         link.href = what;
  404.                         head.appendChild(link);
  405.                 },
  406.                 srcMacro: function (src){
  407.                         var ord=Math.floor(Math.random()*10001)
  408.                         if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  409.                         //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_wp.zclk());}
  410.                         return src;
  411.                 },
  412.                
  413.                 bannerOver: function (pixels, click, anim) {
  414.                         anim = anim || false;
  415.                         var pivot = document.getElementById("bannerover");
  416.                 //      document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  417.                         if(!document.getElementById("bannerover")) {
  418.                        
  419.  
  420.                         son = document.createElement("div");
  421.                         son.innerHTML = '<div id="bannerover"></div>'
  422.                         document.body.insertBefore(son, document.body.firstChild);
  423.  
  424.                         };
  425.                         document.getElementById("bannerover").style.cssText = "display:block; width: 990px; margin: 0 auto; background: transparent;";
  426.                         if ((anim) && (window.jQuery)){
  427.                         $(pivot).animate({
  428.                                 height: pixels+'px'
  429.                         }, 2000, function() {
  430.                                 if (click != undefined){
  431.                                         $(this).css('cursor','pointer');
  432.                                         $(this).click(function() {
  433.                                                 window.open(click)
  434.                                         });
  435.                                 };
  436.                         });
  437.                         }else {
  438.                                 if (window.jQuery){
  439.                        
  440.                                 $(pivot).css('height',pixels+'px');
  441.                                         if (click != undefined){
  442.                                                 $(pivot).css('cursor','pointer');
  443.                                                 $(pivot).click(function() {
  444.                                                         window.open(click)
  445.                                                 });
  446.                                         };
  447.                                 }else {
  448.                                                                
  449.                                                                         document.getElementById("bannerover").style.height= pixels+'px';
  450.                                                                         document.getElementById("bannerover").style.cursor= 'pointer';
  451.                                                                         document.getElementById('bannerover').onclick = function(e){
  452.                                          window.open(DFP_wp.click());
  453.                                          e.stopPropagation();
  454.                                     }
  455.                                                                
  456.                                                                 };  
  457.                         };
  458.                 },
  459.                                
  460.                                
  461.                                
  462.                          isMobile: function () {
  463.                                         var userAgent = navigator.userAgent||navigator.vendor||window.opera;
  464.                                         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)||/1007|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)))
  465.                                                 return true;
  466.                                         else
  467.                                                 return false;
  468.                                 },
  469.                                
  470.                                 isIOS: function () {
  471.                                         var userAgent = navigator.userAgent||navigator.vendor||window.opera;
  472.                                         if(/ip(hone|od|ad)/i.test(userAgent))
  473.                                                 return true;
  474.                                         else
  475.                                                 return false;
  476.                                 }
  477.                          
  478.        
  479.                                                
  480.                                
  481. }
  482.    
  483.  
  484.                
  485.                 //init
  486.                                
  487.                                 if (!DFP_wp.isMobile()) {
  488.                                
  489.                                         if (window.jQuery){
  490.                                                 $( document ).ready(function() {
  491.                                                         DFP_wp.BGcssHack()
  492.                                                         DFP_wp.BGimage(DFP_wp.BgColor, DFP_wp.File, "center", 0 , DFP_wp.Scroll);
  493.                                                         //DFP_wp.BGimage(DFP_wp.BgColor, "http://i.imgur.com/P5CEyvj.jpg", "center", 0 , DFP_wp.Scroll);
  494.                                                        // DFP_wp.bannerOver(DFP_wp.topHeight, DFP_wp.click(), DFP_wp.topHeightAnim );
  495.                                                 });
  496.                                        
  497.                                         }else {
  498.                                        
  499.                                                                        
  500.                         DFP_wp.BGcssHack()
  501.                         DFP_wp.BGimage(DFP_wp.BgColor, DFP_wp.File, "center", 0 , DFP_wp.Scroll);
  502.                       //  DFP_wp.bannerOver(DFP_wp.topHeight, DFP_wp.click(), DFP_wp.topHeightAnim );
  503.                                        
  504.                                        
  505.                                         }
  506.  
  507.                                 };    
  508.        
  509.  
  510.        
  511. }
  512.  
  513.  </script>
  514.  
  515. <script type='text/javascript'>
  516.  
  517. if (typeof DFP_bo ==='undefined'){
  518.  
  519. var DFP_bo =   {
  520.  
  521.                 //SWF1/IMG1 (normal)
  522.                                 swf1: '%%FILE:SWF1%%',
  523.                                         width: '980',
  524.                                         height: '100',
  525.                
  526.                 //SWF2/IMG2 (expandido)
  527.                                         swf2: '%%FILE:SWF2%%',
  528.                                         width2: '980',
  529.                                         height2: '430',
  530.                
  531.                                         ForceBtnFechar: false, //Quando não existe mesmo botão "label de fechar"
  532.                                         ForceBtnFecharOverlay: false, //Coloca overlay sobre o swf2, com ação de fechar (Já existe o "label de fechar")
  533.                                
  534.                                        
  535.                                         ForceBtnFecharWidth: 80, //Largura da área de overlay
  536.                                         ForceBtnFecharHeight: 30, //Altura da área de overlay
  537.                                         ForceBtnFecharBottom: 0, // Posição Y da área de Overlay. Normalmente está encostada ao bottom do ad
  538.                                         ForceBtnFecharRight: 0, // Posição Y da área de Overlay. Normalmente está alinhado à direita
  539.                                
  540.                                
  541.                                         videoNewsl: false, //puxa vídeo no newsl, com o nosso player
  542.                                         videoNewslIframeUrl: 'http://newsl.iol.pt/pub/campanhas/missaosorriso/iframe-vid.html',
  543.                                         videoNewslVideoUrl: 'video.flv',
  544.                                         videoNewsWidth: 465, //Largura do video
  545.                                         videoNewsHeight: 340, //Altura do video
  546.                                         videoNewsTop: 50, // Posição Y da área de video sobre o ad.
  547.                                         videoNewsLeft: 50, // Posição X da área de video sobre o ad.
  548.                                
  549.                                
  550.                                  mode: 'transparent', //alterar por transparent, se desejado
  551.                                  clickTagOverlay: true, //Coloca Evento de expansão com Overlay no swf1
  552.                                  
  553.                                
  554.                                 //DO NOT CHANGE BELOW
  555.                 click: '%%CLICK_URL_ESC%%%%DEST_URL%%',
  556.                 dfpmacro: '%%CLICK_URL_ESC%%',
  557.                
  558.                 pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},  
  559.                 utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  560.                 utm_source_value: document.domain, //default is document value
  561.                 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+''},
  562.                 zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  563.                 debug: function(m){try{console.log('ADSERVER DEBUG POS: '+m)}catch(e){}},
  564.                 swfOurl: 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',
  565.            
  566.                
  567.                 validate: function (param, default_value){
  568.                         if (param == ''){param = default_value}
  569.                         return param;
  570.                 },
  571.                
  572.                 getEl: function (i){return document.getElementById(i)},
  573.                
  574.                 pixel: function(p) {
  575.                         if(p){
  576.                                 img = new Image(1,1)
  577.                                 img.src = DFP_bo.srcMacro(p);
  578.                                 img.style.display='none';
  579.                                 return img;
  580.                         }
  581.                 },
  582.                 Image: function(file, selector, w, h, click){
  583.                         if(!click){click = DFP_bo.click}
  584.                         DFP_bo.getEl(selector).innerHTML='<a href='+click+' target="_blank"><img src='+file+' alt="" width='+w+' height='+h+' border="0" /></a>';
  585.                
  586.                 },
  587.                        
  588.                                        
  589.        
  590.                 bannerOver: function (pixels, click, anim) {
  591.                         anim = anim || false;
  592.                
  593.                        
  594.                         var pivot = '#bannerover';
  595.                         if(!$(pivot).length) {
  596.                                 var bo=$('<div></div>');
  597.                                 bo.attr('id', pivot);  
  598.                                 $('body').append(bo);
  599.                         }
  600.                  
  601.                         /* Do not change below */
  602.                         $(pivot).css('display','block');
  603.                         $(pivot).css('width','100%');
  604.                         $(pivot).css('margin','0 auto');
  605.                        
  606.                         if (anim) {
  607.                         $(pivot).animate({
  608.                                 height: pixels+'px'
  609.                        
  610.                         }, 2000, function() {
  611.                                 if (click != undefined){
  612.                                         $(this).css('cursor','pointer');
  613.                                         $(this).click(function() {
  614.                                                 window.open(click)
  615.                                         });
  616.                                 };
  617.                         });
  618.                         }else {
  619.                         $(pivot).css('height',pixels+'px');
  620.                                 if (click != undefined){
  621.                                         $(pivot).css('cursor','pointer');
  622.                                         $(pivot).click(function() {
  623.                                                 window.open(click)
  624.                                         });
  625.                                 };
  626.                         }
  627.                 },
  628.                
  629.                
  630.                 iframeScript3rd: function(container, src, w, h, beacon){
  631.                         var t;
  632.                         src.indexOf('bs.serving-sys.com')>-1 ? t = DFP_bo.ebIfrm : t= DFP_bo.Ifrm3rd;
  633.                         DFP_bo.iframeGen(DFP_bo.srcMacro(t+escape(src)), container, w, h);
  634.                 },
  635.                
  636.                
  637.                 iframeGen: function(src, container, w, h) {
  638.                         var zcont='<IFRAME SRC='+src+' WIDTH='+w+' HEIGHT='+h+' MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no"></iframe>';
  639.                         if (document.getElementById(container)){
  640.                                 document.getElementById(container).innerHTML = zcont;
  641.                         }else{try{console.log('Adserver_Error: trying to append content to an inexistent container: tag id: 223');}catch(e){};}
  642.                 },
  643.                
  644.        
  645.        
  646.                 Banner: function(file, selector, w1, h1, mode, click){
  647.                         var r=Math.floor(Math.random()*110)
  648.                         DFP_bo.domSwf('temp'+r, selector);
  649.                         DFP_bo.gen(file, 'temp'+r, w1, h1, mode, click);
  650.                 },
  651.        
  652.                
  653.  
  654.                
  655.                 domSwf: function(el, who, where, w, h ){
  656.                        
  657.                         var newEl = document.createElement('div');
  658.                         newEl.id = el;
  659.                         if (who == 'body'){
  660.                                 var y = document.getElementsByTagName('body')[0];
  661.                         }else{
  662.                                 var y = document.getElementById (who);
  663.                         }
  664.                         if(where == 'first'){
  665.                                 y.insertBefore(newEl, y.firstChild);
  666.                         }else{
  667.                                 y.appendChild(newEl);
  668.                         }
  669.                 },
  670.                
  671.                 getAd: function(file, selector, w1, h1, mode, click){
  672.                
  673.                         var t = setInterval(function() {
  674.                                 if (typeof swfobject != 'undefined') {
  675.                                         if (swfobject.hasFlashPlayerVersion('8.0.0')) {
  676.                                                 if(!click){click = escape(DFP_bo.zclk())}
  677.                                                 var flashvars = {
  678.                                                         ad: 'DFP_bo.AS2JS223',
  679.                                                         clickTag: click,
  680.                                                         clickTAG: click,
  681.                                                         clicktag: click
  682.                                                 }
  683.                                                 var params = {
  684.                                                         menu: 'false',
  685.                                                         quality: 'high',
  686.                                                         wmode: mode,
  687.                                                         AllowScriptAccess: 'always'
  688.                                                 }
  689.                                                 var attributes = {id: selector}
  690.                                                 swfobject.embedSWF(file, selector, w1, h1, '8.0.0', '', flashvars, params, attributes);
  691.                                         };
  692.                                         clearInterval(t);
  693.                                         t = null;
  694.                                 }
  695.                         }, 250);
  696.                 },
  697.                
  698.                                
  699.                 load: function (what) {
  700.                         var head = document.getElementsByTagName('head')[0];
  701.                         var script = document.createElement('script');
  702.                         script.type = 'text/javascript';
  703.                         script.src = what;
  704.                         head.appendChild(script);
  705.                 },
  706.                
  707.                 gen: function(file, selector, w1, h1, mode, click){
  708.                         if (typeof swfobject != 'undefined') {
  709.                                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  710.                         }else{
  711.                                 DFP_bo.load(DFP_bo.swfOurl);
  712.                                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  713.                         }
  714.                 },
  715.                
  716.                 srcMacro: function (src){
  717.                         var ord=Math.floor(Math.random()*10001)
  718.                         if(src.indexOf('rand')>-1){src= src.replace(/rand/gi, ord);}
  719.                         //if(src.indexOf('click')>-1){src= src.replace(/click/gi, DFP_bo.zclk());}
  720.                         return src;
  721.                 },    
  722.         mycounter: function(who, what){
  723.                 if (document.getElementById(who)){
  724.                                 switch(what){
  725.                                         case 'destroy':
  726.                                         //      var el = document.getElementById(who);
  727.                                         //      el.parentNode.removeChild(el);
  728.                                         $('#'+who).fadeOut('slow', function() {
  729.                                                 $('#'+who).remove();
  730.                                                 document.body.style.overflow = 'auto';
  731.                                                 $('#barraIOL').fadeIn();
  732.                                         });
  733.                                                
  734.                                         break;
  735.                                         case 'hide':
  736.                                                 var el = document.getElementById(who);
  737.                                                 el.style.display = 'none';
  738.                                                
  739.                                         break;
  740.                                         case 'empty':
  741.                                                 var el = document.getElementById(who);
  742.                                                 while (el.hasChildNodes()){
  743.                                                         el.removeChild(el.lastChild);
  744.                                                 };
  745.                                                
  746.                                         break;
  747.                                         case 'reload':
  748.                                                 if(reloadAd){
  749.                                                 var el = document.getElementById(who);
  750.                                                 el.parentNode.removeChild(el);
  751.                                                 reloadAd(223);
  752.                                                 }
  753.                                         break;
  754.                                         default:
  755.                                                 var el = document.getElementById(who);
  756.                                                 el.parentNode.removeChild(el);
  757.                                
  758.                                 };
  759.                         };
  760.                 },
  761.                
  762.                
  763.                 //event control from actionscript
  764.                 AS2JS223: function (what) {
  765.                
  766.                         if(what == 'close'){
  767.                                 try{console.log('close');}catch(e){};
  768.                                         DFP_bo.mycounter('zahirWrapper223', 'destroy')
  769.                                
  770.                        
  771.                         }else if(what == 'open'){
  772.                                 try{console.log('open');}catch(e){};
  773.                                 DFP_bo.Layer('body', '$width', '$height', DFP_bo.pixelTop(), DFP_bo.pixelLeft() , DFP_bo.destroyCounter());
  774.                                 DFP_bo.gen('$banner', 'zahirLayer2223', '$width', '$height', 'opaque');
  775.                         }
  776.                 }
  777. };
  778.  
  779.  
  780.  
  781.                
  782.         $(function() {
  783.                 //DO IT
  784.  
  785.                 $('#LDB1').remove();
  786.                 $('#bannerover').css('display','block');
  787.                 $('#bannerover').css('height',DFP_bo.height+'px');
  788.                 $('#bannerover').css('textAlign','center');
  789.                 $('#bannerover').css('width',DFP_bo.width+'px');
  790.                 $('#bannerover').css('position','relative');
  791.                 $('#bannerover').css('margin','0px auto');
  792.            
  793.            
  794.         DFP_bo.Banner(DFP_bo.swf1, 'bannerover', DFP_bo.width, DFP_bo.height, DFP_bo.mode)
  795.                 //Gera layer por cima do swf1- no caso de não ter esta ação de rollover no Actionscript
  796.                
  797.                 if (DFP_bo.clickTagOverlay) {
  798.             $('#bannerover').prepend('<div id="BO-clicktag" style="cursor:pointer; position:absolute; top: 0px; right: 0px; z-index 10000; width: 980px; cursor:pointer; height:100px"><img src="http://s0.2mdn.net/dot.gif" height="100" width="980"/></div>');
  799.             $('#BO-clicktag').mouseover(function() {openThis()});
  800.        };
  801.        
  802.        
  803.    
  804.        
  805.         });
  806.        
  807.        
  808.        
  809.        
  810. function openThis() {
  811.         DFP_bo.debug('openThis f called');
  812.                         $('#bannerover').empty();
  813.                            //DFP_bo.Image(DFP_bo.swf2, 'bannerover', DFP_bo.width2, DFP_bo.height2) //if image
  814.                DFP_bo.Banner(DFP_bo.swf2, 'bannerover', DFP_bo.width2, DFP_bo.height2, DFP_bo.mode);
  815.                      
  816.                                         $('#bannerover').animate({
  817.                                         height: DFP_bo.height2+'px'
  818.                                         }, 2000, function() {
  819.                                                                                
  820.                                                 if (DFP_bo.videoNewsl) {                              
  821.                                                         $('#bannerover').append('<div id="videoBO" style="position:absolute; top: '+DFP_bo.videoNewsTop+'px; left:'+DFP_bo.videoNewsLeft+'px;  z-index: 10000; width: '+DFP_bo.videoNewsWidth+'px; height: '+DFP_bo.videoNewsHeight+'px;"></div>');    
  822.                                                         DFP_bo.iframeGen(''+DFP_bo.videoNewslIframeUrl+'?file='+DFP_bo.videoNewslVideoUrl+'&w='+DFP_bo.videoNewsWidth+'&h='+DFP_bo.videoNewsHeight+'', 'videoBO', DFP_bo.videoNewsWidth, DFP_bo.videoNewsHeight);      
  823.                                                
  824.                                                 };
  825.                                                
  826.                                                 if (DFP_bo.ForceBtnFechar) {
  827.                                                
  828.                                                         $('#bannerover').append('<div style="position:absolute; bottom:16px'+DFP_bo.ForceBtnFecharBottom+'px; right:30px'+DFP_bo.ForceBtnFecharRight+'px; cursor:pointer; font-size: 13px; margin: 2px auto 0px; padding:4px; background-color:#333; display:block; text-align:right; color: #fff;" id="closepointer">FECHAR</div>');
  829.                                                         $('#closepointer').click(function() {closeThis() });
  830.                                                
  831.                                                 };
  832.                                                
  833.                                                
  834.                                                 if (DFP_bo.ForceBtnFecharOverlay) {
  835.                                                
  836.                                                         $('#bannerover').append('<div style="position:absolute; bottom:16px'+DFP_bo.ForceBtnFecharBottom+'px; right:30px'+DFP_bo.ForceBtnFecharRight+'px; width: '+DFP_bo.ForceBtnFecharWidth+'px; height: '+DFP_bo.ForceBtnFecharHeight+'px; cursor:pointer; font-size: 13px; margin: 2px auto 0px; padding:4px; background-color:#333; display:block; text-align:right; color: #fff;" id="closepointer">FECHAR</div>');
  837.                                                         $('#closepointer').click(function() {closeThis() });
  838.                                                
  839.                                                 };
  840.                                                
  841.                                                
  842.  
  843.  
  844.                                        
  845.                                 });
  846.                                                                
  847.                                                                  
  848.  
  849.  
  850.        
  851.         };
  852.                
  853.                
  854.  
  855.          
  856.        
  857.         function closeThis() {
  858.  
  859.         DFP_bo.debug('[DFP_bo] ->closeThis () ');
  860.         $('#bannerover').animate({
  861.                height: parseInt(DFP_bo.height)+0+'px'
  862.                                
  863.            }, 2000, function() {
  864.                  $('#bannerover').empty()
  865.                  DFP_bo.Banner(DFP_bo.swf1, 'bannerover', DFP_bo.width, DFP_bo.height, DFP_bo.mode);
  866.                                  
  867.                                /*  if (DFP_bo.clickTagOverlay) {
  868.                                         $('#bannerover').prepend('<div id="BO-clicktag" style="cursor:pointer; position:absolute; top: 0px; right: 0px; z-index 10000; width: 980px; cursor:pointer; height:100px"><img src="http://s0.2mdn.net/dot.gif" height="100" width="980"/></div>');
  869.                                         $('#BO-clicktag').click(function() {window.open(DFP_bo.click) });
  870.                 };     */
  871.  
  872.                //EXPANDIR
  873.                            $('#bannerover').append('<div style="position:absolute; top: 80px; right:0px; cursor:pointer; font-size: 11px; margin: 2px auto 0px; padding:4px; background-color:#333; display:block; text-align:right; color: #fff;" id="openpointer">EXPANDIR</div>');
  874.                                 $('#openpointer').click(function() {openThis() });
  875.                                                
  876.                                                
  877.                });
  878.                                
  879.     };
  880.                                                                
  881.                                                        
  882. function pub_close() { closeThis() };
  883.                                
  884.                            
  885.                                
  886.                
  887. };
  888.  
  889.  
  890.  </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement