function refreshMainForm() {
	showLoading();
	tapestry.form.refresh("quoteForm");
}

$(function() {

	var exists = {};
	$('#errorSection .required').each(function() {
		var content = $(this).text();
		if (exists[content]) {
			$(this).remove();
		} else {
			exists[content] = true;
		}
	});

	// Colour label for phone number if there are validation errors
	if ($('.jQuery_selection_mobile_wrapper .errorTextbox').length > 0) {
		$('.jQuery_label_mobile_wrapper').addClass('required');
	}
	// Colour label for phone number if there are validation errors
	if ($('.jQuery_selection_home_wrapper .errorTextbox').length > 0) {
		$('.jQuery_label_home_wrapper').addClass('required');
	}

	if ($('.jQuery_selection_mainmemberdob_wrapper .errorTextbox').length > 0) {
		$('.jQuery_label_mainmemberdob_wrapper').addClass('required');
	}

	if ($('.jQuery_selection_dependantdob_wrapper .errorTextbox').length > 0) {
		$('.jQuery_selection_dependantdob_wrapper .errorTextbox').parent()
				.siblings('.labelLeftAligned').children(
						'.jQuery_label_dependantdob_wrapper').addClass(
						'required');
	}
});

$(document).ready(
		function() {
			
			//UAE Dubai is no longer a valid contracting country
			$("#contractCountry option").each(function() {				
				if ($(this).text() == 'UAE-Dubai'
						|| $(this).text() == 'EAU-Dubaï'
						|| $(this).text() == 'VAE-Dubai'
						|| $(this).text() == 'EAU-Dubái'
						|| $(this).text() == 'VAE-Dubai') {
					//console.log('removing UAE_DUBAI from contracting country list');
					$(this).remove();  
				}
			});			
			
	});