<!--
function trap() {
	if(document.images) {
		for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown = protect;
		}
	}
}

//var photoArray= new Array('images/Elm logo.jpg','images/technine2.jpg','images/Black Fly logo.gif');

var photoParts = photoArray.length; // number of items in photo array
var preLoad = new Array()

for (i = 0; i < photoParts ; i++){
   preLoad[i] = new Image()
   preLoad[i].src = photoArray[i]
}

bColor = '#c8c8d2';

styleHead = '<font style="position:relative;top: ';

var textArray = new Array(
	"At <b>Sun Valley Doors </b>we offer many types of doors and accesories. From entry, to interior, from office, to hotel, to residential.<br> We do it all.",
	"Feel free to peruse our site and get to know about us and our work. Be sure to contact us so that we can help you find what you need.",
	"Our doors are built using the highest quality materials and the best joinery methods. Our customers have come to trust our quality over the 17 years we have been in business. We think you will too.",
	"We are also a supplier of a full line of weatherstripping products. We can close off those hard to fit openings to keep you warm and saving money on heating bills this winter"
);

var fontfaceArray = new Array(
	"Verdana",
	"Century Gothic",
	"MS Sans Serif",
	"Courier New"
);

var colorArray = new Array(
	"#BB5544",
	"#222222",
	"#882255",
	"#334411"
);

	 
var styleArray = new Array(
	"center",
	"right",
	"left",
	"center"
);
	 
var topArray = new Array(
	20,
	80,
	40
);

var leftArray = new Array(
	25,
	300,
	100
);


var textParts = 4; // number of items in text array
var textCount = 0; // running count of which text msg to use
var up = 1; // direction of fade

var to = 12;	// number of milliseconds used in setTimeout for each color step in fade
var parts = 100;
var count = 0;
var theCell = null; // pointer to table holding text

rotateTo = 2*(to * parts) + 8000;  // how long each rotation will last

function assembleText(pos) {
	theCell.innerHTML = styleHead + pos + ';">' + textArray[textCount] + '</font>';
}

function Color(red,green,blue) {
	this.red = red;
	this.green = green;
	this.blue = blue;
}

var	fromColor = new Color(0,0,0);
var	toColor = new Color(0,0,0);
var	thisColor = new Color(0,0,0);
var	incColor = new Color(0,0,0);

function colorToString(obj) {
	var c = ((obj.red <<16) | (obj.green<<8) | obj.blue);
	return c.toString(16);
}

// parse colors from colorSTR into colorOBJ
function parseColors(colorOBJ, colorSTR) {
	var colorINT = parseInt(colorSTR.substring(1,7), 16);
	colorOBJ.red = ((colorINT & 0xFF0000) >> 16);
	colorOBJ.green = ((colorINT & 0x00FF00) >> 8);
	colorOBJ.blue = (colorINT & 0x0000FF);
}

function setInc() {
	if(up==1) {
		incColor.red = (toColor.red - fromColor.red)/parts;
		incColor.green = (toColor.green - fromColor.green)/parts;
		incColor.blue = (toColor.blue - fromColor.blue)/parts;
	} else {
		incColor.red = (fromColor.red - toColor.red)/parts;
		incColor.green = (fromColor.green - toColor.green)/parts;
		incColor.blue = (fromColor.blue - toColor.blue)/parts;
	}
	//window.status = incColor.red;
}

function clearInc() {
	incColor.red = 0;
	incColor.green = 0;
	incColor.blue = 0;
}

function pauseText() {
	up = 0;
	setInc();
	setTimeout("fadeText()", to);
}

function fadeText() {
	thisColor.red += incColor.red;
	thisColor.green += incColor.green;
	thisColor.blue += incColor.blue;
	theCell.style.color = colorToString(thisColor);
	if (count++ < parts) {
		setTimeout("fadeText()", to);
	}
	else {
		count = 0;
		if(up==1) {
			setTimeout("pauseText()", 5000);  // pause to see text
		}
		//cleatTimeout();
	}
	//window.status=count;
}

function randomColor(color) {
	color.red = Math.random() * 255;
	color.green = Math.random() * 255;
	color.blue = Math.random() * 255;
}

function rotate() {
	assembleText(Math.max(Math.random()*200,30));
	//theCell.innerHTML = textArray[textCount];
	//textId.face = fontfaceArray[textCount];
	theCell.style.fontFamily = fontfaceArray[textCount];
	theCell.style.textAlign = styleArray[textCount];
	//theCell.style.top = Math.max(Math.random()*200,30);
	//theCell.style.left = Math.max(Math.random()*300,30);
	//theCell.style.top = topArray[textCount];
	//theCell.style.left = leftArray[textCount];
	thisColor.red = fromColor.red;
	thisColor.green = fromColor.green;
	thisColor.blue = fromColor.blue;
	//randomColor(toColor);
	parseColors(toColor, colorArray[textCount]);
	up = 1;
	setInc();
	fadeText();
	//window.status = topArray[textCount];
	//window.status=theCell.bgColor;
	//window.status = textCount;
	if (textCount++ == textParts-1) {
		textCount = 0;
	}
	setTimeout("rotate()", rotateTo);
}

function rotateText() {
	theCell = document.getElementById('theCell');
	theCell.style.backgroundColor = bColor;
	parseColors(fromColor, bColor);
	parseColors(thisColor, bColor);
	//alert(thisColor.red);
	rotate();
}

// photo stuff
var thePhoto = null;

var photoCount = 0; // running count of which photo msg to use
var photoTo = 7400;	// number of milliseconds used in setTimeout for each color step in fade

function rotateIt() {
   if (document.all){
      document.images.thePhoto.style.filter="blendTrans(duration=2)";
      document.images.thePhoto.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.thePhoto.filters.blendTrans.Apply();      
   }
	thePhoto.src = preLoad[photoCount].src;
   if (document.all){
      document.images.thePhoto.filters.blendTrans.Play();
   }
	if (photoCount++ == photoParts-1) {
		photoCount=0;
	}
	setTimeout("rotateIt()", photoTo);
}

function rotatePhoto() {
	thePhoto = document.getElementById('thePhoto');
	//alert(thePhoto.src);
	rotateIt();
}

-->
