/* CONFIG */
/*var aLinkNames = new Array("TV-Programm","VIP News","Schlagzeilen","Sport","Wetter","Movie &amp; DVD","Service","Horoskope","Dating &amp; Chat","Reise");
var aLinkTargets = new Array(300,430,110,200,140,440,500,430,600,800);*/

var aLinkNames = new Array("TV-Programm","VIP News","Schlagzeilen","Sport","Magazine","Wetter","Service","Horoskope","Dating & Chat","Reise");
var aLinkTargets = new Array(300,160,110,240,320,140,500,430,600,750);

var aLinkNamesAT = new Array("TV-Programm","VIP News","Schlagzeilen","Sport","Magazine","Wetter","Service","Horoskope","Dating & Chat","Reise");
var aLinkTargetsAT = new Array(300,160,110,240,320,140,500,430,600,750);

var bShowBottomPanel=false;
var sDomain = window.location.hostname.substr(window.location.hostname.indexOf(".")+1,window.location.hostname.length);
var sDomainExt = sDomain.substr(sDomain.indexOf(".")+1,sDomain.length);
var aBottomNames = new Array("Auto",
			"Film + DVD",
			"Games + Gewinnspiele",
			"Videos");
var aBottomTargets = new Array("http://www.kabeleins.de/auto/",
			"http://www.kabeleins.de/film_dvd/",
			"http://www.kabeleins.de/games_gewinn/",
			"http://www.kabeleins.de/tv_programm/trailer/");
			
var sImageName_Header = "http://www.kabeleins.de/images/teletext/teletext_pu_head_neu.gif";
var sImageName_Body = "http://www.kabeleins.de/images/teletext/teletext_pu_mitte_neu.gif";
var sImageName_Footer = "http://www.kabeleins.de/images/teletext/teletext_pu_foot_neu.gif";
var sBulletImage = "http://www.kabeleins.de/images/teletext/arrow_theme.gif";
/* /CONFIG */


function TSS_count_IVW (iPage, iSubPage) {
	count_ivw (iPage + '_' + iSubPage);
}
	
function CreateControl_getObject(objectId) {
      if(document.getElementById && document.getElementById(objectId)) {
            return document.getElementById(objectId);
      } else if (document.all && document.all(objectId)) {
            return document.all(objectId);     
      } else {
            return false;
      }
}
function OnUpdate()
{
  	var iPageNr     = document.getElementById("txtView").GetPageNumber();		 // current pagenumber
	var iSubNr      = document.getElementById("txtView").GetSubPageNumber();  // current subpagenumber
	var iMaxSubs    = document.getElementById("txtView").GetSubPageCount();   // total subpages for this page
	var iPrevPageNr = document.getElementById("txtView").GetPreviousPageNr(); // get previous pagenumber
	var iNextPageNr = document.getElementById("txtView").GetNextPageNr();     // get previous pagenumber
	
	iSubNr = iSubNr+1;
	document.getElementById("idPageNr").value  =iPageNr;
	document.getElementById("iSubPageNr").value=iSubNr;
	
	document.getElementById('idSubPageCount').innerHTML= iSubNr + "/"+ iMaxSubs;
	document.getElementById('idCurrentPageNr').innerHTML=iPageNr;
	document.getElementById('idPrevPage').innerHTML="<<"+iPrevPageNr;
	document.getElementById('idNextPage').innerHTML=iNextPageNr+">>";
}

