// JavaScript Document

<!--
    // JavaScript to interpolate random images into a page.
    var ic = 24;     // Number of alternative images - INCREMENT THIS EVERY TIME A NEW ITEM IS ADDED
	var i = 0;
	
	var TextList = new Array(ic);  // Array to hold filenames
	var NumArray = new Array(ic);  // Array to hold filenames
	
	// To add a new product:
	// 1. Copy one of the products currently on the page below
	//
	// 2. If you scroll right, the first thing you will see (apart from HTML) is the product title - change this to what you want
	//
	// 3. Almost immediatly to the right of the title, you will see the URL for the product image - right click the new image you want
	// from the site, get its URL, and put it there instead
	// 
	// 4. The next thing to the right is the brief product description - again, just change that to whatever you like
	//
	// 5. Finally, there is the URL to the actual product page.  The ones below dont have the affiliate code in them, but as the 
	// version you have will ONLY be used by you, you can just hardcode your affiliate code into the link
	//
	// Points to note :
	// *** never delete any of the \ characters as these stop special characters like quotes from arsing up the script
	// *** if you change the number of products below, ALWAYS remeber to change variable ic (above) 
    	      
	TextList[i] = "";
	i++;
	
		
	// Here is the start of a product
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-shuttle-baitboat&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fonline.cfm%2Fbait-boats%2Fgrandslam-shuttle-baitboat%2F40%2Fyes%2F52449\"><strong><font color=\"#008000\">Grandslam Shuttle Bait Boat<br><img src=\"http://www.anglersnet.co.uk/images/navigation/shuttle.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">The smallest most robust bait boat available. This pocket battleship is so easy to control. Simply the ultimate in stealthy bait presentation.<br>Click Here</a></font>";
	i++;
	// Here is the end of that product
	
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-glimmer&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fbuy.cfm%2Fbite-alarms%2Ftf-gear-glimmer-bite-alarm%2F40%2Fyes%2F41889\"><strong><font color=\"#008000\">TF Gear Glimmer Bite Alarms<br><img src=\"http://www.anglersnet.co.uk/images/navigation/glimmer.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">When you turn on your TFGear Glimmer Bite Alarm, you'll notice how everything has been created to improve bite detection.<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-banshee&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fbuy.cfm%2Fcarp-rods%2Ftf-gear-banshee-carp-rods-buy-1-get-1-free%2F40%2Fyes%2F49554\"><strong><font color=\"#008000\">TF Gear Banshee Carp Rods<br><img src=\"http://www.anglersnet.co.uk/images/navigation/banshee.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Buy 1 Get 1 FREE!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=jf-tfg-enigma&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithOptions.cfm%3FID%3DF-EMG3-%26ShopRef%3D40%26Prime%3DNo%26shopListRec%3D44114\"><strong><font color=\"#008000\">Enigma EMG MKIII Rods<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg3.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Enigma EMG MKIII Rods with FREE Enigma M3 Reel and Free Enigma Cap<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-abu-tsr&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fonline.cfm%2Fsea-fishing-reels%2Fabu-garcia-6500i-tsr-reel%2F40%2Fyes%2F54661\"><strong><font color=\"#008000\">Abu Garcia 6500I TSR Reel<br><img src=\"http://www.anglersnet.co.uk/images/navigation/abutsr.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Taking the world famous 6500 reel series to new limits, the new one piece aluminium frame lowers the reel to give even greater cast control and comfort.<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-wavehopper-jacket&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithOptions.cfm%3FID%3DF-WAVEHV%26ShopRef%3D40%26Prime%3DNo%26shopListRec%3D44467\"><strong><font color=\"#008000\">Wavehopper Inflatable Fly Vest Lifejacket<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg5.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Click below to see the video of this jacket in action.<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-greys-spinningrod&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithOptions.cfm%3FID%3DF-GRXFS%26ShopRef%3D40%26Prime%3DNo%26shopListRec%3D45169\"><strong><font color=\"#008000\">Greys X-Flite Spinning Rod<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg6.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">The Greys X-Flite Spinning Rod is designed to push build quality and value for money to the very limits in a high-performance spinning rod<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-baitrunner-st&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithOptions.cfm%3FID%3DFC-ST-%26ShopRef%3D40%26Prime%3DYes%26shopListRec%3D40534\"><strong><font color=\"#008000\">Shimano Baitrunner ST Carp Reel<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg7.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">In classic black with an XT7 spool finished in silver, the Shimano Baitrunner ST 6000 and ST 10000 Carp reels are packed with far more advanced features than you'd expect to find on any reel at this price point.<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-rt-beach-shelter&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fbuy.cfm%2Ffishing-shelters-and-accessories%2Fron-thompson-beach-shelter%2F40%2Fyes%2F52098\"><strong><font color=\"#008000\">Ron Thompson Beach Shelter<br><img src=\"http://www.anglersnet.co.uk/images/navigation/rts.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Possibly the best value for money shelter on the market<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-feeder-rods&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fmatch-and-feeder%2Ffeeder-fishing-rods%2F40%2F6044\"><strong><font color=\"#008000\">Feeder Rods<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg9.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Discounted rods to suit all budgets!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-matthayes-allrounder&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithoutOptions.cfm%3Fprime%3DYes%26ID%3DTFG-MH-ALLROUNDER%26ShopRef%3D40%26Prime%3DYes%26shopListRec%3D38437\"><strong><font color=\"#008000\">TFG Matt Hayes All Rounder Rod<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg10.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">The TFG Matt Hayes All Rounder Rod is 4 rods in one!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-sonik-nct&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fbuy.cfm%2Fsea-fishing-rods%2Fsonik-nct-beach-rods%2F40%2Fyes%2F54651\"><strong><font color=\"#008000\">Sonik NCT Beach Rods<br><img src=\"http://www.anglersnet.co.uk/images/navigation/sonik.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Just pick up one of the stunning new NCT -Nano Carbon Technology - shore rods from Sonik and you will immediately notice the difference<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-dynamite&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Ffishing-bait%2F40%2F6053%2FDynamite\"><strong><font color=\"#008000\">Dynamite Baits<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg12.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Huge range of boilies, pop-ups, pellets, dips and more!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-baitboats&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Fbait-boats%2F40%2F6030\"><strong><font color=\"#008000\">Bait Boats<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg13.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Prices starting from just &pound;399.99<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-bedchairs&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Ffishing-bedchairs%2F40%2F5795\"><strong><font color=\"#008000\">Bedchairs<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg14.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Something for everyone, with prices from just &pound;49.99<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-bite-alarms&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Fbite-alarms%2F40%2F5797%2FAll\"><strong><font color=\"#008000\">Bite Alarms<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg15.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Delkim, Fox, ProLogic, TFG...we have them all!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-bivvies&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Fbivvy%2F40%2F6033%2FAll\"><strong><font color=\"#008000\">Bivvies<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg16.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">JRC, Nash, Trakker, ProLogic, etc. - compare these prices first!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-centrepin&p=http%3A%2F%2Fwww.fishtec.co.uk%2FProductDetailInfoWithOptions.cfm%3FID%3DTFG-CLASSPIN%26ShopRef%3D40%26Prime%3DYes%26shopListRec%3D48111\"><strong><font color=\"#008000\">TFG Classic Centrepin<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg17.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Designed by Matt Hayes, this reel is a definitive example of the classic centre pin model<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-carp-reels&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Fcarp-and-specialist-reels%2F40%2F6035%2FAll\"><strong><font color=\"#008000\">Carp Reel Sale<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg18.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Deals for every carp anglers. Check out these prices!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><strong><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-carp-rods&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Fcarp-fishing-rods%2F40%2F6036%2FAll\"><font color=\"#008000\">Carp Rod Sale<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg19.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Nash, Greys, TFG, Fox & more!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-smartcast&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Ffish-finders%2F40%2F6074\"><strong><font color=\"#008000\">SmartCast Fishfinders<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg20.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Remove all doubt! From just &pound;134.99 with member discount!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-landing-nets&p=http%3A%2F%2Fwww.fishtec.co.uk%2Ftackle.cfm%2Fcarp-and-specialist%2Flanding-nets%2F40%2F5805\"><strong><font color=\"#008000\">Carp Nets<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg21.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Don't let that big one slip away!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=js-matt-hayes&p=http%3A%2F%2Fwww.fishtec.co.uk%2F\"><strong><font color=\"#008000\">MATT HAYES<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg22.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Come and meet the man on his official website. Watch the videos and see the tackle in action!<br>Click Here</a></font>";
	i++;
	TextList[i] = "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><a href=\"http://www.awin1.com/cread.php?platform=dl&awinmid=1369&awinaffid=58235&clickref=an-js-SALE&p=http%3A%2F%2Fwww.fishtec.co.uk%2Fcoarse-fly-fishing-sale.cfm\"><strong><font color=\"#008000\">SALE!!!<br><img src=\"http://www.anglersnet.co.uk/images/navigation/tfg23.jpg\" border=0 width=100 height=100></font></font></strong><br><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Be quick... offers in this section don't last long!<br>Click Here</a></font>";
	i++;
	
	
