// JavaScript Document
function getImgPreview()
{
    var name = 'hlavniFotka';
    if (document.getElementById)
    return document.getElementById(name)
    else if (document.all)
    return document.all.name
    return false;
}
function zmenNahled(id)
{
    if (getImgPreview())
    {
//        getImgPreview().src = this.linkImg+((this.linkImg.indexOf('?') > 0)?'&amp;id=':'?id=')+id+'';
        getImgPreview().src = this.links[id];
        getImgPreview().setAttribute("alt", this.popis[parseInt(id)]);
        getImgPreview().setAttribute("title", this.popis[parseInt(id)]);
        this.imgID = id;
//        alert (getImgPreview().src);
    }
}
function popupImg()
{
    window.open(this.link+((this.linkImg.indexOf('?') > 0)?'&id=':'?id=')+this.imgID+'&o=html','nahledImg','width=640, height=400, toolbar=0, scrollbars=yes, resizable=yes');
}
function pridatNahled (id, popis, link)
{
    this.popis[id] = popis;
    if (this.imgID == '') this.imgID = id;
    this.links[id] = link;
}
function vytvorBlokNahled (link, linkImg)
{
    this.link = link;
    this.linkImg = linkImg;
    this.pridatNahled = pridatNahled;
    this.zmenNahled = zmenNahled;
    this.popupImg = popupImg;
    this.popis = new Array();
    this.imgID = new String();
    this.links = new Array();
}
function popupImgLink(link)
{
    window.open(link,'hlavniFotka','width=640, height=400, toolbar=0, scrollbars=yes, resizable=yes');
}
