

function dokumentGeladen ( ) {
	
	$("innerContent").setStyle ( "opacity", 0 );
	$("shadow").setStyle ( "opacity", 0 );
	
	if ($("metahigh") != undefined ) $("metahigh").setStyle ( "opacity", 0.5 );
	if ($("subhigh") != undefined ) $("subhigh").setStyle ( "opacity", 0.5 );
	if ($("high") != undefined ) $("high").setStyle ( "opacity", 0.5 );
	
	$("logo").setStyle ( "" );
	$("logo").onclick = goHome;
	
	window.addEventListener('resize', onBGResize, false); 
	onBGResize ( );
		
}


function onBGResize ( ) {
	
	var cSize = getViewSize ( );
	
	var minWidth = 993;
	var minHeight = 593;
	
	if ( cSize[0] < minWidth ) {
		
		$("mainCont").setStyle ( "width", minWidth );
		
	} else {
		
		$("mainCont").setStyle ( "width", "100%" );
		
	}

	if ( cSize[1] < minHeight ) {
		
		$("mainCont").setStyle ( "height", minHeight );
		
	} else {
		
		$("mainCont").setStyle ( "height", "100%" );
		
	}
	
}




function goHome ( ) {
	
	var homeLink = mainPath + "index.html";
	
	location.href = homeLink;
	
}

function onImageLoaded ( ) {
	
	window.setTimeout ( "showContent()", 100 );
	
}

function showContent ( ) {
	
	$("innerContent").tween ( "opacity", 1 );
	$("shadow").tween ( "opacity", 1 );
	
}

var currentLink;

function onNavClick ( link ) {
	
	currentLink = link;
	
	//$("innerContent").set ( 'tween', { onComplete:changeSite } );
	//$("innerContent").tween ( "opacity", 0 );
	//$("nav_"+link).tween ( "opacity", 0.5 );
	
	changeSite ( );
	
	return false;
	
}

function changeSite ( ) {
	
	location.href = currentLink + ".html";
	
}


function getViewSize ( ) {
	
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }
	  
	  return new Array ( myWidth, myHeight );
	  
}



ready.push(function() {
	
	dokumentGeladen ();
	
});
