Znalazłem taki skrypcik:

  1. // Popup routines
  2.  
  3. // Define array (url, x, y, blockingcookie,scrollbars,name)
  4. // tutaj wpisujesz adresy kolejnych popupow
  5. var url=new Array(4);
  6. url[0]=['http://adres.pl/dziekuje.html','450','400','','no','subscribe';
  7. url[1]=['http://adres.pl/popup.htm','450','400','','no','czy_subscribed';
  8.  
  9. var exit=true;
  10. var win=null;
  11. var days=1; // Number of days before next popup
  12.  
  13. // Use this routine on the onclick event of any links you DON'T want popups on
  14. function setExitFalse(){
  15. exit=false;
  16. }
  17.  
  18. function showPopup(popupName){
  19. // Get the optional name parameter
  20.  
  21. if(typeof(popupName) == "undefined") {
  22. // If it is not defined, use the next rotated popup
  23. pickNextRotation();
  24.  
  25. } else {
  26. var popped;
  27. // If it is defined, does that actual popup exist?
  28. for (n=0;n<url.length;n++) {
  29. // alert(url[n][5] + ? ? + popupName);
  30. if (url[n][5] == ?) {
  31. // It doesn?t exist, use a rotation popup
  32. pickNextRotation(?nocheck?);
  33. popped = true;
  34. } else if (url[n][5] == popupName) {
  35. // It does exist, use that popup
  36. NewWindow(url[n][0],?popup?,url[n][1],url[n][2],?custom?,'front?,url[n][4],?nocheck?);
  37. popped = true;
  38. break;
  39. }
  40. }
  41. if (!popped) {
  42. pickNextRotation(?nocheck?);
  43. }
  44. }
  45. }
  46.  
  47. function pickNextRotation(checkcookie) {
  48. // Open window if cookie not found
  49. // alert(?CFC: ? + checkcookie);
  50. var i=0; // Default ID
  51.  
  52. // Get the last ID used
  53. var allcookies=document.cookie;
  54. var pos=allcookies.indexOf(?popup=?);
  55. if(pos!=-1){
  56. var start=pos+6;
  57. var end=allcookies.indexOf(?;?,start);
  58. if(end==-1) {
  59. end=allcookies.length;
  60. }
  61. var i=allcookies.substring(start,end);
  62.  
  63. if (i==url.length-1) {
  64. i=0;
  65. } else {
  66. i++;
  67. }
  68. }
  69. //alert(?Start with ?+ i);
  70.  
  71. if (i > url.length) {
  72. i = 0;
  73. }
  74.  
  75. // Now loop until you find one that is not blocked
  76. for (j=i; j < url.length; j++) {
  77. var allowed=1;
  78. //alert (?Checking url ? + j);
  79. if (url[j][3] != ??) {
  80. // There is a blocking cookie ? find the value
  81. //alert(?Looking for cookie ? + url[j][3]);
  82. var allcookies=document.cookie;
  83. //alert(?allcookies=?+ allcookies);
  84. var pos=allcookies.indexOf(url[j][3] + ?=?);
  85. if(pos!=-1){
  86. //alert(?Found subscribed at ? + pos);
  87. var start=pos + url[j][3].length + 1;
  88. var end=allcookies.indexOf(?;?,start);
  89. if(end==-1) {
  90. end=allcookies.length;
  91. }
  92. var cookieval=allcookies.substring(start,end);
  93. allowed = 0;
  94. } else {
  95. //alert (?Subscribed not found?);
  96. }
  97.  
  98. }
  99.  
  100. if (allowed==1) {
  101. //alert(?allowed?);
  102. break;
  103. } else {
  104. //alert (?not allowed:? + allowed);
  105. }
  106.  
  107. } // Continue loop
  108. //alert(?Ended with ? + j);
  109.  
  110. NewWindow(url[j][0],?popup?,url[j][1],url[j][2],?custom?,'front?,url[j][4],checkcookie);
  111. }
  112.  
  113. function NewWindow(mypage,myname,w,h,pos,infocus,scrollbars,checkforcookie){
  114. // alert (checkforcookie);
  115. if (typeof(checkforcookie) == ?undefined?) {
  116. if(GetCookie(?sid?) == ?999?){
  117. return;
  118. }
  119. }
  120. document.cookie=?sid=999; Path=/; Expires= ? + getFuture(days);
  121. if(pos==?random?){
  122. myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
  123. mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
  124. }
  125. if(pos==?center?){
  126. myleft=(screen.width)?(screen.width-w)/2:100;
  127. mytop=(screen.height)?(screen.height-h)/2:100;
  128. } else if((pos!=?center? && pos!=?random?) || pos==null){
  129. myleft=0;
  130. mytop=20;
  131. }
  132. settings=?width=? + w + ?,height=? + h + ?,top=? + mytop + ?,left=? + myleft + ?,scrollbars=? + scrollbars + ?,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes?;
  133.  
  134. win=window.open(mypage,myname,settings);
  135. win.focus();
  136. }
  137.  
  138. function getFuture(f){
  139. var d = new Date();
  140. d.setTime(d.getTime() + (86400000 * f)); // Milliseconds!
  141. return d;
  142. }
  143.  
  144. function GetCookie (name) {
  145. var arg = name + ?=?;
  146. var alen = arg.length;
  147. var clen = document.cookie.length;
  148. var i = 0;
  149. while (i < clen) {
  150. var j = i + alen;
  151. if (document.cookie.substring(i, j) == arg) {
  152. return getCookieVal (j);
  153. }
  154. i = document.cookie.indexOf(? ?, i) + 1;
  155. if (i == 0) break;
  156. }
  157. return null;
  158. }
  159.  
  160. function setCookie(i){
  161. var nextyear=new Date();
  162. nextyear.setFullYear(nextyear.getFullYear()+1);
  163. document.cookie=?popup=?+i+?;path=/;expires=?+nextyear.toGMTString();
  164. }
  165.  
  166. function getCookieVal (offset) {
  167. var endstr = document.cookie.indexOf (?;?, offset);
  168. if (endstr == -1)
  169. endstr = document.cookie.length;
  170. return unescape(document.cookie.substring(offset, endstr));
  171. }


zapisałem to jako okno.js i wsadziłem do głównego katalogu na serwerze.
w index'ie tuż za <head> wstawiłem kod:
  1. <script type="text/javascript" src="okno.js"></script>


Niestety skrypt nie działa.

Proszę o pomoc kogoś doświadczonego.