home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2002 March / Game.EXE_03_2002.iso / Shareware / Fallout Quest / FQ install.exe / #setuppath# / files / optionsopen.js < prev    next >
Encoding:
Text File  |  2000-10-29  |  2.8 KB  |  126 lines

  1. var hmdsw=100;
  2. var tBuf = 0;
  3. var scrlflag;
  4. var musflag;
  5. var wheremus;
  6. var whermus;
  7. var imgflag;
  8.  
  9. function addCookie(szName,szValue,dtDaysExpires){
  10.   var dtExpires=new Date();
  11.   var dtExpiryDate="";
  12.   dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);
  13.   dtExpiryDate=dtExpires.toGMTString();
  14.   document.cookie=szName+"="+szValue+"; expires="+dtExpiryDate;
  15. }
  16.  
  17. function findCookie(szName){
  18.   var i=0;
  19.   var nStartPosition=0;
  20.   var nEndPosition=0;
  21.   var szCookieString=document.cookie;
  22.   while(i<=szCookieString.length){
  23.     nStartPosition=i;
  24.     nEndPosition=nStartPosition+szName.length;
  25.     if(szCookieString.substring(nStartPosition,nEndPosition)==szName){
  26.       nStartPosition=nEndPosition+1;
  27.       nEndPosition=document.cookie.indexOf(";",nStartPosition);
  28.       if(nEndPosition<nStartPosition)nEndPosition=document.cookie.length;
  29.       return document.cookie.substring(nStartPosition,nEndPosition);
  30.       break;
  31.     }
  32.     i++;
  33.   }
  34.   return "";        
  35.  
  36. function optionsoff(){
  37. window.location.replace("optionsclosed.htm");
  38. }
  39.  
  40. function sndonoff()
  41. {
  42.   tBuf = 0;
  43.   whermus = findCookie('whmus');
  44.   if (whermus == "")
  45.       {
  46.        whermus = "jun";
  47.       }
  48.   musflag = findCookie('muz');
  49.   if (  (musflag !=   "off")
  50.       &&(musflag != "on"))
  51.       {
  52.        musflag = "off"
  53.       }
  54.    if (musflag == "on")
  55.        {
  56.         musflag = "off"
  57.        }else{
  58.         musflag = "on"
  59.        }
  60.    addCookie('muz', musflag, hmdsw);
  61.    wheremus=(whermus + musflag + ".htm");
  62.    parent.music.location.replace(wheremus);
  63.    chimg();
  64. }
  65.  
  66. function scrlonoff()
  67. {
  68. tBuf = 0;
  69. if (confirm('┬φΦ∞αφΦσ!\n┬α∞ φσεß⌡εΣΦ∞ε ±ε⌡≡αφΦ≥ⁿ Φπ≡≤\n(ß≤Σσ≥ ∩≡εΦτΓσΣσφ ∩σ≡στα∩≤±Ω).\n┬±σ σ∙╕ ⌡ε≥Φ≥σ ±Σσδα≥ⁿ ²≥ε?'))
  70. {
  71.   scrlflag = findCookie('scrolling');
  72.   if (  (scrlflag !=   "no")
  73.       &&(scrlflag != "scrl"))
  74.       {
  75.        scrlflag = "no"
  76.       }
  77.    if (scrlflag == "scrl")
  78.        {
  79.         scrlflag = "no"
  80.        }else{
  81.         scrlflag = "scrl"
  82.        }
  83.    addCookie('scrolling', scrlflag, hmdsw);
  84.    parent.main.location.replace("main" + scrlflag + ".htm");
  85.    parent.nextplace.location.replace("next" + scrlflag + ".htm");
  86.    chimg();
  87. }
  88. }
  89.  
  90. function chimg()
  91. {
  92.     musflag = findCookie('muz')
  93.     if(musflag == '')
  94.     {
  95.         musflag = 'on';
  96.         addCookie('muz', musflag, hmdsw);
  97.     }
  98.     if (  (scrlflag !=   'no')
  99.         &&(scrlflag != 'scrl'))
  100.     {
  101.     scrlflag = findCookie('scrolling');
  102.     if(scrlflag == '')
  103.         {
  104.          scrlflag = 'no'
  105.         }
  106.     }
  107.     imgflag = "options_bar_" + scrlflag + "_mus_" + musflag + ".jpg";
  108.     optimg.src = imgflag;
  109. }
  110.  
  111. function TOut()
  112. {
  113.     if (tBuf > 15)
  114.     {
  115.         optionsoff()
  116.     }else{
  117.         tBuf++ ;
  118.     }    
  119. }
  120.  
  121. function doLoad()
  122. {
  123.     window.setInterval( "TOut()", 1000, "JavaScript" );
  124.     chimg();
  125. }