function ajaxSubmit(form, url) {
	if ($('activity_indicator') != null) $('activity_indicator').title = 'hidden';
	
	idx = '';
	if (arguments.length >= 4) idx = arguments[3];

	successAction = null;
	if (arguments.length >= 3) successAction = arguments[2];
	
	$('button' + idx).hide();
	$('loader' + idx).show();		
	new Ajax.Request(url, {
		parameters: Form.serialize($(form)),
		onComplete: function(t) {
			if ($('activity_indicator') != null) $('activity_indicator').title = '';
			
			$('button' + idx).show();
			$('loader' + idx).hide();
			status = t.responseText.replace(/^\s+|\s+$/g, '');
			if (status == 'ok' && successAction != null) successAction();
			if (status != 'ok') alert(status);
		}
	});
}

function homeSplash() {
	var h = document.viewport.getHeight();
	$('splash').setStyle({ height: h + 'px' });
	$('splash_title').setStyle({ top: Math.round(h / 2) - 100 + 'px' });
	$('splash_bar').setStyle({ top: Math.round(h / 2) - 70 + 'px' });
	$('splash_bar').setStyle({ opacity: 0.65 });
	$('splash_bar_text').setStyle({ top: Math.round(h / 2) - 70 + 'px' });
	$('splash_bar_text').setStyle({ opacity: 0.8 });
}