LEFTPOS = 750;   // Fixe Positition von links in Pixel
BOTTOMPOS = 0;   // Position von unten in Pixel
BARHEIGHT = 82;
MINTOPPOS = 50; // Mindesabstand von oben in Pixel
REFRESHINTERVAL = 100; // REFRESHINTERVAL in mms
//Settings für Extra Layer
TIMEDELAY = 100; //Time in mms after that the layer disappears
LAYERNAME = 'watermark'; //Layer an dessen Position der extra Layer ausgerichtet werden soll
DIFX = -152// horizontale verschiebung des extra Layers zum LAYERNAME Layer
DIFY = -105; // verticale verschiebung des extra Layers zum LAYERNAME Layer

switchOff =0; //Voreinstellung für den zusätzlichen Layer (muss immer 0 sein!)
//Layer positionieren
function setPos(layerToSet){
                with(layerToSet.style) {
                display="block";
                visibility="visible";
                position="absolute";
                left= LEFTPOS;
                top = getNewTop();
        }
}

// Intervall initialisieren, indem der Layer positioniert werden soll
function startPos (layerName){
         //setPos(layerToSet);
         layerToSet = document.getElementById(layerName);
         layerPosControl = window.setInterval("setPos(layerToSet)",REFRESHINTERVAL);
}

// Richtigen Position berechnen
function getNewTop(){
         if (document.all){
            height = document.body.offsetHeight;
         }
         if (!document.all){
            height = window.innerHeight;
         }
         newHeight = height - BOTTOMPOS - BARHEIGHT;
         newTopPos = newHeight + document.body.scrollTop;
         if (newTopPos < MINTOPPOS) newTopPos = MINTOPPOS;
         return newTopPos;
}

//============ START Zusätzlichen Layer darstellen
function mouseOn(layerName){
       if (switchOff!=0)clearSwitchOff();
       if (document.getElementById(layerName)) {
          //alert(getXPos());
          //alert(getYPos());
          layerToShow = document.getElementById(layerName);
          with (layerToShow.style){
          top = getYPos();
          left = getXPos();
          visibility="visible";
          }
       }
}

function mouseOff(layerName){
         newLayerName = layerName;
         switchOff = window.setTimeout("closeservizio(newLayerName)",TIMEDELAY);
}

function clearSwitchOff(){
         window.clearTimeout(switchOff);
}

function closeservizio(layerName){
       if (document.getElementById(layerName)) {
               document.getElementById(layerName).style.visibility="hidden";
       }
}

function getXPos(){
         //refLayer = document.getElementById(LAYERNAME);
         //leftPos = refLayer.style.left + DIFX;
         leftPos = LEFTPOS + DIFX;
         return leftPos;
}

function getYPos(){
         //refLayer = document.getElementById(LAYERNAME);
         //topPos = refLayer.style.top + DIFY;
         topPos = getNewTop()+ DIFY;
         return topPos;
}

//============ ENDE Zusätzlichen Layer darstellen


/* Einbau:
Die Funktion startPos() muss im onload aufgerufen werden. Dabei wird der Name/Id des Layers übergeben
    <body onload="startPos('watermark');">

Ein Layer mit Id muss auf der Seite sein, der positioniert werden soll
    <div id="watermark" style="position: absolute; color:#FF0000">
*/