function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.display = document.layers ? (iState ? "show" : "hide") :
   (iState ? "block" : "none");	
}

// CHANGE LINK ELEMENT

function linkOver(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#f30266';
	nodeObj.style.color = '#ffffff';
	}
	
function linkOut(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#D5E4E2';
	nodeObj.style.color = '#2F3C40';
	}

function linkOver2(linkID) //top rollovers in gallery
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#73A79F';
	nodeObj.style.color = '#ffffff';
	}
	
function linkOut2(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#D5E4E2';
	nodeObj.style.color = '#2F3C40';
	}

function linkOver3(linkID) //bottom wide rollover in gallery
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#FF8C13';
	nodeObj.style.color = '#ffffff';
	}
	
function linkOut3(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#FBB56B';
	nodeObj.style.color = '#2F3C40';
	}

function linkOver4(linkID) //rollover in common
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#F2CC05';
	nodeObj.style.color = '#2F3C40';
	}
	
function linkOut4(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#D5E4E2';
	nodeObj.style.color = '#2F3C40';
	}
	
function linkOver5(linkID) //rollover in gallerymenu2
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#FF8C13';
	nodeObj.style.color = '#2F3C40';
	}
	
function linkOut5(linkID)
	{
	var nodeObj = document.getElementById(linkID);
	nodeObj.style.backgroundColor = '#D5E4E2';
	nodeObj.style.color = '#2F3C40';
	}

/*********** Use this as guide to call functions with event handlers in html
NEED TO SET id in A of H2, DIV of the IMG, and DIV of P (text)
Follow ONOUSEOVER and MOUSEOUT usage as on courtauld_institute-aw.html

function nameOn()
	{
	toggleBox('id of div with p',1); // visible
	toggleBox('id of div with img',0); // hidden //
	linkOver('id of link'); // highlighted
	}

function nameOff()
	{
	toggleBox('id of div with p',0);
	toggleBox('id of div with img',1);
	linkOut('id of link');
	}
	
************/

// FUNCTIONS TO CALL

/* homepage */
function toggleArtOn()
	{
	toggleBox('rolloverArt',1);
	toggleBox('rolloverArtImg',0);
	}

function toggleArtOff()
	{
	toggleBox('rolloverArt',0);
	toggleBox('rolloverArtImg',1);
	}
	
function toggleGalOn()
	{
	toggleBox('rolloverGal',1);
	toggleBox('rolloverGalImg',0);
	}

function toggleGalOff()
	{
	toggleBox('rolloverGal',0);
	toggleBox('rolloverGalImg',1);
	}


/* Institute page */
function toggleDegreeOn()
	{
	toggleBox('rolloverDegree',1); /* text div on */
	toggleBox('rolloverDegreeImg',0); /* img div off */
	linkOver('linkDegree'); /* link hover on */
	}

function toggleDegreeOff()
	{
	toggleBox('rolloverDegree',0);
	toggleBox('rolloverDegreeImg',1);
	linkOut('linkDegree');
	}
	
function toggleResearchOn()
	{
	toggleBox('rolloverResearch',1);
	toggleBox('rolloverResearchImg',0);
	linkOver('linkResearch');
	}
	
function toggleResearchOff()
	{
	toggleBox('rolloverResearch',0);
	toggleBox('rolloverResearchImg',1);
	linkOut('linkResearch');
	}
	
function togglePublicOn()
	{
	toggleBox('rolloverPublic',1);
	toggleBox('rolloverPublicImg',0);
	linkOver('linkPublic');
	}
	
function togglePublicOff()
	{
	toggleBox('rolloverPublic',0);
	toggleBox('rolloverPublicImg',1);
	linkOut('linkPublic');
	}
	
function toggleAlumniOn()
	{
	toggleBox('rolloverAlumni',1);
	toggleBox('rolloverAlumniImg',0);
	linkOver('linkAlumni');
	}
	
function toggleAlumniOff()
	{
	toggleBox('rolloverAlumni',0);
	toggleBox('rolloverAlumniImg',1);
	linkOut('linkAlumni');
	}


/* Gallery page */
function toggleCollectionsOn()
	{
	toggleBox('rolloverCollections',1); /* text div on */
	toggleBox('rolloverCollectionsImg',0); /* img div off */
	linkOver2('linkCollections'); /* link hover on */
	}

function toggleCollectionsOff()
	{
	toggleBox('rolloverCollections',0);
	toggleBox('rolloverCollectionsImg',1);
	linkOut2('linkCollections');
	}
	
function toggleVisitorInfoOn()
	{
	toggleBox('rolloverVisitorInfo',1);
	toggleBox('rolloverVisitorInfoImg',0);
	linkOver2('linkVisitorInfo');
	}
	
function toggleVisitorInfoOff()
	{
	toggleBox('rolloverVisitorInfo',0);
	toggleBox('rolloverVisitorInfoImg',1);
	linkOut2('linkVisitorInfo');
	}
	
