
<!-- 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 = "";

// 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.rockwoodbusiness.ca/profiles/aaa_vct/aaa_vct.htm";
Lucky[1] = "http://www.rockwoodbusiness.ca/profiles/bradenhomes/bradenhomes.htm";
Lucky[2] = "http://www.rockwoodbusiness.ca/profiles/ck_coverings/ck_coverings.htm";
Lucky[3] = "http://www.rockwoodbusiness.ca/profiles/campbrebeuf/brebeuf.html";
Lucky[4] = "http://www.rockwoodbusiness.ca/profiles/castles_teaberry/castles_teaberry.htm";
Lucky[5] = "http://www.rockwoodbusiness.ca/profiles/douglas_black_law/douglas_black_law.htm";
Lucky[6] = "http://www.rockwoodbusiness.ca/profiles/dreamscape_spa/dreamscape_spa.htm";
Lucky[7] = "http://www.rockwoodbusiness.ca/profiles/dr_timothy_peloso/dr_timothy_peloso.htm";
Lucky[8] = "http://www.rockwoodbusiness.ca/profiles/eden_house/eden_house.html";
Lucky[9] = "http://www.rockwoodbusiness.ca/profiles/edgewood/edgewood.htm";
Lucky[10] = "http://www.rockwoodbusiness.ca/profiles/ewag/ewag.html";
Lucky[11] = "http://www.rockwoodbusiness.ca/profiles/fishermans_landing/fishermans_landing.html";
Lucky[12] = "http://www.rockwoodbusiness.ca/profiles/fit_tobe_tried/fittobetried.html";
Lucky[13] = "http://www.rockwoodbusiness.ca/profiles/fogbusters/fogbusters.htm";
Lucky[14] = "http://www.rockwoodbusiness.ca/profiles/glen_abbey/glen_abbey.html";
Lucky[15] = "http://www.rockwoodbusiness.ca/profiles/glen_ewen/glenewen.html";
Lucky[16] = "http://www.rockwoodbusiness.ca/profiles/harmonious_spaces/harmonious_spaces.html";
Lucky[17] = "http://www.rockwoodbusiness.ca/profiles/international_healing/internationalhealing.html";
Lucky[18] = "http://www.rockwoodbusiness.ca/profiles/jims_repair/jims.html";
Lucky[19] = "http://www.rockwoodbusiness.ca/profiles/kimlor/kimlor.html";
Lucky[20] = "http://www.rockwoodbusiness.ca/profiles/knapps/knapps.html";
Lucky[21] = "http://www.rockwoodbusiness.ca/profiles/oof/old_orchard_farm.html";
Lucky[22] = "http://www.rockwoodbusiness.ca/profiles/pepes_purple_pig/pepes.html";
Lucky[23] = "http://www.rockwoodbusiness.ca/profiles/rocking_horse/rockinghorse.html";
Lucky[24] = "http://www.rockwoodbusiness.ca/profiles/conservationarea/conservation.html";
Lucky[25] = "http://www.rockwoodbusiness.ca/profiles/the_rockwood_karate_club/the_rockwoodkarate.html";
Lucky[26] = "http://www.rockwoodbusiness.ca/profiles/rockwood_medical/rockwood_medical.html";
Lucky[27] = "http://www.rockwoodbusiness.ca/profiles/rockwood_motorprod/rockwood_motorprod.html";
Lucky[28] = "http://www.rockwoodbusiness.ca/profiles/rockwood_pharmacy/rockwood_pharmacy.html";
Lucky[29] = "http://www.rockwoodbusiness.ca/profiles/rockwood_truevalue/rockwood_truevalue.html";
Lucky[30] = "http://www.rockwoodbusiness.ca/profiles/rockwood_tv/rockwood_tv.html";
Lucky[31] = "http://www.rockwoodbusiness.ca/profiles/rbc/rbc.html";
Lucky[32] = "http://www.rockwoodbusiness.ca/profiles/safety_connection/safety_connection.html";
Lucky[33] = "http://www.rockwoodbusiness.ca/profiles/saunders/saunders.html";
Lucky[34] = "http://www.rockwoodbusiness.ca/profiles/second_hand/secondhand.html";
Lucky[35] = "http://www.rockwoodbusiness.ca/profiles/steetcar_museum/streetcarmuseum.html";
Lucky[36] = "http://www.rockwoodbusiness.ca/profiles/sunshine_design/sunshinedesign.html";
Lucky[37] = "http://www.rockwoodbusiness.ca/profiles/swanston/swanston.html";
Lucky[38] = "http://www.rockwoodbusiness.ca/profiles/sylvia_ayres/sylviaayres.html";
Lucky[39] = "http://www.rockwoodbusiness.ca/profiles/t_and_a/tanda.html";
Lucky[40] = "http://www.rockwoodbusiness.ca/profiles/the_rose_garden/the_rosegarden.html";
Lucky[41] = "http://www.rockwoodbusiness.ca/profiles/township/get.html";
Lucky[42] = "http://www.rockwoodbusiness.ca/profiles/videoplex/videoplex.html";
Lucky[43] = "http://www.rockwoodbusiness.ca/profiles/village_beauty/villagebeauty.html";
Lucky[44] = "http://www.rockwoodbusiness.ca/profiles/village_sweet_shop/village_sweet_shop.html";
Lucky[45] = "http://www.rockwoodbusiness.ca/profiles/vip_pet_grooming/vippetgrooming.html";
Lucky[46] = "http://www.rockwoodbusiness.ca/profiles/wwcfdc/wwcfdc.html";
Lucky[47] = "http://www.rockwoodbusiness.ca/profiles/willow_wrill/willow-wrill.html";
Lucky[48] = "http://www.rockwoodbusiness.ca/profiles/wordbird/wordbird.html";
Lucky[49] = "http://www.rockwoodbusiness.ca/profiles/waterloo_biofilter/waterloo_biofilter.html";
Lucky[50] = "http://www.rockwoodbusiness.ca/profiles/golden_woods/golden_woods.htm";
Lucky[51] = "http://www.rockwoodbusiness.ca/profiles/jameswilson/jameswilson.html";
Lucky[52] = "http://www.rockwoodbusiness.ca/profiles/rockwood_electric/rockwood_electric.html";
Lucky[53] = "http://rockwoodbusiness.ca/profiles/casualdining/casualdining.html";
Lucky[54] = "http://rockwoodbusiness.ca/profiles/sweetheaven/sweetheaven.html";
Lucky[55] = "http://rockwoodbusiness.ca/profiles/bowes/bowes.html";
Lucky[56] = "http://rockwoodbusiness.ca/profiles/rocktoningfitness/rocktoningfitness.html";
Lucky[57] = "http://rockwoodbusiness.ca/profiles/nextpage/nextpage.html";
Lucky[58] = "http://rockwoodbusiness.ca/profiles/foodland/foodland.html";
Lucky[59] = "http://rockwoodbusiness.ca/profiles/bodyworks/bodyworks.html";


// 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]; }
}






