// Prueft auf Internet Explorer
function BrowserCheck(){
	//alert("<br>The value of navigator.appVersion is " +   navigator.appVersion);
	if (navigator.appName != "Microsoft Internet Explorer") {
		alert("Diese Seiten wurden fuer den Microsoft Internet Explorer optimiert. " +
			  "Bei Verwendung anderer Browser kann es zu Unstimmigkeiten bei der " +
			  "Darstellung der Inhalte und/oder der Funktionalitaet kommen."); }
}  

function Impressum() {
	impWindow = window.open("/scripts/pages/de/impressum.php", "impressum",	"width=640,height=480,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
	impWindow.focus();
}

// Aequivalent zur zz_utils.php-Funktion "btn" (zur Verwendung mit php-Templates)
function Button(aCaption, aIcon, aHref, aOnClick) {
	document.write("<table id=\"IcTab\"><tr>");
	document.write("<td id=\"IcTabIcon\"><img src=\"graph/" + aIcon + "\"");
	document.write(" onclick=\"" + aOnClick + "\"></td>");
	document.write("<td><a href=\"" + aHref + "\">" + aCaption + "</a></td>");
	document.write("</tr></table>");
}

function openWindow(url, width, height) {
	myWindow = window.open(url, "", "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,scrollbars=no,resizable=no");
	myWindow.focus();
}
	
// Bestellung aufgeben (Fenster zur Adresseneingabe oeffnen)
function MailOrder(aOrder) {
	MailWindow = window.open("/scripts/include/order.php?order=" + aOrder, "win_mail",
				"width=640,height=480,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	MailWindow.focus();
} // end MailOrder
	
// Bildanzeige in Extrafenster:
function ShowImage(aImageFile) {
	MailWindow = window.open("/scripts/include/image.php?ImageFile=" + aImageFile, "img_view",
				"width=640,height=480,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	MailWindow.focus();
}
	
// Flash-Animation in Extrafenster:
function ShowFlash(aFileName) {
	MailWindow = window.open("/scripts/include/video.php?filename=" + aFileName + "&type=flash", "img_view",
				"width=640,height=550,toolbar=no,menubar=no,scrollbars=no,resizable=yes");
	MailWindow.focus();	
}

// RM Video abspielen
function ShowVideo(aFileName) {
	if (document.TheForm.QUALITY[0].checked) {
		strQ = "352x288";
	}
	else {
		strQ = "176x144";
	}
	strPath = "/html/video/aufloesung" + strQ + "/";
	
	VideoWindow = window.open("/scripts/include/video.php?filename=" + strPath + aFileName + "&type=realmedia", "win_video", 
							  "width=430,height=500,toolbar=no,menubar=no,scrollbars=no,resizable=yes");
	VideoWindow.moveTo((screen.availWidth - 430) / 2, (screen.availHeight - 500) / 2);
}

function VMenuZurueck() {
	parent.VMenu.location.replace("vm_z.htm");
}

function SetMenus(aBereich, aHItem, aSessID) {
	SetHMenu(aBereich, aHItem, aSessID);
	SetVMenu(aBereich, aHItem, "", aSessID);
}

function SetHMenu(aItem) {
	parent.HMenu.location.replace("/scripts/include/topNavigation.php?pageID=" + aItem);
}

function SetVMenu(aItem) {
	parent.VMenu.location.replace("/scripts/include/leftNavigation.php?pageID=" + aItem);
}

// Bestellung absenden
function MailOrderSendMail() {
	if (document.TheForm.name.value == "") {
		alert("Sie haben Ihren Namen nicht angegeben.");
		document.TheForm.name.focus();
	} else {
		if (document.TheForm.strasse.value == "") {
			alert("Sie haben keine Strasse angegeben.");
			document.TheForm.strasse.focus();
		} else {
			if (document.TheForm.ort.value == "") {
				alert("Sie haben keinen Ort angegeben.");
				document.TheForm.ort.focus();
			} else {
				if (document.TheForm.email_from.value == "") {
					alert("Sie haben keine E-Mail-Adresse angegeben.");
					document.TheForm.email_from.focus();
				} else {
					mailtext = document.TheForm.email_body.value + "<br><br>" +
								"Anschrift:<br>" +
								document.TheForm.name.value + "<br>" +
								document.TheForm.strasse.value + "<br>" +
								document.TheForm.ort.value;
					
					document.location = "/scripts/include/sendmail.php?email_from=" + document.TheForm.email_from.value +
										"&email_betreff=Bestell-Service" +
										"&email_body=" +  mailtext;
				}
			}
		}
	}
}

// Recherche absenden
function MailRechercheSendMail() {
	if (document.TheForm.name.value == "") {
		alert("Sie haben Ihren Namen nicht angegeben.");
		document.TheForm.name.focus();
	} else if (document.TheForm.strasse.value == "") {
		alert("Sie haben keine Strasse angegeben.");
		document.TheForm.strasse.focus();
	} else if (document.TheForm.ort.value == "") {
		alert("Sie haben keinen Ort angegeben.");
		document.TheForm.ort.focus();
	} else if (document.TheForm.email_from.value == "") {
		alert("Sie haben keine E-Mail-Adresse angegeben.");
		document.TheForm.email_from.focus();
	} else { 
		mailtext = document.TheForm.email_body.value + "<br><br>" +
					"Anschrift:<br>" +
					document.TheForm.name.value + "<br>" +
					document.TheForm.strasse.value + "<br>" +
					document.TheForm.ort.value + "<br>" +
					"Tel.: " + document.TheForm.telefon.value;
					
		MailWindow = window.open("/scripts/include/sendmail.php?email_from=" + document.TheForm.email_from.value +
							"&email_betreff=Literatur-Recherche" +
							"&email_body=" + mailtext,
							"win_abstract",
				     		"width=640,height=480,toolbar=no,menubar=no,scrollbars=no,resizable=no");
		MailWindow.focus();	
	}
}