//document.write("<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"http://www.apoforms.andreas-grey.com/apothema/datum_all.js\"></script>")

var newslist=new Array();
var newstext=new Array();
//var a_textid=new Array();
function build_newslist()
{
newslist[0]=new Array(newstext[1],"javascript:zeig_aktuell(1)")
newslist[1]=new Array(newstext[2],"javascript:zeig_aktuell(2)")
newslist[2]=new Array(newstext[3],"javascript:zeig_aktuell(3)")
if(global_kw<=10)
newslist[3]=new Array(newstext[4],"javascript:zeig_aktuell(4)")
}

var apostyle, apols, tickerapo;

function apoticker(my_apo)
{
tickerapo=my_apo;
if(my_apo=="friedrichsberg")
{apostyle="txt_norm"; apols=2};

if(my_apo=="kaufland")
{apostyle="rat"; apols=2;};

if(my_apo=="althaldensleben")
{apostyle="blaunorm"; apols=0;};

if(my_apo=="colbitz")
{apostyle="rat"; apols=2;};

}

var cnt=0;                        // current news item
var curr = "";
var i=-1;                        // current letter being typed

function zeig_aktuell(nr)
{
if(tickerapo=="friedrichsberg" || tickerapo=="kaufland" || tickerapo=="althaldensleben" || tickerapo=="colbitz")
{
if(nr==1) top.window.name="rg" + set_nummer1;
if(nr==2) top.window.name="rg" + set_nummer2;
if(nr==3) top.window.name="rg" + set_nummer3;
if(nr==4) top.window.name="rg" + set_nummer4;
document.location.href="ratgeber/main.htm"
}

/*
base="http://www.apoforms.andreas-grey.com/ratgeber/text.php?textid="
if(nr==1)
document.ratgeber.action=base + set_nummer1
if(nr==2)
document.ratgeber.action=base + set_nummer2
if(nr==3)
document.ratgeber.action=base + set_nummer3
if(nr==4)
document.ratgeber.action=base + set_nummer4

document.ratgeber.target="_blank"
document.ratgeber.submit()
*/
}

function newsticker()
{
//ticker_array()
var v_inner;
        // next character of current item
        if (i < newslist[cnt][0].length - 1)
        {
                i++;
                temp1 = newslist[cnt][0];
                temp1 = temp1.split('');
                  curr = curr+temp1[i];
                temp2 = newslist[cnt][1];


                v_inner="<a title='Jede Woche neue Themen' class='" + apostyle + "' href='"+temp2+"'><span style='letter-spacing:" + apols + "px'>"+curr+"</span></a>"

                document.getElementById("mtxt").innerHTML = v_inner;

                //document.getElementById("mtxt").innerHTML = "<small><a href='"+temp2+"'><font color='#ff0000'>"+curr+"_</small></font></a>";
                setTimeout('newsticker()',20)
                return;
        }

        // new item
        i = -1; curr = "";
        if (cnt<newslist.length-1)
                cnt++;
        else
                cnt=0;
        setTimeout('newsticker()',3000)

}

var global_kw, text_base, set_nummer1, set_nummer2, set_nummer3,  set_nummer4;

function set_kalenderwoche()
{
global_kw=f_setze_kw()
if (global_kw==1)  text_base="1,53,106,158";
if (global_kw==2)  text_base="2,54,107,159";
if (global_kw==3)  text_base="3,55,108,160";
if (global_kw==4)  text_base="4,56,109,161";
if (global_kw==5)  text_base="5,57,110,162";
if (global_kw==6)  text_base="6,58,111,163";
if (global_kw==7)  text_base="7,59,112,164";
if (global_kw==8)  text_base="8,60,113,165";
if (global_kw==9)  text_base="9,61,114,166";
if (global_kw==10)  text_base="10,62,115,167";
if (global_kw==11)  text_base="11,63,116";
if (global_kw==12)  text_base="12,64,117";
if (global_kw==13)  text_base="13,65,118";
if (global_kw==14)  text_base="14,66,119";
if (global_kw==15)  text_base="15,67,120";
if (global_kw==16)  text_base="16,68,121";
if (global_kw==17)  text_base="17,69,122";
if (global_kw==18)  text_base="18,70,123";
if (global_kw==19)  text_base="19,71,124";
if (global_kw==20)  text_base="20,72,125";
if (global_kw==21)  text_base="21,73,126";
if (global_kw==22)  text_base="22,74,127";
if (global_kw==23)  text_base="23,75,128";
if (global_kw==24)  text_base="24,76,129";
if (global_kw==25)  text_base="25,77,130";
if (global_kw==26)  text_base="26,78,131";
if (global_kw==27)  text_base="27,79,132";
if (global_kw==28)  text_base="28,80,133";
if (global_kw==29)  text_base="29,81,134";
if (global_kw==30)  text_base="30,82,135";
if (global_kw==31)  text_base="31,83,136";
if (global_kw==32)  text_base="32,84,137";
if (global_kw==33)  text_base="33,85,138";
if (global_kw==34)  text_base="34,86,139";
if (global_kw==35)  text_base="35,87,140";
if (global_kw==36)  text_base="36,88,141";
if (global_kw==37)  text_base="37,89,142";
if (global_kw==38)  text_base="38,90,143";
if (global_kw==39)  text_base="39,91,144";
if (global_kw==40)  text_base="40,92,145";
if (global_kw==41)  text_base="41,93,146";
if (global_kw==42)  text_base="42,94,147";
if (global_kw==43)  text_base="43,95,148";
if (global_kw==44)  text_base="44,96,149";
if (global_kw==45)  text_base="45,97,150";
if (global_kw==46)  text_base="46,98,151";
if (global_kw==47)  text_base="47,99,152";
if (global_kw==48)  text_base="48,100,153";
if (global_kw==49)  text_base="49,101,154";
if (global_kw==50)  text_base="50,103,155";
if (global_kw==51)  text_base="51,104,156";
if (global_kw==52)  text_base="52,105,157";

var a_themen = text_base.split(",");
set_nummer1=Number(a_themen[0])
set_nummer2=Number(a_themen[1])
set_nummer3=Number(a_themen[2])
if(global_kw<=10) set_nummer4=Number(a_themen[3]);

newstext[1]=a_textid[set_nummer1]
newstext[2]=a_textid[set_nummer2]
newstext[3]=a_textid[set_nummer3]
if(global_kw<=10) newstext[3]=a_textid[set_nummer4]
build_newslist();
}
set_kalenderwoche();
