function discloseVaccinationInfo(vacc) {
	if (vacc != '') {
		document.getElementById('disclose_vacc').innerHTML = updateContent(vacc);
	}
}


function fetchAddress() {
	
	var loc;
	
	loc = window.location.hostname;
	
	if (loc.match('everest')) {
		loc = 'http://everest:8888/HappyPet/website/';
	} else {
		if (loc.match('dreamhost')) {
			loc = 'http://happypet.dreamhosters.com/';
		} else {
			loc = 'http://happypet.com/';
		}
	}
	
	return loc;
}



function updateContent(vacc) {
	
	var loc;
	var method;
	
	loc = fetchAddress();
	loc += "lib/readfile.php?v=" + vacc;
	
	//window.open(loc);
	
	try {if (window.XMLHttpRequest) {xmlhttp = new XMLHttpRequest();method= 'GET';}else{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");method= 'POST';}}catch (e) {}
		
	xmlhttp.onreadystatechange = trigger;
	xmlhttp.open(method, loc);
	xmlhttp.send(null);
	

}

function trigger() {
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
		var response = xmlhttp.responseText;
		document.getElementById('disclose_vacc').innerHTML = response;
	}
}
