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

function boxads(){
//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 boxhead = new Array();
var box = new Array();
	//the Header that should be displayed in the ad box (relative numbers match)
	boxhead[0] = 'New Years Greeting';
	boxhead[1] = 'Seasons Greetings';
	boxhead[2] = '';
	boxhead[3] = '';
	boxhead[4] = '';
	
	//what is in the advertisement boxes
	box[0] = 'Photography Plus wishes you a happy new year. We hope you the best year ever and look forward to taking some portraits with you.';
	box[1] = 'We wish all people happy holidays. We hope the giving season brings joy to your family. Portraits are a great gift for a special person in your life.';
	box[2] = '';
	box[3] = '';
	box[4] = '';

// 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
	i = Math.round(Math.random() * 1);
	writetolayer('boxhead',boxhead[i]);
	writetolayer('box',box[i]);
	
//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);
	   		}
	   }

}