function goToBaby() {
	var txtBabyId = document.getElementById("txtBabyId").value;
	var txtPassword = document.getElementById("txtPassword2").value;
	//alert('txtFirstLast='+txtFirstLast+' txtPassword='+txtPassword);
	//alert("filterLocations() txtLocation="+txtLocation);
	var phpFunction = "goToBaby";
	var url = "include/goToBaby_inc.php?phpFunction="+phpFunction+"&txtBabyId="+txtBabyId+"&txtPassword="+txtPassword+"&sid="+Math.random();
	//alert(url);
	xmlHttp = getXmlHttp();
	xmlHttp.onreadystatechange=goToBaby2; 
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}

function goToBaby2() {
	if ((xmlHttp.readyState==4) || (xmlHttp.readyState=="complete")) {
		var txtResponse = xmlHttp.responseText;
		//alert("goToBaby2() txtResponse="+txtResponse);
		txtResponse=txtResponse.substring(1);
		var intPos = txtResponse.lastIndexOf("~");
		var txtBabyId = txtResponse.substring(intPos+1);
		if (txtBabyId!=0) {
			window.open("baby.php?babyId="+txtBabyId);
		} else {
			document.getElementById("spnBabyNotFound").innerHTML="Baby not found";
		}
	} 
}

function returnKeyGoToBaby(event) {
	if (event.keyCode==13) {
		goToBaby();
	}
}

