function showMenu() {
	document.getElementById("submenu").style.display = "block";
}

function hideMenu() {
	document.getElementById("submenu").style.display = "none";
}

function swapImage(imageid,divid) {
	document[divid].src = theArray[imageid];
	//document.getElementById("thecopy").innerHTML = theArray2[imageid];
	currentlySelectedSub = imageid;
	theID = "button"+imageid;
	numberOfButtons = arraySize;
	for (x=0;x<numberOfButtons;x++) {
	  switchoffID = "button"+x;	
	  document.getElementById(switchoffID).src = "../images/rest.png";
	}
// now switch on relevant button
document.getElementById(theID).src = "../images/highlight.png";
	
}

function updateContent(id) {
currentlySelected = id;	
theID = "top"+id;
// switch off all buttons before switching one on
for (x=0;x<5;x++) {
	switchoffID = "top"+x;	
	document.getElementById(switchoffID).src = "../images/rest.png";
}
// now switch on relevant button
document.getElementById(theID).src = "../images/highlight.png";

// now the AJAX bit
theFilename = "portfolio"+id+"_ajax.html";
var updater = new Ajax.Updater('thecontent',theFilename, { evalScripts: 'true' });
}

function selectButtonsOver(id) {
	theID = "top"+id;
	if (currentlySelected == id) {
		document.getElementById(theID).src = "../images/highlight.png";
	} else {
		document.getElementById(theID).src = "../images/highlight.png";
	}
}

function selectButtonsOut(id) {
	theID = "top"+id;
	if (currentlySelected == id) {
		document.getElementById(theID).src = "../images/highlight.png";
	} else {
		document.getElementById(theID).src = "../images/rest.png";
	}
}


function portfolioButtonsOver(id) {
	theID = "button"+id;
	if (currentlySelectedSub == id) {
		document.getElementById(theID).src = "../images/highlight.png";
	} else {
		document.getElementById(theID).src = "../images/highlight.png";
	}
}

function portfolioButtonsOut(id) {
	theID = "button"+id;
	if (currentlySelectedSub == id) {
		document.getElementById(theID).src = "../images/highlight.png";
	} else {
		document.getElementById(theID).src = "../images/rest.png";
	}
}

