function Detail(seite, titel) {
        var fenster = window.open("/standard/detail_popup.php?seite=" + seite + "&titel="+titel,titel,"width=460,height=400,scrollbars=yes,location=no,status=no,resizable=yes");
    }
    
function clearField(obj, defText)
{
    if( $F(obj) == defText )
    {
        $(obj).value = '';
    }
    return true;
}


function checkEmail(emailAddr) {
    // this function checks for a well-formed e-mail address
    // in the format:
    // user@domain.com

    var i;

    // check for @
    i = emailAddr.indexOf("@");
    if (i == -1) {
        return false;
    }

    // separate the user name and domain
    var username = emailAddr.substring(0, i);
    var domain = emailAddr.substring(i + 1, emailAddr.length)

    // look for spaces at the beginning of the username
    i = 0;
    while ((username.substring(i, i + 1) == " ") && (i < username.length)) {
        i++;
    }
    // remove any found
    if (i > 0) {
        username = username.substring(i, username.length);
    }

    // look for spaces at the end of the domain
    i = domain.length - 1;
    while ((domain.substring(i, i + 1) == " ") && (i >= 0)) {
        i--;
    }
    // remove any found
    if (i < (domain.length - 1)) {
        domain = domain.substring(0, i + 1);
    }

    // make sure neither the username nor domain is blank
    if ((username == "") || (domain == "")) {
        return false;
    }

    // check for bad characters in the username
    var ch;
    for (i = 0; i < username.length; i++) {
        ch = (username.substring(i, i + 1)).toLowerCase();
        if (!(((ch >= "a") && (ch <= "z")) ||
            ((ch >= "0") && (ch <= "9")) ||
            (ch == "_") || (ch == "-") || (ch == "."))) {
                return false;
        }
    }

    // check for bad characters in the domain
    for (i = 0; i < domain.length; i++) {
        ch = (domain.substring(i, i + 1)).toLowerCase();
        if (!(((ch >= "a") && (ch <= "z")) ||
            ((ch >= "0") && (ch <= "9")) ||
            (ch == "_") || (ch == "-") || (ch == "."))) {
                return false;
        }
    }

    // check for . in domain (AVS)
    p = domain.indexOf(".");
    if (p == -1) {
        return false;
    }

    return true;
}


function kopie(obj, ziel)
{
    if( checkEmail($F(obj)) )
    {
      $(ziel).checked = true;
    } else
    {
      $(ziel).checked = false;
    }
}

function noError(obj)
{
	if ( $(obj).getStyle('backgroundColor') == "rgb(245, 239, 142)" )
	{
		$(obj).setStyle( {backgroundColor:'white'} );
		errCount--;
	}
	
	if ( errCount == 0 && $('error_message') != null )
	{
		eff = Effect.BlindUp( $('error_message'), {duration:0.3} );
	}
	
/*
  $(obj).setStyle( {border:'none'} );
  $(obj).setStyle( {margin:'0.2em 0 0.3em 0'} );
  $(obj).setStyle( {padding:'0'} );
*/
}

/*
border:1px solid rgb(94,79,54);
  padding:2px;
  font-size:105%;
  background-color:rgb(171,0,9);
  color:white;
  font-weight:bold;
*/