function bookmark(url,title){
	var sOtherBrowserAlertMsg = "Bitte drücken Sie Strg-D (Netscape) oder Strg-T (Opera), um diese Seite zu bookmarken!";
	try {
		if ((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 4)) {
			window.external.AddFavorite(url,title);
		} else if (navigator.appName == 'Netscape') {
			window.sidebar.addPanel(title,url,'');
		} else {
			alert(sOtherBrowserAlertMsg);
		}
	} catch (e) {
		alert(sOtherBrowserAlertMsg);
	}
}


//USED from the sportticker!!!
function openWindow(url,name,w,h,scroll) {
		var win = null;
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        eigenschaften = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
        win = window.open(url,name,eigenschaften)
}


<!--
// mediathek.js
var b= navigator.userAgent.toLowerCase();
var $ = {

	browser: {
		version: (b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
		safari: /webkit/.test(b),
		opera: /opera/.test(b),
		msie: /msie/.test(b) && !/opera/.test(b),
		mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
	}
};



if(typeof g_windowWidth == 'undefined' || typeof g_windowHeight == 'undefined'){
	var g_windowWidth = ($.browser.msie && parseInt($.browser.version) <= 6) ? 1010 :1014;
	var g_windowHeight = ($.browser.msie && parseInt($.browser.version) <= 6) ? 696 :700;
}

function getTimestamp()
{
	var dateObj = new Date();
	return dateObj.getTime();
}

if(typeof openwindow == 'undefined') {
	function openwindow(url) {
		g_windowHeight = $.browser.safari ? 704 : g_windowHeight;
		var yPos = (screen.availHeight-g_windowHeight) / 2;
		var xPos  = (screen.availWidth-g_windowWidth) / 2;
		g_ZDFmediathekWindow = window.open(url, "ZDFmediathek" + getTimestamp(), "width="+g_windowWidth+",height="+g_windowHeight+",left="+xPos+",top="+yPos+",location=no,menubar=no,resizable=yes,toolbar=no");
		if(g_ZDFmediathekWindow)
		g_ZDFmediathekWindow.focus();
	}
}
if(typeof openFullWindow == 'undefined') {
	function openFullWindow(url) {
		var win = window.open(url, "ZDFmediathek2", "left=0,top=0,location=yes,menubar=yes,resizable=yes,toolbar=yes,scrollbars=yes");
		if(win)
		win.focus();
	}
}
var g_window = {
	resizeTo: function(width,height){
	if(g_oldSafari) {
	height += 20;
	window.resizeTo(width,height);
	} else if (self.innerHeight)
	{
	self.innerWidth = width;
	self.innerHeight = height;
	}
	else
	{
	if(navigator.userAgent.indexOf('NT 6.0') != -1) {
	width += 10;
	height += 62;
	}
	window.resizeTo(width,height);
	}
	},
	getInner: function(){
	var x,y;
	if (self.innerHeight)
	{
	x = self.innerWidth;
	y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
	x = document.body.clientWidth;
	y = document.body.clientHeight;
	}
	return [x,y];
	}
};
// end of mediathek.js

changeVar = 0;

function setChangeVar(val) {
  changeVar = val;
}

function redirto(id) {
	if (isNaN(id)) {
		//if the id is not numeric - handle it as it where an url - needed eg. for the heute link
		if(changeVar) { document.location.href=id; }
	} else {
		if (id!='1000000') document.location.href='http://www.zdf.de/ZDFde/inhalt/' + id % 32 + '/0,1872,' + id + ',00.html';
	}
}


function turnOff(name) {
  document.getElementById(name).style.display = 'none';
}

function turnOn(name) {
  document.getElementById(name).style.display = 'block';
}

function white(name) {
  document.getElementById(name).style.backgroundColor = "#FFFFFF";
  document.getElementById(name).style.color = "#FB7D19";
}

function gray(name) {
  document.getElementById(name).style.backgroundColor = "";
  document.getElementById(name).style.color = "";
}


//Javascript für Externe Links oder Popups Anfang
var externerLinkText = "Externer Link - Link öffnet im selben Fenster";
var textNeuesFenster = "Externer Link - Link öffnet in neuem Fenster";
var isOp = (navigator.userAgent.toLowerCase().indexOf("opera") != -1) ? true : false;

function pop(file,windowname,features)
{
	helpwindow = window.open(file,windowname,features);
	helpwindow.focus();
	return false;
}
	
//Javascript für Externe Links oder Popups Ende

function openTDFdriver(Year, DriverID) 
{
	var link_1 = "http://www.letour.fr/";
	var link_2 = "/TDF/RIDERS/de/coureurs/";
	var link_3 = ".html"
	dest = link_1 + Year + link_2 + DriverID + link_3;
	ZDF_Tour_Fahrer = window.open (dest,"Fahrer",'width=600,height=450,top=0,left=0,toolbar=0,location=0,scrollbars=1,resizable=0');
	ZDF_Tour_Fahrer.focus();
}

function openTDFetapinfo(Path) 
{
	var link_1 = "http://www.zdf.de/";
	var link_2 = ".html"
	dest = link_1 + Path + link_2;
	ZDF_Tour_info = window.open (dest,"EtapInfo",'width=780,height=550,top=0,left=0,toolbar=0,location=0,scrollbars=1,resizable=0');
	ZDF_Tour_info.focus();
}

function getServerTimeObj() {
	var xhReq = Frontend.createXMLHttpRequest();
	// if it's not possible to create a HttpRequest-Object return no 
	// time-difference (use the client time)
	//try { xhReq.open("GET", "http://www.heute.de/ZDFheute/date", false)} catch (e)
  	try { xhReq.open("GET", "/ZDFheute/date", false)} catch (e) {      
      return new Date();}

  	try { xhReq.send(null); } catch(e) {
      return new Date(); }
  	var strTime = xhReq.responseText;
    if(!strTime) return new Date();
	var arVal = strTime.split("&");
	var strDateFormat = "";
  var year = 0;
  var month = 0;
  var day = 0;
  var hour = 0;
  var minute = 0;
	for(i=0;i<arVal.length;i++) {
    if(arVal[i].search("year=") != -1) {          
		  year = arVal[i].slice(5);
		} else if(arVal[i].search("month=") != -1) {
		  month = arVal[i].slice(6);
		} else if(arVal[i].search("day=") != -1) {
		  day = arVal[i].slice(4);          
		} else if(arVal[i].search("hour=") != -1) {
		  hour = arVal[i].slice(5);          
		} else if(arVal[i].search("minute=") != -1) {
		  minute = arVal[i].slice(7);          
		}
	}
  	var Monat = new Array();
  	Monat["Jan"] = 0;
  	Monat["Feb"] = 1;
  	Monat["Mar"] = 2;
  	Monat["Apr"] = 3;
  	Monat["May"] = 4;
  	Monat["Mai"] = 4;
  	Monat["Jun"] = 5;
  	Monat["Jul"] = 6;
  	Monat["Aug"] = 7;
  	Monat["Sep"] = 8;
  	Monat["Oct"] = 9;
  	Monat["Okt"] = 9;
  	Monat["Nov"] = 10;
  	Monat["Dec"] = 11;
  	Monat["Dez"] = 11;
	//this is the actual serverdate
	var now = new Date(year, Monat[month], day, hour, minute);
  return now;
}

 

 //Weatherselect
	
		wicon0=new Image;
		wicon0.src='/ZDF/img/weather/weather_20.gif';
		 
		wicon1=new Image;
		wicon1.src='/ZDF/img/weather/weather_21.gif';
		 
		wicon2=new Image;
		wicon2.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon3=new Image;
		wicon3.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon4=new Image;
		wicon4.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon5=new Image;
		wicon5.src='/ZDF/img/weather/weather_21.gif';
		 
		wicon6=new Image;
		wicon6.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon7=new Image;
		wicon7.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon8=new Image;
		wicon8.src='/ZDF/img/weather/weather_25.gif';
		 
		wicon9=new Image;
		wicon9.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon10=new Image;
		wicon10.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon11=new Image;
		wicon11.src='/ZDF/img/weather/weather_20.gif';
		 
		wicon12=new Image;
		wicon12.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon13=new Image;
		wicon13.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon14=new Image;
		wicon14.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon15=new Image;
		wicon15.src='/ZDF/img/weather/weather_20.gif';
		 
		wicon16=new Image;
		wicon16.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon17=new Image;
		wicon17.src='/ZDF/img/weather/weather_21.gif';
		 
		wicon18=new Image;
		wicon18.src='/ZDF/img/weather/weather_19.gif';
		 
		wicon19=new Image;
		wicon19.src='/ZDF/img/weather/weather_19.gif';
		  
		t0=new Image;
		t0.src='/ZDFde/img/weather/t0.gif';
	
		t1=new Image;
		t1.src='/ZDFde/img/weather/t1.gif';
	
		t2=new Image;
		t2.src='/ZDFde/img/weather/t2.gif';
	
		t3=new Image;
		t3.src='/ZDFde/img/weather/t3.gif';
	
		t4=new Image;
		t4.src='/ZDFde/img/weather/t4.gif';
	
		t5=new Image;
		t5.src='/ZDFde/img/weather/t5.gif';
	
		t6=new Image;
		t6.src='/ZDFde/img/weather/t6.gif';
	
		t7=new Image;
		t7.src='/ZDFde/img/weather/t7.gif';
	
		t8=new Image;
		t8.src='/ZDFde/img/weather/t8.gif';
	
		t9=new Image;
		t9.src='/ZDFde/img/weather/t9.gif';
		tp0=new Image;
		tp0.src='/ZDFde/img/weather/tp0.gif';
		tp1=new Image;
		tp1.src='/ZDFde/img/weather/tp1.gif';
	
	var arNightTemp=new Array('-1','1','-1','6','1','-1','2','4','-1','6','1','0','3','4','2','-1','5','-2','5','3',0);
	var arDayTemp=new Array('3','2','4','9','6','1','2','10','0','9','6','3','10','7','8','3','8','0','9','10',0);
	



function openVoting(strSource)
{
	votingWin = window.open(strSource,"voting","width=379,height=434,location=0,menubar=0,statusbar=0,scrollbars=0,resizable=0");
}


scrollSteps = 200
timer=""

function scrollWin(anchorID){

	if (navigator.userAgent.indexOf("Opera") > 0){

	}
	else {

		var s,d;
			var test1 = document.body.scrollHeight;
			var test2 = document.body.offsetHeight
			if (test1 > test2) // all but Explorer Mac
			{
				s = document.body.scrollWidth;
				d = document.body.scrollHeight;
			}
			else // Explorer Mac;
					 //would also work in Explorer 6 Strict, Mozilla and Safari
			{
				s = document.body.offsetWidth;
				d = document.body.offsetHeight;
			}


		var a,b;
			if (self.innerHeight) // all except Explorer
			{
				a = self.innerWidth;
				b = self.innerHeight;
			}
			else if (document.documentElement && document.documentElement.clientHeight)
				// Explorer 6 Strict Mode
			{
				a = document.documentElement.clientWidth;
				b = document.documentElement.clientHeight;
			}
			else if (document.body) // other Explorers
			{
				a = document.body.clientWidth;
				b = document.body.clientHeight;
			}


		var y;

			if (self.pageYOffset) // all except Explorer
			{
				y = self.pageYOffset;
			}

			else if (document.documentElement && document.documentElement.scrollTop)
				// Explorer 6 Strict
			{
				y = document.documentElement.scrollTop;
			}

			else if (document.body) // all other Explorers
			{
				y = document.body.scrollTop;
			}

		id=anchorID.substring(anchorID.indexOf("#")+1,anchorID.length)
		clearTimeout(timer)

		if (y <= document.getElementById(id).offsetTop-scrollSteps){
				window.scrollBy(0,scrollSteps)
				timer=setTimeout("scrollWin('"+id+"')",10)

		if(y > (d-b)-scrollSteps){
			clearTimeout(timer)
			y = d-b
		}

	}
	else{

	if(y >= document.getElementById(id).offsetTop+scrollSteps){
		window.scrollBy(0,-scrollSteps)
		timer=setTimeout("scrollWin('"+id+"')",10)
	}
	else{
		clearTimeout(timer)
		y = document.getElementById(id).offsetTop
	}

}

return false

}

}


//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

//used internally from not used proc
function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

//used internally from not used proc
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

//?
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}


