var slide=new Array();
slide[0]=new Array();
	slide[0].img=new Image();
	slide[0].img.src="/img/image1.jpg";
	slide[0].delay=5000;
slide[1]=new Array();
	slide[1].img=new Image();
	slide[1].img.src="/img/image2.jpg";
	slide[1].delay=5000;
	
var count=slide.length;
var current=-1;
var timer;
function StartSlide() {
	if (++current>count-1) current=0;
	document.getElementById("slide").style.backgroundImage="url("+slide[current].img.src+")";
	timer=setTimeout('StartSlide()',slide[current].delay);
}
function StopSlide() {
	clearTimeout(timer);
}

function ShowPhotos(div,lang) {
	var visible=(div.previousSibling.style.display=='none')?false:true;
	if (visible) {
		div.previousSibling.style.display='none';
		div.innerHTML=(lang=='pl')?'Rozwiń galerię':'Galerie erweitern';
	}
	else {
		div.previousSibling.style.display='';
		div.innerHTML=(lang=='pl')?'Zwiń galerię':'Galerie verkleinern';
	}
}

function Search() {
	var lang=document.body.className;
	var adr=new Array();
		adr['pl']='szukaj';
		adr['de']='suche';
	if (document.forms[0].elements[0].value.length>2)
		document.location.href='/'+lang+'/'+adr[lang]+'/'+document.forms[0].elements[0].value;//escape,encodeURI
	return false;
}

function CreateSubMenu() {
	var mlang;
	if (document.body.className=="pl")
		mlang=new Array(
				"/pl/swiadkowie_polscy",
				"/pl/swiadkowie_niemieccy",
				"/pl/relacje_polskie",
				"/pl/relacje_niemieckie",
				"/pl/archiwalia_niemieckie",
				"/pl/archiwalia_polskie",
				"/pl/krzyz_dzisiaj");
	else
		mlang=new Array(
				"/de/polnische_zeitzeugen",
				"/de/deutsche_zeitzeugen",
				"/de/polnische_erinnerungen",
				"/de/deutsche_erinnerungen",
				"/de/deutsche_archivalien",
				"/de/polnische_archivalien",
				"/de/krzyz_heute");

	var menu=document.getElementById("menu");

	// Create sub menu "Swiadkowie"
	var tab=document.createElement("table");
	tab.cellSpacing=0;
	tab.cellPadding=0;
	tab.style.display="none";
	tab.id="sm_swiadkowie";
	tab.onmouseover=function() { this.style.display=""; };
	tab.onmouseout=function() { this.style.display="none"; };
	with(tab.insertRow(0).insertCell(0)) { height=3; colSpan=3; className="sm_frame_t1"; }
	with(tab.insertRow(1)) {
		with(insertCell(0)) { height=30; width=5; className="sm_frame_lt"; }
		with(insertCell(1)) {
			var a=document.createElement("a");
			a.href=mlang[0];
			a.className="m21";
			appendChild(a); }
		with(insertCell(2)) { width=5; className="sm_frame_rt"; }
	}
	with (tab.insertRow(2).insertCell(0)) { height=1; colSpan=3; className="sm_frame_m1"; }
	with(tab.insertRow(3)) {
		with(insertCell(0)) { height=30; className="sm_frame_lb"; }
		with(insertCell(1)) {
			var a=document.createElement("a");
			a.href=mlang[1];
			a.className="m22";
			appendChild(a); }
		with(insertCell(2)) { className="sm_frame_rb"; }
	}
	with (tab.insertRow(4).insertCell(0)) { height=5; colSpan=3; className="sm_frame_b1"; }
	menu.rows[0].cells[2].appendChild(tab);
	with(menu.rows[0].cells[2].firstChild) {
		onmouseover=function() { className="hover"; document.getElementById("sm_swiadkowie").style.display=""; };
		onmouseout=function() { className=""; document.getElementById("sm_swiadkowie").style.display="none"; };
	}

	// Create sub menu "Tematy"
	tab=document.createElement("table");
	tab.cellSpacing=0;
	tab.cellPadding=0;
	tab.style.display="none";
	tab.id="sm_tematy";
	tab.onmouseover=function() { this.style.display=""; };
	tab.onmouseout=function() { this.style.display="none"; };
	with(tab.insertRow(0).insertCell(0)) { height=3; colSpan=3; className="sm_frame_t2"; }
	with(tab.insertRow(1)) {
		with(insertCell(0)) { height=30; width=5; className="sm_frame_lt"; }
		with(insertCell(1)) {
			var a=document.createElement("a");
			a.href=mlang[2];
			a.className="m31";
			appendChild(a); }
		with(insertCell(2)) { width=5; className="sm_frame_rt"; }
	}
	with (tab.insertRow(2).insertCell(0)) { height=1; colSpan=3; className="sm_frame_m2"; }
	with(tab.insertRow(3)) {
		with(insertCell(0)) { height=30; className="sm_frame_lb"; }
		with(insertCell(1)) {
			var a=document.createElement("a");
			a.href=mlang[3];
			a.className="m32";
			appendChild(a); }
		with(insertCell(2)) { className="sm_frame_rb"; }
	}
	with (tab.insertRow(4).insertCell(0)) { height=5; colSpan=3; className="sm_frame_b2"; }
	menu.rows[0].cells[3].appendChild(tab);
	with(menu.rows[0].cells[3].firstChild) {
		onmouseover=function() { className="hover"; document.getElementById("sm_tematy").style.display=""; };
		onmouseout=function() { className=""; document.getElementById("sm_tematy").style.display="none"; };
	}
	
	// Create sub menu "Galeria"
	var sm3='<table cellspacing=0 cellpadding=0 id="sm_galeria" style="display:none" onmouseover="this.style.display=\'\'" onmouseout="this.style.display=\'none\'">';
	sm3+='<tr><td height=3 colspan=3 class="sm_frame_t3"></td></tr>';
	sm3+='<tr><td height=30 width=5 class="sm_frame_lt"></td>';
	sm3+='<td><a href="'+mlang[4]+'" class="m41"></a></td>';
	sm3+='<td width=5 class="sm_frame_rt"></td></tr>';
	sm3+='<tr><td height=1 colspan=3 class="sm_frame_m3"></td></tr>';
	sm3+='<tr><td height=30 class="sm_frame_lm"></td>';
	sm3+='<td><a href="'+mlang[5]+'" class="m42"></a></td>';
	sm3+='<td class="sm_frame_rm"></td></tr>';
	sm3+='<tr><td height=1 colspan=3 class="sm_frame_m3"></td></tr>';
	sm3+='<tr><td height=30 class="sm_frame_lb"></td>';
	sm3+='<td><a href="'+mlang[6]+'" class="m43"></a></td>';
	sm3+='<td class="sm_frame_rb"></td></tr>';
	sm3+='<tr><td height=5 colspan=3 class="sm_frame_b3"></td></tr>';
	sm3+='</table>';
	menu.rows[0].cells[4].innerHTML+=sm3;

	with(menu.rows[0].cells[4].firstChild) {
		onmouseover=function() { className="hover"; document.getElementById("sm_galeria").style.display=""; };
		onmouseout=function() { className=""; document.getElementById("sm_galeria").style.display="none"; };
	}
	
	with(document.getElementById("search").rows[0].cells[1].firstChild) {
		onmouseover=function() { className="hover"; };
		onmouseout=function() { className=""; };
		onclick=function() { Search(); };
	}
}

window.onload=function() {
	StartSlide();
	CreateSubMenu();
};
/*
<table width=157 cellspacing=0 cellpadding=0 id="sm_swiadkowie" style="display:none" onmouseover="this.style.display=''" onmouseout="this.style.display='none'">
<tr><td height=3 colspan=3 class="sm_frame_t1"></td></tr>//
<tr><td height=30 width=5 class="sm_frame_lt"></td>
	<td width=147 class="m21"><a href="swiadkowie_polscy"></a></td>
	<td width=5 class="sm_frame_rt"></td></tr>
<tr><td height=1 colspan=3 class="sm_frame_m1"></td></tr>//
<tr><td height=30 class="sm_frame_lb"></td>
	<td class="m22"><a href="swiadkowie_niemieccy"></a></td>
	<td class="sm_frame_rb"></td></tr>
<tr><td height=5 colspan=3 class="sm_frame_b1"></td></tr>
</table>

<table width=175 cellspacing=0 cellpadding=0 id="sm_tematy" style="display:none" onmouseover="this.style.display=''" onmouseout="this.style.display='none'">
<tr><td height=3 colspan=3 class="sm_frame_t2"></td></tr>
<tr><td height=30 width=5 class="sm_frame_lt"></td>
	<td width=165 class="m31"><a href="relacje_polskie"></a></td>
	<td width=5 class="sm_frame_rt"></td></tr>
<tr><td height=1 colspan=3 class="sm_frame_m2"></td></tr>
<tr><td height=30 class="sm_frame_lb"></td>
	<td class="m32"><a href="relacje_niemieckie"></a></td>
	<td class="sm_frame_rb"></td></tr>
<tr><td height=5 colspan=3 class="sm_frame_b2"></td></tr>
</table>
*/