Ext.ns("feyaSoft.main");feyaSoft.main.AboutUsPanel=function(){this.upPanel=new Ext.Panel({region:"center",layout:"fit",autoScroll:true,border:false,autoLoad:{url:"html/aboutUs/main.html",scripts:true}});this.dataStore=new Ext.data.JsonStore({url:"utilImages/listImages",baseParams:{myBelong:"mainFeatures"},remoteSort:true,fields:[]});this.dataStore.load();var tpl=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="{id}">','<div class="thumb"><img style="width:250px;height:120px;" src="{[this.getpath(values.imagepath)]}" title="{name}"></div>','<span class="x-editable">{name}</span></div>',"</tpl>",'<div class="x-clear"></div>',{getpath:function(imagepath){if(!imagepath){imagepath=Ext.BLANK_IMAGE_URL}return imagepath}});this.featureView=new Ext.DataView({style:"padding:20px",singleSelect:true,store:this.dataStore,tpl:tpl,autoHeight:true,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",emptyText:"No pages to display",prepareData:function(data){data.name=Ext.util.Format.ellipsis(data.name,50);return data}});this.featureView.on("click",this.onFeatureClickFn,this);this.customerStore=new Ext.data.JsonStore({url:"utilImages/listImages",baseParams:{myBelong:"customer"},remoteSort:true,fields:[]});this.customerStore.load();this.customertpl=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="{id}">','<div class="thumb"><img style="width:220px;height:105px;" src="{[this.getpath(values.imagepath)]}" title="{name}"></div>','<span class="x-editable">{name}</span></div>',"</tpl>",'<div class="x-clear"></div>',{getpath:function(imagepath){if(!imagepath){imagepath=Ext.BLANK_IMAGE_URL}return imagepath}});this.customerView=new Ext.DataView({style:"padding:10px",singleSelect:true,store:this.customerStore,tpl:this.customertpl,autoHeight:true,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",prepareData:function(data){data.name=Ext.util.Format.ellipsis(data.name,50);return data}});this.customerView.on("click",this.onCustomerClickFn,this);this.loginPanel=new feyaSoft.main.LoginPanel();this.customerDataStore=new Ext.data.JsonStore({url:"customerInfo/listImages",remoteSort:true,fields:[]});this.customerDataStore.load();var customerTpl=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="{id}">','<div class="thumb"><img style="width:120px;height:60px;" src="{[this.getpath(values.imagepath)]}" title="{company}"></div>','<span class="x-editable">{company}</span></div>',"</tpl>",'<div class="x-clear"></div>',{getpath:function(imagepath){if(!imagepath){imagepath=Ext.BLANK_IMAGE_URL}return imagepath}});this.customerInfoView=new Ext.DataView({style:"padding:10px",singleSelect:true,store:this.customerDataStore,tpl:customerTpl,autoHeight:true,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",emptyText:"No pages to display",prepareData:function(data){data.name=Ext.util.Format.ellipsis(data.name,50);return data}});this.customerInfoView.on("click",this.onLicenseCustomerClickFn,this);this.downTabPanel=new Ext.TabPanel({region:"south",tabPosition:"bottom",activeTab:0,deferredRender:false,layoutOnTabChange:true,height:350,split:true,resizeTabs:true,tabWidth:250,minTabWidth:120,plugins:new Ext.ux.TabCloseMenu(),items:[{title:"Our Products",iconCls:"application",closable:false,autoScroll:true,layout:"border",border:false,items:[{region:"center",cls:"feyasoft-images-view",autoScroll:true,border:false,items:[this.featureView]},this.loginPanel]},{title:"Who's using our Products",iconCls:"wrench",closable:false,autoScroll:true,layout:"fit",border:false,cls:"feyasoft-images-view",items:[this.customerInfoView]}]});feyaSoft.main.AboutUsPanel.superclass.constructor.call(this,{region:"center",layout:"border",border:false,items:[this.upPanel,this.downTabPanel]})};Ext.extend(feyaSoft.main.AboutUsPanel,Ext.Panel,{onCustomerClickFn:function(dv,index,node,e){var rd=dv.store.getAt(index);var data=rd.data;var name=data.name;if(name=="OilAccount"){window.open("http://www.oilaccount.com","_blank","")}},onFeatureClickFn:function(dv,index,node,e){var rd=dv.store.getAt(index);var data=rd.data;var name=data.name;if(name=="FeyaSoft MyCalendar"){window.location="myCalendar"}else{Ext.Msg.show({title:"About "+name,msg:"To view the detail of "+name+", please sign in our account or login as Guest for quick view.",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO})}},openFeaturePanel:function(data){var tab=Ext.getCmp("feature_"+data.id);if(tab){this.upTabPanel.remove(tab)}var newtab=new Ext.Panel({id:"feature_"+data.id,title:data.name,closable:true,autoScroll:true,layout:"fit",border:false,autoLoad:{url:"html/features/"+data.id+".html",scripts:true}});this.upTabPanel.add(newtab);this.upTabPanel.setActiveTab(newtab)},onLicenseCustomerClickFn:function(dv,index,node,e){var rd=dv.store.getAt(index);var data=rd.data;var url=data.url;var company=data.company;if(url!=null&&url.length>0){window.open(url,"_blank","")}else{Ext.Msg.show({title:"About "+company,msg:"Sorry this customer did not provide their company URL",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO})}}});