// JavaScript Document

var showVideoMask = false;
// closes Video popup
function closeVideoLayerPopup()
{
	document.getElementById("VideoMask").style.display = "none";
	document.getElementById("VideoLayer").style.display = "none";
	showVideoMask = false;
	document.getElementById("Video").innerHTML = '';
	//swfobject.embedSWF("fileadmin/content/media/stopsound.swf", "Video", "500", "450", "7.0.0", "", "");
	return false;
}


// displays Video popup
function showVideoLayer(swf){
	if (!showVideoMask){

		document.getElementById("VideoMask").style.display = "block";
		document.getElementById("VideoLayer").style.display = "block";

		var VideoTop = document.getElementById("VideoLayer").offsetTop;
		var VideoLeft = document.getElementById("VideoLayer").offsetLeft;
		var VideoWidth = document.getElementById("VideoLayer").offsetWidth;
		var VideoHeight = document.getElementById("VideoLayer").offsetHeight;
		var bigWidth = document.getElementById("VideoMask").offsetWidth;
		var bigHeight = (bigWidth / 4 * 3) - 50;

		var widthDelta = (bigWidth - VideoWidth)/2;
		var heightDelta = (bigHeight - VideoHeight)/2;
		var vXPosition = getScrollY(); 
		document.getElementById("VideoMask").style.top = "-35px";
		document.getElementById("VideoMask").style.height = "5000px";
		document.getElementById("VideoLayer").style.top = (vXPosition+50)+"px";		
		document.getElementById("VideoLayer").style.left = widthDelta+"px";
		showVideoMask = true;
		//document.getElementById("Video").innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="500" height="450"><param name="movie" value="'+swf+'" /><param name="allowScriptAccess" value="allways" /><param name="quality" value="high" /><embed src="'+swf+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" allowScriptAccess="allways" type="application/x-shockwave-flash" width="500" height="450"></embed></object>';
		document.getElementById("Video").innerHTML = '<iframe src="http://www.ceravid.net/fileadmin/content/media/mrclverfilm_contentholder.html" id="CleverVideo" width="440" height="400" scrolling="no" frameborder="0" allowtransparency="yes"></iframe>';
		var browserName = navigator.appName;
		var browserVer = parseInt(navigator.appVersion);
		var version = "";
		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
		if(msie4) document.getElementById('CleverVideo').contentWindow.location.reload();
	}

	return false;
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

function NachOben () {
  var y = 0;
  var browserName = navigator.appName;
  var browserVer = parseInt(navigator.appVersion);
  var version = "";
  var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
  if (msie4) {
	  document.getElementById("container").scrollTop = 0;
	  if(document.body.clientWidth <= 1018){
		  document.getElementById("bottom").style.bottom = "20px";
	  }
  }
}
