  var currTextElement = 0;
  var arrHeadlineElements = new Array();
  function nextHeadlineText() {
    $('#headerHeadlineWords').hide();
    $('#headerHeadlineWords').html(arrHeadlineElements[currTextElement]);
    currTextElement++;
    if (currTextElement >= arrHeadlineElements.length) currTextElement = 0;
    //$('#headerHeadlineWords').fadeIn(2000);
    $('#headerHeadlineWords').show();
  }

$(document).ready(function(){
    
    // footer entsprechend so hoch machen, dass er ans seitenende ragt
    var position = $('#footer div.footerRight').position();
    if (position.top+$('#footer div.footerRight').height() < $(window).height()) {
      var newHeight = $(window).height()-position.top-20;
      $('#footer div.footerRight').css('height', newHeight+'px');  
    }
  
    var headlineText = $('#headerHeadlineWords').html();            	
    arrHeadlineElements = headlineText.split(',');
    currTextElement = GetRandom(0, arrHeadlineElements.length-1);
    nextHeadlineText();
    //window.setInterval(function(){nextHeadlineText();}, 5000);    
	  //$('#menuNav_1').hover(show1);
	  //$('#menuNav_2').hover(show2);
	  //$('#menuNav_3').hover(show3);
	  //$('#menuNav_4').hover(show4);
	  //$('#menuNav_5').hover(show5);
	  
	  //$('div.topPanel').hover(out);
	});
		function show1(){
			out();
			$('#submenu_1').show();
		}
		function show2(){
			out();
			$('#submenu_2').show();
		}
		function show3(){
			out();
			$('#submenu_3').show();
		}
		function show4(){
			out();
			$('#submenu_4').show();
		}
		function show5(){
			out();
			$('#submenu_5').show();
		}
		
		function out(){
			$('#submenu_1').hide();
			$('#submenu_2').hide();
			$('#submenu_3').hide();
			$('#submenu_4').hide();
			$('#submenu_5').hide();
		}
		
  function GetRandom( min, max ) {
  	if( min > max ) {
  		return( -1 );
  	}
  	if( min == max ) {
  		return( min );
  	}
    return( min + parseInt( Math.random() * ( max-min+1 ) ) );
  }
		
