function submitLogin() {
	alert("submit");
}


function LostPassword(url) {
	parent.location.href = url+"&username="+document.loginform.username.value;
}

function checkLogin(feld) {
	if(!self.event) return;
	if(event.keyCode==13) {
		document.loginform.submit();
	}
}

function stayLoggedIn(name,value,path,domain,secure) {
	var expiretime = new Date();
	var days = expiretime.getTime() + (500 * 24 * 60 * 60 * 1000);
	expiretime.setTime(days);

	var cookieString = name + "=" +escape(value) + 
		((expiretime) ? ";expires=" + expiretime.toGMTString() : "") + 
       	((path) ? ";path=" + path : "") + 
       	((domain) ? ";domain=" + domain : "") + 
       	((secure) ? ";secure" : "");
   	document.cookie = cookieString;
}


function checkStayLoggedIn(name,redirect) {
	var dc = document.cookie;
   	var start = document.cookie.indexOf(name+"="); 
   	var len = start+name.length+1; 
	
   	if ((!start) && (name != document.cookie.substring(0,name.length))) {
	} else {
	   	if (start == -1) {
		} else {
		   	var end = document.cookie.indexOf(";",len); 
		   	if (end == -1) end = document.cookie.length; 
		   	var code = unescape(document.cookie.substring(len,end)); 
		
			parent.location.href=redirect+code;
		}
	}
}

function deleteStayLoggedIn(name, path, domain ) {
	if(document.cookie) document.cookie = name + "=" +
		( ( path ) ? ";path=" + path : "") +
		( ( domain ) ? ";domain=" + domain : "" ) +
		";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function CheckPassword(url,passwd) {
	if(passwd.length<6) {
		document.getElementById("check1").src = url+"passwortcheck_1.gif";
		document.getElementById("check2").src = url+"passwortcheck_1.gif";
		document.getElementById("check3").src = url+"passwortcheck_1.gif";
		document.register.password_securelevel.value = "1";
	} else {
		var containsnr = 0;
		
		for(i=0; i<(passwd.length); i++) {
			var s = passwd.substr(i,1);
			if(s=="0" || s=="1" || s=="2" || s=="3" || s=="4" || s=="5" || s=="6" || s=="7" || s=="8" || s=="9") containsnr = 1;
		}
		if(containsnr==0) {
			document.getElementById("check1").src = url+"passwortcheck_2.gif";
			document.getElementById("check2").src = url+"passwortcheck_2.gif";
			document.getElementById("check3").src = url+"passwortcheck_2.gif";
			document.register.password_securelevel.value = "2";
		} else {
			document.getElementById("check1").src = url+"passwortcheck_3.gif";
			document.getElementById("check2").src = url+"passwortcheck_3.gif";
			document.getElementById("check3").src = url+"passwortcheck_3.gif";
			document.register.password_securelevel.value = "3";
		}
	}
}







function ajax() {
   //---------------------
   // private declarations
   //---------------------
   var _request = null;
   var _this = null;
       
   //--------------------
   // public declarations
   //--------------------
   this.GetResponseXML = function() {
      return (_request) ? _request.responseXML : null;
   }
       
   this.GetResponseText = function() {
      return (_request) ? _request.responseText : null;
   }
       
   this.GetRequestObject = function() {
      return _request;
   }
       
   this.InitializeRequest = function(method, uri) {
      _InitializeRequest();
      _this = this;
               
      switch (arguments.length) {
         case 2:
            _request.open(method, uri);
            break;
                               
         case 3:
            _request.open(method, uri, arguments[2]);
            break;
      }
               
      if (arguments.length >= 4) _request.open(method, uri, arguments[2], arguments[3]);
      this.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
   }
       
   this.SetRequestHeader = function(Field, Value) {
      if (_request) _request.setRequestHeader(Field, Value);
   }
       
   this.Commit = function(data) {
      if (_request) _request.send(data);
   }
       
   this.Close = function() {
      if (_request) _request.abort();
   }
       
   //---------------------------
   // Public Event Declarations.
   //---------------------------
   this.OnUninitialize = function() { };
   this.OnLoading = function() { };
   this.OnLoaded = function() { };
   this.OnInteractive = function() { };
   this.OnSuccess = function() { };
   this.OnFailure = function() { };
       
   //---------------------------
   // Private Event Declarations
   //---------------------------
   function _OnUninitialize() { _this.OnUninitialize(); };
   function _OnLoading() { _this.OnLoading(); };
   function _OnLoaded() { _this.OnLoaded(); };
   function _OnInteractive() { _this.OnInteractive(); };
   function _OnSuccess() { _this.OnSuccess(); };
   function _OnFailure() { _this.OnFailure(); };
   //------------------
   // Private Functions
   //------------------
   function _InitializeRequest() {
      _request = _GetRequest();
      _request.onreadystatechange = _StateHandler;
   }
       
   function _StateHandler() {
      switch (_request.readyState) {
         case 0:
            window.setTimeout("void(0)", 100);
            _OnUninitialize();
            break;
                               
         case 1:
            window.setTimeout("void(0)", 100);
            _OnLoading();
            break;
                               
         case 2:
            window.setTimeout("void(0)", 100);
            _OnLoaded();
            break;
                       
         case 3:
            window.setTimeout("void(0)", 100);
            _OnInteractive();
            break;
                               
         case 4:
            if (_request.status == 200)
               _OnSuccess();
            else
               _OnFailure();
                                       
            return;
            break;
      }
   }
       
	function _GetRequest() {
		var obj;
               
		if(window.XMLHttpRequest) {
			obj = new XMLHttpRequest();
			if(obj.overrideMimeType) {
				obj.overrideMimeType("text/xml");
			}
		} else if(window.ActiveXObject) {
			try {
				obj = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
					obj = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
					return null;
				}
			}
		}
		return obj;
	}
}



