
	countryCodeMapping = {};
	countryCodeMapping['Amsterdam'] = "nl";
	countryCodeMapping['Atlanta'] = "us";
	countryCodeMapping['Berlin'] = "de";
	countryCodeMapping['Brazil'] = "br";
	countryCodeMapping['Boston'] = "us";
	countryCodeMapping['Brisbane'] = "au";
	countryCodeMapping['Bucharest'] = "ro";
	countryCodeMapping['Chicago'] = "us";
	countryCodeMapping['Copenhagen'] = "dk";
	countryCodeMapping['Dallas'] = "us";
	countryCodeMapping['Frankfurt'] = "de";
	countryCodeMapping['Fremont'] = "us";
	countryCodeMapping['London'] = "gb";
	countryCodeMapping['Miami'] = "us";
	countryCodeMapping['Milan'] = "it";
	countryCodeMapping['Moscow'] = "ru";
	countryCodeMapping['New York'] = "us";
	countryCodeMapping['Newmarket'] = "ie";
	countryCodeMapping['Paris'] = "fr";
	countryCodeMapping['Prague'] = "cz";
	countryCodeMapping['Seattle'] = "us";
	countryCodeMapping['Seattle2'] = "us";
	countryCodeMapping['San Jose'] = "us";
	countryCodeMapping['Singapore'] = "sg";
	countryCodeMapping['Stockholm'] = "se";
	countryCodeMapping['Sydney'] = "au";
	countryCodeMapping['Tallin'] = "ee";
	countryCodeMapping['Tokyo'] = "jp";
	countryCodeMapping['Toronto'] = "ca";
	countryCodeMapping['Vienna'] = "at";
	countryCodeMapping['Washington'] = "us";
	countryCodeMapping['Wellington'] = "nz";
	countryCodeMapping['Barcelona'] = "es";

	$(document).ready(function () {
		box = $('#statustable');
		$.getJSON('/proxyStatus.json', function (data) {
			cssclass = 'wstripe';
			for (proxy in data) {
				if (cssclass == 'dstripe')
				{
					cssclass = 'wstripe';
				}else
				{
					cssclass = 'dstripe';
				}
				therow = '<tr class="' + cssclass + '"><td class="flag">' + showFlag(proxy) + '</td><td>' + proxy + '</td><td>' + showStatus(data[proxy]['Squid N']['state'], data[proxy]['Squid X']['state']) + '</td></tr>';
				box.append(therow);
			}
		});
	});
	
	function showFlag(location){
		return '<img src="/media/flags/' + countryCodeMapping[location] + '.png" alt="' + location + '" />';
	}
	function showStatus(statusN, statusX) {
		var status = statusN + statusX;
		if (status == 0) {
			return '<span class="working">&nbsp;<img src="/media/check.png">&nbsp;</span>';
		} else if (status == 1) {
			return '<span class="meh">&nbsp;<img src="/media/unknown.png">&nbsp;</span>';
		} else {
			return '<span class="boned">&nbsp;<img src="/media/x.png">&nbsp;</span>';
		}
	}

