// JavaScript Document
var disabled = 0;
function isInt(x) {
	var y=parseInt(x);
	if (isNaN(y)) return false;
	return x==y && x.toString()==y.toString();
} 
function usHide() {
	var countryCode = document.getElementById('CountryCode');
	var areaCode = document.getElementById('AreaCode');
	var exchangeNumber = document.getElementById('ExchangeNumber');
	if (disabled != 1) {
		countryCode.value = "1";
		countryCode.disabled = true;
		disabled = 1;
		areaCode.maxLength = 3;
		exchangeNumber.maxLength = 3;
	} else {
		countryCode.value = "";
		countryCode.disabled = false;
		disabled = 0;
		areaCode.maxLength = 4;
		exchangeNumber.maxLength = 4;					
	}
}
function validateForm(formId) {
	form = document.getElementById(formId);
	if(isInt(form.value) == false) {
		var value = form.value;
		var valueLength = value.length;
		form.value = value.slice(0,valueLength-1);
	}
}

function pausecomp(millis)
{
	var date = new Date();
	var curDate = null;
	
	do { curDate = new Date(); }
	while(curDate-date < millis);
} 
		
function doShtuff(first, last, id) {
	var ajax = new Ajaxobj(); 
	document.getElementById('NameBox').value = first + ' ' + last; 
	document.getElementById('IdBox').value = id; 
	document.getElementById('autosuggest').style.display = 'none'; 
	ajax.get("picture_embed.php?search=" + id, 'patientpicture1');
}
			
