function makeLightBox(el) {
    el.lightBox({
        overlayBgColor:     "#000",
        overlayOpacity:     0.7,
        fixedNavigation: false,
        imageLoading: '/repository/js/lightbox/images/lightbox-ico-loading.gif',
        imageBtnClose: '/repository/js/lightbox/images/lightbox-btn-close.gif',
        imageBtnPrev: '/repository/js/lightbox/images/lightbox-btn-prev.gif',
        imageBtnNext: '/repository/js/lightbox/images/lightbox-btn-next.gif'
    });
}

/* lightbox */
$(function() {
    var boxen = [];

    //find all links w/ rel=lightbox[...
    $('a[rel*="lightbox"]').each(function() {

        //push only unique lightbox[gallery_name] into boxen array
        if ($.inArray($(this).attr('rel'),boxen) === -1) boxen.push($(this).attr('rel'));

    });
    //console.log(boxen);
    if(boxen.length){

        //for each unique lightbox group, apply the lightBox
        $(boxen).each(
            function(i,val) {
                makeLightBox($('a[rel="'+val+'"]'));
            });
    }
    else {
        makeLightBox($('.lightbox'));
    }
}); 


function Detail(path)
{
	window.open("detail.php?file="+path, '_blank', 'left=400, top=100, width=610, height=480, status=1, resizable=1');
}

function openView(idsz) {
	location = 'byty-na-prodej/byt-'+idsz+'/';
}


 function winopen(path)
  {
  window.open(path, '_blank', 'left=400, top=100, width=500, height=350, resizable=1');
  return false;
  }


// javascript bez javascriptu - otevirani odkazu v novem okne pomoci classy popup

function aktualizujOdkazy() {
  if(!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if(links[i].className.match("popup")) {
      links[i].onclick = function () {
        return !window.open(this.href);
      }
    }
  }
}
window.onload=aktualizujOdkazy;
