var image_list = new Array();
init_rollover("nav_about");
init_rollover("nav_blog");
//init_rollover("nav_buy_sell");
init_rollover("nav_contact");
init_rollover("nav_search");
init_rollover("nav_home");
init_rollover("nav_santa_barbara");

// Loads the normal and rollover images into the image_list array.  normal_path and over_path are optional.
// If not given, then the id is used for the filename and "_over" is appended for the rollover image.
function init_rollover(id, normal_path, over_path)
{
	if ( !image_list[id] )
	{
		image_list[id] = new Array();

		image_list[id]['normal'] = new Image();
		if ( normal_path !== undefined ) image_list[id]['normal'].src = normal_path;
		else image_list[id]['normal'].src = "/images/"+id+".gif";

		image_list[id]['over'] = new Image();
		if ( over_path !== undefined ) image_list[id]['over'].src = over_path;
		else image_list[id]['over'].src = "/images/"+id+"_over.gif";
	}
}

function over(id)
{
	if ( document.getElementById )
	{
		var elem = document.getElementById(id);
		if ( elem && image_list[id] )
		{
			elem.src = image_list[id]['over'].src;
		}
	}
}

function out(id)
{
	if ( document.getElementById )
	{
		var elem = document.getElementById(id);
		if ( elem && image_list[id] )
		{
			elem.src = image_list[id]['normal'].src;
		}
	}
}
