home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 December / Chip_2000-12_cd1.bin / internet / pohled / CELEBS-POSTCARDS_soubory / Version3 < prev   
Text File  |  2000-11-06  |  5KB  |  137 lines

  1. // Copyright 1999, 2000 Flycast Communications. All rights reserved.
  2. // Patent Pending
  3. // Version 3.6.12
  4.  
  5. FlycastLoaded        = true;
  6. FlycastRandom        = 0;
  7. FlycastClickTarget    = "_top";
  8. FlycastUnicastPage    = "";
  9. //FlycastUnicastPage    = "interstitial";
  10.  
  11. FlycastFoundMSIE    = navigator.userAgent.indexOf("MSIE") >= 0;
  12. FlycastFoundMSIE2    = navigator.userAgent.indexOf("MSIE2") >= 0 || navigator.userAgent.indexOf("MSIE 2") >= 0;
  13. FlycastFoundMSIE3    = navigator.userAgent.indexOf("MSIE 3") >= 0;
  14. FlycastFoundNN    = navigator.userAgent.indexOf("Mozilla/") >= 0 && !FlycastFoundMSIE;
  15. FlycastFoundNN2    = navigator.userAgent.indexOf("Mozilla/2.") >= 0 && !FlycastFoundMSIE;
  16. FlycastFoundNN3    = navigator.userAgent.indexOf("Mozilla/3.") >= 0 && !FlycastFoundMSIE;
  17. //FlycastFoundMac    = navigator.userAgent.indexOf("Macintosh") >= 0 || navigator.userAgent.indexOf("Mac_") >= 0;
  18. //FlycastFoundMacAndIE3    = FlycastFoundMac && FlycastFoundMSIE3;
  19. FlycastModernJS    = !(FlycastFoundNN3 || FlycastFoundMSIE3);
  20.  
  21. function FlycastReplace(str, chr, replacement)
  22. {    //more universally supported than str.replace(chr, replacement)
  23.     var    x    = str.split(chr);
  24.     var    y    = x[0];
  25.     for (i = 1; i < x.length; i++)
  26.     {
  27.         y    += replacement;
  28.         y    += x[i];
  29.     }
  30.     return    y;
  31. }
  32.  
  33. function FlycastSuppressError() {
  34.     window.location.reload();
  35.     return true;
  36. }
  37. if (FlycastFoundNN3) {
  38.     window.onerror    = FlycastSuppressError;
  39. }
  40.  
  41. function FlycastDeliverAd ()
  42. {
  43.     FlycastAdServer    = "http://ad-adex3.flycast.com/server";
  44.     FlycastSiteInfo    = FlycastSite + "/" + FlycastPage + "/";
  45.     FlycastDataTag1    = "";
  46.     FlycastDataTag2    = "";
  47.     FlycastQuery    = "";
  48.  
  49.     if (FlycastNewAd)
  50.     {    //set FlycastRandom
  51.         FlycastNow        = new Date();
  52.         FlycastRandom    = FlycastNow.getTime();
  53.         FlycastRandom    = FlycastRandom % 10000000;
  54.         if (FlycastModernJS)
  55.         {
  56.             FlycastRandom    += Math.floor(Math.random() * 100);
  57.         }
  58.     }
  59.  
  60.     var    httpHeader            = "http://";
  61.     var    httpReferrerIndex    = location.href.indexOf(httpHeader);
  62.     if ((httpReferrerIndex >= 0) && FlycastModernJS)
  63.     {    //set FlycastDataTag1
  64.         httpReferrerIndex    += httpHeader.length;
  65.         httpReferrer    = location.href.substr(httpReferrerIndex);
  66.         //first, truncate queryString
  67.         httpReferrer    = httpReferrer.split('?')[0];
  68.         //substitute ascii for potentially unparseable characters
  69.         httpReferrer    = FlycastReplace(httpReferrer, ";", "\%3b");    //replace (globally) ';' with "%3b"
  70.         httpReferrer    = FlycastReplace(httpReferrer, "=", "\%3d");    //replace (globally) '=' with "%3d"
  71.         httpReferrer    = FlycastReplace(httpReferrer, "/", "\%2f");    //replace (globally) '/' with "%2f"
  72.         FlycastDataTag1    = "referrer=" + httpReferrer;
  73.     }
  74.  
  75.     if (FlycastVersion >= 3.6)
  76.     {    //set FlycastDataTag2, FlycastQuery, FlycastClickTarget (used by media)
  77.         if (FlycastEnableTargetWindow)
  78.         {    //append fcd to indicate using child clickthrough window
  79.             FlycastDataTag2        = "targetType=_blank";
  80.             FlycastClickTarget    = "_blank";
  81.         }
  82.         if (FlycastKeyword.length > 0)
  83.         {    //create query string with keyword
  84.             FlycastQuery    = "?" + FlycastKeyword;
  85.         }
  86.     }
  87.  
  88.     if ((FlycastDataTag1.length > 0) || (FlycastDataTag2.length > 0))
  89.     {    //append DataTags
  90.         FlycastSiteInfo    += ";";
  91.         if (FlycastDataTag1.length > 0)
  92.         {
  93.             FlycastSiteInfo    += FlycastDataTag1 + ";";
  94.         }
  95.         if (FlycastDataTag2.length > 0)
  96.         {
  97.             FlycastSiteInfo    += FlycastDataTag2 + ";";
  98.         }
  99.         FlycastSiteInfo    += "/";
  100.     }
  101.  
  102.     //append random number and possibly keyword
  103.     FlycastSiteInfo    += FlycastRandom + FlycastQuery;
  104.  
  105.     if (FlycastFoundMSIE2 || FlycastFoundNN3)
  106.     {
  107.         document.write("<A target=" + FlycastClickTarget + " HREF=\"" + FlycastAdServer + "/click/" +  FlycastSiteInfo + "\"><IMG WIDTH=" + FlycastWidth + " HEIGHT=" + FlycastHeight + " SRC=\"" + FlycastAdServer + "/ad/" +  FlycastSiteInfo + "\"></A>");
  108.     }
  109.     else if (FlycastFoundMSIE)
  110.     {
  111.         document.write("<IFRAME SRC=\"" + FlycastAdServer + "/iframe/" +  FlycastSiteInfo + "\" scrolling='no' marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0 width=" + FlycastWidth + " height=" + FlycastHeight + "></IFRAME>");
  112.     }
  113.     else
  114.     {
  115.         document.write("<S" + "CRIPT SRC=\"" + FlycastAdServer + "/js/" +  FlycastSiteInfo + "\" LANGUAGE=JAVASCRIPT></SCRIPT>");
  116.     }
  117.     if (FlycastUnicastPage.length > 0)
  118.     {
  119.         FlycastUnicastSiteInfo    = FlycastSite + "/" + FlycastUnicastPage + "/" + FlycastRandom;
  120.         document.write("<S" + "CRIPT SRC=\"" + FlycastAdServer + "/js/" +  FlycastUnicastSiteInfo + "\" LANGUAGE=JAVASCRIPT></SCRIPT>");
  121.     }
  122. }
  123.  
  124. if (FlycastPrintTag)
  125. {
  126.     if (FlycastVersion > 3.5)
  127.     {
  128.         FlycastDeliverAd();
  129.     }
  130.     else if (FlycastFoundNN3)
  131.     {
  132.         FlycastLoaded    = false;
  133.         FlycastDeliverAd();
  134. //    document.write("<A target=" + FlycastClickTarget + " HREF=\"" + FlycastAdServer + "/click/" +  FlycastSiteInfo + "\"><IMG WIDTH=" + FlycastWidth + " HEIGHT=" + FlycastHeight + " SRC=\"" + FlycastAdServer + "/ad/" +  FlycastSiteInfo + "\"></A>");
  135.     }
  136. }
  137.