// "JavaScript-Error"-Unterdrueckung ggf. aktivieren:
// window.onerror = null;






/* ******************************************************************************** */
/* * Browser-Detection/Abfragen                                                   * */
/* *                                                                              * */
/* * es wird geprft, welche Browser-Art/Version unter welcher Plattform luft.   * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * Aufruf      : automatisch nach Einlesen des Files                            * */
/* *                                                                              * */
/* * Parameter                                                                    * */
/* * =========                                                                    * */
/* *                                                                              * */
/* *                                                                              * */
/* * Rckgabewerte                                                                * */
/* * =============                                                                * */
/* *                                                                              * */
/* * is.b      = Browser (Netscape, Explorer ....)                           * */
/* * is.ac   = Browser-Codename (Mozilla o..)                             * */
/* * is.v   = Browser-Version (n; bei MSIE 5.x wird diese auch erkannt)   * */
/* * is.DOM         = DOM-Kompatibel  (true bei MSIE >= 5.x und Netscape >=6      * */
/* * is.swapper  = true/false - Wert fr Layer-Funktionalitt                  * */
/* * is.layers  = true/false - Wert fr Layer-Funktionalitt                  * */
/* * is.ns   = true, wenn Netscape-Browser Vx                              * */
/* * is.ie   = true, wenn MS Explorer-Browser Vx                           * */
/* *                                                                              * */
/* * Sonstiges   :                                                                * */
/* * is.ns3/ns4/ns5/ns6   true, wenn bereinstimmung                              * */
/* * is.ie3/ie4/ie5/ie55  true, wenn bereinstimmung                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * HISTORY:                                                                     * */
/* * 03.11.00    : V 1.0   Developer: fw                                          * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
function BrowserDetection()
{
 this.agent  = navigator.userAgent;
 this.browser  = navigator.appName;
 this.ac   = navigator.appCodeName;
 this.version  = navigator.appVersion;
 this.DOM   = document.getElementById ? true : false; // Netscape V6 + MSIE >= V5

 this.b = this.browser;
 if (this.browser == "Netscape") this.b = "ns";
 if (this.browser.indexOf("Explorer") != -1) this.b = "ie";

 this.pf = "n.A.";
 if (this.b == "ns" && this.DOM) {this.version = String(this.version + navigator.userAgent);}
 if (this.version.indexOf("Win98") > -1 || this.version.indexOf("Windows 98") > -1) this.pf = "Win98";
 if (this.version.indexOf("Win95") > -1 || this.version.indexOf("Windows 95") > -1) this.pf = "Win95";
 if (this.version.indexOf("NT 3") > -1 || this.version.indexOf("NT3") > -1) this.pf = "NT3";
 if (this.version.indexOf("NT 5") > -1 || this.version.indexOf("NT5") > -1) this.pf = "NT5"; // WIN 2000
 if (this.version.indexOf("2000") > -1 || this.version.indexOf("NT4") > -1) this.pf = "2000";
 if (this.version.indexOf("Macintosh") != -1 || this.version.indexOf("Mac") > -1) this.pf = "Mac";
 if (this.version.indexOf("Sun") > -1) this.pf = "Sun";


 this.v = parseInt(this.version);
 if (this.version.indexOf("MSIE") > -1) {
  this.v = parseInt(this.version.substring(this.version.indexOf("MSIE")+5,this.version.lastIndexOf(";")));
 }

 if (this.version.indexOf("Netscape6") > -1) {
  this.v = parseInt(this.version.substring(this.version.indexOf("Netscape6/")+10,this.version.length));
 }

 this.layers  = (this.v >= 4) ? true : false;
 this.opera   = (this.agent.indexOf("Opera") != -1) ? true : false;

 this.ns   = (this.b=="ns" && this.v >= 4);
 this.ns3   = (this.b=="ns" && this.v == 3);
 this.ns4   = (this.b=="ns" && this.v == 4);
 this.ns5   = (this.b=="ns" && this.v == 5);
 this.ns6   = (this.b=="ns" && this.v == 6);

 this.ie   = (this.b=="ie" && this.v >= 4);
 this.ie3   = (this.version.indexOf("MSIE 3") != -1);
 this.ie4   = (this.version.indexOf("MSIE 4") != -1);
 this.ie5   = (this.version.indexOf("MSIE 5") != -1);
 this.ie55   = (this.version.indexOf("MSIE 5.5") != -1);
 this.swapper  = ((this.ie && this.v >=4) || this.ns && this.v >=3) ? true : false;

}

var is = new BrowserDetection();
//alert ("Browser:\t"+is.browser+"\nDOM: "+is.DOM+"\nVersion: "+is.v+"\nPlattform: "+is.pf+"\nCodename: "+is.ac+"\nLayerfunktion: "+is.layers);






/* ******************************************************************************** */
/* * Netscape 4.x onResize-Handler                                                * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * Aufruf      :  onResize="resizer();"                                         * */
/* *                Einzusetzen im <BODY> oder <FRAMESET>                         * */
/* ******************************************************************************** */
/* * HISTORY:                                                                     * */
/* * 11.01.01    : V 1.0   Developer: fw                                          * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
// in <BODY> oder <FRAMESET> einzusetzen:
// onResize="resizer();"

if (is.ns) {
 b_width = top.window.innerWidth;
 b_height = top.window.innerHeight;
}

function resizer()
{
    if (!is.ns4) {return;}
    if (b_width != top.window.innerWidth || b_height != top.window.innerHeight) {self.location.reload();}
}


/* ******************************************************************************** */
/* * Breite/Hoehe (Inhalt) des Browserfensters / Douments auslesen                * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * Aufruf      : var wert = docAttrib("content", 1);                            * */
/* * oder        : var wert = docAttrib(null, 0);                                 * */
/* *                                                                              * */
/* * Parameter                                                                    * */
/* * =========                                                                    * */
/* * framename   : null oder String (bspw. "content")                             * */
/* * which       : 0 = Breite | 1 = Hoehe                                         * */
/* *                                                                              * */
/* *                                                                              * */
/* * Rckgabewerte                                                                * */
/* * =============                                                                * */
/* * value       : Pixelwert                                                      * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * HISTORY:                                                                     * */
/* * 11.01.01    : V 1.0   Developer: fw                                           * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
function docAttrib ( which, attr )
{
 if (which != null)
  which = "parent." + which + ".";
 else
  which = "";

 if (attr == 0)
  value = (is.ns) ? eval(which+"window.innerWidth") : eval(which+"document.body.clientWidth");
 else
  value = (is.ns) ? eval(which+"window.innerHeight") : eval(which+"document.body.clientHeight");

 if (is.pf != "Mac") {
  if (is.ie)
   value+=14;
  else
   value-=2;
 }

 return value;
}


/*function docAttrib ( framename, which )
{
 framename = (framename != null) ? framename = "parent." + framename + "." : framename = "";

 if (which == 0)
  value = (is.ns) ? eval(framename+"window.innerWidth") : eval(framename+"document.body.clientWidth");
 else
  value = (is.ns) ? eval(framename+"window.innerHeight") : eval(framename+"document.body.clientHeight");

 return value;
}
*/








