// JavaScript Document


function zobraz_divku_right(id_divky, id_fotky, height) {
  document.getElementById("divka_img_right").src = "images/divky/divka_"+id_divky+"_"+id_fotky+"_b.jpg";
  document.getElementById("divka_odkaz_right").href = "divka.php?i=" + id_fotky;
}



function zobraz_divku(id_divky, id_fotky, height) {
  document.getElementById("divka_img").src = "images/divky/divka_"+id_divky+"_"+id_fotky+"_a.jpg";
}




function hodiny() {

  var currentTime = new Date ();
  
  var hodiny = currentTime.getHours ();
  var minuty = currentTime.getMinutes ();
 
  cas = (hodiny < 10 ? "0" : "") + hodiny;
  cas += (minuty < 10 ? ":0" : ":") + minuty;

  document.getElementById("clock").innerHTML = cas;
  window.setTimeout('hodiny();',1000);
}


function zobraz_plovouci_banner() {
     document.getElementById("plovouci_box").style.display = "block";
}

function aktualizuj_polohu_banneru() {



  document.getElementById("plovouci_box").style.position = "absolute";
  document.getElementById("plovouci_box").style.top= 
             document.body.scrollTop +
             document.body.clientHeight -383-52;
  document.getElementById("plovouci_box").style.left = 
             document.body.scrollLeft +
             document.body.clientWidth/2-175;
             ;
  setTimeout("aktualizuj_polohu_banneru();", 10);

}


function skryj_plovouci_banner() {
     document.getElementById("plovouci_box").style.display = "none";
}



function TextScroll(scrollname, div_name, up_name, down_name) {
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

    {
          if (document.getElementById) {
              div_obj = document.getElementById(this.div_name);
              if (div_obj) {
                  this.div_obj = div_obj;
                  this.div_obj.style.overflow = 'hidden';
              }
              div_up_obj = document.getElementById(this.up_name);
              div_dn_obj = document.getElementById(this.dn_name);
              if (div_up_obj && div_dn_obj) {
                  div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();")
                  div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
  
                  div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();")
                  div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
              }
          }
    }
  
    this.stopScroll = function() {
          clearTimeout(this.timeoutID);
      }
  
    this.scrollUp = function() {
          if (this.div_obj) {
              this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
              this.div_obj.scrollTop = this.scrollCursor;
              this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
          }
      }
  
    this.scrollDown = function() {
          if (this.div_obj) {
              this.scrollCursor += this.speed;
              this.div_obj.scrollTop = this.scrollCursor;
              this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
          }
      }
  
    this.resetScroll = function() {
          if (this.div_obj) {
              this.div_obj.scrollTop = 0;
              this.scrollCursor = 0;
          }
      }
}


