function Delete (link){
if (confirm("Czy na pewno chcesz skasować?"))
    document.location = link;
}





// zaznacza ramke na obrazku
function ShowPositionPicture(){

position = PositionChecked();

for (i in aPositions)
document.getElementById("picture_"+aPositions[i]).style.border      = "1px solid silver";
document.getElementById("picture_"+position).style.border           = "1px solid blue";
document.getElementById("radio_"+position).focus();

}

// ustala odpowiednie radio po kliknieciu na obazek
function SetRadio(position){
document.getElementById("radio_"+position).checked = true;
document.getElementById("radio_"+position).focus();
ShowPositionPicture(position);
}


// sprawdza jaka pozycja jest zaznaczona
function PositionChecked(){
checked = '';
for (i in aPositions)
if (document.getElementById("radio_"+aPositions[i]).checked) checked = aPositions[i];
return checked;
}


   function findXY(obj)
    {

        var x=0,y=0,w=0,h=0;
        if (obj)
        {w=obj.offsetWidth;h=obj.offsetHeight;}
        while (obj!=null)
        {
            x+=obj.offsetLeft;
            y+=obj.offsetTop;
            obj=obj.offsetParent;
        }
        return {X:x,Y:y,W:w,H:h};
    }
    
function ShowImage(img){

a = findXY(img);
x = a.X + a.W / 2;
y = a.Y + a.H / 2;

maxi = document.getElementById("ViewMaxiImage");
maxi.src = img.src.replace('mini','medi');
//b = findXY(maxi);
maxi.style.left = Math.round(x - 200);
maxi.style.top  = Math.round(y - 200);
//maxi.style.left = Math.round(x - b.W/2 );
//maxi.style.top  = Math.round(y - b.H/2 );
maxi.style.display = "block";
}


function ShowImageMax(img){


a = findXY(img);
x = a.X + a.W / 2;
y = a.Y + a.H / 2;


maxi     = document.getElementById("ViewMaxiImage");
title    = document.getElementById("TitleBox");

maxi.src = img.src.replace('mini','maxi');
maxi.style.left = Math.round(screen.width/2-400);
maxi.style.top  = Math.round(y - 250);
maxi.style.display = "block";

title.style.left = Math.round(screen.width/2-400);
title.style.top  = Math.round(y - 250);
title.innerHTML  = img.title;
title.style.background = 'white';
title.style.color = 'black';
title.style.display = "block";

}


    
    
function Hide(obj){
obj.style.display = "none";
title    = document.getElementById("TitleBox");
title.style.display = "none";
}

function otworz(url,a,b,c){
document.location = url;
}


