Advertisement
anatolionobre

Ticker 1 swf TVI24 MF

Mar 31st, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.03 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. document.write("<div id=\"footerad\"><div id=\"footerad1\"><\/div><\/div>");
  6.  
  7.  
  8. var DFP_ticker = {
  9. //CHANGE USUALLY NOT REQUIRED
  10.  
  11.  
  12.  
  13.  
  14. click: "%%CLICK_URL_ESC%%%%DEST_URL%%",
  15. width: "[%Width%]",
  16. height: "[%Height%]",
  17. mode: "[%ModoFlash%]", //alterar por transparent, se desejado
  18.  
  19.  
  20. utm_campaign_value: 'qem', //nome da campanha, promoção, produto etc
  21. utm: false, //alterar para false se não queremos por algum motivo usar utm
  22. utm_medium_value: 'display', //nome do veículo/medium (banner, email, ppc, etc)
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. //LAYER SPECIFICS
  37.  
  38. //DO NOT CHANGE BELOW
  39. dfpmacro: "%%CLICK_URL_ESC%%",
  40. pre_utm_build: function () {if(this.click.indexOf('?') > -1){return '%26';}else{return '?'}},
  41. utm_content_value: function(){return this.width+'x'+this.height}, //nome/variação do ad
  42. utm_source_value: document.domain, //default is document value
  43. 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+''},
  44. zclk: function(){if(this.utm){return this.dfpmacro+this.click+this.utm_build()}else{return this.click}},
  45. debug: function(m){try{console.log("ADSERVER DEBUG POS: "+m)}catch(e){}},
  46. swfOurl: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
  47. pixelTop: function(){return DFP_ticker.validate("$descreve", "100")},
  48. pixelLeft: function(){return DFP_ticker.validate("$iframesrc", "0")},
  49. destroyCounter: function(){return DFP_ticker.validate("$scriptsrc", "30")},
  50.  
  51. validate: function (param, default_value){
  52. if (param == ""){param = default_value}
  53. return param;
  54. },
  55.  
  56.  
  57.  
  58.  
  59.  
  60. getEl: function (i){return document.getElementById(i)},
  61.  
  62. pixel: function(p) {
  63. if(p){
  64. img = new Image(1,1)
  65. img.src = DFP_ticker.srcMacro(p);
  66. img.style.display="none";
  67. return img;
  68. }
  69. },
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. Image: function(file, selector, w, h, click){
  79. if(!click){click = unescape(DFP_ticker.zclk())}
  80. DFP_ticker.getEl(selector).innerHTML='<a href="'+click+'" target="_blank"><img src="'+file+'" alt="" width="'+w+'" height="'+h+'" border="0" /></a>';
  81.  
  82. },
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. Banner: function(file, selector, w1, h1, mode, click){
  95. var r=Math.floor(Math.random()*110)
  96. DFP_ticker.domSwf("temp"+r, selector);
  97. DFP_ticker.gen(file, "temp"+r, w1, h1, mode, click);
  98. },
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. domSwf: function(el, who, where, w, h ){
  108.  
  109. var newEl = document.createElement("div");
  110. newEl.id = el;
  111.  
  112.  
  113.  
  114.  
  115. if (who == "body"){
  116. var y = document.getElementsByTagName('body')[0];
  117. }else{
  118. var y = document.getElementById (who);
  119. }
  120. if(where == "first"){
  121. y.insertBefore(newEl, y.firstChild);
  122. }else{
  123. y.appendChild(newEl);
  124. }
  125. },
  126.  
  127. getAd: function(file, selector, w1, h1, mode, click){
  128.  
  129. var t = setInterval(function() {
  130. if (typeof swfobject != "undefined") {
  131. if (swfobject.hasFlashPlayerVersion("8.0.0")) {
  132. if(!click){click = escape(DFP_ticker.zclk())}
  133. var flashvars = {
  134. ad: "DFP_ticker.AS2JS223",
  135. clickTag: click,
  136. clickTAG: click,
  137. clicktag: click
  138. }
  139. var params = {
  140. menu: "false",
  141. quality: "high",
  142. wmode: mode,
  143. AllowScriptAccess: "always"
  144. }
  145. var attributes = {id: selector}
  146. swfobject.embedSWF(file, selector, w1, h1, "8.0.0", "", flashvars, params, attributes);
  147. };
  148. clearInterval(t);
  149. t = null;
  150. }
  151. }, 250);
  152. },
  153.  
  154.  
  155. load: function (what) {
  156. var head = document.getElementsByTagName("head")[0];
  157. var script = document.createElement("script");
  158. script.type = "text/javascript";
  159. script.src = what;
  160. head.appendChild(script);
  161. },
  162.  
  163. gen: function(file, selector, w1, h1, mode, click){
  164. if (typeof swfobject != "undefined") {
  165. DFP_ticker.getAd(file, selector, w1, h1, mode, click);
  166. }else{
  167. DFP_ticker.load(DFP_ticker.swfOurl);
  168. DFP_ticker.getAd(file, selector, w1, h1, mode, click);
  169. }
  170. },
  171.  
  172. srcMacro: function (src){
  173. var ord=Math.floor(Math.random()*10001)
  174. if(src.indexOf("rand")>-1){src= src.replace(/rand/gi, ord);}
  175. //if(src.indexOf("click")>-1){src= src.replace(/click/gi, DFP_ticker.zclk());}
  176. return src;
  177. },
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. mycounter: function(who, what){
  187. if (document.getElementById(who)){
  188. switch(what){
  189. case "destroy":
  190. // var el = document.getElementById(who);
  191. // el.parentNode.removeChild(el);
  192. $("#"+who).fadeOut('slow', function() {
  193. $("#"+who).remove();
  194. document.body.style.overflow = 'scroll';
  195. $('#barraIOL').fadeIn();
  196. });
  197.  
  198. break;
  199. case "hide":
  200. var el = document.getElementById(who);
  201. el.style.display = "none";
  202.  
  203. break;
  204. case "empty":
  205. var el = document.getElementById(who);
  206. while (el.hasChildNodes()){
  207. el.removeChild(el.lastChild);
  208. };
  209.  
  210. break;
  211. case "reload":
  212. if(reloadAd){
  213. var el = document.getElementById(who);
  214. el.parentNode.removeChild(el);
  215. reloadAd(223);
  216. }
  217. break;
  218. default:
  219. var el = document.getElementById(who);
  220. el.parentNode.removeChild(el);
  221.  
  222. };
  223. };
  224. },
  225.  
  226.  
  227. //event control from actionscript
  228. AS2JS223: function (what) {
  229.  
  230. if(what == "close"){
  231. try{console.log("close");}catch(e){};
  232. DFP_ticker.mycounter("zahirWrapper223", "destroy")
  233.  
  234.  
  235. }else if(what == "open"){
  236. try{console.log("open");}catch(e){};
  237. DFP_ticker.Layer("body", "$width", "$height", DFP_ticker.pixelTop(), DFP_ticker.pixelLeft() , DFP_ticker.destroyCounter());
  238. DFP_ticker.gen("$banner", "zahirLayer2223", "$width", "$height", "opaque");
  239. }
  240. }
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253. }
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. //START EDITING
  267.  
  268. function hideTicker() {
  269. $("#footer_ad").fadeOut()
  270.  
  271.  
  272. }
  273.  
  274. head.ready(function() {
  275.  
  276. if (typeof oop === "undefined"){
  277.  
  278. $("body").append("<div id='footer_ad' style='position:fixed;left:0px;bottom:0px;height:410px;width:100%;z-index: 10000;background-color:transparent !important;text-align: center;margin: auto;'></div>")
  279. DFP_ticker.Banner('%%FILE:SWF1%%', 'footer_ad', '1600', '410', 'transparent')
  280.  
  281. }
  282. oop = 1;
  283.  
  284.  
  285.  
  286.  
  287. });
  288.  
  289.  
  290.  
  291. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement