var currentFrontElement = null;
var previousOpacity = null;
var arrImages = new Array(2);
var currentImageIndex = -1;

arrImages[0] = "./images/laptop.png";
arrImages[1] = "./images/networkedpcs.jpg";
arrImages[2] = "./images/consult.png";

for (i=0; i < arrImages.length; i++) {
  var preload = new Image();
  preload.src = arrImages[i];
}

/*function bringToFront(aDiv)	{
	if (currentFrontElement){
		currentFrontElement.style.zIndex="-1";
	}
	aDiv.style.zIndex="1";
	currentFrontElement = aDiv;
}
function sendToBack(aDiv)	{
	if (currentFrontElement){
		currentFrontElement = null;
	}
	aDiv.style.zIndex="-1";
}
function hide(aDiv)	{
	previousOpacity = aDiv.style.opacity;
	aDiv.style.opacity = "0.0";
	currentFrontElement = aDiv;
}
function restore(aDiv)	{
	currentFrontElement.style.opacity = previousOpacity;
}*/
function highlight(aDiv)	{
	previousOpacity = aDiv.style.opacity;
	if (!previousOpacity) {
		previousOpacity = 0.4;
	}
	//aDiv.style.opacity = "1.0";
	changeOpacOfElem(1.0, aDiv);
	currentFrontElement = aDiv;
}
function restore(aDiv)	{
	//currentFrontElement.style.opacity = previousOpacity;
	changeOpacOfElem(previousOpacity, currentFrontElement);
}
function swapimage(imgIndex) {
	if (imgIndex == currentImageIndex ) return;
	var elem = document.getElementById("serviceimage");
	elem.style.visibility = "visible";
	if (imgIndex < 0){
		elem.src = null;
		elem.width = 400;
		elem.height = 300;
		changeOpacOfElem(0.0, elem);
		//opacity('serviceimage', 0.2, 0, 200)
	} else {
		elem.src = arrImages[imgIndex];
		changeOpacOfElem(0.4, elem);
		//opacity('serviceimage', 0, 0.4, 200)
	}
	currentImageIndex = imgIndex;
}

function showSliceText(index){	// <<<< check if this is used
	if(!document.images) return;
	test
}