//used internally
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?');
  else
    return src + ext;
}

//used internally
function AC_Generateobj(objAttrs, params, embedAttrs)
{
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

//used
function AC_FL_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

//used
function AC_SW_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

//used internally
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();   

    switch (currArg){   
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":   
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//used at LS.war
function change_day () {
	if (document.Chooser.zeitraum[6].checked == true || document.Chooser.zeitraum[5].checked == true) {
		var deaktiviert = false;
	} else {
		var deaktiviert = true;
	}
	for (var i = 1; i < 8; i++) {
		document.Chooser['weekday'+i].disabled = deaktiviert;
	}
}


/////////////////////////////////////////////////////////////////////////////////////
/// OLD functions

//FLASH

// fpi-init

var requiredVersion = 5;
var useRedirect = false;
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
var flash9Installed = false;
var flash10Installed = false;
var flash11Installed = false;
var maxVersion = 10;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;

// fpi-writevb

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

jsVersion = 1.1;

if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
	document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}


// fpi-main
//used
function detectFlash(){

	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion == 8;
			flash9Installed = flashVersion == 9;
			flash10Installed = flashVersion == 10;
			flash11Installed = flashVersion == 11;
		}
	}
	for (var i = 2; i <= maxVersion; i++) {
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}

	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;

	if (actualVersion >= requiredVersion) {
		hasRightVersion = true;
		if (useRedirect) {
			if(jsVersion > 1.0) {
				window.location.replace(flashPage);
			} else {
				window.location = flashPage;
			}
		}
	} else {

		if (useRedirect) {
			if(jsVersion > 1.0) {
				window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
			} else {
				window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
			}
		}
	}
}

