function nextTab(id) {
	var max_ = 8;
	
	if (id == 0) {
		document.location='survey.php?q=1';
		return;
	}
	if (id == -1) {
		document.location='evaluation.php';
		return;
	}
	if (id == -2) {
		document.location='survey.php?q=1&lang=ro';
		return;
	}
	
	for (var i = 1; i<=max_; i++) {
		if (i == id) {
			$('tab'+id).show();
			$('tdd'+id).addClassName('tab_active');
		} else {
			$('tdd'+i).removeClassName('tab_active');
			$('tab'+i).hide();
		}
	}
}
function nextTab1(id) {
	var max_ = 9;
	
	if (id == 0) {
		document.location='survey.php?q=1';
		return;
	}
	if (id == -1) {
		document.location='evaluation.php';
		return;
	}
	if (id == -2) {
		document.location='survey.php?q=1&lang=ro';
		return;
	}
	
	for (var i = 1; i<=max_; i++) {
		if (i == id) {
			$('tab'+id).show();
			$('td'+id).addClassName('tab_active');
		} else {
			$('td'+i).removeClassName('tab_active');
			$('tab'+i).hide();
		}
	}
}
function moverOpt(id) {
	$('opt'+id).setStyle({fontWeight: 'bold'});
}
function sendComment(l) {
	var url = 'post_comment.php';
	var name = $('c_name').value;
	var mail = $('c_email').value;
	var comment = $('comment').value;
	if (!comment) {
		comment = '';
	} else {
		comment = comment.strip().stripScripts().stripTags().escapeHTML();
	}
	if (!name) {
		name = '';
	} else {
		name = name.strip().stripScripts().stripTags().escapeHTML();
	}
	if (!mail) {
		mail = '';
	} else {
		mail = mail.strip().stripScripts().stripTags().escapeHTML();
	}

	new Ajax.Request(url, {
		method: 'post',
		parameters: 'name='+name+'&comment='+comment+'&lang='+l+'&email='+mail,
		onSuccess: function(transport) {
			$('notice').update(transport.responseText);
		}
	});
}
