/* image rollovers */

	buttons = new Array('ourcompany','structural','civil','traffic','facade','contactus', 'technology', 'awards', 'careers');
	buttonOff = new Array();
	buttonOn = new Array();

for(var i=0; i <= buttons.length-1; i++) {
	buttonOff[buttons[i]] = document.createElement("img");
	buttonOff[buttons[i]].src = "images/navigation-" + buttons[i] + ".gif";

	buttonOn[buttons[i]] = document.createElement("img");
	buttonOn[buttons[i]].src = "images/navigation-" + 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;
}

// 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";
	}

}


	// returns the current left offset of an object
	function getCurrentLeft(object) {
		return parseInt(document.getElementById(object).style.left);
	}
	
	// returns the width of an object
	function getWidth(object) {
		return parseInt(document.getElementById(object).style.width);
	}
	
	

	// slideshow
/** old manual slideshow **/
/*
	// lauch a window 90%
	function launchSlideShow(number) {
		var cat = parseInt(number);
		var ssWidth = 0.95 * screen.width;
		var ssHeight = 0.90 * screen.height;
		
		var ssLeft = (screen.width - ssWidth) / 2;
		var	ssTop = (screen.height - ssHeight) / 2 - 20;
		
		var ssAttributes = 'width=' + ssWidth + ', height=' + ssHeight + ',left='+ ssLeft+', top='+ ssTop +',resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no';
		var ssWindow = window.open('slideshow.htm?slideshowID=' + cat,'slideShowWindow', ssAttributes);
	}
*/

/** new flash based slideshow  **/

	// lauch a window 90%
	function launchSlideShow(galleryName) {
		var ssWidth = 0.95 * screen.width;
		var ssHeight = 0.90 * screen.height;
		
		var ssLeft = (screen.width - ssWidth) / 2;
		var	ssTop = (screen.height - ssHeight) / 2 - 20;
		
		var ssAttributes = 'width=' + ssWidth + ', height=' + ssHeight + ',left='+ ssLeft+', top='+ ssTop +',resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no';
		var ssWindow = window.open('gallery/'+ galleryName + '/index.html', 'slideShowWindow', ssAttributes);
	}

