function preloadGifs(sData) 
/* sData = "img1,img2,img3" no extension */
{
	var Data = sData.split(",");
	var iMax = Data.length;
	var Gifs = new Array(iMax);
	for(var i=0;i<iMax;i++)
	{
		if(Data[i]!=null)
		{
			Gifs[i]=new Image();
			Gifs[i].src="images/"+Data[i]+".gif";
		}
	}
}



function htmlNAV(index)
/* 

Changes inner HTML of list navigation <ul>, so that we can run an IE-specific script that won't make the chrome buttons flicker when mouse hovers.
This is necessary because scriptless CSS-navigation on IE 6/7 is embarrasingly buggy
HG/12/12/06
HG/20/12/06 (changing navigation)

usage: htmlNAV(1 to 4)

Home = 1
Location = 2
About  = 3
Contact = 4

PS: If this starts becoming slow on IE, change everything to one big array of innerHTML

*/
{
/* Not using DOM3 .. as it's too slow on IE */

	var iHOME_PAGE = 1;
	var iCONTACT = 4;

	var sHTML = "";
	for(var i=1;i<=4;i++)
	{	
		if(i==index)
		{
			sHTML += "<li><strong>" + sLinks[i] + "</strong></li>"; /* Non moving button on pages */
		}
		else
		{
			sHTML += "<li class='"+sLinks[i].toLowerCase()+"'><img src='images/shadow.gif' class='shadow'><a class='push' title='" + sTitles[i] + "' href='" + (i==iHOME_PAGE?'index':sLinks[i].toLowerCase()) + (i==iCONTACT?'.asp':'.htm') + "' onmouseover='p(this);on(" + i +")' onfocus='p(this);on(" + i + ")' onmouseout='r(this);off(" + i + ")' onblur='r(this);on(" + i + ")'>";
			sHTML += "<img class='chrome' src='images/chrome.gif'><img id='LED" + i + "' class='LED' src='images/off.gif'>";
			sHTML += "<span class='text'>" + sLinks[i] + "</span></a></li>";
		}
/*

ie for i == 2

<li>
	<img src='images/shadow.gif' class='shadow'>

	<a class='push' title='Directions to Music Tutor' 
				href='location.htm' 
				onmouseover='p(this);on(3)' 
				onfocus='p(this);on(3)' 
				onmouseout='r(this);off(3)' 
				onblur='r(this);on(3)'>

		<img class='chrome' src='images/chrome.gif'>
		
		<img id='LED3' class='LED' src='images/off.gif'>

		<span class='text'>Location</span>

	</a>
</li>

its IE: code left uncompliant, no alt where alt="" ; hopefully it should speed up and not present a problem.
*/
	}
	document.all.ulNav.innerHTML = sHTML;

}

function p(obj)  /* pushes button */
{
	obj.style.top = "3px";
}

function r(obj)  /* releases button */
{
	obj.style.top = 0;
}

function on(index)  /* switches LED on */
{
	document.images['LED'+index].src = "images/on.gif";
} 

function off(index)  /* switches LED off */
{
	document.images['LED'+index].src = "images/off.gif";
}


