function preload(pic_array) {
  for(i = 0; i < pic_array.length; i++) {
		if (i < 2)
			prefix = '/images';
		else
			prefix = '/images/cs'
		eval(pic_array[i] + '_i = new Image;');
		eval(pic_array[i] + '_a = new Image;');
		eval(pic_array[i] + '_i.src = "' + prefix + '/' + pic_array[i] + '_i.gif";');
		eval(pic_array[i] + '_a.src = "' + prefix + '/' + pic_array[i] + '_a.gif";');
  }
}


var pics = new Array("bt_de", "bt_cs", "bt_0", "bt_1", "bt_2", "bt_3", "bt_4", "bt_5", "bt_6", "bt_7", "bt_8", "bt_9", "bt_10", "bt_11", "bt_12");

preload(pics);

function activate(n) {
  eval("document.images." + n + ".src = " + n + "_a.src");
}

function deactivate(n) {
  eval("document.images." + n + ".src = " + n + "_i.src");
}

function activate_td(element) {
	element.style.backgroundColor = '#4192B6';
}

function deactivate_td(element) {
	element.style.backgroundColor = '#70ADC8';
}

function addfav() {
	window.external.AddFavorite( 'http://www.daad.cz', 'DAAD IC Prague');
}

function printPage() {
	window.print();
}

function editorOtevri(link) {
	window.open(link, 'EDITOR', 'directories=0,location=0,menubar=0,scrollbars=0,resizable=0,status=0,titlebar=0,toolbar=0,width=640,height=480');
}

function editorNacti(editor, co) {
	if ((cil = document.getElementById(editor)) && (zdroj = window.opener.document.forms['edit_form'].elements[co]))
		cil.value = zdroj.value;
}

function editorZavri() {
	window.opener.focus();
	window.close();
}

function editorUloz(kam, editor) {
	var cd = window.opener.document;

	if ((cil = cd.forms['edit_form'].elements[kam]) && (zdroj = document.getElementById(editor + '___Frame').contentWindow.document.getElementById('eEditorArea').contentWindow.document.body)) {
		cil.value = zdroj.innerHTML;
		if ((cil2 = cd.getElementById('td_' + kam)))
			cil2.innerHTML = zdroj.innerHTML;
	}
	editorZavri();
}
