ad-ms1462_2.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //bbs
  2. var cloudad_type2 = 'ms1462_2';
  3. var cloudad_urls2 = [
  4. 'http://ad.csdn.net/adsrc/ibm-q3-hybrid-cloud-cloud-homepage-banner-960-90-30k-new.swf'
  5. ];
  6. var cloudad_clks2 = [
  7. ''
  8. ];
  9. var can_swf2 = (function () {
  10. if (document.all) swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
  11. else if (navigator.plugins) swf = navigator.plugins["Shockwave Flash"];
  12. return !!swf;
  13. })();
  14. function cloudad_show2() {
  15. var rd = Math.random();
  16. var ad_url, log_url;
  17. if (rd < 0.55 && can_swf2) {
  18. ad_url = cloudad_urls2[0];
  19. log_url = 'http://ad.csdn.net/log.ashx';
  20. log_url += '?t=view&adtype=' + cloudad_type2 + '&adurl=' + encodeURIComponent(ad_url);
  21. cloudad_doRequest2(log_url, true);
  22. }
  23. if (rd < 0) {
  24. ad_url = cloudad_clks2[0];
  25. log_url = 'http://ad.csdn.net/log.ashx';
  26. log_url += '?t=click&adtype=' + cloudad_type2 + '&adurl=' + encodeURIComponent(ad_url);
  27. cloudad_doRequest2(log_url, true);
  28. }
  29. }
  30. function cloudad_doRequest2(url, useFrm) {
  31. var e = document.createElement(useFrm ? "iframe" : "img");
  32. e.style.width = "1px";
  33. e.style.height = "1px";
  34. e.style.position = "absolute";
  35. e.style.visibility = "hidden";
  36. if (url.indexOf('?') > 0) url += '&r_m=';
  37. else url += '?r_m=';
  38. url += new Date().getMilliseconds();
  39. e.src = url;
  40. document.body.appendChild(e);
  41. }
  42. setTimeout(function () {
  43. cloudad_show2();
  44. }, 1000);