/* image rollovers */

	buttons = new Array('ourcompany','structural','civil','traffic','facade','technology','careers','contactus');
	buttonOff = new Array();
	buttonOn = new Array();
	//small home images test
	buttonOffSmall = new Array();
	buttonOnSmall = new Array();

for(var i=0; i <= buttons.length-1; i++) {
	buttonOff[buttons[i]] = document.createElement("img");
	buttonOff[buttons[i]].src = "images/home-" + buttons[i] + ".gif";
	
	buttonOn[buttons[i]] = document.createElement("img");
	buttonOn[buttons[i]].src = "images/home-" + buttons[i] + "_on.gif";
	
	//small home images test
	buttonOffSmall[buttons[i]] = document.createElement("img");
	buttonOffSmall[buttons[i]].src = "images/smallhome-" + buttons[i] + ".gif";

	buttonOnSmall[buttons[i]] = document.createElement("img");
	buttonOnSmall[buttons[i]].src = "images/smallhome-" + buttons[i] + "_on.gif";
}

// functions to do the image swapping
function swapOn(image) {
		document[image].src = buttonOn[image].src;
}

function swapOff(image) {
		document[image].src = buttonOff[image].src;
}

//small home images test
function swapOnSmall(image) {
		document[image].src = buttonOnSmall[image].src;
}

function swapOffSmall(image) {
		document[image].src = buttonOffSmall[image].src;
}


// initialise buttons
function initButtons(currentSection,currentSubSection) {
 	if (document.images[currentSection]) {
		swapOn(currentSection);
		// rewrite the 'Off' state button to the 'On' version
		buttonOff[currentSection].src = buttonOn[currentSection].src
	}

	if (document.images[currentSubSection])	{
		swapOn(currentSubSection);
		// rewrite the 'Off' state button to the 'On' version
		buttonOff[currentSubSection].src = buttonOn[currentSubSection].src
	}
}

/* screen shot popup */

function showScreen(image) {
	window.open('show_screen.htm?image=' + image,'screenShots','width=700,height=500');
}

/* checks to see if 'other' was selected in the quote form */

function checkOther(form,textObject,formObject) {

	var value = form.options[form.selectedIndex].value;
	var divObject = document.getElementById(textObject);
	var inputObject = document.getElementById(formObject);

	if (value == "other") {
		inputObject.disabled = false;
		divObject.style.color = "#000000";
		inputObject.style.backgroundColor= "#FFF6F6";
	} else {
		inputObject.style.backgroundColor= "#EEEEEE";
		inputObject.disabled = true;
		divObject.style.color = "#CCCCCC";
	}

}