var myTWin = window.myTWin;

function popupGalleryWindow(link,winName,width,height)
{
  var retValue=true;
  if (myTWin!=null && !myTWin.closed)
  {
    myTWin.focus();
    myTWin.location.href=link.href;
  }
  else
  {
    myTWin=window.open('/getfoto.php?file='+link.href,winName, "toolbar=0, status=0, menubar=0, scrollbars=1, resizable=1, width="+width+", height="+height);
    if (myTWin==null || typeof(myTWin)=="undefined")
      retValue=false;
    else
    {
      link.target=winName;
      myTWin.focus();
    }
  }
  return retValue;
}

// vlastni select pomoci div+a -->
function selectClick(par) {
  optionHidden();
  alloption=document.getElementById(par);
  alloption.style.display="block";
  activeoption=0;
  return false;
}
function optionClick(table, par) {
  alert(table+' '+par);
  return false;
}
var activeoption=2;
var alloption;
document.onclick=function(){
  optionHidden();
};
function optionHidden() {
  if (activeoption==1){
    alloption.style.display="none";
    activeoption=0;
  } else if (activeoption==0){
    activeoption=1;
  }
}

function OpenMyWin(link,winName,w,h,scrollb)
{
  var retValue = true;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings="width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+scrollb+",location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0";  
  if (myTWin!=null && !myTWin.closed)
  {
    myTWin.focus();
    myTWin.location.href=link.href;
  }
  else
  {
    
		myTWin=window.open(link.href,winName,settings);
    if (myTWin==null || typeof(myTWin)=="undefined")
      retValue=false;
    else
    {
      link.target=winName;
      myTWin.focus();
    }
  }
  return retValue;
}

// vlastni select pomoci div+a <--
