/* Must be the name of the rollover GIF without the path, extension or '_rollover' 
   and it has to be in the images directory */
var linkIds = [
	"skull",
	"members",
	"song_audio",
	"pictures",
	"calendar",
	"booking",
	"mailing_list",
	"discussion",
	"confidential",
	"links"
];

/* must be in the same order as linkIds */
var hrefs = [
	"index.html",
	"members.html",
	"songs_and_audio.html",
	"photos.html",
	"calendar.html",
	"booking.html",
	"tsen_email.html",
	"wwwboard.html",
	"confidential.html",
	"links.html"
];

function preloadImages(skull_color)
{ //v3.0
  var d=document;
  if(d.images)
  {
  	if(!d.preloadArray)
  	{
  		d.preloadArray=new Array();
  	}
    var i,j=d.preloadArray.length,a=linkIds;
    for(i=0; i<a.length; i++)
    {
    	if (a[i].indexOf("#")!=0)
    	{
    		d.preloadArray[j]=new Image;
    		var name=a[i];
    		if(i == 0)
    		{
    			// for skull only
    			name += '_' + skull_color;
    		}
    		d.preloadArray[j++].src= 'images/' + name + '_rollover.gif';
    	}
    }
  }
}

/* name must be the image file name without the path, for example, joshua.gif. It must be
   in the images directory */
function preloadImage(name)
{ //v3.0
  var d=document;
  if(d.images)
  {
  	if(!d.preloadArray)
  	{
  		d.preloadArray=new Array();
  	}
  	var iname = d.preloadArray.length;
		d.preloadArray[iname]=new Image;
		d.preloadArray[iname].src= 'images/' + name;
  }
}

function tsen_nav(current, skull_color)
{
	var menu_name = 'menu' + '_' + skull_color;
	document.write('<div id="' + menu_name + '" class="menu">');

	for (var i=0; i<linkIds.length; i++)
	{
		var linkId = linkIds[i];
		if(linkId == current)
		{
			document.write('<img id=' + linkId + ' src="images/1x1_transparent.gif">');
		}
		else
		{
			var classId = linkId;
			if(i == 0)
			{
				// for skull only
				linkId += '_' + skull_color;
			}
			document.write('<a id=' + linkId + ' class=' + classId + ' href="' + hrefs[i] + '"></a>');
		}
  }
	document.write('</div>');
}

