﻿/**
 * This sets up the mouseovers in the site-wide left-hand navigation.
 * All the possibilities are in one image, positioned via CSS on mouseover
 * so there's no preloading.  The JavaScript is only necessary because of the
 * angled text which requires an image map.  -- Thomas
 */
function setUpVenueRolls(container, prefix, current) {
	function swap(venue) {
		var s = container.style;
		s.marginLeft = -venues[venue]+'px';
		s.paddingLeft = venues[venue]+'px';
	}
	var div,
		divs = {},
		suffix,
		venues = {
			'main': 0,
			'country-store': 113,
			'taste-tent': 226,
			'arts-pavilion': 339,
			'music-stage': 452,
			'tabasco-tent': 565,
			'social-hall': 678,
			'history-tent': 791,
			'info-booth': 904,
			'international': 1017
		};
	if (typeof container == 'string') {
		container = document.getElementById(container);
	}
	for (suffix in venues) {
		if (suffix != 'main') {
			div = document.getElementById(prefix + suffix);
			(function(suffix) {
				div.onmouseover = function() {
					swap(suffix);
				};
				div.onmouseout = function() {
					swap(current);
				};
			})(suffix);
		}
	}
	swap(current);
}
