Ext.ns("feyaSoft.oilAccount.share.search");feyaSoft.oilAccount.share.search.LoginWin=function(){var hideValue=new Ext.form.Hidden({id:"spring-security-redirect",value:"/login/ajaxSuccess"});var username=new Ext.form.TextField({name:"j_username",allowBlank:false,fieldLabel:"Email",vtype:"email",minLength:4,blankText:"Example: yourname@yourcompany.com",emptyText:"Example: yourname@yourcompany.com",anchor:"98%"});var password=new Ext.form.TextField({fieldLabel:"Password",allowBlank:false,inputType:"password",name:"j_password",minLength:2,anchor:"98%"});this.forgetLabel=new Ext.form.Label({text:"Forgot your password?",style:"padding: 0px 0px 0px 75px; cursor:pointer;",listeners:{render:function(c){c.getEl().on("click",function(){new feyaSoft.oilAccount.share.search.PasswordWin()},c)}},anchor:"90%"});this.loginForm=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:70,width:430,frame:false,defaultType:"textfield",url:"j_spring_security_check",items:[hideValue,username,password,this.forgetLabel]});this.playPanel=new Ext.Panel({region:"center",border:false,html:'<a href="http://www.oilaccount.com/home.html" TARGET=_BLANK><img src="images/startPlay.jpg"></a>'});this.wholePanel=new Ext.Panel({baseCls:"x-panel-mc",items:[{border:false,height:25,html:'<div style="font-size: 12px">Sign-in to your OilAccount using your email address and password</div>'},{border:false,height:67,layout:"border",items:[{border:false,region:"west",width:450,items:[this.loginForm]},this.playPanel]},{border:false,height:75,html:'<hr size="1" color="grey"/><div style="font-size: 12px; padding: 5px 0px 5px 0px">Create your FREE OilAccount <a STYLE="text-decoration:none" href="signup" TARGET=_BLANK>Sign Up</a><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a STYLE="text-decoration:none" href="Advertise.html" TARGET=_BLANK>Advertise</a>&nbsp;&nbsp;&nbsp;&nbsp;<a STYLE="text-decoration:none" href="Contact.html" TARGET=_BLANK>Contact Us</a>&nbsp;&nbsp;&nbsp;&nbsp;<a STYLE="text-decoration:none" href="Terms.html" TARGET=_BLANK>Legal</a></div>'}]});feyaSoft.oilAccount.share.search.LoginWin.superclass.constructor.call(this,{title:"Sign in",iconCls:"lock",width:550,height:250,minWidth:500,minHeight:200,layout:"fit",bodyStyle:"padding:10px 10px 10px 15px;",buttonAlign:"right",shim:false,animCollapse:false,constrainHeader:true,items:[this.wholePanel],resizable:false,keys:{key:[13],fn:this.loginFn,scope:this},buttons:[{text:"Close",handler:function(){this.close()},scope:this},{text:"Sign In",handler:this.loginFn,scope:this}]});this.show()};Ext.extend(feyaSoft.oilAccount.share.search.LoginWin,Ext.Window,{loginFn:function(){if(this.loginForm.form.isValid()){this.loginForm.form.submit({waitMsg:"Processing",method:"POST",failure:function(form,action){Ext.Msg.alert("Login Failed","Username or password are incorrect - please try again")},success:function(form,action){if(action.result.success=="true"){window.location.href="myAccount"}else{Ext.Msg.alert("Login Failed","Username or password are incorrect - please try again")}},scope:this})}else{Ext.MessageBox.alert("Errors","Please fix the errors noted.")}}});feyaSoft.oilAccount.share.search.PasswordWin=function(){Ext.QuickTips.init();Ext.form.Field.prototype.msgTarget="side";var email=new Ext.form.TextField({fieldLabel:"Email",name:"email",vtype:"email",emptyText:"Enter your sign in email address",maxLength:100,allowBlank:false,anchor:"90%"});this.formPanel=new Ext.form.FormPanel({id:"formPanel",baseCls:"x-plain",labelWidth:50,frame:false,url:"../publicsearch/forgetPw",defaultType:"textfield",bodyStyle:"padding: 0px 0px 0px 30px;",items:[email]});this.forgetPanel=new Ext.Panel({layout:"border",baseCls:"x-panel-mc",items:[{border:false,bodyStyle:"padding: 5px 8px 20px 8px;",region:"north",html:'<div style="font-size:small">Forgot your password? Enter your sign-in email below. We will send you a temporary password to your email.</div>'},{region:"center",border:false,layout:"fit",autoHeight:true,items:[this.formPanel]}]});feyaSoft.oilAccount.share.search.PasswordWin.superclass.constructor.call(this,{title:"Forget your password?",layout:"fit",width:450,height:180,modal:true,items:[this.forgetPanel],buttons:[{text:"Cancel",handler:function(){this.close()},scope:this},{handler:function(){if(this.formPanel.form.isValid()){this.formPanel.form.submit({waitMsg:"Processing",failure:function(form,action){Ext.MessageBox.alert("Error Message",action.result.info)},success:function(form,action){if(action.result.success=="true"){Ext.MessageBox.alert("Success Message",action.result.info);this.close()}else{Ext.MessageBox.alert("Error Message",action.result.info)}},scope:this})}else{Ext.MessageBox.alert("Errors","Please fix the errors noted.")}},scope:this,text:"Send"}]});this.show()};Ext.extend(feyaSoft.oilAccount.share.search.PasswordWin,Ext.Window,{});
