function ukrywanie(targetId)
{
    if(document.getElementById)
    {
        target = document.getElementById(targetId);

            if (target.style.display == "none" ) {
                target.style.display = "";

            } else {
                target.style.display = "none";
            }
    }
}


// Autorem skryptu jest: SŁAWOMIR KOKŁOWSKI
// www.kurshtml.boo.pl
// Jeśli chcesz wykorzystać ten skrypt na swojej stronie, nie usuwaj tego komentarza!

function flash(id, kolor, czas, kolor2, czas2)
{
  if (document.getElementById)
  {
    document.getElementById(id).style.color = kolor;
    setTimeout('flash("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas);
  }
  else if (document.all)
  {
    document.all[id].style.color = kolor;
    setTimeout('flash("' +  id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas);
  }
}


// Otwieranie nowego okienka z parametrami
function OpenWindow(url)
{
    var Okno = window.open(url, "OpenWindow", 'width=200,height=100,top=0,left=0,resizable=0,scrollbars=no,menubar=no,status=no');

}

function OpenWindowScroll(url)
{
    var Okno = window.open(url, "OpenWindow", 'width=200,height=100,top=0,left=0,resizable=0,scrollbars=yes,menubar=no,status=no');

}

// Zamykanie okienka
function CloseWindow()
{
    var Okno = window.close();
}



// Operacje wykonywane po zaladowaniu strony
function init()
{
    // Dodawanie onclick do wybranych linkow
    var photos = document.getElementsByTagName('a');

    for(i=0; i < photos.length; i++)
    {
        if( (photos[i].parentNode.className == 'photoBar') || (photos[i].className == 'photoNewWin'))
        {
            var href = photos[i].getAttribute("href");

            //photos[i].onclick = function() {OpenWindow('foto.php?file=' + href + '&js=1'); return false;}
            var href_new = "OpenWindow('foto.php?file=" + href + "&js=1'); return false";
            photos[i].setAttribute("onclick", href_new);
        }
        
        if (photos[i].className == 'NewWinParam')
        {
            photos[i].onclick = function() {OpenWindow(this.href + '&js=1'); return false;}
        }
        
    }
    
    if (document.getElementById('subscribe'))
    {
        var subscribe = document.getElementById('subscribe');
        var subscribe_href = subscribe.getAttribute("href");
        var subscribe_href_new = "OpenWindow('" + subscribe_href + "&js=1'); return false";
        subscribe.setAttribute("onclick", subscribe_href_new);
    }
}

window.onload = function()
{
  init();
}