function writeBottomPanel()
{
	var s="";
	if (bShowBottomPanel)
	{
		s+="<div style=\"background-color:#000000; width:440px; height:34px; margin: 7px 0px 0px 0px; font-family: Verdana, Arial, Helvetica, Sans-serif; font-size:11px; color:#FFFFFF;\">";
		s+="<h1 style=\"margin: 0px; padding: 3px 0px 1px 3px; font-size:12px; font-size:12px; font-weight:bold; text-decoration:none;\">"+sDomain+"</h1>";
		s+="<p style=\"margin: 0px; padding: 0px 0px 2px 3px;  font-weight:normal;\">";
		s+="&gt; <a href=\""+aBottomTargets[0]+"\" target=\"_blank\" style=\"font-family: Verdana, Arial, Helvetica, Sans-serif; font-size:11px; font-weight:normal; margin: 0px 20px 0px 0px; padding: 0px 0px 3px 0px; color:#FFFFFF;\" class=\"linkstyle\">"+aBottomNames[0]+"</a>";
		s+="&gt; <a href=\""+aBottomTargets[1]+"\" target=\"_blank\" style=\"font-family: Verdana, Arial, Helvetica, Sans-serif; font-size:11px; font-weight:normal; margin: 0px 20px 0px 0px; padding: 0px 0px 3px 0px; color:#FFFFFF;\" class=\"linkstyle\">"+aBottomNames[1]+"</a>";
		s+="&gt; <a href=\""+aBottomTargets[2]+"\" target=\"_blank\" style=\"font-family: Verdana, Arial, Helvetica, Sans-serif; font-size:11px; font-weight:normal; margin: 0px 20px 0px 0px; padding: 0px 0px 3px 0px; color:#FFFFFF;\" class=\"linkstyle\">"+aBottomNames[2]+"</a>";
		s+="&gt; <a href=\""+aBottomTargets[3]+"\" target=\"_blank\" style=\"font-family: Verdana, Arial, Helvetica, Sans-serif; font-size:11px; font-weight:normal; margin: 0px 0px 0px 0px; padding: 0px 0px 3px 0px; color:#FFFFFF;\" class=\"linkstyle\">"+aBottomNames[3]+"</a>";
		s+="</p></div>";
	}
	document.write(s);
}

function writeHeader()
{
	document.write("<div style=\"background-image:url("+sImageName_Header+"); background-repeat: no-repeat; height:82px; width:800px;\"></div>");
	document.write("<div style=\"background-image:url("+sImageName_Body+"); background-repeat: repeat-y; height:350px; width:800px;\">");
}

function writeFooter()
{
	document.write("<div style=\"background-image:url("+sImageName_Footer+"); background-repeat:no-repeat; background-color:#d4c8af; height:100px; width:738px; padding: 33px 0px 0px 12px;\">");
}

function writeApplet()
{
	s="";
	s+="<applet archive=\"TssView.jar?123\" CODE=\"TSSView.class\" CODEBASE=\".\" id=\"txtView\" height=\"300\" width=\"440\" align=\"top\" MAYSCRIPT VIEWASTEXT>";
        s+="<PARAM NAME = CODE VALUE = \"TSSView.class\" >";
        s+="<PARAM NAME=\"txtsub\" VALUE=\"00\">";
        s+="<PARAM NAME=\"font\" VALUE=\"vtx10x12.gif\">";
        s+="<PARAM NAME=\"channel\" VALUE=\"pro7"+sDomainExt+"\">";
        s+="<PARAM NAME=\"txtpage\" VALUE=\"100\">";
        s+="<PARAM NAME=\"bgcolor\" VALUE=\"000000\">";
        s+="<PARAM NAME=\"showbuttons\" value=\"false\">";
        s+="<PARAM NAME=\"onpageloadmethod\" VALUE=\"TSS_count_IVW\">";
        s+="<PARAM NAME=\"addtimestamp \" VALUE=\"true\">";
        s+="</applet>";
        document.write(s);
}

function writeLink(sName,sTarget)
{
	var s="";
	/*s+="<img src=\""+sBulletImage+"\" width=\"7\" height=\"7\" border=\"0\">";*/
	s+="<li><a href=\"javascript:getPage("+sTarget+");\">"+sName+"</a></li>";document.write(s);
}

function getPage(iPage)
{
	
	//OnUpdate();
	if (iPage < 100) return
	else
	{
		iE=iPage%10;
		iPage=Math.floor(iPage/10);
		iZ=iPage%10;
		iH=Math.floor(iPage/10);
	}
	
	onnumberclicked(iH);
	onnumberclicked(iZ);
	onnumberclicked(iE);
}

function getPageOnLoad()
{
	if (document.URL.indexOf('?')>-1)
	{
		var iPage=document.URL.substr(document.URL.indexOf('?')+1,document.URL.length);
		if (iPage.length == 3)
		{
			if (!isNaN(iPage))
			{
				getPage(iPage,1);
			}
		}
		else
		{
			if (iPage.indexOf("_")>-1)
			{
				var aPage=iPage.split("_");
			}
			if (!isNaN(aPage[0]))
			{
				if (!isNaN(aPage[1]))
				{
					getPage(aPage[0],aPage[1]);
				}
			}
		}
	}
}

window.onload=getPageOnLoad;