var Contact = {
	OpenForm: function(id) {
		Lightview.show({
			href: '/contact/send_email/'+id,
			rel: 'ajax',
			title: 'Contact',
			options: {
				topclose: false,
				scrolling: false,
				autosize: true,
				ajax: {
					method: 'get',
					evalScripts: true,
					requestHeaders: Biscuit.Ajax.RequestHeaders('update')
				}
			}
		});
	},
	AddHandlers: function() {
		$('contact_form').observe("submit", function(event){
			Event.stop(event);
			new Biscuit.Ajax.FormValidator('contact_form',{
				ajax_submit: true,
				custom_ajax_submitter: Contact.SubmitMessage,
				throbber_id: 'submit_throbber'
			});
		});
		$('close_editor').observe("click",function(event){
			Event.stop(event);
			Lightview.hide();
		});
	},
	SubmitMessage: function() {
		var contact_form = $('contact_form');
		Lightview.show({
			href: contact_form.action,
			rel: 'ajax',
			title: 'Contact',
			options: {
				topclose: false,
				scrolling: false,
				autosize: true,
				ajax: {
					method: 'post',
					evalScripts: true,
					requestHeaders: Biscuit.Ajax.RequestHeaders('update'),
					parameters: Form.serializeElements(contact_form.getElements(),true) // the parameters from the form
				}
			}
		});
	}
}
