// JavaScript Document
window.onload = getBrowser;

// Define Browser Name
var browser = navigator.appName;

// Finds the browser and makes a function selection
function getBrowser() {
	if (browser == "Microsoft Internet Explorer"){
		selectMapIe();
		}
	else {
		selectMapNotIe();
	}
}

// Runs if the browser is not IE
function selectMapNotIe() {
	if (document.getElementById("wagmp_directions_1").innerHTML == "") {
		var map1 = document.getElementById("wagmp_map_1");
		var map2 = document.getElementById("wagmp_map_2");
		map1.style.width = "0";
		map1.style.height = "0";
		map1.style.visibility = "hidden";
		map2.style.width = "400px";
		map2.style.height = "350px";
		map2.style.visibility = "visible";
	}
			else {					
				var map1 = document.getElementById("wagmp_map_1");
				var map2 = document.getElementById("wagmp_map_2");			
				map2.style.width = "0";
				map2.style.height = "0";
				map2.style.visibility = "hidden";
				map1.style.width = "400px";
				map1.style.height = "350px";
				map1.style.visibility = "visible";
		}
}

// Runs if the browser is IE
function selectMapIe() {
	if (document.all.wagmp_directions_1.innerHTML == "") {
		var map1 = document.all.wagmp_map_1;
		var map2 = document.all.wagmp_map_2;
		map1.style.width = "0";
		map1.style.height = "0";
		map1.style.visibility = "hidden";
		map2.style.width = "400px";
		map2.style.height = "350px";
		map2.style.visibility = "visible";
	}
	else {
		changeMapIe();
		}
}

// Swaps the maps for IE from an event in the form 
// This makes sure right map shows for IE... you know... M$ || IE = code++ 
function changeMapIe() {
	if (browser == "Microsoft Internet Explorer") {
				var map1 = document.all.wagmp_map_1;
				var map2 = document.all.wagmp_map_2;			
				map2.style.width = "0";
				map2.style.height = "0";
				map2.style.visibility = "hidden";
				map1.style.width = "400px";
				map1.style.height = "350px";
				map1.style.visibility = "visible";
				}
		}