/* ******************************************************************************** */
/* * Fenster ffnen                                                               * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * Aufruf      : openWin("test.html",640,480,-1,-1,1);                          * */
/* *                                                                              * */
/* * Parameter                                                                    * */
/* * =========                                                                    * */
/* * remoteWin   : globale Veriable; kann somit abgefragt werden (true/false)     * */
/* * datei       : zu oeffnende Datei/Pfad                                        * */
/* * breite      : Fensterbreite in Pixel                                         * */
/* * hoehe       : Fensterhoehe in Pixel                                          * */
/* * x           : x-Position (pixel) des Fensters (-1 = standard)                * */
/* * y           : y-Position (pixel) des Fensters (-1 = standard)                * */
/* * scrolling   : 1 = Scrollbars on | -1 = Scrollbars off                        * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
/* * HISTORY:                                                                     * */
/* * 11.01.01    : V 1.0   Developer: fw                                          * */
/* *                                                                              * */
/* *                                                                              * */
/* *                                                                              * */
/* ******************************************************************************** */
var remoteWin = false;

function openWin (datei,breite,hoehe,x,y,scrolling)
{
 if (!scrolling) {scrolling=0;}
 var fenstereigenschaften = "resizable=yes,toolbar=0,scrollbars="+scrolling+",status=0,directories=0,menubar=0,location=0,width="+breite+",height="+hoehe;

 var win_width  = window.screen.width;
 var win_height = window.screen.height;

 if (top.is.v >= 4)
 {
    //wenn zwei Monitore am Mac angeschlossen sind...
  var secondMon = 0;
  if (win_width >= 1600) {win_width = win_width/2; secondMon=win_width;}

  if (x<0) {x = secondMon+(win_width-breite)/2;} else {x=0;}
  if (y<0) {y = (win_height-hoehe)/2;} else {y=0;}

  fenstereigenschaften     += ",screenX="+x+", left="+x;
  fenstereigenschaften     += ",screenY="+y+", top="+y;
 }
 // ist Fenster bereits geoeffnet; wenn bei MSIE ja - schliesse.
 if(is.ie){
  if(remoteWin.closed == false){
   remoteWin.close();
   remoteWin = window.open(datei,"REMOTEWIN",fenstereigenschaften);
   if (top.is.v >= 4) {remoteWin.focus();}
  } else {
   remoteWin = window.open(datei,"REMOTEWIN",fenstereigenschaften);
   if (top.is.v >= 4) {remoteWin.focus();}
   }
 } else{
  remoteWin = window.open(datei,"REMOTEWIN",fenstereigenschaften);
  if (top.is.v >= 4) {remoteWin.focus();}
 }
}


