// Array with flags if fields have been cleared
var cleared = Array();

/** Clear input fields one time **/
function initial_clear(obj) {
	if (!cleared[$(obj).attr("id")]) {
		$(obj).val("");
		cleared[$(obj).attr("id")] = true;
	}
}

/** Post form to django to change language of the user and refresh the window **/
function select_language(val) {
	$.post('/i18n/setlang/', {'language': val}, function(data) {
		location.reload();
	});
}

$(document).ready(function() {
	/** Hook imgBox to links with class zoom **/
	$("a.zoom").imgbox({
		'zoomOpacity': true
	});
});
