﻿// JScript File

var imgMap;

function init(){
	imgMap = document.getElementById("imgMap");
	
}

function setMap(mapName, regionId){
	selectedMap = mapName;
	updateLstRegions(regionId);
}

function changeMap(mapName, regionId){
	if(mapName == undefined){
		mapName = selectedMap;
	}
	
	imgMap.src = "/images/showcase/map/" + mapName + ".jpg";
	updateInfo(mapName, regionId);
}

function updateInfo(mapName){
	infoDiv = document.getElementById("info" + mapName.toUpperCase());
	if(infoDiv != null){
		document.getElementById("tdInfo").innerHTML = infoDiv.innerHTML;
		document.getElementById("tdInfoTitle").innerText = mapName.toUpperCase();
	}
}

function updateLstRegions(regionId){
	ddRegion = document.getElementById("ctl00_ContentPlaceHolder1_ddRegion");
	
	for(i = 0; i < ddRegion.options.length; i++){
		if(ddRegion.options[i].value == regionId){
			ddRegion.selectedIndex = i;
		}
	}
}

function debug(text){
	document.getElementById("heading").innerText = text;
}
