Advertisement
anatolionobre

Wallpaper Flash

Mar 5th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.32 KB | None | 0 0
  1. <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
  2.  
  3. <script type="text/javascript">
  4.  
  5. var DFP_wp = {
  6. //CHANGE USUALLY NOT REQUIRED
  7.  
  8. click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  9. width: "[%Width%]",
  10. height: "[%Height%]",
  11. mode: "[%ModoFlash%]", //alterar por transparent, se desejado
  12.  
  13.  
  14. utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
  15. utm: false, //alterar para false se não queremos por algum motivo usar utm
  16. utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
  17.  
  18.  
  19.  
  20.  
  21. //LAYER SPECIFICS
  22.  
  23. //DO NOT CHANGE BELOW
  24. dfpmacro: "%%CLICK_URL_ESC%%",
  25. pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},
  26. utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  27. utm_source_value: document.domain, //default is document value
  28. 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+''},
  29. zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  30. debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  31. swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  32. pixelTop: function(){return DFP_wp.validate("$descreve", "100")},
  33. pixelLeft: function(){return DFP_wp.validate("$iframesrc", "0")},
  34. destroyCounter: function(){return DFP_wp.validate("$scriptsrc", "30")},
  35.  
  36. validate: function (param, default_value){
  37. if (param == ""){param = default_value}
  38. return param;
  39. },
  40.  
  41.  
  42. getEl: function (i){return document.getElementById(i)},
  43.  
  44. pixel: function(p) {
  45. if(p){
  46. img = new Image(1,1)
  47. img.src = DFP_wp.srcMacro(p);
  48. img.style.display="none";
  49. return img;
  50. }
  51. },
  52.  
  53.  
  54. Image: function(file, selector, w, h, click){
  55. if(!click){click = unescape(DFP_wp.zclk())}
  56. DFP_wp.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  57.  
  58. },
  59.  
  60.  
  61.  
  62. BGimage: function(where, color, file, xpos, ypos, type ){
  63. var loc = String(window.location);
  64. var host = String(window.location.host);
  65.  
  66. if(host === "www.lux.iol.pt"){
  67. jQuery(".contentout").attr('id','contentout')
  68. where = "contentout"
  69. };
  70.  
  71. if (loc.indexOf("bbvip") > -1 ){
  72. where = "contentwrapper"
  73.  
  74. }
  75.  
  76. if ( host != "www.iol.pt") {
  77. if ( host != "demaeparamae.pt") {
  78. if ( host != "www.lux.iol.pt") {
  79. if (loc.indexOf("bbvip") === -1 ){
  80. ypos = (ypos+41).toString()
  81.  
  82. };
  83. };
  84. };
  85. };
  86.  
  87. if (host != "www.iol.pt") {ypos = (ypos).toString()}
  88.  
  89.  
  90. if (file.substr(0,4) != "http") {file = ""+file;}
  91. var rpt = "no-repeat";
  92. if (where == "body"){
  93. var y = document.getElementsByTagName('body')[0];
  94. }else{
  95. var y = document.getElementById (where);
  96. };
  97.  
  98. y.style.cssText = 'background: '+color+' url('+file+') '+rpt+' '+type+' '+xpos+' '+ypos+'px';
  99.  
  100. },
  101.  
  102.  
  103. BGinit: function(where){
  104.  
  105.  
  106.  
  107. //click = click || "";
  108.  
  109.  
  110. var loc = String(window.location);
  111. var host = String(window.location.host);
  112.  
  113. //hacks
  114. switch(host)
  115. {
  116.  
  117. case "newsl.iol.pt":
  118. if (loc.indexOf("ss.html") > -1) { //tvi
  119. $("#contentwrapper").css({
  120. width: '990px',
  121. margin: 'auto'
  122. });
  123.  
  124. DFP_wp.BGclick("#contentwrapper");
  125. };
  126.  
  127. if (loc.indexOf("mf/index.html") > -1) { //mf
  128. $("#contentwrapper").css({
  129. width: '997px',
  130. margin: 'auto'
  131. });
  132.  
  133. $("body").css('backgroundPosition','center 41px');
  134. DFP_wp.BGclick("#contentwrapper");
  135. };
  136.  
  137. break;
  138.  
  139.  
  140. case "iol.pt":
  141. if (loc.indexOf("index_new.html") > -1) {
  142. DFP_wp.loadcss("http://www.iol.pt/css/pub_2014.css");
  143. DFP_wp.BGclick(0);
  144. }
  145. else if (loc.indexOf("index_new_7.html") > -1) {
  146. DFP_wp.loadcss("http://www.iol.pt/css/pub_2015.css");
  147. DFP_wp.BGclick(0);
  148. }
  149. else {
  150. document.getElementById("contentwrapper").style.cssText = "width:980px; margin:auto; background:transparent";
  151. DFP_wp.BGclick(0);
  152. }
  153. break;
  154.  
  155.  
  156. case "www.tvi.iol.pt":
  157.  
  158. if (loc.indexOf("bbvip") > -1) {
  159.  
  160.  
  161. var link = document.createElement("link");
  162. link.href = "http://www.tvi.iol.pt/bbvip/css/pub.css?v2013.05.14-12.56";
  163. link.type = "text/css";
  164. link.rel = "stylesheet";
  165. document.getElementsByTagName("head")[0].appendChild(link);
  166.  
  167.  
  168. $("body").prepend('<div class="adserverbg" id="wp_left" style=" left:50%; width:300px;height:1800px;position: absolute;right:0px;top:580px;display:block;z-index:1000; margin-left:-800px;background-color: transparent; cursor:pointer"></div><div class="adserverbg" id="wp_right" style="left:50%; width:300px; height:1800px;position:fixed !important; position: absolute;right:0px;top:580px;display:block;z-index:10000; margin-left:500px; background-color: transparent;cursor:pointer"></div>');
  169. jQuery(".adserverbg").click(function () { window.open("%%CLICK_URL_ESC%%%%DEST_URL%%")});
  170.  
  171.  
  172.  
  173. }else{
  174.  
  175. $("#contentwrapper").css({
  176. width: '990px',
  177. margin: 'auto'
  178. });
  179.  
  180. DFP_wp.BGclick("#contentwrapper");
  181. }
  182.  
  183. break;
  184. case "www.tvi24.iol.pt":
  185. if(document.location.pathname.split("/").slice(1, 2).toString() === "cinebox")
  186. {
  187. $(".divVideoPlayer").css('background-color','#000');
  188. $(".wrapTopoHp, .topoVideos, .divBottom").css({
  189. width: '984px',
  190. margin: '0 auto',
  191. backgroundImage: 'none',
  192. backgroundColor: 'transparent',
  193. overflow: 'visible'
  194. });
  195. DFP_wp.BGclick(".topoHp");
  196. }else
  197. {
  198.  
  199. pub_wallpaper();
  200. $("#header").css({
  201. width: '975px',
  202. margin: '0px auto 0px',
  203. background: 'transparent'
  204.  
  205. });
  206.  
  207. $(".videosDiv, .outrosProjectosDiv, .black").css({
  208. width: '975px',
  209. margin: '0px auto'
  210. });
  211.  
  212. DFP_wp.BGclick("#header");
  213.  
  214. };
  215.  
  216. break;
  217.  
  218. case "tvi24.stg":
  219.  
  220. pub_wallpaper();
  221. $("#header").css({
  222. width: '975px',
  223. margin: '0px auto 0px',
  224. background: 'transparent'
  225.  
  226. });
  227.  
  228. $(".videosDiv, .outrosProjectosDiv").css({
  229. width: '975px !important',
  230. margin: '0px auto !important'
  231.  
  232.  
  233. });
  234.  
  235. DFP_wp.BGclick("#header");
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242. break;
  243. case "www.agenciafinanceira.iol.pt":
  244.  
  245. $("#contentwrapper").css({
  246. width: '990px',
  247. margin: 'auto'
  248. });
  249.  
  250.  
  251. DFP_wp.BGclick("#contentwrapper");
  252.  
  253.  
  254. break;
  255. case "www.maisfutebol.iol.pt":
  256. $("#contentwrapper, #main").css({
  257. width: '997px',
  258. margin: 'auto'
  259. });
  260.  
  261. $("body").css('backgroundPosition','center 41px');
  262.  
  263. if($("#contentwrapper").length){
  264. DFP_wp.BGclick("#contentwrapper");
  265. }else {
  266. DFP_wp.BGclick("#main");
  267.  
  268. };
  269.  
  270. break;
  271.  
  272.  
  273. case "www.lux.iol.pt":
  274.  
  275. $(".contentout").css('position','relative');
  276.  
  277. $("body").prepend('<div class="adserverbg" id="wp_left" style=" left:50%; width:300px;height:1800px;position: absolute;right:0px;top:310px;display:block;z-index:1000; margin-left:-800px;background-color: transparent; cursor:pointer"></div><div class="adserverbg" id="wp_right" style="left:50%; width:300px; height:1800px;position:fixed !important; position: absolute;right:0px;top:310px;display:block;z-index:10000; margin-left:500px; background-color: transparent;cursor:pointer"></div>');
  278. jQuery(".adserverbg").click(function () { window.open(unescape(DFP_wp.click))});
  279.  
  280.  
  281.  
  282. break;
  283.  
  284.  
  285. case "http://demaeparamae.pt/":
  286.  
  287. DFP_wp.BGclick("#container");
  288.  
  289. break;
  290. default:
  291. DFP_wp.debug("BGinit- default");
  292. }
  293.  
  294.  
  295. },
  296.  
  297.  
  298.  
  299. BGclick: function(where, SpecialSite){
  300.  
  301. //SpecialSite = SpecialSite || 'default';
  302. //if (SpecialSite === "lux"){}
  303. //if ((click != undefined) || (click != "")){click = DFP_wp.zclk()};
  304. click = DFP_wp.zclk();
  305. jQuery(where).css('position','relative');
  306.  
  307.  
  308. var elWidth = jQuery(where).width();
  309. var elHeight = 2000; //jQuery(where).height();
  310. var elOffset = 0; //jQuery(where).offset().top;
  311. var screen =(document.all) ? (document.body.offsetWidth)-20 : (window.innerWidth)-20;
  312. var BandaSize = ((screen-elWidth)/2);
  313.  
  314. 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>');
  315. 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>');
  316.  
  317. jQuery(where).prepend(leftbg);
  318. jQuery(where).prepend(rightbg);
  319.  
  320. jQuery(".adserverbg").click(function () {
  321. window.open(unescape(DFP_wp.click));
  322. });
  323.  
  324.  
  325. /*if (jQuery('#pubTop').length) {
  326. jQuery("#pubTop").click(function () {
  327. window.open(unescape(click));
  328. });
  329. };
  330. */
  331.  
  332. },
  333.  
  334.  
  335. bannerOver: function (pixels, click, anim) {
  336. anim = anim || false;
  337.  
  338.  
  339. var pivot = "#bannerover";
  340. if(!$(pivot).length) {
  341. var bo=$('<div></div>');
  342. bo.attr('id', pivot);
  343. $("body").append(bo);
  344. }
  345.  
  346. /* Do not change below */
  347. $(pivot).css('display','block');
  348. $(pivot).css('width','100%');
  349. $(pivot).css('margin','0 auto');
  350.  
  351. if (anim) {
  352. $(pivot).animate({
  353.  
  354.  
  355. height: pixels+'px'
  356.  
  357. }, 2000, function() {
  358. if (click != undefined){
  359. $(this).css('cursor','pointer');
  360. $(this).click(function() {
  361. window.open(click)
  362. });
  363. };
  364. });
  365.  
  366. }else {
  367. $(pivot).css('height',pixels+'px');
  368. if (click != undefined){
  369. $(pivot).css('cursor','pointer');
  370. $(pivot).click(function() {
  371. window.open(click)
  372. });
  373. };
  374. }
  375.  
  376. },
  377.  
  378.  
  379.  
  380. iframeScript3rd: function(container, src, w, h, beacon){
  381. var t;
  382. src.indexOf("bs.serving-sys.com")>-1 ? t = DFP_wp.ebIfrm : t= DFP_wp.Ifrm3rd;
  383. DFP_wp.iframeGen(DFP_wp.srcMacro(t+escape(src)), container, w, h);
  384. },
  385.  
  386.  
  387. iframeGen: function(src, container, w, h) {
  388. var zcont='<IFRAME SRC="'+DFP_wp.srcMacro(t+escape(src))+'" WIDTH="'+w+'" HEIGHT="'+h+'" MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no"></iframe>';
  389. if (document.getElementById(container)){
  390. document.getElementById(container).innerHTML = zcont;
  391. }else{try{console.log("Adserver_Error: I'm trying to append content to an inexistent container: tag id: 223");}catch(e){};}
  392. },
  393.  
  394.  
  395.  
  396. Banner: function(file, selector, w1, h1, mode, click){
  397. var r=Math.floor(Math.random()*110)
  398. DFP_wp.domSwf("temp"+r, selector);
  399. DFP_wp.gen(file, "temp"+r, w1, h1, mode, click);
  400. },
  401.  
  402.  
  403.  
  404. Layer: function(who, w1, h1, top, left, counter){
  405.  
  406.  
  407. DFP_wp.domSwf("zahirWrapper", who, "first", "100%", "100%");
  408. var a = DFP_wp.getEl("zahirWrapper");
  409. a.style.margin = "auto";
  410. a.style.width = "100%";
  411. a.style.height = "100%";
  412. a.style.top = "0px";
  413. a.style.position = "absolute";
  414. a.style.zIndex= "10000";
  415. a.style.overflow = "visible";
  416. a.style.backgroundColor = "#fff";
  417.  
  418.  
  419. DFP_wp.domSwf("zahirWrapper223", "zahirWrapper", "first", w1, "0");
  420.  
  421. var a = DFP_wp.getEl("zahirWrapper223");
  422. a.style.margin = "auto";
  423. a.style.width = w1+"px";
  424. a.style.position = "relative";
  425. a.style.zIndex= "9999";
  426. a.style.overflow = "visible";
  427.  
  428. DFP_wp.domSwf("zahirLayer223", "zahirWrapper223", "first", w1, h1);
  429. var b = document.getElementById("zahirLayer223");
  430. b.style.position = "absolute";
  431. b.style.top = top+"px";
  432. b.style.left = left+"px";
  433. b.style.zIndex = "9998";
  434. b.style.overflow = "visible";
  435.  
  436. DFP_wp.domSwf("zahirLayer2223", "zahirLayer223", "first", w1, h1);
  437.  
  438. document.body.style.overflow = 'hidden';
  439.  
  440. setTimeout (function check_barraIOL () {
  441. if ( $('#barraIOL').length != 0) {
  442. $('#barraIOL').hide();
  443. } else {
  444. setTimeout (check_barraIOL, 300);
  445. }
  446. }, 300);
  447.  
  448.  
  449. $("#zahirWrapper223").prepend("<div id='intro_close' style='width: 100%; height: 50px; margin: 2px auto; text-align:center'><div style=' width: 180px; cursor:pointer; margin:0px 0px 0px auto;'><img alt='close' src='http://newsl.iol.pt//pub/resources/introv1/generico_c.png' /></div></div>");
  450. $('#intro_close').click(function() {DFP_wp.mycounter('zahirWrapper', 'destroy');});
  451.  
  452.  
  453.  
  454.  
  455. if(counter){
  456. counter= counter * 1000;
  457. setTimeout("DFP_wp.mycounter('zahirWrapper', 'destroy')", counter)
  458. }
  459. },
  460.  
  461.  
  462. domSwf: function(el, who, where, w, h ){
  463.  
  464. var newEl = document.createElement("div");
  465. newEl.id = el;
  466.  
  467. if (who == "body"){
  468. var y = document.getElementsByTagName('body')[0];
  469. }else{
  470. var y = document.getElementById (who);
  471. }
  472. if(where == "first"){
  473. y.insertBefore(newEl, y.firstChild);
  474. }else{
  475. y.appendChild(newEl);
  476. }
  477. },
  478.  
  479. getAd: function(file, selector, w1, h1, mode, click){
  480.  
  481. var t = setInterval(function() {
  482. if (typeof swfobject != "undefined") {
  483. if (swfobject.hasFlashPlayerVersion("8.0.0")) {
  484. if(!click){click = escape(DFP_wp.zclk())}
  485. var flashvars = {
  486. ad: "DFP_wp.AS2JS223",
  487. clickTag: click,
  488. clickTAG: click,
  489. clicktag: click
  490. }
  491. var params = {
  492. menu: "false",
  493. quality: "high",
  494. wmode: mode,
  495. AllowScriptAccess: "always"
  496. }
  497. var attributes = {id: selector}
  498. swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes);
  499. };
  500. clearInterval(t);
  501. t = null;
  502. }
  503. }, 250);
  504. },
  505.  
  506.  
  507. load: function (what) {
  508. var head = document.getElementsByTagName("head")[0];
  509. var script = document.createElement("script");
  510. script.type = "text/javascript";
  511. script.src = what;
  512. head.appendChild(script);
  513. },
  514.  
  515. gen: function(file, selector, w1, h1, mode, click){
  516. if (typeof swfobject != "undefined") {
  517. DFP_wp.getAd(file, selector, w1, h1, mode, click);
  518. }else{
  519. DFP_wp.load(DFP_wp.swfOurl);
  520. DFP_wp.getAd(file, selector, w1, h1, mode, click);
  521. }
  522. },
  523.  
  524. srcMacro: function (src){
  525. var ord=Math.floor(Math.random()*10001)
  526. if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  527. //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_wp.zclk());}
  528. return src;
  529. },
  530.  
  531.  
  532. mycounter: function(who, what){
  533. if (document.getElementById(who)){
  534. switch(what){
  535. case "destroy":
  536. // var el = document.getElementById(who);
  537. // el.parentNode.removeChild(el);
  538. $("#"+who).fadeOut('slow', function() {
  539. $("#"+who).remove();
  540. document.body.style.overflow = 'scroll';
  541. $('#barraIOL').fadeIn();
  542. });
  543.  
  544. break;
  545. case "hide":
  546. var el = document.getElementById(who);
  547. el.style.display = "none";
  548.  
  549. break;
  550. case "empty":
  551. var el = document.getElementById(who);
  552. while (el.hasChildNodes()){
  553. el.removeChild(el.lastChild);
  554. };
  555.  
  556. break;
  557. case "reload":
  558. if(reloadAd){
  559. var el = document.getElementById(who);
  560. el.parentNode.removeChild(el);
  561. reloadAd(223);
  562. }
  563. break;
  564. default:
  565. var el = document.getElementById(who);
  566. el.parentNode.removeChild(el);
  567.  
  568. };
  569. };
  570. },
  571.  
  572.  
  573. //event control from actionscript
  574. AS2JS223: function (what) {
  575.  
  576. if(what == "close"){
  577. try{console.log("close");}catch(e){};
  578. DFP_wp.mycounter("zahirWrapper223", "destroy")
  579.  
  580.  
  581. }else if(what == "open"){
  582. try{console.log("open");}catch(e){};
  583. DFP_wp.Layer("body", "$width", "$height", DFP_wp.pixelTop(), DFP_wp.pixelLeft() , DFP_wp.destroyCounter());
  584. DFP_wp.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
  585. }
  586. }
  587.  
  588.  
  589.  
  590. }
  591.  
  592.  
  593.  
  594. //START EDITING
  595.  
  596. $(function() {
  597.  
  598. if(typeof wp === "undefined"){
  599.  
  600. DFP_wp.BGimage("body", "#000", "", "center", 0 , "scroll");
  601.  
  602. $("#contentwrapper").css({
  603. width: '990px',
  604. margin: '140px auto',
  605. position: 'relative'
  606. });
  607.  
  608. $("#contentwrapper").prepend('<div id="leftpub" style="position:absolute; top:-140px; left: -120px; width: 120px; height: 600px"></div>');
  609. $("#contentwrapper").prepend('<div id="rightpub" style="position:absolute; top:-140px; right: -120px; width: 120px; height: 600px"></div>');
  610. $("#contentwrapper").prepend('<div id="toppub" style="position:absolute; top:-140px; left: 0px; width: 980px; height: 140px"></div>');
  611.  
  612.  
  613. DFP_wp.Banner("%%FILE:SWF3%%", "toppub", "980", "140", "opaque");
  614. DFP_wp.Banner("%%FILE:SWF1%%", "leftpub", "120", "600", "opaque");
  615. DFP_wp.Banner("%%FILE:SWF2%%", "rightpub", "120", "600", "opaque");
  616.  
  617.  
  618.  
  619. //para testes
  620. //DFP_wp.BGimage("body", "#000", "http://i.imgur.com/dKWFGzE.jpg", "center", 0 , "scroll");
  621.  
  622. //DFP_wp.BGinit()
  623.  
  624. //(altura do Bo, clique se existir se não deixar o que está, animação -> true/false)
  625. // Se não existir topo, colocar 0
  626. //DFP_wp.bannerOver(100, DFP_wp.click, false )
  627.  
  628.  
  629. // topo: 1010 x50
  630. // 150x600
  631.  
  632. }
  633.  
  634. wp =1;
  635.  
  636. });
  637.  
  638.  
  639. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement