Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Last update:
- -->
- <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
- <script type="text/javascript">
- if(typeof DFP_bo === "undefined"){
- var DFP_bo = {
- //CHANGE USUALLY NOT REQUIRED
- click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
- //normal
- width: "980",
- height: "430",
- //expandido
- width2: "980",
- height2: "430",
- mode: "opaque", //alterar por transparent, se desejado
- //LAYER SPECIFICS
- //DO NOT CHANGE BELOW
- dfpmacro: "%%CLICK_URL_ESC%%",
- pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},
- utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
- utm_source_value: document.domain, //default is document value
- utm_build: function(){return this.pre_utm_build()+'utm_source%3D'+this.utm_source_value+'%26utm_medium%3D'+this.utm_medium_value+'%26utm_content%3D'+this.utm_content_value()+'%26utm_campaign%3D'+this.utm_campaign_value+''},
- zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
- debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
- swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
- pixelTop: function(){return DFP_bo.validate("$descreve", "100")},
- pixelLeft: function(){return DFP_bo.validate("$iframesrc", "0")},
- destroyCounter: function(){return DFP_bo.validate("$scriptsrc", "30")},
- validate: function (param, default_value){
- if (param == ""){param = default_value}
- return param;
- },
- getEl: function (i){return document.getElementById(i)},
- pixel: function(p) {
- if(p){
- img = new Image(1,1)
- img.src = DFP_bo.srcMacro(p);
- img.style.display="none";
- return img;
- }
- },
- Image: function(file, selector, w, h, click){
- if(!click){click = unescape(DFP_bo.zclk())}
- 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>';
- },
- bannerOver: function (pixels, click, anim) {
- anim = anim || false;
- var pivot = "#bannerover";
- if(!$(pivot).length) {
- var bo=$('<div></div>');
- bo.attr('id', pivot);
- $("body").append(bo);
- }
- /* Do not change below */
- $(pivot).css('display','block');
- $(pivot).css('width','100%');
- $(pivot).css('margin','0 auto');
- if (anim) {
- $(pivot).animate({
- height: pixels+'px'
- }, 2000, function() {
- if (click != undefined){
- $(this).css('cursor','pointer');
- $(this).click(function() {
- window.open(click)
- });
- };
- });
- }else {
- $(pivot).css('height',pixels+'px');
- if (click != undefined){
- $(pivot).css('cursor','pointer');
- $(pivot).click(function() {
- window.open(click)
- });
- };
- }
- },
- iframeScript3rd: function(container, src, w, h, beacon){
- var t;
- src.indexOf("bs.serving-sys.com")>-1 ? t = DFP_bo.ebIfrm : t= DFP_bo.Ifrm3rd;
- DFP_bo.iframeGen(DFP_bo.srcMacro(t+escape(src)), container, w, h);
- },
- iframeGen: function(src, container, w, h) {
- 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>';
- if (document.getElementById(container)){
- document.getElementById(container).innerHTML = zcont;
- }else{try{console.log("Adserver_Error: I'm trying to append content to an inexistent container: tag id: 223");}catch(e){};}
- },
- Banner: function(file, selector, w1, h1, mode, click){
- var r=Math.floor(Math.random()*110)
- DFP_bo.domSwf("temp"+r, selector);
- DFP_bo.gen(file, "temp"+r, w1, h1, mode, click);
- },
- domSwf: function(el, who, where, w, h ){
- var newEl = document.createElement("div");
- newEl.id = el;
- if (who == "body"){
- var y = document.getElementsByTagName('body')[0];
- }else{
- var y = document.getElementById (who);
- }
- if(where == "first"){
- y.insertBefore(newEl, y.firstChild);
- }else{
- y.appendChild(newEl);
- }
- },
- getAd: function(file, selector, w1, h1, mode, click){
- var t = setInterval(function() {
- if (typeof swfobject != "undefined") {
- if (swfobject.hasFlashPlayerVersion("8.0.0")) {
- if(!click){click = escape(DFP_bo.zclk())}
- var flashvars = {
- ad: "DFP_bo.AS2JS223",
- clickTag: click,
- clickTAG: click,
- clicktag: click
- }
- var params = {
- menu: "false",
- quality: "high",
- wmode: mode,
- AllowScriptAccess: "always"
- }
- var attributes = {id: selector}
- swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes);
- };
- clearInterval(t);
- t = null;
- }
- }, 250);
- },
- load: function (what) {
- var head = document.getElementsByTagName("head")[0];
- var script = document.createElement("script");
- script.type = "text/javascript";
- script.src = what;
- head.appendChild(script);
- },
- gen: function(file, selector, w1, h1, mode, click){
- if (typeof swfobject != "undefined") {
- DFP_bo.getAd(file, selector, w1, h1, mode, click);
- }else{
- DFP_bo.load(DFP_bo.swfOurl);
- DFP_bo.getAd(file, selector, w1, h1, mode, click);
- }
- },
- srcMacro: function (src){
- var ord=Math.floor(Math.random()*10001)
- if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
- //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_bo.zclk());}
- return src;
- },
- mycounter: function(who, what){
- if (document.getElementById(who)){
- switch(what){
- case "destroy":
- // var el = document.getElementById(who);
- // el.parentNode.removeChild(el);
- $("#"+who).fadeOut('slow', function() {
- $("#"+who).remove();
- document.body.style.overflow = 'scroll';
- $('#barraIOL').fadeIn();
- });
- break;
- case "hide":
- var el = document.getElementById(who);
- el.style.display = "none";
- break;
- case "empty":
- var el = document.getElementById(who);
- while (el.hasChildNodes()){
- el.removeChild(el.lastChild);
- };
- break;
- case "reload":
- if(reloadAd){
- var el = document.getElementById(who);
- el.parentNode.removeChild(el);
- reloadAd(223);
- }
- break;
- default:
- var el = document.getElementById(who);
- el.parentNode.removeChild(el);
- };
- };
- },
- //event control from actionscript
- AS2JS223: function (what) {
- if(what == "close"){
- try{console.log("close");}catch(e){};
- DFP_bo.mycounter("zahirWrapper223", "destroy")
- }else if(what == "open"){
- try{console.log("open");}catch(e){};
- DFP_bo.Layer("body", "$width", "$height", DFP_bo.pixelTop(), DFP_bo.pixelLeft() , DFP_bo.destroyCounter());
- DFP_bo.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
- }
- }
- }
- function pub_open() {
- DFP_bo.debug("pub_open f called");
- $('#pub_open').hide()
- DFP_bo.Image("%%FILE:JPG2%%", "bannerover", DFP_bo.width, DFP_bo.height);
- $("#bannerover").animate({
- height: '430px'
- }, 3000, function() {
- //$('#pub_open').show()
- // $("#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>");
- $("#pub_close").click(function() {
- window.open(DFP_bo.click)
- });
- $("#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>");
- $("#closepointer").click(function() {
- pub_close()
- });
- });
- };
- function pub_close() {
- DFP_bo.debug("closeThis called");
- $("#bannerover").animate({
- height: '100px'
- }, 1000, function() {
- DFP_bo.Image("%%FILE:JPG1%%", "bannerover", "980", "100");
- $("#pub_close").remove();
- $("#closepointer").remove();
- $("#pub_open").show();
- $("#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>")
- $('#pub_open').click(function() {
- pub_open()
- //$('#pub_open').css('height','430px')
- });
- });
- }
- $(function() {
- $("#LDB1").remove();
- $("#bannerover").css('display','block');
- $("#bannerover").css('height','100px');
- $("#bannerover").css('width','980px');
- $("#bannerover").css('position','relative');
- $("#bannerover").css('margin','auto');
- $("#bannerover").css('textAlign','center');
- //DFP_bo.Banner("%%FILE:SWF1%%", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
- DFP_bo.Image("%%FILE:JPG1%%", "bannerover", "980", "100");
- $("#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>")
- $('#pub_open').mouseover(function() {
- pub_open()
- $('#pub_open').css('height','430px')
- });
- // teste
- //DFP_bo.Banner("http://newsl.iol.pt/pub/dfp/universobebe_980X430_IOL.swf", "bannerover", DFP_bo.width, DFP_bo.height, DFP_bo.mode)
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement