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 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 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);
}
// menüü
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;
		}
	} 
}
