function move_multiple(from, to, all) {
	from_list = eval('document.forms[0].' + from);
	to_list = eval('document.forms[0].' + to);
	for (i = 0; i < from_list.options.length; i++) {
		var current = from_list.options[i];
		if (current.selected || all == 1) {
			to_list.options[to_list.length] = new Option(current.text, current.value);
			from_list.options[i] = null;
			i--;
		}
	}
}
function all_select(from) {
	list = eval('document.forms[0].' + from);
	count = list.options.length;
	for (i = 0; i < count; i++) {
		eval('document.forms[0].hidden_' + from + '.value += ' +
			'list.options[i].value + (count - 1 == i ? \'\' : \'|\')');
	}
}
function sort_multiple_list(select_name, list_array) {
	select_list = eval('document.forms[0].' + select_name);
	old_options = new Array(select_list.options.length);
	for (i = 0; i < select_list.options.length; i++) {
		old_options[Number(select_list.options[i].value)] = i;
	}
	new_options = new Array(select_list.options.length);
	opt_count = 0;
	for (i = 0; i < list_array.length; i++) {
		if (old_options[list_array[i]] != undefined) {
			new_options[opt_count] = select_list.options[old_options[list_array[i]]];
			opt_count++;
		}
	}
	for (i = 0; i < new_options.length; i++) {
		select_list.options[i] = new Option(new_options[i].text, new_options[i].value);
	}
}
function move_multiple2(from, to) {
	var from_list = document.getElementById(from);
	var to_list = document.getElementById(to);
	for (i = 0; i < from_list.options.length; i++) {
		var current = from_list.options[i];
		if (current.selected) {
			to_list.options[to_list.length] = new Option(current.text, current.value);
			from_list.options[i] = null;
			i--;
		}
	}
}
function all_select2(from) {
	var list = document.getElementById(from);
	var count = list.options.length;
	for (i = 0; i < count; i++) {
		eval('list.form.hidden_' + from + '.value += ' +
			'list.options[i].value + (count - 1 == i ? \'\' : \'|\')');
	}
}
function sort_multiple_list2(select_name, list_array) {
	select_list = document.getElementById(select_name);
	old_options = new Array(select_list.options.length);
	for (i = 0; i < select_list.options.length; i++) {
		old_options[Number(select_list.options[i].value)] = i;
	}
	new_options = new Array(select_list.options.length);
	opt_count = 0;
	for (i = 0; i < list_array.length; i++) {
		if (old_options[list_array[i]] != undefined) {
			new_options[opt_count] = select_list.options[old_options[list_array[i]]];
			opt_count++;
		}
	}
	for (i = 0; i < new_options.length; i++) {
		select_list.options[i] = new Option(new_options[i].text, new_options[i].value);
	}
}
function open_pic(pic_location, page_title, pic_width, pic_height) {
	var imgVar = new Image ();
	imgVar.src = pic_location;
	newWin = window.open ('', 'pic_window', 'height=' + pic_height + ',width=' + pic_width + 
		',top=20,left=20,resizable=no');
	newWin.document.write ('<html><head><title>' + page_title + '</title></head>');
	newWin.document.write ('<body style="margin: 0px; text-align: center; vertical-align: middle">');
	newWin.document.write ('<a href="javascript:window.close()"><img src="' + pic_location + '" height="' + 
		pic_height + '" width="' + pic_width + '" name="im" border="0"></a></body></html>');
	newWin.document.close ();
}
function open_statuspage(status_html) {
	newWin = window.open ('', 'status_window', 'height=320,width=260,top=40,left=40');
	newWin.document.write (status_html);
	newWin.document.close ();
}
function open_printpage() {
	newWin = window.open ('', 'print_window', 'height=470,width=700,top=40,left=40,scrollbars=yes');
	newWin.document.write ('<html><head>' + document.getElementById('document_head').innerHTML + '</head><body onload="window.print();" class="printpage" style="margin: 15px; background-color: white;">');
	newWin.document.write (document.getElementById('content_td').innerHTML);
	newWin.document.write ('</body></html>');
	newWin.document.close ();
}
function go_to_anchor(param) {
	var uri = location.href;
	var ending = uri.substring(uri.length - param.length - 1);
	if (ending != '#' + param) location.href = uri + '#' + param;
	else location.href = uri;
}
function find_filename(filename) {
	var file = new String(filename);
	while (file.indexOf('/') != -1) {
		file = file.substring(file.indexOf('/') + 1, file.length);
	}
	file = file.substring(0, file.indexOf('.'));
	return file;
}
function automatic_submit(lang) {
	var els = self.content.document.forms[0].elements;
	for (i = 0; i < els.length; i++) {
		if (els[i].name == 'article') {
			self.content.document.forms[0].relocate_lang.value = lang.options[lang.selectedIndex].value;
			self.content.document.forms[0].submit();
		}
	}
}
function getObject(obj) {
	if (document.all) {
		if (typeof obj == 'string') return document.all(obj);
		else return obj.style;
	}
	if (document.getElementById) {
		if (typeof obj == 'string') return document.getElementById(obj);
		else return obj.style;
	}
	return null;
}
function counter(textarea, left, text, max) {
	var textareaObj = getObject(textarea);
	var leftObj = getObject(left);
	var char_left = max - textareaObj.value.length;
	if (char_left <= 0) {
		char_left = 0;
		text = '<span style="color: red">' + text + '</span>';
		textareaObj.value = textareaObj.value.substr(0, max);
	}
	leftObj.innerHTML = text.replace('{CHAR}', char_left);
}
function close_menu() {
	var ar = document.getElementById('menu_div').getElementsByTagName('DIV');
	for (var i = 0; i < ar.length; i++) {
		ar[i].style.display = 'none';
	}
}
function switch_menu(obj) {
	if (document.getElementById) {
		var el = document.getElementById(obj);
		var ar = document.getElementById('menu_div').getElementsByTagName('DIV');
		if (el.style.display == 'none') {
			for (var i = 0; i < ar.length; i++) {
				ar[i].style.display = 'none';
			}
			el.style.display = 'block';
		}
		else {
			el.style.display = 'none';
		}
	}
}
function change_class(ID, oldClass, newClass) { 
	if (document.getElementById) {
		var el = document.getElementById(ID);
		var ar = document.getElementById('menu_div').getElementsByTagName('a');
		if (el.className == oldClass) {
			for (var i=0; i<ar.length; i++) {
				if (ar[i].className == newClass) {
					ar[i].className = oldClass;
				}
			}
			el.className = newClass;
		}
	} 
}
function change_translation() {
	var box = document.forms[0].tlang_id;
	var number = box.options[box.selectedIndex].value;
	var codes = document.getElementsByTagName('SPAN');
	var lang_code = document.getElementById('lang_code_' + number).innerHTML;
	var ar = window.frames['content'].document.getElementsByTagName('DIV');
	var div_found = false;
	for (var i = 0; i < ar.length; i++) {
		var div_id = ar[i].id;
		if (div_id.substr(0, 6) == 'trans_') {
			if (div_id == 'trans_' + number) {
				ar[i].style.display = 'block';
				div_found = true;
			}
			else ar[i].style.display = 'none';
		}
	}
	var table_rows = window.frames['content'].document.getElementsByTagName('TR');
	for (var i = 0; i < table_rows.length; i++) {
		var row_id = table_rows[i].id;
		if (row_id.substr(0, 8) == 'trans_tr') {
			if (div_found == true) table_rows[i].style.display = '';
			else table_rows[i].style.display = 'none';
		}
	}
	var code_span = window.frames['content'].document.getElementsByTagName('SPAN');
	for (var i = 0; i < code_span.length; i++) {
		if (code_span[i].id == 'trans_lang_code') {
			code_span[i].innerHTML = lang_code;
		}
	}
}
function show_rows(show_count, total_count, row_prefix) {
	for (i = show_count + 1; i <= total_count; i++) {
		document.getElementById(row_prefix + i).style.display = 'none';
	}
	for (i = 1; i <= show_count; i++) {
		document.getElementById(row_prefix + i).style.display = '';
	}
}
function show_fields(assoc, from, action_id) {
	/* action_id: 1 - add, 2 - remove, 3 - add all, 4 - remove all */
	var table_rows = document.getElementsByTagName('TR');
	for (var i = 0; i < table_rows.length; i++) {
		var row_id = table_rows[i].id;
		if (row_id.substr(0, 9) == 'trans_tr_' || row_id.substr(0, 6) == 'field_') {
			table_rows[i].style.display = 'none';
		}
	}
	if (action_id != 4) {
		var tlang = window.top.document.forms[0].tlang_id;
		var tlang_id = tlang.options[tlang.selectedIndex].value;
		var from_list = eval('document.forms[0].' + from);
		for (i = 0; i < from_list.options.length; i++) {
			var current = from_list.options[i];
			for (j = 0; j < assoc[current.value].length; j++) {
				var row_nr = assoc[current.value][j];
				document.getElementById('field_' + row_nr).style.display = '';
				if (document.getElementById('field_' + row_nr + '_nr')) {
					document.getElementById('field_' + row_nr + '_nr').style.display = '';
					var max_nr = document.getElementById('nr_fields_' + row_nr).options.length - 1;
					var sld = document.getElementById('nr_fields_' + row_nr).selectedIndex;
					show_rows(sld, max_nr, 'field_' + row_nr + '_');
				}
				if (tlang_id > 0) document.getElementById('trans_tr_' + row_nr).style.display = '';
			}
		}
	}
}
function change_checkboxes(check_id) {
	var main_check = document.getElementById('main_' + check_id);
	var inputs = document.getElementsByTagName('INPUT');
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].id == check_id) {
			inputs[i].checked = main_check.checked;
		}
	}
}
function fill_hidden(check_id) {
	var hidden_id = 'hidden_' + check_id;
	var ids = new String();
	var inputs = document.getElementsByTagName('INPUT');
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].id == check_id && inputs[i].checked == true) {
			ids += (ids.length == 0 ? '' : ',') + inputs[i].value;
		}
	}
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].id == hidden_id) {
			inputs[i].value = ids;
		}
	}
}
var container = new Object();
var d = new Date();
container.month = d.getMonth() + 1;
container.year = d.getFullYear();
container.choice_type = 1;
function get_link_pos(anchorname) {
	var coordinates = new Object();
	var x = 0;
	var y = 0;
 	if (document.getElementById && document.all) {
		x = get_link_pos_left(document.all[anchorname]);
		y = get_link_pos_top(document.all[anchorname]);
	}
	else if (document.getElementById) {
		var o = document.getElementById(anchorname);
		x = get_link_pos_left(o);
		y = get_link_pos_top(o);
	}
 	else if (document.all) {
		x = get_link_pos_left(document.all[anchorname]);
		y = get_link_pos_top(document.all[anchorname]);
	}
	else if (document.layers) {
		var found = 0;
		for (var i = 0; i < document.anchors.length; i++) {
			if (document.anchors[i].name == anchorname) { 
				found = 1;
				break;
			}
		}
		if (found == 0) {
			x = 0; 
			y = 0;
		}
		x = document.anchors[i].x;
		y = document.anchors[i].y;
	}
	else {
		x = 0; 
		y = 0; 
	}
	coordinates.x = x;
	coordinates.y = y;
	return coordinates;
}
function get_link_pos_left(el) {
	var ol = el.offsetLeft;
	while ((el = el.offsetParent) != null) {
		ol += el.offsetLeft;
	}
	return ol;
}
function get_link_pos_top(el) {
	var ot = el.offsetTop;
	while ((el = el.offsetParent) != null) {
		ot += el.offsetTop;
	}
	return ot;
}
function is_clicked(e, div_name) {
	if (document.layers) {
		var clickX = e.pageX;
		var clickY = e.pageY;
		var t = document.layers[div_name];
		if ((clickX > t.left) && (clickX < t.left + t.clip.width) && (clickY > t.top) && (clickY < t.top + t.clip.height)) return true;
		else return false;
	}
	else if (document.all) {
		var t = window.event.srcElement;
		while (t.parentElement != null) {
			if (t.id == div_name) return true;
			t = t.parentElement;
		}
		return false;
	}
	else if (document.getElementById && e) {
		var t = e.originalTarget;
		while (t.parentNode != null) {
			if (t.id == div_name) return true;
			t = t.parentNode;
		}
		return false;
	}
	return false;
}
function div_calender_check_hide(e) {
	div_name = container.div_name;
	if (!is_clicked(e, div_name)) {
		div_calender_hide(div_name);
	}
}
function div_calender_hide(div_name) {
	if (document.getElementById) document.getElementById(div_name).style.visibility = 'hidden';
	else if (document.all) document.all[div_name].style.visibility = 'hidden';
	else if (document.layers) document.layers[div_name].visibility = 'hidden';
}
function div_calender(div_name, prefix, reset_date, no_date_allowed) {
	if (reset_date == true) {
		var d = new Date();
		container.month = d.getMonth() + 1;
		container.year = d.getFullYear();
	}
	var link_name = prefix + 'cal';
	container.div_name = div_name;
	container.link_name = link_name;
	container.prefix = prefix;
	container.no_date_allowed = no_date_allowed;
	var content = div_calender_content(container.year, container.month);
	var coords = get_link_pos(link_name);
	var left_extra = 50;
	var top_extra = 0;
	if (document.getElementById || document.all) {
		if (document.getElementById) var elem = document.getElementById(div_name);
		else var elem = document.all[div_name];
		elem.innerHTML = content;
		elem.style.left = (coords.x + left_extra) + 'px';
		elem.style.top = (coords.y + top_extra) + 'px';
		elem.style.visibility = 'visible';
	}
	else if (document.layers) {
		var elem = document.layers[div_name];
		elem.innerHTML = content;
		elem.left = (coords.x + left_extra) + 'px';
		elem.top = (coords.y + top_extra) + 'px';
		elem.visibility = 'visible';
	}
	document.onmouseup = div_calender_check_hide;
}
function change_date(xday, xmonth, xyear) {
	var prefix = container.prefix;
	var d = new Date();
	if (container.choice_type == 1) {
		if (container.no_date_allowed == true) {
			xday++;
			xmonth++;
		}
		var found = 0;
		if (document.getElementById) {
			document.getElementById(prefix + 'day').selectedIndex = xday - 1;
			document.getElementById(prefix + 'month').selectedIndex = xmonth - 1;
			var opt = document.getElementById(prefix + 'year').options;
		}
		else if (document.all) {
			document.all[prefix + 'day'].selectedIndex = xday - 1;
			document.all[prefix + 'month'].selectedIndex = xmonth - 1;
			var opt = document.all[prefix + 'year'].options;
		}
		else if (document.layers) {
			document.layers[prefix + 'day'].selectedIndex = xday - 1;
			document.layers[prefix + 'month'].selectedIndex = xmonth - 1;
			var opt = document.layers[prefix + 'year'].options;
		}
		for (var i = 0; i < opt.length; i++) {
			if (opt[i].value == xyear) {
				found = 1;
				break;
			}
		}
		if (found == 0 && container.no_date_allowed != true && xyear < opt[0].value) i = 0;
		else if (found == 0 && container.no_date_allowed == true && xyear < opt[0].value) i = 1;
		else if (found == 0 && xyear > opt[opt.length - 1].value) i = opt.length - 1;
		if (container.no_date_allowed == true && xyear == 0) i = 0;
		if (document.getElementById) document.getElementById(prefix + 'year').selectedIndex = i;
		else if (document.all) document.all[prefix + 'year'].selectedIndex = i;
		else if (document.layers) document.layers[prefix + 'year'].selectedIndex = i;
	}
	else if (container.choice_type == 2) {
		var date_string = (String(xday).length == 1 ? '0' : '') + String(xday) + '.' + (String(xmonth).length == 1 ? '0' : '') + String(xmonth) + '.' + String(xyear);
		if (document.getElementById) {
			document.getElementById(prefix + 'date').value = date_string;
		}
		else if (document.all) {
			document.all[prefix + 'date'].value = date_string;
		}
		else if (document.layers) {
			document.layers[prefix + 'date'].value = date_string;
		}
	}
	div_calender_hide(container.div_name);
}
function div_calender_content(xyear, xmonth) {
	var content = '';
	var date = new Date(xyear, xmonth - 1, 1);
	var last_month = xmonth - 2;
	if (last_month < 0) last_month = 11;
	var next_month = xmonth;
	if (next_month > 11) next_month = 0;
	var day_of_week = date.getDay();
	if (day_of_week == 0) day_of_week = 7;
	var months = new Array('Jaanuar', 'Veebruar', 'M&auml;rts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'August', 'September', 'Oktoober', 'November', 'Detsember');
	var days_in_month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if (xyear % 4 == 0) days_in_month[1] = 29;
	var monday = 1;
	if (day_of_week > 1) monday = days_in_month[last_month] - (day_of_week - 1) + 1;
	content += '<table border="0" width="150" style="border: 1px solid #CCCCCC; background-color: #FBFBFB;">';
	content += '<tr style="font-weight: bold;"><td style="font-size: 10px; line-height: 160%;"><a href="javascript:void(0);" onclick="container.month=container.month-1;if(container.month==0)container.month=12;if(container.month==12)container.year=container.year-1;div_calender(container.div_name,container.prefix,false,container.no_date_allowed);">&laquo;</a></td><td colspan="7" style="text-align: center; font-size: 10px; line-height: 160%;">' + months[xmonth - 1] + ' ' + xyear + '</td><td style="font-size: 10px; line-height: 160%;"><a href="javascript:void(0);" onclick="container.month=container.month+1;if(container.month==13)container.month=1;if(container.month==1)container.year=container.year+1;div_calender(container.div_name,container.prefix,false,container.no_date_allowed);">&raquo;</a></td></tr>';
	content += '<tr><td colspan="9" style="border-bottom: 1px solid #CCCCCC;"></td></tr>';
	var days = new Array(42);
	var c = 0;
	if (monday > 1) {
		for (i = monday; i <= days_in_month[last_month]; i++) {
			days[c] = i;
			c++;
		}
	}
	for (i = 1; i <= days_in_month[xmonth - 1]; i++) {
		days[c] = i;
		c++;
	}
	for (i = 1; i <= 14; i++) {
		days[c] = i;
		c++;
		if (c == 42) break;
	}
	var days_in_weeks = new Array(6);
	for (i = 0; i < days_in_weeks.length; i++) {
		days_in_weeks[i] = new Array(7);
	}
	var week_count = 0;
	c = 0;
	for (i = 0; i < days.length; i++) {
		days_in_weeks[week_count][c] = days[i];
		if ((i + 1) % 7 == 0) {
			week_count++;
			c = 0;
		}
		else c++;
	}
	var d = new Date();
	var past_today = 0;
	var past_counter = -1;
	if ((xyear == d.getFullYear() && xmonth - 1 > d.getMonth()) || xyear > d.getFullYear()) past_today = 1;
	for (i = 0; i < 6; i++) {
		if (i == 5 && days_in_weeks[i][0] < 10) break;
		content += '<tr><td></td>';
		for (j = 0; j < 7; j++) {
			if ((days_in_weeks[i][j] == d.getDate() && xmonth - 1 == d.getMonth() && xyear == d.getFullYear() && ((i == 0 && days_in_weeks[i][j] <= 7) || i > 0)) || (days_in_weeks[i][j] == d.getDate() && i == 0 && days_in_weeks[i][j] > 15 && ((xmonth - 2 == d.getMonth() && xyear == d.getFullYear()) || (xmonth == 1 && d.getMonth() == 11 && xyear - 1 == d.getFullYear())))) {
				past_today = 1;
				past_counter = 0;
			}
			var text_color = (((i == 0 && days_in_weeks[i][j] > 15) || (i >= 4 && days_in_weeks[i][j] < 15)) ? 'gray' : 'black');
			if (container.choice_type == 2) {
				curr_month = xmonth;
				curr_year = xyear;
				if (i == 0 && days_in_weeks[i][j] > 15) {
					curr_month = (xmonth == 1 ? 12 : xmonth - 1);
					curr_year = (xmonth == 1 ? xyear - 1 : xyear);
				}
				else if (i >= 4 && days_in_weeks[i][j] < 15) {
					curr_month = (xmonth == 12 ? 1 : xmonth + 1);
					curr_year = (xmonth == 12 ? xyear + 1 : xyear);
				}
				var fdate_full = String(days_in_weeks[i][j]) + '-' + String(curr_month) + '-' + String(curr_year);
				var fdate_part = String(days_in_weeks[i][j]) + '-' + String(curr_month);
				var show_link = 1;
				if (past_today == 0) show_link = 0;
				else if (j >= 6 && container.exception_once[fdate_full] == undefined && container.exception_every[fdate_part] == undefined) show_link = 0;
				else if ((container.exception_once[fdate_full] != undefined && container.exception_once[fdate_full] == 0) || (container.exception_every[fdate_part] != undefined && container.exception_every[fdate_part] == 0)) show_link = 0;
				if (past_counter >= 0 && show_link == 1) past_counter++;
				if (past_counter >= 0 && ((past_counter <= 1 && d.getHours() < 14) || (past_counter <= 2 && d.getHours() >= 14) || (j == 0 && past_counter <= 2))) show_link = 0;
			}
			content += '<td style="text-align: right;' + (((i == 0 && days_in_weeks[i][j] > 15) || (i >= 4 && days_in_weeks[i][j] < 15)) ? '' : ((days_in_weeks[i][j] == d.getDate() && xmonth - 1 == d.getMonth() && xyear == d.getFullYear()) ? ' background-color: #fadadd;' : '')) + ((container.choice_type == 2 && show_link == 1) ? ' border: 1px solid #fadadd;' : '') + ' font-size: 10px; line-height: 160%;">';
			if (container.choice_type == 2 && show_link == 0) content += '<span style="color: ' + text_color + '">' + days_in_weeks[i][j] + '</span>';
			else content += '<a href="javascript:void(0);" onclick="change_date(' + days_in_weeks[i][j] + ',' + ((i == 0 && days_in_weeks[i][j] > 15) ? last_month + 1 : ((i >= 4 && days_in_weeks[i][j] < 15) ? next_month + 1 : xmonth)) + ',' + ((xmonth == 1 && i == 0 && days_in_weeks[i][j] > 15) ? xyear - 1 : ((xmonth == 12 && i >= 4 && days_in_weeks[i][j] < 15) ? xyear + 1 : xyear)) + ');" style="color: ' + text_color + ';">' + days_in_weeks[i][j] + '</a>';
			content += '</td>';
		}
		content += '<td></td></tr>';
	}
	if (container.no_date_allowed == true) {
		content += '<tr><td colspan="9" style="border-top: 1px solid #CCCCCC; text-align: center; font-size: 10px; line-height: 160%;"><a href="javascript:void(0);" style="color: black;" onclick="change_date(0,0,0);">ei m&auml;&auml;ra</a></td></tr>';
	}
	content += '</table>';
	return content;
}

function show(nr, id){
	for (i = nr; i <= 5; i++){
		document.getElementById(id + i).style.display = 'none';
	}
	for (i = 1; i <= nr; i++){
		document.getElementById(id + i).style.display = 'block';
	}
}

function set_picture(pic, thumb_width, thumb_height, el_id, max_width, max_height) {
	image_width = max_width
	image_height = max_width*thumb_height/thumb_width;
	if (image_height > max_height) {
		image_height = max_height;
		image_width = max_height*thumb_width/thumb_height;
	}
	picture_place = document.getElementById(el_id);
	if (picture_place) {
		picture_place.width = image_width;
		picture_place.height = image_height;
		picture_place.src = pic;
	}
}
function show_spec_boxes(box_type, prefix, action_id) {
	var inputs = document.getElementsByTagName('INPUT');
	for (var i = 0; i < inputs.length; i++) {
		var input_id = inputs[i].id;
		if (inputs[i].type == box_type && input_id.substr(0, prefix.length) == prefix) {
			if (action_id == 0) inputs[i].style.display = 'none';
			else inputs[i].style.display = 'inline';
		}
	}	
}
function change_values(current, sfield_id) {
	var chosen = document.getElementById('fields_' + sfield_id);
	if (document.getElementById('field_' + current.options[current.selectedIndex].value + '_' + sfield_id)) var csource = document.getElementById('field_' + current.options[current.selectedIndex].value + '_' + sfield_id).value;
	else var csource = '';
	if (chosen.type == 'text') {
		chosen.value = csource;
	}
	else if (csource != '') {
		var found = 0;
		for (var i = 0; i < chosen.length; i++) {
			if (chosen.options[i].value == csource) {
				chosen.selectedIndex = i;
				found = 1;
			}
		}
		if (found == 0) return false;
	}
	else chosen.selectedIndex = false;
	return true;
}
function change_picture(prefix, next_nr, max_nr) {
	for (i = 1; i <= max_nr; i++) {
		if (i == next_nr) document.getElementById(prefix + i).style.display = '';
		else document.getElementById(prefix + i).style.display = 'none';
	}
}
function search_submit(search_word, prefix) {
	search_word = search_word.replace(/ /g, '_');
	var new_loc = location.pathname;
	new_loc = new_loc.substr(0, new_loc.lastIndexOf('/') + 1);
	window.location = new_loc + prefix + '/' + search_word;
}