function getChangePwdForm(){
	var login = new Ext.FormPanel({ 
	       labelWidth:120,
	       url:'member.php?progress=changePassword', 
	       frame:true, 
	       title:'Şifre Değiştir', 
	       width:270, 
	       padding:240, 
	       defaultType:'textfield',
		   monitorValid:true,
	       items:[{ 
	               fieldLabel:'Eski Şifreniz', 
	               name:'oldPassword',
	               inputType:'password',
	               width:200,
	               allowBlank:false 
	           },{ 
	               fieldLabel:'Yeni Şifreniz', 
	               name:'newPassword1',
	               inputType:'password',
	               width:200,
	               allowBlank:false 
	           },
	           { 
	               fieldLabel:'Yeni Şifreniz Tekrar',
	               width:200, 
	               name:'newPassword2', 
	               inputType:'password', 
	               allowBlank:false 
	           },{ 
				   xtype:'label',
				   style:'color:red',
	               text:'Şifreniz en az 6, en fazla 14 karakter uzunluğunda olabilir.', 
	               width:200
	           }],
	       buttons:[{ 
	               text:'Şifre Değiştir',
	               formBind: true,	 
	               // Function that fires when user clicks the button 
	               handler:function(){ 
	                   login.getForm().submit({ 
	                       method:'POST', 
	                       waitTitle:'Bağlanıyor', 
	                       waitMsg:'Şifreniz değiştiriliyor, lütfen bekleyiniz...',
	
	                       success:function(){ 
	                       	Ext.Msg.alert('Durum', 'Tebrikler, şifreniz başarıyla değiştirildi', function(btn, text){
								   if (btn == 'ok'){ win.close();}
							        });
	                       },
	                       failure:function(form, action){ 
	                           if(action.failureType == 'server'){ 
	                               obj = Ext.util.JSON.decode(action.response.responseText); 
	                               Ext.Msg.alert('Şifre Değiştirme Başarısız!', obj.errors.reason); 
	                           }else{ 
	                               Ext.Msg.alert('Uyarı!', 'Sunucuya ulaşılamıyor : ' + action.response.responseText); 
	                           } 
	                           login.getForm().reset(); 
	                       } 
	                   }); 
	               } 
	           },
	           {text:'Kapat',handler:function (){win.close();}}
	           ] 
	   });
	
	
	// This just creates a window to wrap the login form. 
	// The login object is passed to the items collection.       
	   var win = new Ext.Window({
	       layout:'fit',
	       modal:true,
	       width:370,
	       height:190,
	       closable: false,
	       plain: true,
	       items: [login]
	});
	
	return win;
}

function getLoginForm(){
	var login = new Ext.FormPanel({ 
	       labelWidth:80,
	       url:'login.php', 
	       frame:true, 
	       title:'Giriş', 
	       width:270, 
	       padding:240, 
	       defaultType:'textfield',
		   monitorValid:true,
	       items:[{ 
	               fieldLabel:'Kullanıcı Adı', 
	               name:'loginUsername',
	               inputType:'textField',
	               width:200,
	               allowBlank:false 
	           },{ 
	               fieldLabel:'Şifre',
	               width:200, 
	               name:'loginPassword', 
	               inputType:'password', 
	               allowBlank:false 
	           }],
	       buttons:[{ 
	               text:'Giriş',
	               formBind: true,	 
	               // Function that fires when user clicks the button 
	               handler:function(){ 
	                   login.getForm().submit({ 
	                       method:'POST', 
	                       waitTitle:'Bağlanıyor', 
	                       waitMsg:'Giriş yapılıyor, lütfen bekleyiniz...',
	
						// Functions that fire (success or failure) when the server responds. 
						// The one that executes is determined by the 
						// response that comes from login.asp as seen below. The server would 
						// actually respond with valid JSON, 
						// something like: response.write "{ success: true}" or 
						// response.write "{ success: false, errors: { reason: 'Login failed. Try again.' }}" 
						// depending on the logic contained within your server script.
						// If a success occurs, the user is notified with an alert messagebox, 
						// and when they click "OK", they are redirected to whatever page
						// you define as redirect. 
	                       success:function(){ 
	                       	Ext.Msg.alert('Durum', 'Tebrikler, sisteme başarıyla giriş yaptınız!', function(btn, text){
								   if (btn == 'ok'){
								   				win.el.mask('Sisteme yönlendiriliyorsunuz,lütfen bekleyiniz','x-mask-loading');
						                        var redirect = 'index.php?page=operations'; 
						                        window.location = redirect;
				                                }
							        });
	                       },
	
						// Failure function, see comment above re: success and failure. 
						// You can see here, if login fails, it throws a messagebox
						// at the user telling him / her as much.  
	                       failure:function(form, action){ 
	                           if(action.failureType == 'server'){ 
	                               obj = Ext.util.JSON.decode(action.response.responseText); 
	                               Ext.Msg.alert('Giriş Başarısız!', obj.errors.reason); 
	                           }else{ 
	                               Ext.Msg.alert('Uyarı!', 'Sunucuya ulaşılamıyor : ' + action.response.responseText); 
	                           } 
	                           login.getForm().reset(); 
	                       } 
	                   }); 
	               } 
	           },
	           {text:'Kapat',handler:function (){win.close();}},
	           {text:'Şifremi Unuttum',handler:function (){getLostPwdForm().show();}}
	           ] 
	   });
	
	
	// This just creates a window to wrap the login form. 
	// The login object is passed to the items collection.       
	   var win = new Ext.Window({
	       layout:'fit',
	       modal:true,
	       width:340,
	       height:150,
	       closable: false,
	       plain: true,
	       items: [login]
	});
	
	return win;
}

function getLostPwdForm(){
	var lostPwd = new Ext.FormPanel({ 
	       labelWidth:80,
	       url:'member.php?progress=sendForgotPwdLink', 
	       frame:true, 
	       title:'Şifremi Unuttum', 
	       width:270, 
	       padding:240, 
	       defaultType:'textfield',
		   monitorValid:true,
	       items:[{ 
	               fieldLabel:'Kullanıcı Adı', 
	               name:'userName',
	               inputType:'textField',
	               width:200,
	               allowBlank:false 
	           }],
	       buttons:[{ 
	               text:'Şifremi Sıfırla',
	               formBind: true,	 
	               // Function that fires when user clicks the button 
	               handler:function(){ 
	                   lostPwd.getForm().submit({ 
	                       method:'POST', 
	                       waitTitle:'Bağlanıyor', 
	                       waitMsg:'Lütfen bekleyiniz...',
	                       success:function(){ 
	                       	Ext.Msg.alert('Durum', 'Şifre sıfırlama linki belirttiğiniz eposta adresine gönderilmiştir', function(btn, text){
								   if (btn == 'ok'){
								   				win.close();
				                                }
							        });
	                       },
	
						// Failure function, see comment above re: success and failure. 
						// You can see here, if login fails, it throws a messagebox
						// at the user telling him / her as much.  
	                       failure:function(form, action){ 
	                           if(action.failureType == 'server'){ 
	                               obj = Ext.util.JSON.decode(action.response.responseText); 
	                               Ext.Msg.alert(' Başarısız!', obj.errors.reason); 
	                           }else{ 
	                               Ext.Msg.alert('Uyarı!', 'Sunucuya ulaşılamıyor : ' + action.response.responseText); 
	                           } 
	                           lostPwd.getForm().reset(); 
	                       } 
	                   }); 
	               } 
	           },
	           {text:'Kapat',handler:function (){win.close();}}
	           ] 
	   });
	
	
	// This just creates a window to wrap the login form. 
	// The login object is passed to the items collection.       
	   var win = new Ext.Window({
	       layout:'fit',
	       modal:true,
	       width:340,
	       height:150,
	       closable: false,
	       plain: true,
	       items: [lostPwd]
	});
	
	return win;
}