window.addEvent('domready', function(){
	$('contactform').addEvent('submit', function(e) {
		new Event(e).stop();
		var log = $('log_res').empty().addClass('ajax-loading');
		this.send({
			update: log,
			onSuccess: function() {
					log.removeClass('ajax-loading');
					t = setTimeout("clearResponse()",5000);
			}
		});
	});			
});

function resetForm() {
	document.form.reset();
	var clear = $('log_res');
	clear.empty();
}

function clearResponse() {
	var clear = $('log_res');
	clear.empty();
	clearTimeout(t);
}

function refocus() {
	$('textarea').focus();
	$('textarea').blur();
	$('input').focus();
	$('input').blur();
	//$('input:first').focus();
}

