function reset_pass() {
	document.oslogin.txtPassword.value='';
}

function InitForm() {
	if (document.cookie) {
		var start = document.cookie.indexOf("useraccount=");
		if (start == -1) return false;
		var tmp = document.cookie.substring(start + 15, document.cookie.length);
		var ende = tmp.indexOf(";");
		if (ende == -1)
			ende = tmp.length;
		document.oslogin.txtUsername.value = tmp.substring(0, ende);
	}
}

function SetCookie() {
	var username = escape(document.oslogin.txtUsername.value.replace(/\s+/g,""));
	if(username==''){
		alert('Bitte geben Sie Ihr Kundennummer ein.');
		document.oslogin.txtUsername.focus();
		return false;
	}
	var passwd = document.oslogin.txtPassword.value.replace(/\s+/g,"");
	if(passwd==''){
		alert('Bitte geben Sie Ihr Kundenkennwort ein.');
		document.oslogin.txtPassword.focus();
		return false;
	}

	var jetzt = new Date();
	var ablauf = new Date(jetzt.getTime() + (365 * 24 * 60 * 60 * 1000));
	var user_id = "%3B"+username;
	var user_id = user_id.replace(/-/,"%2D");
	document.cookie = "useraccount="+user_id+"; expires=" + ablauf.toGMTString()+";domain=netcologne.de";
	document.oslogin.submit();
	window.setTimeout("reset_pass()",50);
	return false;
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

// Set window.name for proper site map urls
addLoadEvent(function() {self.window.name="main";});
