var MissionStatementStatus = false;
var MarkenStatus = false;

function LinkOver(t) {
	if (MissionStatementStatus == false) {
		$('#'+t.id).animate({'color':'#ffffff'},800);
	}
}

function LinkOut(t) {
	
	if (t.id == 'LinkNavigation5') {
		if (MissionStatementStatus == false) {
				$('#'+t.id).animate({'color':'#858585'},800);		
		}
	} else if (t.id == 'LinkNavigation6') {
		if (MarkenStatus == false) {
			$('#'+t.id).animate({'color':'#858585'},800);		
		}
	} else {
		$('#'+t.id).animate({'color':'#858585'},800);		
	}
	

	
	
}
function Get(o) {
	return document.getElementById(o);
}



function Fs (URL) {
     fswindow = window.open('/', "", "fullscreen=yes,left=0,top=0");
     fswindow.focus();
}
			

function EmotionEoverLay() {
	if (ShowEmotionClick == true) { 
	pTop = findPosTop(Get('Emotion'));
	pLeft = findPosLeft(Get('Emotion'))
	

	
	Get('EmotionOverlay').className = 'EmotionOverlayHolder';
	Get('EmotionOverlay').style.display = 'block';
	Get('EmotionOverlay').style.position = 'absolute';
	Get('EmotionOverlay').style.left = parseInt(pLeft) +'px';
	Get('EmotionOverlay').style.top = parseInt(pTop) + 236 +'px';
	var InnerHTML = '<div class="Right">';
	for (i=0;i<EmotionItems;i++) {
		Display = i+1;
		Active = '';
		if (i == CurrentEmotion) {
			Active = 'Active';
		}
		InnerHTML = InnerHTML + '<div onclick="javascript:SlideEmotionForce('+ i +')" style="cursor:pointer" class="BoxHolder'+ Active +'"><div class="Inner">'+ Display +'</div></div>';
	}   
	InnerHTML = InnerHTML + '<div class="Clear"></div></div><div class="Clear"></div>';
	Get('EmotionOverlay').innerHTML = InnerHTML;
	
	}
}


function InitPage() {
	WindowWidth = $(window).width();
	Start = ($(window).width()/2) - (980 / 2);
	PS = ($(window).height()/2) - (620/2);

	Get('BControls').style.display = 'none';
	Get('BNavigation').style.display = 'none';
	Get('BLogo').style.display = 'none';
	Get('BLanguage').style.display = 'none';
	Get('BContent').style.display = 'none';
	Get('BFooter').style.display = 'none';
	SetPagePosition();
}

function SetPagePosition() {
	
	
	Get('BControls').style.top = PS + 'px';
	Get('BControls').style.left = Start + 'px';
	Get('BControls').style.display = 'block';
	
	
	Get('BControls2').style.top = PS + 'px';
	Get('BControls2').style.left = Start + 'px';
	Get('BControls2').style.display = 'none';
	
	

	Get('BNavigation').style.top = PS + 120 + 'px';
	Get('BNavigation').style.left = Start + 'px';
	Get('BNavigation').style.display = 'block';

	
	Get('BLanguage').style.top = PS +10  + 'px';
	Get('BLanguage').style.left = Start +685 + 'px';		
	
	Get('BLanguage').style.display = 'block';
	
	Get('BMeta').style.top = PS  + 64 + 'px';
	if (Lang == 'en') {
		Get('BMeta').style.left = Start +640 + 'px';
	}else {
		Get('BMeta').style.left = Start +680 + 'px';
	}
	Get('BMeta').style.display = 'block';
	
	Get('BLogo').style.top = PS  + 'px';
	Get('BLogo').style.left = Start + 260 + 'px';
	Get('BLogo').style.display = 'block';
	

	Get('BFooter').style.top = PS + 122 + 439 + 'px';
	Get('BFooter').style.left = Start + 5 + 'px';
	Get('BFooter').style.display = 'block';

	Get('BFooterHolder').style.top = PS + 115 + 439 + 'px';
	Get('BFooterHolder').style.left = '0px';
	Get('BFooterHolder').style.display = 'block';

	
	
	
	Get('BContent').style.top = PS + 120  + 'px';
	Get('BContent').style.left = Start + 260 + 'px';
	Get('BContent').style.display = 'block';
	
	return false;

	

	
}

