var shownmenus=new Array();
var idHide=0;

function dropit(e,whichone,dropby,parent) {
donthide(e);
themenu=document.getElementById(whichone);
themenuStyle=themenu.style;
if (themenuStyle.visibility=="visible")
	return false;

if (parent!='') {
	parentid=document.getElementById(parent).id;
	themenuStyle.backgroundColor=document.getElementById(parent).style.backgroundColor;
	document.getElementById(whichone).firstChild.style.borderLeftColor=themenuStyle.backgroundColor;
	}
else {
	themenuStyle.backgroundColor=dropby.style.backgroundColor;
	document.getElementById(whichone).firstChild.style.borderLeftColor=dropby.style.backgroundColor;
	parentid=0;
	}
hidemenu2(parentid);

element=dropby;
w=element.offsetWidth;
var L=element.offsetLeft, T=element.offsetTop;
while(element.offsetParent){
	element=element.offsetParent;
	L+=element.offsetLeft;
	T+=element.offsetTop;
	}
themenuStyle.left=L+w+'px';
themenuStyle.top=T+'px';
iframestyle=document.getElementById('i'+whichone).style;
iframestyle.left=themenuStyle.left;
iframestyle.top=themenuStyle.top;
iframestyle.width=themenu.offsetWidth+'px';
iframestyle.height=themenu.offsetHeight+'px';

if (shownmenus.push) {
	shownmenus.push(whichone);
	iframestyle.display="block";
	}
else
	shownmenus[shownmenus.length]=whichone;
themenuStyle.visibility="visible";
return false;
}

function hidemenu() {
return hidemenu2(0);
}
function hidemenu2(parentid) {
i=shownmenus.length;
notfound=true;
while (i>0 && parentid!=shownmenus[i-1]) {
	if (shownmenus.pop)
		themenuid=shownmenus.pop();
	else {
		themenuid=shownmenus[shownmenus.length-1];
		shownmenus.length=shownmenus.length-1;
		}
	iframestyle=document.getElementById('i'+themenuid).style;
	iframestyle.display="none";
	document.getElementById(themenuid).style.visibility="hidden";
	i--;
	}
return false;
}

function donthide(e) {
	e.cancelBubble = true;
if (e.stopPropagation) {
	e.stopPropagation();
	}
else {
	}
return false;
}

document.onmouseover=hidemenu

function clk(n) {
if(document.images){
	(new Image()).src="count.php?banner_id="+n;
	}
return true;
}

var prevData;

function customDateString() {
d = new Date();
if (d && (d.getHours()+d.getMinutes())!=prevData) {
	minuty=d.getMinutes();
	rok = d.getYear();
	if (rok<200) rok=rok+1900;
	if (minuty<10) minuty='0'+minuty;
	document.getElementById('data').innerHTML='<b>'+d.getHours()+':'+minuty+'</b><br>'+dow[d.getDay()]+', '+d.getDate()+' '+months[d.getMonth()]+' '+rok;
	prevData=d.getHours()+d.getMinutes();
	}
return false;
}

function openpic2(pic,code) {
img=document.getElementById('galimg');
img.src=pic;
//img.onload=mymove;
document.getElementById('galcontent').innerHTML=code;
return false;
}

function hidepic() {
document.getElementById('gal').style.visibility="hidden";
document.getElementById('igal').style.display="none";
return false;
}

function mymove()  {
whichone=document.getElementById('galimg');
ghost=document.getElementById('gal');
mytop=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
myleft=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
mywidth=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth);
myheight=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
ighost=document.getElementById('igal');

if (whichone.width>0) {
	ghost.style.left=myleft+(mywidth-whichone.width-60)/2+'px';
	ghost.style.width=whichone.width+60+'px';
	ighost.style.left=ghost.style.left;
	ighost.style.width=whichone.width+102+'px';
	}
if (whichone.height>0) {
	ghost.style.top=mytop+(myheight-whichone.height-50)/2+'px';
	ghost.style.height=whichone.height+50+'px';
	ighost.style.top=ghost.style.top;
	ighost.style.height=whichone.height+52+'px';
	}
else {
	ghost.style.top=mytop+10+'px';
	}
if (whichone.src.indexOf('images/logo.jpg')==-1)  {
	ghost.style.visibility='visible';
	ighost.style.display='block';
//	ghost.style.display='block';
	}
return true;
}

function getSWFHTML(plik,w,h) {
var swfNode = "";
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
	swfNode = '<embed type="application/x-shockwave-flash" src="'+ plik +'" width="'+ w +'" height="'+ h +'" quality="high" wmode="transparent">';
} else { // PC IE
	swfNode  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ w +'" height="'+ h +'">';
	swfNode += '<param name="movie" value="'+ plik +'">';
	swfNode += '<PARAM NAME=quality VALUE=high>';
	swfNode += '<PARAM NAME=wmode VALUE=transparent>';
	swfNode += '</object>';
	}
document.write(swfNode);
return false;
}
var idInt;
var scrollpos=0;
var mychild;
function InitScroll() {
scr=document.getElementById('scroller');
if (scr.childNodes.length>2) {
	idInt = window.setInterval("animuj()", 50);
	}
else if (scr.childNodes.length>0) {
	minheight=scr.offsetHeight;
	for (i=1;i<scr.childNodes.length;i++) {
		minheight2=scr.childNodes.item(i).offsetHeight+scr.childNodes.item(i-1).offsetHeight;
		if (minheight2<minheight)
			minheight=minheight2;
		}
	document.getElementById('today').style.height=minheight+'px';
	document.getElementById('container').style.height=minheight+'px';
	}
else {
	document.getElementById('today').style.display='none';
	}
}
function animuj() {
scr=document.getElementById('scroller');
scrollpos--;
scr.style.top=scrollpos+'px';
if (!mychild) {
	mychild=scr.firstChild;
	scrollpos=document.getElementById('container').offsetHeight;
	scr.style.top=scrollpos+'px';
	}
if ((scrollpos+mychild.offsetTop<=0 && mychild.nextSibling) || (scrollpos+mychild.offsetTop+mychild.offsetHeight<=0 && !mychild.nextSibling)){
	window.clearInterval(idInt);
	window.setTimeout("InitScroll()", 1000);
	mychild=mychild.nextSibling?mychild.nextSibling:false;
	}
}

function InitKalendarium() {
scr=document.getElementById('kalendarium');
if (scr) {
	i=scr.childNodes.length;
	while ((i>1) && (scr.offsetHeight>160)) {
		if (scr.childNodes.item(i-1).style)
			scr.childNodes.item(i-1).style.display='none';
		i--;
		}
	}
}
function InitAll() {
setInterval('customDateString()',1000);
InitScroll();
InitKalendarium();
}



function hide_ghostban() {
document.getElementById('ghostdiv').style.display='none';
document.getElementById('ghostban').style.display='none';
//document.body.style.overflow='';
document.getElementById('ALL').style.height='auto';
document.getElementById('ALL').style.overflow='';
document.getElementById('ALL').style.position='';
return true;
}

function mymove_ghostban()  {
whichone=document.getElementById('ghostimg');
ghost=document.getElementById('ghostban');
mytop=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
myheight=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);

if (whichone.height>0) {
	ghost.style.top=mytop+(myheight-whichone.height)/2+'px';
	}
else if (ghostheight>0) {
	ghost.style.top=mytop+(myheight-ghostheight)/2+'px';
	}
ghost.style.display='block';
document.getElementById('ghostdiv').style.display='block';
document.getElementById('ALL').style.height='100%';
document.getElementById('ALL').style.overflow='hidden';
document.getElementById('ALL').style.position='relative';
return true;
}