function pickRandom() 
{	
	if (Math.random)
	{
		var thisval = Math.round(Math.random() * (i-1));		
		return thisval;

	}
	else 
	{
		var now = new Date();
		return thisval2;		

	}
}

function GenerateRandomSet(M, N) {
  // Generate M non-repeating random numbers from 1 to N }
  if (M<1) return []
  var aSet = GenerateRandomSet(M-1, N-1)
  var J = Math.floor(Math.random()*N) + 1 // J is in 1..N
  aSet[J] ? aSet[N]=N : aSet[J]=J
  return aSet  }
  
function replaceSubstring(inputString, fromString, toString) {
   // Goes through the inputString and replaces every occurrence of fromString with toString
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      // Find a string that doesn't exist in the inputString to be used
      // as an "inbetween" string
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } // Keep on going until we build an "inbetween" string that doesn't exist
      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      // Next, replace the "inbetween" string with the "toString"
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } // Ends the check to see if the string being replaced is part of the replacement string or not
   return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function
  
function TestGRS(M, N) { var Q, j, k=0, Ans=[]
  Q = GenerateRandomSet(M, N)
 
  for (j=0 ; j < Q.length ; j++) if (Q[j]) Ans[k++] = Q[j]
  
  return Ans 
  }
  
 function SetAffiliate(AffilCode) 
 {  	
  	for (j=0 ; j < TextList.length ; j++) 
  	{
		var str = "";
		str = replaceSubstring(TextList[j], "232715", AffilCode);
		TextList[j] = str;
	}
 }
  
// Write out text, using a randomly-chosen image name.
NumArray = TestGRS(7,i);

// -->

