
var req;
var idBox;
var lon;
var lat;
function checkUser(u) {
	if(u == '') {
		alert('Please specify a username to check.');
	} else {
		var url = '/usercheck/' + u + '/';
		if(window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		} else if(window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		idBox = 'usercheck';
		req.open("GET", url, true);
		req.onreadystatechange = callBack;
		req.send(null);
	}
}

function callBack() {
	if(req.readyState == 4) {
		if(req.status == 200) {
			response = req.responseText;
			document.getElementById(idBox).innerHTML = response;
		}
	}
}

function winStat(t) {
	window.status = t;
	return true;		
}

function newWin(u,n,f) {
	window.open(u,n,f);
}

function loadGM(){
	if(GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(lat, lon), 13);
		var point = new GLatLng(lat, lon);
		map.addOverlay(new GMarker(point));
	}
}
