var t = new Object;
	t['PatronName'] = 'First Name*';
	t['PatronSurname'] = 'Last Name*';
	t['PatronEmail'] = 'E-mail*';
	t['PatronMobile'] = 'Mobile*';

jQuery(document).ready(function($){
	
	
	
	var oForm = jQuery('#4e40a6017e297').removeAttr('onsubmit');//Get ref to form and remove onsubmit attribute as it will be wrapped in validation script below
	
	oForm.find('.MGLRow br').remove();
	
	var fields = oForm.find('input[type="text"]').not('#MGLDOB').addClass('txt');// Grab ref to text input fields
	
	fields
		.each(function(){//For each input field
			var e = $(this);
			if($.trim(e.val()) == '')e.val(t[e.attr('name')]);//Add value to field
		})
		.focus(function(){//When this fiels is in focus
			var e = $(this);
			if($.trim(e.val()) == t[e.attr('name')])//If the default value is in it
			{
				e.val('');// Replace it with nothing	
			}
		})
		.blur(function(){// When this field loses focus
			var e = $(this);
			if($.trim(e.val()) == '')//If there is no value in it
			{
				e.val(t[e.attr('name')]);// Reinstate the default value	
			}
		});
		
		
		oForm.submit(function($e){// Validate this form
		
			fields
				.each(function(){//For each text input field
					var e = $(this);
					if($.trim(e.val()) == t[e.attr('name')])//If the default value is present
					{
						e.val('');	//Remove the default value
					}	
				});
				
			
			var validate = mgl_validator.call($(this)[0],'4e40a6017e297');//Use the form's default validation
			
			if(!validate)//If the form's default validation returned errors
			{
				$e.preventDefault();// Do not submit this form
			
				fields
					.each(function(){//for each input field
						var e = $(this);
						if($.trim(e.val()) == '')// If it is empty
						{
							e.val(t[e.attr('name')]);	//Reinstate the default value
						}	
					});
			}
				
			
		});
		
		
		oForm
			.find('#MGLSubmit')
			.html('<input type="submit" value="Sign Up!" /><!--span id="errordisplay" style="text-align:center;display:block;position:relative;margin-left:auto;margin-right:auto;"></span-->');
			
});
