  var timeout_refresh = null;
  var idxfoto    = 0;

  BIG_LEFT = 50;
  BIG_TOP  = 50;

  /*
            f u n c t i o n
  */
  function next() {
    var new_idx = idxfoto + 1; //eval(id_bigfoto.idxfoto) + 1;
    return show(new_idx);
  }  //function

  function prev() {
    var new_idx = idxfoto - 1; //eval(id_bigfoto.idxfoto) - 1;
    return show(new_idx);
  }  //function

  function show(idx) {
    idx = parseInt(idx);
    
    if (!DOM_TRUE) {return true};
    
    try {
      var big_foto = document.getElementById('id_bigfoto');
      
//      if ((big_foto != null) && big_foto.scrollIntoView) {big_foto.scrollIntoView(false)};
      
      if (document.getElementById('Notice').style.visibility = "hidden") {
        document.getElementById('Notice').style.visibility = "";
      } //if
  
      if (idx > (imgarr.length -1) ) {
        idx = 0;
      } //if
      if (idx < 0) {
        idx = imgarr.length -1;
      } //if
  
      var nimg = new Image();
      nimg = eval("imgarr[" + idx + "]");
  
      if (IE) big_foto.filters.item(0).Apply();
      big_foto.style.visibility = '';
  
      big_foto.width   = nimg.width;
      big_foto.height  = nimg.height;
      big_foto.src     = nimg.src;
      big_foto.title   = nimg.title;
      big_foto.alt     = nimg.title;
      //big_foto.idxfoto = idx;
      idxfoto          = idx;
      //document.getElementById('id_label').innerText = nimg.title;
      document.getElementById('id_label').value   = nimg.title;
      document.getElementById('id_label').style.width = nimg.width;
  
      window.clearTimeout(timeout_refresh);
  
      if (!nimg.complete) {
        document.getElementById('id_move_control').value   = 'Stahuji obrázek č.' + (idx + 1) + ', čekejte prosím...';
        big_foto.style.visibility = 'hidden';
  
        timeout_refresh = window.setTimeout('show("' + idx + '")', 1000);  //refresh 1s
      } else {
  
        document.getElementById('id_move_control').value   = '' + (idx + 1) + ' z ' + imgarr.length + ' fotografií';
        document.getElementById('id_move_control').title   = 'Velikost obrázku: ' + big_foto.fileSize + ' bytů';
  
        if (IE) big_foto.filters.item(0).Play();
      } //if
  //    align(); //align control items
  
      return false;
    } catch (e) {
      return true;
    }  //try
  } //function


//////////////////////////////////////////////////////
//           m o v e
//////////////////////////////////////////////////////
var x = 0
var y = 0
drag  = 0
move  = 0
window.document.onmousemove = mouseMove
window.document.onmousedown = mouseDown
window.document.onmouseup   = mouseUp
window.document.ondragstart = mouseStop

function mouseUp() {
  move = 0;
}

function mouseDown() {
  if (drag) {
    clickleft = window.event.x - parseInt(dragObj.style.left);
    clicktop  = window.event.y - parseInt(dragObj.style.top);
    dragObj.style.zIndex += 1;
    move = 1;
  }
}
function mouseMove() {
  if (move) {
    dragObj.style.left = window.event.x - clickleft;
    dragObj.style.top  = window.event.y - clicktop;
  }
}
function mouseStop() {
  window.event.returnValue = false;
}

function Show(divid) {
  var element = document.getElementById(divid);   
   
  if (IE) element.filters.blendTrans.apply();
  element.style.visibility = "visible";
  if (IE) element.filters.blendTrans.play();
}

function Hide(divid) {
  var element = document.getElementById(divid);
  
  window.clearTimeout(timeout_refresh);

  if (IE) element.filters.blendTrans.apply();
  element.style.visibility = "hidden";
  if (IE) element.filters.blendTrans.play();
}