
function Consult(EmID)	{
	
	var Name = $('Con_AgentName').value;  // required
	var Agency = $('Con_Agency').value;  // required
	var Email = $('Con_AgentEmail').value;  // required
	var Phone = $('Con_AgentPhone').value;  // required
	var Zip = $('Con_AgentZip').value;  // required
	var BestTime = $('BestTime').value;  // required

	var missing = '';
	var numtodo = 0;
	
	if (Name.length == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Agent Name \n ';
	}
	if (Agency.length == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Agency \n ';
	}
	if (Email.length == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Email Address \n ';
	}
	if (Phone.length == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Phone \n ';
	}
	if (Zip.length == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Zip Code \n ';
	}
	if (BestTime == 0) {
		numtodo = numtodo + 1;
		missing = missing + '  (' + numtodo + ') Select Best Time \n ';
	}
	missing = 'There are ' + numtodo + ' required item(s) missing: \n ' + missing;
	if (numtodo > 0) {
		alert(missing);
		return;
	}
	
	Name = encodeURIComponent(Name);
	Agency = encodeURIComponent(Agency);
	Phone = encodeURIComponent(Phone);
	Email = encodeURIComponent(Email);
	BestTime = encodeURIComponent(BestTime);
	
	var url = 'addr_Consult.asp?EmID=' + EmID + '&Name=' + Name + '&Agency=' + Agency + '&Email=' + Email + '&Phone=' + Phone + '&BestTime=' + BestTime + '&Zip=' + Zip;
	//$('Con_AgentEmail').value = url;
	new Ajax.Request(url, 
		{	method: 'get', 
			onSuccess: function(transport)	{
				
				if (transport.responseText == 'Recorded')	{
					alert('Thank you for registering! An email confirming your registration is being sent to you.');
					$('Img33').style.visibility = 'hidden';
					return;
				}
			},
			onFailure: function(transport)	{
				alert('Sorry, the server is off-line and failed to record your registration.');
				return;
			}
		}
	)
}