function import_client_details(old_contact){
	old_contact = old_contact || false;
	var url = "ajax/client.php";
	if(old_contact != false){
		url = "ajax/contact.php"
	}
	new Ajax.Request(url, {
		method: 'get',
		parameters: {'fetch':old_contact},
		onSuccess: function(transport){
			var res;
			eval("res=" + transport.responseText);
			if($('title')) $('title').value = res['title'];
			if($('firstname')) $('firstname').value = res['firstname'];
			if($('surname')) $('surname').value = res['surname'];
			if($('company_no')) $('company_no').value = res['company_no'];
			if($('company_name')) $('company_name').value = res['company_name'];
			if($('company_type')) $('company_type').value = res['company_type'];
			if($('house_number')) $('house_number').value = res['house_number'];
			if($('addressline1')) $('addressline1').value = res['addressline1'];
			if($('addressline2')) $('addressline2').value = res['addressline2'];
			if($('company_name')) $('company_name').value = res['company_name'];
			if($('street')) $('street').value = res['addressline1'];
			if($('city')) $('city').value = res['city'];
			if($('town')) $('town').value = res['town'];
			if($('county')) $('county').value = res['county'];
			if($('postcode')) $('postcode').value = res['postcode'];
			if($('country')) $('country').value = res['country'];
			if($('phone')) $('phone').value = res['phone'];
			if($('mobile')) $('mobile').value = res['mobile'];
			if($('fax')) $('fax').value = res['fax'];
			if($('email')) $('email').value = res['email'];
		}
	});
}

function confirm_mailbox_deletion(){
	return window.confirm("Are you sure you want to delete this mailox?");
}
