function pokaz_obrazek(sciezka,x,y)
{
ext_pic=open('', '', 'width='+x+', height='+y+'');
ext_pic.document.write('<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\"><title>..:MILAGNES::..</title></head><body marginwidth=0 merinheight=0 leftmargin=0 topmargin=0 onLoad=\"focus(self);\"><img src=\"'+sciezka+'\" onClick=\"javascript:window.close()\" alt=\"Kliknij, aby zamkn±æ!\"></body></html>');
}

function okienko(url, w, h, s)
{   
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var t='location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars='+s+',status=no,width='+w+',height='+h+',left='+winl+',top='+wint;

    now = new Date();
    sec = now.getSeconds(); 
    sec = sec+""+now.getMinutes();
    namex="okno"+sec;
    
    nowe_okienko=window.open(url,namex,t);
    nowe_okienko.focus();
}

function skok(elmnt,content)
{
    if (content.length==elmnt.maxLength)
    {
	if (elmnt.name=='dzien_od') {  document.forms[0].miesiac_od.focus() }
	else if (elmnt.name=='miesiac_od') { document.forms[0].rok_od.focus() }
	else if (elmnt.name=='rok_od') { document.forms[0].tytul.focus() }
    }
}

function edytuj(id)
{
    okienko("e.php?funkcja=edytuj&id="+id, 655, 500, 0);
}

function dodaj(doc,id)
{
    okienko("e.php?funkcja=dodaj&doc="+doc+"&id="+id, 655, 500, 1);
}


function usun(rekord)
{
    if (window.confirm('Czy na pewno chcesz skasowaæ dane?'))
    {
        document.forms[0].funkcja.value='usun';
        document.forms[0].rekord.value=rekord;
        document.forms[0].submit();
    }
}

function usun_strone(doc)
{
    if (window.confirm('Czy na pewno chcesz skasowaæ stronê?'))
    {
	document.forms[0].funkcja.value='usun_strone';
        document.forms[0].rekord.value=doc;
        document.forms[0].submit();
    }
}

function fotoedit(plik,plik_d,id,tablica,pole,doc)
{
    okienko("image.php?plik="+plik+"&plik_d="+plik_d+"&id="+id+"&tablica="+tablica+"&pole="+pole+"&doc="+doc, 360, 460, 0);
}


