/*
@function 	= 	chooseAgent()
@purpose 	= 	display form fields for Agent Registration
@parameters = 	
@returns	= 	void
@usage		=	chooseAgent()
*/
function chooseAgent()
{
	clearLabels("userRegistration"); 
	displayObject("customerRegistration", 0);
	displayObject("agentRegistration", 1);
	displayObject("customerError", 0); 
	displayObject("agentError", 0); 
	setMessage("regError", ""); 
	setMessage("customerError", ""); 
	setMessage("agentError", "");
	document.userRegistration.reset(); document.userRegistration.whichRegistration[0].checked = true;
}
/*
@function 	= 	chooseCustomer()
@purpose 	= 	display form fields for Customer Registration
@parameters = 	
@returns	= 	void
@usage		=	chooseCustomer()
*/
function chooseCustomer()
{
	clearLabels("userRegistration"); 
	displayObject("customerRegistration", 1); 
	displayObject("agentRegistration", 0); 
	displayObject("customerError", 0); 
	displayObject("agentError", 0); 
	setMessage("regError", ""); 
	setMessage("customerError", ""); 
	setMessage("agentError", "");
	document.userRegistration.reset(); document.userRegistration.whichRegistration[1].checked = true;
}
/*
@function 	= 	validateRegistration()
@purpose 	=  	validation registration based on selected user type
@parameters = 	
@returns	= 	boolean
@usage		=	validateRegistration()
*/
function validateRegistration()
{
	var f = document.userRegistration; var err = ""; var isAgent = false; var isCustomer = false;
	
	clearLabels("userRegistration"); setMessage("regError", ""); setMessage("agentError", ""); setMessage("customerError", ""); displayObject("regError", 0);
	
	if (f.whichRegistration[0].checked) { isAgent = true; } 
	else if (f.whichRegistration[1].checked) { isCustomer = true; }
	else { setMessage("regError", "Please select a type of User."); displayObject("regError", 1); return false; }	
	return true;
}