function add_client()
{
	var f_name=document.getElementById('f_name').value;
	var m_name=document.getElementById('m_name').value;
	var cust_email=document.getElementById('cust_email').value;
	var telephone=document.getElementById('telephone').value;
	var fax=document.getElementById('fax').value;
	var gender=document.getElementById('gender');
	var gender=document.getElementById('gender').options[gender.selectedIndex].value;
	var address=document.getElementById('address').value;
	var city=document.getElementById('city').value;
	var state=document.getElementById('state').value;
	var zip=document.getElementById('zip').value;
	var iata=document.getElementById('iata').value;
	var iatan=document.getElementById('iatan').value;
	var tids=document.getElementById('tids').value;
	var acta=document.getElementById('acta').value;
	var association=document.getElementById('association').value;
		
if(validateAgent()!=false){
var myRequest = new ajaxObject('submitagents.php? f_name='+f_name+'&m_name='+m_name+
               '&cust_email='+cust_email+'&telephone='+telephone+'&fax='+fax+'&gender='+gender+'&address='+address+
               '&city='+city+'&state='+state+'&zip='+zip+'&iata='+iata+
               '&iatan='+iatan+'&tids='+tids+'&acta='+acta+'&association='+association+
              '&');
	
	myRequest.callback=function(responseText)
	{
		if(responseText==1)
		{
			alert("done adn well done");
			closePopupDiv();
			display_group();
		}
		else
		{
			alert(responseText);
		}
	}
	myRequest.update();
}
}


function normal_string(str_exp,helpmsg)
{
	var nameexp=/^[a-zA-Z0-9\ \_\+]+$/;
	if(!str_exp.value.match(nameexp) && str_exp!="")
	{
	alert(helpmsg);
	str_exp.value="";
	return false;
	}
	else
	{
		return true;
	}
	
}

function phone_string(str_exp,helpmsg)
{
	var phoneexp=/^[0-9\ \-\+]+$/;
	if(!str_exp.value.match(phoneexp) && str_exp!="")
	{
	alert(helpmsg);
	str_exp.value="";
	return false;
	}
	else
	{
		return true;
	}
	
}



function email_string(str_exp,helpmsg)
{
	var phoneexp=/^[\\wa-zA-Z0-9_]+@[\\wa-zA-Z0-9_]+.[a-zA-Z0-9_.]+$/;
	if(!str_exp.value.match(phoneexp) && str_exp!="")
	{
	alert(helpmsg);
	str_exp.value="";
	return false;
	}
	else
	{
		return true;
	}
	
}
function validateAgent(){	

	var reason = '';
	//reason += validateMemberTitle();
	reason += validateMemberFname();
	//reason += validateMemberMname();
	
	
		if (reason != '') {
		alert("Please attend to the following:\r\n" +reason);
		return false;
		}

	}
	
	function validateMemberFname(){
	var f_name = document.getElementById('complain');	
	var error = '';
	if(f_name.value.length == 0){var error = 'You have not entered first name.\n';}	
	return error;			
	}
	
	