/*
Accessible Scroller
andre.huf@medial.info - 2005-03-02
*/
/*
prevent flicker by clearing the timeouts instead of letting them run independently
*/
/* Helper Functions */
function hexToDec(uHex)
{
    switch(uHex)
    {
        case("a"): return 10;  break;
        case("b"): return 11;  break;
  case("c"): return 12;  break;
        case("d"): return 13;  break;
        case("e"): return 14;  break;
        case("f"): return 15;  break;
        default:   return parseInt(eval(uHex));  break;
    }
}

function hexToRGB(uHex)
// function hexToRGB(uHex, uColor)
{
    var rgb = new Array();
    /* throw everything away which is not in a hex value and convert the outcome to lowercase.*/
    uHex = uHex.replace(/[^0-9abcdefABCDEF]*/g, "").toLowerCase();
    if (uHex.length >= 6) uHex = uHex.substring(0,6);
    else                  uHex = uHex.substring(0,3).replace(/(.)(.)(.)/, "$1$1$2$2$3$3");

    rgb[0] = hexToDec(uHex.charAt(0)) * 16 + hexToDec(uHex.charAt(1));
    rgb[1] = hexToDec(uHex.charAt(2)) * 16 + hexToDec(uHex.charAt(3));
    rgb[2] = hexToDec(uHex.charAt(4)) * 16 + hexToDec(uHex.charAt(5));
    return rgb;
}

