<!--


	// Führende Leerzeichen entfernen
	function LTrim(str)
	 {
		var whitespace = new String(" \t\n\r");
	
		var s = new String(str);
	
		if (whitespace.indexOf(s.charAt(0)) != -1)
		 {
			 // We have a string with leading blank(s)...
	
			 var j=0, i = s.length;
	
			 // Iterate from the far left of string until we
			 // don't have any more whitespace...
			 while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
				  j++;
	
			 // Get the substring from the first non-whitespace
			 // character to the end of the string...
			 s = s.substring(j, i);
		 }
	
		return s;
	 }
	
	
	// Nachfolgende Leerzeichen entfernen
	function RTrim(str)
	 {
		// We don't want to trip JUST spaces, but also tabs,
		// line feeds, etc.  Add anything else you want to
		// "trim" here in Whitespace
		var whitespace = new String(" \t\n\r");
	
		var s = new String(str);
	
		if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
		 {
			 // We have a string with trailing blank(s)...
	
			 var i = s.length - 1;       // Get length of string
	
			 // Iterate from the far right of string until we
			 // don't have any more whitespace...
			 while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
				  i--;
	
			 // Get the substring from the front of the string to
			 // where the last non-whitespace character is...
			 s = s.substring(0, i+1);
		 }
	
		return s;
	 }
	
	
	// Führende und nachfolgende Leerzeichen entfernen
	function Trim(str)
	 {
		return RTrim(LTrim(str));
	 }
	
	
	// substring von [start] bis [start+len]
	function Mid(str, start, len)
	 {
		// Make sure start and len are within proper bounds
		if (start < 0 || len < 0) return "";
		
		var iEnd, iLen = String(str).length;
	
		if (start + len > iLen) iEnd = iLen;
		else iEnd = start + len;
		
		return String(str).substring(start,iEnd);
	 }
	
	
	// String mit [anz] Leerzeichen zurückgeben
	function setSpace(anz)
	 {
		var space_str = "";
		for (var i=1; i<=anz; i++)
		 {
			space_str += " ";
		 }
		return space_str; 
	 }


	// eMail-Adresse gültig ?
	function isValidEmail(email)
	 { 
		var validFlag = false;

		if ( (email != "") && (email.indexOf("@") != -1) && (email.indexOf(".") != -1) )
		 {
			var atCount = 0;
			var specialFlag = false;
			
			for (var atLoop=0; atLoop<email.length; atLoop++)
			 {
				atChr = email.charAt(atLoop);
				atChrCode = atChr.charCodeAt(0);
				
				if (atChr == "@") atCount++;
				if ( (atChrCode >= 32) && (atChrCode <= 44) ) specialFlag = true;
				if ( (atChrCode == 47) || (atChrCode == 96) || (atChrCode >= 123) ) specialFlag = true;
				if ( (atChrCode >= 58) && (atChrCode <= 63) ) specialFlag = true;
				if ( (atChrCode >= 91) && (atChrCode <= 94) ) specialFlag = true;
			 }
			
			if ( (atCount == 1) && (!specialFlag) )
			 {
				var badFlag = false;
				
				var tAry1 = new Array();
				tAry1 = email.split("@");
				var UserName = tAry1[0];
				var DomainName = tAry1[1];
				
				if ( (UserName == "") || (DomainName == "") ) badFlag = true;
				if (DomainName.charAt(0) == ".") badFlag = true;
				if (Mid(DomainName, DomainName.length-1, 1) == ".") badFlag = true;
				
				validFlag = true;
			 }
		 }

		if (badFlag) validFlag = false;
		
		return validFlag;
	} 

-->