function toggleCurrentExhibitionsOn()
	{
	toggleBox('rolloverCurrentExhibitions',1);
	toggleBox('rolloverCurrentExhibitionsImg',0);
	linkOver3('linkCurrentExhibitions');
	}
	
function toggleCurrentExhibitionsOff()
	{
	toggleBox('rolloverCurrentExhibitions',0);
	toggleBox('rolloverCurrentExhibitionsImg',1);
	linkOut3('linkCurrentExhibitions');
	}


/* Common page */
function toggleMenuitem01On()
	{
	toggleBox('rolloverMenuitem01',1); /* text div on */
	toggleBox('rolloverMenuitem01Img',0); /* img div off */
	linkOver4('linkMenuitem01'); /* link hover on */
	}

function toggleMenuitem01Off()
	{
	toggleBox('rolloverMenuitem01',0);
	toggleBox('rolloverMenuitem01',1);
	linkOut4('linkMenuitem01');
	}
	
function toggleMenuitem02On()
	{
	toggleBox('rolloverMenuitem02',1);
	toggleBox('rolloverMenuitem02Img',0);
	linkOver4('linkMenuitem02');
	}
	
function toggleMenuitem02Off()
	{
	toggleBox('rolloverMenuitem02',0);
	toggleBox('rolloverMenuitem02Img',1);
	linkOut4('linkMenuitem02');
	}
	
function toggleHermitageOn()
	{
	toggleBox('rolloverHermitage',1);
	toggleBox('rolloverHermitageImg',0);
	linkOver4('linkHermitage');
	}
	
function toggleHermitageOff()
	{
	toggleBox('rolloverHermitage',0);
	toggleBox('rolloverHermitageImg',1);
	linkOut4('linkHermitage');
	}
	
function toggleEastwingOn()
	{
	toggleBox('rolloverEastwing',1);
	toggleBox('rolloverEastwingImg',0);
	linkOver4('linkEastwing');
	}
	
function toggleEastwingOff()
	{
	toggleBox('rolloverEastwing',0);
	toggleBox('rolloverEastwingImg',1);
	linkOut4('linkEastwing');
	}
	
/* Gallery menu 2page */
function toggleForthcomingOn()
	{
	toggleBox('rolloverForthcoming',1); /* text div on */
	toggleBox('rolloverForthcomingImg',0); /* img div off */
	linkOver5('linkForthcoming'); /* link hover on */
	}

function toggleForthcomingOff()
	{
	toggleBox('rolloverForthcoming',0);
	toggleBox('rolloverForthcomingImg',1);
	linkOut5('linkForthcoming');
	}
	
function toggleArchiveOn()
	{
	toggleBox('rolloverArchive',1);
	toggleBox('rolloverArchiveImg',0);
	linkOver5('linkArchive');
	}
	
function toggleArchiveOff()
	{
	toggleBox('rolloverArchive',0);
	toggleBox('rolloverArchiveImg',1);
	linkOut5('linkArchive');
	}
	
function toggleHermitageOn()
	{
	toggleBox('rolloverHermitage',1);
	toggleBox('rolloverHermitageImg',0);
	linkOver5('linkHermitage');
	}
	
function toggleHermitageOff()
	{
	toggleBox('rolloverHermitage',0);
	toggleBox('rolloverHermitageImg',1);
	linkOut5('linkHermitage');
	}
	
function toggleEastwingOn()
	{
	toggleBox('rolloverEastwing',1);
	toggleBox('rolloverEastwingImg',0);
	linkOver5('linkEastwing');
	}
	
function toggleEastwingOff()
	{
	toggleBox('rolloverEastwing',0);
	toggleBox('rolloverEastwingImg',1);
	linkOut5('linkEastwing');
	}


/*************************************************************
	* Window Onload Manager (WOM) v1.0
	* Author: Justin Barlow - www.netlobo.com
	*
	* Description:
	* The WOM library of functions allows you to easily call
	* multiple javascript functions when your page loads.
	*
	* Usage:
	* Add functions to WOM using the womAdd() function. Pass the
	* name of your functions (with or without parameters) into
	* womAdd(). Then call womOn() like this:
	*     womAdd('hideDiv()');
	*     womAdd('changeBg("menuopts","#CCCCCC")');
	*     womOn();
	* WOM will now run when your page loads and run all of the
	* functions you have added using womAdd()
	*************************************************************/
	/*************************************************************
	* The womOn() function will set the window.onload function to
	* be womGo() which will run all of your window.onload
	* functions.
	*************************************************************/
	function womOn(){
	  window.onload = womGo;
	}
	/*************************************************************
	* The womGo() function loops through the woms array and
	* runs each function in the array.
	*************************************************************/
	function womGo(){
	  for(var i = 0;i < woms.length;i++)
		eval(woms[i]);
	}
	/*************************************************************
	* The womAdd() function will add another function to the woms
	* array to be run when the page loads.
	*************************************************************/
	function womAdd(func){
	  woms[woms.length] = func;
	}
	/*************************************************************
	* The woms array holds all of the functions you wish to run
	* when the page loads.
	*************************************************************/
	var woms = new Array();