/* create a new class for the scroller */
function medialASObj()
{
 /* ### properties ### */
    /* create default values */
    this.pElementId = "";                     // name of the parent element
    this.pFlyIn     = "";                     // top, right, bottom, left
    this.pFlyInDur  = 0;                      // milliseconds
    this.pStay      = 2000;                   // milliseconds
    this.pFlyOut    = "";                     // top, right, bottom, left
    this.pFlyOutDur = 0;                      // milliseconds
    this.pFadeIn    = "false";                // true | false (string)
    this.pFadeOut   = "false";                // true | false (string)
    this.pColorBack = new Array(255,255,255); // the color to start the text fade with as an array
    this.pColorFore = new Array(0,0,0);       // the color of the text as an array
 this.pColorLink = new Array(0,0,0);       // the color of the links in the text as an array 
 this.pTimeoutStay = "";
 this.pTimeoutFadeIn = "";
 this.pTimeoutFadeOut = "";
 
 /* halve the time if fade out AND fade in have to be done */
    //if(this.pFadeIn == "true" && this.pFadeOut == "true") this.pStay /= 2;
 
    this.pChildren;
    this.pChildrenLength;
    this.pElementToDisplay = 0;
    this.pElementToHide    = 1;
 this.pElementToDisplayInnerHTML = "";
 
 this.colorFadeStepColors = new Array();
 this.colorFadeStepColorsA = new Array();

 /* ### methods ### */
    this.hide = function()
    {
        /* Step through the DOM and hide all Elements (nodeType = 1 means "Element") */
        for(locElementIndex = 0; locElementIndex < this.pChildrenLength; locElementIndex++)
        {
            if(this.pChildren[locElementIndex].nodeType == 1)
            {
                this.pChildren[locElementIndex].style.display = "none";
            }
        }
    }
 /*
 this.typewriter = function (uInnerHTML, uChar)
 {
  uInnerHTML = uInnerHTML;
  return uInnerHTML.charAt(uChar);
  uChar++;
  window.setTimeout("document." + this.pElementId + ".typewriter(" + uInnerHTML + ", " + uChar + ");", 10);
 }
 */
    /* show one element after another */
 this.show = function()
 {
  /* go back to the first element if you reached the last */
  if(this.pElementToDisplay >= this.pChildrenLength) 
  {
   this.hide();
   this.pElementToDisplay = 0;
  }

  if(this.pChildren[this.pElementToDisplay].nodeType == 1)
  {
    // alert(this.pChildren[this.pElementToHide].innerHTML); // the innerHTML of the Elements in the List
    // hide one element...
    this.pChildren[this.pElementToHide].style.display = "none";
    

    this.pElementToDisplayInnerHTML = this.pChildren[this.pElementToDisplay].innerHTML;
    
    // ...and show the next one
    this.pChildren[this.pElementToDisplay].style.display = "block";
    // display it typewriter style...

    // this.pChildren[this.pElementToDisplay].innerHTML = this.typewriter(this.pElementToDisplayInnerHTML);
    
    

    this.pElementToHide = this.pElementToDisplay;
    this.pElementToDisplay += 1;
    locNameOfObject = this.pElementId;
    // alert(locNameOfObject);
    window.clearTimeout(this.pTimeoutFadeIn);
    window.clearTimeout(this.pTimeoutFadeOut);
    this.pTimeoutStay = window.setTimeout("document." + locNameOfObject + ".show();", this.pStay);
    

    /* fade it in */
    //this.fadeIn(0);
    if(this.pFadeIn == "true")  this.fadeIn(0);
    /* and fade it out */
    if(this.pFadeOut == "true")
    {
     //alert(this.pSteps);
     this.fadeOut(this.pSteps);
    }
    //if(this.pFadeOut == "true") fadeOut(this.pElementId, this.pStay, this.pColorFore, this.pColorBack, 1);
  }

  else
  {
   this.pElementToDisplay += 1;
   this.show();
  }
 }
 
 this.fadeIn = function(uStep)
 {
  document.getElementById(this.pElementId).style.color = this.pFadeStepColor[uStep];
  locAllAnchors = document.getElementById(this.pElementId).getElementsByTagName("A");
  if (locAllAnchors.length > 0)
  {
   for (i = 0; i < locAllAnchors.length; i++)
   {
    locAllAnchors[i].style.color= this.pFadeStepColorA[uStep];
   }
  }
  //this.pChildren[this.pElementToDisplay].getElementsByTagName("A").style.color = "#f00";
  uStep += 1;
  this.pTimeoutFadeIn = window.setTimeout("document." + this.pElementId + ".fadeIn(" + uStep + ");", this.pStepDelay);
 }

 this.fadeOut = function(uStep)
 {
  document.getElementById(this.pElementId).style.color = this.pFadeStepColor[uStep];
  locAllAnchors = document.getElementById(this.pElementId).getElementsByTagName("A");
  if (locAllAnchors.length > 0)
  {
   for (i = 0; i < locAllAnchors.length; i++)
   {
    locAllAnchors[i].style.color= this.pFadeStepColorA[uStep];
   }
  }
  uStep -= 1;
  this.pTimeoutFadeOut= window.setTimeout("document." + this.pElementId + ".fadeOut(" + uStep + ");", this.pStepDelay);
 }
 
 this.fillStepColors = function()
 {
  this.pStepDelay        = 60;
  /* text colors */
  this.pFadeStepColor    = new Array()
  this.pFadeStepString   = new Array();
  this.pNewColor         = new Array();
  /* link colors */
  this.pFadeStepColorA    = new Array()
  this.pFadeStepStringA   = new Array();
  this.pNewColorA         = new Array(); 
  
  this.pDiff             = 0;
  this.pDiffA            = 0;
  
  // alert(this.pStay);
  
  this.pSteps = Math.round((this.pStay / 2) / this.pStepDelay); // fades in and stays in full color in each the half time of pStay
  
  /* from which color to which color does it fade? */
  /*
  alert(
   this.pColorBack[0] + " - " + this.pColorFore[0] + "\n" + 
   this.pColorBack[0] + " - " + this.pColorFore[0] + "\n" + 
   this.pColorBack[0] + " - " + this.pColorFore[0] + "\n"
  )*/
  
  this.pDiffStep = new Array();
  this.pDiffStep[0] = (this.pColorBack[0] >= this.pColorFore[0]) ? (this.pColorBack[0] - this.pColorFore[0]) / this.pSteps : (this.pColorFore[0] - this.pColorBack[0]) / this.pSteps;
  this.pDiffStep[1] = (this.pColorBack[1] >= this.pColorFore[1]) ? (this.pColorBack[1] - this.pColorFore[1]) / this.pSteps : (this.pColorFore[1] - this.pColorBack[1]) / this.pSteps;
  this.pDiffStep[2] = (this.pColorBack[2] >= this.pColorFore[2]) ? (this.pColorBack[2] - this.pColorFore[2]) / this.pSteps : (this.pColorFore[2] - this.pColorBack[2]) / this.pSteps;

  this.pDiffStepA = new Array();
  this.pDiffStepA[0] = (this.pColorBack[0] >= this.pColorLink[0]) ? (this.pColorBack[0] - this.pColorLink[0]) / this.pSteps : (this.pColorLink[0] - this.pColorBack[0]) / this.pSteps;
  this.pDiffStepA[1] = (this.pColorBack[1] >= this.pColorLink[1]) ? (this.pColorBack[1] - this.pColorLink[1]) / this.pSteps : (this.pColorLink[1] - this.pColorBack[1]) / this.pSteps;
  this.pDiffStepA[2] = (this.pColorBack[2] >= this.pColorLink[2]) ? (this.pColorBack[2] - this.pColorLink[2]) / this.pSteps : (this.pColorLink[2] - this.pColorBack[2]) / this.pSteps;

  for (i = 0; i <= this.pSteps; i++)
  {
         this.colorFadeStepColors[i] = new Array();
   this.colorFadeStepColorsA[i] = new Array();
   for(var k = 0; k < 3; k++)
   {
    this.colorFadeStepColors[i][k] = (this.pColorBack[k] > this.pColorFore[k]) ? Math.round(this.pColorBack[k] - this.pDiffStep[k] * i) : Math.round(this.pColorBack[k] + this.pDiffStep[k] * i);
    if (this.colorFadeStepColors[i][k] > 255) this.colorFadeStepColors[i][k] = 255;
    else if (this.colorFadeStepColors[i][k] < 0) this.colorFadeStepColors[i][k] = 0;
    
    this.colorFadeStepColorsA[i][k] = (this.pColorBack[k] > this.pColorLink[k]) ? Math.round(this.pColorBack[k] - this.pDiffStepA[k] * i) : Math.round(this.pColorBack[k] + this.pDiffStepA[k] * i);
    if (this.colorFadeStepColorsA[i][k] > 255) this.colorFadeStepColorsA[i][k] = 255;
    else if (this.colorFadeStepColorsA[i][k] < 0) this.colorFadeStepColorsA[i][k] = 0;
   }
   this.pFadeStepColor[i] = "rgb(" + this.colorFadeStepColors[i][0] + ", " + this.colorFadeStepColors[i][1] + ", " + this.colorFadeStepColors[i][2] + ")";
   this.pFadeStepColorA[i] = "rgb(" + this.colorFadeStepColorsA[i][0] + ", " + this.colorFadeStepColorsA[i][1] + ", " + this.colorFadeStepColorsA[i][2] + ")";
  }
  // alert(this.pSteps) // how many steps does the fade take?
  // alert(this.pFadeStepColor) // what are the colors of the fade?
 }
}

