Hyphenator.setDisplayToggleBox(false);               
Hyphenator.addExceptions('ziem-lich');               
Hyphenator.run();	

window.addEvent('load', function(){

		function externalLinks() {
			if (!document.getElementsByTagName) return;
			var anchors = document.getElementsByTagName("a");
			for (var i=0; i<anchors.length; i++) {
				var anchor = anchors[i];
				if (
					anchor.getAttribute("href") && ( 
					anchor.getAttribute("rel") == "external" || 
					anchor.getAttribute("rel") == "external nofollow" || 
					anchor.getAttribute("rel") == "nofollow external" )
					)
				anchor.target = "_blank";
			}
		}

		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'container') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		
		
		function setContent() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				
					var headerMainHeight = 150;
					var headerSubHeight = 180;
					var headerHeight = headerMainHeight + headerSubHeight;

					
					var newsTop = document.getElementById('news_top');
					var newsSub = document.getElementById('news_sub');
					var contentContainer = document.getElementById('contentContainer');
					var content = document.getElementById('content');
					
					var newsTopHeight = newsTop.offsetHeight - 20;
					var newsSubHeight = newsSub.offsetHeight;
					var contentHeight =  content.offsetHeight;

					var contentContainerHeight = contentContainer.offsetHeight;
					
					 if (navigator.appName == "Microsoft Internet Explorer") //IE
					 {
						if (window.XMLHttpRequest) 
						{
							var theHeight = ((windowHeight) - (newsTopHeight)) + 120 + 'px';		
						}
						else
						{
							var theHeight = ((windowHeight) - (newsTopHeight)) + 112 + 'px';
						}
					 }
					 else if (window.devicePixelRatio)//Safari
					 {
						document.getElementById('nav_main').style.paddingTop = 2.2 + 'em';
						document.getElementById('nav_sub').style.paddingTop = 8 + 'em';

					 	var theHeight = ((windowHeight) - (newsTopHeight)) + 101 + 'px';	
					 }					 
					 else//others
					 {
						var theHeight = ((windowHeight) - (newsTopHeight)) + 129 + 'px';		 
					 }
					
								

					if (windowHeight > (contentHeight+newsTopHeight)) 
					{					
						newsTop.style.height = theHeight;
						newsSub.style.height = theHeight;
						
						if (window.devicePixelRatio)//Safari
						{
							contentContainer.style.height = ((windowHeight) - (headerHeight)) - 40 + 'px';
						}
						else
						{
						contentContainer.style.height = ((windowHeight) - (headerHeight)) - 40 + 'px';
						newsTop.style.height = theHeight;
						newsSub.style.height = theHeight;
						}
						

					}
					else
					{
						newsTop.style.height = newsTopHeight - 140 + "px";
						newsSub.style.height = newsTopHeight - 140 + "px";
						contentContainer.style.height = newsTopHeight - 140 + "px";			
					}
			}
		}
		
		setContent();
		externalLinks();

					

});