detectFlash();

//USED
// function for inserting flash to article text
// placement: 	used to determine the size of the flash
//				(main (476 x 236), flash-applikation (476 x 635), default (298 x 235), mediathek-popup (780 x 410)
// version: 	the ch_version field from table animation - used for checking the correct version
function func_call_animation_body(URL1, URL2, placement, version) {
	var useRedirect;
	useRedirect = false;
	
	if (!useRedirect) {

		//checking which version is needed - default to the requiredVersion var
		if ( typeof(version) == 'undefined' ) {
			version = '';
		}


		switch (version) {
			case ('5.x'):
				neededVersion = 5;
				break;
			case ('6.x'):
				neededVersion = 6;
				break;
			case ('7.x'):
				neededVersion = 7;
				break;
			case ('8.x'):
				neededVersion = 8;
				break;
			default:
				neededVersion = requiredVersion;
				break;
		}


		if ( actualVersion >= neededVersion ) {
			var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
			if (placement=="main") {
				var oeTags = oeTags + 'WIDTH="476" HEIGHT="236" ';
			} else if (placement=="flash-applikation") {
				var oeTags = oeTags + 'WIDTH="476" HEIGHT="635" ';
			} else if (placement=="mediathek-popup") {
				var oeTags = oeTags + 'WIDTH="780" HEIGHT="410" ';
			} else {
				var oeTags = oeTags + 'WIDTH="298" HEIGHT="235" ';
			}
			var oeTags = oeTags
			+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
			+ '<PARAM NAME="MOVIE" VALUE="' + URL1 + '">'
			+ '<PARAM NAME="PLAY" VALUE="true">'
			+ '<PARAM NAME="LOOP" VALUE="false">'
			+ '<PARAM NAME="QUALITY" VALUE="high">'
			+ '<PARAM NAME="MENU" VALUE="false">'
			+ '<EMBED SRC="' + URL1 + '"';
			if (placement=="main") {
				var oeTags = oeTags + 'WIDTH="476" HEIGHT="236"';
			} else if (placement=="flash-applikation") {
				var oeTags = oeTags + 'WIDTH="476" HEIGHT="635" ';
			} else if (placement=="mediathek-popup") {
				var oeTags = oeTags + 'WIDTH="780" HEIGHT="410" ';
			} else {
				var oeTags = oeTags + 'WIDTH="298" HEIGHT="235"';
			}
			var oeTags = oeTags + 'PLAY="true"'
			+ 'LOOP="false"'
			+ 'QUALITY="high"'
			+ 'MENU="false"'
			+ 'TYPE="application/x-shockwave-flash"'
			+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
			+ '</EMBED>'
			+ '</OBJECT>';

			document.write(oeTags);
		} else {
			if (placement=="main") {
				var alternateContent = '<IMG SRC="' + URL2 + '" WIDTH="476" HEIGHT="236" BORDER="0">';
			} else if (placement=="flash-applikation") {
				var alternateContent = '<IMG SRC="' + URL2 + '" WIDTH="476" HEIGHT="635" BORDER="0">';
			} else if (placement=="mediathek-popup") {
				var alternateContent = '<IMG SRC="' + URL2 + '" WIDTH="780" HEIGHT="410" BORDER="0">';
			} else {
				var alternateContent = '<IMG SRC="' + URL2 + '" WIDTH="298" HEIGHT="235" BORDER="0">';
			}
			document.write(alternateContent);
		}
	}
}







