if(typeof background != "undefined" && background != '') {
	window.onload = rbInit;
	if(checkIE56()) {
		window.onresize = rbReload;		
	} else {
		window.onresize = rbResize;		
	}
	rbOpen('center');
	rbClose(background);
}
function SpruchInit() {
if (document.getElementsByTagName('body')[0] && document.getElementsByTagName('body')[0].className == 'spruchani') {
	if($$('#menu td')) {
		var spruchtimeout = window.setInterval("Spruch()", 2800);
	}
}
}
function Spruch(popups) {
	if($$('#menu td')) {
		$$('#menu td').each(function(node) {
			if(node.hasClassName('spruch')) {
				node.removeClassName('spruch');
			}
		});
		var i = Math.round(Math.random() * ($$('#menu td').length-1));
		var tdspruch = $$('#menu td')[i];
		tdspruch.addClassName('spruch');
	}
}
function IE56Hover() {
		if($$('#menu td')) {
			$$('#menu td').each(function(node) {
				node.getElementsByClassName('clickblock').each(function(subnode) {
					subnode.getElementsByClassName('head').each(function(subsubnode) {
 	 				 	subsubnode.hide();
						subsubnode.parentNode.attachEvent('onmouseover', function(){
							subsubnode.setStyle('display:block;');
							subsubnode.show();
							if(subsubnode.parentNode.parentNode.hasClassName('spruch')) {
								subsubnode.parentNode.parentNode.removeClassName('spruch');
							}
						});
						subsubnode.parentNode.attachEvent('onmouseout', function(){
							subsubnode.setStyle('display:none;');	
							subsubnode.hide();
						});
					});
				});
			});
		}
}

SpruchInit();

if(checkIE56()) {
	IE56Hover();
}

var oldimagepath;

function switchNav(self,id,path) {
	if($(id)) {
		if(checkIE56()) {
		 	oldimagepath = $(id).outerHTML.split("src='")[1];
			oldimagepath = oldimagepath.split("', sizing")[0];
			$(self).style.filter = 'alpha(opacity=' + 100 + ')';
		} else {
			oldimagepath = $(id).src;
		}
		changeNavImg($(id), path);
	}
}

function reswitchNav(self, id) {
	if($(id)) {
		changeNavImg($(id), oldimagepath);
		if(checkIE56()) {
			$(self).style.filter = 'alpha(opacity=' + 50 + ')';
		}
	}
}

function changeNavImg(id, path) {
		if(checkIE56()) {
				var	_4 = id;
	            var _6 = (_4.id) ? "id='" + _4.id + "' " : "";
	            var _7 = (_4.className) ? "class='" + _4.className + "' " : "";
	            var _8 = (_4.title) ? "title='" + _4.title + "' " : "title='" + _4.alt + "' ";
	            var _9 = "display:inline-block;";
	            if(_4.align == "left") {
	               _9 = "float:left;" + _9;
	               }
	            if(_4.align == "right") {
	               _9 = "float:right;" + _9;
	               }
	            if(_4.parentElement.href) {
	               _9 = "cursor:hand;" + _9;
	               }
	            var _a = "<span " + _6 + _7 + _8 + " style=\"" + "width:" + 500 + "px; height:" + 30 + "px;" + _9 + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src='" + path + "', sizingMethod='crop');\"></span>";
	            _4.outerHTML = _a;
		} else {
			id.src = path;
		}	
}

function checkIE56() {
		if(navigator.appName == "Microsoft Internet Explorer") {		
			var _1 = navigator.appVersion.split("MSIE");
	   		var _2 = parseFloat(_1[1]);
		    if((_2 >= 5.5) && (_2 < 7) && (document.body.filters)) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
}