// Map handler

//var allContinents = new Array("north_america","south_america","europe","africa","asia","australia");

//var allCountries = new Array();
//allCountries["north_america"] = new Array("usa","United States","canada","Canada");
//allCountries["south_america"] = new Array("brazil","Brazil");
//allCountries["africa"] = new Array("south_africa","South Africa");
//allCountries["austr"] = new Array("australia","Australia");
//allCountries["europe"] = new Array("france","France","uk","United Kingdom","belgium","Belgium","austria","Austria","switzerland","Switzerland");
//allCountries["asia"] = new Array("israel","Israel","cyprus","Cyprus");

function switchContinent(who) {
	var thisid = who.options[who.selectedIndex].value;
	var mycountries = allCountries[thisid];
	var sel = document.getElementById("countries");
	document.getElementById("fff").SetVariable("newSelected",((who.selectedIndex+1)+""));
	var b = "mz";
	if (window.navigator.appName.toUpperCase().indexOf("EXPLORER") > -1) b = "ie";
	if (b=="ie") {
		var items = sel.options.length;
		for (var i = 0; i<items; i++) sel.options.remove(0);
	} else {
		var items = sel.options.length;
		for (var i = 0; i<items; i++) sel.options[0] = null;
	}
	for (var i = 0; i<mycountries.length;i+=2) {
		var thatid = mycountries[i];
		var thatname = mycountries[i+1];
		if (b == "ie") {
			var no = new Option();
			no.value = thatid;
			no.text = thatname;
			sel.options.add(no);
		} else {
			sel.options[sel.options.length] = new Option(thatname,thatid);
		}
	}
}

function showDistributor() {
	var cont = document.getElementById("continents").options[document.getElementById("continents").selectedIndex].value;
	var count = document.getElementById("countries").options[document.getElementById("countries").selectedIndex].value;
	// Hide all
	for (var i in allCountries) {
		var those = allCountries[i];
		for (var j=0;j<those.length;j+=2) {
			document.getElementById(those[j]).style.display = "none";
		}
	}
	// Reveal
	document.getElementById(count).style.display = "block";
	document.getElementById(cont).style.display = "block";
}

function outerSelect(who) {
	var mynum = parseInt(who.substr(4));
	document.getElementById("continents").selectedIndex = (mynum-1);
	switchContinent(document.getElementById("continents"));
}

function _init() {
	window.setTimeout('document.getElementById("fff").SetVariable("newSelected","1");',100);
}
