Advertisement
anatolionobre

BO Expansivel - duas imagens

Apr 1st, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--
  2.  
  3. Last update:
  4.  
  5. -->
  6.  
  7. <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
  8. <script type="text/javascript">
  9.  
  10. if(typeof DFP_bo === "undefined"){
  11.  
  12.  
  13. var DFP_bo =   {
  14.         //CHANGE USUALLY NOT REQUIRED
  15.  
  16.         click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  17.        
  18.         //normal
  19.         width: "980",
  20.         height: "430",
  21.        
  22.         //expandido
  23.         width2: "980",
  24.         height2: "430",
  25.        
  26.         mode: "opaque", //alterar por transparent, se desejado
  27.  
  28.  
  29.  
  30.        
  31.         //LAYER SPECIFICS
  32.        
  33.         //DO NOT CHANGE BELOW
  34.         dfpmacro: "%%CLICK_URL_ESC%%",
  35.         pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},  
  36.         utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  37.         utm_source_value: document.domain, //default is document value
  38.         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+''},
  39.         zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  40.         debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  41.         swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  42.         pixelTop: function(){return DFP_bo.validate("$descreve", "100")},
  43.         pixelLeft: function(){return DFP_bo.validate("$iframesrc", "0")},
  44.         destroyCounter: function(){return DFP_bo.validate("$scriptsrc", "30")},        
  45.        
  46.         validate: function (param, default_value){
  47.             if (param == ""){param = default_value}
  48.             return param;
  49.         },
  50.        
  51.  
  52.         getEl: function (i){return document.getElementById(i)},
  53.        
  54.         pixel: function(p) {
  55.             if(p){
  56.                 img = new Image(1,1)
  57.                 img.src = DFP_bo.srcMacro(p);
  58.                 img.style.display="none";
  59.                 return img;
  60.             }
  61.         },
  62.  
  63.  
  64.         Image: function(file, selector, w, h, click){
  65.             if(!click){click = unescape(DFP_bo.zclk())}
  66.             DFP_bo.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img style="width:'+w+'px; height:'+h+'px" src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  67.        
  68.         },
  69.            
  70.                    
  71.    
  72.        
  73.            
  74.  
  75.        
  76.        
  77.         bannerOver: function (pixels, click, anim) {
  78.             anim = anim || false;
  79.        
  80.            
  81.             var pivot = "#bannerover";
  82.             if(!$(pivot).length) {
  83.                 var bo=$('<div></div>');
  84.                 bo.attr('id', pivot);  
  85.                 $("body").append(bo);
  86.             }
  87.          
  88.             /* Do not change below */
  89.             $(pivot).css('display','block');
  90.             $(pivot).css('width','100%');
  91.             $(pivot).css('margin','0 auto');
  92.            
  93.             if (anim) {
  94.             $(pivot).animate({
  95.  
  96.  
  97.                 height: pixels+'px'
  98.            
  99.             }, 2000, function() {
  100.                 if (click != undefined){
  101.                     $(this).css('cursor','pointer');
  102.                     $(this).click(function() {
  103.                         window.open(click)
  104.                     });
  105.                 };
  106.             });
  107.  
  108.             }else {
  109.             $(pivot).css('height',pixels+'px');
  110.                 if (click != undefined){
  111.                     $(pivot).css('cursor','pointer');
  112.                     $(pivot).click(function() {
  113.                         window.open(click)
  114.                     });
  115.                 };
  116.             }
  117.  
  118.         },
  119.        
  120.        
  121.  
  122.         iframeScript3rd: function(container, src, w, h, beacon){
  123.             var t;
  124.             src.indexOf("bs.serving-sys.com")>-1 ? t = DFP_bo.ebIfrm : t= DFP_bo.Ifrm3rd;
  125.             DFP_bo.iframeGen(DFP_bo.srcMacro(t+escape(src)), container, w, h);
  126.         },
  127.        
  128.        
  129.         iframeGen: function(src, container, w, h) {
  130.             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>';
  131.             if (document.getElementById(container)){
  132.                 document.getElementById(container).innerHTML = zcont;
  133.             }else{try{console.log("Adserver_Error: I'm trying to append content to an inexistent container: tag id: 223");}catch(e){};}
  134.         },
  135.        
  136.    
  137.    
  138.         Banner: function(file, selector, w1, h1, mode, click){
  139.             var r=Math.floor(Math.random()*110)
  140.             DFP_bo.domSwf("temp"+r, selector);
  141.             DFP_bo.gen(file, "temp"+r, w1, h1, mode, click);
  142.         },
  143.    
  144.        
  145.        
  146.  
  147.        
  148.        
  149.         domSwf: function(el, who, where, w, h ){
  150.            
  151.             var newEl = document.createElement("div");
  152.             newEl.id = el;
  153.  
  154.             if (who == "body"){
  155.                 var y = document.getElementsByTagName('body')[0];
  156.             }else{
  157.                 var y = document.getElementById (who);
  158.             }
  159.             if(where == "first"){
  160.                 y.insertBefore(newEl, y.firstChild);
  161.             }else{
  162.                 y.appendChild(newEl);
  163.             }
  164.         },
  165.        
  166.         getAd: function(file, selector, w1, h1, mode, click){
  167.        
  168.             var t = setInterval(function() {
  169.                 if (typeof swfobject != "undefined") {
  170.                     if (swfobject.hasFlashPlayerVersion("8.0.0")) {
  171.                         if(!click){click = escape(DFP_bo.zclk())}
  172.                         var flashvars = {
  173.                             ad: "DFP_bo.AS2JS223",
  174.                             clickTag: click,
  175.                             clickTAG: click,
  176.                             clicktag: click
  177.                         }
  178.                         var params = {
  179.                             menu: "false",
  180.                             quality: "high",
  181.                             wmode: mode,
  182.                             AllowScriptAccess: "always"
  183.                         }
  184.                         var attributes = {id: selector}
  185.                         swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes);
  186.                     };
  187.                     clearInterval(t);
  188.                     t = null;
  189.                 }
  190.             }, 250);
  191.         },
  192.        
  193.                
  194.         load: function (what) {
  195.             var head = document.getElementsByTagName("head")[0];
  196.             var script = document.createElement("script");
  197.             script.type = "text/javascript";
  198.             script.src = what;
  199.             head.appendChild(script);
  200.         },
  201.        
  202.         gen: function(file, selector, w1, h1, mode, click){
  203.             if (typeof swfobject != "undefined") {
  204.                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  205.             }else{
  206.                 DFP_bo.load(DFP_bo.swfOurl);
  207.                 DFP_bo.getAd(file, selector, w1, h1, mode, click);
  208.             }
  209.         },
  210.        
  211.         srcMacro: function (src){
  212.             var ord=Math.floor(Math.random()*10001)
  213.             if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  214.             //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_bo.zclk());}
  215.             return src;
  216.         }, 
  217.  
  218.  
  219.     mycounter: function(who, what){
  220.         if (document.getElementById(who)){
  221.                 switch(what){
  222.                     case "destroy":
  223.                     //  var el = document.getElementById(who);
  224.                     //  el.parentNode.removeChild(el);
  225.                     $("#"+who).fadeOut('slow', function() {
  226.                         $("#"+who).remove();
  227.                         document.body.style.overflow = 'scroll';
  228.                         $('#barraIOL').fadeIn();
  229.                     });
  230.                        
  231.                     break;
  232.                     case "hide":
  233.                         var el = document.getElementById(who);
  234.                         el.style.display = "none";
  235.                        
  236.                     break;
  237.                     case "empty":
  238.                         var el = document.getElementById(who);
  239.                         while (el.hasChildNodes()){
  240.                             el.removeChild(el.lastChild);
  241.                         };
  242.                        
  243.                     break;
  244.                     case "reload":
  245.                         if(reloadAd){
  246.                         var el = document.getElementById(who);
  247.                         el.parentNode.removeChild(el);
  248.                         reloadAd(223);
  249.                         }
  250.                     break;
  251.                     default:
  252.                         var el = document.getElementById(who);
  253.                         el.parentNode.removeChild(el);
  254.                
  255.                 };
  256.             };
  257.         },
  258.        
  259.        
  260.         //event control from actionscript
  261.         AS2JS223: function (what) {
  262.        
  263.             if(what == "close"){
  264.                 try{console.log("close");}catch(e){};
  265.                     DFP_bo.mycounter("zahirWrapper223", "destroy")
  266.                
  267.            
  268.             }else if(what == "open"){
  269.                 try{console.log("open");}catch(e){};
  270.                 DFP_bo.Layer("body", "$width", "$height", DFP_bo.pixelTop(), DFP_bo.pixelLeft() , DFP_bo.destroyCounter());
  271.                 DFP_bo.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
  272.             }
  273.         }
  274.  
  275.  
  276.  
  277. }
  278.  
  279.     function pub_open() {
  280.         DFP_bo.debug("pub_open f called");
  281.             $('#pub_open').hide()
  282.         DFP_bo.Image("%%FILE:JPG2%%", "bannerover", DFP_bo.width, DFP_bo.height);
  283.        
  284.         $("#bannerover").animate({
  285.                     height: '430px'
  286.                     }, 3000, function() {
  287.                     //$('#pub_open').show()
  288.         // $("#bannerover").prepend("<div id='pub_close' style='cursor:pointer; position:absolute; top: 0px; left: 0px; z-index 10000; width: 980px; height:430px'><img src='http://s0.2mdn.net/dot.gif' height='430' width='980'/></div>");
  289.          
  290.          $("#pub_close").click(function() {
  291.                      window.open(DFP_bo.click)
  292.                 });
  293.        
  294.          
  295.          
  296.  
  297. $("#bannerover").append("<div id='closepointer' style='position:absolute; top: 410px; right:20px; cursor:pointer; font-size: 12px; padding:2px; background-color: #000; color:#fff'>FECHAR</div>");
  298.                 $("#closepointer").click(function() {
  299.                     pub_close()
  300.                 });
  301.                 });      
  302.  
  303.                
  304.            
  305.            
  306.            
  307.            
  308.         };
  309.  
  310.  
  311.     function pub_close() {
  312.    
  313.     DFP_bo.debug("closeThis called");
  314.     $("#bannerover").animate({
  315.  
  316.                     height: '100px'
  317.                
  318.                 }, 1000, function() {
  319.                     DFP_bo.Image("%%FILE:JPG1%%", "bannerover", "980", "100");
  320.                  $("#pub_close").remove();
  321.                 $("#closepointer").remove();
  322.                 $("#pub_open").show();
  323.                      $("#bannerover").prepend("<div id='pub_open' style='position:absolute; top: 80px; right:20px; cursor:pointer; font-size: 12px; padding:2px; background-color: #000; color:#fff'>EXPANDIR</div>")
  324.  
  325.         $('#pub_open').click(function() {
  326.        
  327.         pub_open()
  328.        
  329.    
  330.        
  331.         //$('#pub_open').css('height','430px')
  332.        
  333.        
  334.         });
  335.                
  336.                    
  337.                        
  338.                 });
  339.  
  340.     }
  341.  
  342.  
  343.  
  344.     $(function() {
  345. $("#LDB1").remove();
  346.    
  347.     $("#bannerover").css('display','block');
  348.      $("#bannerover").css('height','100px');
  349.      $("#bannerover").css('width','980px');
  350.       $("#bannerover").css('position','relative');
  351.      $("#bannerover").css('margin','auto');
  352.      $("#bannerover").css('textAlign','center');
  353.     //DFP_bo.Banner("%%FILE:SWF1%%", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
  354.    
  355.  
  356.    
  357.     DFP_bo.Image("%%FILE:JPG1%%", "bannerover", "980", "100");
  358.    
  359.      
  360.      $("#bannerover").prepend("<div id='pub_open' style='cursor:pointer; position:absolute; top: 0px; left: 0px; z-index 10000; width: 980px; height:100px'><img style='width: 980px; height:100px' src='http://s0.2mdn.net/dot.gif' height='100' width='980'/></div>")
  361.  
  362.         $('#pub_open').mouseover(function() {
  363.        
  364.         pub_open()
  365.        
  366.    
  367.        
  368.         $('#pub_open').css('height','430px')
  369.        
  370.        
  371.         });
  372.     // teste
  373.     //DFP_bo.Banner("http://newsl.iol.pt/pub/dfp/universobebe_980X430_IOL.swf", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
  374.      
  375.      
  376.    
  377.  
  378.    
  379.    
  380.      
  381.     });
  382.    
  383.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement