function login(){

	var loginWin = new ljex.FormWindow({
		title: cms.version+' - LOGIN',
		id: 'loginWindow',
		width: 'auto',
//		height: 230,
//		contentBgColor: '#e0e0e0',
		parentId: 'page',
		center: true,
		focusOpacity: false,

		form: {
			id: 'loginForm',
			width: 340,
			style: 'background-image: url("../images/login_cms3.jpg");height: 161px;',
			footerStyle: 'margin-top:0px;background-color:transparent;border-width:0px;',
			labelStyle:'color:#000;font-weight:bold;margin-left:20px;',
		//	icon: '/files/images/icons/contact_mail.png',
		//	renderTo: 'loginWindow-content',
			labelWidth: 80,
			url: '/index.php5?action=login',
			// veranlasst den FormController dazu KEINE custom session beim 
			// rendern der Form zu starten, sondern normales session_start() auszuführen
			cmsLogin: true, 
			onrender: function(){
				$('log').setAttribute("autocomplete","on");
			},
					
			items: [{
				xtype: 'html',
				id: 'hmpf',
				html: '<img src="/images/icons/luna_64x64.png" style="float:left;margin: 10px 0px 10px 15px"><div style="font-weight:bold;font-size:14px;padding-top:25px;"><center><i>Willkommen auf <br>'+location.hostname+'</i></center></div><div style="clear:left"></div>'
			},{
				xtype: 'textfield',
				label: 'Benutzer',
				style: 'margin-top:0px;',
				id: 'log',
				width: 200
			},{
				xtype: 'textfield',
				label: 'Passwort',
				type: 'password',
				id: 'passwd',
				handler: {
					"keypress": function(e){
						if(ljex.isIE()) var keycode = event.keyCode;
						else var keycode = e.which;
						if(keycode==13){
							$("btnLogin").onclick();
						}
					}
				},
				width: 200
			}],

			onrender: function(){
				$('log').focus();
			},


			buttons:[{
				text: 'Login',
				id: 'btnLogin',
				submit: 'ajax',
				handler: function(response){
				var data=eval("("+response.responseText+")");
					var sperre=false;

					if(($('log').value!="tschweda" && $("log").value!="ddemmer") && sperre){
						new ljex.Ajax({
							url: '/index.php5?action=logout',
							method: 'GET',
							scope: this,
							callback: function(response,scope){ 
								data = JSON.parse(response.responseText);
								$warn("Das CMS ist z.Z. wegen Wartungsarbeiten gesperrt... In dringenden Fällen 277 wählen. Danke!");
							}
						}).request();
					}else{
						if(data['success']){
							if(!data['hasLoggedOut']){
								alert("Sie haben sich bei Ihrem letzten Besuch nicht ausgeloggt. Dies ist ein Sicherheitsrisiko. Bitte denken Sie daran sich diesmal ordnungsgemäß abzumelden. Vielen Dank!");
							}
							loginWin.close();
							var msgWin = new ljex.MessageBox({
								title: 'Login & Find Out',
								msg: '<center><b>Starte LunaCMS...</b><br><img id="patience" src="/images/nlsend.gif"></center>',
								type: ljex.MessageBox.STATUS
							});
							$('patience').onload= function(){ 
								location.href='/index.php5';
							}
						}else{
							if(data['sperre']){
								$error("Sie haben sich 3x nicht ausgeloggt. Dies hat eine Sperrung Ihres Accounts zur Folge. Wenden Sie sich bitte an Timo oder Daniel um die Sperre wieder aufzuheben.");
							}else{
								$error("<div style='float:left;margin-right:6px;margin-top:20px;'><b>Benutzername oder Passwort falsch!</b></div><img src='images/polizei.jpg' />");
							}
						}
					} 
				}
			},{
				text: 'Passwort anfordern',
				id: 'btn_pass',
				handler: function(){
				}
			}]
		}
	});
	
	loginWin.open();

//	loginForm.render();

}

