	// Version 0.984

	<!--

	//////// I M A G E * S W A P

	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	if ((browserName == "Netscape" && browserVer >= 3) || (browserVer >= 4))
		canRoll = true;
	else
		canRoll = false;

	function hiLite(imgID, imgName) {
		if (canRoll) {
			document.images[imgID].src = eval(imgName + ".src");
		}
	}

	function hiLite2(imgID, imgName, imgID2, imgName2) {
		if (canRoll) {
			document.images[imgID].src = eval(imgName + ".src");
			document.images[imgID2].src = eval(imgName2 + ".src");
		}
	}

	//-->

	///////// Geotagging - Google-API-Key 
	// http://dw-world.de/
	window.dwGoogleAPIKey = 'ABQIAAAAzfwaX9DgXdEfzQtRytMk0BRjhKu3L0JFORag-VGTnCayB1dJJBQTYZJaUNeBBU2X7d98sFJ3p1Fwwg';
	if (window.location.hostname.substr(window.location.hostname.length-9, 9) == 'dwelle.de') {
		// http://dwelle.de/
		window.dwGoogleAPIKey = 'ABQIAAAAzfwaX9DgXdEfzQtRytMk0BSodKZRW-eRet-ImFbG1Vne0zUCsRR4RjjGqZvSlQa7zGYC9U3aAKmPMw';
	}
	//-->
	
	function submitSendungPulldown() {
	  for(i=0;i<document.FormSendungen.Sendungen.length;++i)
  		if(document.FormSendungen.Sendungen.options[i].selected == true)
	        self.location.href = document.FormSendungen.Sendungen.options[i].value;
	   }

	function submitProgrammAuswahl() {
	  for(i=0;i<document.ProgrammAuswahlForm.Sendungen.length;++i)
  		if(document.ProgrammAuswahlForm.Sendungen.options[i].selected == true)
			if (document.ProgrammAuswahlForm.Sendungen.options[i].value != '')
		        self.location.href = document.ProgrammAuswahlForm.Sendungen.options[i].value;
	   }

	// Funktion um ein Popup-Fenster ohne URL Zeile, Status Zeile, etc. zu starten

	function popup(openadresse,winName,winWidth,winHeight) {
		//win = window.open(openadresse,winName,'resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=no,copyhistory=no,width='+winWidth+',height='+winHeight+',fullscreen=no,titlebar=no');
		var win = window.open(openadresse,winName,'width='+winWidth+',height='+winHeight+',resizable=yes,status=no,scrollbars=yes,true,left=20,top=20');
		//if (navigator.appName == "Microsoft Internet Explorer")	{
		//	win.location.reload();
		//}
		win.focus();
	}

	function popupscr(openadresse,winName,winWidth,winHeight) {
		//win = window.open(openadresse,winName,'resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=yes,copyhistory=no,width='+winWidth+',height='+winHeight+',fullscreen=no,titlebar=no');
		var win = window.open(openadresse,winName,'width='+winWidth+',height='+winHeight+',resizable=yes,status=no,scrollbars=yes,true,left=20,top=20');
		//if (navigator.appName == "Microsoft Internet Explorer")	{
		//	win.location.reload();
		//}
		win.focus();
	}

	// Funktion um ein Popup-Fenster ohne URL Zeile, Status Zeile, etc. zu starten	/ ohne resize/

	function popupsb(openadresse,winName,winWidth,winHeight) {
		//win = window.open(openadresse,winName,'resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,copyhistory=no,width='+winWidth+',height='+winHeight+',fullscreen=no,location=yes,titlebar=no');
		var win = window.open(openadresse,winName,'width='+winWidth+',height='+winHeight+',resizable=no ,status=no,scrollbars=yes,left=0,top=0,true');
		//if (navigator.appName == "Microsoft Internet Explorer")	{
		//	win.location.reload();
		//}
		win.focus();
	}

	// Funktion um ein Popup-Fenster auf das Kartenmodul zu starten

