var map = new Object();
map.divs = new Array();

map.assign_clicks = function ()
{
	map.div = document.getElementById(map.id)
	
	var list_items = map.div.getElementsByTagName('li');
	for (var i = 0; i <= list_items.length; i++)
	{
		if (list_items[i])
		{
			var li_id = list_items[i].id;
			var div_id = list_items[i].id.replace(eval('/'+map.from_prefix+'/'), map.to_prefix);
			
			if (list_items[i].className == "current")
			{
				map.current = div_id;
			}
			var a_href = list_items[i].getElementsByTagName('a');
			a_href[0].href = 'javascript:map.show(\'' + eval('div_id') + '\')';
		}
	}
}

map.show = function (id)
{
	document.getElementById(map.current.replace(eval('/'+map.to_prefix+'/'), map.from_prefix)).className = '';	
	document.getElementById(map.current).style.display = 'none';
	map.current = id;
	document.getElementById(id.replace(eval('/'+map.to_prefix+'/'), map.from_prefix)).className = 'current';		
	document.getElementById(id).style.display = 'block';
}

// map.load param
// List-item's and Div's must have the same suffix after the prefix to match up, i.e. 'map_test' and 'campus_test'
// [0] = id of unordered list
// [1] = prefix of list-item id
// [2] = prefix of div id
map.load = function (id, from_prefix, to_prefix)
{	
	map.id = id;
	map.from_prefix = from_prefix;
	map.to_prefix = to_prefix;
	window.onload = map.assign_clicks
}


