var requestResetPassword = siteUrl + 'requestResetPassword';
function forgotPassword(){
	Ext.QuickTips.init();

  //document.getElementById('flash_detect').style.visibility = 'hidden';
	var popup;
	var spot = new Ext.Spotlight({
			        easing: 'easeOut',
			        duration: .3
			    });

		popup = new Ext.Window({
			id: 'popup',
			width: 360,
			height: 160,
			title: 'Reset Password Request Window', 
			layout:'absolute',
    	resizable: false,
			hideBorders : false,
			closable: false,
			shadow: true,
			shadowOffset: 10,
			items:[
				new Ext.FormPanel({
					id:'simpleForm',
					x:28,
					y:32,
							border: false,
					items:[
						new Ext.form.TextField({
							id:'login',
							fieldLabel: 'Email Address', 
							blankText : 'Please input the email address here',
							label: 'Email Address',
							vtype:'email',
							width:180,
							allowBlank:false
						})
					]
				})
			],
			buttons:[{
				text:"Reset Password",
				handler: function(){
					Ext.ComponentMgr.get('simpleForm').getForm().submit({url:requestResetPassword, 
                                                               waitMsg:'Sending Email...',
                                                               success: function(){
                                                               	Ext.Msg.alert('Reset Password', 
                                                               	              'Please check ' + Ext.ComponentMgr.get('login').getValue() + ' to reset your password.<br> You may also need to check your junk mailfolder.',
                                                               	              function(){closeWindow();});
                    																					 },
                    																					 failure: function(){
                    																					 		alert('failed');
                    																					 }
																														});
				}
			},
			{
				text:"Cancel",
				handler: closeWindow
			}
			]
		});
		
		popup.show(document.body);
		
    spot.show('popup');	
    
	
  
  function closeWindow(){
					popup.close();
					spot.destroy();
  }
}