function europakarte(land_id,sprach_id) {

sprache = new Array ('',
'ger',
'eng',
'rus',
'chin',
'bras',
'alb',
'amh',
'arab',
'ben',
'bos',
'bul',
'dar',
'fra',
'gri',
'hau',
'hin',
'ind',
'kis',
'kro',
'maz',
'pas',
'per',
'pol',
'por',
'rum',
'san',
'ser',
'span',
'tur',
'ukr',
'urd',
'kli');

landname = new Array('','',
'albania',
'andorra',
'azerbaijan',
'belgium',
'bosniaherzegovina',
'bulgaria',
'denmark',
'germany',
'estonia',
'faroeislands',
'finland',
'france',
'georgia',
'greece',
'unitedkingdom',
'ireland',
'iceland',
'italy',
'croatia',
'latvia',
'liechtenstein',
'lithuania',
'luxemburg',
'malta',
'macedonia',
'moldavia',
'monaco',
'netherlands',
'norway',
'austria',
'poland',
'portugal',
'romania',
'russia',
'sanmarino',
'sweden',
'switzerland',
'serbiamontenegro',
'slovakia',
'slovenia',
'spain',
'czechrepublic',
'turkey',
'ukraine',
'hungary',
'vaticancity',
'belarus',
'cyprus',
'armenia',
'serbia',
'montenegro');


url="http://www9.dw-world.de/europakarte/"+sprache[sprach_id]+"/europakarte_fs.php?id="+land_id;
//alert(url)
window.europa=open(url, "europakarte", "innerWidth=476,innerHeight=700,width=476,height=740,status=no,resizable=yes,locationbar=no,menubar=no,scrollbars=yes,titlebar=no");
window.europa.focus()
}

	// Funktion um ein Popup-Fenster ohne URL Zeile, Status Zeile, etc. zu starten	/ ohne resize/scrollbar

	function popop(openadresse,winName,winWidth,winHeight) {
		//win = window.open(openadresse,winName,'resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,copyhistory=no,width='+winWidth+',height='+winHeight+',fullscreen=no,titlebar=no');
		var win = window.open(openadresse,winName,'width='+winWidth+',height='+winHeight+',resizable=no ,status=no,scrollbars=no,true');
		//if (navigator.appName == "Microsoft Internet Explorer")	{
		//	win.location.reload();
		//}
		win.focus();
	}

// new function for opening popups, it substitutes the functions "popup", "popupscr", "popupsb", "popop"
function openPopup(url,title,type) {
	var winWidth=578;
	var winHeight=544;
	var winScrollbar='yes';

	
	// Hack: ie6 needs more px
	var winVideoWidth=999;
	if ((browserName == "Microsoft Internet Explorer" && browserVer >= 3) || (browserVer <= 4)) {
		winVideoWidth=1015;
	}
	
	if (type=='picPopup') {
		winWidth=380;
		winHeight=488;
		winScrollbar='no';
	} else if (type=='picPopupPortrait') {
		winWidth=294;
		winHeight=544;
		winScrollbar='no';
	} else if (type=='dayPicPopup') {
		if (browserName == 'Microsoft Internet Explorer' && browserVer < 7) {
			winWidth=625;
			winHeight=535;
			winScrollbar='no';
		} else {
		winWidth=616;
		winHeight=535;
		winScrollbar='no';
		}
	} else if (type=='surveyResult') {
		winWidth=616;
		winHeight=500;
		winScrollbar='no';
	} else if (type=='videoPopup') {
		winWidth=winVideoWidth;
		winHeight=657;
		winScrollbar='yes';
	} else if (type=='audioPopup') {
		winWidth=408;
		
		//winHeight=396;
		winHeight=421;
		
		winScrollbar='no';
	} else if (type=='liveaudioPopup') {
		winWidth=408;
		
		//winHeight=372;
		winHeight=405;
		
		winScrollbar='no';
	} else if (type=='livevideoPopup') {
		winWidth=winVideoWidth;
		winHeight=657;
		winScrollbar='yes';		
	} else if (type=='tvregionPopup') {
		winWidth=777;
		winHeight=650;
		winScrollbar='yes';
	}

	var popupWindow=window.open(url,type,'width='+winWidth+',height='+winHeight+',resizable=yes,location=no,status=no,toolbar=no,menubar=no,hotkeys=yes,scrollbars='+winScrollbar);
	popupWindow.focus();
 	return false;
}//end openPopup


	// Funktionen zum Drucken und Schliessen aus Popup


	function CloseWin() {
	    	window.close();
	}

	function onClickPrint() {
         	parent.onClickPrint();
		    mainFrame.focus();
	        mainFrame.print();
    }

