// <a href="html-or.jpg" onclick="return myPopup(this,123,456)" title="..."
// or
// <a href="html-or.jpg" onclick="return myPopup(this)" title="..."

//var pop = null;

function popdown() {
	if (pop && !pop.closed) pop.close();
}
function myPopup(url,windowname,w,h,x,y){
	//popdown();
	pop = window.open(url,windowname,"resizable=no,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+w+",height="+h+",left="+x+",top="+y+"");
	return pop ? false : true;
}
//window.onunload = popdown;
//window.onfocus = popdown;
function popImage(url, image, titel, alt)
{ var undefined;

  if (alt==undefined)
  {alt='';}

  if (titel==undefined)
  {titel='www.graues-kloster.de';}
  pop=window.open('', 'Image', 'height=200,width=150');
  var tmp = pop.document;
  //pop = window.open('', '','resizable=1');
    //tmp.open();
    tmp.write('<html><head><title>popup</title>');
    tmp.write('<title>'+titel+'</title>');
    tmp.write('<meta http-equiv=\"imagetoolbar\" content=\"no\">');
    tmp.write('<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" scroll=\"no\" >');
    //onload=\"opener.resize(document.images[0].width,document.images[0].height)\">')
    tmp.write('<a href=\"javascript:self.close()\">');
    tmp.write('<img src=\"'+image+'\" border=\"0\" alt=\"'+alt+'\">')
    tmp.write('</body></html>');
    tmp.close();
    pop.focus();
  	return pop ? false : true;	
}

function resize(x,y)
{
if (navigator.appName.toLowerCase() == 'microsoft internet explorer')
  {
	
 if ((navigator.userAgent.toLowerCase().indexOf('aol')==-1) && (navigator.userAgent.toLowerCase().indexOf('opera')==-1))
     {pop.resizeTo(x+10,y+29);}  
    
 if (navigator.userAgent.toLowerCase().indexOf('opera')!=-1)
     {pop.resizeTo(x+12,y+31);}

 if (navigator.userAgent.toLowerCase().indexOf('aol')!=-1)
     {pop.resizeTo(x+4,y+4);}
  
  }


else
{
	if(navigator.appVersion.substring(0,1) < "5")
		{pop.resizeTo(x,y);}
	
	else
		{pop.resizeTo(x+8,y+28);}
}

shckx=(screen.availWidth/2)-(x/2);
shcky=(screen.availHeight/2)-(y/2);

pop.moveTo(shckx,shcky);
}

