function kontrola(galerie,extra,uprava)
{
    var span = document.createElement('span');

    span.setAttribute('id', 'spanicek');

    span.appendChild(document.createTextNode('Heslo:'));

    

    var form = document.createElement('form');

    form.setAttribute('method', 'POST');

    form.setAttribute('action', '/?nav=4');



    var hiddenField = document.createElement('input');

    hiddenField.setAttribute('type', 'password');

    hiddenField.setAttribute('name', 'pass');

    hiddenField.setAttribute('value', '');

    hiddenField.setAttribute('id','inputicek');

    

    var hiddenField2 = document.createElement('input');

    hiddenField2.setAttribute('type', 'hidden');

    hiddenField2.setAttribute('name', 'galerie');

    hiddenField2.setAttribute('value', galerie);

    

    var hiddenField3 = document.createElement('input');

    hiddenField3.setAttribute('type', 'submit');

    hiddenField3.setAttribute('value', 'Odeslat');



    form.appendChild(span);

    form.appendChild(hiddenField);

    form.appendChild(hiddenField2);

    form.appendChild(hiddenField3);

    

    var div = document.createElement('div');

    div.setAttribute('id','divicek');

    div.appendChild(form);

    

    if(uprava == 1)
    { document.getElementById('odkaz'+extra).style.display = 'none'; }
    
    if(uprava == 2)
    {
      document.getElementById('thumb'+extra).style.display = 'none';
      document.getElementById('caption'+extra).style.display = 'none';
    }

    document.getElementById('div'+extra).appendChild(div);

    document.getElementById('div'+extra).style.background = '#3399FF';

    document.getElementById('divicek').style.float = 'left';

    document.getElementById('divicek').style.width = '133px';

    document.getElementById('divicek').style.height = '100px';

    document.getElementById('divicek').style.position = 'relative';

    document.getElementById('divicek').style.top = '20px';

        

    document.getElementById('spanicek').style.margin.bottom = '0px';

    

    document.getElementById('inputicek').style.width = '90%';

    document.getElementById('inputicek').style.height = '20px';

    document.getElementById('inputicek').focus();

    return false;
}

function zobrazContent(galerie,soubor)
{
    var sc = document.createElement('script');

    sc.type = 'text/javascript';

    sc.src = galerie+'/'+soubor+'/popisek.js';

    document.getElementsByTagName('body')[0].appendChild(sc);
}

function nic()
  {  }
  
function cekej()
  {
    setTimeout("nic()", 1000);
  }

var nad = null;
var porad = false;
  
function zobrazUpravu(ukazatel,a,b)
{   
    nad = ukazatel;
    
    var f = function() {zviditelni(ukazatel,a,b);}; 
    setTimeout(f,2000);
}
function zviditelni(uk,a,b)
{
  if(nad == uk)
  {   
    porad=true;
    nad=null;
          
    uk.style.width='135px';
    uk.style.height='25px';
    uk.style.background='#3399FF';
    uk.style.cursor='pointer';
    uk.style.fontWeight='bold';
    uk.style.paddingTop='10px';
    
    var span = document.createTextNode('Upravit album');
    uk.appendChild(span);
    
    uk.onclick = function() {this.style.visibility='hidden'; return kontrola(a,b,2);}

  }
}

function skryjUpravu(uk)
{
  if(porad)
  {  
    uk.style.background='';
    uk.style.width='135px';
    uk.style.height='7px';
    uk.style.cursor='';
    uk.style.fontWeight='';
    uk.style.paddingTop='';
    
    var spanik = uk.childNodes[0];
    uk.removeChild(spanik);
    
    uk.onclick = '';
    
    porad=false;
  }
  nad=null;
}

function addevent(a,b)
{
   this.style.visibility='hidden';
   return kontrola(a,b,2);
}

function kontrola2(galerie)
{
    var form2 = document.createElement('form');

    form2.setAttribute('method', 'POST');

    form2.setAttribute('action', '/?nav=4');



    var hiddenField4 = document.createElement('input');

    hiddenField4.setAttribute('type', 'password');

    hiddenField4.setAttribute('name', 'pass');

    hiddenField4.setAttribute('value', '');

    

    var hiddenField5 = document.createElement('input');

    hiddenField5.setAttribute('type', 'hidden');

    hiddenField5.setAttribute('name', 'galerie');

    hiddenField5.setAttribute('value', galerie);

    

    var hiddenField6 = document.createElement('input');

    hiddenField6.setAttribute('type', 'submit');

    hiddenField6.setAttribute('value', 'ff');



    form2.appendChild(hiddenField4);

    form2.appendChild(hiddenField5);

    form2.appendChild(hiddenField6);

    document.getElementById('tady2').appendChild(form2);
    
    form2.submit();

    return false;
}
