
<!-- Paste this code into an external JavaScript file named: feelLucky.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Will Bontrager :: http://www.bontragerconnection.com/ */

// Leave next line as is.
var Lucky = new Array();

// The cookie to keep track of which "lucky" destinations 
// have already been visited needs a name. Okay to change
//  the cookie name.

var FeelLuckyCookieName = "FeelLuckyCookie";

// When a "lucky" destination has been decided upon, shall 
// the browser open a new window with the desitination URL?
// (Specify "y" or "yes" if yes new window; otherwise "".)
var NewWindow = "y";

// Specify your lucky destination URLs here. The first is 
// assigned to Lucky[0], the next to Lucky[1], and so 
// forth, in numerical sequence -- as many as you want.

Lucky[0] = "http://www.showbiz.uk.net/oldtimemusichall/feb07pics.htm";
Lucky[1] = "http://www.photoeyes.biz/events/stainespancakerace2007/pics.htm";
Lucky[2] = "http://www.photoeyes.biz/snow/index.htm";
Lucky[3] = "http://www.photoeyes.biz/pramrace/2006/review.htm";
Lucky[4] = "http://www.photoeyes.biz/events/egham2006nativity/review.htm";
Lucky[5] = "http://www.photoeyes.biz/trafalgar2006egham.htm";
Lucky[6] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[7] = "http://www.safer-runnymede.co.uk/photos.htm";
Lucky[8] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[9] = "http://www.photoeyes.biz/stanlake/index.htm";
Lucky[10] = "http://www.photoeyes.biz/vwca2006/annualshow1.htm";
Lucky[11] = "http://www.photoeyes.biz/events/eghamroyalshow/gallery.htm";
Lucky[12] = "http://www.photoeyes.biz/events/balloons2006/index.htm";
Lucky[13] = "http://www.photoeyes.biz/anneandenid/savill.htm";
Lucky[14] = "http://www.photoeyes.biz/events/eghamnativity2009.htm";
Lucky[15] = "http://www.photoeyes.biz/events/carnivalcapers/photos.htm";
Lucky[16] = "http://www.photoeyes.biz/greatfosters/index.htm";
Lucky[17] = "http://www.photoeyes.biz/chelsea2006/index.htm";
Lucky[18] = "http://www.photoeyes.biz/stgeorgesday2006/pics.htm";
Lucky[19] = "http://www.photoeyes.biz/jailbreak/jailbreak.htm";
Lucky[20] = "http://www.photoeyes.biz/trafalgar2005.htm";
Lucky[21] = "http://www.photoeyes.biz/magnaday2006/index.htm";
Lucky[22] = "http://www.photoeyes.biz/church/longcross.htm";
Lucky[23] = "http://www.showbiz.uk.net/VIAMlondon2010/gallery.htm";
Lucky[24] = "http://www.photoeyes.biz/events/floral-luncheon.htm";
Lucky[25] = "http://www.musicman.org.uk/gamelan/march2007.htm";
Lucky[26] = "http://www.showbiz.uk.net/rdg/breakingthecode/gallery.htm";
Lucky[27] = "http://www.photoeyes.biz/events/buses2007/gallery.htm";
Lucky[28] = "http://www.photoeyes.biz/general/airforcesmemorial.htm";
Lucky[29] = "http://www.photoeyes.biz/events/flowerfestival2007.htm";
Lucky[30] = "http://www.photoeyes.biz/events/magnacartaday/photos.htm";
Lucky[31] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[32] = "http://www.photoeyes.biz/events/stgeorgesparade2010/gallery.htm";
Lucky[33] = "http://www.showbiz.uk.net/rdg/hayfever/gallery.htm";
Lucky[34] = "http://www.photoeyes.biz/events/sculptures/gallery.htm";
Lucky[35] = "http://www.photoeyes.biz/events/balloons2007/index.htm";
Lucky[36] = "http://www.photoeyes.biz/events/eghamroyalshow/gallery.htm";
Lucky[37] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[38] = "http://www.photoeyes.biz/general/rholloway.htm";
Lucky[39] = "http://www.photoeyes.biz/general/coxeslock.htm";
Lucky[40] = "http://www.photoeyes.biz/general/sanatorium.htm";
Lucky[41] = "http://www.photoeyes.biz/general/chertsey.htm";
Lucky[42] = "http://www.photoeyes.biz/events/civicservice2007.htm";
Lucky[43] = "http://www.showbiz.uk.net/zodiac/42ndstreet/gallery.htm";
Lucky[44] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[45] = "http://www.showbiz.uk.net/zodiac/42ndstreet/gallery.htm";
Lucky[46] = "http://www.showbiz.uk.net/rdg/journeysend/gallery.htm";
Lucky[47] = "http://www.showbiz.uk.net/sjp/sleepingbeauty/gallery.htm";
Lucky[48] = "http://www.photoeyes.biz/pramrace/index.htm";
Lucky[49] = "http://www.showbiz.uk.net/act/alice/show.htm";
Lucky[50] = "http://www.photoeyes.biz/events/stainespancakerace2008/pics.htm";
Lucky[51] = "http://www.wonderyearsrock.com";
Lucky[52] = "http://www.photoeyes.biz/general/sistersofstmarychapel.htm";
Lucky[53] = "http://www.showbiz.uk.net/rdg/kindertransport/gallery.htm";
Lucky[54] = "http://www.showbiz.uk.net/act/frankies/gallery.htm";
Lucky[55] = "http://www.photoeyes.biz/stanlake/exhibition2008.htm";
Lucky[56] = "http://www.photoeyes.biz/general/daffodils.htm";
Lucky[57] = "http://www.showbiz.uk.net/rdgentry.htm";
Lucky[58] = "http://www.showbiz.uk.net/rdg/lightningplay/gallery.htm";
Lucky[59] = "http://www.photoeyes.biz/events/blackcherryfair/photos.htm";
Lucky[60] = "http://www.photoeyes.biz/events/chertseyshow2008/gallery.htm";
Lucky[61] = "http://www.photoeyes.biz/events/eghamroyalshow/gallery.htm";
Lucky[62] = "http://www.showbiz.uk.net/chapterhouse/savillgarden/openairtheatre.htm";
Lucky[63] = "http://www.photoeyes.biz/events/GCR/galleries.htm";
Lucky[64] = "http://www.showbiz.uk.net/zodiac/oliver/gallery.htm";
Lucky[65] = "http://www.photoeyes.biz/events/vwchristmaslightson.htm";
Lucky[66] = "http://www.showbiz.uk.net/sjp/aladdin/gallery.htm";
Lucky[67] = "http://www.showbiz.uk.net/act/omh/z/gallery.htm";
Lucky[68] = "http://www.photoeyes.biz/events/tornado2009.htm";
Lucky[69] = "http://www.photoeyes.biz/snow/index.htm";
Lucky[70] = "http://www.showbiz.uk.net/smtg/mame/gallery.htm";
Lucky[71] = "http://www.showbiz.uk.net/kasjog/orpheus/gallery.htm";
Lucky[72] = "http://www.photoeyes.biz/events/hytheparktreeplanting.htm";
Lucky[73] = "http://www.photoeyes.biz/general/punchbowlvw.htm";
Lucky[74] = "http://www.photoeyes.biz/events/chobham-carnival/photos.htm";
Lucky[75] = "http://www.photoeyes.biz/events/chertseyvikings2009.htm";
Lucky[76] = "http://www.showbiz.uk.net/sjp/breakingthecode/gallery.htm";
Lucky[77] = "http://www.photoeyes.biz/events/chelseaflowershow/2009.htm";
Lucky[78] = "http://www.showbiz.uk.net/christchurchplayers/allatsea/photos.htm";
Lucky[79] = "http://www.photoeyes.biz/events/ashfordonthemap/2009/gallery.htm";
Lucky[80] = "http://www.showbiz.uk.net/sjp/beauty/gallery.htm";
Lucky[81] = "http://www.photoeyes.biz/events/englefieldgreenfair/photos.htm";
Lucky[82] = "http://www.showbiz.uk.net/christchurchplayers/suddendeparture/photos.htm";
Lucky[83] = "http://www.photoeyes.biz/events/blackcherryfair/photos.htm";
Lucky[84] = "http://www.showbiz.uk.net/rdgentry.htm";
Lucky[85] = "http://www.photoeyes.biz/general/vwruins.htm";
Lucky[86] = "http://www.showbiz.uk.net/sjp/pantomurder2009/gallery.htm";
Lucky[87] = "http://www.photoeyes.biz/events/freedomofborough2009/gallery.htm";
Lucky[88] = "http://www.photoeyes.biz/events/chertseyshow/2009/gallery.htm";
Lucky[89] = "http://www.showbiz.uk.net/chapterhouse/savillgarden/entry.htm";
Lucky[90] = "http://www.showbiz.uk.net/procyon/fame/gallery.htm";
Lucky[91] = "http://www.photoeyes.biz/events/stjudes150th.htm";
Lucky[92] = "http://www.showbiz.uk.net/act/swinging60s/gallery.htm";
Lucky[93] = "http://www.photoeyes.biz/events/mizens-oktoberfest/gallery.htm";
Lucky[94] = "http://www.showbiz.uk.net/zodiac/copacabana/gallery.htm";
Lucky[95] = "http://www.showbiz.uk.net/sjp/oneactplays/index.htm";

