
function preload(which, setting)
{
	theImage = new Image();
	theImage.src = buildPath(which, setting);
	return(theImage);
}

function buildPath(which, setting)
{
	path = "images/" + which + (setting==null?"":"_"+setting) + ".gif";
	//alert(path);
	return(path);
}

function setHeading(which)
{
	if(document.images["heading"])
		document.images["heading"].src = "images/" + which + ".gif";
}

function setMenu(which)
{
	parent.left.location.href="navbar.htm?" + which;
}

function turnAllOff()
{
	turnOff('home');
	turnOff('concept');
	turnOff('model');
	turnOff('links');
	turnOff('contact');

}

function setSelButton(which)
{
	turnAllOff();
	if(which != "" && document.images[which])
		setSel(which);
	setHeading(which);
}

function isSel(which)
{
	if(document.images[which] &&
	   document.images[which].src &&
	   document.images[which].src.indexOf("_sel") == -1)
		return false;
	else
		return true;	
}


function turnOn(which)
{
	if(isSel(which))
		return;
	if(document.images[which])
		document.images[which].src = "images/" + which + "_on.gif";	
}
function turnOff(which)
{
	if(isSel(which))
		return;
	if(document.images[which])
		document.images[which].src = "images/" + which + "_off.gif";
}
function setSel(which)
{
	if(document.images[which])
		document.images[which].src = "images/" + which + "_sel.gif";
}


