function submitEnquiryForm() { 

	// attach handler to form's submit event
	if($('#enquireForm').valid()) { 
		$('.detail').attr('value',''); // clear any default data in form 
		_alert('Submitting your request ...'); 
		hideEnquiryForm();
		
		$('#enquireForm').ajaxSubmit(
			{ 
				url: '/contact/quick_enquiry_process.php', 
				type: 'post',  
				dataType: 'json', 
				success: function(data) { 
					
					if(data.success == 'true' || data.success == 1 || data.success == '1') { 
					 
					 	$('#enquireFormExpander #thanks').show();
						$('#enquireFormExpander #form').hide();
						$('#enquireFormExpander').animate(
							{ 
								width: 'toggle', 
								height: 'toggle', 
								opacity: 'show' 
							}, 
							1000
						);
						
						//add tracking
						if (data.ref_no != "") {
						
							try {
								pageTracker = _gat._getTracker("UA-6107599-3"); //india account
								pageTracker._trackPageview('contact/quick_enquiry_confirmation.php');
							} catch(err) {}
							
							try{
  		
							  pageTracker._addTrans(
								  data.ref_no,            // order ID - required
								  "AndBeyond India",  // affiliation or store name
								  "1",           // total - required
								  "0",            // tax
								  "0",           // shipping
								  "city",        // city
								  "state",      // state or province
								  "country"              // country
								);
								
							var page = top.location.pathname.substr(1,top.location.pathname.length);
								
							   pageTracker._addItem(
								  data.ref_no,           // order ID - necessary to associate item with transaction
								  data.ref_no,           // SKU/code - required
								  "Enquiry Tracking on India",        // product name
								  page,   // category or variation
								  "1",          // unit price - required
								  "1"               // quantity - required
							   );
							
							   pageTracker._trackTrans(); //submits transaction to the Analytics servers
							   
							} catch(err) {}
							
						}//end check for refNO
						
						return false;
	
					}else {
					_alert('Your request failed to submit. Either your connection failed or you filled the form in to quickly. Please retry submitting your form.'); 
					return false;
					}	
				}
			}
		); 
	}
	else { _alert('Please review your form again.\n Some fields are invalid.'); } 
	
	return false; // prevent form reloading
}

function clearEnquiryForm() {
	$('#enquireForm').clearForm();
}

function showEnquiryForm() {
	$('#enquireFormExpander #thanks').hide();
	$('#enquireFormExpander #form').show();
	$('#enquireFormExpander').animate(
		{ 
			width: 'toggle', 
			height: 'toggle', 
			opacity: 'show' 
		}, 
		1000
	);
	return false;
} 

function hideEnquiryForm() {
	$('#enquireFormExpander #displayPhone').slideUp(500);
	$('#enquireFormExpander #displayDetailTrip').slideUp(
		800, 
		function() {
			$('#enquireFormExpander').animate(
				{ 
					width: 'toggle', 
					height: 'toggle', 
					opacity: 'hide' 
				}, 
				1000
			);
		}
	);

	//clearEnquiryForm();
	return false;
} 

function showPhoneNumbers() {
	$('#enquireFormExpander #displayPhone').slideToggle(1000);
}

function showDetailTrip() {
	$('#enquireFormExpander #displayDetailTrip').slideToggle(1000);
	return false;
}

function clearField() {
	$(this).removeClass('detail').attr('value','').unbind("focus");
}



$(document).ready(function()
{
	$('.detail').focus(clearField);
	$('#enquireForm #enquiry_tz').val(new Date().getTimezoneOffset());
	
}); 

