home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / utils / kazaa_media_desktop / kmd.exe / cloudloader.js < prev    next >
Encoding:
JavaScript  |  2003-05-29  |  2.5 KB  |  133 lines

  1.  
  2. //alert(getCookie("daBoxEula"));
  3. function getCookie(Name) {
  4. var search = Name + "="
  5. if (document.cookie.length > 0) { // if there are any cookies
  6.     offset = document.cookie.indexOf(search)
  7.         if (offset != -1) { // if cookie exists
  8.         offset += search.length
  9.         // set index of beginning of value
  10.         end = document.cookie.indexOf(";", offset)
  11.         // set index of end of cookie value
  12.         if (end == -1)
  13.         end = document.cookie.length
  14.         return unescape(document.cookie.substring(offset, end))
  15.         }
  16.     }
  17. }
  18.  
  19.  
  20. function setCookie(name, value, expires, path, domain, secure) {
  21.   var xCookie = name + "=" + value +
  22.       ((expires) ? "; expires=" + expires.toGMTString() : "") +
  23.       ((path) ? "; path=" + path : "") +
  24.       ((domain) ? "; domain=" + domain : "") 
  25.   
  26.   document.cookie = xCookie;
  27. }
  28.  
  29. function eulaOpen(filename) {
  30.  
  31.     window.open(filename,'eula','menubar=yes,location=no,menus=no,scrollbars,resizable=1,status=no');
  32.     
  33. }
  34.  
  35. function checkTheBox(boxLocation)
  36. {
  37.     
  38.     if (boxLocation == "eula")
  39.     {
  40.     
  41.         if (getCookie("daBoxEula") == "true") 
  42.         {
  43.             setCookie("daBoxEula", "false")
  44.         } else {
  45.         
  46.             setCookie("daBoxEula", "true")
  47.         }
  48.     //alert(getCookie("daBoxEula"));
  49.     }
  50.     
  51.     
  52.     if (boxLocation == "ad")
  53.     {
  54.     
  55.         if (getCookie("daBoxAd") == "true") 
  56.         {
  57.             setCookie("daBoxAd", "false")
  58.         } else {
  59.         
  60.             setCookie("daBoxAd", "true")
  61.         }
  62.     }
  63.     
  64.             if (boxLocation == "desktopIcon")
  65.     {
  66.     
  67.         if (getCookie("desktopIcon") == "true") 
  68.         {
  69.             setCookie("desktopIcon", "false")
  70.         } else {
  71.         
  72.             setCookie("desktopIcon", "true")
  73.         }
  74.     }
  75.             if (boxLocation == "quicklaunchIcon")
  76.     {
  77.     
  78.         if (getCookie("quicklaunchIcon") == "true") 
  79.         {
  80.             setCookie("quicklaunchIcon", "false")
  81.         } else {
  82.         
  83.             setCookie("quicklaunchIcon", "true")
  84.         }
  85.     }
  86.             if (boxLocation == "start")
  87.     {
  88.     
  89.         if (getCookie("start") == "start") 
  90.         {
  91.             setCookie("start", "false")
  92.         } else {
  93.         
  94.             setCookie("start", "true")
  95.         }
  96.     }
  97.             if (boxLocation == "virus")
  98.     {
  99.     
  100.         if (getCookie("virus") == "virus") 
  101.         {
  102.             setCookie("virus", "false")
  103.         } else {
  104.         
  105.             setCookie("virus", "true")
  106.         }
  107.     }
  108.             if (boxLocation == "filter")
  109.     {
  110.     
  111.         if (getCookie("filter") == "true") 
  112.         {
  113.             setCookie("filter", "false")
  114.         } else {
  115.         
  116.             setCookie("filter", "true")
  117.         }
  118.     }
  119.             if (boxLocation == "incomingMessages")
  120.     {
  121.     
  122.         if (getCookie("incomingMessages") == "true") 
  123.         {
  124.             setCookie("incomingMessages", "false")
  125.         } else {
  126.         
  127.             setCookie("incomingMessages", "true")
  128.         }
  129.     }
  130.  
  131. }
  132.  
  133.