Advertisement
anatolionobre

BO Expansivel 1swf

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