<!--

// the list of billboard strings to display

var aBillboardItems = new Array(

	"I bought my wormery when I moved into my new house and left my old compost heap behind.  I've been here a few months now, and it seems to be working well. ~ <em>Mrs S W</em>",
	
	"Thanks for your prompt service, the wormery arrived in time for my wifes' birthday, saving me from a fate too awful to contemplate... the worms seem to be happy too!",

	"The wormery is the neat, clean and tidy way to compost! ~ <em>JB</em>",

	"Excellent product!  Thank you. ~ <em>Catrin Lewis</em>",
	
	"Just to say my wormery came this morning before 10 o/c.  Great service as I only ordered it on Sunday, thats not even 48 hours. ~ <em>Sheila</em>",

	"I was sceptical about the claims made about the efficacy of the Wormery; now that I have had two for a considerable time I am a convert to the system. My garden benefits hugely. ~ <em>Mr Aitken</em>",

	"It's an excellent product that works perfectly and your delivery was quick and painless. ~ <em>Mr Murphy</em>",

	"May I say how pleased I have been with my Wormery. I have had excellent results! ~ <em>Ms Ashley</em>",

	"Almost exactly two years ago, I bought a Wormery. Since then, the system has worked extremely well and we have had large amounts of liquid feed and about three bin fulls of compost! ~ <em>Mr Smith</em>",

	"Well what can I say, you get everything that the website boasts. It was easy to set up. It's so easy to use. It's odourless. I really can say I'm doing my bit for the environment. ~ <em>Bryant Kettle</em>"

	);

// the string number to start with (0 is first)

var iCurItem = 0;

// the numbers of items to display. if this is "null" then the browser

// is really old and we should do nothing

var iNumItems = aBillboardItems.length;

// the length (in milliseconds) for which each item will be displayed

var iDelayMilliseconds = 5500;



// test to see if the browser is IE4 or above

var browserName = navigator.appName;

var browserVer = parseInt(navigator.appVersion);



var browserIE4 = ((browserName == "Microsoft Internet Explorer") && (browserVer >= 4));

// if the browser isn't IE4+ then we'll need to remove any HTML from our

// billboard strings. We can use the function stripHTML to do this

if ((!(browserIE4)) && (iNumItems != null)) {

	for (var i = 0; i < iNumItems; i++) {

		aBillboardItems[i] = stripHTML(aBillboardItems[i]);

	}

}



function stripHTML(sHTML) {

	var sOutText = "";

	var iTagStart;

	var iTagEnd = 0;

	

	// look for the start of the first tag

	iTagStart = sHTML.indexOf("<");

	// repeat until we find no more HTML opening brackets

	while (iTagStart != -1) {

		// add the text since the last tag (or the beginning) until

		// the start of this tag

		sOutText += sHTML.substring(iTagEnd, iTagStart);

		// find the end of this tag

		iTagEnd = sHTML.indexOf(">", iTagStart) + 1;

		// find the start of the next tag

		iTagStart = sHTML.indexOf("<", iTagEnd);

	}

	if (iTagEnd != 0) {

		// finish up by adding the rest of the string

		//sOutText += sHTML.substring(iTagEnd, sHTML.length);

		sOutText = sHTML;

	} else {

		// no HTML was found, so just return the string we got

		sOutText = sHTML;

	}

	// return the result string

	return sOutText;

}

function showNextItem() {

	var sIEHTML;

	

	// show the text

	if (iNumItems != null) {

		if (browserIE4) {

			// IE4+ specific code that removes the TEXTAREA control

			// and displays read-only text in a table

			sIEHTML = aBillboardItems[iCurItem];

			BillboardDiv.innerHTML = sIEHTML

		} else {

			// code for Netscape and other browsers

			//document.BillboardForm.BillboardTextArea.value = aBillboardItems[iCurItem];

			sIEHTML = aBillboardItems[iCurItem];

			document.getElementById("BillboardDiv").innerHTML = sIEHTML;

		}

		// set the next item, roll-over to the start of the list, if needed

		iCurItem = (iCurItem + 1) % iNumItems;

		// run this function again after a delay

		setTimeout("showNextItem()", iDelayMilliseconds);

	}

}

// -->