//	if (navigator.appName.indexOf("Explorer") != -1)
//	  {
//	  check = true;
//	  }
//	else
//	  check = false;

    var check;
	// browser-detection neu, hr 09.11.2001
	if (document.all) {
		// Internet Explorer
		check = true;
	}
	else if (document.layers) {
		// Netscape Navigator
		check = false;
	}
	else if (document.getElementById) {
		// Netscape 6
		check = false;
	}
	else {
		// alles andere
		check = false;
	}

	if (navigator.platform.indexOf("Mac") != -1)
	  {
	  apple = true;
	  }
	else {
	  apple = false;
	}


function clearInput (inputObject, inputValue, eventType) {
	if(eventType=="focus") {
		if(inputObject.value == inputValue) {
			inputObject.value = "";
		}
	}
	if(eventType=="blur") {
		if(inputObject.value == '') {
			inputObject.value = inputValue;
		}
	}
}

function displaysb(sb,dir,index) {
	if (sb == '') {
		sb = '';
	}

	document.getElementById('socialInfo').innerHTML=sb;
	var position = 2+30*index+"px";
	
	if (dir == "rtl") {
	document.getElementById('socialInfo').style.marginRight=position;
	} else {
		document.getElementById('socialInfo').style.marginLeft=position;
	}
}

function chooseMatchday(id,roundcount) {

	var rc = parseInt(roundcount);
	var maxrc = parseInt(rc+1);

	// Pfeilnavigation Uebertrag
	if (id=='scores0') {
		id='scores1';
	} else if (id=='scores'+maxrc) {
		id='scores'+rc;
	}

	// ein/ausblenden des Spieltags
	for(n=1;n<maxrc;++n) {
		document.getElementById("scores"+n).style.display="none";
	   }
		document.getElementById(id).style.display="inline";

	// dropdown select ermitteln
	for(s=1;s<maxrc;++s) {
		for(t=1;t<maxrc;++t) {
			if (s=t) {
				document.getElementById("selector"+s).selectedIndex = (t-1);
			}
		}
	}

}

