Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--18/10/2013
- MF+ AP
- -->
- <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_wp === "undefined"){
- var DFP_wp = {
- clickHeight: 750, //altura da área de click
- clickWidth: 300, //largura da área de clcik
- BgColor: "#fff", //cor do background
- Scroll: "scroll", //escolher entre scroll e fixed
- topHeight: 200, //altura da área de topo clicável , se existir. Se não existir, colocar "0"
- topHeightAnim: false, //Se existir altura de topo, configurar se queremos animação a descer se não (true/false): default = false
- //CHANGE USUALLY NOT REQUIRED
- siteWidth: 990, //largura do site (normalmente sempre 990)
- File: "%%FILE:JPG1%%", //ficheiro de imagem
- click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
- utm: false, //alterar para false se não queremos por algum motivo usar utm
- utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
- utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
- //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_wp.validate("$descreve", "100")},
- pixelLeft: function(){return DFP_wp.validate("$iframesrc", "0")},
- destroyCounter: function(){return DFP_wp.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_wp.srcMacro(p);
- img.style.display="none";
- return img;
- }
- },
- Image: function(file, selector, w, h, click){
- if(!click){click = unescape(DFP_wp.zclk())}
- DFP_wp.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
- },
- BGimage: function(color, file, xpos, ypos, type ){
- var loc = String(window.location);
- var host = String(window.location.host).replace('www.', '')
- var where = "body"
- //hacks
- if(host === "lux.iol.pt"){
- jQuery(".contentout").attr('id','contentout')
- where = "contentout"
- };
- //ypos -> barra do IOL (41px, com exceções)
- if ( host != "iol.pt") {
- if ( host != "demaeparamae.pt") {
- if ( host != "lux.iol.pt") {
- ypos = (ypos+41)
- };
- };
- };
- ypos = (ypos).toString()
- //container exceptions
- if (loc.indexOf("bbvip") > -1 ){where = "contentwrapper"}
- // hack for local file testing
- if (file.substr(0,4) != "http") {file = ""+file;}
- //apply BG
- var rpt = "no-repeat";
- if (where == "body"){var y = document.getElementsByTagName('body')[0];
- }else{var y = document.getElementById (where);};
- y.style.cssText = 'background: '+color+' url('+file+') '+rpt+' '+type+' '+xpos+' '+ypos+'px';
- },
- BGclick: function(t, click){
- LeftMargin = ((DFP_wp.siteWidth + 10)/2) + DFP_wp.clickWidth;
- RightMargin = ((DFP_wp.siteWidth + 10)/2);
- click = click || DFP_wp.click;
- //click = "%%CLICK_URL_ESC%%" + click;
- $("body").prepend('<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><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>');
- jQuery(".adserverbg").click(function () { window.open(click)});
- },
- BGcssHack: function(where){
- var loc = String(window.location);
- var host = String(window.location.host).replace('www.', '')
- var path = String(window.location.pathname);
- //hacks
- switch(host)
- {
- case "iol.pt":
- $("#contentwrapper").css('width','980px');
- $("#contentwrapper").css('margin','auto');
- $("#outercontent").css('background','transparent');
- DFP_wp.BGclick(0);
- break;
- case "newsl.iol.pt":
- //http://newsl.iol.pt/pub/testes-wp/ss4.html
- //http://newsl.iol.pt/pub/testes-wp/iloveit.html
- //http://newsl.iol.pt/pub/testes-wp/belmonte.html
- if (loc.indexOf("bbvip") > -1) {
- DFP_wp.BGclick(580);
- }else if(loc.indexOf("ss4") > -1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
- DFP_wp.BGclick(41);
- }else if(loc.indexOf("iloveit") >-1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
- DFP_wp.BGclick(41);
- }else if (loc.indexOf("belmonte") > -1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
- DFP_wp.BGclick(41);
- }else{
- $("#contentwrapper").css({
- width: '990px',
- margin: 'auto'
- });
- DFP_wp.BGclick(41);
- };
- break;
- case "maisfutebol.iol.pt":
- //$(".topBar").css('marginTop','130px');
- DFP_wp.loadcss("http://www.maisfutebol.iol.pt/css/1024.css?v65") ;
- DFP_wp.BGclick(41);
- break;
- case "tvi.iol.pt":
- if (loc.indexOf("bbvip") > -1) {
- DFP_wp.BGclick(580);
- }else if(loc.indexOf("ss4") > -1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/ss4/css/pub.css?20131008");
- DFP_wp.BGclick(41);
- }else if(loc.indexOf("iloveit") >-1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/iloveit/css/pub.css?v20131008");
- DFP_wp.BGclick(41);
- }else if (loc.indexOf("belmonte") > -1){
- DFP_wp.loadcss("http://www.tvi.iol.pt/belmonte/css/pub.css?v20131008");
- DFP_wp.BGclick(41);
- }else{
- $("#contentwrapper").css({
- width: '990px',
- margin: 'auto'
- });
- DFP_wp.BGclick(41);
- }
- break;
- case "autoportal.iol.pt":
- $( "<div id='bannerover'></div>" ).insertBefore( "#pagina" );
- $("#pagina").css('border','0');
- DFP_wp.BGclick(41);
- break;
- case "tvi24.iol.pt":
- if(document.location.pathname.split("/").slice(1, 2).toString() === "cinebox")
- {
- $(".divVideoPlayer").css('background-color','#000');
- $(".wrapTopoHp, .topoVideos, .divBottom").css({
- width: '984px',
- margin: '0 auto',
- backgroundImage: 'none',
- backgroundColor: 'transparent',
- overflow: 'visible'
- });
- DFP_wp.BGclick_deprecated(".topoHp");
- }else
- {
- pub_wallpaper();
- $("#header").css({
- width: '975px',
- margin: '0px auto 0px',
- background: 'transparent'
- });
- $(".videosDiv, .outrosProjectosDiv, .black").css({
- width: '975px',
- margin: '0px auto'
- });
- DFP_wp.BGclick("#header");
- };
- break;
- case "lux.iol.pt":
- $(".contentout").css('position','relative');
- DFP_wp.BGclick(210);
- break;
- case "http://demaeparamae.pt/":
- DFP_wp.BGclick(0);
- break;
- default:
- DFP_wp.debug("BGCssHack- default");
- }
- },
- BGclick_deprecated: function(where, SpecialSite){
- //SpecialSite = SpecialSite || 'default';
- //if (SpecialSite === "lux"){}
- //if ((click != undefined) || (click != "")){click = DFP_wp.zclk()};
- click = DFP_wp.zclk();
- jQuery(where).css('position','relative');
- var elWidth = jQuery(where).width();
- var elHeight = 2000; //jQuery(where).height();
- var elOffset = 0; //jQuery(where).offset().top;
- var screen =(document.all) ? (document.body.offsetWidth)-20 : (window.innerWidth)-20;
- var BandaSize = ((screen-elWidth)/2);
- leftbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+BandaSize+'px; height:'+elHeight+'px; top:'+-elOffset+'px; left:'+-BandaSize+'px; cursor:pointer; z-index:10000"></div>');
- rightbg= jQuery('<div class="adserverbg" style="position:absolute; width:'+BandaSize+'px; height:'+elHeight+'px; top:'+-elOffset+'px; left:'+elWidth+'px; cursor:pointer; z-index:10000"></div>');
- jQuery(where).prepend(leftbg);
- jQuery(where).prepend(rightbg);
- jQuery(".adserverbg").click(function () {
- window.open(unescape(DFP_wp.click));
- });
- if (jQuery('#pubTop').length) {
- jQuery("#pubTop").click(function () {
- window.open(unescape(click));
- });
- };
- },
- loadjs: function (what) {
- var head = document.getElementsByTagName("head")[0];
- var script = document.createElement("script");
- script.type = "text/javascript";
- script.src = what;
- head.appendChild(script);
- },
- loadcss: function (what) {
- var head = document.getElementsByTagName("head")[0];
- var link = document.createElement("link");
- link.type = "text/css";
- link.rel = "stylesheet";
- link.href = what;
- head.appendChild(link);
- },
- 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_wp.zclk());}
- return src;
- },
- 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);
- }
- $(pivot).css('display','block');
- $(pivot).css('width', DFP_wp.siteWidth);
- $(pivot).css('margin','0 auto');
- $(pivot).css('backgroundColor','transparent');
- 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)
- });
- };
- }
- }
- }
- //START EDITING
- $(document).ready(function() {
- DFP_wp.BGimage(DFP_wp.BgColor, DFP_wp.File, "center", 0 , DFP_wp.Scroll);
- DFP_wp.BGcssHack()
- DFP_wp.bannerOver(DFP_wp.topHeight, DFP_wp.click, DFP_wp.topHeightAnim );
- });
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement