//
//  Copyright (C) 2002 TechnoTrend AG
//

var filter = 0;
var fav = "no";

function ShowDataProg(sProgName, sURL)
{

var winLocked = new Array();

	parent.Fr_data.document.getElementById("PN0").style.display = 'inline';
	parent.Fr_data.document.getElementById("DA0").style.display = 'inline';

	sTime = parent.Fr_time.document.getElementById("TimSel").value;
	nTime = parseInt(sTime,10);
	if( nTime < 10 )
	{
		sURL += ("#0" + sTime);
	}
	else
	{
		sURL += ("#" + sTime);
	}

        var activeWin;

        if (top.Fr_winButtons.document.getElementById("bt0").active == "yes")
          activeWin = 0;
        if (top.Fr_winButtons.document.getElementById("bt1").active == "yes")
          activeWin = 1;
        if (top.Fr_winButtons.document.getElementById("bt2").active == "yes")
          activeWin = 2;
        if (top.Fr_winButtons.document.getElementById("bt3").active == "yes")
          activeWin = 3;
        if (top.Fr_winButtons.document.getElementById("bt4").active == "yes")
          activeWin = 4;
        if (top.Fr_winButtons.document.getElementById("bt5").active == "yes")
          activeWin = 5;


        winLocked[0] = (top.Fr_data.nifp0.document.getElementById("CurPrg").winLocked == "1");
		winLocked[1] = (top.Fr_data.nifp1.document.getElementById("CurPrg").winLocked == "1");
        winLocked[2] = (top.Fr_data.nifp2.document.getElementById("CurPrg").winLocked == "1");
        winLocked[3] = (top.Fr_data.nifp3.document.getElementById("CurPrg").winLocked == "1");
        winLocked[4] = (top.Fr_data.nifp4.document.getElementById("CurPrg").winLocked == "1");
        winLocked[5] = (top.Fr_data.nifp5.document.getElementById("CurPrg").winLocked == "1");


    if (!winLocked[activeWin])
	{
		switch(activeWin)
		{
		case 0:
			parent.Fr_data.nifp0.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(0)'>" + sProgName + "</span>";
			parent.Fr_data.nifp0.document.getElementById("CurPrg").win = "0";
			parent.Fr_data.nifd0.location.href=sURL;
			break;
		case 1:
			top.Fr_winButtons.document.getElementById("td_bt2").style.visibility = "visible";
			parent.Fr_data.document.getElementById("PN1").style.display = 'inline';
			parent.Fr_data.document.getElementById("DA1").style.display = 'inline';
			parent.Fr_data.nifp1.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(1)'>" + sProgName + "</span>";
			parent.Fr_data.nifp1.document.getElementById("CurPrg").win = "1";
			parent.Fr_data.nifd1.location.href=sURL;
			break;
		case 2:
			top.Fr_winButtons.document.getElementById("td_bt3").style.visibility = "visible";
			parent.Fr_data.document.getElementById("PN2").style.display = 'inline';
			parent.Fr_data.document.getElementById("DA2").style.display = 'inline';
			parent.Fr_data.nifp2.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(2)'>" + sProgName + "</span>";
			parent.Fr_data.nifp2.document.getElementById("CurPrg").win = "2";
			parent.Fr_data.nifd2.location.href=sURL;
			break;
		case 3:
			top.Fr_winButtons.document.getElementById("td_bt4").style.visibility = "visible";
			parent.Fr_data.document.getElementById("PN3").style.display = 'inline';
			parent.Fr_data.document.getElementById("DA3").style.display = 'inline';
			parent.Fr_data.nifp3.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(3)'>" + sProgName + "</span>";
			parent.Fr_data.nifp3.document.getElementById("CurPrg").win = "3";
			parent.Fr_data.nifd3.location.href=sURL;
	     	break;
		case 4:
			top.Fr_winButtons.document.getElementById("td_bt5").style.visibility = "visible";
			parent.Fr_data.document.getElementById("PN4").style.display = 'inline';
			parent.Fr_data.document.getElementById("DA4").style.display = 'inline';
			parent.Fr_data.nifp4.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(4)'>" + sProgName + "</span>";
			parent.Fr_data.nifp4.document.getElementById("CurPrg").win = "4";
			parent.Fr_data.nifd4.location.href=sURL;
	  		break;
		case 5:
			parent.Fr_data.document.getElementById("PN5").style.display = 'inline';
			parent.Fr_data.document.getElementById("DA5").style.display = 'inline';
			parent.Fr_data.nifp5.document.getElementById("CurPrg").innerHTML = "<span oncontextmenu='PrintIt(5)'>" + sProgName + "</span>";
			parent.Fr_data.nifp5.document.getElementById("CurPrg").win = "5";
			parent.Fr_data.nifd5.location.href=sURL;
	  		break;
		default:
			parent.Fr_data.nifp1.document.getElementById("CurPrg").innerHTML = sProgName;
			parent.Fr_data.nifd1.location.href=sURL;
			break;
		}
	}
}


