/* = = = = = = = = = = = = = = = = = = = = = = = START HOS-Default-Funktionen = = = = = = = = = = = = = = = = = = = = = = = */
/* START FF Consolen-Ausgabe */
function hosinfo(ausgabe)
{
   if(navigator.appName.indexOf("Netscape") != -1)
   {
     try{console.info(ausgabe)} catch(e){}; 
   }
}
/* ENDE  FF Consolen-Ausgabe */
/* = = = = = = = = = = = = = = = = = = = = = = = ENDE  HOS-Default-Funktionen = = = = = = = = = = = = = = = = = = = = = = = */
/* START MP JS Drucken */ 
function mpprintwin(url, pwi, phe) {
  if(typeof url == 'undefined') {
    var url = document.location.href;
    url = url.replace(/#.*/,'');
    url = url + (url.indexOf('?')>-1 ? "&" : ",0?") + '_FRAME=33&_FORMAT=PRINT';
  }     
  if(!pwi) pwi=640;
  if(!phe) phe=480;

  var pw = window.open(url,'PRINTWIN','width='+pwi+',height='+phe+',scrollbars=1');
}
/* ENDE  MP JS Drucken */

// START Benutzerregistrierung Zusatzinfo-Box 
function regzusatzinfoboxen(id,was)
{
// hosinfo(id+'/'+was); 
  if(document.getElementById(id))
  {
//  hosinfo(id+'./.'+was); 
    document.getElementById(id).style.display=was;
//  hosinfo(document.getElementById(id).style.display); 
  }
}
// ENDE  Benutzerregistrierung Zusatzinfo-Box 
var _CMBILD=0;
// START Werbung Positionierung
      var adlWallPaperTop=0;
      var adlWallPaperLeft=815;
// ENDE  Werbung Positionierung

// START Dummy-Funktion     
function ps_nichts()
{
}
// ENDE Dummy-Funktion   

// START Seite als Startseite für den Browser setzen
function startseite()
{
  var domaene="http://admin.mainpost.de";
  if(document.body.setHomePage != undefined)
  {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage(domaene);
  }
  else
  {
    alert("Bitte stellen Sie ihre Startseite manuell ein.");
  }
}
// ENDE  Seite als Startseite für den Browser setzen


// START Login - Div Verhalten
function getPosition(element)
{ // x,y-Position bestimmen 
  var elem=element,tagname="",x=0,y=0;
  while ((typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined"))
  {
    y+=elem.offsetTop;     
    x+=elem.offsetLeft;    
    tagname=elem.tagName.toUpperCase(); 
    if (tagname=="BODY")
      elem=0;
    if (typeof(elem)=="object")
      if (typeof(elem.offsetParent)=="object")
        elem=elem.offsetParent;
  }
  position=new Object();
  position.x=x;
  position.y=y;
  return position;
}

function checkLogin(wo)
{ //Anmeldebereich dynamisch anzeigen
  curpos=getPosition(wo);
  //alert(curpos.x+" "+curpos.y);
  
  
  
  var dsl=document.getElementById('formlogin');
  if((dsl.style.display!='none')&&(dsl.style.display!='block'))
  {
    dsl.style.display='none';
  }
  //alert(dsl.style.display);
  if(dsl.style.display!='none')
  {
    dsl.style.display='none';
  }
  else
  {  
    ua = navigator.userAgent;
    var top=0;
    var left=0;
    var display='block';
    if ( ua.indexOf("MSIE") != -1)
    {
      top = curpos.y+20;
      left = curpos.x-213;
    }
    else
    {
      top = curpos.y+20;
      left = curpos.x-213;
    }
    top += "px";
    left += "px";
    dsl.style.display=display;
    dsl.style.top = top;
    dsl.style.left = left;
  }
  //top.window.setTimeout("hideLogin()",5000);
}


function hideLogin()
{ // Login-Div wieder verstecken
  if(uname.length > 0)
  {
     document.getElementById('formlogin').style.display='none';
  }
}
function closeLogin()
{
  document.getElementById('formlogin').style.display='none';
}
// ENDE  Login - Div Verhalten


// START Artikel mit Leiste-Box bilder-Div nach Bedarf ausblenden
function ps_bilddiv_prüfer(loc,hide)
{
//  alert('loc='+loc+'; hide='+hide+'; inhalt loc='+document.getElementById(loc).innerHTML);
  
  if((document.getElementById(loc))&&(document.getElementById(hide)))
  {
    //alert('divs exist.');
    if(document.getElementById(loc).innerHTML=="")
    {
      //alert('hide');
      document.getElementById(hide).style.display="none";
    }
  }
}
// START Artikel mit Leiste-Box bilder-Div nach Bedarf ausblenden


// START Artikel mit Leiste-Box Trenner " - " bei Stichzeile
function ps_location_trenner(loc)
{
  //alert('huhu');
    if(document.getElementById(loc).innerHTML!="") 
    {
      document.write(' - ');
    }
}
// ENDE  Artikel mit Leiste-Box Trenner " - " bei Stichzeile



/* START Top-Navi Ebene3 topnavi_e2.tpl */ 
var browserName = navigator.appName;
//document.write(browserName);
var obj_old="qwer";

function findPos(el)
{
    var xPos    = 0;
    var yPos    = 0;
    if (document.layers)
    {
        // simply done with nc4x
        //
        xPos = el.x;
        yPos = el.y;
    }
    else
    {
        // loop through all offsets
        //
        while(el)
        {
            xPos += el.offsetLeft;
            yPos += el.offsetTop;
            el  = el.offsetParent;
        }
    }
    return {xPos: xPos, yPos: yPos};
}

function ps_subnav(id)
{
  if (id != 17566) {
      var ps_bildname="pul_"+id;
      var ps_divname="div_"+id;
      var x=y=0;
      var ps_el = document.getElementById(ps_bildname);
      x = findPos(ps_el).xPos;
      y = findPos(ps_el).yPos;

      //alert('ps_el = '+ps_el+'; x = '+x+'; y = '+y);
      if(obj_old!="qwer")
      {
        obj_old.style.display='none';
        obj_old="qwer";
      }

      if(document.getElementById(ps_divname))
      {
        if(browserName='Netscape')
        {
          x-=4;
          y+=6;
        }
        if(browserName='Microsoft Internet Explorer')
        {
          x-=3;
          y+=1;
        }
        if(browserName='Opera')
        {
          x-=0;
          y+=0;
        }
        
        var ps_div_el = document.getElementById(ps_divname);
        ps_div_el.style.left=x+'px';
        ps_div_el.style.top=y+'px';
        ps_div_el.style.display='inline';
        obj_old=ps_div_el;
        if(typeof ps_timer != "undefined")
        {
          window.clearTimeout(ps_timer);
          ps_timer="";
        }
      }
  }
}

function setactiv (id,classname) {
    if (obj = document.getElementById(id)) {
        obj.className = classname;
        ps_activ = 0;
    }
}
 

function hidediv()
{
  if(obj_old!="qwer")
  {
    if(typeof ps_timer != "undefined")
    {
      //alert('hihi ps_timer = '+ps_timer);
      obj_old.style.display='none';
      obj_old="qwer";
      window.clearTimeout(ps_timer);
      ps_timer="";
    }
  }
}

function reset_timer()
{
  if(obj_old!="qwer")
  {
    if(typeof ps_timer != "undefined")
    {
      window.clearTimeout(ps_timer);
    }
  }
}

function start_timer()
{
  if(obj_old!="qwer")
  {
    ps_timer = window.setTimeout("hidediv()",500);
  }
}
/* ENDE Top-Navi Ebene3 topnavi_e2.tpl */



/* START Top-Navi Ebene3 topnavi_e3.tpl */ 


function chws(name)
{
  if(document.getElementById(name))
  {
    document.getElementById(name).style.backgroundColor= '#FFFFFF';
  }
}
function chorig(name)
{
  if(document.getElementById(name))
  {
    document.getElementById(name).style.backgroundColor= '#f2f7fd';
  }
}
/* ENDE Top-Navi Ebene3 topnavi_e3.tpl */





// START Versteckt die Dart-Divs, wenn keine Werbung ausgeliefert wird
function dart_verstecker(id_name,h)
{
  if(document.getElementById(id_name))
  { // enn der übergebene ID-Name existiert 
    if(document.getElementById(id_name).offsetHeight<h)
    { // wenn die Höhe des DIVs kleiner als übergebener int(=h)
      document.getElementById(id_name).style.display = "none";
    }
  }
}
// ENDE  Versteckt die Dart-Divs, wenn keine Werbung ausgeliefert wird



// START Multimedia-Boxen für Artikelboxen mit Statusleiste
function ps_mmbox()
{
  if(typeof multimediabox =="undefined")
  {
    multimediabox=555;
  }
  else
  {
    multimediabox+=1;
  }
  return multimediabox;
}

function mediaswitch(div_id_on,div_id_off)
{
  var ps_span_id_on  = 'multilink_'+div_id_on;
  var ps_span_id_off = 'multilink_'+div_id_off;
  if(document.getElementById(div_id_off))
  {
    document.getElementById(div_id_off).style.display='none';
    document.getElementById(div_id_off).style.height='0px';
//    position
  }
  if(document.getElementById(div_id_on))
  {
    document.getElementById(div_id_on).style.display='inline';
    document.getElementById(div_id_off).style.height='auto';
  }
  if(document.getElementById(ps_span_id_off))
  {
    document.getElementById(ps_span_id_off).style.fontWeight='normal';
  }
  if(document.getElementById(ps_span_id_on))
  {
    document.getElementById(ps_span_id_on).style.fontWeight='bold';
  }
}


function mediaswitch2(div_id_on,div_id_off,reiter)
{

reiterList = new Array("bilderserien","videos");

for (var i = 0; i < reiterList.length; ++i) {
  if (reiterList[i] == reiter) {
    document.getElementById(reiterList[i] + "_reiter").className="reiter wetter_activ wetter_reiter";
    document.getElementById(reiterList[i] + "_bild").src="/mp_pics/reiter_pfeil_aktiv.gif";
  }
  else {
        document.getElementById(reiterList[i] + "_reiter").className="reiter  wetter_reiter";
        document.getElementById(reiterList[i] + "_bild").src="/mp_pics/reiter_pfeil.gif";
    }
  }


  var ps_span_id_on  = 'multilink_'+div_id_on;
  var ps_span_id_off = 'multilink_'+div_id_off;



  
  if(document.getElementById(div_id_off))
  {
    document.getElementById(div_id_off).style.visibility = "hidden";
    document.getElementById(div_id_off).style.height='0px';
    document.getElementById(div_id_off).style.display='none';
    
  }
  if(document.getElementById(div_id_on))
  {
    document.getElementById(div_id_on).style.visibility = "visible";
    document.getElementById(div_id_on).style.height='auto';
    document.getElementById(div_id_on).style.display='block';
}
  if(document.getElementById(ps_span_id_off))
  {
    document.getElementById(ps_span_id_off).style.fontWeight='normal';
  }
  if(document.getElementById(ps_span_id_on))
  {
    document.getElementById(ps_span_id_on).style.fontWeight='bold';
  }
}



// ENDE  Multimedia-Boxen für Artikelboxen mit Statusleiste


// START Wetterboxen

              function reiterbox_anzeige2(a,b,c)
              {
                //alert('a='+a+'; b='+b+'; c='+c);
                function swap(bildname,tauschbild)
                {
                  document.images[bildname].src=tauschbild;
                }


                for (i=1; i<=b; i++)
                {
                  if(document.getElementById(a+'_'+i+'_box'))
                  {
                    document.getElementById(a+'_'+i+'_reiter').className="reiter  wetter_reiter";
                    document.getElementById(a+'_'+i+'_box').style.display="none";
                    swap(a+'_'+i+'_bild','/mp_pics/reiter_pfeil.gif');    
                  }
                }

                if(document.getElementById(a+'_'+c+'_box'))
                {
                  document.getElementById(a+'_'+c+'_reiter').className="reiter wetter_activ wetter_reiter";
                  document.getElementById(a+'_'+c+'_box').style.display="inline";
                  swap(a+'_'+c+'_bild','/mp_pics/reiter_pfeil_aktiv.gif');    
                }
              }

// ENDE Wetterboxen


// START Rechte Navigation Reiterboxen
              function reiterbox_anzeige(a,b,c)
              {
                //alert('a='+a+'; b='+b+'; c='+c);
                function swap(bildname,tauschbild)
                {
                  document.images[bildname].src=tauschbild;
                }
                if(document.getElementById(a+'_box'))
                {
                  document.getElementById(a+'_reiter').className="reiter";
                  document.getElementById(a+'_box').style.display="none";
                  swap(a+'_bild','/mp_pics/reiter_pfeil.gif');    
                }
                if(document.getElementById(b+'_box'))
                {
                  document.getElementById(b+'_reiter').className="reiter";
                  document.getElementById(b+'_box').style.display="none";
                  swap(b+'_bild','/mp_pics/reiter_pfeil.gif');    
                }
                if(document.getElementById(c+'_box'))
                {
                  document.getElementById(c+'_reiter').className="reiter activ";
                  document.getElementById(c+'_box').style.display="inline";
                  swap(c+'_bild','/mp_pics/reiter_pfeil_aktiv.gif');    
                }
              }
// ENDE  Rechte Navigation Reiterboxen


// START Get-Parameter in ein Array schreiben
function get_to_array() 
{
    var url   = window.location.search;
    if (url != "")  
    {
      if ( url.substring(0,2) == '??' ) {
        url = url.substring(1,url.length);
      }
      ps_get = new Object();
      url = url.substring(1,url.length);
      liste = url.split("&");
      for (i=0;i<=liste.length-1;i++) 
      {
        temp = liste[i].split("=");
        temp[1]=temp[1].replace(/\+/g," ");
        temp[1]=unescape(temp[1]);
        ps_get[temp[0]] = temp[1];
      } 
     return ps_get;
   } 
   else 
   {
     return '';
   }
}
// ENDE Get-Parameter in ein Array schreiben


function multimedia(a)
{
  //alert("-"+a+"-");
  if(a==undefined)
  {
    window.open('/medien/home/index.html', 'popup', 'height=760,width=1000,location=no,scrollbars=yes,resizable=yes');
  }
  else
  {
    window.open(a, 'popup', 'height=760,width=1000,location=no,scrollbars=yes,resizable=yes');
  }
}

// START MediaCenter-Fenster Größe richtigstellen
function resizeOuterTo(w,h)
{
  var browserName = navigator.appName;
  if(browserName='Netscape')
  {
    w+=0;
    h+=0;
  }
  if(browserName='Microsoft Internet Explorer')
  {
    w+=0;
    h+=55;
  }
  if(browserName='Opera')
  {
    w+=0;
    h+=0;
  }
  if (parseInt(navigator.appVersion)>3)
  {
    if (navigator.appName=="Netscape") {
      top.outerWidth=w;
      top.outerHeight=h;
    }
    else top.resizeTo(w,h);
  }
}
// ENDE  MediaCenter-Fenster Größe richtigstellen

// BEGIN Artikel bewerten
function sterne_einfaerben()
{
  var punkte = document.getElementById("punkte").innerHTML;
  punkte = Math.round(punkte.replace(/,/g, "."));
  for (i=5;i>=1;i--)
  {
    if (i <= punkte) 
    {
        document.images['star_'+i].src="/mp_pics/ar_bewertung_on.gif";
    } else
    {
        document.images['star_'+i].src="/mp_pics/ar_bewertung_off.gif";
    }
  } 
}

function stern_leuchten(wert)
{
  for (i=wert;i>=1;i--)
  {
    document.images['star_'+i].src="/mp_pics/ar_bewertung_over.gif";
  } 
}

function stern_vergeben(wert) 
{
     document.getElementById('ps_hidden_punkte').value = wert;
     document.uvform.submit();
}
// ENDE Artikel bewerten

// BEGIN Artikel-detail Bookmak-Popup 
function ps_ardetail_bookmark(id)
{
  var ps_bildname="pul_"+id;
  var ps_divname="div_"+id;
  var x=y=0;
  var ps_el = document.getElementById(ps_bildname);
  x = findPos(ps_el).xPos;
  y = findPos(ps_el).yPos;
  //alert('ps_el = '+ps_el+'; x = '+x+'; y = '+y);
  if(obj_old!="qwer")
  {
    obj_old.style.display='none';
    obj_old="qwer";
  }

  if(document.getElementById(ps_divname))
  {
    if(browserName='Netscape')
    {
      x-=24;
      y+=6;
    }
    if(browserName='Microsoft Internet Explorer')
    {
      x-=23;
      y+=1;
    }
    if(browserName='Opera')
    {
      x-=22;
      y+=0;
    }
    var ps_div_el = document.getElementById(ps_divname);
    ps_div_el.style.left=x+'px';
    ps_div_el.style.top=y+'px';
    ps_div_el.style.display='inline';
    //obj_old=ps_div_el;
    if(typeof ps_timer != "undefined")
    {
      window.clearTimeout(ps_timer);
      ps_timer="";
    }
  }
}
// ENDE Artikel-detail Bookmak-Popup 

// BEGIN Psychotest
function psycho(MyID) {
          if (  MyID=='' ) {  alert('Keine Ziel-URL angegeben!');   return; }
          msgWindow = open("/specials/psychotest/frage.php?new=1&thema_id="+MyID,"Psycho","dependent=1,scrollbars=1,resizable=1,width=450,height=400");
}
// ENDE Psychotest

// BEGIN Select-Link /fotos   
function goto_url(url)
{
  if (url!="0")
  {
    document.location.href=url;
  }
}
// ENDE  Select-Link /fotos


/* START Default-Layout Artikel-Detail Bildansicht */
/* Vorab variable im Layout-TPL anlegen */
andere_tumbs = new Array();

function ardetail_bildentscheider()
{
  if(!document.getElementById('ardetail_bild_trenner'))
  {
    document.getElementById('ardetail_bild_container').style.display='none';
  }
  else
  {
    if(!document.getElementById('ardetail_vorschaubild_begrenzer'))
    {

      if(andere_tumbs.length<1)
      {
        document.getElementById('ardetail_bild_trenner').style.display='none';
      }
      else
      {
        var tempstr='<div class="begrenzer" id="ardetail_vorschaubild_begrenzer"><div class="begrenzer2">';
        for(r=0;r<andere_tumbs.length;r++)
        {
          tempstr+=andere_tumbs[r];
        }
        tempstr+='</div></div><div id="pi_countger"></div>';
        document.getElementById('ka_andere_tumbs').innerHTML=tempstr;
      }
    }
    else
    {
      if(andere_tumbs.length>0)
      {
        var temp_begrenzer2=document.getElementById('ardetail_vorschaubild_begrenzer2').innerHTML;
        var tempstr='';
        for(r=0;r<andere_tumbs.length;r++)
        {
          tempstr+=andere_tumbs[r];
        }
        tempstr+=temp_begrenzer2;
        document.getElementById('ardetail_vorschaubild_begrenzer2').innerHTML=tempstr;
      }
    }
  }
  if(document.getElementById('ardetail_vorschaubild_begrenzer'))
  {
    vorschau=document.getElementById('ardetail_vorschaubild_begrenzer').getElementsByTagName('img');
    var l=vorschau.length;
    l+=1;
    if(l>4)
    {
      var link=document.getElementById('ardetail_bild_container').getElementsByTagName('span')[0].innerHTML;
      document.getElementById('pi_countger').innerHTML='<a href="'+link+'">alle Bilder ('+l+' Bilder) »</a>';
    }
  }
}
/* ENDE  Default-Layout Artikel-Detail Bildansicht */



/* START WerbeSlider */
var ShowTime = 0;       // Anzeigedauer des Einzelelements in Millisekunden
var ShowTimeBackUp;     // Sicherung der Anzeigedauer als Backup zur Vermeidung des doppelten Timers
var SlideTime = 10;     // Verzögerung des Slidens in Millisekunden
var SlideStepping = 1;  // Pixelschritte des Slidens in Pixeln

var OldLeft = 0;
var NewLeft = 0;
var MaxLeft = 0;
var AdList = new Array();
var MaxAmount = 0;
var SliderItemWidth = 0;
var AdSliderInitialized = 0;

function AdSliderInit(DOMID, ITEMCSSCLASS, COLLAPSEID) {
  //hosinfo('function AdSliderInit');
  ShowTimeBackUp = ShowTime;
  if ( DOMID != null && DOMID != false && DOMID != '' ) {
    //hosinfo('ID ist vorhanden');
    var AdSliderCon = document.getElementById(DOMID);
    if ( AdSliderCon != null && AdSliderCon != false ) {
      //hosinfo('Con ist vorhanden');
      AdSliderCon.style.position = 'relative';
      AdSliderCon.style.left = '0px';
      var AdSliderItems = AdSliderCon.getElementsByTagName('div');
      if ( AdSliderItems != null && AdSliderItems != false ) {
        //hosinfo('Items vorhanden');
        var ElCount = -1;
        
        // Breite des Container aus dem Style bestimmen und als Grundlage für den Scroller verwenden
        SliderItemWidth = parseInt(AdSliderItems[0].offsetWidth);
        hosinfo('Width: '+SliderItemWidth);
        NewLeft = SliderItemWidth;
        
        for ( i=0; i < AdSliderItems.length; i++ ) {
          if ( AdSliderItems[i].className == ITEMCSSCLASS && AdSliderItems[i].offsetHeight > 50 && AdSliderItems[i].offsetWidth > 0 ) {
            // hosinfo('i: '+i);
            ElCount++;
            AdList[ElCount] = AdSliderItems[i];
          }
          else {
            AdSliderItems[i].style.display = 'none';
          }
        }
        
        MaxAmount = AdList.length;
        
        if ( AdList.length > 1 ) {
//        hosinfo('Erstes Element hinzufügen');
          var FirstElem = AdSliderItems[0].cloneNode(true);
          var newNo = AdList.length;
          FirstElem.id = ITEMCSSCLASS+newNo;
          AdSliderCon.appendChild(FirstElem);
          ElCount++;
          AdList[ElCount] = document.getElementById(FirstElem.id);
//          hosinfo('Zweites Element hinzufügen');
          var SecondElem = AdSliderItems[1].cloneNode(true);
          var newNo = AdList.length; 
          SecondElem.id = ITEMCSSCLASS+newNo;
          AdSliderCon.appendChild(SecondElem);
          ElCount++;
          AdList[ElCount] = document.getElementById(SecondElem.id);
        }
        
        //hosinfo(AdList);
        var AdSliderItems = AdSliderCon.getElementsByTagName('div');
        if ( AdSliderItems != null && AdSliderItems != false ) {
          
        }
        
//        hosinfo(AdList);
//        hosinfo('AdSliderInit(): Anzahl '+AdList.length);
        if ( AdList.length > 1 ) {
          if ( AdList != null && AdList != false ) {
            ScrollElements(DOMID);
          }
        }
        if ( AdList.length < 1 && COLLAPSEID != '' ) {
          var CollapseAll = document.getElementById(COLLAPSEID);
          if ( AdSliderItems != null && AdSliderItems != false ) {
            CollapseAll.style.display = 'none';
          }
        }
      }
    }
  }
}

function ScrollElements(DOMID) {
  //hosinfo('function ScrollElements('+DOMID+')');
  if ( AdList != null && AdList != false ) {
    var MaxVal = AdList.length;
    if ( ElShown1 == MaxVal-1 && ElShown2 >= MaxVal ) {
      ElShown1 = 0;
      ElShown2 = 1;
    }
    
    if ( ElShown1 >= MaxVal ) {
      ElShown1 = 0;
    }
    if ( ElShown1 < 0 ) {
      ElShown1 = 0;
    }
    if ( ElShown2 < 0 ) {
      ElShown2 = 0;
    }
    if ( ElShown2 >= MaxVal ) {
      ElShown2 = 0;
    }
    
    //hosinfo('ScrollElements() läuft');
    NewLeft = ElShown1 * SliderItemWidth;
    var Amount = MaxAmount;
//    hosinfo('ScrollElements(): Anzahl '+Amount);  
    if ( Amount != 0 ) {
      MaxLeft = Amount * SliderItemWidth;
//      hosinfo('ScrollElements(): MaxLeft-Berechnung '+MaxLeft+ ' / Amount: '+Amount);
    }
    if ( NewLeft > MaxLeft ) {
      if ( ElShown1 == 0 ) {
        NewLeft = SliderItemWidth;
        window.setTimeout("ScrollElements('"+DOMID+"')", ShowTime);
      }
      hosinfo('Wann springst Du hier rein?');
    }
    var Slider = document.getElementById(DOMID);
    OldLeft = parseInt(Slider.style.left);
    OldLeft = Math.abs(OldLeft);
    
    var Current = parseInt(Slider.style.left);
    if ( AdSliderInitialized == 1 ) {
        // Check ob es das letzte Element ist
        if ( (MaxVal-1) == ElShown1 || ElShown1 == 0 ) {
            ShowTime = 0;
        }
        else {
            ShowTime = ShowTimeBackUp;
        }
    }
    
    SlideIt(DOMID, NewLeft);
    ElShown1++;
    ElShown2++;
    
    AdSliderInitialized = 1;
    window.setTimeout("ScrollElements('"+DOMID+"')", ShowTime);
  }
}

function SlideIt(DOMID, StopValue) {
  var Slider = document.getElementById(DOMID);
  var Current = parseInt(Slider.style.left);
  Current = Math.abs(Current);
  //hosinfo('SlideIt('+DOMID+', '+StopValue+')');
  //hosinfo('Startwert: '+Current + ' / Stopwert: '+StopValue);
  
  if ( Current != NewLeft && Current < NewLeft ) {
    Current = Current + SlideStepping;
    if ( Current >= NewLeft ) {
        Current = NewLeft;
    }
  }
  if ( Current >= NewLeft ) {
    if ( Current >= MaxLeft ) {
      Current = 0;
      NewLeft = SliderItemWidth;
    }
    Slider.style.left = '-' + Current + 'px';
//    hosinfo('SlideIt('+StopValue+') / Current: '+Current+' / NewLeft: '+NewLeft+' / Maxleft: '+MaxLeft);
    if ( typeof Timer != 'undefined' ) {
      clearTimeout(Timer);
    }
  }
  else {
    Slider.style.left = '-' + Current + 'px';
    Timer = setTimeout("SlideIt('"+DOMID+"', "+StopValue+")", SlideTime);
  }
}

var ElShown1 = 0;
var ElShown2 = 1;
/* ENDE WerbeSlider */




function AddLinkToImg(DOMID, URL, WINNAME) {
  if ( DOMID != '' && URL != '' ) {
    var IMGCon = document.getElementById(DOMID);
    if ( IMGCon != false && IMGCon != null ) {
      var IMG2Link = IMGCon.getElementsByTagName('img');
      if ( IMG2Link != false && IMG2Link != null ) {
        if ( IMG2Link.length > 0 ) {
          if ( IMG2Link[0] != false && IMG2Link[0] != null ) {
            IMG2Link[0].style.cursor = 'pointer';
            IMG2Link[0].onclick = function() { window.open(URL,WINNAME,'width=500,height=503,resizable=1');return(false); }
            //window.open('URL','WINNAME','width={w},height={h},resizable=1');return(false)
          }
        }
      }
    }
  }
}


function AddLinkToTag(DOMID, URL) {
  if ( DOMID != '' && URL != '' ) {
    var TAGCon = document.getElementById(DOMID);
    if ( TAGCon != false && TAGCon != null ) {
      TAGCon.style.cursor = 'pointer';
      TAGCon.onclick = function() { document.location.href = URL; }
    }
  }
}