function recall(){
				location.reload();
}
var loginRules = {
	'#loginbtn': function(el){
	   el.onclick = function(){
	   Engine.setStatus('<img src="/images/ajax_ind/indicator_medium.gif" alt="Lade" /><br/>Versuche Einzuloggen...');
	   hash = MD5(document.login.password.value);
	   var str =  'username=' + document.login.username.value + '&';
			str += 'passwordh=' + hash ;

			var url = 'http://www.work8.de/app/user/login?action=check';
			createRequest();
			request.open('POST', url);
			request.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=ISO-8859-1');
			request.send(str);
			to = window.setTimeout("recall()", 7000);
			
			
			request.onreadystatechange = function ()
			{
			if (request.readyState == 4)
				{
	                if(request.responseText != 'true')
					{
						window.clearTimeout(to);
						Engine.hideStatus();
						Engine.setValidation(request.responseText);
					}else{
						window.clearTimeout(to);
						window.location = "http://www.work8.de/app/user/internal";
					}
				}
			};

	  	}
	},
    '#loginfrm':function(el)
    {
        el.onsubmit = function()
	       {
	       Engine.setStatus('<img src="/images/ajax_ind/indicator_medium.gif" alt="Lade" /><br/>Bitte Warten...');
	       this.passwordh.value = MD5(this.password.value);
           this.password.value = "";
           }
    },
    '.smallbutton':function(el)
    {
        el.onmouseover = function(){
            this.style.backgroundPosition = "0 -25px";
        }
        el.onmouseout = function(){
            this.style.backgroundPosition = "top left";
        }
    },
    '.button':function(el)
    {
        el.onmouseover = function(){
            this.style.backgroundPosition = "0 -35px";
        }
        el.onmouseout = function(){
            this.style.backgroundPosition = "top left";
        }
    }
}
Behaviour.register(loginRules);
