/*
Achtung: dynamisch erzeugte Datei!
für Neugenerierung einfach löschen
*/

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
// show() zeigt eine Grafikdatei in einem Popup an, daß dynamisch durch JavaScript generiert wird
// übergeben wird:	- Bild0		: anzuzeigende Grafikdatei mit Pfad
//			- Breite0	: Breite der Grafik (es jeweils 30 Pixel dazuaddiert, damit ein ein Rand zwischen Grafik und Fensterrand bleibt)
//			- Hoehe0	: Höhe der Grafik
// Aufruf:	<a href="javascript:show('foto_01g.jpg',600,400)" onMouseOver="window.status='Bild vergrößern';return true"><img src="foto_01.jpg"></a>
// (php)	<a href=\"javascript:show('foto_01g.jpg',600,400)\" onMouseOver=\"window.status='Bild vergrößern';return true\"><img src=\"foto_01.jpg\"></a>

fenster = null;
function show(Bild0,Breite0,Hoehe0)
{	
	Bild	= Bild0;
	Breite	= Breite0;
	Hoehe	= Hoehe0;
	weg();
	setTimeout("top(Bild,Breite,Hoehe)",500);
}
function top(Bild,Breite,Hoehe)
{  
	fBreite	= Breite>800 ? 800 : Breite+4;
	fHoehe	= Hoehe >600 ? 600 : Hoehe+4;
	posX	= (screen.width/2)-(fBreite/2);
	posY	= (screen.height/2)-(fHoehe/2);	
	Optionen= 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,height='+fHoehe+',width='+fBreite+',screenX='+posX+',screenY='+posY+',left='+posX+',top='+posY+' ';
	fenster = window.open(Bild,'Foto',Optionen);
	with (fenster) 
	{
		Breite>Hoehe ? hintergrund='background="images/hintergrund_show_horizontal.gif"' : hintergrund='background="images/hintergrund_show_vertikal.gif"';
		hintergrund = ""; // für Hintergrund diese Zeile auskommentieren
		document.writeln('<html><headD><title>Gro&szlig;es Foto</TITLE><meta http-equiv="imagetoolbar" content="no"></head>');
		document.writeln('<body bgcolor="#FFFFFF" '+hintergrund+' style=\"margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:100%;overflow:auto;\">');
		document.writeln('<div align="center">');
		document.writeln('<a href="javaScript:window.close()"><img src="'+Bild+'" width='+Breite+' height='+Hoehe+' border="0" alt="Fenster schliessen"></a>');
		document.writeln('</div></body></html>');
	}
}
function weg()
{
	if (fenster != null)
	{
		if (!fenster.closed)
		{
			fenster.close();
		}
	}
}
