Ext.onReady(function(){var e=Ext.data;var b=Ext.form;var k="/search/doSearch.php";var c=new b.FormPanel({labelWidth:80,frame:false,bodyStyle:"padding:5px 0px 0px 5px",border:false,onSubmit:Ext.emptyFn,autoScroll:true,width:628,url:k,items:[{xtype:"fieldset",title:"Search Members by Keyword",autoHeight:true,defaults:{border:false},items:[{layout:"column",defaults:{border:false,labelSeparator:" "},items:[{columnWidth:0.9,items:[{xtype:"textfield",fieldLabel:"Keywords",name:"keywords",width:120,allowBlank:false,listeners:l},{xtype:"hidden",name:"searchType",value:"keyword"}]},{columnWidth:0.1,labelSeparator:" ",items:[{xtype:"button",text:"Search",handler:function(){var o=c.getForm();
if(o.findField("keywords").getValue()==""){return}document.body.style.cursor="wait";o.getEl().dom.action=c.url;o.getEl().dom.submit()}}]}]}]}]});Ext.fly("searchByKeywords").update("");c.render("searchByKeywords");
var d=new b.FormPanel({labelWidth:80,frame:false,bodyStyle:"padding:5px 0px 0px 5px",border:false,onSubmit:Ext.emptyFn,autoScroll:true,width:628,url:k,items:[{xtype:"fieldset",checkboxToggle:false,title:"Search for Newest Members",autoHeight:true,defaults:{border:false},items:[{layout:"column",labelWidth:0,items:[{columnWidth:0.9,labelSeparator:" ",border:false,items:[{xtype:"panel",border:false,html:"&nbsp;"},{xtype:"hidden",name:"searchType",value:"newestUsers"}]},{columnWidth:0.1,labelSeparator:" ",border:false,items:[{xtype:"button",text:"Search",handler:function(){document.body.style.cursor="wait";
d.getForm().getEl().dom.action=d.url;d.getForm().getEl().dom.submit()}}]}]}]}]});document.getElementById("searchForNewestUsers").removeChild(document.getElementById("newUserBotLink"));d.render("searchForNewestUsers");
var a=new b.FormPanel({labelWidth:80,frame:false,bodyStyle:"padding:5px 0px 0px 5px",border:false,onSubmit:Ext.emptyFn,autoScroll:true,width:628,url:k,items:[{xtype:"fieldset",checkboxToggle:false,title:"Search for Online Members",autoHeight:true,defaults:{border:false},items:[{layout:"column",labelWidth:0,items:[{columnWidth:0.9,labelSeparator:" ",border:false,items:[{xtype:"panel",border:false,html:"&nbsp;"},{xtype:"hidden",name:"searchType",value:"onlineUsers"}]},{columnWidth:0.1,labelSeparator:" ",border:false,items:[{xtype:"button",text:"Search",handler:function(){document.body.style.cursor="wait";
a.getForm().getEl().dom.action=a.url;a.getForm().getEl().dom.submit()}}]}]}]}]});document.getElementById("searchForOnlineUsers").removeChild(document.getElementById("onlineUserBotLink"));a.render("searchForOnlineUsers");
var l={"specialkey":function(p,o){if(o.getKey()==o.RETURN||o.getKey()==o.ENTER){o.stopEvent()}}};var n=new b.FormPanel({labelWidth:80,frame:false,bodyStyle:"padding:5px 0px 0px 5px",border:false,onSubmit:Ext.emptyFn,autoScroll:true,width:628,url:k,items:[{xtype:"fieldset",title:"Search by User Name",autoHeight:true,defaults:{border:false},items:[{layout:"column",defaults:{border:false,labelSeparator:" "},items:[{columnWidth:0.9,items:[{xtype:"textfield",fieldLabel:"User Name",name:"userName",width:120,allowBlank:false,listeners:l},{xtype:"hidden",name:"searchType",value:"userName"}]},{columnWidth:0.1,labelSeparator:" ",items:[{xtype:"button",text:"Search",handler:function(){var o=n.getForm();
if(o.findField("userName").getValue()==""){return}document.body.style.cursor="wait";o.getEl().dom.action=n.url;o.getEl().dom.submit()}}]}]}]}]});Ext.fly("searchByUserName").update("");n.render("searchByUserName");
function m(t,p){var q=Ext.getCmp(t).getValue().split(/, ?/);var s,r="";for(var o=0;o<q.length;o++){s=p[q[o]];r+=((typeof s!="undefined")?s:q[o])+((o+1<q.length)?",":"")}return r}var j={};var f=new e.Store({url:"/search/findInterests.php",baseParams:{type:"all"},reader:new e.XmlReader({record:"int",totalRecords:"cnt",id:"id"},e.Record.create([{name:"id",type:"string"},{name:"aliasId",type:"string"},{name:"parentId",type:"string"},{name:"name",type:"string"},{name:"abbr",type:"string"}]))});
var g;var i=new b.FormPanel({labelWidth:80,frame:false,bodyStyle:"padding:5px 0px 0px 5px",border:false,onSubmit:Ext.emptyFn,autoScroll:true,width:628,url:k,items:[{xtype:"fieldset",checkboxToggle:false,title:"Detailed Search",autoHeight:true,items:[{layout:"column",border:false,defaults:{border:false,labelSeparator:" "},items:[{columnWidth:0.9,items:[{xtype:"panel",border:false,html:"&nbsp;"},{xtype:"hidden",name:"searchType",value:"withDetails"}]},{columnWidth:0.1,items:[{xtype:"button",text:"Search",handler:function(){document.body.style.cursor="wait";
var o=i.getForm();o.findField("medicalInterests").setValue(m("medicalInterestsEditor",j));i.getForm().getEl().dom.action=i.url;i.getForm().getEl().dom.submit()}}]}]},{xtype:"fieldset",layout:"column",title:"Members aged",autoHeight:true,defaults:{border:false,labelSeparator:" "},items:[{columnWidth:0.08,items:[{xtype:"numberfield",name:"minimumAge",width:"40px",fieldLabel:"",maxLength:3,allowBlank:false,allowDecimals:false,listeners:l}]},{columnWidth:0.05,items:[{xtype:"panel",border:false,html:"&nbsp;to&nbsp;&nbsp;"}]},{columnWidth:0.08,items:[{xtype:"numberfield",name:"maximumAge",width:"40px",fieldLabel:"",maxLength:3,allowBlank:false,allowDecimals:false,listeners:l}]},{columnWidth:0.1,items:[{xtype:"panel",border:false,html:"&nbsp;years&nbsp;&nbsp;"}]}]},{xtype:"fieldset",layout:"column",title:"Ethnicity",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.185,defaults:{xtype:"checkbox",name:"ethnicity[]"},items:[{id:"ethnicityField",boxLabel:"Aborigine",inputValue:"aborigine"},{boxLabel:"African",inputValue:"african"}]},{columnWidth:0.185,defaults:{xtype:"checkbox",name:"ethnicity[]"},items:[{boxLabel:"Asian",inputValue:"asian"},{boxLabel:"Caucasian",inputValue:"caucasian"}]},{columnWidth:0.185,defaults:{xtype:"checkbox",name:"ethnicity[]"},items:[{boxLabel:"European",inputValue:"european"},{boxLabel:"Indian",inputValue:"indian"}]},{columnWidth:0.26,defaults:{xtype:"checkbox",name:"ethnicity[]"},items:[{boxLabel:"Latin American",inputValue:"latinAmerican"},{boxLabel:"Native American",inputValue:"nativeAmerican"}]},{columnWidth:0.185,defaults:{xtype:"checkbox",name:"ethnicity[]"},items:[{boxLabel:"Polynesian",inputValue:"polynesian"},{boxLabel:"Other",inputValue:"other"}]}]},{xtype:"fieldset",title:"Life Style",autoHeight:true,defaults:{labelSeparator:" ",layout:"form"},items:[{xtype:"fieldset",layout:"column",title:"Education",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.32,defaults:{xtype:"checkbox",name:"education[]"},items:[{id:"educationField",boxLabel:"No High School",inputValue:"noHighSchool"},{boxLabel:"Some High School",inputValue:"someHighSchool"},{boxLabel:"High School",inputValue:"highSchool"}]},{columnWidth:0.37,defaults:{xtype:"checkbox",name:"education[]"},items:[{boxLabel:"Some College",inputValue:"someCollege"},{boxLabel:"Bachelor Degree",inputValue:"bachelorDegree"},{boxLabel:"Post Bachelor Degree",inputValue:"postBachelorDegree"}]},{columnWidth:0.31,defaults:{xtype:"checkbox",name:"education[]"},items:[{boxLabel:"School Of Life",inputValue:"schoolOfLife"}]}]},{xtype:"fieldset",layout:"column",title:"Activity Level",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.31,defaults:{xtype:"checkbox",name:"activityLevel[]"},items:[{id:"activityLevelField",boxLabel:"Inactive",inputValue:"inactive"},{boxLabel:"Active Once a Month",inputValue:"activeOnceAMonth"}]},{columnWidth:0.31,defaults:{xtype:"checkbox",name:"activityLevel[]"},items:[{boxLabel:"Active Twice a Month",inputValue:"activeTwiceAMonth"},{boxLabel:"Active Once a Week",inputValue:"activeOnceAWeek"}]},{columnWidth:0.38,defaults:{xtype:"checkbox",name:"activityLevel[]"},items:[{boxLabel:"Active a Few Times a Week",inputValue:"activeAFewTimesAWeek"},{boxLabel:"Active Daily",inputValue:"activeDaily"}]}]}]},{xtype:"fieldset",title:"Personality",autoHeight:true,defaults:{labelSeparator:" ",layout:"form"},items:[{xtype:"fieldset",layout:"column",title:"Outlook",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.25,defaults:{xtype:"checkbox",name:"outlook[]"},items:[{id:"outlookField",boxLabel:"Pessimistic",inputValue:"pessimistic"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"outlook[]"},items:[{boxLabel:"Realistic",inputValue:"realistic"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"outlook[]"},items:[{boxLabel:"Optimistic",inputValue:"optimistic"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"outlook[]"},items:[{boxLabel:"Very Optimistic",inputValue:"veryOptimistic"}]}]},{xtype:"fieldset",layout:"column",title:"Sense of Humour",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.37,defaults:{xtype:"checkbox",name:"senseOfHumour[]"},items:[{id:"humourField",boxLabel:"No Sense Of Humour",inputValue:"noSenseOfHumour"},{boxLabel:"Dry / Sarcastic",inputValue:"drySarcastic"},{boxLabel:"Black",inputValue:"black"}]},{columnWidth:0.31,defaults:{xtype:"checkbox",name:"senseOfHumour[]"},items:[{boxLabel:"Witty",inputValue:"witty"},{boxLabel:"Comical",inputValue:"comical"},{boxLabel:"Odd",inputValue:"odd"}]},{columnWidth:0.32,defaults:{xtype:"checkbox",name:"senseOfHumour[]"},items:[{boxLabel:"Cheesy",inputValue:"cheesy"},{boxLabel:"Friendly",inputValue:"friendly"}]}]}]},{xtype:"fieldset",title:"Belief System",autoHeight:true,defaults:{labelSeparator:" ",layout:"form"},items:[{xtype:"fieldset",layout:"column",title:"Religion",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.31,defaults:{xtype:"checkbox",name:"religion[]"},items:[{id:"religionField",boxLabel:"Agnostic",inputValue:"agnostic"},{boxLabel:"Atheist",inputValue:"atheist"},{boxLabel:"Buddhist",inputValue:"buddhist"},{boxLabel:"Catholic",inputValue:"catholic"},{boxLabel:"Christian",inputValue:"christian"}]},{columnWidth:0.31,defaults:{xtype:"checkbox",name:"religion[]"},items:[{boxLabel:"Hindu",inputValue:"hindu"},{boxLabel:"Jewish",inputValue:"jewish"},{boxLabel:"Lutheran",inputValue:"lutheran"},{boxLabel:"Presbyterian",inputValue:"presbyterian"},{boxLabel:"Protestant",inputValue:"protestant"}]},{columnWidth:0.38,defaults:{xtype:"checkbox",name:"religion[]"},items:[{boxLabel:"Shiite Muslim",inputValue:"shiiteMuslim"},{boxLabel:"Sikh",inputValue:"sikh"},{boxLabel:"Sunni Muslim",inputValue:"sunniMuslim"},{boxLabel:"Spiritual, not religious",inputValue:"spiritualNotReligious"},{boxLabel:"Other",inputValue:"other"}]}]},{xtype:"fieldset",layout:"column",title:"Religious Involvement",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.6,defaults:{xtype:"checkbox",name:"religiousInvolvement[]"},items:[{id:"involvementField",boxLabel:"Frequent",inputValue:"frequent"},{boxLabel:"Only On Special Occasions",inputValue:"onlyOnSpecialOccasions"}]},{columnWidth:0.4,defaults:{xtype:"checkbox",name:"religiousInvolvement[]"},items:[{boxLabel:"Rarely",inputValue:"rarely"},{boxLabel:"Never",inputValue:"never"}]}]}]},{xtype:"fieldset",title:"Indulgences",autoHeight:true,defaults:{labelSeparator:" ",layout:"form"},items:[{xtype:"fieldset",layout:"column",title:"Eating",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.5,defaults:{xtype:"checkbox",name:"eating[]"},items:[{id:"eatingField",boxLabel:"Eat Healthy at All Meals",inputValue:"eatHealthyAtAllMeals"},{boxLabel:"Eat Healthy Every Day",inputValue:"eatHealthyEveryDay"},{boxLabel:"Eat Healthy On Weekends",inputValue:"eatHealthyOnWeekends"}]},{columnWidth:0.5,defaults:{xtype:"checkbox",name:"eating[]"},items:[{boxLabel:"Eat Healthy Once in a While",inputValue:"eatHealthyOnceInAWhile"},{boxLabel:"Rarely Eat Healthy",inputValue:"rarelyEatHealthy"},{boxLabel:"Never Eat Healthy",inputValue:"neverEatHealthy"}]}]},{xtype:"fieldset",layout:"column",title:"Drinking",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.5,defaults:{xtype:"checkbox",name:"drinking[]"},items:[{id:"drinkingField",boxLabel:"Do Not Drink",inputValue:"doNotDrink"},{boxLabel:"Only On Special Occasions",inputValue:"onlyOnSpecialOccasions"},{boxLabel:"Only On Weekends",inputValue:"onlyOnWeekends"}]},{columnWidth:0.5,defaults:{xtype:"checkbox",name:"drinking[]"},items:[{boxLabel:"A Few Times a Week",inputValue:"aFewTimesAWeek"},{boxLabel:"Daily",inputValue:"daily"}]}]},{xtype:"fieldset",layout:"column",title:"Smoking",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.33,defaults:{xtype:"checkbox",name:"smoking[]"},items:[{id:"smokingField",boxLabel:"Chain Smoker",inputValue:"chainSmoker"},{boxLabel:"Daily",inputValue:"daily"},{boxLabel:"A Few Times a Week",inputValue:"aFewTimesAWeek"}]},{columnWidth:0.39,defaults:{xtype:"checkbox",name:"smoking[]"},items:[{boxLabel:"Only On Weekends",inputValue:"onlyOnWeekends"},{boxLabel:"Trying To Quit",inputValue:"tryingToQuit"},{boxLabel:"Only On Special Occasions",inputValue:"onlyOnSpecialOccasions"}]},{columnWidth:0.27,defaults:{xtype:"checkbox",name:"smoking[]"},items:[{boxLabel:"Do Not Smoke",inputValue:"doNotSmoke"}]}]},{xtype:"fieldset",layout:"column",title:"Drug Use",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.35,defaults:{xtype:"checkbox",name:"drugUse[]"},items:[{id:"drugUseField",boxLabel:"Do Not Use Drugs",inputValue:"doNotUseDrugs"}]},{columnWidth:0.35,defaults:{xtype:"checkbox",name:"drugUse[]"},items:[{boxLabel:"Once In A While",inputValue:"onceInAWhile"}]},{columnWidth:0.29,defaults:{xtype:"checkbox",name:"drugUse[]"},items:[{boxLabel:"Medicinally",inputValue:"medicinally"}]}]}]},{xtype:"fieldset",layout:"column",title:"Approach to Wellness",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.35,defaults:{xtype:"checkbox",name:"wellnessApproach[]"},items:[{id:"wellnessApproachField",boxLabel:"Alternative Medicine",inputValue:"alternativeMedicine"},{boxLabel:"Complimentary Medicine",inputValue:"complimentaryMedicine"}]},{columnWidth:0.33,defaults:{xtype:"checkbox",name:"wellnessApproach[]"},items:[{boxLabel:"Conventional Medicine",inputValue:"conventionalMedicine"},{boxLabel:"Natural Health",inputValue:"naturalHealth"}]},{columnWidth:0.15,defaults:{xtype:"checkbox",name:"wellnessApproach[]"},items:[{boxLabel:"Exercise",inputValue:"exercise"},{boxLabel:"Diet",inputValue:"diet"}]},{columnWidth:0.17,defaults:{xtype:"checkbox",name:"wellnessApproach[]"},items:[{boxLabel:"Spirituality",inputValue:"spirituality"}]}]},{xtype:"fieldset",layout:"column",title:"Membership Purpose",autoHeight:true,defaults:{border:false},items:[{columnWidth:0.25,defaults:{xtype:"checkbox",name:"membershipPurpose[]"},items:[{id:"membershipPurposeField",boxLabel:"Activity Partner",inputValue:"activityPartner"},{boxLabel:"Confidant",inputValue:"confidant"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"membershipPurpose[]"},items:[{boxLabel:"Friendship",inputValue:"friendship"},{boxLabel:"Opinions",inputValue:"opinions"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"membershipPurpose[]"},items:[{boxLabel:"Contacts",inputValue:"contacts"},{boxLabel:"Experiences",inputValue:"experiences"}]},{columnWidth:0.25,defaults:{xtype:"checkbox",name:"membershipPurpose[]"},items:[{boxLabel:"Relationship",inputValue:"relationship"},{boxLabel:"Improve Health",inputValue:"improveHealth"}]}]},{xtype:"fieldset",layout:"column",title:"Medical Interests",autoHeight:true,defaults:{labelSeparator:" ",layout:"form",labelWidth:55},items:[{columnWidth:0.78,border:false,items:[{xtype:"combo",id:"medicalInterestsEditor",fieldLabel:"Interests",typeAhead:false,loadingText:"Searching...",pageSize:10,hideTrigger:true,minChars:2,maskRe:/[a-zA-Z0-9\-, ]/,value:"",emptyText:"Enter a list including any conditions, procedures or medications",displayField:"name",store:f,onSelect:function(o,p){var q=Ext.getCmp("medicalInterestsEditor");
q.setValue(((g!=null)?g:"")+o.get("name"));q.collapse();q.fireEvent("select",this,o,p);j[o.get("name")]=o.get("id")+o.get("aliasId")},listeners:{"beforequery":function(r){var p=r.query;var o=p.split(/, ?/);
p=o.join(", ");var q=p.lastIndexOf(", ");q+=(q==-1)?1:2;g=p.substr(0,q);r.query=p.substr(q)}},width:370},{xtype:"hidden",name:"medicalInterests"}]},{xtype:"checkbox",columnWidth:0.22,name:"sameMedicalInterestsAsMe[]",boxLabel:"Same As Mine",inputValue:"sameMedicalInterestsAsMe"}]}]}]});
Ext.fly("searchDetailed").update("");var h=new Ext.Button({text:"Detailed Search",style:"padding-left: 4px; padding-top:5px",handler:function(){if(typeof(this.drawn)=="undefined"){i.render("searchDetailed");
this.drawn=true}else{i.setVisible(!i.isVisible())}this.hide()}});h.render("searchDetailed")});