g_local = true;

var Frontend = {
	timeDiff: null,
	
	//used internally
	testIsValidObject: function(objToTest) {
		if (null == objToTest) {
			return false;
		}
		if ("undefined" == typeof(objToTest) ) {
			return false;
		}
		return true;
	},
	
	//used
	togglePlay: function(playerId, url, retryRemains) {
		var playerObj = document.getElementById(playerId);
		if (Frontend.testIsValidObject(playerObj)) {
			try {
				playerObj.sendEvent('PLAY');
			} catch(err) {
				
				if(typeof retryRemains == 'undefined') {
					retryRemains = 5;
				}
				retryRemains--;
				if (retryRemains != 0) {
					setTimeout("Frontend.togglePlay('" + playerId + "', '" + url + "', " + retryRemains + ")", 1000);
				} else {
					Frontend.openMedia(url);
				}
			}
		} else {
			Frontend.openMedia(url);
		}
		return false;
	},
	
	//used
	changeAzInnerHtml: function() {
		var tmpStr = '';
		var replacements = new Array('incsearchnextfcuk','incsearchteasertext','inc-search-navi','inc-search-header');

		for (var i=0;i < replacements.length;i++) {
			id =replacements[i];
			tmpStr = document.getElementById(id).innerHTML;
			document.getElementById(id).innerHTML = document.getElementById(id + '-replacement').value;
			document.getElementById(id + '-replacement').value = tmpStr;
		}

		document.body.normalize();
		bldInitial();
		bldUpdate(0);
	},

	//USED in old code
	changeMtHeuteNews: function(whatToShow,whatToHide) {
		document.getElementById('mediathek-heute-news').innerHTML = document.getElementById('mediathek-heute-news-' + whatToShow).value;
		if (whatToShow == "auto") {
			document.getElementById('mt-heute-news-header-auto').src = "/ZDF/img/mediathek-heute-news-active.gif";
			document.getElementById('mt-heute-news-header-man').src = "/ZDF/img/mediathek-aktuelle-sendungen-inactive.gif";
		} else {
			document.getElementById('mt-heute-news-header-auto').src = "/ZDF/img/mediathek-heute-news-inactive.gif";
			document.getElementById('mt-heute-news-header-man').src = "/ZDF/img/mediathek-aktuelle-sendungen-active.gif";
		}
		document.body.normalize();
	},

	//used
	createXMLHttpRequest: function() {
		var xmlHttp = null;
		// Mozilla, Opera, Safari sowie Internet Explorer 7
		if (typeof XMLHttpRequest != 'undefined') {
			xmlHttp = new XMLHttpRequest();
		}
		if (!xmlHttp) {
			// Internet Explorer 6 und älter
			try {
				xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
	    		xmlHttp  = new
					ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
	   			xmlHttp  = null;
				}
			}
		}
		return xmlHttp;
	},


	//used
	// if it is not possible to create a HttpRequest-Object return no time-difference
	// (use the client time for that cases)
	getTimeDiffBetweenServerAndClient: function() {
		var xhReq = Frontend.createXMLHttpRequest();
		try { xhReq.open("GET", "/ZDFheute/date", false); } catch (e) {return 0; }
		try { xhReq.send(null); } catch(e) { return 0; }
		var strTime = xhReq.responseText;

		var arVal = strTime.split("&");
		var strDateFormat = "";
		for(i=0;i<arVal.length;i++) {
			if(arVal[i].search("year=") != -1) {
				year = arVal[i].slice(5);
			} else if(arVal[i].search("month=") != -1) {
				month = arVal[i].slice(6);
			} else if(arVal[i].search("day=") != -1) {
				day = arVal[i].slice(4);
			} else if(arVal[i].search("hour=") != -1) {
				hour = arVal[i].slice(5);
			} else if(arVal[i].search("minute=") != -1) {
				minute = arVal[i].slice(7);
			} else if(arVal[i].search("second=") != -1) {
				second = arVal[i].slice(7);
			}
		}
		var Monat = new Array();
		Monat["Jan"] = 0;
		Monat["Feb"] = 1;
		Monat["Mar"] = 2;
		Monat["Apr"] = 3;
		Monat["May"] = 4;
		Monat["Mai"] = 4;
		Monat["Jun"] = 5;
		Monat["Jul"] = 6;
		Monat["Aug"] = 7;
		Monat["Sep"] = 8;
		Monat["Oct"] = 9;
		Monat["Okt"] = 9;
		Monat["Nov"] = 10;
		Monat["Dec"] = 11;
		Monat["Dez"] = 11;

		var now = new Date(year, Monat[month], day, hour, minute, second);
		var nower = new Date();
		now = now - nower;
		return now;
	},

	//used
	// returns the server date if possible, if not then the client date
	getRealTime: function() {
		if (Frontend.timeDiff == null) {
			Frontend.timeDiff = Frontend.getTimeDiffBetweenServerAndClient();
		}
		var now = new Date();
		var time = now.getTime();
		time += Frontend.timeDiff;
		now.setTime(time);
		return now;
	},
	
	//used
	// Mode[0|1] 0 = belly, 1 = chat
	getdatetime: function(Sendung,Dauer,Mode,ShiftedTime) {	
		var dateShiftMilliSeconds = (5*60+30)*60000;
		//this is the actual serverdate
		var now = Frontend.getRealTime();
		
		if (Mode == 0) {
			var shiftedSendung = new Date(Sendung-dateShiftMilliSeconds);
			var shiftedNow = new Date(now-dateShiftMilliSeconds);
		} else {
			var shiftedSendung = Sendung;
			var shiftedNow = now;
		}
		var shiftedSendungWithoutTime = new Date(shiftedSendung.getFullYear(), shiftedSendung.getMonth(), shiftedSendung.getDate());
		var shiftedNowWithoutTime = new Date(shiftedNow.getFullYear(), shiftedNow.getMonth(), shiftedNow.getDate());
		
		var shiftedEndDate = new Date(shiftedSendung*1+Dauer*60000);
		
		var TagInWoche = shiftedSendung.getDay();
		var Minute = Sendung.getMinutes();
		var MinuteAusgabe = ((Minute < 10) ? "0" + Minute : Minute);
		MinuteString = MinuteAusgabe.toString();
		
		var Stunde = Sendung.getHours();
		var StundeAusgabe = ((Stunde < 10) ? "0" + Stunde : Stunde);
		StundeString = StundeAusgabe.toString();
		
		var Tag = shiftedSendung.getDate();
		var TagAusgabe = ((Tag < 10) ? "0" + Tag : Tag);
		TagString = TagAusgabe.toString();
		
		var Monat = (shiftedSendung.getMonth() + 1);
		var MonatAusgabe = ((Monat < 10) ? "0" + Monat : Monat);
		MonatString = MonatAusgabe.toString();
		
		var Jahr = shiftedSendung.getFullYear();
		JahrString = Jahr.toString();
		var JahrKurz = JahrString.substring(2, 4);
		var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
		var GermanMonthName = new Array("","Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
		
		var differenz = (shiftedSendung-shiftedNow)/60000;
		var dayDifferenz = (shiftedSendungWithoutTime - shiftedNowWithoutTime)/60000;
		
		/*document.write("differenz: " + differenz+"<br>");
		document.write("dayDifferenz: " + dayDifferenz+"<br>");
		document.write("shiftedNow: " + shiftedNow+"<br>");
		document.write("shiftedSendung: " + shiftedSendung+"<br>");
		document.write("shiftedEndDate: " + shiftedEndDate+"<br>");
		
		document.write((shiftedEndDate > shiftedNow)+"<br>");
		
		document.write("shiftedNowWithoutTime: " + shiftedNowWithoutTime+"<br>");
		document.write("shiftedSendungWithoutTime: " + shiftedSendungWithoutTime+"<br>");*/
		
//document.write("dayDifferenz: " + dayDifferenz+"<br>");
		
		if (differenz < 0) {
			if (shiftedEndDate > shiftedNow) {
				if(Mode == 1) {
					return "Jetzt";
				} else {
					return "Jetzt im Programm";
				}
			} else {
				return "Rückblick";
			}
		} else if (differenz <= 15) {
			return "Gleich";
		} else if (dayDifferenz < 1440) {
			return "Heute" + (Mode==1?" ":"<br />") + StundeAusgabe + "." + MinuteAusgabe + " Uhr";
		} else if (dayDifferenz < 2880) {
			return "Morgen" + (Mode==1?" ":"<br />") + StundeAusgabe + "." + MinuteAusgabe + " Uhr";
		} else if (dayDifferenz < 10080) {
			return "" + Wochentag[TagInWoche] + (Mode==1?" ":"<br />") + StundeAusgabe + "." + MinuteAusgabe + " Uhr";
		} else if (dayDifferenz >= 10080) {
			return "" + TagAusgabe + "." + MonatAusgabe + "." + JahrKurz + (Mode==1?" ":"<br />") + StundeAusgabe + "." + MinuteAusgabe + " Uhr";
			} else {
			//should never happen
			return "TODO";
		}
	},
	
	
	
	//used
	getCountDown: function(id, type, showDate) {
		var timediff = showDate - Frontend.getRealTime();
		timediff = timediff /1000; // difference in seconds
		

		var objCountdown = document.getElementById(id);
		if(Math.floor(timediff) <= 0) {
			objCountdown.firstChild.nodeValue = "";
			objCountdown.parentNode.parentNode.style.display = "none";
		    return;
		}


		var days = Math.floor(timediff / (24*60*60));
		timediff = timediff - days*24*60*60;
		var hours = Math.floor(timediff / (60*60));
		timediff = timediff - hours*60*60;
		var minutes = Math.floor(timediff /60);
		timediff = timediff - minutes*60;
		var seconds = Math.floor(timediff);
		var strCountdown = "noch ";
		if(type == 1) {
			strCountdown += (days>0?(days>1?days+" Tage, ":days+" Tag, "):"")+((days || hours>0)?(hours!=1?hours+" Stunden, ":hours+" Stunde, "):"")+((hours|| minutes>0)?(minutes!=1?minutes+" Minuten ":minutes+" Minute "):"")+((minutes||hours||days)?" und ":"")+(seconds==1?"1 Sekunde":seconds+" Sekunden");
		} else if (type == 2) {
			strCountdown += (days>0?(days>1?days+" Tage, ":days+" Tag, "):"")+((days || hours>0)?(hours!=1?hours+" Std, ":hours+" Stunde, "):"")+((hours|| minutes>0)?(minutes!=1?minutes+" Min ":minutes+" Min "):"")+((minutes||hours||days)?" und ":"")+seconds+" Sek";
		} else { //default: short version (should fit in every size)
			strCountdown += (days>0?(days>1?days+" Tage, ":days+" Tag, "):"")+((days || hours>0)?hours+" Std":"")+((!days && hours)?", ":" ")+(((hours && !days)||( minutes>0 && !days))?(minutes!=1?minutes+" Min ":minutes+" Min "):"")+((minutes && !days && !hours)?" und ":"")+((!days && !hours)?seconds+" Sek":"");
		}
		

		if(objCountdown) {
			if(showDate >= (Frontend.getRealTime()/1000)) {
				objCountdown.firstChild.nodeValue = strCountdown;
				setTimeout("Frontend.getCountDown('"+id+"', "+type+", "+showDate+");", 1000);
			} else {
				objCountdown.firstChild.nodeValue = spacer;
			}
		}
	},

	//used
	purgeBRs: function(text) {
		text = text.replace("<br>", " ");
		text = text.replace("<br/>", " ");
		text = text.replace("<br />", " ");
		re = /\s+/g;
		text = text.replace(re, " ");
		return text;
	},

	//used	
		//paramname must be the same as the form element name which has changed!
		//also the formelement must be a radio !!
		//paramtype: numeric|text
	changeLocation: function(paramName) {
		var form = document.getElementById('chooser');

		var tmpArray = document.location.href.split(',');

		var idString = tmpArray[2];
		var idInnerArray = idString.split('_');

		var element = form[paramName];

		for(var i=0;i<element.length;i++){
			if(element[i].checked){
				element.value=element[i].value;
			}
		}

			//changing the required param
		var rightIdString = idInnerArray[1];
		if(rightIdString != null && rightIdString != '' && rightIdString != 'undefined'){
			var origRightIdString = rightIdString;
			var regexString = paramName+':[^-]+';
			var regex = new RegExp(regexString, "gi");
			idInnerArray[1] = rightIdString.replace(regex, paramName+':'+element.value);
				//in this case the replace didnt work -> the parameter was not inside originaly. must be put afterwards then
			if(origRightIdString == idInnerArray[1]){
				idInnerArray[1] += '-'+paramName+':'+element.value;
			}
		}else{
			idInnerArray[1] = paramName+':'+element.value;
		}

			//changing the paging back to 1
		rightIdString = idInnerArray[1];
		regexString = 'pageNumber:[^-]+';
		regex = new RegExp(regexString, "gi");
		idInnerArray[1] = rightIdString.replace(regex, 'pageNumber:1');

		var finalId = idInnerArray.join('_');
		tmpArray[2] = finalId;
		var newHref = tmpArray.join(',');

		//var newHref = document.location.href.replace(idString, finalId);
		document.location.href = newHref;
	},

	//used
	validateContactForm: function(listOfFields) {
		// get a list of fieldnames split them and loop over there to check the values.
		if (listOfFields != "") {
			var fieldnames = listOfFields.split(" ");
			for(var i=0;i<fieldnames.length;i++){
				if (fieldnames[i].toUpperCase() == "EMAIL") {
					if (document.kontakt.Email.value.indexOf('@') != '-1' && document.kontakt.Email.value.indexOf('.') != '-1') {
		 				// do nothing
					} else {
		 				alert('Bitte geben Sie eine korrekte Emailadresse an.');
		 				return false;
					}
				} else if (fieldnames[i].toUpperCase() == "NACHRICHT") {
					if (document.kontakt.Nachricht.value == '') {
		 				alert('Bitte füllen Sie alle Pflichtfelder aus.');
		 				return false;
					}
				} else {
					// check for mandatory checkboxes
					if (eval("document.kontakt."+ fieldnames[i] +".type") == "checkbox" || (typeof(eval("document.kontakt."+ fieldnames[i] +".length")) != "undefined" && eval("document.kontakt."+ fieldnames[i] +"[0].type") == "checkbox")) {
						if (typeof(eval("document.kontakt."+ fieldnames[i] +".length")) == "undefined") {
							// it is only one checkbox available
							if (!eval("document.kontakt."+ fieldnames[i] +".checked")) {
								var msg = "Bitte füllen Sie alle Pflichtfelder aus.";
								alert(msg);
								return false;
							}
						} else {
							// there are more checkboxes available
							var Anzahl = 0;
							var Ergebnis = "";
							for (s=0; s < eval("document.kontakt."+ fieldnames[i] +".length");s++) {
								if (eval("document.kontakt."+ fieldnames[i] +"[s].checked")) {
									var Anzahl = Anzahl + 1;
									var Ergebnis = Ergebnis + eval("document.kontakt."+ fieldnames[i] +"[s].value") + "," ;
								}
							}
							if (Anzahl == 0) {
								var msg = "Bitte füllen Sie alle Pflichtfelder aus.";
								alert(msg);
								return false;
							}
						}
					} else {
						if (eval("document.kontakt."+ fieldnames[i] +".type") == "text") {
							if (eval("document.kontakt."+ fieldnames[i] +".value") == '') {
								var msg = "Bitte füllen Sie alle Pflichtfelder aus.";
								alert(msg);
								return false;
							}
						}
					}
				}
			}
			document.kontakt.submit();
		} else {
			document.kontakt.submit();
		}
	},
	
	//used
	openHtmlPopup: function(strSource, width, height) {
		htmlpopup = window.open(strSource,"tabelle","width=" + width + ",height=" + height + ",location=0,menubar=0,status=0,toolbar=0,scrollbars=1,resizable=0");
		htmlpopup.focus();
	},
	
	//used
	openBoerse: function(strSource) {
		boerseWin = window.open(strSource,"boerse","width=590,height=507,scrollbars=0,menubar=0,toolbar=0,location=0,status=1,resizable=1");
		boerseWin.focus;
	},
	
	//used
	openMedia: function(strSource) {
		//var topPix = (screen.availHeight - 768)/2;
		//var leftPix = (screen.availWidth - 1024)/2;
		//mediathekwin = window.open(strSource,"mediathek","top=" + topPix + ",left=" + leftPix + ",width=1024,height=768,location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=1");
		//mediathekwin.focus();
		openwindow(strSource);
	},
	
	//used
	openHtmlPopupResizable: function(strSource, width, height) {
		htmlpopup = window.open(strSource,"tabelle","width=" + width + ",height=" + height + ",location=0,menubar=0,status=0,toolbar=0,scrollbars=1,resizable=1");
		htmlpopup.focus();
	},
	
	//used
	openVotingPopup: function(strSource) {
		htmlpopup = window.open(strSource,'onlineabstimmung','width=380,height=434,location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0');
		htmlpopup.focus();
	},
	
	//used
	openBoerse: function(strSource) {
		boerseWin = window.open(strSource,"boerse","width=590,height=507,scrollbars=0,menubar=0,toolbar=0,location=0,status=1,resizable=1");
		boerseWin.focus();
	}
	
};


var Rss = {		
	einblenden:function (div) {
			with(document.getElementById(div).style) {
				if(display.indexOf('none') != -1)
				 {
					display="block";
				}
				else {
					display="none";
				}
			}
	},

	button:function (div) {
		with(document.getElementById(div).style) {
			if(backgroundImage.indexOf('rss_button_off.gif') != -1) {
				backgroundImage="url(/ZDF/img/rss_button_on.gif)";
			} else {
				backgroundImage="url(/ZDF/img/rss_button_off.gif)";
			}
		}
	}
};

//-->

