function validateSignUP()
{
	trimFields();
	if(obj.first_name.value == '')
	{
		alert("Please enter First Name.");
		obj.first_name.focus();
		return;
	}
	if(obj.last_name.value == '')
	{
		alert("Please enter Last Name.");
		obj.last_name.focus();
		return;
	}
	if(obj.email_address.value == '')
	{
		alert("Please enter Email Address.");
		obj.email_address.focus();
		return;
	}
	if(!chkEmail(obj.email_address.value))
	{
		alert("Please enter a valid Email Address.");
		obj.email_address.focus();
		obj.email_address.select();
		return;
	}
	if(obj.username.value == '')
	{
		alert("Please enter Username.");
		obj.username.focus();
		return;
	}
	if(obj.password.value == '')
	{
		alert("Please enter Password.");
		obj.password.focus();
		return;
	}
	if(obj.confirm_password.value == '')
	{
		alert("Please Confirm your Password.");
		obj.confirm_password.focus();
		return;
	}
	if(obj.password.value != obj.confirm_password.value)
	{
		alert("The Password and Confirm Password do not match!\nPlease enter again and ensure both are same.");
		obj.confirm_password.focus();
		obj.confirm_password.select();
		return;
	}
	if(obj.captcha.value == '')
	{
		alert("Please enter the Security Code as shown.");
		obj.captcha.focus();
		return;
	}
	$('#button').css('display', 'none');
	$('#ajax_loader').css('display', 'block');

	 $.ajax({
	   type: "GET",
	   data: "first_name="+obj.first_name.value+'&last_name='+obj.last_name.value+'&email_address='+obj.email_address.value+'&username='+obj.username.value+'&password='+obj.password.value+'&captcha='+obj.captcha.value,
	   url: "process_user_signup.php"+'?hash='+parseInt(Math.random() * 10000000000),
	   success: function(retVal){
			if(retVal == 'SUCCESS')
			{
				window.location = 'confirmation_signup.php';
				obj.first_name.value = '';
				obj.last_name.value = '';
				obj.email_address.value = '';
				obj.username.value = '';
				obj.password.value = '';
				obj.confirm_password.value = '';
				obj.captcha.value = '';
				refreshCaptcha('img_captcha');
			}
			if(retVal == 'DUPLICATE')
			{
				$('#fancy_msg').css('color', '#FF0000');
				document.getElementById('fancy_msg').innerHTML = "Another User with the same Username exists!\n Please choose another one";
				refreshCaptcha('img_captcha');
				obj.captcha.value = '';
				obj.username.focus();
				obj.username.select();
			}
			if(retVal == 'INVALID_CAPTCHA')
			{
				$('#fancy_msg').css('color', '#FF0000');
				document.getElementById('fancy_msg').innerHTML = "Sorry! the security code you have entered is incorrect!\nPlease enter the new security code as shown.";
				refreshCaptcha('img_captcha');
				obj.captcha.value = '';
				obj.captcha.focus();
			}
			$('#button').css('display', 'block');
			$('#ajax_loader').css('display', 'none');
	   }
	});
}