function Reveal(elem, sEvID)
{
	var RefElem = document.getElementById(sEvID);
	if( RefElem && (RefElem.className == "tree") )
	{
		if(	RefElem.style.display != "inline" )
		{
			elem.title = "";
			RefElem.style.display = "inline";
		}
		else
		{
			RefElem.style.display = "none";
		}
	}
}

function SetCursor(elem, sEvID)
{
	var RefElem = document.getElementById(sEvID);
	if( RefElem && (RefElem.className == "tree") )
	{
		elem.style.cursor = "hand";
		if( RefElem.style.display != "inline" )
		{
			var Begriff = document.getElementById(sEvID).lastChild.firstChild.data;
			var Extrakt = Begriff.slice(0,100);
			if (Begriff.length > 100)
				Extrakt += "..."; 
			
			elem.title = Extrakt;
		}
		else
		{
			elem.title = "";
		}
	}
}


function ChangeTime(obj)
{
	var sURL = "";
	var sTime = obj.value;

	top.Fr_void.document.getElementById("idPeriod").from = sTime;

	if( parseInt(sTime,10) < 10 )
		sTime = "0" + sTime;

	sURL = top.Fr_data.document.nifd5.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd5.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd5.document.all.idif)
		parent.Fr_data.document.nifd5.document.all.idif.scrollTop -= 38;
	

	sURL = top.Fr_data.document.nifd4.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd4.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd4.document.all.idif)
		parent.Fr_data.document.nifd4.document.all.idif.scrollTop -= 38;

	sURL = top.Fr_data.document.nifd3.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd3.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd3.document.all.idif)
		parent.Fr_data.document.nifd3.document.all.idif.scrollTop -= 38;

	sURL = top.Fr_data.document.nifd2.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd2.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd2.document.all.idif)
		parent.Fr_data.document.nifd2.document.all.idif.scrollTop -= 38;

	sURL = top.Fr_data.document.nifd1.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd1.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd1.document.all.idif)
		parent.Fr_data.document.nifd1.document.all.idif.scrollTop -= 38;

	sURL = top.Fr_data.document.nifd0.document.URL;
	saURL = sURL.split("#");
	saURL[0] += "#" + sTime;
	parent.Fr_data.document.nifd0.location.href=decodeURI(saURL[0]);

	if(parent.Fr_data.document.nifd0.document.all.idif)
		parent.Fr_data.document.nifd0.document.all.idif.scrollTop -= 38;
}

function CorrigTop()
{
	if(document.all.idif)
	{
		setTimeout('document.all.idif.scrollTop -= 38', 400);
	}
}

function SetCurTime()
{
	var Now = new Date();
    var sHours = Now.getHours();

	var i;
	document.all.TimSelSpan.innerHTML = "<select id=\"TimSel\" class=\"cssSel\" onchange=\"ChangeTime(this);\"></select>";

	for( i = 0; i < 25; i++ )
	{
		oOption = parent.Fr_time.document.createElement("OPTION");
		oOption.text = i.toString() + ":00";
		oOption.value = i.toString();
		parent.Fr_time.document.all.TimSel.add(oOption);
		if(sHours == oOption.value)
			oOption.selected = true;
	}

	top.Fr_void.document.getElementById("idPeriod").from = sHours;
}

function ShowHide()
{

	switch (filter)
	{
	case 0:
		Radio2TV();
		filter++;
		break;
	case 1:
		TV2Radio();
		filter = 0;
		break;
	default:
		break;
	}

}

function Radio2TV()
{
	var i;
	var span = parent.Fr_content.document.getElementsByTagName("span").length;

	if (fav == "no")
	{
		for (i = 0; i < span; i++)
		{
			if (parent.Fr_content.document.getElementsByTagName("span")[i].TVR == 1)
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "inline";
			else
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "none";
		}
	}
	else if (fav == "yes")
	{
		for (i = 0; i < span; i++)
		{
			if (parent.Fr_content.document.getElementsByTagName("span")[i].TVR == 1 && parent.Fr_content.document.getElementsByTagName("span")[i].F ==1)
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "inline";
			else
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "none";
		}
	}
} 

function TV2Radio()
{
	var i;
	var span = parent.Fr_content.document.getElementsByTagName("span").length;

	if (fav == "no")
	{
		for (i = 0; i < span; i++)
		{
			if (parent.Fr_content.document.getElementsByTagName("span")[i].TVR == 0)
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "inline";
			else
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "none";
		}
	}

	else if (fav == "yes")
	{
		for (i = 0; i < span; i++)
		{
			if (parent.Fr_content.document.getElementsByTagName("span")[i].TVR == 0 && parent.Fr_content.document.getElementsByTagName("span")[i].F ==1)
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "inline";
			else
				parent.Fr_content.document.getElementsByTagName("span")[i].style.display = "none";
		}
	}
}

function mouseovertvr(elem)
{
	if(filter == 0)
	{
		SetImage(elem, "../Html/Pic/g_tv_a.gif");
	}
	else
	{
		SetImage(elem, "../Html/Pic/g_radio_a.gif");
	}
}

function mousedowntvr(elem)
{
	if(filter == 0)
	{
		SetImage(elem, "../Html/Pic/g_tv_b.gif");
	}
	else
	{
		SetImage(elem, "../Html/Pic/g_radio_b.gif");
	}
}

function mouseouttvr(elem)
{
	if(filter == 0)
	{
		SetImage(elem, "../Html/Pic/g_radio_c.gif");
	}
	else
	{
		SetImage(elem, "../Html/Pic/g_tv_c.gif");
	}
}


function favorit()
{

	if (fav =="yes")
	{
	   fav = "no";
	}
	else
	{
	   fav = "yes";
	}


	if (filter > 0)
		filter--;
	else
		filter = 1;       // wenn ShowAll aktiv => filter = 2 !!!!

	ShowHide();
}

function mouseoutfav()
{
	if (fav == "no")
		document.getElementsByName("Fav")[0].src="./../Html/Pic/G_FAV.gif";
	else
		document.getElementsByName("Fav")[0].src="./../Html/Pic/G_FAV_C.gif";
}


function lock()
{
	var i;
	var win;
	i = document.getElementById("CurPrg").winLocked;
	win = parseInt(document.getElementById("CurPrg").win,10);

	if (i == "1")
	{
		document.getElementById("CurPrg").style.color = "#FFFF00";
		document.getElementById("CurPrg").winLocked = "0";

		switch (win)
		{
			case 0:
				  top.Fr_winButtons.document.getElementById("bt0").style.color = "#FFFF00";
				  top.Fr_winButtons.document.getElementById("bt0").winLocked = "no";
				  changeActiveWindow0();
				  break;

			case 1:
				  top.Fr_winButtons.document.getElementById("bt1").style.color = "#FFFF00";
				  top.Fr_winButtons.document.getElementById("bt1").winLocked = "no";
				  changeActiveWindow1();
				  break;

			case 2:
				  top.Fr_winButtons.document.getElementById("bt2").style.color = "#FFFF00";
				  top.Fr_winButtons.document.getElementById("bt2").winLocked = "no";
				  changeActiveWindow2();
				  break;

			case 3:
				  top.Fr_winButtons.document.getElementById("bt3").style.color = "#FFFF00";
				  top.Fr_winButtons.document.getElementById("bt3").winLocked = "no";
				  changeActiveWindow3();
				  break;

			case 4:
				  top.Fr_winButtons.document.getElementById("bt4").style.color = "#FFFF00";
				  top.Fr_winButtons.document.getElementById("bt4").winLocked = "no";
				  changeActiveWindow4();
				  break;
			case 5:
				top.Fr_winButtons.document.getElementById("bt5").style.color = "#FFFF00";
				top.Fr_winButtons.document.getElementById("bt5").winLocked = "no";
				changeActiveWindow5();
				break;
			}   //switch
		}     //if
		else
		{
		document.getElementById("CurPrg").style.color = "#FF8800";
		document.getElementById("CurPrg").winLocked = "1";

		  switch (win)
		  {
		   case 0:
				  top.Fr_winButtons.document.getElementById("bt0").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt0").winLocked = "yes";
				  break;

		   case 1:
				  top.Fr_winButtons.document.getElementById("bt1").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt1").winLocked = "yes";
				  break;

		   case 2:
				  top.Fr_winButtons.document.getElementById("bt2").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt2").winLocked = "yes";
				  break;

		   case 3:
				  top.Fr_winButtons.document.getElementById("bt3").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt3").winLocked = "yes";
				  break;

		   case 4:
				  top.Fr_winButtons.document.getElementById("bt4").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt4").winLocked = "yes";
				  break;
		   case 5:
				  top.Fr_winButtons.document.getElementById("bt5").style.color = "#FF8800";
				  top.Fr_winButtons.document.getElementById("bt5").winLocked = "yes";
				  break;
		   }     //switch
	 }       //else
}

function changeActiveWindow0()   // Fenster 0 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp0.document.getElementById("CurPrg").winLocked == "1");


	var oldActiveWin;

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");

	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt0").style.color = "#FF8800";

	if (!winLocked)
	{
		top.Fr_winButtons.document.getElementById(oldId).active = "no";
		top.Fr_winButtons.document.getElementById("bt0").active = "yes";

		if (oldActiveWinLocked)
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
		else
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

		top.Fr_winButtons.document.getElementById("bt0").style.color = "#FFFF00";
	}
}

function changeActiveWindow1()   // Fenster 1 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp1.document.getElementById("CurPrg").winLocked == "1");

	var oldActiveWin;

//	top.Fr_winButtons.document.getElementById("td_bt2").style.visibility = "visible";

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");


	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt1").style.color = "#FF8800";

	if (!winLocked)
	{
		top.Fr_winButtons.document.getElementById(oldId).active = "no";
		top.Fr_winButtons.document.getElementById("bt1").active = "yes";

		if (oldActiveWinLocked)
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
		else
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

		top.Fr_winButtons.document.getElementById("bt1").style.color = "#FFFF00";
	}
}

function changeActiveWindow2()   // Fenster 3 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp2.document.getElementById("CurPrg").winLocked == "1");

	var oldActiveWin;

//	top.Fr_winButtons.document.getElementById("td_bt3").style.visibility = "visible";

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");


	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt2").style.color = "#FF8800";

	if (!winLocked)
	{
		top.Fr_winButtons.document.getElementById(oldId).active = "no";
		top.Fr_winButtons.document.getElementById("bt2").active = "yes";

		if (oldActiveWinLocked)
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
		 else
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

		top.Fr_winButtons.document.getElementById("bt2").style.color = "#FFFF00";
	}
}

function changeActiveWindow3()   // Fenster 3 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp3.document.getElementById("CurPrg").winLocked == "1");

	var oldActiveWin;

//	top.Fr_winButtons.document.getElementById("td_bt4").style.visibility = "visible";

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");


	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt3").style.color = "#FF8800";

	if (!winLocked)
	{
		top.Fr_winButtons.document.getElementById(oldId).active = "no";
		top.Fr_winButtons.document.getElementById("bt3").active = "yes";

		if (oldActiveWinLocked)
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
		else
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

		top.Fr_winButtons.document.getElementById("bt3").style.color = "#FFFF00";
	}
}

function changeActiveWindow4()   // Fenster 4 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp4.document.getElementById("CurPrg").winLocked == "1");

	var oldActiveWin;

//	top.Fr_winButtons.document.getElementById("td_bt5").style.visibility = "visible";

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");


	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt4").style.color = "#FF8800";

	if (!winLocked)
	{
		top.Fr_winButtons.document.getElementById(oldId).active = "no";
		top.Fr_winButtons.document.getElementById("bt4").active = "yes";

		if (oldActiveWinLocked)
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
		 else
			top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

		top.Fr_winButtons.document.getElementById("bt4").style.color = "#FFFF00";
	}
}


function changeActiveWindow5()   // Fenster 5 aktiv
{
	var winLocked = new Boolean();
	 winLocked = (top.Fr_data.nifp5.document.getElementById("CurPrg").winLocked == "1");

	var oldActiveWin;

	if (top.Fr_winButtons.document.getElementById("bt0").active == "yes") oldActiveWin = 0;
	if (top.Fr_winButtons.document.getElementById("bt1").active == "yes") oldActiveWin = 1;
	if (top.Fr_winButtons.document.getElementById("bt2").active == "yes") oldActiveWin = 2;
	if (top.Fr_winButtons.document.getElementById("bt3").active == "yes") oldActiveWin = 3;
	if (top.Fr_winButtons.document.getElementById("bt4").active == "yes") oldActiveWin = 4;
	if (top.Fr_winButtons.document.getElementById("bt5").active == "yes") oldActiveWin = 5;

	var oldId = "bt" + oldActiveWin;

	var oldActiveWinLocked = new Boolean();
	 oldActiveWinLocked = (top.Fr_winButtons.document.getElementById(oldId).winLocked == "yes");


	if (winLocked)
	 top.Fr_winButtons.document.getElementById("bt5").style.color = "#FF8800";

	if (!winLocked){
	top.Fr_winButtons.document.getElementById(oldId).active = "no";
	top.Fr_winButtons.document.getElementById("bt5").active = "yes";

	if (oldActiveWinLocked)
	  top.Fr_winButtons.document.getElementById(oldId).style.color = "#FF8800";
	 else
	  top.Fr_winButtons.document.getElementById(oldId).style.color = "#C0C0C0";

	top.Fr_winButtons.document.getElementById("bt5").style.color = "#FFFF00";
	}
}


function recTimer(node)
{
	var num = node.num;
	window.navigate("recTimer:" + num);
}

function SetImage(elem,imgname)
{
	elem.src = imgname;
}


function PrintAll()
{
	var bOK = false;

	var i;

	var objects = new Array(6);

	nCols = objects.length;

	for(i = 0; i < nCols; i++ )
	{
		objects[i] = new Array(5);
	}

	objects[0][0] = parent.Fr_data.nifp0;
	objects[0][1] = parent.Fr_data.nifd0;
	objects[0][2] = top.Fr_void.document.all.progname0;
	objects[0][3] = parent.Fr_data.document.all.PN0;
	objects[0][4] = top.Fr_void.document.all.idday_0;

	objects[1][0] = parent.Fr_data.nifp1;
	objects[1][1] = parent.Fr_data.nifd1;
	objects[1][2] = top.Fr_void.document.all.progname1;
	objects[1][3] = parent.Fr_data.document.all.PN1;
	objects[1][4] = top.Fr_void.document.all.idday_1;

	objects[2][0] = parent.Fr_data.nifp2;
	objects[2][1] = parent.Fr_data.nifd2;
	objects[2][2] = top.Fr_void.document.all.progname2;
	objects[2][3] = parent.Fr_data.document.all.PN2;
	objects[2][4] = top.Fr_void.document.all.idday_2;

	objects[3][0] = parent.Fr_data.nifp3;
	objects[3][1] = parent.Fr_data.nifd3;
	objects[3][2] = top.Fr_void.document.all.progname3;
	objects[3][3] = parent.Fr_data.document.all.PN3;
	objects[3][4] = top.Fr_void.document.all.idday_3;

	objects[4][0] = parent.Fr_data.nifp4;
	objects[4][1] = parent.Fr_data.nifd4;
	objects[4][2] = top.Fr_void.document.all.progname4;
	objects[4][3] = parent.Fr_data.document.all.PN4;
	objects[4][4] = top.Fr_void.document.all.idday_4;

	objects[5][0] = parent.Fr_data.nifp5;
	objects[5][1] = parent.Fr_data.nifd5;
	objects[5][2] = top.Fr_void.document.all.progname5;
	objects[5][3] = parent.Fr_data.document.all.PN5;
	objects[5][4] = top.Fr_void.document.all.idday_5;

	var nSpans = 0;
	var nTrs = 0;
	var nTds = 0;

	var sContent = "";
	var sTime = "";

	var TRcount = 1;	// ohne Datum

	var nTime = 0;
	var nLastTime = 0;

	var sId = "";

	var nTdtims = 0;
	var nTdtimsCnt = 0;

	var nObj = 0;

	var bWinOK = false;

	var sIdPre = "";

	var obj_ifp = objects[nObj][0];
	var obj_ifd = objects[nObj][1];
	var obj_prn = objects[nObj][2];
	var obj_col = objects[nObj][3];
	var obj_day = objects[nObj][4];

	var nFrom = parseInt( top.Fr_void.document.getElementById("idPeriod").from, 10 );

	for( nObj = 0; nObj < nCols; nObj++ )
	{
		obj_ifp = objects[nObj][0];
		obj_ifd = objects[nObj][1];
		obj_prn = objects[nObj][2];
		obj_col = objects[nObj][3];
		obj_day = objects[nObj][4];

		sIdPre = nObj + "_";

		if(obj_col.style.display != "none")
		{
			nSpans = 0;
			nTrs = 0;
			nTds = 0;

			sContent = "<table style=\"width:100%\" width=\"100%\">";
			sTime = "";

			TRcount = 1;	// ohne Datum

			nTime = 0;
			nLastTime = 0;

			sId = "";

			nTdtims = 0;
			nTdtimsCnt = 0;

			bOK = true;
			bWinOK = false;

			if( (obj_ifp.document.getElementById("CurPrg").winLocked == "1")
				|| (nObj == 0) )
			{
				bWinOK = true;
			}

			if( bWinOK == true )
			{
				obj_prn.innerHTML = 
					obj_ifp.document.getElementById("CurPrg").innerHTML;
				obj_prn.className = "cssPrN";

				obj_day.innerHTML = 
					obj_ifd.document.getElementById("idday").firstChild.nodeValue;
			}
			else
			{
				obj_prn.innerHTML = " ";
				obj_prn.className = "";
				obj_day.innerHTML = " ";
			}

			nSpans = obj_ifd.document.getElementsByTagName("span").length;

			nTds = obj_ifd.document.getElementsByTagName("td").length;

			for( i = 0; i < nTds; i++ )
			{
				if( obj_ifd.document.getElementsByTagName("td")[i].className == "tdtim" )
					nTdtims++;
			}

			nTrs = obj_ifd.document.getElementsByTagName("tr").length;

			if( nSpans )
				sTime = obj_ifd.document.getElementsByTagName("span")[0].firstChild.nodeValue;
			else
				sTime = "0";

			nTime = parseInt(sTime,10);
			if( nTime == 0 )
			{
				nTime = 24;
			}
			nLastTime = nTime;

			i = 2;
			for( nTdtimsCnt = 0 ; nTdtimsCnt <= nTdtims; nTdtimsCnt++, i += 2 )
			{
				if( nTdtimsCnt < nTdtims )
				{
					if( TRcount < nTrs )
					{
						sContent += obj_ifd.document.getElementsByTagName("tr")[TRcount].outerHTML;
						TRcount++;
					}

					if( (TRcount < nTrs) && (obj_ifd.document.getElementsByTagName("tr")[TRcount].className == "tree") )
					{
						sContent += obj_ifd.document.getElementsByTagName("tr")[TRcount].outerHTML;
						TRcount++;
					}
				}

				if( nTdtimsCnt < (nTdtims - 1) )
				{
					sId = sIdPre + nTime.toString(10);
					sTime = obj_ifd.document.getElementsByTagName("span")[i].firstChild.nodeValue;
					nTime = parseInt(sTime,10);
					if( nTime == 0 )
					{
						nTime = 24;
					}
				}

				if( (nLastTime != nTime) || ( nTdtimsCnt == nTdtims ) )
				{
					if( nTdtimsCnt == nTdtims )
					{
						sId = sIdPre + nTime.toString();
					}
					sContent += "</table>";

					if(	(nFrom < nTime) && (bWinOK == true) )
					{
						top.Fr_void.document.getElementById(sId).innerHTML = sContent;	
					}
					else
					{
						top.Fr_void.document.getElementById(sId).innerHTML = " ";
					}
					sContent = "<table style=\"width:100%\" width=\"100%\">";
					nLastTime = nTime;
				}
			}
		}//if
	}//for

	if( bOK == true )
	{
		top.Fr_void.focus();
		top.Fr_void.print();
	}

	for( i = 0; i < nCols; i++ )
	{
		objects[i][2].className = "";
		objects[i][2].innerHTML = " ";
		objects[i][4].innerHTML = " ";
	}
	bWinOK = false;
}

function PrintIt(nObj)
{
	var objPrN;
	var objDat;

	switch(nObj)
	{
	case 0:
		objPrN = top.Fr_data.nifp0;
		objDat = top.Fr_data.nifd0;
		break;
	case 1:
		objPrN = top.Fr_data.nifp1;
		objDat = top.Fr_data.nifd1;
		break;
	case 2:
		objPrN = top.Fr_data.nifp2;
		objDat = top.Fr_data.nifd2;
		break;
	case 3:
		objPrN = top.Fr_data.nifp3;
		objDat = top.Fr_data.nifd3;
		break;
	case 4:
		objPrN = top.Fr_data.nifp4;
		objDat = top.Fr_data.nifd4;
		break;
	case 5:
		objPrN = top.Fr_data.nifp5;
		objDat = top.Fr_data.nifd5;
		break;
	default:
		objPrN = top.Fr_data.nifp0;
		objDat = top.Fr_data.nifd0;
		break;
	}

	top.Fr_void.document.all.progname0.innerHTML = 
		objPrN.document.getElementById("CurPrg").innerHTML;//firstChild.nodeValue;
	top.Fr_void.document.all.progname0.className = "cssPrN";

	top.Fr_void.document.all.data0.innerHTML = 
		objDat.document.body.innerHTML;

	top.Fr_void.focus();
	top.Fr_void.print();

	top.Fr_void.document.all.progname0.innerHTML = " ";
	top.Fr_void.document.all.progname0.className = "";
	top.Fr_void.document.all.data0.innerHTML = " ";
}