function ContentOut() {
	window.setTimeout('Out_Controls()',100);	
	window.setTimeout('Out_Logo()',500);
	window.setTimeout('Out_Footer()',800);
	window.setTimeout('Out_Navigation()',1000);
	window.setTimeout('Out_Content()',1000);
	window.setTimeout('Out_Meta()',1200);
	window.setTimeout('Out_Language()',1800);
	window.setTimeout('In_Controls2()',200);
}

var WindowWidth =0;
var	Start = 0;
var	PS = 0;

function Out_Controls() { $('#BControls').fadeOut(800);  }
function Out_Logo() { $('#BLogo').fadeOut(500);;  }
function Out_Footer() { $('#BFooterHolder').fadeOut(900);$('#BFooter').fadeOut(600);  }
function Out_Navigation() { $('#BNavigation').fadeOut(500);  }
function Out_Content() { $('#BContent').fadeOut(500);  }
function Out_Meta() { $('#BMeta').fadeOut(500);  }
function Out_Language() {  $('#BLanguage').fadeOut(500);  }
function Out_Controls2() {  $('#BControls2').fadeOut(500);  }

function In_Controls() { $('#BControls').fadeIn();  }
function In_Logo() { $('#BLogo').fadeIn(500);;  }
function In_Footer() { $('#BFooterHolder').fadeIn(); $('#BFooter').fadeIn();  }
function In_Navigation() { $('#BNavigation').fadeIn(500);  }
function In_Content() { $('#BContent').fadeIn(500);  }
function In_Meta() { $('#BMeta').fadeIn(500);  }
function In_Language() {  $('#BLanguage').fadeIn(500);  }


function In_Controls2() {
	$('#BControls2').slideDown(500); 
}

function ContentIn() {
	window.setTimeout('In_Controls()',100);	
	window.setTimeout('In_Logo()',500);
	window.setTimeout('In_Footer()',800);
	window.setTimeout('In_Navigation()',1000);
	window.setTimeout('In_Content()',1000);
	window.setTimeout('In_Meta()',1200);
	window.setTimeout('In_Language()',1800);
	window.setTimeout('Out_Controls2()',100);

}

function Toggle(Element) {
	
	if (O) {
		if (O.style.display == 'none') {
			$('#'+Element).slideDown();	
		} else {
			$('#'+Element).slideUp();	
		}
	}	
}
var PrevS = '';
function Sub(S) {
	Exe = true;
	if (PrevS != '') {
		if (S != PrevS) {
			$('#'+Element).slideUp();
			PrevS = '';
			window.setTimeout('Sub(\''+ S +'\')',500);
			Exe = false;
		}	
	}
	if (Exe == true) {
		Element = 'SubNavigation';
		O = document.getElementById(Element);
		if (O) {
			if (O.style.display == 'none') {
				$('#'+Element).slideDown();	
			} else {
				$('#'+Element).slideUp();	
			}
		}
		O.innerHTML = Get(S).innerHTML;
		PrevS = S ;
	}
}



function Standort() {
	window.setTimeout('White()',500);
	window.setTimeout('ShowStandwort()',1000);
	
	
}
function ShowStandwort() {
	InitStandort();
	$('#Standort').fadeIn(500);
}

function White() {
	InitWhite();
	$('#White').fadeIn(500);
}

function InitStandort() {
	Get('Standort').style.top = 150 + 'px';
	Get('Standort').style.left = $(window).width() / 2-250 + 'px';
	
}

function InitWhite() {

	Get('White').style.height = $(window).height() + 'px';
	Get('White').style.width = $(window).width() + 'px';
	
//	alert('i');
}

$(document).ready(function(){
	$('.Menu li li').addClass('level2');
	$('.Menu li').not('.level2').addClass('level1');

	$('.Menu .Submenu').slideUp(0); 
	$('.Menu .Submenu').last().css('left', '-73px');
	$('.Menu .Submenu').each(function(){
		$(this).find('li:last .Line').remove();
	});

	
  	
	$('.Menu li').not('.level2').hover(function(){
		$ul = $(this).find('ul');
		if ($ul.children().size() > 0)
		$(this).find('ul').stop(true, true).slideDown(500);
	}, function(){
		$(this).find('ul').stop(true, true).slideUp(500);
	});
});

var OpenElement = '';

function ToggleE(Element) {
	
	if (Get(Element)) {
	
	if (OpenElement.length > 0) {
		if (OpenElement != Element) {
			$('#'+ OpenElement).slideUp();
		}
	}
	
	if (Get(Element).style.display == 'none') {
		$('#'+ Element).slideDown();	
	} else {
		$('#'+ Element).slideUp();		
	}
	OpenElement = Element;

	}
}