function loadDetails(uri,id,roundcount){

	var rc = parseInt(roundcount);
	var maxrc = parseInt(rc+1);
	if (uri.indexOf("gameDay0") != -1) {
		uri = uri.replace("gameDay0","gameDay1");

	} else if (uri.indexOf("gameDay"+maxrc) != -1) {
		uri = uri.replace("gameDay"+maxrc,"gameDay"+rc);
	}

	//erstellen des requests
	var req = null;
	try{
		req = new XMLHttpRequest();
	}
	catch (ms){
		try{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (nonms){
			try{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed){
				req = null;
			}
		}
	}
	if (req == null)
		alert("Error creating request object!");
	else {
		//toggleWaitMessage('progressWait');

		//anfrage erstellen (GET, url ist localhost,request ist asynchron)
		req.open("GET", uri, true);
		//Beim abschliessen des request wird diese Funktion ausgef??hrt
		req.onreadystatechange = function(){
			switch(req.readyState) {
				case 4:
				if(req.status!=200) {
					alert("Fehler:"+req.status);
				}else{
					//alert(req.responseText);
					//schreibe die antwort in den div container mit der id content
					//toggleWaitMessage('progressWait');
					document.getElementById('scores').innerHTML = req.responseText;
				}
				break;
				default:
					return false;
				break;
			}
		};
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(null);
	}
}

function chgTabContent (naviId, txtId) 
{
	document.getElementById("radio").style.display='none';
	document.getElementById("txtRadio").style.display='none';
	document.getElementById("fernsehen").style.display='none';
	document.getElementById("txtFernsehen").style.display='none';
	document.getElementById("multimedia").style.display='none';
	document.getElementById("txtMultimedia").style.display='none';
	document.getElementById(naviId).style.display='inline';
	document.getElementById(txtId).style.display='inline';
}


var activeTable; 

function _showDay(day) { 

	var oldDay = document.getElementById('table' + activeTable);
	var newDay = document.getElementById('table' + day);
	
	if(newDay != null) {
		oldDay.style.display = 'none';
		newDay.style.display = 'block';
		
		var oldTab = document.getElementById('day' + activeTable);
		var newTab = document.getElementById('day' + day);

		if(oldTab != null && newTab != null) {
			oldTab.className = oldTab.className.replace('selected', 'std');
			newTab.className = newTab.className.replace('std', 'selected');
		activeTable = day;		
			return true;
		}
	}
	return false;
}

function showDay(day) {
	
	if(_showDay(day)) {
		//show language selection
		document.getElementById('programPlanDropdownLanguageBox').style.display='block';
	}
}

function showWeek() {
	if(_showDay(0)) {
		//hide language selection
		document.getElementById('programPlanDropdownLanguageBox').style.display='none';
	}
}

function getLocalTime(timestamp) {
	var tempdate = new Date(timestamp);
	return formatTime(tempdate.getHours()) + ":" + formatTime(tempdate.getMinutes());
}

function formatTime(timeval) {
	if (timeval < 10) timeval = "0"+timeval;
	return timeval;
}


// Broadcast Summary

var broadcasts = new Array();
var languages = new Array();

function registerBroadcast(broadcastId, scheduleIds) {
	broadcasts[broadcastId] = scheduleIds;
}

function registerBroadcastLanguage(languageId) {
	languages.push(languageId);
}

function showAllBroadcasts() {
	var scheduleSelection = document.getElementById('broadcastDropdownSchedule');
	var languageSelection = document.getElementById('broadcastDropdownLanguage');

	scheduleSelection.selectedIndex = 0;
	languageSelection.selectedIndex = 0;
	
	bcSelectionValueChanged(scheduleSelection, 'Schedule');
	bcSelectionValueChanged(languageSelection, 'Language');	
} 

function bcSelectionValueChanged(selectEl, name, structureId, defaultScheduleId) {
	if((typeof selectEl) == 'string') {
		selectEl = document.getElementById(selectEl);
	}
	
	if(selectEl == null) {
		return;
	}

	var selIndex = selectEl.selectedIndex;
	var selValue = selectEl.options[selIndex].value;
	
	// alert(name + ': ' + selValue);
	
	if(name == 'Schedule') {
		var href = null;
		
		if(selValue == defaultScheduleId) {
			href = '/dw/0,,' + structureId + ',00.html';
		}
		else {
			href = '/dw/' + selValue + '/0,,' + structureId + ',00.html';
		}
		
		location.href = href;
		
		// setBroadcastVisibility(selValue);
		return;
	}
	
	if(name == 'Language') {
		setLanguageVisibility(selValue);
		return;
	}
}

function setBroadcastVisibility(scheduleId) {
	scheduleIdStr = 'schedule_' + scheduleId + '_';

	for (broadcastId in broadcasts) {
		var scheduleIds = broadcasts[broadcastId];
		var broadcast = document.getElementById(broadcastId);
		if(scheduleId == '0' || scheduleIds.indexOf(scheduleIdStr) > -1) {
			broadcast.style.display = 'block';
		}
		else {
			broadcast.style.display = 'none';
		}
	}
}

function setLanguageVisibility(languageId) {
	for (var i = 0; i < languages.length; i++) {
		var listId = 'broadcastList' + languages[i];
		listEl = document.getElementById(listId);
		
		if(languageId == '0' || languageId == languages[i]) {
			listEl.style.display = 'block';
		}
		else {
			listEl.style.display = 'none';
		}
	}

}



function ppSelectionValueChanged(selectEl, name, structureId, defaultScheduleId) {
	if((typeof selectEl) == 'string') {
		selectEl = document.getElementById(selectEl);
	}
	
	if(selectEl == null) {
		return;
	}

	var selIndex = selectEl.selectedIndex;
	var selValue = selectEl.options[selIndex].value;
	
	// alert(name + ': ' + selValue);
	
	if(name == 'Schedule') {
		var href = null;
		
		if(selValue == defaultScheduleId) {
			href = '/dw/0,,' + structureId + ',00.html';
		}
		else {
			href = '/dw/' + selValue + '/0,,' + structureId + ',00.html';
		}
		
		location.href = href;
		
		return;
	}
	
	if(name == 'Language') {
		setPPLanguageVisibility(selValue);
		return;
	}
}


function setPPLanguageVisibility(languageId) {
	var teaser = document.getElementById('teaser252');
	var rows = teaser.getElementsByTagName('tr');
	
	for(var i=0; i<rows.length; i++) {
		var row =rows[i];
		if(row.className.indexOf('dayTableRow') == -1) {		
			continue;
		}
		if(languageId == '0' || row.className.indexOf('language_' + languageId + '_') > -1) {
			row.style.display = '';
		}
		else {
			row.style.display = 'none';
		}
		
	}
}


