function checkForm(){
	var l=checkForm.arguments;
	var o=l[0];
	var bool=1;

	for (var i=1;i<l.length;i++) {

		var e=o[l[i]];
		//var val=(e.options && !e.value)?e.options[e.selectedIndex].value:e.value;//NS4, select
		var val = e.value;
		if (val==''){
			e.focus();
			alert("Bitte alle erforderlichen Felder ausfüllen!");
			return false;
		} else if ((l[i]=='email') && (!isEmail(e.value))){
			e.focus();
			e.select();
			alert("Bitte eine korrekte Email-Adresse eingeben!");
			return false;
		//} else if ((l[i]=='datum') && (!isDate(e.value))){
		} else if ((l[i].indexOf("datum")>-1) && (!isDate(e.value))){
			e.focus();
			e.select();
			alert("Bitte eine korrektes Datum eingeben!");
			return false;
		} else if ((l[i].indexOf("zeit")>-1) && (!isTime(e.value))){
			e.focus();
			e.select();
			alert("Bitte eine korrekte Uhrzeit eingeben!");
			return false;
		}
	}
	return true;
}
function isJpg(fileName){
	if(fileName!='' && fileName.substr(s.length-4,4).toLowerCase()!='.jpg'){
		alert('F&uuml;r Bilddatei nur Endung *.jpg erlaubt!');
		return false;
	}
	return true;
}
function isEmail(email) {
	reg = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/;
	return reg.exec(email);
	//var reg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]{2,}[.][a-zA-Z0-9]{2,4}$/;
	//var reg2 = /[.@]{2,}/;
	//return ((reg.exec(email)!=null) && (reg2.exec(email)==null));
}

function isDate(d){
	var reg = /^[0-3][0-9].[0-1][0-9].20[0-9]{2}$/;
	return (reg.exec(d)!=null);
}
function isTime(t){
	var reg = /^[0-2][0-9]:[0-5][0-9]$/;
	return (reg.exec(t)!=null);
}
function showHide(check,l){
	if(document.getElementById){
		//for(var i=0;i<l.length;i++) document.getElementById(l[i]).style.visibility=(check.checked)?'hidden':'visible';
		for(var i=0;i<l.length;i++) document.getElementById(l[i]).style.display=(check.checked)?'none':'inline';
	}
}

function hideShow(check,l){
	if(document.getElementById){
		//for(var i=0;i<l.length;i++) document.getElementById(l[i]).style.visibility=(check.checked)?'visible':'hidden';
		for(var i=0;i<l.length;i++) document.getElementById(l[i]).style.display=(check.checked)?'inline':'none';
	}
}

// entfernt Rahmen um Links in IE5+
function cl(o){
	if(o.blur)o.blur();
}

function m(d,n){
	location.href='mai'+'lto'+':'+n+unescape('%40')+d;
	return false;
}

/*
 * This is the function that actually highlights a text string by
 * adding HTML tags before and after all occurrences of the search
 * term. You can pass your own tags if you'd like, or if the
 * highlightStartTag or highlightEndTag parameters are omitted or
 * are empty strings then the default <font> tags will be used.
 */
function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag)
{
  // the highlightStartTag and highlightEndTag parameters are optional
  if ((!highlightStartTag) || (!highlightEndTag)) {
    highlightStartTag = "<span class='hilite'>";
    highlightEndTag = "</span>";
  }

  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();

  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
          bodyText = bodyText.substr(i + searchTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }
  return newText;
}


/*
 * This is sort of a wrapper function to the doHighlight function.
 * It takes the searchText that you pass, optionally splits it into
 * separate words, and transforms the text on the current web page.
 * Only the "searchText" parameter is required; all other parameters
 * are optional and can be omitted.
 */
function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
  if (treatAsPhrase) {
    searchArray = [searchText];
  } else {
    searchArray = searchText.split(" ");
  }

  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    if (warnOnFailure)
      alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
    return false;
  }

  var bodyText = document.body.innerHTML;
  for (var i = 0; i < searchArray.length; i++) {
    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
  }

  document.body.innerHTML = bodyText;
  return true;
}

// **********************************************************************
// Progress-Upload
// **********************************************************************
function popUp(mypage, myname, w, h, scroll, titlebar){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=false';
	var win = window.open(mypage, myname, winprops);
	if (win.window.focus) win.window.focus();
}

function post_data(tForm){
	return true; // deactivated
	
	var fn = '';
	var n = 0; // files.length
	for (var i=0;i<tForm.elements.length;i++)
		if (tForm.elements[i].type=='file'&&tForm.elements[i].value!='') {
			fn = tForm.elements[i].value;
			fn = fn.split('/').pop().split('\\').pop();
			n++;
		}

	if (n>0){

		// OPEN PROGRESS BAR POPOP
		var uid = tForm.uid.value;
		var baseUrl = tForm.post_location.value;
		var upload_script = tForm.upload_script.value;
		//var max_upload = tForm.MAX_FILE_SIZE.value;

		baseUrl += "?uid=" + uid;
		baseUrl += "&fn=" + (n>1 ? 'n:'+n : fn); //files[0]);
	
		popUp(baseUrl,"Uploader",460,130,false,false);
		
		// CHANGE ACTION
		tForm.upload_type.value = '2';
		tForm.action = '/upload.cgi?uid='+uid+'&upload_script='+upload_script; //+'&max_upload='+max_upload;
	}
	
	tForm.submit();
	return false;
}

var _id = document.getElementById;