/* this is the function that gets called from the html page */
/*
the following parameters are possible, no matter which order they take, 
all parameters except "ElementId" are optional

Example of use:
medialAS("ElementId=scroller1", "FlyIn=500", "Stay=1000");

ElementId=scroller1    the id of the element that makes up the scroller
FlyIn=top              where does the item come from (top, right, bottom, left)
FlyInDur=2000          how many milliseconds does the items take to come in
Stay=3000              how many milliseconds does the item stay
FlyOut=right           in which direction does the item leave (top, right, bottom, left)
FlyOutDur=1000         how many milliseconds does the items take to leave
FadeIn                 does the item fade in (true | false)
FadeOut                does the item fade out (true | false)
ColorBack              the background color of the scroller, needed to simulate the fade effect
ColorFore              the foreground color of the scroller, needed to simulate the fade effect
ColorLink              the foreground color of the Links inside the text to be scrolled, needed to simulate the fade effect
*/
function medialAS()
{   
    /* First test if the DOM is supported at all */
    if(document.getElementById && document.childNodes && document.createElement )
    {
        /* extract the function arguments into an array */
        var locArguments = new Array();
        for(i = 0; i < medialAS.arguments.length; i++)
        {
            locArguments = medialAS.arguments[i].split("=");
            eval("var " + locArguments[0] + " = \"" + locArguments[1] + "\";");
        }
        /* do all these funky thinks only if the function has been told the element to play with */
        if(typeof(ElementId) != "undefined")
        {
                /* create new object for each scroller on page */
                //var locObject = eval("document." + ElementId + "  = new medialASObj();");
    var locObject = eval("document." + ElementId + "  = new medialASObj();");
                /* change some css properties for use with javascript */
                eval("document.getElementById(\"" + ElementId + "\").style.overflow = \"hidden\";");
                /* overwrite the default properties of the object */
                                                     locObject.pElementId = ElementId;
                if(typeof(FlyIn)     != "undefined") locObject.pFlyIn     = FlyIn;
                if(typeof(FlyInDur)  != "undefined") locObject.pFlyInDur  = parseInt(FlyInDur);
                if(typeof(Stay)      != "undefined") locObject.pStay      = parseInt(Stay);
                if(typeof(FlyOut)    != "undefined") locObject.pFlyOut    = FlyOut;
                if(typeof(FlyOutDur) != "undefined") locObject.pFlyOutDur = parseInt(FlyOutDur);
                if(typeof(FadeIn)    != "undefined") locObject.pFadeIn    = FadeIn;
                if(typeof(FadeOut)   != "undefined") locObject.pFadeOut   = FadeOut;
                if(typeof(ColorBack) != "undefined") locObject.pColorBack = hexToRGB(ColorBack);
                if(typeof(ColorFore) != "undefined") locObject.pColorFore = hexToRGB(ColorFore);
    if(typeof(ColorLink) != "undefined") locObject.pColorLink = hexToRGB(ColorLink);

                /* how many elements to display and hide? */    
                locObject.pChildren = document.getElementById(ElementId).childNodes;
                locObject.pChildrenLength = locObject.pChildren.length;
                /* first hide all HTML elements, then show one after another */
    locObject.fillStepColors();
                locObject.hide();
                locObject.show();
        }
    }
}

