// JavaScript Document controlling Navigation Menu behaviour

//menu highlight functions

function hilight(id)
	{
	newImage = "url(images/blkgrdtop.jpg)";
	if (document.getElementById(id).innerHTML != "") {
		document.getElementById(id).style.backgroundColor = "#000"; }
	}

function lowlight(id)
	{
	document.getElementById(id).style.backgroundColor = "transparent";
	}
	
//gallery magnifying glasses
function showMagnify(id)
	{
	document.getElementById(id).style.visibility = "visible";
	}
function hideMagnify(id)
	{
	document.getElementById(id).style.visibility = "hidden";
	}

//slide timer functions

function startSlideTime(timeVar)
	{
	timeVar=setTimeout("slideNavOut()",1500);
	return timeVar;
	}
function clearSlideTime(timeVar)
	{
	clearTimeout(timeVar);
	return timeVar;
	}
function slideNavOut(slider)
	{
	var dropMenu = new Fx.Slide('bar2');
	dropMenu.slideOut();
	}	
	
//scripts to change menu options 

function changeContent(num)
	{
	
//	alert("started");
	var names  = new Array();
	//to disable a menu segment, set the caption of the first slot to blank - 7 slots available on each menu.
	//About Us
	names[0] = new Array('Home',			'index.php',
						 'History',			'page.php?page=history',
						 'Sitemap',			'page.php?page=sitemap',
						 'Contact', 		'page.php?page=contact');
	//Portfolio
	names[1] = new Array('Commercial Portfolio', 	'gallery.php?album=main/Portfolio',
						 'Sherlock Holmes', 		'gallery.php?album=main/SherlockHolmes',
						 'Other Theatre',			'gallery.php?album=main/OtherTheatre',
						 'Keith\'s Favourites', 	'gallery.php?album=main/KeithsFavourites',
						 'Recent Local History', 	'gallery.php?album=main/RLH',
						 'Purchasing Prints', 		'page.php?page=portprices');
						 
	//Surrey Villages
	names[2] = new Array('Archives Home',			'gallery.php?album=archive',
						 'Walter Rose',		 		'gallery.php?album=archive/WalterRose',
						 'John Chaplin', 			'gallery.php?album=archive/JohnChaplin',
						 'Surrey Village Views', 	'gallery.php?album=archive/SurreyVillageViews',
						 'Betchworth', 				'gallery.php?album=archive/Betchworth',
						 'Search/Index',			'page.php?page=search',
						 'Purchasing Prints',		'page.php?page=archiveprices');
	// Services
	names[3] = new Array('Commercial Photography', 	'page.php?page=commercial');

	//Other
	names[4] = new Array('Betchworth Within Living Memory', 'page.php?page=bwlm',
						 'Links of Interest', 		'page.php?page=links',
  						 'About This Site...',		'page.php?page=aboutsite');
	//As yet unused
	names[5] = new Array('', 		    'admin/index.php',
						 'Test Album', 		'gallery.php?album=test',
						 'menu5.3', 		'#',
						 'menu5.3', 		'#',
						 '',				'#');
//	alert("defined");
	
	var x = document.getElementById('secondmenu').rows;
	var y = x[0].cells;
//	alert("objectified")

if (names[num][0] != "") {
	for (i=0; i<=6; i++)
		{
	
		if (names[num][(i*2)]!=undefined)
			{
			y[i].innerHTML = '<a href="' + names[num][(i*2)+1] + '">' + names[num][(i*2)] + '</a>';
			}
		else
			{
			y[i].innerHTML = "";
			}
			
		} }
//	alert("arrayed");
	}