var nn=document.layers?true:false;
var n6=document.getElementById?true:false;
var ie=document.all?true:false;
if ((ie) && (n6)) n6 = false;

var bn = navigator.appName;
var vn = navigator.appVersion.substring(0,1);

var fJS = false;

function init() {
	if (((bn == "Netscape") && (vn >= "3")) || ((bn == "Microsoft Internet Explorer") && (vn >= "4"))) {
		fJS = true;
	}
}

function drucken() {
	if (window.print) self.print();
	if(document.all && navigator.appVersion.substring(22,23)==4) {
		self.focus();
	    var OLECMDID_PRINT = 6;
	    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
	    var OLECMDEXECOPT_PROMPTUSER = 1;
	    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	    document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
	    WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
	    WebBrowser1.outerHTML = '';
	}
}

var imp = null;
function impressum() {
	if (imp != null) if (!imp.closed) imp.close();
	imp = window.open('impressum.htm','Impressum','marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=no,status=no,width=210,height=360,resizable=no');
	if (imp.opener==null) imp.opener=self;
	if (vn >= "4") imp.moveTo(0,0);
	return;
}

function checkMail() {
	var checkMail = document.nletter.newsmail.value.indexOf("@");
	var checkMail1 = document.nletter.newsmail.value.lastIndexOf(".");
	var checkMail2 = document.nletter.newsmail.value.lastIndexOf(" ");
	var checkMailLaenge = document.nletter.newsmail.value.length;
	if ((checkMail2 != -1) || (checkMail1 == -1) || (checkMail < 1) || (checkMail == checkMailLaenge-1) || (checkMail == checkMail1-1) || (checkMail1 > checkMailLaenge-3) || (checkMailLaenge < 6) || (document.nletter.newsmail.value == "eMail eingeben") || (document.nletter.newsmail.value == "")) {
		alert("Eine gültige eMail-Anschrift sollten Sie schon eintragen,\nsonst macht die Anmeldung wenig Sinn!");
		return false;
	}
	return;
}

var nl = null;
function newsl() {
	var mail = document.nletter.newsmail.value;
	if (nl != null) if (!nl.closed) nl.close();
	nl = window.open('newsletter.asp?email=' + mail,'Newsletter','left=' + (400-160) + ',top=' + ((screen.availHeight/2)-110) + 'marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=no,status=no,width=320,height=220,resizable=no');
	if (nl.opener==null) nl.opener=self;
	//if (vn >= "4") nl.moveTo((screen.availWidth/2)-160,(screen.availHeight/2)-110);
	return;
}

var wi = null;
function info(datei,x,y,scbar) {
	tmpScroll = "yes";
	if (scbar == 0) tmpScroll = "no";
	if (!x) var tmpX = 520;
	else var tmpX = x+20;
	if (!y) var tmpY = 350;
	else var tmpY = y+30;
	if (wi != null) if (!wi.closed) wi.close();
	wi = window.open(datei,'Infofenster','left=' + (400-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpScroll + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (wi.opener==null) wi.opener=self;
	//if (vn >= "4") wi.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

var ew = null;
function zoomFenster(datei,x,y,alt,scbar,id,wo) {
	var tmpX = x+36;
	var tmpY = y+100;
	if (id > 0) tmpY = tmpY+20;
	var tmpSc = "no";
	if (tmpY > 500) {
		tmpY = 500;
		tmpSc = "yes";
		tmpX += 16;
	}
	if (scbar == 1) {
		tmpSc = "yes";
		tmpX += 16;
	}
	if (ew != null) if (!ew.closed) ew.close();
	ew = window.open('zoom.asp?id=' + id + '&hoch=' + y + '&breit=' + x + '&bild=' + datei + '&titel=' + alt,'Bildvergroesserung','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpSc + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (ew.opener==null) ew.opener=self;
	//if (vn >= "4") ew.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

var wk = null;
function warenkorb(art,id,anzahl) {
	var tmpX = 620;
	var tmpY = 350;
	if (wk != null) if (!wk.closed) wk.close();
	if (art < 100) {
		if (art < 0) wk = window.open('warenkorb.asp?delall=1','Warenkorb','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=yes,status=no,width=620,height=350,resizable=no');
		else wk = window.open('warenkorb.asp?art=' + art + '&id=' + id + '&anzahl=' + anzahl,'Warenkorb','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=yes,status=no,width=650,height=350,resizable=no');
	} else {
		wk = window.open('warenkorb.asp','Warenkorb','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=yes,status=no,width=650,height=350,resizable=no');
	}
	if (wk.opener==null) wk.opener=self;
	//if (vn >= "4") wk.moveTo((screen.availWidth/2)-310,(screen.availHeight/2)-175);
	return;
}

function checkStuhl() {
	var count = 0;
	var text1 = "";
	if ((document.kalkulator.personen.value == "") && (document.kalkulator.qm.value == "")) {
		text1 += "- Bitte geben Sie die Anzahl der Personen oder die Raumgröße an\n";
		count += 1;
	}
	if (document.kalkulator.bestuhlung.options[document.kalkulator.bestuhlung.selectedIndex].value == 0) {
		text1 += "- Bitte wählen Sie die gewünschte Bestuhlungsform\n";
		count += 1;
	}
	//if (document.kalkulator.technik.options[document.kalkulator.technik.selectedIndex].value == 0) {
	//	text1 += "- Bitte wählen Sie die Art der Tagungstechnik\n";
	//	count += 1;
	//}
	
	if (count == 0) {
		info('',350,200,0);
		return "bestuhlung.asp";
	}
	else {
		if (count >= 2) text1 = "Folgende Felder müssen noch ausgefüllt werden:\n" + text1;
		else text1 = "Füllen Sie bitte auch noch das folgende Feld aus:\n" + text1;
		alert(text1);
		return false;
	}
} 

function ieFake(fake) {
	if ((document.all) && (fake)) fake.blur();
}

if (document.layers) document.write('<link rel=stylesheet media="screen" type="text/css" href="styles_nn.css">');
else document.write('<link rel=stylesheet media="screen" type="text/css" href="styles.css">');