function VerticalScroller()
{
 this.ie=document.all
 this.dom=document.getElementById
 this.messages=new Array();
 
 this.scrollerdelay='3000';
 this.scrollerwidth='300';
 this.scrollerheight='100';
 this.scrollerbgcolor='lightyellow';
 this.scrollerspeed=1;
 this.i;
 this.instanceName;
 this.lMainLayer1Obj;
 this.lMainLayer2Obj;
 this.px="px";
 
 
 
 this.init = function(){

  if (this.messages.length>2)
   this.i=2
  else
   this.i=0
 }

 this.setName = function(val)
 {
  this.instanceName=val;
 }
 
 this.addMessage = function(message)
 {
  this.messages.push(message);
 }
 
 this.move1 = function(whichlayer){
  tlayer=eval(whichlayer)

  if (tlayer.top>0&&tlayer.top<=5){
   tlayer.top=0
   setTimeout(this.instanceName+".move1(tlayer)",this.scrollerdelay)
   setTimeout(this.instanceName+".move2(document.main.document.second)",this.scrollerdelay)
   return
  }

  if (tlayer.top>=tlayer.document.height*-1){
   tlayer.top-=5
   setTimeout(this.instanceName+".move1(tlayer)",50)
  }else{
   tlayer.top=parseInt(this.scrollerheight)+this.px;
   tlayer.document.write(this.messages[i]);
   tlayer.document.close();
   if (i==(this.messages.length-1))
    i=0;
   else
    i++;
  }
 }

 this.move2 = function(whichlayer){
  tlayer2=eval(whichlayer)

  if (tlayer2.top>0&&tlayer2.top<=5){
   tlayer2.top=0
   setTimeout(this.instanceName+".move2(tlayer2)",this.scrollerdelay)
   setTimeout(this.instanceName+".move1(document.main.document.first)",this.scrollerdelay)
   return
  }

  if (tlayer2.top>=tlayer2.document.height*-1){
   tlayer2.top-=5
   setTimeout(this.instanceName+".move2(tlayer2)",50)
  }else{
   tlayer2.top=parseInt(this.scrollerheight)+this.px;
   tlayer2.document.write(this.messages[i]);
   tlayer2.document.close();
   if (i==this.messages.length-1)
    i=0;
   else
    i++;
  }
 }


 
 this.move3 = function(whichdiv){
  var tdiv=document.getElementById(whichdiv);
  
  if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
   tdiv.style.top=0+"px";
   setTimeout(this.instanceName+".move3('"+tdiv.id+"')",this.scrollerdelay);
   setTimeout(this.instanceName+".move4('"+this.lMainLayer2Obj.id+"')",this.scrollerdelay);
   return;
  }
  if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
   tdiv.style.top=(parseInt(tdiv.style.top)-this.scrollerspeed)+"px";
   setTimeout(this.instanceName+".move3('"+tdiv.id+"')",50);
  }else{
   tdiv.style.top=parseInt(this.scrollerheight)+this.px;
   tdiv.innerHTML=this.messages[this.i];
   
   if (this.i==this.messages.length-1)
    this.i=0;
   else
    this.i++;
  }
 }

 this.move4 = function(whichdiv){
  var tdiv2=document.getElementById(whichdiv);

  if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
   tdiv2.style.top=0+"px";
   
   setTimeout(this.instanceName+".move4('"+tdiv2.id+"')",this.scrollerdelay);
   setTimeout(this.instanceName+".move3('"+this.lMainLayer1Obj.id+"')",this.scrollerdelay);
   return;
  }

  if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
   tdiv2.style.top=(parseInt(tdiv2.style.top)-this.scrollerspeed)+this.px;
   setTimeout(this.instanceName+".move4('"+tdiv2.id+"')",50);
  }else{
   tdiv2.style.top=parseInt(this.scrollerheight)+this.px;

   tdiv2.innerHTML=this.messages[this.i];
   if (this.i==this.messages.length-1)
    this.i=0;
   else
    this.i++;
  }
 }

 this.createBody = function(containerId)
 {
  var container = document.getElementById(containerId);
  var html;
  
  html = '<div id="medialScrMain" style="position:relative;">';
  html += '<div style="position:absolute;width:'+this.scrollerwidth+'px;height:'+this.scrollerheight+'px;clip:rect(0 '+this.scrollerwidth+'px '+this.scrollerheight+'px 0);left:0px;top:0px">';
  html += '<div id="medialScrMainL1" style="position:absolute;width:'+this.scrollerwidth+'px;left:0px;top:1px;">';
  html += this.messages[0];
  html += '</div>';
  html += '<div id="medialScrMainL2" style="position:absolute;width:'+this.scrollerwidth+'px;left:0px;top:0px;visibility:hidden">';
  html += this.messages[1];
  html += '</div>';
  html += '</div>';
  html += '</div>';
  
  container.innerHTML=html;
 }
 
 
 this.startscroll = function (layer1, layer2, mainContainer){
  

  if(this.instanceName.length>0 && this.messages.length>0)
  {
   if(this.messages.length==1)
    this.addMessage(this.messages[0]);

   if (this.ie||this.dom){
    this.createBody(mainContainer);
    this.lMainLayer1Obj=this.ie? eval(layer1) : document.getElementById(layer1);
    this.lMainLayer2Obj=this.ie? eval(layer2) : document.getElementById(layer2);
    this.move3(this.lMainLayer1Obj.id);
    this.lMainLayer2Obj.style.top=this.scrollerheight+this.px;
    this.lMainLayer2Obj.style.visibility='visible';
   }else if (document.layers){
    document.main.visibility='show';
    this.move1(document.main.document[layer1].id);
    document.main.document[layer2].top=(parseInt(this.scrollerheight)+5)+this.px;
    document.main.document[layer2].visibility='show';
   }
  }
 }
 
 return this;
}
function count_altDivs() {
	var allDIVS = document.getElementsByTagName('span');
	var el, i = 0, howmany = 0;
	while (el = allDIVS.item(i++)) if (el.id.substr(0,13) == 'adressTooltip') howmany++;
	return howmany;
}



var howmanyaltDivs;

function howmanyDiv() {
	var anzahl = count_altDivs();
	return anzahl;
}



function showElement(element) {
	hideAllElement();
	document.getElementById(element).style.visibility = "visible";
}

function hideElement(element) {
	document.getElementById(element).style.visibility = "hidden";
}

function hideAllElement() {
	var divarray;
	var newdivname;
	divarray = howmanyDiv();
	for(var i=0; i<divarray; i++)
	{
		newdivname = "adressTooltip" + i;
		document.getElementById(newdivname).style.visibility = "hidden";
	}
}