// Fenster öffnen °NEW°
function popUp(strURL,strType,strHeight,strWidth) {
			var strOptions="";
				if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
				if (strType=="showall") strOptions="toolbar,menubar,scrollbars,resizable,location,status,height="+strHeight+",width="+strWidth;
				if (strType=="elastic") strOptions="toolbar,scrollbars,resizable,height="+strHeight+",width="+strWidth;
				
				// Position berechnen
				var cool = (!document.all && document.getElementById);
				var ie = (document.all);

				if(cool) {
				sbreite = innerWidth;
				shoehe = innerHeight;
				}
				else if(ie) {
				sbreite = document.body.clientWidth;
				shoehe = document.body.clientHeight;
				}
				b = strWidth;                    
				h = strHeight; 
				x = (sbreite-b)/2;
				y = (shoehe-h)/2;
				
				// Fenster öffnen	
				fenster = window.open(strURL, 'newWin', strOptions);
				// Fenster zentrieren
				fenster.moveTo(x, y);
}

// Suckerfish Menu >> http://www.htmldog.com/articles/suckerfish/dropdowns/example/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



//________________________________________________________________________________________________
// Hack um Formulare zum Funktionieren zu bringen. 
// Bitte löschen sobald Formulare normal genutz werden können.


/***************************************************************
*
*  Universal validate-form
*
*
*
*
*  Copyright notice
* 
*  (c) 1998-2000 Kasper Skårhøj
*  All rights reserved
*
*  This script is part of the standard PHP-code library provided by
*  Kasper Skårhøj, kasper@typo3.com
* 
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* 
*  This copyright notice MUST APPEAR in all copies of this script
***************************************************************/


function validateForm2(theFormname,theFieldlist,goodMess,badMess)	{
	if (document[theFormname] && theFieldlist)	{
		var index=1;
		var theField = split(theFieldlist, ",", index);
		var msg="";
		while (theField) {
			index++;
			theLabel = unescape(split(theFieldlist, ",", index));
			theField = unescape(theField);
			if (document[theFormname][theField])	{
				var fObj = document[theFormname][theField];
				var type=fObj.type;
				if (!fObj.type)	{
					type="radio";
				}
				var value="";
				switch(type)	{
					case "text":
					case "textarea":
						value = fObj.value;
					break;
					case "select-one":
						if (fObj.selectedIndex>=0)	{
							value = fObj.options[fObj.selectedIndex].value;
						}
					break;

					case "radio":
						var l=fObj.length;
						for (a=0; a<l;a++)	{
							if (fObj[a].checked)	{
								value = fObj[a].value;
							}
						}
					break;
					default:
						value=1;
				}
				if (!value)	{
					msg+="\n"+theLabel;
				}
			}
			index++;
			theField = split(theFieldlist, ",", index);
		}
		if (msg)	{
			var theBadMess = unescape(badMess);
			if (!theBadMess)	{
				theBadMess = "You must fill in these fields:";
			}
			theBadMess+="\n";
			alert(theBadMess+msg);
			return false;
		} else {
			var theGoodMess = unescape(goodMess);
			if (theGoodMess)	{
				alert(theGoodMess);
			}
			return true;
		}
	}
}
function split(theStr1, delim, index) {
	var theStr = ''+theStr1;
	var lengthOfDelim = delim.length;
	sPos = -lengthOfDelim;
	if (index<1) {index=1;}
	for (a=1; a<index; a++)	{
		sPos = theStr.indexOf(delim, sPos+lengthOfDelim);
		if (sPos==-1)	{return null;}
	}
	ePos = theStr.indexOf(delim, sPos+lengthOfDelim);
	if(ePos == -1)	{ePos = theStr.length;}	
	return (theStr.substring(sPos+lengthOfDelim,ePos));
}
