
// Testimonial shifter developed by Allan Bogh - Stealth Media Solutions, Inc.
// www.stealthmediasolutions.com

function samples(){
//sets up variables to test which version browser the user has
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

//sets up the specials array
var samples = new Array();
	//specials[0] = 'Each month you will see specials listed in this box, we currently have no specials listed yet but check back next month to see the updated specials!';
	samples[0] = '<img src="images/indexsamples.jpg" width="546">';
	samples[1] = '<img src="images/indexsamples1.jpg" width="546">';
	samples[2] = '<img src="images/indexsamples2.jpg" width="546">';
	samples[3] = '<img src="images/indexsamples3.jpg" width="546">';
	samples[4] = '<img src="images/indexsamples4.jpg" width="546">';

// change the number after Math.random() to the last number in the array or else the program
// won't check that number
// calls write to layer function with defined variables
	writetolayer('sampleimages',samples[Math.round(Math.random() * 4)]);

//DO NOT EDIT BELOW THIS LINE!!!	
	function writetolayer(lay,txt) {

// checks browser version and writes layer text
// this will write to a layer called 'testimonial'
// should look like <div id="testimonial">
		if (ie4) {
			document.all[lay].innerHTML = txt;
		}
		if (ns4) {
			document[lay].document.write(txt);
			document[lay].document.close();
		}
		if (ns6) {
			over = document.getElementById([lay]);
			range = document.createRange();
			range.setStartBefore(over);
			domfrag = range.createContextualFragment(txt);
			while (over.hasChildNodes()) {
				over.removeChild(over.lastChild);
				}
			over.appendChild(domfrag);
	   		}
	   }

}