// Globale Variablen
var projekt;
var thema;
var nachricht;
var benutzer;
var passwort;

// Initialisierungsfunktion
function init(){
	projekt = createElement("projekt");
	thema = createElement("thema");
	nachricht = createElement("nachricht");
	benutzer = createElement("benutzer");
	passwort = createElement("passwort");
}

// Hilfsfunktion zum Erstellen von Objektreferenzen
function createElement(pElement){
	if(navigator.appName=="Microsoft Internet Explorer"){
		pElement = document.all[pElement];
		return pElement;
	}else{
		pElement = document.getElementById(pElement);
		return pElement;
	}
}

// Formularcheck
function checkForm(){
	if(thema.value==""){
		alert("Das Eingabefeld \"Thema\" besitzt keinen gültigen Wert!");
		thema.focus();
		return false;
	}else if(nachricht.value==""){
		alert("Das Eingabefeld \"Nachricht\" besitzt keinen gültigen Wert!");
		nachricht.focus();
		return false;
	}else{
		return true;
	}
}

// Logincheck Benutzerkennung
function checkLoginForm(){
	if(benutzer.value==""){
		alert("Das Eingabefeld \"Benutzername\" besitzt keinen gültigen Wert!");
		benutzer.focus();
		return false;
	}else if(passwort.value==""){
		alert("Das Eingabefeld \"Passwort\" besitzt keinen gültigen Wert!");
		passwort.focus();
		return false;
	}else{
		return true;
	}
}

// Newsfenster öffnen
function openNews(pUrl, pName, pWidth, pHeight, pLeft, pTop, pScrollbars, pToolbar, pMenubar, pLocation, pStatus, pResizable, pStatustext){
	pLeft = (screen.width-pWidth)/2;
	pTop = (screen.height-pHeight)/2;
	if(navigator.appName=="Microsoft Internet Explorer"){
		news = window.open(pUrl, pName, "width="+pWidth+",height="+pHeight+",left="+pLeft+",top="+pTop+",scrollbars="+pScrollbars+",toolbar="+pToolbar+",location="+pLocation+",menubar="+pMenubar+",status="+pStatus+",resizable="+pResizable);
 		news.focus();
		news.status = pStatustext;
	}else{
		news = window.open(pUrl, pName, "width="+pWidth+",height="+pHeight+",left="+pLeft+",top="+pTop+",screenX=0,screenY=0"+",scrollbars="+pScrollbars+",toolbar="+pToolbar+",location="+pLocation+",menubar="+pMenubar+",status="+pStatus+",resizable="+pResizable);
 		news.focus();
		news.status = pStatustext;
	}
}

