function preLoadImages()
{
	var t = '<layer top="-100" left="0" visibility="hide"><div style="position:absolute; top:-100px; left:0px; visibility:hidden">';

	for (i = 0; i < arguments.length; i++)
		t += '<img src="' + arguments[i] + '" height="10" width="10">';

	t += '</div></layer>';

	document.write(t);
}

function show(id)
{
	if (document.getElementById)
		document.getElementById(id).style.display = "block";
	else if (document.all)
		document.all[id].style.display = "block";
	else if (document.layers)
		document.layers[id].style.display = "block";
}

function hide(id)
{
	if (document.getElementById)
		document.getElementById(id).style.display = "none";
	else if (document.all)
		document.all[id].style.display = "none";
	else if (document.layers)
		document.layers[id].style.display = "none";
}

function swapImage(imgN,imgU,caption)
{
	if (document.images)
	{
		image = document.images[imgN];
		image.src = imgU;
	}

    /* IE supports innerText, which Firefox does not, supporting textContent instead, so we need to check if they're both to work. Btw, W3C specifies textContent. */
//    var hasInnerText = document.getElementsByTagName("body")[0].innerText != undefined ? true : false;

//    if (hasInnerText)
//      document.getElementById("caption").innerText = caption;
      document.getElementById("caption").innerHTML = caption;
//    else
//      document.getElementById("caption").textContent = caption;
}

function showInfo(info)
{
	swapImage('large', 'images/' + info + '.jpg'); 
	hide(currentInfo); 
	currentInfo = 'info-' + info; 
	show(currentInfo); 
}

function setActiveStyleSheet(title) 
{
	var i, a, main;
	for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) 
	{
		if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) 
		{
	       a.disabled = true;
		   if(a.getAttribute("title") == title)
			   a.disabled = false;
	    }
	}
}

function hide_email(address)
{
	var args = hide_email.arguments;

	document.write('<a class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;');
	document.write(args[0]);
	document.write('&#64;'); /* at */
	document.write(args[1]);
	document.write('&#46;'); /* dot */
	document.write(args[2]);
	document.write('">');
	document.write(args[0]);
	document.write('&#64;');
	document.write(args[1]);
	document.write('&#46;');
	document.write(args[2]);
	document.write('</a>');
}