function showphoto(url,x,y) {
    windowPop = window.open (url,"photo","width="+x+",height="+y+",location=1,menubar=0,scrollbars=1,resizable=0,status=0,titlebar=1,toolbar=0");
    windowPop.focus();
}

function show_popup(url,x,y) {
	windowPop = window.open (url,"photo","width="+x+",height="+y+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0");
	windowPop.focus();
}


function showfile(url) {
	windowPop = window.open (url,"photo","width=470,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1,toolbar=0");
	windowPop.focus();
}

function show_win(url) {
	windowPop = window.open (url,"photo","width=700,height=500,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1,toolbar=0");
	windowPop.focus();
}

function show_win_zag(url) {
    winzag = window.open(url, "grafik_zag","width=950,height=680,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=1,toolbar=0");
    winzag.focus();
    
}

$(function(){
    $('a').each(function(){
        var href = $(this).attr('href');
        if(href){
            var result = href.match(/javascript:showphoto\('\/photo\/popup(\S+)'/);
            if(result != null){
                var newurl = result[1];
                $(this).attr('href',newurl);
                $(this).addClass('lightbox');
            }
        }
    });
    $('.lightbox').lightBox({
        imageLoading:			'/img/lightbox/lightbox-ico-loading.gif',
        imageBtnPrev:			'/img/lightbox/lightbox-btn-prev.gif',
        imageBtnNext:			'/img/lightbox/lightbox-btn-next.gif',
        imageBtnClose:			'/img/lightbox/lightbox-btn-close.gif',
        imageBlank:				'/img/lightbox/lightbox-blank.gif'
    });    
});
