function newwin(co,xwidth,yheight) 
{
 xx = screen.width/2 - xwidth/2;
 yy = screen.availHeight/2 - yheight/2;
 var xdist = 0;
 var ydist = 0;
 if (document.all)
 {
  var xdist = 10;
  var ydist = 29;
 }
 else
 {
  var xdist = 24;
  var ydist = 29;
 }
 var a = window.open(co,"new","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,left="+xx+",top="+yy+",resizable=no,width="+(xwidth+xdist)+",height="+(yheight+ydist));
}


function show_photo(id, w, h) {
  if (!w) w = 680;
  if (!h) h = 500;
  obrw = w;
  obrh = h;
  w = w - 5;
  h = h - 5;
  if (screen.width < w + 20) w = screen.width - 20;
  if (screen.height < h + 100) h = screen.height - 100;

  window.open(
    'fotodetail.php?sou=' + id + '&w=' + w + '&h=' + h,
    'detail',
    'width=' + w + ',height=' + h + ',resizable,statusbar=no').focus();
}
