
    
    /***********************************************
    
    * DHTML Billboard script- © Dynamic Drive (www.dynamicdrive.com)
    
    * This notice must stay intact for use
    
    * Visit http://www.dynamicdrive.com/ for full source code
    
    ***********************************************/
    
    
    
    //List of transitional effects to be randomly applied to billboard:
    
    
    
    
    
    //var billboardeffects=["Iris"] //Uncomment this line and input one of the effects above (ie: "Iris") for single effect 
    
    //moznosti: "ZigZag", "GradientWipe(GradientSize=1.0 Duration=0.7)", "Inset", "Iris", "Pixelate(MaxSquare=5 enabled=false)", "RadialWipe", "RandomBars", "Slide(slideStyle='push')", "Spiral", "Stretch", "Strips", "Wheel",.
    
    
    var timer;
    var tickspeed=4000; //ticker speed in miliseconds (2000=2 seconds)
    
    var effectduration=800; //Transitional effect duration in miliseconds
    var billboardeffects=["Pixelate(MaxSquare=5 enabled=false)"];
    var filterid=Math.floor(Math.random()*billboardeffects.length);
    
    var hidecontent_from_legacy=1; //Should content be hidden in legacy browsers- IE4/NS4 (0=no, 1=yes).
    
    
    var selectedDiv=0;
    var totalDivs=0;
    
    
    //zapis stylu
    document.write('<style type="text/css">\n');
    if (document.getElementById){
      document.write('.billcontent{display:none;\n'+'filter:progid:DXImageTransform.Microsoft.'+billboardeffects[filterid]+'}\n');
    }
    else if(hidecontent_from_legacy){
      document.write('#contentwrapper{display:none;}')
    }
    document.write('</style>\n')
        
    //zmiznuti vsech novinek
    function contractboard(){
      var inc=0;
      while(document.getElementById("billboard"+inc)){
        document.getElementById("billboard"+inc).style.display="none";
        inc++;
      }
    }
    
    //stopne prochazeni pri mysi nad contentwrapperem
    function zastavProchazeni(id){
      clearTimeout(timer);
      document.getElementById(id).onmouseout=function(){timer=setTimeout("expandboard()",tickspeed);}
    }
    
    //zobrazi novinku
    function expandboard(){
      var selectedDivObj=document.getElementById("billboard"+selectedDiv);
      contractboard();
      //pokud existuje filter -> efekt prechodu
      if(selectedDivObj.filters){
        if(billboardeffects.length>1){
          filterid=Math.floor(Math.random()*billboardeffects.length);
          selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[filterid];
        }
        selectedDivObj.filters[0].duration=effectduration/1000;
        selectedDivObj.filters[0].Apply();
      } 
      //zviditelni novinku
      selectedDivObj.style.display="block";
      //prehraje efekt, pokud existuje
      if(selectedDivObj.filters){
        selectedDivObj.filters[0].Play();
      }
      
      //zmena stylu ovladaciho tlacitka
      zvyrazniOvladac("ovladac"+selectedDiv);
      //inkrementace
      if(selectedDiv<totalDivs-1){selectedDiv++;}
      else{selectedDiv=0;}
      //nastaveni casovace
      timer=setTimeout("expandboard()",tickspeed)
    }
    
    function zvyrazniOvladac(aktualni){
      //zmena stylu ovladacu
      document.getElementById("ovladaceWrapperu").style.fontSize="0.9em";
      document.getElementById("ovladaceWrapperu").style.cursor="pointer";
      document.getElementById("ovladaceWrapperu").style.color="#777777";
      var els=document.getElementById("ovladaceWrapperu").getElementsByTagName("span");
      for(i=0;i<els.length;i++){
        els[i].style.fontWeight="normal";
        els[i].style.color="#777777";
      }
      //změna aktualniho ovladace
      var ovladac=document.getElementById(aktualni);
      ovladac.style.fontWeight="bold";
      ovladac.style.color="#000000";
      
    }
    
    //vypne vsechny ostatni novinky a zapne aktualni podle ovladace
    function zviditelni(id,ovladac){
      var el=document.getElementById(id);
      zvyrazniOvladac(ovladac.id);
      contractboard();
      el.style.display="block";
      
      selectedDiv=parseInt(ovladac.id.replace(/ovladac/,""));
      //inkrementace
      if(selectedDiv<totalDivs-1){selectedDiv++;}
      else{selectedDiv=0;}
    }
    
    //urceni poctu novinek (id='billboard[cislo]'), spusti se na window.onload, prida cas efektu k casu smycky, pokud efekt existuje (IE) 
    function startbill(){
      while(document.getElementById("billboard"+totalDivs)!=null){
        var id="billboard"+totalDivs;
        document.getElementById(id).onmouseover=function(){zastavProchazeni(this.id);};
        totalDivs++;
      }
      if(document.getElementById("billboard0").filters){
        tickspeed+=effectduration;
      }
      expandboard();
    }
    
    if (window.addEventListener){
      window.addEventListener("load", startbill, false);
    }
    else if(window.attachEvent){
      window.attachEvent("onload", startbill);
    }
    else if(document.getElementById){
      window.onload=startbill;
    }

