function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		navHomeImg = newImage("../images/nav_home_on.gif");
		//mapListMenu_Venues = newImage("../images/mapListMenu_VenuesOn.png");
		preloadFlag = true;
	}
}


 if (document.layers){
      //Netscape 4 specific code
      pre = 'document.';
      post = '';
      post2 = '';
      var IEoffsets = 0;
   }
   if (document.getElementById){
      //Netscape 6 specific code
      pre = 'document.getElementById("';
      post = '").style';
      post2 = '")';
      var IEoffsets = 2;
   }
   if (document.all){
      //IE4+ specific code
      pre = 'document.all.';
      post = '.style';
      post2 = '';
      var IEoffsets = 5;
   }
  
   		function showLayer(lyr){
			eval(pre + lyr + post).display = 'block';
		}
		function hideLayer(lyr){
			eval(pre + lyr + post).display = 'none';
		}
		
		

var howtoArrState = 'closed';
var officialArrState = 'closed';
	
function toggleArrow(arrow){
	if(arrow == 'howToPlayArrow' && howtoArrState == 'closed'){
		howtoArrState = 'open';
		showLayer('howToPlayLyr');
		changeImages('howToPlayArrow', 'images/arrowOpen.png');
		changeImages('officialRules', 'images/subTitle_officialRules.png');
	} 
	else if(arrow == 'howToPlayArrow' && howtoArrState == 'open'){
		howtoArrState = 'closed';
		hideLayer('howToPlayLyr');
		changeImages('howToPlayArrow', 'images/arrowClosed.png');
		changeImages('officialRules', 'images/subTitle_officialRules_light.png');
	}
	else if(arrow == 'officialRulesArrow' && officialArrState == 'closed'){
		officialArrState = 'open';
		showLayer('officialRulesLyr');
		changeImages('officialRulesArrow', 'images/arrowOpen.png');
	}
	else if(arrow == 'officialRulesArrow' && officialArrState == 'open'){
		officialArrState = 'closed';
		hideLayer('officialRulesLyr');
		changeImages('officialRulesArrow', 'images/arrowClosed.png');
	}
}

var currentMapView = 'venues';

function toggleList(which){
	if(currentMapView == 'venues'){
		changeImages('mapListMenu_Venues', '../images/mapListMenu_VenuesOff.png');
		hideLayer('venuesList');
	} else if(currentMapView == 'artists'){
		changeImages('mapListMenu_Artists', '../images/mapListMenu_ArtistsOff.png');
		hideLayer('artistsList');
	} else if(currentMapView == 'directors'){
		changeImages('mapListMenu_Directors', '../images/mapListMenu_DirectorsOff.png');
		hideLayer('directorsList');
	}

	if(which == 'venues'){
		changeImages('mapListMenu_Venues', '../images/mapListMenu_VenuesOn.png');
		showLayer('venuesList');
		currentMapView = 'venues';
	} else if(which == 'artists'){
		changeImages('mapListMenu_Artists', '../images/mapListMenu_ArtistsOn.png');
		showLayer('artistsList');
		currentMapView = 'artists';
	} else if(which == 'directors'){
		changeImages('mapListMenu_Directors', '../images/mapListMenu_DirectorsOn.png');
		showLayer('directorsList');
		currentMapView = 'directors';
	}
}