// No additional JavaScript customizations are required. //

var TabChar = String.fromCharCode(9);
var CurrentCookie = '';
function GetLuckyCookie() {
  var cookiecontent = '';
  if(document.cookie.length > 0) {
  	 var cookiename = FeelLuckyCookieName + '=';
  	 var cookiebegin = document.cookie.indexOf(cookiename);
  	 var cookieend = 0;
  	 if(cookiebegin > -1) {
     	cookiebegin  += cookiename.length;
     	cookieend = document.cookie.indexOf(";",cookiebegin);
     	if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
     	cookiecontent = document.cookie.substring(cookiebegin,cookieend);
    }
  }
  return cookiecontent;
}

function PutLuckyCookie(value) {
  if(CurrentCookie.length > 0) { value = CurrentCookie + TabChar + value; }
  value = escape(value);
  document.cookie = FeelLuckyCookieName + "=" + value;
}

function YesMakeMeLucky() { 
  CurrentCookie = GetLuckyCookie();
  CurrentCookie = unescape(CurrentCookie);
  if(CurrentCookie == '.') { CurrentCookie = ''; }
  var LuckyVisitedList = CurrentCookie.split(TabChar);
  if(LuckyVisitedList.length >= Lucky.length) {
   	document.cookie = FeelLuckyCookieName + "=.";
   	CurrentCookie = '';
   	LuckyVisitedList = Array();
  }
  for(var i = 0; i < LuckyVisitedList.length; i++) { Lucky[LuckyVisitedList[i]] = ''; }
  var LuckyL = new Array();
  for(var i = 0; i < Lucky.length; i++) {
   	if(Lucky[i].length > 0) { LuckyL.push('' + i + TabChar + Lucky[i]); }
  }
  var LuckyDestinationNumber = 0;
  if(LuckyL.length > 1) { LuckyDestinationNumber = Math.ceil((Math.random() * LuckyL.length) - 1); }
  var LuckyNumberPlace = new Array();
  LuckyNumberPlace = LuckyL[LuckyDestinationNumber].split(TabChar);
  PutLuckyCookie(LuckyNumberPlace[0]);
  NewWindow = NewWindow.toLowerCase();
  if(NewWindow.substr(0,1) == "y") { window.open(LuckyNumberPlace[1]); }
  else { document.location = LuckyNumberPlace[1]; }
}