//_________________________________________________________________________________________________ Funktion für grosses Bild anzeigen
/*function bild (bildgr, breite, hoehe) {
	var fensteroptionen = ",scrollbars=no,resizable=no,locationbar=no,menubar=no,status=no";
	var b = breite + 10;
	var h = hoehe + 50;
	var links = (screen.width - b) / 2;														//auf Bildschirm zentrieren
	var oben = (screen.height - h) / 2;
	
	fensterpop = window.open (bildgr,'Info','width=' + b + ',height=' + h + ',left=' + links + ',top=' + oben + fensteroptionen);
	fensterpop.resizeTo(b,h);
	fensterpop.focus();
}
*/
//________________________________________________________________________________________________________ Funktion für PopUp anzeigen
function PopUp(Seite,Breite,Hoehe) {
	var fensteroptionen = ",scrollbars=no,resizable=no,locationbar=no,menubar=no,statusbar=no";
	var links = (screen.width - Breite) / 2;												//auf Bildschirm zentrieren
	var oben = (screen.height - Hoehe) / 2;

	fensterpop = window.open (Seite, '','width=' + Breite + ',height=' + Hoehe +',left=' + links + ',top=' + oben + fensteroptionen);
	fensterpop.focus();
}
//________________________________________________________________________________________________________ Funktion für PopUp anzeigen
function VPopUp(Seite,Breite,Hoehe) {
	var fensteroptionen = ",scrollbars=yes,resizable=yes,locationbar=yes,menubar=yes,statusbar=yes";
	var links = (screen.width - Breite) / 2;												//auf Bildschirm zentrieren
	var oben = (screen.height - Hoehe) / 2;

	fensterpop = window.open (Seite, 'PopUp','width=' + Breite + ',height=' + Hoehe +',left=' + links + ',top=' + oben + fensteroptionen);
	fensterpop.focus();
}
//________________________________________________________________________________________________________ Funktion für PopUp anzeigen
function UPopUp(Seite) {
	var fensteroptionen = ",scrollbars=yes,resizable=yes,locationbar=no,menubar=no,statusbar=yes";
	var Breite = 960;
	var Hoehe = 668;
	var links = (screen.width - Breite) / 2;												//auf Bildschirm zentrieren
	var oben = (screen.height - Hoehe) / 2;

	fensterpop = window.open (Seite, 'PopUp','width=' + Breite + ',height=' + Hoehe +',left=' + links + ',top=' + oben + fensteroptionen);
	fensterpop.focus();
}
//_________________________________________________________________________________________________ Funktion für Bilder-PopUp anzeigen
function BildPop (Bild, BildText, MaxBreite, MaxHoehe) {
	var fensteroptionen = ",scrollbars=no,resizable=no,locationbar=no,menubar=no,statusbar=no";
	var links = (screen.width - 100) / 2;													//auf Bildschirm zentrieren
	var oben = (screen.height - 100) / 2;
	
	fensterpop = window.open ('../_php/bild.php?Bild=' + Bild + '&BildText=' + BildText + '&MaxBreite=' + MaxBreite + '&MaxHoehe=' + MaxHoehe, 'BildPop','width=100,height=100,left=' + links + ',top=' + oben + fensteroptionen);
	fensterpop.focus();
}
//_________________________________________________________________________ Funktion für führende und nachfolgende Leerzeichen löschen
function trimm(tStr) {
	var Pattern = /^\s*|\s*$/g;
	
	return tStr.replace(Pattern,"");														//Zeichenkette lt. Muster ersetzen
}
//___________________________________________________________________________________________________ Funktion für EMailAdresse prüfen
function CheckMailAdress(EMail) {
	var Pattern = /^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z\.\-]+\.)+[a-z]{2,4}$/; 					//Suchmuster für EMail

	if (EMail.value.match(Pattern) == null) {												//wenn suchmuster nicht passt ...
		return false;																		//falsch zurückliefern
	}
	else {
		return true;																		//wahr zurückliefern
	}
}
//________________________________________________________________________________________________ Funktion für Flash extern einbinden
function flash(flashurl, myname, mywidth, myheight) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + mywidth + '"');
	document.write('height="' + myheight + '" id="' + myname + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + flashurl + '" />');
	document.write('<param name="quality" value="high" />');
//	document.write('<param name="bgcolor" value="' + mybgcolor + '" />');
//	document.write('<embed src="' + flashurl + '" quality="high" bgcolor="' + mybgcolor + '" width="' + mywidth + '" height="' + myheight + '" name="' + myname + '" ');
	document.write('<embed src="' + flashurl + '" quality="high" width="' + mywidth + '" height="' + myheight + '" name="' + myname + '" ');
	document.write('align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"');
 	document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
//________________________________________________________________________________________________ Funktion für Xplorer-Fenster öffnen
function openExplorer(xplTarget,xplFileTypes,xplSort) {
	var winOptions = ",scrollbars=yes,resizable=yes,location=no,menubar=no,status=yes,toolbar=no";//Fensteroptionen
	var winW = screen.width / 2;													//Breite
	var winH = screen.height / 2;													//Höhe
	var winLeft = (screen.width - winW) / 2;										//auf Bildschirm zentrieren
	var winTop = (screen.height - winH) / 2;										//

	var winSite = "../_php/xplorer.php?FileTypes=" + xplFileTypes + "&Sort=" + xplSort + "&Upload=true&Select=true&Del=false&Target=" 
				  + xplTarget + "&Preview=true&getLastDir=true&Msg=Datei%20wählen";

	xpl = window.open (winSite, 'xpl','width=' + winW + ',height=' + winH +',left=' + winLeft + ',top=' + winTop + winOptions);//PopUp
	xpl.focus();																	//Fokus setzen
}
