function imgMouseOverEvents(outString, overString, selector) {
	$$(selector).each(function(image) {
		image = $(image);
		if (image.hasClass('active'))
			{
			// set active
			if ($type(image.src)) image.src = image.src.replace(outString, overString);
			}
			
		if ($type(image.src)) {
			if (image.src.indexOf(outString) > 0) {
				image.addEvent('mouseenter',function(){
					image.src = image.src.replace(outString, overString);
				}).addEvent('mouseleave', function(){
					image.src = image.src.replace(overString, outString);
				});
			}
		}
	});
};
window.addEvent('domready', function(){imgMouseOverEvents('_off', '_on', 'div#atminimap img');});

var currentopen = 'none';
var currenthidden = 'none';

function showmapele(showthis) {
	if(showthis == 'vlb' || showthis == 'all') {
		$('at_map_vlb').fade('in');
	} else {
		$('at_map_vlb').fade('0.4');
	}
	if(showthis == 'trl' || showthis == 'all') {
		$('at_map_trl').fade('in');
	} else {
		$('at_map_trl').fade('0.4');
	}
	if(showthis == 'ktn' || showthis == 'all') {
		$('at_map_ktn').fade('in');
	} else {
		$('at_map_ktn').fade('0.4');
	}
	if(showthis == 'stm' || showthis == 'all') {
		$('at_map_stm').fade('in');
	} else {
		$('at_map_stm').fade('0.4');
	}
	if(showthis == 'slb' || showthis == 'all') {
		$('at_map_slb').fade('in');
	} else {
		$('at_map_slb').fade('0.4');
	}
	if(showthis == 'ooe' || showthis == 'all') {
		$('at_map_ooe').fade('in');
	} else {
		$('at_map_ooe').fade('0.4');
	}
	if(showthis == 'noe' || showthis == 'all') {
		$('at_map_noe').fade('in');
	} else {
		$('at_map_noe').fade('0.4');
	}
	if(showthis == 'wie' || showthis == 'all') {
		$('at_map_wie').fade('in');
	} else {
		$('at_map_wie').fade('0.4');
	}
	if(showthis == 'blg' || showthis == 'all') {
		$('at_map_blg').fade('in');
	} else {
		$('at_map_blg').fade('0.4');
	}
};

function Histuff() {
	var stateVar = "nothin'";
	this.addtohistory = function(newVal) {
		unFocus.History.addHistory(newVal);
	};
	this.historyListener = function(historyHash) {
		stateVar = historyHash;
		if(stateVar) {
			disableme = 'pr_'+stateVar;
			showme = 'fl_'+stateVar;
			$(disableme).setStyle('display', 'none');
			if(currentopen != 'none') {
				$(currentopen).setStyle('display', 'none');
				$(currenthidden).setStyle('display', 'block');
			}
			$(showme).setStyle('display', 'block');
			currentopen = showme;
			currenthidden = disableme;
		} else {
			if(currentopen != 'none') {
				$(currentopen).setStyle('display', 'none');
				$(currenthidden).setStyle('display', 'block');
			}
		}
	};
	unFocus.History.addEventListener('historyChange', this.historyListener);
	this.historyListener(unFocus.History.getCurrent());
};

window.addEvent('domready', function() {

pagecontrol = new Histuff();

if($('MAP_out1') || $('MAP_out2'))
	{
		$('MAP_out1').addEvent('mouseenter', function(event) {
		 		showmapele('all');
	 	 });
	 	 $('MAP_out2').addEvent('mouseenter', function(event) {
		 		showmapele('all');
	 	 });
	}
if($('MAP_vlb'))
	{
		 $('MAP_vlb').addEvent('mouseenter', function(event) {
		 		showmapele('vlb');
	 	 });
 	}
if($('MAP_trl1') || $('MAP_trl2'))
	{
		 $('MAP_trl1').addEvent('mouseenter', function(event) {
		 		showmapele('trl');
	 	 });
	 	 $('MAP_trl2').addEvent('mouseenter', function(event) {
		 		showmapele('trl');
	 	 });
 	}
if($('MAP_ktn'))
	{
		 $('MAP_ktn').addEvent('mouseenter', function(event) {
		 		showmapele('ktn');
	 	 });
 	}
if($('MAP_stm1') || $('MAP_stm2') || $('MAP_stm3'))
	{
		 $('MAP_stm1').addEvent('mouseenter', function(event) {
		 		showmapele('stm');
	 	 });
	 	 $('MAP_stm2').addEvent('mouseenter', function(event) {
		 		showmapele('stm');
	 	 });
	 	 $('MAP_stm3').addEvent('mouseenter', function(event) {
		 		showmapele('stm');
	 	 });
 	}
if($('MAP_slb'))
	{
		 $('MAP_slb').addEvent('mouseenter', function(event) {
		 		showmapele('slb');
	 	 });
 	}
if($('MAP_ooe'))
	{
		 $('MAP_ooe').addEvent('mouseenter', function(event) {
		 		showmapele('ooe');
	 	 });
 	}
if($('MAP_noe'))
	{
		 $('MAP_noe').addEvent('mouseenter', function(event) {
		 		showmapele('noe');
	 	 });
 	}
	
if($('MAP_wie'))
	{
		 $('MAP_wie').addEvent('mouseenter', function(event) {
		 		showmapele('wie');
	 	 });
 	}
if($('MAP_blg'))
	{
		 $('MAP_blg').addEvent('mouseenter', function(event) {
		 		showmapele('blg');
	 	 });
 	}


 	
}); // end DOMREADY


