function authenticateUser(node) {
	node.hide();
	$('loading').show();	
	window.setTimeout(function() {  document.login_form.submit(); }, 2000); 
}

function doSubQuestion(event) {	
	var input = Event.element(event);
	var id = input.id;
	var followup = $(''+id+'ub');
	
	surveyCleanUp(input);
			   
	if (followup != null) {
		followup.show();
	}
}

function surveyCleanUp(element) {	
	var parent = element.parentNode;
	while (!parent.match('.survey-q')) {
		if (parent.className == 'follow-up') {
			return;
		} else {
			parent = parent.parentNode;
		}
	}	
	
	var followup_array = parent.select('.follow-up');
	if (followup_array.length > 0) {
		for (var i = 0; i < followup_array.length; i++) {
			var followup = followup_array[i];
			if (followup.visible()) {
				break;	
			}
		}
		
		if (followup.visible()) {
			var inputs = followup.select('input');
			for (var i = 0; i < inputs.length; i++) {
				if (inputs[i].checked) {
					inputs[i].checked = false;
				}
			}			
			followup.hide();
		}
	}
}
