// Main JS

var defaultStatusText = 'Základní škola Masarykova Rychnov nad Kněžnou';
window.defaultStatus = defaultStatusText;

function ws(txt) {
	if (!txt) window.status = defaultStatus;
	else window.status = txt;
	return true;
}
function getCenterW(width) {
	return parseInt( eval( (screen.width-parseInt(width))/2 ) );
}
function getCenterH(height) {
	return parseInt( eval( (screen.height-parseInt(height))/2 ) );
}
function popupFile(src,w,h) {
	window.open(src,'popup','width='+w+',height='+h+',resizable=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=no,screenX='+getCenterW(w)+',screenY='+getCenterH(h)+',top='+getCenterH(h)+',left='+getCenterW(w));
}
function popupImg(src,w,h) {
	xWidth = w + 40;
	xHeight = h + 40;
	winpopup = window.open('','popup','width='+xWidth+',height='+xHeight+',resizable=no,menubar=no,scrollbars=no,status=no,toolbar=no,screenX='+getCenterW(xWidth)+',screenY='+getCenterH(xHeight)+',top='+getCenterH(xHeight)+',left='+getCenterW(xWidth));
	winpopup.document.open();
	winpopup.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n');
	winpopup.document.write('<html>\n<head>\n');
	winpopup.document.write('<title>' + defaultStatusText + '</title>\n');
	winpopup.document.write('<style type="text/css">\n');
	winpopup.document.write('<!--\n');
	winpopup.document.write('IMG {\n');
	winpopup.document.write('	margin-top:' + (xHeight - h)/2 + 'px;\n');
	winpopup.document.write('	margin-left:' + (xWidth - w)/2 + 'px;\n');
	winpopup.document.write('	padding:1px;\n');
	winpopup.document.write('	border:1px solid #BBBBBB;\n');
	winpopup.document.write('}\n');
	winpopup.document.write('-->\n');
	winpopup.document.write('</style>\n');
	winpopup.document.write('</head>\n');
	winpopup.document.write('<body style="margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; background-color: #F9F9F9;">\n');
	winpopup.document.write('<a href="#" onclick="window.close(); return false;" title="Zavřít">\n	<img src="'+src+'" width="'+w+'" height="'+h+'" border="0" alt="Zavřít" align="center"><br>\n</a>\n');
	winpopup.document.write('</body>\n</html>\n');
	winpopup.document.close();
}
function menuOver(obj,classPrefix,classSuffix) {
	if (!classSuffix) classSuffix = 'Ovr';
	if (obj.className == classPrefix)
		obj.className = obj.className + classSuffix;
	else
		obj.className = classPrefix;
	if (menuInitItem && menuInitItem > 0)
		document.getElementById('item'+menuInitItem).className = classPrefix + classSuffix;
}
function menuClick(src) {
	document.location.href = src;
}
function menuInit(item,classPrefix,classSuffix) {
	if (item && item > 0) {
		document.getElementById('item'+item).className = classPrefix + classSuffix;
		menu.Mouse(item,'ovr');
	}
}

