/*
 * Shaker 0.9.0
 * Copyright(c) 2006-2009 Logabout
 * licensing@logabout.com
 * http://www.logabout.com/license
 */
Date.patterns={LbShort:"M j",LbLong:"M j, Y",LbCombo:"M j, Y @ g:i A",LbShortCombo:"M j @ g:i A",LbFull:"Y-m-d H:i:s",LbFullDate:"Y-m-d",LbFullTime:"H:i:s",ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"};Ext.namespace("Logabout.Defs");Logabout.Defs.anonymousUserSession="abraanonym";Logabout.Defs.ADtest=false;Logabout.Defs.masterMinDist=0.2;Logabout.Defs.StatsBonus={gocbonus:100,emailbonus:500,profilebonus:400};Logabout.Defs.DebugUsers=[{userid:45,username:"clarker"},{userid:46,username:"andre"},{userid:49,username:"sangoma"},{userid:227,username:"andre gfc"}];Logabout.Defs.FullRecDef=[{name:"utc",type:"date",dateFormat:"U"},{name:"crdatetime",type:"date",dateFormat:"U"},{name:"sfield1",defaultValue:null},{name:"sfield2",defaultValue:null},{name:"sfield3",defaultValue:null},{name:"sfield4",defaultValue:null},{name:"sfield5",defaultValue:null},{name:"sfield6",defaultValue:null},{name:"sfield7",defaultValue:null},{name:"sfield8",defaultValue:null},{name:"ifield1",defaultValue:null},{name:"ifield2",defaultValue:null},{name:"ifield3",defaultValue:null},{name:"ifield4",defaultValue:null},{name:"ifield5",defaultValue:null},{name:"ifield6",defaultValue:null},{name:"ifield7",defaultValue:null},{name:"ifield8",defaultValue:null},{name:"ifield9",defaultValue:null},{name:"ifield10",defaultValue:null},{name:"ifield11",defaultValue:null},{name:"ifield12",defaultValue:null},{name:"ifield13",defaultValue:null},{name:"ifield14",defaultValue:null},{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"alt",type:"float"},{name:"gmapzoom",defaultValue:null},{name:"description",defaultValue:null},{name:"wpid"},{name:"mswpid",defaultValue:null},{name:"mtype",defaultValue:null},{name:"loguserid"},{name:"logusername"},{name:"wtype"},{name:"tsect"},{name:"tsecttype"},{name:"swpid"},{name:"tripname",defaultValue:null},{name:"wptcount",defaultValue:null},{name:"newrec",type:"boolean"},{name:"diffdist",type:"float"},{name:"dttime",mapping:"utc",type:"string",convert:function(a){var b=Date.parseDate(a,"U");return b.format("H:i")}},{name:"dtseconds",mapping:"utc",type:"int",convert:function(a){var b=Date.parseDate(a,"U");return b.format("s")}}];Logabout.Defs.defGrpTsect="200801015101";Logabout.Defs.defTripTsectType="01";Logabout.Defs.picComboPath=null;Logabout.Defs.cfgdomain=null;Logabout.Defs.incDirPath=null;Logabout.Defs.imagesDirPath=null;Logabout.Defs.pMarkerIcons=null;Logabout.Defs.pRegIcons=null;Logabout.Defs.blankWaypointImage=null;Logabout.Defs.pPicFilePath="/files/profilepics/";Logabout.Defs.wtypeIcons={5:["Goal",13,"sf_goalitem.png","sf_goalitem_h.png"],7:["Trip",10,"sf_trip.png","sf_trip_h.png"],8:["Fuel",1,"sf_fuel.png","sf_fuel_h.png"],9:["Camp",2,"sf_camp.png","sf_camp_h.png"],10:["Water",3,"sf_water.png","sf_water_h.png"],11:["Dump",4,"sf_dump.png","sf_dump_h.png"],12:["Wifi",5,"sf_wifi.png","sf_wifi_h.png"],13:["Outdoor",6,"sf_outdoor.png","sf_outdoor_h.png"],14:["POI",7,"sf_poi.png","sf_poi_h.png"],15:["Photo",8,"sf_photo.png","sf_photo_h.png"],16:["Hotel",9,"sf_hotel.png","sf_hotel_h.png"],28:["User",12,"stumps_user.png","stumps_user_h.png"],77:["Search",11,"stumps_search_center.png","stumps_search_center_h.png"]};Logabout.Defs.eWtypes=[[5,"Goal",10,"sf_goalitem.png","sf_goalitem_h.png"],[8,"Fuel",1,"sf_fuel.png","sf_fuel_h.png"],[9,"Camp",2,"sf_camp.png","sf_camp_h.png"],[10,"Water",3,"sf_water.png","sf_water_h.png"],[11,"Dump",4,"sf_dump.png","sf_dump_h.png"],[12,"Wifi",5,"sf_wifi.png","sf_wifi_h.png"],[13,"Outdoor",6,"sf_outdoor.png","sf_outdoor_h.png"],[14,"POI",7,"sf_poi.png","sf_poi_h.png"],[15,"Photo",8,"sf_photo.png","sf_photo_h.png"],[16,"Hotel",9,"sf_hotel.png","sf_hotel_h.png"]];Logabout.Defs.NoGoaleWtypes=[[8,"Fuel",1,"sf_fuel.png","sf_fuel_h.png"],[9,"Camp",2,"sf_camp.png","sf_camp_h.png"],[10,"Water",3,"sf_water.png","sf_water_h.png"],[11,"Dump",4,"sf_dump.png","sf_dump_h.png"],[12,"Wifi",5,"sf_wifi.png","sf_wifi_h.png"],[13,"Outdoor",6,"sf_outdoor.png","sf_outdoor_h.png"],[14,"POI",7,"sf_poi.png","sf_poi_h.png"],[15,"Photo",8,"sf_photo.png","sf_photo_h.png"],[16,"Hotel",9,"sf_hotel.png","sf_hotel_h.png"]];Logabout.Defs.wptHash={5:"Goal",7:"Trip",8:"Fuel",9:"Camp",10:"Water",11:"Dump",12:"Wifi",13:"Outdoor",14:"POI",15:"Photo",16:"Hotel"};Logabout.Defs.eWtype={0:"n0",1:"Start",2:"End",3:"n3",4:"n4",5:"n5",6:"n6",7:"Trip",8:"Fuel",9:"Camp",10:"Water",11:"Dump",12:"Wifi",13:"Outdoor",14:"POI",15:"Photo",16:"Hotel"};Logabout.Defs.markerTemplateFuncs={getDebugUser:function(){return Logabout.Bridgeport.isDebugUser()},getProfilePicImgSrc:function(a){if(a){return'<img src="'+Logabout.Defs.pPicFilePath+a+'"></img>'}else{return'<img src="'+Logabout.Defs.pPicFilePath+'blankpicplaceholder.jpg"></img>'}},getIconPath:function(a){return Logabout.Defs.pMarkerIcons+Logabout.Defs.wtypeIcons[a][2]},getBulletPath:function(a){return Logabout.Defs.pRegIcons},getMarkerSize:function(d,a){if(a==null){a=["sfield2","sfield3","sfield4","ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9"]}if(d.sfield8!=null&&(d.ifield10==0||d.ifield10==1)){return"db-mrk-long-wide"}var c=0;for(var b in d){if(a.indexOf(b)!=-1){if(d[b]!==null){c++}}}if(d.description!=null||c>4){return"db-mrk-long-narrow"}return"db-mrk-short-narrow"},getPhotoSrc:function(b){if(!b.ifield10||!b.sfield8){return false}var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return a},getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},getAddress:function(e,c,d,b){var a="";if(e){a+=e}if(c){a+=(e?", ":"")+c}if(d){a+=(e||c?", ":"")+d}if(b){return Ext.util.Format.ellipsis(a,b)}else{return a}},getDetail:function(f,c,a,b){var e="";if(!b){b="db-mrk-detail"}for(var d in f){if(c.indexOf(d)!=-1){if(f[d]!==null){if(Logabout.Defs.eWptDetail[f.wtype][d]){e+='<div class="'+b+'">';e+='<div class="'+b+'-label">'+Logabout.Defs.eWptDetail[f.wtype][d].label+"</div>";if(Logabout.Defs.eWptDetail[f.wtype][d].datar){e+='<div class="'+b+'-value">'+Logabout.Bridgeport.getDatarVal(Logabout.Defs.eWptDetail[f.wtype][d].datar,f[d])+"</div>"}else{e+='<div class="'+b+'-value">'+f[d]+"</div>"}e+='<div class="'+b+'-clear"></div>';e+="</div>"}}}}if(e.length>0&&a){e='<div class="'+a+'">'+e+"</div>"}return e},getItemPhotoDiv:function(b){if(!b.ifield10||!b.sfield8){return'<div class="pd-error"><img src="'+a+'"></img></div>'}var c=(b.ifield10==0?"pd-landscape":(b.ifield10==1?"pd-landscape":(b.ifield10==2?"pd-portrait":"pd-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+values.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'},wpthash:Logabout.Defs.wptHash,customDate:function(f,b){var a=new Date();var e=a.add(Date.SECOND,-120);var c=a.add(Date.MINUTE,-80);var d=a.add(Date.HOUR,-24);var g=a.add(Date.DAY,-31);if(b=="logabout-feed"){if(f>a){return"coming up"}else{if(Math.floor(f.clearTime(true).getElapsed()/(60000*60*24))==1){return"yesterday"}else{if(Math.floor(f.clearTime(true).getElapsed()/(60000*60*24))==0){return"today"}else{return f.format("M j")}}}}else{if(b=="logabout-vshort"){if(f.valueOf()>a.valueOf()){return"f"}else{if(f.between(g,d)){return Math.floor(f.getElapsed()/(60000*60*24))+"d"}else{if(f.between(d,c)){return Math.floor(f.getElapsed()/(60000*60))+"h"}else{if(f.between(c,e)){return Math.floor(f.getElapsed()/(60000))+"m"}else{if(f.between(e,a)){return Math.floor(f.getElapsed()/(1000))+"s"}else{return f.format("M")}}}}}}else{if(b){return f.format(b)}else{if(f.valueOf()>a.valueOf()){return"date in future"}else{if(f.between(g,d)){return(Math.floor(f.getElapsed()/(60000*60*24))==1)?"1 day ago":Math.floor(f.getElapsed()/(60000*60*24))+" days ago"}else{if(f.between(d,c)){return(Math.floor(f.getElapsed()/(60000*60))==1)?"1 hour ago":Math.floor(f.getElapsed()/(60000*60))+" hours ago"}else{if(f.between(c,e)){return(Math.floor(f.getElapsed()/(60000))==1)?"1 min ago":Math.floor(f.getElapsed()/(60000))+" mins ago"}else{if(f.between(e,a)){return(Math.floor(f.getElapsed()/(1000))==1)?"1 sec ago":Math.floor(f.getElapsed()/(1000))+" secs ago"}else{return f.format("M, Y")}}}}}}}}}};Logabout.Defs.eWptDetail={7:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},tsecttype:{label:"Trip/Group Type",datar:[[1,"trip - leg",3],[2,"trip - stay",4],[10,"trip - hike",5],[11,"trip - backpack",6],[12,"trip - sightsee",7],[13,"trip - shop",8],[14,"trip - walk",9],[15,"trip - bike",10],[16,"trip - ski",11],[17,"trip - climb",12],[18,"trip - misc",13],[51,"group - default",1],[52,"group - custom",2]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},8:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Gallons"},ifield2:{label:"Price/Gal"},ifield3:{label:"Total Cost"},ifield4:{label:"Miles"},ifield5:{label:"Odo"},ifield6:{label:"Hours"},ifield7:{label:"Mpg"},ifield8:{label:"Type",datar:[[0,"---",0],[1,"regular",1],[2,"mid-grade",2],[3,"premium",3],[4,"diesel",4],[5,"bio diesel",5],[6,"propane",6]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},9:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Nights"},ifield2:{label:"Cost/Night"},ifield3:{label:"Total Cost"},ifield4:{label:"Camp Type",datar:[[0,"---",0],[1,"cg - rv park",1],[2,"cg - national park",2],[3,"cg - national forest",3],[4,"dispersed",8],[5,"private",9],[6,"car camping",10],[7,"walk-in",11],[8,"walmart",12],[9,"rest stop",13],[10,"cg - state park",4],[11,"curbside",14],[12,"cg - blm",5],[13,"cg - membership only",6],[14,"cg - casino",7]]},ifield5:{label:"Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield7:{label:"Hookups",datar:[[0,"---",0],[1,"none",1],[2,"water",2],[3,"water/elec",3],[4,"full",4]]},sfield2:{label:"Site Number"},ifield9:{label:"Datastorm",datar:[[0,"---",0],[1,"no sites",1],[2,"some sites",2],[3,"most sites",3],[4,"all sites",4]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},10:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Gallons"},ifield2:{label:"Days"},ifield3:{label:"Gal/Day"},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},11:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Price"},ifield2:{label:"Type",datar:[[0,"---",0],[1,"campground",1],[2,"rest stop",2],[3,"gas station",3],[4,"storage facility",4],[5,"city service",5],[6,"other",6]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},12:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Cost",datar:[[0,"---",0],[1,"free",1],[2,"free with purchase",2],[3,"paid",3]]},ifield2:{label:"Price"},ifield3:{label:"Type",datar:[[0,"---",0],[1,"coffee shop",2],[2,"library",3],[3,"subscription",4],[4,"private network",5],[5,"city network",6],[6,"other",7],[7,"campground",1]]},ifield4:{label:"Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield5:{label:"Security",datar:[[0,"---",0],[1,"unsecured",1],[2,"secured",2],[3,"other",3]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},13:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Type",datar:[[0,"---",0],[1,"trail head",1],[2,"geocache",2],[3,"surf spot",3],[4,"climbing crag",4],[5,"dive spot",5],[6,"bird watching",6],[7,"rock hunting",7],[8,"beach",8],[9,"fishing spot",9],[10,"ski area",10],[11,"other",11]]},ifield2:{label:"Price"},ifield3:{label:"Excertion",datar:[[0,"---",0],[1,"easy",1],[2,"moderate",2],[3,"workout",3],[4,"difficult",4],[5,"painful",5]]},ifield4:{label:"Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},14:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Type",datar:[[0,"---",0],[1,"historical site",7],[2,"geological site",8],[3,"photo opportunity",6],[4,"restaurant",2],[5,"shopping",4],[6,"museum",13],[7,"tourist attraction",14],[8,"other",16],[9,"laundromat",10],[10,"tourist info",12],[11,"rest stop",15]]},ifield2:{label:"Price"},ifield3:{label:"Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},15:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Type",datar:[[0,"---",0],[1,"point and shoot",1],[2,"slr",2],[3,"medium format",3],[4,"pro",4]]},ifield2:{label:"Price"},ifield3:{label:"Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}},16:{sfield1:{label:"Name"},sfield5:{label:"City"},sfield6:{label:"State/Prov"},sfield7:{label:"Country"},sfield8:{label:"PicPath"},ifield1:{label:"Nights"},ifield2:{label:"Cost/Night"},ifield3:{label:"Total Cost"},ifield4:{label:"Hotel Type",datar:[[0,"---",0],[1,"resort",1],[2,"spa",2],[3,"hotel",3],[4,"lodge",4],[5,"guest house",5],[6,"bed and breakfast",6],[7,"extended stay",7],[8,"inn",8],[9,"airport",9],[10,"motel",10],[11,"hostel",11],[12,"other",12]]},ifield5:{label:"Star Rating",datar:[[0,"---",0],[1,"1 star",1],[2,"2 star",2],[3,"3 star",3],[4,"4 star",4],[5,"5 star",5],[6,"6 star",6]]},ifield6:{label:"My Rating",datar:[[0,"---",0],[1,"1 - bad",1],[2,"2 - mediocre",2],[3,"3 - ok",3],[4,"4 - good",4],[5,"5 - excellent",5]]},ifield7:{label:"Status",datar:[[0,"---",0],[1,"open",1],[2,"closed",2],[3,"seasonal",3],[4,"unknown",4]]},ifield11:{label:"Activity Date"},ifield12:{label:"Use for gadget"}}};Logabout.Defs.TemplatesMarkerUserLists={infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("-#-");Logabout.Bridgeport.zoomWptDetail(a[1],null,null,true);Logabout.Bridgeport.trackEvent("mrkuserlists","zoomwptdetail","click")},this);Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mrkuserlists","showprofile","click")},this)},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-groups">',"<tpl if=\"restype == 'likethis'\">",'<div class="db-icon db-icon-tick">{[fm.ellipsis(values.logusername,23)]} liked</div>',"</tpl>","<tpl if=\"restype == 'beenhere'\">",'<div class="db-icon db-icon-greenflag">{[fm.ellipsis(values.logusername,23)]} has been here</div>',"</tpl>","<tpl if=\"restype == 'favorite'\">",'<div class="db-icon db-icon-star">{[fm.ellipsis(values.logusername,23)]} favorite</div>',"</tpl>",'<div class="db-mrk-detailblock">','<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,23)]}</div>','<div class="db-icon db-icon-userblue">originally by ','<span class="db-mrk-linkitem db-li-showprofile">{[fm.ellipsis(values.origusername,23)]}<span class="db-mrk-linkdata">{origuserid}_{origusername}</span></span>',"</div>",'<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showdetails">view details<span class="db-mrk-linkdata">{[this.getMyId()]}-#-{swpid}</span></span>',"</div>","</div>","</div>","</tpl>"]};Logabout.Defs.TemplatesMarkerUserFounded={infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("-#-");Logabout.Bridgeport.zoomWptDetail(a[1],null,null,true);Logabout.Bridgeport.trackEvent("mrkuserfounded","zoomwptdetail","click")},this);Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mrkuserfounded","showprofile","click")},this);Ext.select(".db-mrk-linkitem.db-li-quicklog",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showQuickLog(null,a);Logabout.Bridgeport.trackEvent("mrkuserfounded","quicklog","click")})},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-groups">','<div class="db-icon db-icon-founded">founded by ','<span class="db-mrk-linkitem db-li-showprofile">{[fm.ellipsis(values.logusername,23)]}<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="db-mrk-detailblock">','<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,23)]}</div>','<div class="db-icon db-icon-clock">{[ this.customDate(values.utc,Date.patterns.LbCombo)]}</div>','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showdetails">view details<span class="db-mrk-linkdata">{[this.getMyId()]}-#-{swpid}</span></span>',"</div>",'<div class="db-icon db-icon-add">','<span class="db-mrk-linkitem db-li-quicklog">log it<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>","</div>","</div>","</tpl>"]};Logabout.Defs.TemplatesMarkerNews={infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mrknews","showprofile","click")},this);Ext.select(".db-mrk-linkitem.db-li-showregwptdetail",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("-#-");Logabout.Bridgeport.zoomWptDetail(a[1],null,null,true);Logabout.Bridgeport.trackEvent("mrknews","zoomwptdetail","click")},this);Ext.select(".db-mrk-linkitem.db-li-showlistwptdetail",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("-#-");Logabout.Bridgeport.zoomWptDetail(a[1].split("-")[2],null,null,true);Logabout.Bridgeport.trackEvent("mrknews","zoomwptdetail","click")},this);Ext.select(".db-mrk-linkitem.db-li-showuserwpts",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],a[2],null,"fortrip",false,null,null,true,{showtab:a[3]});Logabout.Bridgeport.trackEvent("mrknews","showuserwpts","click")},this);Ext.select(".db-mrk-linkitem.db-li-showalluserwpts",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,"alltrips",false,null,null,true,{showtab:"waypoints"});Logabout.Bridgeport.trackEvent("mrknews","showuserwpts","click")},this);Ext.select(".db-mrk-linkitem.db-li-showuserlists",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,null,false,null,null,true,{showtab:a[2]});Logabout.Bridgeport.trackEvent("mrknews","showuserlists","click")},this)},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-tab1 {[ this.getMarkerSize(values) ]}">','<tpl if="wptcount == 1">','<div class="news-ico {[ this.getItemClass(values) ]}">','<span class="db-mrk-linkitem db-li-showalluserwpts">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span>',"</span> {[this.getComboData(values)]}","</div>","</tpl>",'<tpl if="wptcount != 1">','<div class="news-ico {[ this.getItemClass(values) ]}">{logusername} {[this.getComboData(values)]}</div>',"</tpl>",'<div class="db-mrk-detailblock">','<tpl if="wptcount == 1">','<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,23)]}</div>',"</tpl>",'<tpl if="wptcount == 1">','<tpl if="this.isSwpidBased(values)">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showregwptdetail">view details<span class="db-mrk-linkdata">{[this.getMyId()]}-#-{swpid}</span></span>',"</div>","</tpl>",'<tpl if="!this.isSwpidBased(values)">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showuserwpts">view details<span class="db-mrk-linkdata">{loguserid}_{logusername}_{tsect}_{restype}</span></span>',"</div>","</tpl>","</tpl>",'<tpl if="wptcount != 1">','<tpl if="this.isSwpidBased(values)">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showuserwpts">view details<span class="db-mrk-linkdata">{loguserid}_{logusername}_{tsect}_{restype}</span></span>',"</div>","</tpl>",'<tpl if="!this.isSwpidBased(values)">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showuserlists">view details<span class="db-mrk-linkdata">{loguserid}_{logusername}_{restype}</span></span>',"</div>","</tpl>","</tpl>","</div>","</div>","</tpl>"]};Logabout.Defs.TemplatesMarkerTabUserWay={infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mrktabuserway","showprofile","click")},this);Ext.select(".db-mrk-linkitem.db-li-edit",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.editWaypoint(a);Logabout.Bridgeport.trackEvent("mrktabuserway","editwpt","click")});Ext.select(".db-mrk-linkitem.db-li-delete",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteWaypoint(a);Logabout.Bridgeport.trackEvent("mrktabuserway","deletewpt","click")});Ext.select(".db-mrk-linkitem.db-li-viewdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.zoomWptDetail(a,null,null,true);Logabout.Bridgeport.trackEvent("mrktabuserway","zoomwptdetail","click")});Ext.select(".db-mrk-linkitem.db-li-favorite",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.insertGroupItem(a,"favorite");Logabout.Bridgeport.trackEvent("mrktabuserway","addfavorite","click")});Ext.select(".db-mrk-linkitem.db-li-quicklog",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showQuickLog(null,a);Logabout.Bridgeport.trackEvent("mrktabuserway","quicklog","click")});Ext.select(".db-mrk-linkitem.db-li-datalog",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showQuickData(a);Logabout.Bridgeport.trackEvent("mrktabuserway","quickdata","click")});Ext.select(".db-mrk-linkitem.db-li-enlarge",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showPictureWindow(a);Logabout.Bridgeport.trackEvent("mrktabuserway","showpicturewindow","click")})},markerTemplateDef:[{label:"log",tpldef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-tab1 {[ this.getMarkerSize(values) ]}">','<div class="db-mrk-name db-icon {[ this.getItemIconClass(values) ]}">',"{[fm.ellipsis(values.sfield1,35)]}","</div>",'<div class="db-mrk-detailblock">','<tpl if="show_uname == 1">','<tpl if="mtype == 1">','<div class="db-mrk-itm db-icon db-icon-founded">','founded by <span class="db-mrk-linkitem db-li-showprofile">{logusername}<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>","</tpl>",'<tpl if="mtype != 1">','<div class="db-mrk-itm db-icon db-icon-userblue">','by <span class="db-mrk-linkitem db-li-showprofile">{logusername}<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>","</tpl>","</tpl>",'<tpl if="show_date == 1">','<div class="db-mrk-itm db-icon db-icon-clock">{[ this.customDate(values.utc,Date.patterns.LbCombo)]}</div>',"</tpl>",'<tpl if="show_dist == 1">','<div class="db-mrk-itm db-icon db-icon-brackets">{[(values.diffdist).toFixed(0) ]} miles</div>',"</tpl>","</div>",'<tpl if="show_detailfavorite == 1">','<div class="db-mrk-detailblock">','<div class="db-mrk-detailcontrols">','<div class="db-mrk-itmb db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-viewdetails">view details<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-mrk-itmb db-icon db-icon-star">','<span class="db-mrk-linkitem db-li-favorite">add favorite<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-clear"></div>',"</div>","</div>","</tpl>",'<tpl if="show_quicklog == 1">','<div class="db-mrk-detailblock">','<div class="db-mrk-detailcontrols">','<div class="db-mrk-itmb db-icon db-icon-add">','<span class="db-mrk-linkitem db-li-quicklog">log it<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-clear"></div>',"</div>","</div>","</tpl>",'<tpl if="show_datalog == 1">','<div class="db-mrk-detailblock">','<div class="db-mrk-detailcontrols">','<div class="db-mrk-itmb db-icon db-icon-info">','<span class="db-mrk-linkitem db-li-datalog">show log entry detail<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-clear"></div>',"</div>","</div>","</tpl>",'<tpl if="show_editcontrols == 1">','<tpl if="me_isowner == true && me_isguest != true">','<div class="db-mrk-editcontrols">','<div class="db-mrk-itmb db-icon db-icon-edit">','<span class="db-mrk-linkitem db-li-edit">edit<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-mrk-itmb db-icon db-icon-delete">','<span class="db-mrk-linkitem db-li-delete">delete<span class="db-mrk-linkdata">{swpid}</span></span>',"</div>",'<div class="db-clear"></div>',"</div>","</tpl>","</tpl>","</div>","</tpl>"]},{label:"more",tpldef:['<tpl for=".">','{[ this.getDetail(values,["sfield2","sfield3","sfield4","ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9"],"db-mrk-mpanel db-mrk-tab2 db-mrk-standardsize") ]}',"</tpl>"]},{label:"photo",tpldef:['<tpl for=".">','<tpl if="sfield8 != null">','<div class="db-mrk-mpanel db-mrk-tab3 db-mrk-standardsize">','<tpl if="ifield10 == 0">','<div class="db-mrk-standard db-mrk-mappic db-mrk-landscape">',"</tpl>",'<tpl if="ifield10 == 1">','<div class="db-mrk-standard db-mrk-mappic db-mrk-landscape">',"</tpl>",'<tpl if="ifield10 == 2">','<div class="db-mrk-standard db-mrk-mappic db-mrk-portrait">',"</tpl>",'<tpl if="ifield10 &gt; 2">','<div class="db-mrk-standard db-mrk-mappic db-mrk-hide">',"</tpl>",'<img src="{[ (fm.substr(values.sfield8,0,4) == "http")?values.sfield8:(Logabout.Defs.picComboPath+values.sfield8) ]}"></img>',"</div>",'<div class="db-icon db-icon-zoomin">','<span class="db-mrk-linkitem db-li-enlarge">enlarge photo<span class="db-mrk-linkdata">{[ this.getPhotoSrc(values) ]}</span></span>',"</div>","</div>","</tpl>","</tpl>"]}]};Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Camp=Ext.extend(Ext.form.FieldSet,{title:"Camp Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},FieldSetValidation:function(){var c=Number(this.find("name","ifield1")[0].getValue());var b=this.find("name","ifield3")[0];var a=this.find("name","ifield2")[0];var e=Number(b.getValue());var d=Number(a.getValue());if(c>0){if(d>0){b.suspendEvents();b.setValue(Number(d*c).toFixed(2));b.resumeEvents();this.fireEvent("lbvalchanged",b.name,b.getValue())}else{if(e>0){a.suspendEvents();a.setValue(Number(e/c).toFixed(2));a.resumeEvents();this.fireEvent("lbvalchanged",a.name,a.getValue())}}}},initComponent:function(){Ext.apply(this,{items:[{xtype:"textfield",fieldLabel:"Site Number",name:"sfield2",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},maxLength:10,allowBlank:true},{xtype:"numberfield",fieldLabel:"Nights",name:"ifield1",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Cost/Night",name:"ifield2",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:1,minValue:0,maxValue:10000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Total Cost",name:"ifield3",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:10000,allowBlank:true},{xtype:"combo",fieldLabel:"Type",name:"camptype",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},hiddenName:"ifield4",allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield4","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[9].ifield4.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield4",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Rating",name:"camprating",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},hiddenName:"ifield5",allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield5","ratingdesc","typeorder"],data:Logabout.Defs.eWptDetail[9].ifield5.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"ratingdesc",valueField:"ifield5",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Datastorm",name:"datastorm",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},hiddenName:"ifield9",allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield9","ratingdesc","typeorder"],data:Logabout.Defs.eWptDetail[9].ifield9.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"ratingdesc",valueField:"ifield9",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Hookups",name:"camphookups",hiddenName:"ifield7",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield7","hookupdesc","typeorder"],data:Logabout.Defs.eWptDetail[9].ifield7.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"hookupdesc",valueField:"ifield7",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Camp.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfscamp",Logabout.PreConf.Fieldset.Camp);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Dump=Ext.extend(Ext.form.FieldSet,{title:"Dump Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},initComponent:function(){Ext.apply(this,{items:[{xtype:"numberfield",fieldLabel:"Price",name:"ifield1",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:100000,allowBlank:true},{xtype:"combo",fieldLabel:"Type",name:"fueltype",hiddenName:"ifield2",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["dumpval","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[11].ifield2.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"dumpval",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Dump.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfsdump",Logabout.PreConf.Fieldset.Dump);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Fuel=Ext.extend(Ext.form.FieldSet,{title:"Fuel Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},FieldSetValidation:function(){var d=Number(this.find("name","ifield1")[0].getValue());var e=Number(this.find("name","ifield3")[0].getValue());var a=Number(this.find("name","ifield4")[0].getValue());var b=this.find("name","ifield2")[0];var c=this.find("name","ifield7")[0];if(d>0){if(e>0){b.suspendEvents();b.setValue(Number(e/d).toFixed(2));b.resumeEvents();this.fireEvent("lbvalchanged",b.name,b.getValue())}if(a>0){c.suspendEvents();c.setValue(Number(a/d).toFixed(2));c.resumeEvents();this.fireEvent("lbvalchanged",c.name,c.getValue())}}},initComponent:function(){Ext.apply(this,{items:[{xtype:"numberfield",fieldLabel:"Gallons",name:"ifield1",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Price/Gal",name:"ifield2",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:1,minValue:0,maxValue:100,allowBlank:true},{xtype:"numberfield",fieldLabel:"Total Cost",name:"ifield3",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:10000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Miles",name:"ifield4",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:10000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Odo",name:"ifield5",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Hours",name:"ifield6",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:50000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Mpg",name:"ifield7",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true},{xtype:"combo",fieldLabel:"Type",name:"fueltype",hiddenName:"ifield8",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield8","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[8].ifield8.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield8",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Fuel.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfsfuel",Logabout.PreConf.Fieldset.Fuel);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Hotel=Ext.extend(Ext.form.FieldSet,{title:"Hotel Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},FieldSetValidation:function(){var c=Number(this.find("name","ifield1")[0].getValue());var b=this.find("name","ifield3")[0];var a=this.find("name","ifield2")[0];var e=Number(b.getValue());var d=Number(a.getValue());if(c>0){if(d>0){b.suspendEvents();b.setValue(Number(d*c).toFixed(2));b.resumeEvents();this.fireEvent("lbvalchanged",b.name,b.getValue())}else{if(e>0){a.suspendEvents();a.setValue(Number(e/c).toFixed(2));a.resumeEvents();this.fireEvent("lbvalchanged",a.name,a.getValue())}}}},initComponent:function(){Ext.apply(this,{items:[{xtype:"numberfield",fieldLabel:"Nights",name:"ifield1",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Cost/Night",name:"ifield2",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:1,minValue:0,maxValue:10000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Total Cost",name:"ifield3",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:10000,allowBlank:true},{xtype:"combo",fieldLabel:"Type",name:"hoteltype",hiddenName:"ifield4",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield4","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[16].ifield4.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield4",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Star Rating",name:"starrating",hiddenName:"ifield5",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield5","ratingdesc","typeorder"],data:Logabout.Defs.eWptDetail[16].ifield5.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"ratingdesc",valueField:"ifield5",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"My Rating",name:"myrating",hiddenName:"ifield6",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield6","ratingdesc","typeorder"],data:Logabout.Defs.eWptDetail[16].ifield6.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"ratingdesc",valueField:"ifield6",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Status",name:"hotelstatus",hiddenName:"ifield7",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield7","statusdesc","typeorder"],data:Logabout.Defs.eWptDetail[16].ifield7.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a status...",displayField:"statusdesc",valueField:"ifield7",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Hotel.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfshotel",Logabout.PreConf.Fieldset.Hotel);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Outdoor=Ext.extend(Ext.form.FieldSet,{title:"Outdoor Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},initComponent:function(){Ext.apply(this,{items:[{xtype:"combo",fieldLabel:"Type",name:"poitype",hiddenName:"ifield1",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield1","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[13].ifield1.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield1",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"numberfield",fieldLabel:"Price",name:"ifield2",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:100000,allowBlank:true},{xtype:"combo",fieldLabel:"Excertion",name:"outexcertion",hiddenName:"ifield3",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield3",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true,store:new Ext.data.SimpleStore({fields:["ifield3","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[13].ifield3.datar,sortInfo:{field:"typeorder",direction:"ASC"}})},{xtype:"combo",fieldLabel:"Rating",name:"outrating",hiddenName:"ifield4",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield4","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[13].ifield4.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield4",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Outdoor.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfsoutdoor",Logabout.PreConf.Fieldset.Outdoor);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Photo=Ext.extend(Ext.form.FieldSet,{title:"Photo Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},initComponent:function(){Ext.apply(this,{items:[{xtype:"combo",fieldLabel:"Type",name:"phototype",hiddenName:"ifield1",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield1","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[15].ifield1.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield1",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"numberfield",fieldLabel:"Price",name:"ifield2",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:100000,allowBlank:true},{xtype:"combo",fieldLabel:"Rating",name:"photorating",hiddenName:"ifield3",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield3","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[15].ifield3.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield3",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Photo.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfsphoto",Logabout.PreConf.Fieldset.Photo);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Poi=Ext.extend(Ext.form.FieldSet,{title:"Poi Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},initComponent:function(){Ext.apply(this,{items:[{xtype:"combo",fieldLabel:"Type",name:"poitype",hiddenName:"ifield1",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield1","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[14].ifield1.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield1",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"numberfield",fieldLabel:"Price",name:"ifield2",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:100000,allowBlank:true},{xtype:"combo",fieldLabel:"Rating",name:"poirating",hiddenName:"ifield3",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield3","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[14].ifield3.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield3",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Poi.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfspoi",Logabout.PreConf.Fieldset.Poi);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Water=Ext.extend(Ext.form.FieldSet,{title:"Water Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},FieldSetValidation:function(){var c=Number(this.find("name","ifield2")[0].getValue());var b=this.find("name","ifield1")[0];var e=this.find("name","ifield3")[0];var d=Number(b.getValue());var a=Number(e.getValue());if(c>0){if(d>0){e.suspendEvents();e.setValue(Number(d/c).toFixed(2));e.resumeEvents();this.fireEvent("lbvalchanged",e.name,e.getValue())}else{if(a>0){b.suspendEvents();b.setValue(Number(c*a).toFixed(2));b.resumeEvents();this.fireEvent("lbvalchanged",b.name,b.getValue())}}}},initComponent:function(){Ext.apply(this,{items:[{xtype:"numberfield",fieldLabel:"Gallons",name:"ifield1",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Days",name:"ifield2",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:1,minValue:0,maxValue:1000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Gal/Day",name:"ifield3",listeners:{valid:this.FieldSetValidation,change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:1000,allowBlank:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Water.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfswater",Logabout.PreConf.Fieldset.Water);Ext.namespace("Logabout.PreConf.Fieldset");Logabout.PreConf.Fieldset.Wifi=Ext.extend(Ext.form.FieldSet,{title:"Wifi Information",autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,defaults:{width:150},initComponent:function(){Ext.apply(this,{items:[{xtype:"combo",fieldLabel:"Cost",name:"costtype",hiddenName:"ifield1",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield1","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[12].ifield1.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield1",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"numberfield",fieldLabel:"Price",name:"ifield2",listeners:{change:function(b,c,a){this.fireEvent("lbvalchanged",b.name,c,a)},scope:this},allowNegative:false,decimalPrecision:2,minValue:0,maxValue:100000,allowBlank:true},{xtype:"combo",fieldLabel:"Type",name:"wifitype",hiddenName:"ifield3",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield3","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[12].ifield3.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield3",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Rating",name:"wifirating",hiddenName:"ifield4",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield4","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[12].ifield4.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield4",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true},{xtype:"combo",fieldLabel:"Security",name:"wifisecurity",hiddenName:"ifield5",listeners:{select:function(a){if(a.getValue()==0){a.clearValue()}this.fireEvent("lbvalchanged",a.hiddenName,a.getValue())},scope:this},allowBlank:true,forceSelection:true,listWidth:250,store:new Ext.data.SimpleStore({fields:["ifield5","typedesc","typeorder"],data:Logabout.Defs.eWptDetail[12].ifield5.datar,sortInfo:{field:"typeorder",direction:"ASC"}}),emptyText:"Select a type...",displayField:"typedesc",valueField:"ifield5",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true}]});this.addEvents("lbvalchanged");Logabout.PreConf.Fieldset.Wifi.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbfswifi",Logabout.PreConf.Fieldset.Wifi);Ext.namespace("Logabout");Logabout.MarkerCol=function(e,d,b){Logabout.MarkerCol.superclass.constructor.call(this,e,d);this.addEvents("markerclicked","activemarkerchanged","mapmoved");this.id=b.id;this.tpl=b.tpl||'<div class="x-combo-list-item x-icon-combo-item {'+this.iconClsField+'}">{'+this.displayField+"}</div>";this.mapMan=b.mapman;this.mrkPos=null;this.markersHidden=true;this.googleMap=b.map;this.geoCoder=b.geocoder;this.lbGmarkers=new Array();this.panOnClick=b.panOnClick===false?false:true;this.polyLineStyleCfg=b.polyLineStyleCfg||{color:"#FF0000",width:5};this.polyLineShow=b.polyLineShow===false?false:true;if(this.polyLineShow){this.polyLine=null}this.showwithar=b.showWith||[];this.colzoomlevel=b.colzoomlevel||null;this.markStaticImage=b.markstaticimage||false;this.eWtypes=b.ewtypes||{5:["Goal",11,"sf_goal.png","sf_goal_h.png"],7:["Trip",10,"sf_trip.png","sf_trip_h.png"],8:["Fuel",1,"sf_fuel.png","sf_fuel_h.png"],9:["Camp",2,"sf_camp.png","sf_camp_h.png"],10:["Water",3,"sf_water.png","sf_water_h.png"],11:["Dump",4,"sf_dump.png","sf_dump_h.png"],12:["Wifi",5,"sf_wifi.png","sf_wifi_h.png"],13:["Outdoor",6,"sf_outdoor.png","sf_outdoor_h.png"],14:["POI",7,"sf_poi.png","sf_poi_h.png"],15:["Photo",8,"sf_photo.png","sf_photo_h.png"],16:["Hotel",9,"sf_hotel.png","sf_hotel_h.png"]};this.gIcons={};this.markerInfoShow=b.markerInfoShow===false?false:true;var a=['<div class="frontMapInfo">','<tpl for=".">',"<p>{sfield1}</p>","<p>{[ this.customDate(values.utc) ]}</p>","</tpl>","</div>"];this.useTabMarker=b.useTabMarker||null;this.markerTemplate=null;if(this.useTabMarker){this.markerTemplate=b.markerTemplateDef;for(var c=0;c<this.markerTemplate.length;c++){this.markerTemplate[c].tpl=new Ext.XTemplate(this.markerTemplate[c].tpldef.join(""),b.markerTemplateFunctions).compile()}}else{if(b.markerTemplateDef){a=b.markerTemplateDef}this.markerTemplate=new Ext.XTemplate(a.join(""),b.markerTemplateFunctions);this.markerTemplate.compile()}this.infoCallBackFunc=b.infoCallBackFunc||null;this.hideMarkerOnCreate=b.hideMarkerOnCreate===false?false:true;this.markerType=b.markerType;this.addToHistory=b.addToHistory===false?false:true;this.doSort=b.doSort===false?false:true;this.polyMasterStyles=b.polyMasterStyles||{stroke:{color:"#3299D5",weight:2,opacity:1},fill:{color:"#3793D1",weight:2,opacity:0.2}};this.polyMasterDefaultKmRadius=b.polyMasterDefaultKmRadius||0.2;this.polyMasterShow=b.polyMasterShow===true?true:false;this.lbPolyMastersAr=new Array()};Ext.extend(Logabout.MarkerCol,Ext.util.MixedCollection,{lbPositionUpdated:function(a,b){a.lat=b.lat().toFixed(6);a.lng=b.lng().toFixed(6);if(this.polyMasterShow){this.lbSetMasterPolyStyle(true)}},lbSetMasterPolyStyle:function(d,b,a,c){if(this.googleMap){if(c===true){this.polyMasterShow=true}else{if(c===false){this.polyMasterShow=false}}this.each(function(o,l,f){if(this.lbGmarkers[this.getKey(o)]){if(this.lbPolyMastersAr[this.getKey(o)]){GEvent.clearInstanceListeners(this.lbPolyMastersAr[this.getKey(o)]);this.googleMap.removeOverlay(this.lbPolyMastersAr[this.getKey(o)]);delete this.lbPolyMastersAr[this.getKey(o)]}if(d){var j=parseFloat(o.lat);var k=parseFloat(o.lng);var q=b?parseFloat(b):this.polyMasterDefaultKmRadius;var g=q/111.32;var e=q/Math.abs(111.32*Math.cos((Math.PI/180)*j));var p=j+g/2;var n=j-g/2;var i=k+e/2;var h=k-e/2;var m=new GPolygon([new GLatLng(p,h),new GLatLng(p,i),new GLatLng(n,i),new GLatLng(n,h),new GLatLng(p,h)]);m.setStrokeStyle(a?a.stroke:this.polyMasterStyles.stroke);m.setFillStyle(a?a.fill:this.polyMasterStyles.fill);this.googleMap.addOverlay(m);this.lbPolyMastersAr[this.getKey(o)]=m}}},this)}},lbAddAllFromRecArray:function(d){var c=new Array();for(var b=0,a=d.length;b<a;b++){if(d[b].data){if(!this.key(this.getKey(d[b].data))){c.push(d[b].data)}}else{if(!this.key(this.getKey(d[b]))){c.push(d[b])}}}Logabout.MarkerCol.superclass.addAll.call(this,c);if(this.doSort){this.sort("DESC",function(f,e){if(f.utc<e.utc){return -1}if(f.utc>e.utc){return 1}return 0})}this.lbCreateMarkers();if(this.polyLineShow){this.lbCreateOrUpdatePolyLine()}},lbRefreshAddFromRecArray:function(e){var c=new Array();var d=new Array();for(var b=0,a=e.length;b<a;b++){if(e[b].data){if(this.key(this.getKey(e[b].data))){d.push(e[b].data)}else{c.push(e[b].data)}}else{if(this.key(this.getKey(e[b]))){d.push(e[b])}else{c.push(e[b])}}}for(var b=0,a=d.length;b<a;b++){if(this.googleMap){GEvent.clearInstanceListeners(this.lbGmarkers[d[b]["swpid"]]);this.googleMap.removeOverlay(this.lbGmarkers[d[b]["swpid"]]);delete this.lbGmarkers[d[b]["swpid"]];if(this.lbPolyMastersAr&&this.lbPolyMastersAr[d[b]["swpid"]]!=null){this.googleMap.removeOverlay(this.lbPolyMastersAr[d[b]["swpid"]]);delete this.lbPolyMastersAr[d[b]["swpid"]]}}this.removeKey(d[b]["swpid"])}Logabout.MarkerCol.superclass.addAll.call(this,c);Logabout.MarkerCol.superclass.addAll.call(this,d);if(this.doSort){this.sort("DESC",function(g,f){if(g.utc<f.utc){return -1}if(g.utc>f.utc){return 1}return 0})}this.lbCreateMarkers();if(this.polyLineShow){this.lbCreateOrUpdatePolyLine()}},lbUpdateAllFromRecArray:function(d){var c=new Array();for(var b=0,a=d.length;b<a;b++){if(d[b].data){c.push(d[b].data)}else{c.push(d[b])}}this.lbClear();Logabout.MarkerCol.superclass.addAll.call(this,c);this.lbCreateMarkers();if(this.polyLineShow){this.lbCreateOrUpdatePolyLine()}},lbAddAllFromPlainArray:function(a){Logabout.MarkerCol.superclass.addAll.call(this,a);this.lbCreateMarkers();if(this.polyLineShow){this.lbCreateOrUpdatePolyLine()}},lbRemoveOne:function(a){if(this.googleMap){GEvent.clearInstanceListeners(this.lbGmarkers[a]);this.googleMap.removeOverlay(this.lbGmarkers[a]);delete this.lbGmarkers[a];if(this.lbPolyMastersAr&&this.lbPolyMastersAr[a]!=null){this.googleMap.removeOverlay(this.lbPolyMastersAr[a]);delete this.lbPolyMastersAr[a]}this.removeKey(a);if(this.polyLineShow){this.lbCreateOrUpdatePolyLine()}}else{this.removeKey(a)}},lbCreateMarkers:function(){if(this.googleMap){this.each(function(d,b,c){if(!this.lbGmarkers[this.getKey(d)]){var e=null;if(this.markStaticImage){e={icon:this.lbGetIcon(this.markStaticImage.normal)}}else{e={icon:this.lbGetIcon(this.eWtypes[parseInt(d.wtype)][2])}}var a=new GMarker(new GLatLng(parseFloat(d.lat),parseFloat(d.lng)),e);if(this.infoCallBackFunc){GEvent.addListener(a,"infowindowopen",(function(){this.infoCallBackFunc()}).createDelegate(this))}GEvent.addListener(a,"click",(function(){this.fireEvent("markerclicked",this,d);this.lbSetActiveMarker(this.getKey(d))}).createDelegate(this));this.googleMap.addOverlay(a);if(this.hideMarkerOnCreate){a.hide()}if(this.polyMasterShow&&!this.hideMarkerOnCreate){this.lbSetMasterPolyStyle(true)}this.lbGmarkers[this.getKey(d)]=a}},this)}},lbGetIcon:function(b){if(this.googleMap){if(this.gIcons[b]){return this.gIcons[b]}else{var a=new GIcon();a.image=Logabout.Defs.pMarkerIcons+b;a.shadow=Logabout.Defs.pMarkerIcons+"shadow.png";a.iconSize=new GSize(23,34);a.shadowSize=new GSize(52,29);a.iconAnchor=new GPoint(7,34);a.infoWindowAnchor=new GPoint(10,1);this.gIcons[b]=a;return a}}else{return null}},lbCreateOrUpdatePolyLine:function(){if(this.googleMap){if(this.getCount()>0){if(this.polyLine){GEvent.clearInstanceListeners(this.polyLine);this.googleMap.removeOverlay(this.polyLine)}var a=new Array();this.each(function(d,b,c){a.push(this.lbGmarkers[this.getKey(d)].getLatLng())},this);this.polyLine=new GPolyline(a,this.polyLineStyleCfg.color,this.polyLineStyleCfg.width);this.googleMap.addOverlay(this.polyLine);this.polyLine.hide()}}},lbSetMarkerImage:function(a,b){if(this.googleMap){if(this.markStaticImage){if(b){this.lbGmarkers[this.getKey(a)].setImage(Logabout.Defs.pMarkerIcons+this.markStaticImage.highlight)}else{this.lbGmarkers[this.getKey(a)].setImage(Logabout.Defs.pMarkerIcons+this.markStaticImage.normal)}}else{if(b){this.lbGmarkers[this.getKey(a)].setImage(Logabout.Defs.pMarkerIcons+this.eWtypes[parseInt(a.wtype)][3])}else{this.lbGmarkers[this.getKey(a)].setImage(Logabout.Defs.pMarkerIcons+this.eWtypes[parseInt(a.wtype)][2])}}}},lbSetActiveMarker:function(g,c){var e=this.key(g);if(e){if(this.mrkPos!=null){if(this.key(this.mrkPos)){this.lbSetMarkerImage(this.key(this.mrkPos),false)}}this.lbSetMarkerImage(e,true);if(this.mrkPos!=this.getKey(e)){this.mrkPos=this.getKey(e);this.fireEvent("activemarkerchanged",this,e)}else{this.mrkPos=this.getKey(e)}if(this.googleMap){if(this.panOnClick){this.googleMap.panTo(this.lbGmarkers[this.getKey(e)].getLatLng())}if(this.markerInfoShow){if(this.markerType=="waypoint-1"||this.markerType=="waypoint-2"){if(e.gmapzoom>0&&this.wptEditPanel.lbeditstatus!="loaded"){this.googleMap.setZoom(Number(e.gmapzoom))}}if(this.useTabMarker){var f=new Array();var b=null;var a=false;for(var d=0;d<this.markerTemplate.length;d++){b=this.markerTemplate[d].tpl.applyTemplate(e);if(b.length>0){f.push(new GInfoWindowTab(this.markerTemplate[d].label,b));if(d==2){a=true}}}this.lbGmarkers[this.getKey(e)].openInfoWindowTabsHtml(f,{selectedTab:a?f.length-1:0})}else{if(c!=null){this.lbGmarkers[this.getKey(e)].openInfoWindowHtml(c.applyTemplate((e)))}else{this.lbGmarkers[this.getKey(e)].openInfoWindowHtml(this.markerTemplate.applyTemplate((e)))}}}}}},lbAtFirst:function(){if(this.mrkPos==this.getKey(this.first())){return true}else{return false}},lbAtLast:function(){if(this.mrkPos==this.getKey(this.last())){return true}else{return false}},lbSetActiveNext:function(){if(this.markersHidden){return}if(!this.lbAtLast()){var a=this.indexOfKey(this.mrkPos)+1;this.lbSetActiveMarker(this.getKey(this.itemAt(a)));return true}else{return false}},lbSetActivePrev:function(){if(this.markersHidden){return}if(!this.lbAtFirst()){var a=this.indexOfKey(this.mrkPos)-1;this.lbSetActiveMarker(this.getKey(this.itemAt(a)));return true}else{return false}},lbSetActiveStart:function(){if(this.markersHidden){return}var a=0;this.lbSetActiveMarker(this.getKey(this.itemAt(a)));return true},lbBasicDist:function(d,c,b,a){return(3958*3.1415926*Math.sqrt((b-d)*(b-d)+Math.cos(b/57.29578)*Math.cos(d/57.29578)*(a-c)*(a-c))/180)},lbZoomToMarkers:function(){if(this.googleMap){if(typeof this.colzoomlevel=="object"){if(this.colzoomlevel.hardzoom){this.googleMap.setZoom(this.colzoomlevel.hardzoom)}else{this.sort(this.colzoomlevel.sortDir,this.colzoomlevel.sortFunc);var k=0;var n=0;var j=this.colzoomlevel.zfactor;if(this.getCount()>0){var a=0.01;var i=new GLatLng(this.colzoomlevel.centerlat,this.colzoomlevel.centerlng);var o=new GLatLngBounds(i,new GLatLng(this.colzoomlevel.centerlat+a,this.colzoomlevel.centerlng+a));this.each(function(s){k+=this.lbBasicDist(s.lat,s.lng,this.colzoomlevel.centerlat,this.colzoomlevel.centerlng)},this);k=parseFloat(k/this.getCount());this.each(function(s){n=this.lbBasicDist(s.lat,s.lng,o.getCenter().lat(),o.getCenter().lng());if(this.colzoomlevel.doNotUseFactor||(parseFloat(n)/k)<parseFloat(j)||this.getCount()<3){if(!o.contains(this.lbGmarkers[this.getKey(s)].getLatLng())){o.extend(this.lbGmarkers[this.getKey(s)].getLatLng())}}},this);var c=this.googleMap.getBoundsZoomLevel(o)>1?this.googleMap.getBoundsZoomLevel(o)-1:1;this.googleMap.setZoom(c);this.googleMap.panTo(o.getCenter())}}}else{if(this.colzoomlevel){var h=parseInt(this.colzoomlevel);if(h==199){return}else{if(h==99){var k=0;var m=0;var e=null;var r=null;var b=null;var p=null;this.each(function(s){if(b&&p){m++;k+=this.lbBasicDist(s.lat,s.lng,b,p)}b=parseFloat(s.lat);p=parseFloat(s.lng)},this);k=parseFloat(k/m);var n=0;var j=0.8;var l=null;if(this.getCount()>1){var a=0.01;var d=this.lbGmarkers[this.getKey(this.first())].getLatLng().lat()+a;var f=this.lbGmarkers[this.getKey(this.first())].getLatLng().lng()+a;var g=new GLatLng(d,f);var o=new GLatLngBounds(this.lbGmarkers[this.getKey(this.first())].getLatLng(),g);this.each(function(s){if(l){n=this.lbBasicDist(s.lat,s.lng,l.lat,l.lng);if((parseFloat(n)/k)<parseFloat(j)){if(!o.contains(this.lbGmarkers[this.getKey(l)].getLatLng())){o.extend(this.lbGmarkers[this.getKey(l)].getLatLng())}}}l=s},this);this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(o));this.googleMap.panTo(o.getCenter())}}else{if(h>0){if(h>this.getCount()){h=this.getCount()}if(this.getCount()>1){var a=0.01;var d=this.lbGmarkers[this.getKey(this.first())].getLatLng().lat()+a;var f=this.lbGmarkers[this.getKey(this.first())].getLatLng().lng()+a;var g=new GLatLng(d,f);var o=new GLatLngBounds(this.lbGmarkers[this.getKey(this.first())].getLatLng(),g);var q=0;this.each(function(s){q++;if(q<=h){if(!o.contains(this.lbGmarkers[this.getKey(s)].getLatLng())){o.extend(this.lbGmarkers[this.getKey(s)].getLatLng())}}},this);this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(o));this.googleMap.panTo(o.getCenter())}}}}}else{if(this.getCount()>1){var a=0.01;var d=this.lbGmarkers[this.getKey(this.first())].getLatLng().lat()+a;var f=this.lbGmarkers[this.getKey(this.first())].getLatLng().lng()+a;var g=new GLatLng(d,f);var o=new GLatLngBounds(this.lbGmarkers[this.getKey(this.first())].getLatLng(),g);this.each(function(s){if(!o.contains(this.lbGmarkers[this.getKey(s)].getLatLng())){o.extend(this.lbGmarkers[this.getKey(s)].getLatLng())}},this);this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(o));this.googleMap.panTo(o.getCenter())}}}}},lbShowAll:function(){if(this.googleMap){this.each(function(c){this.lbGmarkers[this.getKey(c)].show()},this);if(this.polyLineShow){this.polyLine.show()}if(this.polyMasterShow){this.lbSetMasterPolyStyle(true)}}this.markersHidden=false;if(this.mrkPos!=null){if(this.key(this.mrkPos)){this.lbSetMarkerImage(this.key(this.mrkPos),false)}this.mrkPos=null}for(var b=0,a=this.showwithar.length;b<a;b++){if(this.mapMan.mrkCols[this.showwithar[b]]){if(this.mapMan.mrkCols[this.showwithar[b]].markersHidden){this.mapMan.mrkCols[this.showwithar[b]].lbShowAll()}}}},lbHideAll:function(){if(this.googleMap){this.each(function(a){this.lbGmarkers[this.getKey(a)].hide()},this);if(this.polyLine){this.polyLine.hide()}if(this.polyMasterShow){this.lbSetMasterPolyStyle(false)}}this.markersHidden=true},lbClear:function(){if(this.googleMap){this.each(function(a){GEvent.clearInstanceListeners(this.lbGmarkers[this.getKey(a)]);this.googleMap.removeOverlay(this.lbGmarkers[this.getKey(a)]);delete this.lbGmarkers[this.getKey(a)];if(this.lbPolyMastersAr[this.getKey(a)]!=null){this.googleMap.removeOverlay(this.lbPolyMastersAr[this.getKey(a)]);delete this.lbPolyMastersAr[this.getKey(a)]}},this);if(this.polyLine){GEvent.clearInstanceListeners(this.polyLine);this.googleMap.removeOverlay(this.polyLine)}this.lbGmarkers.length=0;this.googleMap.closeInfoWindow()}Logabout.MarkerCol.superclass.clear.call(this)}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.WindowShow=function(c,b,a){Logabout.MarkerCol.WindowShow.superclass.constructor.call(this,c,b,a);this.handler_waypointcancelled=function(){this.fireEvent("marker_waypointcancelled",this.id)};this.enablePopUpWin=false};Ext.extend(Logabout.MarkerCol.WindowShow,Logabout.MarkerCol,{lbCreateMarkers:function(){this.wptEditContainer=new Ext.Window({width:450,height:450,hidden:true,resizable:false,modal:false,border:false,frame:true,plain:true,title:"windowshow",html:"template goes here",listeners:{show:function(a){if(this.useTabMarker){a.body.dom.innerHTML=this.markerTemplate[0].tpl.applyTemplate(this.key(this.mrkPos))}else{a.body.dom.innerHTML=this.markerTemplate.applyTemplate(this.key(this.mrkPos))}if(this.infoCallBackFunc){this.infoCallBackFunc()}},hide:this.handler_waypointcancelled,scope:this}})},lbWindowBodyHtml:"",lbWindowShowAndUpdate:function(a){if(!this.enablePopUpWin){return}if(this.wptEditContainer){this.wptEditContainer.show()}},lbWindowHide:function(){if(this.wptEditContainer){this.wptEditContainer.hide()}},lbSetActiveMarker:function(b){var a=this.key(b);if(a){if(this.mrkPos!=this.getKey(a)){this.mrkPos=this.getKey(a);this.fireEvent("activemarkerchanged",this,a)}else{this.mrkPos=this.getKey(a)}this.lbWindowShowAndUpdate()}},lbShowAll:function(){if(!this.enablePopUpWin){return}this.lbWindowShowAndUpdate();this.markersHidden=false;this.mrkPos=null},lbHideAll:function(){if(!this.enablePopUpWin){return}this.lbWindowHide();this.markersHidden=true},lbClear:function(){if(!this.enablePopUpWin){return}this.lbWindowHide();Logabout.MarkerCol.WindowShow.superclass.clear.call(this)},lbZoomToMarkers:function(){return},lbCreateOrUpdatePolyLine:function(){return}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.WindowEdit=function(c,b,a){Logabout.MarkerCol.WindowEdit.superclass.constructor.call(this,c,b,a);this.isEditMarker=a.isEditMarker===true?true:false;this.wptEditPanel=a.wptEditPanel||null;this.handler_waypointsaved=function(){this.wptEditContainer.hide();this.fireEvent("marker_waypointsaved",arguments)};this.handler_waypointcancelled=function(){this.wptEditContainer.hide();this.fireEvent("marker_waypointcancelled",this.id)}};Ext.extend(Logabout.MarkerCol.WindowEdit,Logabout.MarkerCol,{lbCreateMarkers:function(){if(!this.wptEditContainer){this.wptEditContainer=new Ext.Window({width:this.wptEditPanel.lbContainerW,height:this.wptEditPanel.lbContainerH,closeAction:"hide",hidden:true,resizable:false,modal:true,border:false,frame:true,plain:true,title:this.wptEditPanel.lbtitle,items:[this.wptEditPanel],listeners:{show:function(a){this.wptEditPanel.show();this.wptEditContainer.doLayout()},beforehide:function(a){this.wptEditPanel.hide()},hide:function(a){},scope:this}})}if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}this.wptEditPanel.on({waypointsaved:{fn:this.handler_waypointsaved,scope:this},waypointcancelled:{fn:this.handler_waypointcancelled,scope:this}});this.wptEditPanel.updateAccuracy(8)},lbSetActiveMarker:function(b){var a=this.key(b);if(a){if(this.mrkPos!=this.getKey(a)){this.mrkPos=this.getKey(a);this.fireEvent("activemarkerchanged",this,a)}else{this.mrkPos=this.getKey(a)}this.wptEditContainer.show();this.wptEditPanel.prepareShow()}},lbShowAll:function(){this.wptEditContainer.show();this.markersHidden=false;this.mrkPos=null},lbHideAll:function(){this.wptEditContainer.hide();this.markersHidden=true},lbClear:function(){this.wptEditContainer.hide();Logabout.MarkerCol.WindowEdit.superclass.clear.call(this)},lbZoomToMarkers:function(){return},lbCreateOrUpdatePolyLine:function(){return}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.WaypointCombo=function(c,b,a){Logabout.MarkerCol.WaypointCombo.superclass.constructor.call(this,c,b,a)};Ext.extend(Logabout.MarkerCol.WaypointCombo,Logabout.MarkerCol,{lbCreateOrUpdatePolyLine:function(){return},lbGetIcon:function(b){if(this.googleMap){if(this.gIcons[b]){return this.gIcons[b]}else{var a=new GIcon();a.image=Logabout.Defs.pMarkerIcons+b;a.shadow=Logabout.Defs.pMarkerIcons+"shadow.png";a.iconSize=new GSize(23,34);a.shadowSize=new GSize(52,29);a.iconAnchor=new GPoint(7,34);a.infoWindowAnchor=new GPoint(10,1);this.gIcons[b]=a;return a}}else{return null}}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.DragEdit=function(c,b,a){Logabout.MarkerCol.DragEdit.superclass.constructor.call(this,c,b,a);this.isEditMarker=a.isEditMarker===true?true:false;this.useReverseGeocoding=a.reverseGeo===true?true:false;this.wptEditPanel=a.wptEditPanel||null;this.lbclearListeners=function(){if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}if(this.wptEditPanel.hasListener("waypointpositionUIchanged")){this.wptEditPanel.un("waypointpositionUIchanged",this.handler_waypointpositionUIchanged,this)}if(this.wptEditPanel.hasListener("waypointgeocoderequest")){this.wptEditPanel.un("waypointgeocoderequest",this.handler_waypointgeocoderequest,this)}if(this.wptEditPanel.hasListener("waypointzoomrequest")){this.wptEditPanel.un("waypointzoomrequest",this.handler_waypointzoomrequest,this)}if(this.zoomListener){GEvent.removeListener(this.zoomListener)}};this.handler_waypointsaved=function(){this.lbclearListeners();this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointsaved",arguments)};this.handler_waypointcancelled=function(){this.lbclearListeners();this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointcancelled",this,this.id)};this.handler_waypointpositionUIchanged=function(f,e){this.googleMap.closeInfoWindow();var d=this.lbGmarkers[this.getKey(this.itemAt(0))];if(e.lat){d.setLatLng(new GLatLng(e.lat,d.getLatLng().lng()))}else{if(e.lng){d.setLatLng(new GLatLng(d.getLatLng().lat(),e.lng))}}this.googleMap.setZoom(15);GEvent.trigger(d,"click")};this.handler_waypointgeocoderequest=function(e,d){if(this.geoCoder){this.wptEditPanel.updateGeoCodeStatus("SEARCH");this.geoCoder.getLocations(d,(function(f){if(f.Status.code==G_GEO_SUCCESS){this.googleMap.closeInfoWindow();var g=this.lbGmarkers[this.getKey(this.itemAt(0))];var h=new GLatLngBounds(new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.south,f.Placemark[0].ExtendedData.LatLonBox.west),new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.north,f.Placemark[0].ExtendedData.LatLonBox.east));g.setLatLng(new GLatLng(f.Placemark[0].Point.coordinates[1],f.Placemark[0].Point.coordinates[0]));this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(h));GEvent.trigger(g,"click");this.wptEditPanel.updateGeoCodeStatus("OK",f.Placemark[0].address)}else{this.wptEditPanel.updateGeoCodeStatus("NOTFOUND")}}).createDelegate(this))}else{this.wptEditPanel.updateGeoCodeStatus("NOCODER")}};this.handler_waypointzoomrequest=function(e,d,f){if(f){this.googleMap.setZoom(f)}else{switch(d){case"zin":this.googleMap.zoomIn();break;case"zout":this.googleMap.zoomOut();break;default:break}}}};Ext.extend(Logabout.MarkerCol.DragEdit,Logabout.MarkerCol,{lbCreateMarkers:function(){if(this.googleMap){this.lbGmarkers=new Array();if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}if(this.wptEditPanel.hasListener("waypointpositionUIchanged")){this.wptEditPanel.un("waypointpositionUIchanged",this.handler_waypointpositionUIchanged,this)}if(this.wptEditPanel.hasListener("waypointgeocoderequest")){this.wptEditPanel.un("waypointgeocoderequest",this.handler_waypointgeocoderequest,this)}if(this.wptEditPanel.hasListener("waypointzoomrequest")){this.wptEditPanel.un("waypointzoomrequest",this.handler_waypointzoomrequest,this)}this.wptEditPanel.on({waypointsaved:{fn:this.handler_waypointsaved,scope:this},waypointcancelled:{fn:this.handler_waypointcancelled,scope:this},waypointpositionUIchanged:{fn:this.handler_waypointpositionUIchanged,scope:this},waypointgeocoderequest:{fn:this.handler_waypointgeocoderequest,scope:this},waypointzoomrequest:{fn:this.handler_waypointzoomrequest,scope:this}});if(this.zoomListener){GEvent.removeListener(this.zoomListener)}this.zoomListener=GEvent.addListener(this.googleMap,"zoomend",(function(b,a){this.wptEditPanel.MarkerUpdateZoom(a)}).createDelegate(this));this.each(function(d,b,c){if(!this.lbGmarkers[this.getKey(d)]){var e={icon:this.lbGetIcon("sf_new.png"),draggable:true};var a=new GMarker(new GLatLng(parseFloat(d.lat),parseFloat(d.lng)),e);GEvent.addListener(a,"click",(function(){this.fireEvent("markerclicked",this,d);this.lbSetActiveMarker(this.getKey(d))}).createDelegate(this));GEvent.addListener(a,"infowindowopen",(function(){this.wptEditPanel.MarkerUpdatePosition(a.getLatLng().lat().toFixed(6),a.getLatLng().lng().toFixed(6),this.googleMap.getZoom());this.lbPositionUpdated(d,a.getLatLng());if(this.geoCoder&&this.useReverseGeocoding){this.geoCoder.getLocations(a.getLatLng(),(function(f){if(f.Status.code==G_GEO_SUCCESS){var g=null;var h=null;var j=null;var i=null;if(f.Placemark[0].AddressDetails.Country){g=f.Placemark[0].AddressDetails.Country}if(g&&g.AdministrativeArea){h=g.AdministrativeArea}if(h&&h.Locality){j=h.Locality}if(h&&h.AddressLine){i=h.AddressLine}this.wptEditPanel.updateCityStateCountry((j?j.LocalityName:(i?i[0]:null)),(h?h.AdministrativeAreaName:null),(g?g.CountryName:null))}else{this.wptEditPanel.updateCityStateCountry(null,null,null)}}).createDelegate(this))}}).createDelegate(this));GEvent.addListener(a,"dragstart",(function(){this.wptEditPanel.tryBlurFocus()}).createDelegate(this));GEvent.addListener(a,"dragend",(function(){GEvent.trigger(a,"click")}).createDelegate(this));this.googleMap.addOverlay(a);a.hide();this.lbGmarkers[this.getKey(d)]=a}},this)}},lbSetMarkerImage:function(b,a){return}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.InfoEdit=function(c,b,a){Logabout.MarkerCol.InfoEdit.superclass.constructor.call(this,c,b,a);this.isEditMarker=a.isEditMarker===true?true:false;this.useReverseGeocoding=a.reverseGeo===true?true:false;this.wptEditPanel=a.wptEditPanel||null;this.handler_waypointsaved=function(){this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointsaved",arguments)};this.handler_waypointcancelled=function(){this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointcancelled",this,this.id)};this.handler_waypointpositionUIchanged=function(f,e){var d=this.lbGmarkers[this.getKey(this.itemAt(0))];if(e.lat){d.setLatLng(new GLatLng(e.lat,d.getLatLng().lng()))}else{if(e.lng){d.setLatLng(new GLatLng(d.getLatLng().lat(),e.lng))}}this.wptEditPanel.updatePosition(d.getLatLng().lat().toFixed(6),d.getLatLng().lng().toFixed(6),15);this.googleMap.closeInfoWindow();this.googleMap.setZoom(15);GEvent.trigger(d,"click")};this.handler_waypointgeocoderequest=function(e,d){if(this.geoCoder){this.wptEditPanel.updateGeoCodeStatus("SEARCH");this.geoCoder.getLocations(d,(function(f){if(f.Status.code==G_GEO_SUCCESS){var g=this.lbGmarkers[this.getKey(this.itemAt(0))];var h=new GLatLngBounds(new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.south,f.Placemark[0].ExtendedData.LatLonBox.west),new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.north,f.Placemark[0].ExtendedData.LatLonBox.east));this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(h));g.setLatLng(new GLatLng(f.Placemark[0].Point.coordinates[1],f.Placemark[0].Point.coordinates[0]));this.wptEditPanel.updatePosition(g.getLatLng().lat().toFixed(6),g.getLatLng().lng().toFixed(6),this.googleMap.getZoom());this.wptEditPanel.updateGeoCodeStatus("OK",f.Placemark[0].address);this.googleMap.closeInfoWindow();GEvent.trigger(g,"click")}else{this.wptEditPanel.updateGeoCodeStatus("NOTFOUND")}}).createDelegate(this))}else{this.wptEditPanel.updateGeoCodeStatus("NOCODER")}};this.handler_waypointzoomrequest=function(e,d){switch(d){case"zin":this.googleMap.zoomIn();break;case"zout":this.googleMap.zoomOut();break;default:break}}};Ext.extend(Logabout.MarkerCol.InfoEdit,Logabout.MarkerCol,{lbCreateMarkers:function(){if(this.googleMap){this.lbGmarkers=new Array();this.each(function(d,b,c){if(!this.lbGmarkers[this.getKey(d)]){var e={icon:this.lbGetIcon("sf_new.png"),draggable:true};var a=new GMarker(new GLatLng(parseFloat(d.lat),parseFloat(d.lng)),e);GEvent.addListener(a,"click",(function(){this.fireEvent("markerclicked",this,d);this.lbSetActiveMarker(this.getKey(d))}).createDelegate(this));GEvent.addListener(a,"infowindowopen",(function(){if(!this.wptEditContainer){this.wptEditContainer=new Ext.Panel({width:this.wptEditPanel.lbEditW,height:this.wptEditPanel.lbEditH,closeAction:"hide",hidden:true,border:false,frame:false,plain:true,layout:"fit",renderTo:Ext.getBody(),items:[this.wptEditPanel],listeners:{show:function(f){this.wptEditPanel.show()},beforehide:function(f){this.wptEditPanel.hide()},scope:this}})}if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}if(this.wptEditPanel.hasListener("waypointpositionUIchanged")){this.wptEditPanel.un("waypointpositionUIchanged",this.handler_waypointpositionUIchanged,this)}if(this.wptEditPanel.hasListener("waypointgeocoderequest")){this.wptEditPanel.un("waypointgeocoderequest",this.handler_waypointgeocoderequest,this)}if(this.wptEditPanel.hasListener("waypointzoomrequest")){this.wptEditPanel.un("waypointzoomrequest",this.handler_waypointzoomrequest,this)}this.wptEditPanel.on({waypointsaved:{fn:this.handler_waypointsaved,scope:this},waypointcancelled:{fn:this.handler_waypointcancelled,scope:this},waypointpositionUIchanged:{fn:this.handler_waypointpositionUIchanged,scope:this},waypointgeocoderequest:{fn:this.handler_waypointgeocoderequest,scope:this},waypointzoomrequest:{fn:this.handler_waypointzoomrequest,scope:this}});this.zoomListener=GEvent.addListener(this.googleMap,"zoomend",(function(g,f){this.wptEditPanel.updateAccuracy(f)}).createDelegate(this));Ext.get("wptpanelmarker").insertFirst(this.wptEditContainer.getEl());this.wptEditContainer.show();this.wptEditContainer.doLayout();this.wptEditPanel.updateAccuracy(this.googleMap.getZoom());if(this.markerType=="waypoint-1"){if(d.gmapzoom>0){this.wptEditPanel.updateAccuracy(this.googleMap.getZoom(),this.googleMap.getZoom())}}if(this.geoCoder&&this.useReverseGeocoding){this.geoCoder.getLocations(a.getLatLng(),(function(f){if(f.Status.code==G_GEO_SUCCESS){var g=null;var h=null;var j=null;var i=null;if(f.Placemark[0].AddressDetails.Country){g=f.Placemark[0].AddressDetails.Country}if(g&&g.AdministrativeArea){h=g.AdministrativeArea}if(h&&h.Locality){j=h.Locality}if(h&&h.AddressLine){i=h.AddressLine}this.wptEditPanel.updateCityStateCountry((j?j.LocalityName:(i?i[0]:null)),(h?h.AdministrativeAreaName:null),(g?g.CountryName:null))}else{this.wptEditPanel.updateCityStateCountry(null,null,null)}}).createDelegate(this))}}).createDelegate(this));GEvent.addListener(a,"dragstart",(function(){this.wptEditPanel.tryBlurFocus()}).createDelegate(this));GEvent.addListener(a,"dragend",(function(){this.wptEditPanel.updatePosition(a.getLatLng().lat().toFixed(6),a.getLatLng().lng().toFixed(6),this.googleMap.getZoom());GEvent.trigger(a,"click")}).createDelegate(this));GEvent.addListener(a,"infowindowbeforeclose",(function(){GEvent.removeListener(this.zoomListener);this.wptEditContainer.hide()}).createDelegate(this));this.googleMap.addOverlay(a);a.hide();this.lbGmarkers[this.getKey(d)]=a}},this)}},lbSetMarkerImage:function(b,a){return}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.DragEditVicinity=function(c,b,a){Logabout.MarkerCol.DragEditVicinity.superclass.constructor.call(this,c,b,a);this.isEditMarker=a.isEditMarker===true?true:false;this.useReverseGeocoding=a.reverseGeo===true?true:false;this.wptEditPanel=a.wptEditPanel||null;this.busyzooming=false;this.lbclearListeners=function(){if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}if(this.wptEditPanel.hasListener("waypointpositionUIchanged")){this.wptEditPanel.un("waypointpositionUIchanged",this.handler_waypointpositionUIchanged,this)}if(this.wptEditPanel.hasListener("waypointgeocoderequest")){this.wptEditPanel.un("waypointgeocoderequest",this.handler_waypointgeocoderequest,this)}if(this.wptEditPanel.hasListener("waypointzoomrequest")){this.wptEditPanel.un("waypointzoomrequest",this.handler_waypointzoomrequest,this)}if(this.wptEditPanel.hasListener("waypointpanto")){this.wptEditPanel.un("waypointpanto",this.handler_waypointpanto,this)}if(this.zoomListener){GEvent.removeListener(this.zoomListener)}};this.handler_waypointpanto=function(){var d=this.lbGmarkers[this.getKey(this.itemAt(0))];this.googleMap.panTo(d.getLatLng())};this.handler_waypointsaved=function(){this.lbclearListeners();this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointsaved",arguments)};this.handler_waypointcancelled=function(){this.lbclearListeners();this.googleMap.closeInfoWindow();this.fireEvent("marker_waypointcancelled",this,this.id)};this.handler_waypointpositionUIchanged=function(f,e){this.googleMap.closeInfoWindow();var d=this.lbGmarkers[this.getKey(this.itemAt(0))];if(e.tocenter===true){d.setLatLng(new GLatLng(this.googleMap.getCenter().lat(),this.googleMap.getCenter().lng()))}else{if(e.lat){d.setLatLng(new GLatLng(e.lat,d.getLatLng().lng()))}else{if(e.lng){d.setLatLng(new GLatLng(d.getLatLng().lat(),e.lng))}}}this.wptEditPanel.loadVicinityMarkers(d.getLatLng().lat().toFixed(6),d.getLatLng().lng().toFixed(6),this.itemAt(0).wtype,this.googleMap.getBounds().toSpan().lat().toFixed(6),this.googleMap.getBounds().toSpan().lng().toFixed(6));if(e.tocenter!==true){this.googleMap.setZoom(15)}GEvent.trigger(d,"click");this.lbSetMasterPolyStyle(this.polyMasterShow)};this.handler_waypointToVicinityPosition=function(f,e){this.googleMap.closeInfoWindow();var d=this.lbGmarkers[this.getKey(this.itemAt(0))];if(e.lat&&e.lng){d.setLatLng(new GLatLng(e.lat,e.lng))}this.itemAt(0).wtype=e.wtype;this.wptEditPanel.loadVicinityMarkers(d.getLatLng().lat().toFixed(6),d.getLatLng().lng().toFixed(6),this.itemAt(0).wtype,this.googleMap.getBounds().toSpan().lat().toFixed(6),this.googleMap.getBounds().toSpan().lng().toFixed(6));GEvent.trigger(d,"click");this.lbSetMasterPolyStyle(this.polyMasterShow)};this.handler_waypointgeocoderequest=function(e,d){if(this.geoCoder){this.wptEditPanel.updateGeoCodeStatus("SEARCH");this.geoCoder.getLocations(d,(function(f){if(f.Status.code==G_GEO_SUCCESS){this.googleMap.closeInfoWindow();var g=this.lbGmarkers[this.getKey(this.itemAt(0))];var h=new GLatLngBounds(new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.south,f.Placemark[0].ExtendedData.LatLonBox.west),new GLatLng(f.Placemark[0].ExtendedData.LatLonBox.north,f.Placemark[0].ExtendedData.LatLonBox.east));g.setLatLng(new GLatLng(f.Placemark[0].Point.coordinates[1],f.Placemark[0].Point.coordinates[0]));this.googleMap.setZoom(this.googleMap.getBoundsZoomLevel(h));GEvent.trigger(g,"click");this.wptEditPanel.loadVicinityMarkers(g.getLatLng().lat().toFixed(6),g.getLatLng().lng().toFixed(6),this.itemAt(0).wtype,this.googleMap.getBounds().toSpan().lat().toFixed(6),this.googleMap.getBounds().toSpan().lng().toFixed(6));this.wptEditPanel.updateGeoCodeStatus("OK",f.Placemark[0].address)}else{this.wptEditPanel.updateGeoCodeStatus("NOTFOUND")}}).createDelegate(this))}else{this.wptEditPanel.updateGeoCodeStatus("NOCODER")}};this.handler_waypointwtypeupdate=function(d,e){this.itemAt(0).wtype=e};this.handler_waypointzoomrequest=function(e,d,f){if(this.busyzooming==true){return}this.busyzooming=true;(function(){this.busyzooming=false}).defer(500,this);if(f){this.googleMap.setZoom(f)}else{switch(d){case"zin":this.googleMap.zoomIn();break;case"zout":this.googleMap.zoomOut();break;default:break}}}};Ext.extend(Logabout.MarkerCol.DragEditVicinity,Logabout.MarkerCol,{lbCreateMarkers:function(){if(this.googleMap){this.lbGmarkers=new Array();if(this.wptEditPanel.hasListener("waypointsaved")){this.wptEditPanel.un("waypointsaved",this.handler_waypointsaved,this)}if(this.wptEditPanel.hasListener("waypointcancelled")){this.wptEditPanel.un("waypointcancelled",this.handler_waypointcancelled,this)}if(this.wptEditPanel.hasListener("waypointpositionUIchanged")){this.wptEditPanel.un("waypointpositionUIchanged",this.handler_waypointpositionUIchanged,this)}if(this.wptEditPanel.hasListener("waypointToVicinityPosition")){this.wptEditPanel.un("waypointToVicinityPosition",this.handler_waypointToVicinityPosition,this)}if(this.wptEditPanel.hasListener("waypointgeocoderequest")){this.wptEditPanel.un("waypointgeocoderequest",this.handler_waypointgeocoderequest,this)}if(this.wptEditPanel.hasListener("waypointzoomrequest")){this.wptEditPanel.un("waypointzoomrequest",this.handler_waypointzoomrequest,this)}if(this.wptEditPanel.hasListener("waypointwtypeupdate")){this.wptEditPanel.un("waypointwtypeupdate",this.handler_waypointwtypeupdate,this)}if(this.wptEditPanel.hasListener("waypointpanto")){this.wptEditPanel.un("waypointpanto",this.handler_waypointpanto,this)}this.wptEditPanel.on({waypointsaved:{fn:this.handler_waypointsaved,scope:this},waypointcancelled:{fn:this.handler_waypointcancelled,scope:this},waypointpositionUIchanged:{fn:this.handler_waypointpositionUIchanged,scope:this},waypointToVicinityPosition:{fn:this.handler_waypointToVicinityPosition,scope:this},waypointgeocoderequest:{fn:this.handler_waypointgeocoderequest,scope:this},waypointzoomrequest:{fn:this.handler_waypointzoomrequest,scope:this},waypointwtypeupdate:{fn:this.handler_waypointwtypeupdate,scope:this},waypointpanto:{fn:this.handler_waypointpanto,scope:this}});if(this.zoomListener){GEvent.removeListener(this.zoomListener)}this.zoomListener=GEvent.addListener(this.googleMap,"zoomend",(function(b,a){this.wptEditPanel.MarkerUpdateZoom(a);this.busyzooming=false}).createDelegate(this));this.each(function(d,b,c){if(!this.lbGmarkers[this.getKey(d)]){var e={icon:this.lbGetIcon("sf_new.png"),draggable:true};var a=new GMarker(new GLatLng(parseFloat(d.lat),parseFloat(d.lng)),e);GEvent.addListener(a,"click",(function(){this.fireEvent("markerclicked",this,d);this.lbSetActiveMarker(this.getKey(d))}).createDelegate(this));GEvent.addListener(a,"infowindowopen",(function(){this.wptEditPanel.MarkerUpdatePosition(a.getLatLng().lat().toFixed(6),a.getLatLng().lng().toFixed(6),this.googleMap.getZoom());this.lbPositionUpdated(d,a.getLatLng());if(this.geoCoder&&this.useReverseGeocoding){this.geoCoder.getLocations(a.getLatLng(),(function(f){if(f.Status.code==G_GEO_SUCCESS){var g=null;var h=null;var j=null;var i=null;if(f.Placemark[0].AddressDetails.Country){g=f.Placemark[0].AddressDetails.Country}if(g&&g.AdministrativeArea){h=g.AdministrativeArea}if(h&&h.Locality){j=h.Locality}if(h&&h.AddressLine){i=h.AddressLine}this.wptEditPanel.updateCityStateCountry((j?j.LocalityName:(i?i[0]:null)),(h?h.AdministrativeAreaName:null),(g?g.CountryName:null))}else{this.wptEditPanel.updateCityStateCountry(null,null,null)}}).createDelegate(this))}}).createDelegate(this));GEvent.addListener(a,"dragstart",(function(){this.wptEditPanel.tryBlurFocus()}).createDelegate(this));GEvent.addListener(a,"dragend",(function(){GEvent.trigger(a,"click");this.wptEditPanel.loadVicinityMarkers(a.getLatLng().lat().toFixed(6),a.getLatLng().lng().toFixed(6),d.wtype,this.googleMap.getBounds().toSpan().lat().toFixed(6),this.googleMap.getBounds().toSpan().lng().toFixed(6))}).createDelegate(this));this.googleMap.addOverlay(a);this.wptEditPanel.loadVicinityMarkers(a.getLatLng().lat().toFixed(6),a.getLatLng().lng().toFixed(6),d.wtype,this.googleMap.getBounds().toSpan().lat().toFixed(6),this.googleMap.getBounds().toSpan().lng().toFixed(6));a.hide();this.lbGmarkers[this.getKey(d)]=a}},this)}},lbSetMarkerImage:function(b,a){return}});Ext.namespace("Logabout.MarkerCol");Logabout.MarkerCol.Vicinity=function(c,b,a){Logabout.MarkerCol.Vicinity.superclass.constructor.call(this,c,b,a)};Ext.extend(Logabout.MarkerCol.Vicinity,Logabout.MarkerCol,{lbCreateOrUpdatePolyLine:function(){return},lbSetMarkerImage:function(b,a){return},lbGetIcon:function(b){if(this.googleMap){if(this.gIcons[b]){return this.gIcons[b]}else{var a=new GIcon();a.image=Logabout.Defs.pMarkerIcons+"mastermrk.png";a.shadow=Logabout.Defs.pMarkerIcons+"shadow-mastermrk.png";a.iconSize=new GSize(10,10);a.shadowSize=new GSize(16,10);a.iconAnchor=new GPoint(5,5);a.infoWindowAnchor=new GPoint(5,5);this.gIcons[b]=a;return a}}else{return null}}});Ext.namespace("Logabout");Logabout.MapMgr2=function(b,a,c){this.addEvents("mapmarkerclicked","mapmgrhidecol","mapmgrcolchanged","mapmgritmchanged","mapzoomed");this.mrkCols={};this.activeCol=null;this.activeItm=null;this.ColItmHistory=[];this.map=b;this.geocoder=c;this.getMapCenterInCustomLatLng=function(){if(this.map){return{lat:this.map.getCenter().lat().toFixed(6),lng:this.map.getCenter().lng().toFixed(6)}}else{return{lat:45.89,lng:-115.678}}};this.getMapSpanInCustomLatLng=function(){if(this.map){return{lat:this.map.getBounds().toSpan().lat().toFixed(6),lng:this.map.getBounds().toSpan().lng().toFixed(6)}}else{return{lat:45.89,lng:-115.678}}};this.addColItmHistory=function(e,f){if(this.mrkCols[e].addToHistory===false){return}if(this.ColItmHistory.length>0){var d=this.ColItmHistory[this.ColItmHistory.length-1]}else{var d={dt:new Date(),colid:0,itmid:0}}if(d.colid!=e||d.itmid!=f){this.ColItmHistory.push({dt:new Date(),colid:e,itmid:f})}if(this.ColItmHistory.length>10){this.ColItmHistory.splice(0,this.ColItmHistory.length-10)}};this.ActivatePrevHistEntry=function(f){var e=0;for(var d=this.ColItmHistory.length-1;d>=0;d--){if(f){if(f!=this.ColItmHistory[d].colid){e=this.ColItmHistory[d];break}}else{e=this.ColItmHistory[d];break}}if(e!=0){if(e.itmid!=null){this.colItemSelected(e.colid,e.itmid)}else{this.setActiveCol(e.colid)}}};this.setActiveCol=function(d){if(this.mrkCols[d]){if(this.mrkCols[d].getCount()>0){this.colItemSelected(d,this.mrkCols[d].getKey(this.mrkCols[d].first()))}}};this.colItemSelected=function(g,h){if(this.mrkCols[g]){for(var f in this.mrkCols){if(g!=f){this.mrkCols[f].lbHideAll(g);this.fireEvent("mapmgrhidecol",this,f)}}var e=this.mrkCols[g].item(h);this.mrkCols[g].lbShowAll(g);if(this.mrkCols.searchman){var d=new Array();for(var f in this.mrkCols){if("searchman"!=f){this.mrkCols[f].eachKey(function(j,i){d.push(j)})}}this.mrkCols.searchman.lbShowWithout(d)}if(this.activeCol!=g){this.mrkCols[g].lbZoomToMarkers();this.mrkCols[g].lbSetActiveMarker(h);this.fireEvent("mapmgrcolchanged",this,g,h,e,this.mrkCols[g].lbAtFirst(),this.mrkCols[g].lbAtLast(),this.activeCol)}else{this.mrkCols[g].lbSetActiveMarker(h)}this.activeCol=g;this.activeItm=h;this.addColItmHistory(g,h)}};this.refreshAdd=function(f,e,g,d){if(this.mrkCols[f]){this.mrkCols[f].lbRefreshAddFromRecArray(g)}else{this.addCollection(f,e,g,d)}};this.addCollection=function(f,e,g,d){if(!this.mrkCols[f]){d.mapman=this;d.id=f;d.map=this.map;d.geocoder=this.geocoder;if(!d.markerType){d.markerType="display-1"}switch(d.markerType){case"wizard-1":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol.InfoEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this})}else{this.mrkCols[f]=new Logabout.MarkerCol.WindowEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this})}break;case"waypoint-1":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol.InfoEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this})}else{this.mrkCols[f]=new Logabout.MarkerCol.WindowEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this})}break;case"waypoint-2":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol.DragEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},marker_waypointsaved:function(h){this.ActivatePrevHistEntry(f)},marker_waypointcancelled:function(h){this.ActivatePrevHistEntry(f)},scope:this})}else{if(d.wptEditPanel){d.wptEditPanel.updateAccuracy(15)}}break;case"drageditvicinity":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol.DragEditVicinity(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},marker_waypointsaved:function(h){this.ActivatePrevHistEntry(f)},marker_waypointcancelled:function(h){this.ActivatePrevHistEntry(f)},scope:this})}else{if(d.wptEditPanel){d.wptEditPanel.updateAccuracy(15)}}break;case"vicinity-1":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol.Vicinity(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this})}break;case"trip-1":this.mrkCols[f]=new Logabout.MarkerCol.WindowEdit(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},marker_waypointsaved:function(h){this.ActivatePrevHistEntry(f)},marker_waypointcancelled:function(h){this.ActivatePrevHistEntry(f)},scope:this});break;case"search-1":this.mrkCols[f]=new Logabout.MarkerCol.Search(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast())},scope:this});break;case"display-1":if(this.map){this.mrkCols[f]=new Logabout.MarkerCol(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast());this.addColItmHistory(f,this.mrkCols[h.id].getKey(i))},scope:this})}else{this.mrkCols[f]=new Logabout.MarkerCol.WindowShow(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast());this.addColItmHistory(f,this.mrkCols[h.id].getKey(i))},scope:this})}break;case"movemap-1":this.mrkCols[f]=new Logabout.MarkerCol.MoveMap(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromPlainArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast());this.addColItmHistory(f,this.mrkCols[h.id].getKey(i))},scope:this});break;case"searchcenter-1":this.mrkCols[f]=new Logabout.MarkerCol.SearchCenter(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast());this.addColItmHistory(f,this.mrkCols[h.id].getKey(i))},scope:this});break;case"waypointcombo-1":this.mrkCols[f]=new Logabout.MarkerCol.WaypointCombo(false,function(h){return h[e]},d);this.mrkCols[f].lbAddAllFromRecArray(g);this.mrkCols[f].on({markerclicked:function(h,i){this.fireEvent("mapmarkerclicked",h,i)},activemarkerchanged:function(h,i){this.fireEvent("mapmgritmchanged",this,h.id,i[e],i,this.mrkCols[h.id].lbAtFirst(),this.mrkCols[h.id].lbAtLast());this.addColItmHistory(f,this.mrkCols[h.id].getKey(i))},scope:this});break}}else{this.mrkCols[f].colzoomlevel=d.colzoomlevel;this.mrkCols[f].lbUpdateAllFromRecArray(g)}};this.appendToCollection=function(d,e){this.mrkCols[d].lbAddAllFromRecArray(e)};this.removeCollection=function(d){this.mrkCols[d].lbClear();this.mrkCols[d]=null;delete this.mrkCols[d]};this.MoveNext=function(){return this.mrkCols[this.activeCol].lbSetActiveNext()};this.MovePrev=function(){return this.mrkCols[this.activeCol].lbSetActivePrev()};this.MoveStart=function(){return this.mrkCols[this.activeCol].lbSetActiveStart()};Logabout.MapMgr2.superclass.constructor.call(this)};Ext.extend(Logabout.MapMgr2,Ext.util.Observable);Ext.namespace("Logabout.Demo");Logabout.Demo.GeoCodeThis=function(a){this.addEvents("geocoderstatus","geocoderesults");this.lbmapmgr=a.lbmapmgr;this.lbtplFunctions=a.lbtplFunctions;this.lburl=a.lburl;this.lbtimeout=a.lbtimeout;this.searchRadius=100;this.createFake=function(){var b=[{id:"p1",address:"why, az, usa",lat:42.6787,lng:-117.98}];return b};this.geocode=function(c){this.fireEvent("geocoderstatus",this,{status:"searching",address:c});if(c=="r0"){this.fireEvent("geocoderstatus",this,{status:"notfound",address:c});return}if(c=="rr0"){var b=this.createFake();this.fireEvent("geocoderstatus",this,{status:"notfound",address:"fake address",pm:b});this.tellMeSearch({celat:b[0].lat,celng:b[0].lng,searchAddress:c,radius:this.searchRadius});return}var d=null;if(typeof GClientGeocoder=="undefined"){var b=this.createFake();this.fireEvent("geocoderstatus",this,{status:"found",address:"fake address",pm:b});this.tellMeSearch({celat:b[0].lat,celng:b[0].lng,searchAddress:"fake address",radius:this.searchRadius})}else{d=new GClientGeocoder();d.getLocations(c,(function(g){if(g.Placemark){var h=new Array();for(var f=0,e=g.Placemark.length;f<e&&f<5;f++){h.push({id:g.Placemark[f].id,address:g.Placemark[f].address,lat:g.Placemark[f].Point.coordinates[1],lng:g.Placemark[f].Point.coordinates[0]})}this.fireEvent("geocoderstatus",this,{status:"found",address:c,pm:h});this.tellMeSearch({celat:h[0].lat,celng:h[0].lng,searchAddress:c,radius:this.searchRadius})}else{this.fireEvent("geocoderstatus",this,{status:"notfound",address:c})}}).createDelegate(this))}};this.arRemoveUsingAr_Loguserid=function(h,b){var g=new Array();var j=false;for(var e=0,d=h.length;e<d;e++){j=false;for(var f=0,c=b.length;f<c;f++){if(h[e].loguserid==b[f].loguserid){j=true}}if(!j){g.push(h[e])}}return g};this.tellMeSearch=function(d,g){this.lastPosObj=d;var c=4;var e=d.radius/(69.1*Math.cos(d.celat/57.3))+d.celng;var f=69.1*(e-d.celng)*Math.cos(d.celat/57.3);var b=e-d.celng;d.swlat=d.celat-b;d.swlng=d.celng-b;d.nelat=d.celat+b;d.nelng=d.celng+b;d.wtypelist=[9,10,11,12,13];d.querystart=0;d.querylimit=50;(function(){var h=arguments.callee;Ext.Ajax.request({url:this.lburl,timeout:this.lbtimeout,params:{task:"dotell",browserts:new Date().format("U"),swlat:d.swlat,swlng:d.swlng,nelat:d.nelat,nelng:d.nelng,celat:d.celat,celng:d.celng,wtypelist:Ext.util.JSON.encode(d.wtypelist),start:d.querystart,limit:d.querylimit},reader:new Ext.data.JsonReader({root:"results",id:"swpid",totalProperty:"totalrows"},Ext.data.Record.create(Logabout.Defs.FullRecDef)),success:function(l,t){var k=Ext.util.JSON.decode(l.responseText);var s=new Array();var m=new Array();for(var n=0,q=k.waypoints.length;n<q;n++){if(k.waypoints[n].wtype==9&&s.length<c){s.push(k.waypoints[n])}else{if(m.length<c){m.push(k.waypoints[n])}}}var r=new Array();var p=new Date().add(Date.DAY,-30).format("U");for(var n=0,q=k.closeuser.length;n<q;n++){if(k.closeuser[n].utc>p&&r.length<c){r.push(k.closeuser[n])}}var o=this.arRemoveUsingAr_Loguserid(k.closeuser,r);if(o.length>c){o.splice(c,o.length-c)}var j=new Array();for(var n=0,q=k.recentcg.length;n<q;n++){if(j.length<c){j.push(k.recentcg[n])}}if(d.searchAddress=="rr0"){this.fireEvent("geocoderesults",this,{status:"notfound",positionobject:d});return}if(s.length==0){this.fireEvent("geocoderesults",this,{status:"notfound",positionobject:d})}else{this.fireEvent("geocoderesults",this,{status:"found",totalrows:s.length,results:s,positionobject:d})}},failure:function(i,j){Ext.Msg.show({title:"Search Error",msg:"Please click OK to try again",buttons:Ext.Msg.OK,fn:function(k){if(k=="ok"){h.defer(5,this)}},scope:this,icon:Ext.MessageBox.ERROR})},scope:this})}).defer(5,this)};Logabout.Demo.GeoCodeThis.superclass.constructor.call(this)};Ext.extend(Logabout.Demo.GeoCodeThis,Ext.util.Observable);Ext.namespace("Logabout.Demo");Logabout.Demo.NotifyBox=function(){var b;function a(c,d){if(c){return['<div class="dbnb-main">','<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>','<div class="x-box-ml"><div class="x-box-mr">','<div class="x-box-mc">','<div class="dbnb-title">',"<h3>",c,"</h3>","</div>",'<div class="dbnb-close x-tool x-tool-close"></div>','<div class="dbnb-clear"></div>',d,"</div>","</div></div>","</div>"].join("")}else{return['<div class="dbnb-main">','<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>','<div class="x-box-ml"><div class="x-box-mr">','<div class="x-box-mc">','<div class="dbnb-close x-tool x-tool-close"></div>','<div class="dbnb-left">',d,"</div>",'<div class="dbnb-clear"></div>',"</div>","</div></div>","</div>"].join("")}}return{msg:function(h,e,d,f){this.hide();var g=Ext.get("db-disp");var c=Ext.DomHelper.append(g,{html:a(h,e)},true);if(f){f.createDelegate(this,[g])()}c.alignTo(g,"t-b",[0,-(c.getHeight())]);if(d){c.slideIn("b").pause(d?d:3).ghost("b",{remove:true,callback:function(){this.hide()},scope:this})}else{c.slideIn("b")}g.child(".dbnb-close").addClassOnOver("x-tool-close-over").on("click",function(j,i){c.stopFx();c.ghost("b",{remove:true,callback:function(){this.hide()},scope:this})},this)},hide:function(){var c=Ext.get("db-disp");if(c.child("div.dbnb-main")){c.child("div.dbnb-main").stopFx();c.child("div.dbnb-main").remove()}}}}();Ext.namespace("Logabout.Demo");Logabout.Demo.SignalController=Ext.extend(Ext.util.Observable,{constructor:function(a){Ext.apply(this,a.lbstandardconfig);this.addEvents({groupiteminserted:true,groupitemdeleted:true,waypointdeleted:true,mapinactiveten:true,quicklogupdate:true,userstatsupdated:true,userpicupdated:true});this.listeners=a.listeners;if(this.lbmapmgr.map){this.gmMoveH=GEvent.addListener(this.lbmapmgr.map,"moveend",(function(){this.mapmoveSetLastActive()}).createDelegate(this))}this.mapInactiveEvSecs=15;this.timerTenStartUpSecs=2;this.timerTenTaskObj={run:function(){if(this.mapmoveActivityExpired(this.mapInactiveEvSecs)){this.fireEvent("mapinactiveten")}},scope:this,interval:5000};this.timerTenSecs=0;this.timerTenSetSchedule=function(c,b){this.timerTenSecs=c;if(c==0){Ext.TaskMgr.stop(this.timerTenTaskObj)}else{this.timerTenTaskObj.interval=c*1000;Ext.TaskMgr.start(this.timerTenTaskObj)}};Logabout.Demo.SignalController.superclass.constructor.call(this)},mapmoveSetLastActive:function(){this.mapmoveLastActiveDate=new Date()},mapmoveActivityExpired:function(a){if(!this.mapmoveLastActiveDate){return false}if(new Date().getElapsed(this.mapmoveLastActiveDate)/1000>a){return true}return false},sigLog:[],logSignalErr:function(d,e){var b=null;for(var c=0,a=this.sigLog.length;c<a;c++){if(this.sigLog[c].source==d){b=c}}if(b===null){this.sigLog.push({source:d,erramount:e})}},logSignalClear:function(c){for(var b=0,a=this.sigLog.length;b<a;b++){if(this.sigLog[b].source==c){this.sigLog.splice(b,1);break}}},refreshOK:function(){if(this.sigLog.length>0){return false}else{return true}},deleteWaypoint:function(a,b){Ext.Msg.show({title:b?"Delete Trip?":"Delete Log?",msg:b?"Do you want to delete the trip?":"Do you want to delete the log?",buttons:Ext.Msg.YESNOCANCEL,fn:function(c){if(c=="yes"){Ext.Ajax.request({url:this.lburl,params:{task:"userdatadissoc",swpid:a,sesstoken:this.cfgdsess},callback:function(e,g,d){if(g){var f=Ext.util.JSON.decode(d.responseText);if(f.error==true){Ext.MessageBox.alert("Error Deleting",f.errors[0])}else{this.fireEvent("waypointdeleted",this.lbluid,{swpid:f.swpid,mtype:f.mtype,points:parseInt(f.ifield13)});Logabout.Bridgeport.updateUserStats(this,"delete",{pntcnt:-(parseInt(f.ifield13)),pntcntchg:-(parseInt(f.ifield13)),fdrcnt:(f.mtype==1?-1:0),fdrcntchg:(f.mtype==1?-1:0),wptcnt:-1,wptcntchg:-1})}}else{Ext.MessageBox.alert("Unknown Error","An unknown error occured while attempting to delete data, please contact a system administrator.")}},scope:this})}},scope:this,icon:Ext.MessageBox.QUESTION})}});Ext.namespace("Logabout.Demo");Logabout.Demo.MemoryPanel=Ext.extend(Ext.Panel,{lbParentOwner:null,lbNextLoadNoMapAction:false,lbshowtitlebar:true,lbmapmgr:null,lbstandardconfig:null,lbconnection:null,lbbaseparams:null,lbusepager:false,lbpagesize:10,lbidprop:null,lbinitcompcallback:function(){return null},lbinitcompEVcallback:function(){if(this.lbmapmgr){this.lbmapmgr.on({mapmgrcolchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbDataView.clearSelections()}else{this.lbDataView.select(this.id+this.lbdvnodesep+a,false,true)}},mapmgritmchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbDataView.clearSelections()}else{this.lbDataView.select(this.id+this.lbdvnodesep+a,false,true)}},mapmgrhidecol:function(b,a){if(this.id==a){this.lbDataView.clearSelections()}},scope:this})}},lbafterrendercallback:function(){return null},lbfields:Logabout.Defs.FullRecDef,lbStoreSortInfo:{field:"diffdist",direction:"ASC"},lbStoreRemoteSort:false,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.body.select(".x-tool",true).addClassOnOver("x-tool-close-over").on("click",function(d,c){this.fireEvent("clickedclose",this)},this);this.body.select(".results-none",true).each(function(d,e,c){d.dom.innerHTML=this.lbresultval},this)},lbBwrapCfg:null,lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){if(this.lbshowtitlebar){return['<div class="results-maintitle"></div>','<div class="results-title-left">no results for <span class="results-none">ss</span></div>','<div class="results-title-right x-tool x-tool-close"></div>','<div class="results-clear"></div>',"</div>",'<div class="results-add">','<div class="results-add-but"></div>',"</div>"].join("")}else{return"<div>No Results</div>"}},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"results-over",selectedClass:"results-sel",itemSelector:"div.results-wrap",loadingText:"loading.."},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main">','<tpl if="this.showTitleBar()">','<div class="results-maintitle"></div>','<div class="results-title-left">results for <span class="results-searchname">{[ this.getResultVal() ]}</span></div>','<div class="results-title-right x-tool x-tool-close"></div>','<div class="results-clear"></div>',"</div>","</tpl>",'<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,35)]}","</div>",'<div class="results-item-right">',"{diffdist} miles","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>",'<div class="results-add">','<div class="results-add-but"></div>',"</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={showSection:function(a){switch(a){case"uname":return true;break;case"date":return true;break;case"dist":return true;break}},getMarkerSize:function(){return"db-mrk-standardsize"},customDate:this.lbtplFunctions.customDate,getDetail:this.lbtplFunctions.getDetail,isOwner:function(){return false},isGuest:function(){return false},getPhotoSrc:function(b){if(!b.ifield10||!b.sfield8){return false}var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return a},getItemIconClass:this.lbtplFunctions.getItemIconClass}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef},lbresultval:null,lbSetResultValue:function(a){this.lbresultval=a},initComponent:function(){Ext.apply(this,this.lbstandardconfig);if(this.lbinitcompcallback){this.lbinitcompcallback()}this.addEvents("clickedclose");this.lbinitdataviewtemplate();this.lbinitmarkercol();this.lbStore=new Ext.data.JsonStore({proxy:(this.lbconnection?new Ext.data.HttpProxy(this.lbconnection):new Ext.data.MemoryProxy()),baseParams:this.lbbaseparams,root:"results",totalProperty:"totalrows",fields:this.lbfields,idProperty:this.lbidprop,remoteSort:this.lbStoreRemoteSort,sortInfo:this.lbStoreSortInfo,listeners:{load:function(a,c,b){this.lbstoreloadhandler(a,c,b)},scope:this}});this.lbDataView=new Ext.DataView(Ext.apply({store:this.lbStore,tpl:this.lbtpl,listeners:{selectionchange:function(b,a){this.lbdataviewselectionchangehandler(b,a)},scope:this},emptyText:this.lbdataviewemptytext()},this.lbDataViewConfig));Ext.apply(this,{bwrapCfg:this.lbBwrapCfg!=null?this.lbBwrapCfg:null,items:this.lbDataView,bbar:(!this.lbusepager?null:new Ext.PagingToolbar({store:this.lbStore,displayInfo:true,pageSize:this.lbpagesize}))});if(this.lbinitcompEVcallback){this.lbinitcompEVcallback()}Logabout.Demo.MemoryPanel.superclass.initComponent.apply(this,arguments)},lbLoadData:function(d,a,b,c){this.lbNextLoadNoMapAction=false||b;if(this.lbconnection){this.lbStore.load(c)}else{this.lbStore.loadData(d,a)}},onRender:function(){Logabout.Demo.MemoryPanel.superclass.onRender.apply(this,arguments);if(this.lbafterrendercallback){this.lbafterrendercallback()}}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.NearbyWaypoints=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:1},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0}]),lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-placelogs">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<tpl if="mtype == 1">','<div class="results-item-left2 db-icon db-icon-founded">',"{logusername}","</div>","</tpl>",'<tpl if="mtype != 1">','<div class="results-item-left2 db-icon db-icon-userblue">',"{logusername}","</div>","</tpl>",'<div class="results-item-right">',"{diffdist} miles","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMyId:(function(){return this.id}).createDelegate(this),customDate:Logabout.Defs.markerTemplateFuncs.customDate,getMarkerSize:Logabout.Defs.markerTemplateFuncs.getMarkerSize,getItemIconClass:Logabout.Defs.markerTemplateFuncs.getItemIconClass,getPhotoSrc:Logabout.Defs.markerTemplateFuncs.getPhotoSrc,getDetail:Logabout.Defs.markerTemplateFuncs.getDetail}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,showWith:["waypointcombopanel"],infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.NearbyUsers=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-user"}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.logusername,85)]} ({[ this.customDate(values.utc) ]})","</div>",'<div class="results-item-right">',"{diffdist} miles","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>",'<div class="results-add">','<div class="results-add-but"></div>',"</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,showWith:["waypointcombopanel"],markstaticimage:{normal:"stumps_user.png",highlight:"stumps_user_h.png"},infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.WaypointComboPlaceLogs=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:0},{name:"show_quicklog",type:"int",defaultValue:0},{name:"show_datalog",type:"int",defaultValue:1},{name:"show_editcontrols",type:"int",defaultValue:0}]),lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}this.lbDataView.getEl().select(".memp-placelogs .user-li-debugshow",true).addClassOnOver("user-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".user-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showADTestMasterSlaveDebug(c[0],c[1])})}this.lbstoreparentloadhandler(a,b)},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getDebugUser:this.lbtplFunctions.getDebugUser});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-placelogs">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<tpl if="mtype == 1">','<div class="results-item-left2 db-icon db-icon-founded">',"{logusername}","</div>","</tpl>",'<tpl if="mtype != 1">','<div class="results-item-left2 db-icon db-icon-userblue">',"{logusername}","</div>","</tpl>",'<div class="results-item-right">',"{[ this.customDate(values.utc) ]}","</div>",'<tpl if="this.getDebugUser()">','<div class="results-item-right2 user-linkitem user-li-debugshow">debug show<div class="user-linkdata">{swpid}_{mswpid}</div></div>',"</tpl>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMyId:(function(){return this.id}).createDelegate(this),customDate:Logabout.Defs.markerTemplateFuncs.customDate,getMarkerSize:Logabout.Defs.markerTemplateFuncs.getMarkerSize,getItemIconClass:Logabout.Defs.markerTemplateFuncs.getItemIconClass,getPhotoSrc:Logabout.Defs.markerTemplateFuncs.getPhotoSrc,getDetail:Logabout.Defs.markerTemplateFuncs.getDetail}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,showWith:["waypointcombopanel"],infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserLike=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"origuserid",type:"string"},{name:"origusername",type:"string"},{name:"restype",type:"string"}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.lbDataView.getEl().select(".user-li-delete",true).addClassOnOver("user-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteGroupItem(c,"likethis");Logabout.Bridgeport.trackEvent("userlike","DVdelete","click")})},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[3])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},isOwner:(function(){return this.lbisowner}).createDelegate(this),isGuest:(function(){return this.lbguestmode}).createDelegate(this)});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,33)]} by {origusername}","</div>",'<div class="results-item-right">','<tpl if="this.isOwner() && !this.isGuest()">','<div class="results-sct-commands">','<div class="user-linkitem user-li-delete">remove<div class="user-linkdata">{swpid}</div></div>',"</div>","</tpl>","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserLists.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserLists.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserBeenHere=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"origuserid",type:"string"},{name:"origusername",type:"string"},{name:"restype",type:"string"}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.lbDataView.getEl().select(".user-li-delete",true).addClassOnOver("user-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteGroupItem(c,"beenhere");Logabout.Bridgeport.trackEvent("userbeenhere","DVdelete","click")})},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[3])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},isOwner:(function(){return this.lbisowner}).createDelegate(this),isGuest:(function(){return this.lbguestmode}).createDelegate(this)});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,33)]} by {origusername}","</div>",'<div class="results-item-right">','<tpl if="this.isOwner() && !this.isGuest()">','<div class="results-sct-commands">','<div class="user-linkitem user-li-delete">remove<div class="user-linkdata">{swpid}</div></div>',"</div>","</tpl>","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserLists.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserLists.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserFavorite=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"origuserid",type:"string"},{name:"origusername",type:"string"},{name:"restype",type:"string"}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.lbDataView.getEl().select(".user-li-delete",true).addClassOnOver("user-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteGroupItem(c,"favorite");Logabout.Bridgeport.trackEvent("userfavorite","DVdelete","click")})},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[3])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},isOwner:(function(){return this.lbisowner}).createDelegate(this),isGuest:(function(){return this.lbguestmode}).createDelegate(this)});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,33)]} by {origusername}","</div>",'<div class="results-item-right">','<tpl if="this.isOwner() && !this.isGuest()">','<div class="results-sct-commands">','<div class="user-linkitem user-li-delete">remove<div class="user-linkdata">{swpid}</div></div>',"</div>","</tpl>","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserLists.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserLists.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserFounded=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"logcount",type:"int"}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[3])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-userfounded">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,33)]}","</div>",'<div class="results-item-left2">',"{[this.customDate(values.utc)]}","</div>",'<div class="results-item-right">',"{logcount} log(s)","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserFounded.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserFounded.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.PeopleLeaderBoard=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"utc",type:"date",dateFormat:"U"},{name:"loguserid"},{name:"username"},{name:"fdrcnt"},{name:"fdrcntchg"},{name:"lastutc"},{name:"pntcnt"},{name:"pntcntchg"},{name:"pntrank"},{name:"pntrankchg"},{name:"wptcnt"},{name:"wptcntchg"},{name:"picPath"},{name:"picWidth"},{name:"picHeight"}]),lbStoreSortInfo:{field:"sumstatorder",direction:"ASC"},lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"loguserid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.lbDataView.getEl().select(".leader-li-showrecent",true).addClassOnOver("leader-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".leader-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(c[0],c[1],null,null,"alltrips",false,null,null,true,{showtab:"waypoints"});Logabout.Bridgeport.trackEvent("peopleleaderboard","DVshowrecent","click")})},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"leader-over",selectedClass:"leader-sel",itemSelector:"div.leader-wrap",loadingText:"loading.."},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getProfilePicImgSrc:function(a){if(a){return'<img src="'+Logabout.Defs.pPicFilePath+a+'"></img>'}else{return'<img src="'+Logabout.Defs.pPicFilePath+'blankpicplaceholder.jpg"></img>'}}});this.lbtpl.compile()},lbtpldef:['<div class="leader-main">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{loguserid}" class="leader-wrap">','<div class="leader-username">',"<div>{[ fm.ellipsis(values.username,20) ]}</div>","</div>",'<div class="leader-pic">',"{[ this.getProfilePicImgSrc(values.picPath) ]}","</div>",'<div class="leader-right">',"<div>rank: {pntrank}</div>","<div>places: {fdrcnt}</div>","<div>points: {pntcnt}</div>","</div>","</div>","</tpl>",'<div class="leader-clear"></div>',"</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,markstaticimage:{normal:"stumps_user.png",highlight:"stumps_user_h.png"},infoCallBackFunc:function(){Ext.select(".db-mrk-recent .db-li-showdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,"alltrips",false,null,null,true,{showtab:"waypoints"});Logabout.Bridgeport.trackEvent("peopleleaderboard","MRKshowrecent","click")},this)},markerTemplateDef:['<div class="db-mrk-main db-mrk-recent">','<tpl for=".">','<div class="db-mrk-name">{[fm.ellipsis(values.username,25)]}</div>','<div class="db-icon db-icon-clock">{[ this.customDate(values.utc) ]}</div>','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showdetails">view details<span class="db-mrk-linkdata">{loguserid}_{username}</span></span>',"</div>","</tpl>","</div>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserEditVicinity=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbinitcompcallback:function(){this.addEvents("lbstoreload");this.lbmarkercolconfig.showWith=[this.lbshowwithar];this.on("afterrender",function(a){this.bwrap.select(".x-tool",true).addClassOnOver("x-tool-close-over");this.bwrap.on("click",function(c,b){this.lbParentOwner.resultsCloseHandler()},this,{delegate:".x-tool"})},this)},lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}Ext.select(".results-iconcommands .db-mrk-linkitem.db-li-positionhere",true).addClassOnOver("db-mrk-linkover");if(this.body.child(".memp-vicinity")){this.body.child(".memp-vicinity").on("click",function(f,e){if(Ext.get(e.id)!=null){var d=Ext.get(e.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Ext.getCmp(this.id).lbParentOwner.moveMarkerReqHandler(this,d[0],d[1],d[2],d[3])}},this,{delegate:".db-li-positionhere"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbBwrapCfg:{tag:"div",cls:"x-panel-bwrap",children:[{tag:"div",cls:"results-bwrap-header",children:[{tag:"div",cls:"results-title-left",html:"or log a nearby place:"},{tag:"div",cls:"results-title-right x-tool x-tool-close",html:""},{tag:"div",cls:"results-clear"}]}]},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-vicinity">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<div class="results-item-right results-iconcommands">','<div class="db-icon db-icon-go">','<span class="db-mrk-linkitem db-li-positionhere">log here<span class="db-mrk-linkdata">{swpid}_{lat}_{lng}_{wtype}</span></span>',"</div>","</div>",'<div class="results-item-right">',"{[values.diffdist.toFixed(1)]} mi","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}}},lbmarkercolconfig:{markerType:"vicinity-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:true,infoCallBackFunc:function(){Ext.select(".db-vicinity .db-mrk-linkitem.db-li-positionhere",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){if(Ext.get(b.id)!=null){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Ext.getCmp(this.id).lbParentOwner.moveMarkerReqHandler(this,a[0],a[1],a[2],a[3]);Logabout.Bridgeport.trackEvent("UserEditVicinity","MRKpositionhere","click")}},this)},markerTemplateDef:['<div class="db-vicinity db-mrk-main db-mrk-recent">','<tpl for=".">','<div class="results-ico {[ this.getItemClass(values) ]} db-mrk-name">{[fm.ellipsis(values.sfield1,20)]}</div>','<div class="db-icon db-icon-brackets">{diffdist} miles</div>','<div class="db-icon db-icon-founded">founded by {logusername}</div>','<div class="db-icon db-icon-go">','<span class="db-mrk-linkitem db-li-positionhere">log here<span class="db-mrk-linkdata">{swpid}_{lat}_{lng}_{wtype}</span></span>',"</div>","</tpl>","</div>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserEditVicinityWiz=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbinitcompcallback:function(){this.addEvents("lbstoreload");this.lbmarkercolconfig.showWith=[this.lbshowwithar]},lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.refreshAdd(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}Ext.select(".results-iconcommands .db-mrk-linkitem.db-li-positionhere",true).addClassOnOver("db-mrk-linkover");if(this.body.child(".memp-vicinity")){this.body.child(".memp-vicinity").on("click",function(f,e){if(Ext.get(e.id)!=null){var d=Ext.get(e.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Ext.getCmp(this.id).lbParentOwner.moveMarkerReqHandler(this,d[0],d[1],d[2],d[3])}},this,{delegate:".db-li-positionhere"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbBwrapCfg:{tag:"div",cls:"x-panel-bwrap",children:[{tag:"div",cls:"results-bwrap-header wiz-bkg",children:[{tag:"div",cls:"results-title-left",html:"places nearby: choose one or drag the marker for more"},{tag:"div",cls:"results-clear"}]}]},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-vicinity">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<div class="results-item-right results-iconcommands">','<div class="results-action-ico db-icon-go">','<span class="db-mrk-linkitem db-li-positionhere">log here<span class="db-mrk-linkdata">{swpid}_{lat}_{lng}_{wtype}</span></span>',"</div>","</div>",'<div class="results-item-right">',"{diffdist} miles","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"vicinity-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:true,infoCallBackFunc:function(){Ext.select(".db-vicinitywiz .db-mrk-linkitem.db-li-positionhere",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){if(Ext.get(b.id)!=null){Logabout.Bridgeport.trackEvent("UserEditVicinityWiz","MRKpositionhere","click");var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Ext.getCmp(this.id).lbParentOwner.moveMarkerReqHandler(this,a[0],a[1],a[2],a[3])}},this)},markerTemplateDef:['<div class="db-vicinitywiz db-mrk-main db-mrk-recent">','<tpl for=".">','<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,25)]}</div>','<div class="db-icon db-icon-dist">{diffdist} miles</div>','<div class="db-icon db-icon-go">','<span class="db-mrk-linkitem db-li-positionhere">log here<span class="db-mrk-linkdata">{swpid}_{lat}_{lng}_{wtype}</span></span>',"</div>","</tpl>","</div>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.FounderList=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbinitcompcallback:function(){this.addEvents("lbstoreload");this.lbmarkercolconfig.showWith=[this.lbshowwithar]},lbafterrendercallback:function(){this.bwrap.select(".db-icon-prv",true).addClassOnOver("db-scroll-hover");this.bwrap.select(".db-icon-nxt",true).addClassOnOver("db-scroll-hover");this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,-1)},this,{delegate:".db-icon-prv"});this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,1)},this,{delegate:".db-icon-nxt"});Logabout.Tips.tip({lbid:this.id,target:this.body,delegate:".db-dv-linkitem.db-li-uname",lbShouldShow:this.lbParentOwner.lbShowChildTT,lbShouldScope:this.lbParentOwner,lbClicks:[{cls:".tt-viewlogs",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,null,false,null,null,true,"places");Logabout.Bridgeport.trackEvent("founderlist","tooltiplogs","click")},scope:this},{cls:".tt-viewprofile",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("founderlist","tooltipprofile","click")},scope:this}]})},lbScrollFocusItm:function(a){if(Ext.get(this.id+this.lbdvnodesep+a.itmId)){Ext.get(this.id+this.lbdvnodesep+a.itmId).scrollIntoView(this.body.child(".results-datalist"))}},lbfields:[{name:"sumstatid"},{name:"sumstatdt"},{name:"sumstatutc",type:"date",dateFormat:"U"},{name:"sumstattype"},{name:"sumstatdesc"},{name:"sumstatorder"},{name:"sumstatentry"},{name:"ssIfield1"},{name:"ssIfield2"},{name:"ssSfield1"},{name:"ssSfield2"},{name:"swpid"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"ppicPath"},{name:"ppicWidth"},{name:"ppicHeight"},{name:"utc",type:"date",dateFormat:"U"},{name:"wpid"},{name:"wtype"},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"}],lbStoreSortInfo:{field:"sumstatorder",direction:"ASC"},lbStoreRemoteSort:true,lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.refreshAdd(this.id,"sumstatid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}Ext.select(".db-dv-linkitem.db-li-uname",true).addClassOnOver("db-dv-linkover");if(this.body.child(".memp-founderlist")){this.body.child(".memp-founderlist").on("click",function(f,e){if(Ext.get(e.id)!=null){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(d[0],d[1],null,null,null,false,null,null,true,{showtab:"founded"})}},this,{delegate:".db-li-showplace"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;this.lbParentOwner.lbSetLastActiveChild({objId:this.id,itmId:b.getSelectedRecords()[0].data.sumstatid});if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-founderlist">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{sumstatid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico dbi-wpt-user">','<div class="results-uname">','<span class="db-dv-linkitem db-li-uname">{[fm.ellipsis(values.logusername,20)]}','<span class="db-dv-linkdata">{loguserid}</span>','<div class="tt-trigger tt-hide">','<div class="tt-main">','<div class="tt-uname db-icon db-icon-userblue">{logusername}</div>','<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-viewprofile">view profile<span class="tt-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-viewlogs">view places<span class="tt-linkdata">{loguserid}_{logusername}</span></span>',"</div>","</div>","</div>","</span>","</div>",'<div class="results-place"><b>{ssIfield2}</b> places founded</div>','<div class="results-position">{sumstatorder}</div>','<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this),getWptName:function(a){if(typeof(a.sfield1)!="undefined"){return Ext.util.Format.ellipsis(a.sfield1,23)}else{if(typeof(a.ssSfield1)!="undefined"){return Ext.util.Format.ellipsis(a.ssSfield1,23)}}}}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:false,markstaticimage:{normal:"stumps_user.png",highlight:"stumps_user_h.png"},infoCallBackFunc:function(){Ext.select(".db-vicinitywiz .db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mempfounderlist","MRKshowprofile","click")},this);Ext.select(".db-vicinitywiz .db-mrk-linkitem.db-li-showplaces",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){if(Ext.get(b.id)!=null){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,null,false,null,null,true,{showtab:"founded"});Logabout.Bridgeport.trackEvent("mempfounderlist","MRKshowplaces","click")}},this)},markerTemplateDef:['<div class="db-vicinitywiz db-mrk-recent">','<tpl for=".">','<div class="db-icon db-icon-founded">','<span class="db-mrk-linkitem db-li-showprofile">{[fm.ellipsis(values.logusername,23)]}<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>'," founded {ssIfield2} places","</div>",'<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showplaces">view details<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>","</tpl>","</div>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.MostvizList=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbinitcompcallback:function(){this.addEvents("lbstoreload");this.lbmarkercolconfig.showWith=[this.lbshowwithar]},lbafterrendercallback:function(){this.bwrap.select(".db-icon-prv",true).addClassOnOver("db-scroll-hover");this.bwrap.select(".db-icon-nxt",true).addClassOnOver("db-scroll-hover");this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,-1)},this,{delegate:".db-icon-prv"});this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,1)},this,{delegate:".db-icon-nxt"});Logabout.Tips.tip({lbid:this.id,target:this.body,delegate:".db-dv-linkitem.db-li-placename",lbShouldShow:this.lbParentOwner.lbShowChildTT,lbShouldScope:this.lbParentOwner,lbClicks:[{cls:".tt-zoomwaypoint",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.zoomWptDetail(a,null,null,true);Logabout.Bridgeport.trackEvent("mostvizlist","zoomwptdetail","click")},scope:this}]})},lbScrollFocusItm:function(a){if(Ext.get(this.id+this.lbdvnodesep+a.itmId)){Ext.get(this.id+this.lbdvnodesep+a.itmId).scrollIntoView(this.body.child(".results-datalist"))}},lbfields:[{name:"sumstatid"},{name:"sumstatdt"},{name:"sumstatutc",type:"date",dateFormat:"U"},{name:"sumstattype"},{name:"sumstatdesc"},{name:"sumstatorder"},{name:"sumstatentry"},{name:"ssIfield1"},{name:"ssIfield2"},{name:"ssSfield1"},{name:"ssSfield2"},{name:"swpid"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"ppicPath"},{name:"ppicWidth"},{name:"ppicHeight"},{name:"utc",type:"date",dateFormat:"U"},{name:"wpid"},{name:"wtype"},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"}],lbStoreSortInfo:{field:"sumstatorder",direction:"ASC"},lbStoreRemoteSort:true,lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.refreshAdd(this.id,"sumstatid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}Ext.select(".db-dv-linkitem.db-li-placename",true).addClassOnOver("db-dv-linkover");if(this.body.child(".memp-mostvizlist")){this.body.child(".memp-mostvizlist").on("click",function(f,e){if(Ext.get(e.id)!=null){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.zoomWptDetail(d[0],null,null,true)}},this,{delegate:".db-li-showplace"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;this.lbParentOwner.lbSetLastActiveChild({objId:this.id,itmId:b.getSelectedRecords()[0].data.sumstatid});if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-mostvizlist">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{sumstatid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-placename">','<span class="db-dv-linkitem db-li-placename">{[fm.ellipsis(values.ssSfield1,26)]}','<span class="db-dv-linkdata">{loguserid}</span>','<div class="tt-trigger tt-hide">','<div class="tt-main">','<div class="tt-uname db-icon db-icon-redflag">{ssSfield1}</div>','<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-zoomwaypoint">view place<span class="tt-linkdata">{swpid}</span></span>',"</div>","</div>","</div>","</span>","</div>",'<div class="results-place"><b>{ssIfield1}</b> visits</div>','<div class="results-position">{sumstatorder}</div>','<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserFounded.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserFounded.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.SearchResultsGeoCode=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbafterrendercallback:function(){this.bwrap.select(".x-tool",true).addClassOnOver("x-tool-close-over").on("click",function(b,a){this.fireEvent("clickedclose",this)},this)},lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:1},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0}]),lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.bwrap.select(".results-titleresultval",true).each(function(d,e,c){d.dom.innerHTML=this.lbresultval},this)},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbBwrapCfg:{tag:"div",cls:"x-panel-bwrap",children:[{tag:"div",cls:"lb-mempanel-header",children:[{tag:"div",cls:"results-title-left",html:"result for: "},{tag:"div",cls:"results-title-left results-titleresultval",html:""},{tag:"div",cls:"results-title-right x-tool x-tool-close",html:""},{tag:"div",cls:"results-clear"}]}]},lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-placelogs">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<tpl if="mtype == 1">','<div class="results-item-left2 db-icon db-icon-founded">',"{logusername}","</div>","</tpl>",'<tpl if="mtype != 1">','<div class="results-item-left2 db-icon db-icon-userblue">',"{logusername}","</div>","</tpl>",'<div class="results-item-right">',"{diffdist} miles","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMyId:(function(){return this.id}).createDelegate(this),customDate:Logabout.Defs.markerTemplateFuncs.customDate,getMarkerSize:Logabout.Defs.markerTemplateFuncs.getMarkerSize,getItemIconClass:Logabout.Defs.markerTemplateFuncs.getItemIconClass,getPhotoSrc:Logabout.Defs.markerTemplateFuncs.getPhotoSrc,getDetail:Logabout.Defs.markerTemplateFuncs.getDetail}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,showWith:["waypointcombopanel"],infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.SearchResultsMap=Ext.extend(Logabout.Demo.MemoryPanel,{lbParentOwner:null,lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbafterrendercallback:function(){this.bwrap.select(".x-tool",true).addClassOnOver("x-tool-close-over").on("click",function(b,a){this.fireEvent("clickedclose",this)},this);this.bwrap.select(".db-dv-linkitem.db-li-showmore",true).addClassOnOver("db-dv-linkover").on("click",function(b,a){this.lbParentOwner.searchMoreHandler()},this)},lbSetSearchResult:function(c,a,b){if(b){this.bwrap.select(".results-titleloadingstatus",true).show()}else{this.bwrap.select(".results-titleloadingstatus",true).hide()}if(c!=null&&a!=null){this.bwrap.select(".results-titleresultval",true).each(function(e,f,d){e.dom.innerHTML="found "+c+" results."},this)}},lbClearSearch:function(b,a){if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.removeCollection(this.id);this.lbmapmgr.ActivatePrevHistEntry(this.id)}this.lbStore.removeAll()},lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:1},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0}]),lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}a.sort("diffdist","ASC")},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbBwrapCfg:{tag:"div",cls:"x-panel-bwrap",children:[{tag:"div",cls:"lb-mempanel-header memp-searchresultmap",children:[{tag:"div",cls:"results-title-left results-titleresultval",html:""},{tag:"div",cls:"results-title-left db-dv-linkitem db-icon db-icon-go db-li-showmore",html:"load more"},{tag:"div",cls:"results-title-left results-titleloadingstatus",html:"loading..."},{tag:"div",cls:"results-title-right x-tool x-tool-close",html:""},{tag:"div",cls:"results-clear"}]}]},lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-searchresultsmap">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<tpl if="mtype == 1">','<div class="results-item-left2 db-icon db-icon-founded">',"{logusername}","</div>","</tpl>",'<tpl if="mtype != 1">','<div class="results-item-left2 db-icon db-icon-userblue">',"{logusername}","</div>","</tpl>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMyId:(function(){return this.id}).createDelegate(this),customDate:Logabout.Defs.markerTemplateFuncs.customDate,getMarkerSize:Logabout.Defs.markerTemplateFuncs.getMarkerSize,getItemIconClass:Logabout.Defs.markerTemplateFuncs.getItemIconClass,getPhotoSrc:Logabout.Defs.markerTemplateFuncs.getPhotoSrc,getDetail:Logabout.Defs.markerTemplateFuncs.getDetail}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.IntroPlaces=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,onelineHeight:25,multlineHeight:95,onelinePromptCount:3,onelineCount:0,lbinitcompEVcallback:function(){if(this.lbmapmgr){this.lbmapmgr.on({mapmgrcolchanged:function(d,e,b,c,g,f){if(this.id!=e){this.lbDataView.clearSelections()}else{var a=this.id+this.lbdvnodesep+b;this.lbDataView.select(a,false,true);this.lbDataView.getNode(a).scrollIntoView(this.lbDataView.body)}},mapmgritmchanged:function(d,e,b,c,g,f){if(this.id!=e){this.lbDataView.clearSelections()}else{var a=this.id+this.lbdvnodesep+b;this.lbDataView.select(a,false,true);this.lbDataView.getNode(a).scrollIntoView(this.lbDataView.body)}},mapmgrhidecol:function(b,a){if(this.id==a){this.lbDataView.clearSelections()}},scope:this})}},lbSetOneLineCount:function(){var a=0;this.lbDataView.getEl().select(".intro-oneline").each(function(b){a++},this);this.onelineCount=a},lbafterrendercallback:function(){this.lbsignalController.on("quicklogupdate",function(c,d,b){if(d&&Logabout.Bridgeport.getActiveMenuTag()=="card-welcome"){var a=this.lbDataView.findItemFromChild(this.id+this.lbdvnodesep+b.mswpid);if(a!=null){Ext.get(a).removeClass("intro-choose-no");Ext.get(a).child(".intro-value").update(b.points);Ext.get(a).shift({height:this.onelineHeight,callback:function(f){f.addClass(["intro-choose-yes","intro-oneline"]);var e=0;this.lbDataView.getEl().select(".intro-oneline").each(function(g){e++},this);if(e-this.onelineCount>=this.onelinePromptCount){this.lbParentOwner.lbSwitchLeftCard(1)}},scope:this})}}},this)},lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:0},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.refreshAdd(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id,c[0].data.swpid)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}this.body.select(".db-action-showprofile",true).addClassOnOver("db-dv-linkover").on("click",function(f,e){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.trackEvent("mempintroplaces","showprofile","click");Logabout.Bridgeport.showProfile(d[0],d[1])},this);Ext.select(".intro-cmd-list .db-dv-linkitem",true).addClassOnOver("db-dv-linkover");this.body.child(".intro-memp-main").on("click",function(f,e){if(Ext.get(e.id)!=null){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showQuickLog(null,d);Logabout.Bridgeport.trackEvent("mempintroplaces","quicklog","click")}},this,{delegate:".db-action-yes"});this.body.child(".intro-memp-main").on("click",function(g,f){if(Ext.get(f.id)!=null){Logabout.Demo.NotifyBox.hide();var e=Ext.get(f.id).child(".db-dv-linkdata",true).firstChild.nodeValue;var d=this.lbDataView.getNode(this.id+this.lbdvnodesep+e);if(d!=null){Ext.get(d).shift({height:this.onelineHeight,callback:function(i){i.addClass(["intro-choose-no","intro-oneline"]);var h=0;this.lbDataView.getEl().select(".intro-oneline").each(function(j){h++},this);if(h-this.onelineCount>=this.onelinePromptCount){this.lbParentOwner.lbSwitchLeftCard(1)}},scope:this})}Logabout.Bridgeport.trackEvent("mempintroplaces","visitNO","click")}},this,{delegate:".db-action-no"})}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){Logabout.Demo.NotifyBox.hide();if(c.length>0){var a=c[0].id;var d=a.split(this.lbdvnodesep)[1];if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,d)}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"intro-over",selectedClass:"intro-sel",itemSelector:"div.intro-wrap",loadingText:"loading..",autoScroll:false},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="intro-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"intro-landscape":(b.ifield10==1?"intro-landscape":(b.ifield10==2?"intro-portrait":"intro-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),wpthash:this.lbtplFunctions.wpthash});this.lbtpl.compile()},lbtpldef:['<div class="intro-memp-main">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="intro-wrap">','<div id="{[ this.getMyId() ]}-#-{mswpid}" class="intro-hide"></div>','<div class="intro-left-cont intro-photo-cont">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="intro-left-cont2">','<div class="intro-title db-icon {[ this.getItemClass(values) ]}">',"{sfield1}","</div>",'<div class="intro-itm-list">','<div class="intro-itm db-icon db-icon-founded">founded by ','<span class="db-dv-linkitem db-action-showprofile">{logusername}','<span class="db-dv-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="intro-itm db-icon db-icon-clock">',"on {[ this.customDate(values.utc,Date.patterns.LbLong)]}","</div>",'<div class="intro-itm db-icon {[ this.getItemClass(values) ]}">',"type {[ this.wpthash[values.wtype] ]}","</div>","</div>","</div>",'<div class="intro-right-cont">','<div class="intro-itm-points">','<div class="intro-itm">','<span class="intro-value">0</span>','<span class="intro-label">Points</span>',"</div>","</div>",'<div class="intro-cmd-list">','<div class="intro-title">Have you been here?</div>','<div class="intro-cmd-grp">','<div class="intro-itm db-dv-linkitem db-action-yes">','<div class="db-icon db-icon-tick">Yes</div>','<span class="db-dv-linkdata">{swpid}</span>',"</div>",'<div class="intro-itm db-dv-linkitem db-action-no">','<div class="db-icon db-icon-clear">No</div>','<span class="db-dv-linkdata">{swpid}</span>',"</div>",'<div class="intro-clear"></div>',"</div>","</div>","</div>",'<div class="intro-clear"></div>',"</div>","</tpl>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,getItemIconClass:this.lbtplFunctions.getItemIconClass,getPhotoSrc:this.lbtplFunctions.getPhotoSrc,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,polyMasterShow:false,doSort:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.UserCompetitors=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbOwnerVals:null,lbSetOwnerVals:function(a){this.lbOwnerVals=a},lbfields:Logabout.Defs.FullRecDef.concat([{name:"fdrcnt"},{name:"fdrcntchg"},{name:"lastutc"},{name:"pntcnt"},{name:"pntcntchg"},{name:"pntrank"},{name:"pntrankchg"},{name:"username"},{name:"loguserid"},{name:"wptcnt"},{name:"wptcntchg"},{name:"picPath"},{name:"picWidth"},{name:"picHeight"}]),lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"loguserid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.colItemSelected(this.id,this.lbuid)}this.body.select(".db-action-showprofile",true).addClassOnOver("db-dv-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.trackEvent("usercompetitors","DVshowprofile","click");Logabout.Bridgeport.showProfile(c[0],c[1])},this);this.body.select(".db-action-showmore",true).addClassOnOver("db-dv-linkover").on("click",function(d,c){Logabout.Bridgeport.trackEvent("usercompetitors","DVshowmore","click");Logabout.Bridgeport.setMenu("card-people")},this)}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"histcomp-over",selectedClass:"histcomp-sel",itemSelector:"div.histcomp-wrap",loadingText:"loading.."},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getProfilePicImgSrc:function(a){if(a){return'<img src="'+Logabout.Defs.pPicFilePath+a+'"></img>'}else{return'<img src="'+Logabout.Defs.pPicFilePath+'blankpicplaceholder.jpg"></img>'}},getPntDiff:(function(b){var a=b.pntcnt-this.lbOwnerVals.pnts;return(a>0?("+"+a):a)}).createDelegate(this),isOwnerUserId:(function(a){if(a.loguserid==this.lbuid){return true}else{return false}}).createDelegate(this)});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="histcomp-main memp-usercompetitors">','<div class="results-datalist">','<tpl for=".">','<tpl if="this.isOwnerUserId(values)">','<div id="{[ this.getMyId() ]}-#-{loguserid}" class="histcomp-wrap histcomp-owner">',"</tpl>",'<tpl if="!this.isOwnerUserId(values)">','<div id="{[ this.getMyId() ]}-#-{loguserid}" class="histcomp-wrap">',"</tpl>",'<div class="histcomp-left1">','<div class="histcomp-rank">',"<span>{pntrank}</span>","</div>","</div>",'<div class="histcomp-left2">','<div class="histcomp-pic">',"{[ this.getProfilePicImgSrc(values.picPath) ]}","</div>","</div>",'<div class="histcomp-right">','<div class="histcomp-top">','<div class="histcomp-top-itm1 db-icon db-icon-userblue">','<span class="db-dv-linkitem db-action-showprofile">{[ fm.ellipsis(values.username,40) ]}','<span class="db-dv-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="histcomp-top-itm2">',"<span>{pntcnt} ({[ this.getPntDiff(values) ]})</span>","</div>",'<div class="hist-clear"></div>',"</div>","</div>",'<div class="hist-clear"></div>',"</div>","</tpl>",'<div class="histcomp-endwrap">','<div class="histcomp-endwrap-itm db-icon db-icon-go">','<span class="db-dv-linkitem db-action-showmore">show more people</span>',"</div>","</div>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("usercompetitors","MRKshowprofile","click")},this)},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-competitors">','<div class="db-mrk-detailblock">','<div class="db-icon db-icon-userblue">','<span class="db-mrk-linkitem db-li-showprofile">{[fm.ellipsis(values.username,23)]}<span class="db-mrk-linkdata">{loguserid}_{username}</span></span>',"</div>",'<div class="db-mrk-detail-list">','<div class="db-mrk-detail-itm">','<div class="db-mrk-detail-label">places:</div>','<div class="db-mrk-detail-value">{fdrcnt}</div>','<div class="db-mrk-detail-clear"></div>',"</div>",'<div class="db-mrk-detail-itm">','<div class="db-mrk-detail-label">logs:</div>','<div class="db-mrk-detail-value">{wptcnt}</div>','<div class="db-mrk-detail-clear"></div>',"</div>",'<div class="db-mrk-detail-itm">','<div class="db-mrk-detail-label">points:</div>','<div class="db-mrk-detail-value">{pntcnt}</div>','<div class="db-mrk-detail-clear"></div>',"</div>","</div>","</div>","</div>","</tpl>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.ADTestMasterSlave=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:Logabout.Defs.FullRecDef,lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}Ext.select(".memp-adtest .db-dv-linkitem.db-li-showplace",true).addClassOnOver("db-dv-linkover");if(this.body.child(".memp-adtest")){this.body.child(".memp-adtest").on("click",function(e,d){if(Ext.get(d.id)!=null){var c=Ext.get(d.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.zoomWptDetail(c[0],null,null,true)}},this,{delegate:".db-li-showplace"})}Ext.select(".memp-adtest .db-dv-linkitem.db-li-adminedit",true).addClassOnOver("db-dv-linkover");if(this.body.child(".memp-adtest")){this.body.child(".memp-adtest").on("click",function(e,d){if(Ext.get(d.id)!=null){var c=Ext.get(d.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.editWaypoint(c[0],c[1])}},this,{delegate:".db-li-adminedit"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[2])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-adtest">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,25)]} by {logusername}","</div>",'<div class="results-item-left2">'," ** time: {[this.customDate(values.utc)]}","</div>",'<div class="results-item-right">',"swpid: {swpid} mid: {mswpid} mt: {mtype} gz: {gmapzoom} pts: {ifield13}","</div>",'<div class="results-item-right2">','<span class="db-dv-linkitem db-li-showplace">show<span class="db-dv-linkdata">{swpid}_{lat}_{lng}_{wtype}</span></span>',"</div>",'<div class="results-item-right2">','<span class="db-dv-linkitem db-li-adminedit">EDIT<span class="db-dv-linkdata">{swpid}_{loguserid}</span></span>',"</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,showWith:["adtestmasterslavewin","adtest_log","adtest_master","adtest_children"],infoCallBackFunc:null,markerTemplateDef:['<div class="db-mrk-main db-mrk-recent">','<tpl for=".">','<div class="db-icon db-icon-userblue">{[fm.ellipsis(values.logusername,25)]}</div>','<div class="">{swpid}</div>',"</tpl>","</div>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.GadminGoals=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbfields:[{name:"goalid"},{name:"updatetimeTS"},{name:"ownerluid"},{name:"goalname"},{name:"goaldesc"},{name:"itemcount"}],lbStoreSortInfo:{field:"updatetimeTS",direction:"ASC"},lbstoreloadhandler:function(a,b){return null},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}var d=b.getSelectedRecords()[0];this.lbParentOwner.lbUpdateEBoxes(d.data.goalname,d.data.goaldesc)}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getDebugUser:this.lbtplFunctions.getDebugUser});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-goals">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{goalid}" class="results-wrap">','<div class="results-data-section">','<div class="results-item-left">',"id: {goalid}","</div>",'<div class="results-item-left2">',"ownerluid: {ownerluid}","</div>",'<div class="results-item-left2">',"name: {[fm.ellipsis(values.goalname,100)]}","</div>",'<div class="results-item-left2">',"desc: {[fm.ellipsis(values.goaldesc,100)]}","</div>",'<div class="results-item-left2">',"itemcount: {itemcount}","</div>",'<div class="results-clear"></div>',"</div>","</div>","</tpl>","</div>","</div>"]});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.GadminGoalItems=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbfields:Logabout.Defs.FullRecDef.concat([{name:"goalitmid"},{name:"updatetimeTS"},{name:"goaluserid"},{name:"goalswpid"},{name:"goalid"}]),lbstoreloadhandler:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}this.lbDataView.getEl().select(".memp-placelogs .user-li-debugshow",true).addClassOnOver("user-linkover").on("click",function(e,d){var c=Ext.get(d.id).child(".user-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showADTestMasterSlaveDebug(c[0],c[1])})}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="goal-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"goal-landscape":(b.ifield10==1?"goal-landscape":(b.ifield10==2?"goal-portrait":"goal-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),getDebugUser:this.lbtplFunctions.getDebugUser});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-gadmingi">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<div class="results-clear"></div>','<div class="results-item-left goal-photo-cont">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="results-item-left db-icon db-icon-founded">',"{logusername}","</div>",'<div class="results-clear"></div>','<div class="results-item-left db-icon db-icon-clock">',"{[ this.customDate(values.utc) ]}","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>",'<div class="results-clear"></div>',"</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMyId:(function(){return this.id}).createDelegate(this),customDate:Logabout.Defs.markerTemplateFuncs.customDate,getMarkerSize:Logabout.Defs.markerTemplateFuncs.getMarkerSize,getItemIconClass:Logabout.Defs.markerTemplateFuncs.getItemIconClass,getPhotoSrc:Logabout.Defs.markerTemplateFuncs.getPhotoSrc,getDetail:Logabout.Defs.markerTemplateFuncs.getDetail}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerUserFounded.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerUserFounded.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.GpanelGoals=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbafterrendercallback:function(){this.bwrap.on("click",function(c,b){var a=Ext.get(b).child(".db-dv-linkdata",true).firstChild.nodeValue;this.lbParentOwner.showGoalUsers(a)},this,{delegate:".db-li-showusers"});this.bwrap.on("click",function(c,b){var a=Ext.get(b).child(".db-dv-linkdata",true).firstChild.nodeValue;this.lbParentOwner.showGoalUserItems(a,this.lbluid,this.lbuname)},this,{delegate:".db-li-showuserdetails"})},lbCalcComplete:function(b){var a=b.length;var c=0;Ext.each(b,function(d){c+=parseInt(d.data.attemptusers)},this);this.lbParentOwner.lbGoalUpdate(c,a)},lbfields:[{name:"goalid"},{name:"updatetimeTS"},{name:"ownerluid"},{name:"goalname"},{name:"goaldesc"},{name:"itemcount"},{name:"attemptusers"},{name:"completeusers"},{name:"gicomplete"},{name:"completedatetimeTS",type:"date",dateFormat:"U"},{name:"bonuspoints"},{name:"sfield8"},{name:"ifield10"},{name:"lat",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"lng",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"alt",type:"float"},{name:"gmapzoom",defaultValue:null},{name:"description",defaultValue:null}],lbStoreSortInfo:{field:"goalid",direction:"ASC"},lbstoreloadhandler:function(a,b){if(this.lbmapmgr&&b.length>0){this.lbmapmgr.addCollection(this.id,"goalid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}this.lbCalcComplete(b);this.bwrap.select(".db-dv-linkitem",true).addClassOnOver("db-dv-linkover")}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;this.lbParentOwner.lbSetLastActiveChild({objId:this.id,itmId:b.getSelectedRecords()[0].data.goalid});if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="goal-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"goal-landscape":(b.ifield10==1?"goal-landscape":(b.ifield10==2?"goal-portrait":"goal-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),youPerform:function(a){if(a.gicomplete){if(a.bonuspoints){return'<div class="db-icon db-icon-userred">your stats: <span class="db-icon db-icon-star">completed</span></div>'}else{return'<div class="db-icon db-icon-userred">your stats: '+a.gicomplete+" out of "+a.itemcount+" items</div>"}}else{return'<div class="db-icon db-icon-userred">your stats: not started</div>'}},getDebugUser:this.lbtplFunctions.getDebugUser});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-gpanelg">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{goalid}" class="results-wrap lb-round-border-10">','<div class="results-data-section">','<div class="results-item-title">',"{[fm.ellipsis(values.goalname,100)]}","</div>","</div>",'<div class="results-data-section">','<div class="results-item-photo">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="results-item-desc">',"{[fm.ellipsis(values.goaldesc,200)]}","</div>",'<div class="results-clear"></div>',"</div>",'<div class="results-data-section lb-round-border-5 results-section-compare">','<div class="results-item-x db-icon db-icon-userblue">','<span class="db-dv-linkitem db-li-showusers">','{[fm.plural(values.attemptusers," user")]}','<span class="db-dv-linkdata">{goalid}</span>',"</span>","<span> working on this goal</span>","</div>",'<div class="results-item-x">',"{[this.youPerform(values)]}","</div>","</div>",'<div class="results-data-section  lb-round-border-5 results-section-go">','<div class="results-item-x">','<span class="results-item-startgoal db-dv-linkitem db-li-showuserdetails">view your progress<span class="db-dv-linkdata">{goalid}</span></span>',"</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,getItemIconClass:this.lbtplFunctions.getItemIconClass,getPhotoSrc:this.lbtplFunctions.getPhotoSrc,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:{hardzoom:4},hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:false,doSort:false,markstaticimage:{normal:"sf_goal.png",highlight:"sf_goal_h.png"},infoCallBackFunc:function(){Ext.select(".db-mrk-gpanelg .db-li-startgoal",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mempfounderlist","MRKshowprofile","click")},this)},markerTemplateDef:['<div class="db-mrk-main db-mrk-gpanelg">','<tpl for=".">','<div class="db-mrk-mpanel">','<div class="db-mrk-detailblock">','<div class="db-mrk-name">{goalname}</div>','<div class="db-mrk-desc">{[ fm.ellipsis(values.goaldesc,100) ]}</div>',"</div>","</div>","</tpl>","</div>",]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.GpanelGoalItems=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbAjax:function(c,d,b,a){Ext.Ajax.request({url:c,params:d,success:function(e,f){var g=Ext.util.JSON.decode(e.responseText);if(g.error){Ext.Msg.show({title:"Error",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}else{if(b){b.createDelegate(a)(g)}else{this.orefMempGoals.lbStore.reload()}}},failure:function(e,f){Ext.Msg.show({title:"Error",msg:"Transport Error",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})},scope:this})},lbCalcComplete:function(b){var c=this.lbDataView.getStore().getCount();var d=null;var a=0;this.lbDataView.getStore().each(function(e){d=e.data.goalid;if(e.data.uswpid){a++}},this);this.lbParentOwner.lbGoalItemUpdate(d,a,c,(b=="load"?true:false))},lbYesDel:function(d,c){if(!Logabout.Bridgeport.checkGuestPriv("gpanelgoalitems:lbYesDel")){return true}if(Ext.get(c.id)!=null){var a=Ext.get(c.id).child(".db-dv-linkdata",true).firstChild.nodeValue;var b=this.lbDataView.getStore().getById(a);if(b){Ext.get(c.id).parent(".goal-cmd-grp").addClass("goal-busy");this.lbAjax("crud/quickgoalcreate",{format:"json",fields:Ext.encode([{mswpid:b.data.swpid,mtype:0,utc:new Date().format("U"),wtype:b.data.wtype,tsect:b.data.tsect,tsecttype:b.data.tsecttype,sfield1:b.data.sfield1,lat:b.data.lat,lng:b.data.lng,alt:b.data.alt,gmapzoom:b.data.gmapzoom}])},function(g){var f=this.lbDataView.getStore().find("swpid",g.created.mswpid);if(f!=-1){this.lbDataView.getStore().getAt(f).data.uswpid=g.created.swpid;this.lbDataView.refreshNode(f);this.lbRefreshEvs();this.lbCalcComplete("quickgoalcreate")}var e=this.lbDataView.getEl().child(".goal-busy");if(e){e.removeClass("goal-busy")}},this)}}},lbNoDel:function(c,b){if(!Logabout.Bridgeport.checkGuestPriv("gpanelgoalitems:lbNoDel")){return true}if(Ext.get(b.id)!=null){Logabout.Demo.NotifyBox.hide();var a=Ext.get(b.id).child(".db-dv-linkdata",true).firstChild.nodeValue;Ext.get(b.id).parent(".goal-cmd-grp").addClass("goal-busy");this.lbAjax("crud/quickgoaldelete",{format:"json",swpid:a},function(f){var e=this.lbDataView.getStore().find("uswpid",f.deleted.swpid);if(e!=-1){this.lbDataView.getStore().getAt(e).data.uswpid=null;this.lbDataView.refreshNode(e);this.lbRefreshEvs();this.lbCalcComplete("quickgoaldelete")}var d=this.lbDataView.getEl().child(".goal-busy");if(d){d.removeClass("goal-busy")}},this)}},lbRefreshEvs:function(){Ext.select(".goal-cmd-grp .db-dv-linkitem",true).addClassOnOver("db-dv-linkover");this.body.un("click",this.lbYesDel,this);this.body.un("click",this.lbNoDel,this);this.body.on("click",this.lbYesDel,this,{delegate:".db-action-yes"});this.body.on("click",this.lbNoDel,this,{delegate:".db-action-no"})},lbfields:Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:0},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0},{name:"goalid"},{name:"goalitmid"},{name:"updatetimeTS"},{name:"goaluserid"},{name:"goalswpid"},{name:"goaldesc",convert:function(a){if(a===null){return""}else{return a}}},{name:"uswpid"}]),lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr&&c.length>0){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}this.body.select(".db-action-showprofile",true).addClassOnOver("db-dv-linkover").on("click",function(f,e){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.trackEvent("mempintroplaces","showprofile","click");Logabout.Bridgeport.showProfile(d[0],d[1])},this);this.lbRefreshEvs();this.lbCalcComplete("load")}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"goal-over",selectedClass:"goal-sel",itemSelector:"div.goal-wrap",loadingText:"loading..",autoScroll:false},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="goal-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"goal-landscape":(b.ifield10==1?"goal-landscape":(b.ifield10==2?"goal-portrait":"goal-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),getLoggedClass:(function(a){if(a.uswpid){return"goal-logged"}else{return""}}).createDelegate((this)),wpthash:this.lbtplFunctions.wpthash,isGuestUser:(function(){return this.lbisguestuser}).createDelegate((this)),isOwnerViewer:(function(){if(parseInt(this.lbStore.lastOptions.params.loguserid)==parseInt(this.lbluid)){return true}else{return false}}).createDelegate((this))});this.lbtpl.compile()},lbtpldef:['<div class="goal-memp-main">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{swpid}" class="goal-wrap {[ this.getLoggedClass(values) ]}">','<div class="goal-block goal-top">','<div class="goal-title db-icon {[ this.getItemClass(values) ]}">',"{sfield1}","</div>","</div>",'<div class="goal-block goal-photo-cont">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="goal-block goal-cmd-grp">','<tpl if="this.isOwnerViewer()">','<div class="goal-itm db-dv-linkitem db-action-yes">','<div class="db-icon db-icon-unchecked">Click to log a visit</div>','<span class="db-dv-linkdata">{swpid}</span>',"</div>",'<div class="goal-itm db-action-busy">','<div class="db-icon db-icon-loading">please wait...</div>',"</div>",'<div class="goal-itm db-action-showyes">','<div class="db-icon db-icon-checked">Been Here</div>',"</div>",'<div class="goal-itm db-dv-linkitem db-action-no">','<div class="db-icon db-icon-clearx">Undo</div>','<span class="db-dv-linkdata">{uswpid}</span>',"</div>",'<div class="goal-clear"></div>',"</tpl>",'<tpl if="!this.isOwnerViewer()">','<div class="goal-itm db-action-none">','<div class="db-icon db-icon-unchecked">Not Yet</div>',"</div>",'<div class="goal-itm db-action-showyes">','<div class="db-icon db-icon-checked">Been Here</div>',"</div>",'<div class="goal-clear"></div>',"</tpl>","</div>","</div>","</tpl>",'<div class="goal-clear"></div>',"</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,getItemIconClass:this.lbtplFunctions.getItemIconClass,getPhotoSrc:this.lbtplFunctions.getPhotoSrc,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this),getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="goal-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"goal-landscape":(b.ifield10==1?"goal-landscape":(b.ifield10==2?"goal-portrait":"goal-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),getItemClass:function(a){return"dbi-wpt-"+a.wtype}}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:function(){var a=8},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-gpanelgi">','<div class="db-mrk-detailblock">','<div class="db-mrk-name">','<div class="db-icon {[ this.getItemClass(values) ]}">',"{sfield1}","</div>","</div>",'<div class="db-mrk-photodesc">','<div class="db-mrk-photo">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="db-mrk-desc">{goaldesc}</div>','<div class="goal-clear"></div>',"</div>","</div>","</div>","</tpl>"]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.GpanelGoalUsers=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbfields:[{name:"goaluserid"},{name:"goalid"},{name:"goalname"},{name:"itemcount"},{name:"goalid"},{name:"loguserid"},{name:"username"},{name:"gicomplete"},{name:"completedatetime"},{name:"bonuspoints"},{name:"sfield8"},{name:"ifield10"},{name:"lat",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"lng",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"alt",type:"float"},{name:"gmapzoom",defaultValue:null}],lbStoreRemoteSort:true,lbstoreloadhandler:function(a,b){if(b.length>0){if(this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"goaluserid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}}this.body.select(".db-dv-linkitem",true).addClassOnOver("db-dv-linkover");if(this.body.child(".memp-gpanelgu")){this.body.child(".memp-gpanelgu").on("click",function(e,d){if(Ext.get(d.id)!=null){var c=Ext.get(d.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");this.lbParentOwner.showGoalUserItems(c[0],c[1],c[2])}},this,{delegate:".db-li-showusergoalitem"})}}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(me.getSelectedRecords())}}},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-gpanelgu">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{goaluserid}" class="results-wrap">','<div class="results-data-section">','<div class="db-icon db-icon-userblue results-item-left">',"{[fm.ellipsis(values.username,33)]}","</div>",'<div class="results-item-left2">','<tpl if="values.itemcount == values.gicomplete">','<div class="db-icon db-icon-star">{gicomplete} / {itemcount}</div>',"</tpl>",'<tpl if="values.itemcount != values.gicomplete">','<div class="">{gicomplete} / {itemcount}</div>',"</tpl>","</div>",'<div class="results-item-right">','<div class="db-icon db-icon-go">','<span class="db-dv-linkitem db-li-showusergoalitem">show user progress<span class="db-dv-linkdata">{goalid}_{loguserid}_{username}</span></span>',"</div>","</div>",'<div class="results-clear"></div>',"</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:{hardzoom:4},hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:false,doSort:false,markstaticimage:{normal:"sf_goal.png",highlight:"sf_goal_h.png"},infoCallBackFunc:function(){Ext.select(".db-mrk-gpanelg .db-li-startgoal",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mempfounderlist","MRKshowprofile","click")},this)},markerTemplateDef:['<div class="db-mrk-main db-mrk-gpanelgu">','<tpl for=".">','<div class="db-mrk-mpanel">','<div class="db-mrk-detailblock">','<div class="db-mrk-name">{goalname}</div>','<div class="db-mrk-uname db-icon db-icon-userblue">{[ fm.ellipsis(values.username,100) ]}</div>',"</div>","</div>","</tpl>","</div>",]}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.MultiNews=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:false,lbmapmgr:null,lbinitcompcallback:function(){this.addEvents("lbstoreload");this.lbmarkercolconfig.showWith=[this.lbshowwithar]},lbafterrendercallback:function(){this.bwrap.select(".db-icon-prv",true).addClassOnOver("db-scroll-hover");this.bwrap.select(".db-icon-nxt",true).addClassOnOver("db-scroll-hover");this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,-1)},this,{delegate:".db-icon-prv"});this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,1)},this,{delegate:".db-icon-nxt"});Logabout.Tips.tip({lbid:this.id,target:this.body,delegate:".db-dv-linkitem.db-li-uname",lbShouldShow:this.lbParentOwner.lbShowChildTT,lbShouldScope:this.lbParentOwner,lbClicks:[{cls:".tt-viewlogs",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],null,null,null,false,null,null,true,"waypoints");Logabout.Bridgeport.trackEvent("multinews","tooltiplogs","click")},scope:this},{cls:".tt-viewprofile",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("multinews","tooltipprofile","click")},scope:this}]})},lbScrollFocusItm:function(a){if(Ext.get(this.id+this.lbdvnodesep+a.itmId)){Ext.get(this.id+this.lbdvnodesep+a.itmId).scrollIntoView(this.body.child(".news-datalist"))}},lbcombodata:{gToken:{likethis:"really liked {0} waypoint{1}",beenhere:"have also been at {0} waypoint{1}",favorite:"added {0} favorite{1}"},wType:{7:"created {0} new trip{1}",8:"filled up {0} time{1} with fuel",9:"logged {0} camp spot{1}",10:"filled up {0} time{1} with water",11:"used {0} dump station{1}",12:"found {0} wifi hot spot{1}",13:"enjoyed {0} outdoor place{1}",14:"visited {0} point{1} of interest",15:"took {0} photo{1}",16:"stayed at {0} hotel{1}"},wFounded:{7:"created {0} new trip{1}",8:"founded {0} fuel stop{1}",9:"founded {0} camp spot{1}",10:"founded {0} water filling spot{1}",11:"founded {0} dump station{1}",12:"founded {0} wifi hot spot{1}",13:"founded {0} outdoor place{1}",14:"founded {0} point{1} of interest",15:"took {0} photo{1}",16:"founded {0} hotel{1}"},gGoal:{5:"completed {0} goal{1}"}},lbfields:[{name:"sumstatid"},{name:"sumstatdt"},{name:"sumstatutc",type:"date",dateFormat:"U"},{name:"sumstattype"},{name:"sumstatdesc"},{name:"sumstatorder"},{name:"sumstatentry"},{name:"ssIfield1"},{name:"ssIfield2"},{name:"ssIfield3"},{name:"ssSfield1"},{name:"ssSfield2"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"ppicPath"},{name:"ppicWidth"},{name:"ppicHeight"},{name:"utc",type:"date",dateFormat:"U"},{name:"swpid"},{name:"wtype",convert:function(a,b){if(b.sumstatentry=="goals"){return 5}else{return a}}},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"},{name:"wptcount",type:"int",convert:function(a,b){return b.ssIfield1}},{name:"restype",type:"string",convert:function(a,b){return b.sumstatentry}}],lbStoreSortInfo:{field:"sumstatorder",direction:"ASC"},lbStoreRemoteSort:true,lbstoreloadhandler:function(a,c,b){if(this.lbmapmgr){this.fireEvent("lbstoreload",this,a,c,b);this.lbmapmgr.refreshAdd(this.id,"sumstatid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}if(this.lbmapmgr.mrkCols[this.id]){this.lbmapmgr.mrkCols[this.id].lbShowAll()}this.body.select(".news-child-wrap",true).addClassOnOver("news-over");this.body.select(".news-child-wrap .db-li-uname",true).addClassOnOver("db-dv-linkover")}},lbviewcallback:null,lbdvnodesep:"_",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;this.lbParentOwner.lbSetLastActiveChild({objId:this.id,itmId:b.getSelectedRecords()[0].data.sumstatid});if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbDataViewConfig:{multiSelect:false,singleSelect:true,overClass:"news-over",selectedClass:"news-sel",itemSelector:"div.news-child-wrap",loadingText:"loading..",autoScroll:false},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){if(a.sumstatentry=="waypoints"){if(a.mtype==1){return"db-icon db-icon-founded"}else{return"dbi-wpt-"+a.wtype}}else{if(a.sumstatentry=="goals"){return"dbi-wpt-goal"}else{return"dbi-grp-"+a.sumstatentry}}},getComboData:(function(a){if(a.sumstatentry=="waypoints"){if(a.mtype==1){return String.format(this.lbcombodata.wFounded[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}else{return String.format(this.lbcombodata.wType[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}}else{if(a.sumstatentry=="goals"){return String.format(this.lbcombodata.gGoal[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}else{return String.format(this.lbcombodata.gToken[a.sumstatentry],a.ssIfield1,(a.ssIfield1>1?"s":""))}}}).createDelegate(this),customDate:this.lbtplFunctions.customDate});this.lbtpl.compile()},lbtpldef:['<div class="news-main">','<div class="news-datalist">','<tpl for=".">','<div class="news-group-wrap">','<div class="news-childlist">','<div id="{[ this.getMyId() ]}_{sumstatid}" class="news-child-wrap">','<div class="news-child-item news-ico {[ this.getItemClass(values) ]}">','<div class="news-uname">','<span class="db-dv-linkitem db-li-uname">{logusername}','<span class="db-dv-linkdata">{loguserid}</span>','<div class="tt-trigger tt-hide">','<div class="tt-main">','<div class="tt-uname db-icon db-icon-userblue">{logusername}</div>','<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-viewprofile">view profile<span class="tt-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-viewlogs">view logs<span class="tt-linkdata">{loguserid}_{logusername}</span></span>',"</div>","</div>","</div>","</span>",'<span class=""> {[this.getComboData(values)]}</span>',"</div>",'<div class="news-date">{[ this.customDate(values.utc) ]}</div>',"</div>","</div>","</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:function(a){if(a.wptcount>1){return"db-mrk-news-short"}else{return"db-mrk-news-long"}},customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){if(a.sumstatentry=="waypoints"){if(a.mtype==1){return"db-icon db-icon-founded"}else{return"dbi-wpt-"+a.wtype}}else{if(a.sumstatentry=="goals"){return"dbi-wpt-goal"}else{return"dbi-grp-"+a.sumstatentry}}},getComboData:(function(a){if(a.sumstatentry=="waypoints"){if(a.mtype==1){return String.format(this.lbcombodata.wFounded[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}else{return String.format(this.lbcombodata.wType[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}}else{if(a.sumstatentry=="goals"){return String.format(this.lbcombodata.gGoal[a.wtype],a.ssIfield1,(a.ssIfield1>1?"s":""))}else{return String.format(this.lbcombodata.gToken[a.sumstatentry],a.ssIfield1,(a.ssIfield1>1?"s":""))}}}).createDelegate(this),isSwpidBased:function(a){if(a.wcount==1&&a.swpid!=null){return true}else{return false}}}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerNews.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerNews.markerTemplateDef}});Ext.namespace("Logabout.Demo.MemoryPanel");Logabout.Demo.MemoryPanel.PopularGoals=Ext.extend(Logabout.Demo.MemoryPanel,{lbshowtitlebar:true,lbmapmgr:null,lbdistance:null,lbafterrendercallback:function(){this.bwrap.on("click",function(c,b){var a=Ext.get(b).child(".db-dv-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showGoal(a);Logabout.Bridgeport.trackEvent("memppopulargoals","showgoalusers","click")},this,{delegate:".db-li-showgoalusers"});this.bwrap.on("click",function(c,b){var a=Ext.get(b).child(".db-dv-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.showGoal(a,this.lbluid,this.lbuname);Logabout.Bridgeport.trackEvent("memppopulargoals","showgoalusers","click")},this,{delegate:".db-li-showgoalitems"})},lbScrollFocusItm:function(a){if(Ext.get(this.id+this.lbdvnodesep+a.itmId)){Ext.get(this.id+this.lbdvnodesep+a.itmId).scrollIntoView(this.body.child(".results-datalist"))}},lbfields:[{name:"goalid"},{name:"updatetimeTS",type:"date",dateFormat:"U"},{name:"ownerluid"},{name:"goalname"},{name:"goaldesc"},{name:"itemcount"},{name:"attemptusers"},{name:"completeusers"},{name:"gicomplete"},{name:"completedatetimeTS",type:"date",dateFormat:"U"},{name:"bonuspoints"},{name:"sfield8"},{name:"ifield10"},{name:"lat",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"lng",type:"float",convert:function(a){if(a===null){return 1.07654}else{return a}}},{name:"alt",type:"float"},{name:"gmapzoom",defaultValue:null},{name:"description",defaultValue:null}],lbStoreSortInfo:{field:"updatetimeTS",direction:"DESC"},lbstoreloadhandler:function(a,b){if(this.lbmapmgr&&b.length>0){this.lbmapmgr.addCollection(this.id,"goalid",a.getRange(),this.lbmarkercolconfig);if(!this.lbNextLoadNoMapAction){this.lbmapmgr.setActiveCol(this.id)}this.bwrap.select(".db-dv-linkitem",true).addClassOnOver("db-dv-linkover")}},lbviewcallback:null,lbdvnodesep:"-#-",lbdataviewselectionchangehandler:function(b,c){if(c.length>0){var a=c[0].id;this.lbParentOwner.lbSetLastActiveChild({objId:this.id,itmId:b.getSelectedRecords()[0].data.goalid});if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split(this.lbdvnodesep)[1])}if(this.lbviewcallback){this.lbviewcallback(b.getSelectedRecords())}}},lbdataviewemptytext:function(){return"<div>no results within approximately "+this.lbdistance+" miles</div>"},lbtplFunctions:null,lbtpl:null,lbinitdataviewtemplate:function(){this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getIconPath:this.lbtplFunctions.getIconPath,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),showTitleBar:(function(){return this.lbshowtitlebar}).createDelegate(this),getResultVal:(function(){return this.lbresultval}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="goal-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"goal-landscape":(b.ifield10==1?"goal-landscape":(b.ifield10==2?"goal-portrait":"goal-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),youPerform:function(a){if(a.gicomplete){if(a.bonuspoints){return'<div class="db-icon db-icon-userred">your stats: <span class="db-icon db-icon-star">completed</span></div>'}else{return'<div class="db-icon db-icon-userred">your stats: '+a.gicomplete+" out of "+a.itemcount+" items</div>"}}else{return'<div class="db-icon db-icon-userred">your stats: not started</div>'}},getDebugUser:this.lbtplFunctions.getDebugUser});this.lbtpl.compile()},lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="results-main memp-populargoals memp-gpanelg">','<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}-#-{goalid}" class="results-wrap lb-round-border-10">','<div class="results-data-section">','<div class="results-item-title">','<div class="memp-populargoals-goalname">{[fm.ellipsis(values.goalname,100)]}</div>',"</div>","</div>",'<div class="results-data-section">','<div class="results-item-photo">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="results-item-desc">',"{[fm.ellipsis(values.goaldesc,200)]}","</div>",'<div class="results-clear"></div>',"</div>",'<div class="results-data-section">','<div class="memp-populargoals-usercount lb-round-border-5">','<div class="db-icon db-icon-userblue">','<span class="db-dv-linkitem db-li-showgoalusers">','{[fm.plural(values.attemptusers," user")]}','<span class="db-dv-linkdata">{goalid}</span>',"</span>","<span> working on this goal</span>","</div>","</div>",'<div class="memp-populargoals-go lb-round-border-5">','<div class="results-item-x">','<span class="db-icon db-icon-go db-dv-linkitem db-li-showgoalitems">{shownewicon} view goal<span class="db-dv-linkdata">{goalid}</span></span>',"</div>","</div>",'<div class="results-clear"></div>',"</div>","</div>","</tpl>","</div>","</div>"],lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,getItemIconClass:this.lbtplFunctions.getItemIconClass,getPhotoSrc:this.lbtplFunctions.getPhotoSrc,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:{hardzoom:4},hideMarkerOnCreate:true,useTabMarker:false,polyMasterShow:false,doSort:false,markstaticimage:{normal:"sf_goal.png",highlight:"sf_goal_h.png"},infoCallBackFunc:function(){Ext.select(".db-mrk-gpanelg .db-li-startgoal",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("mempfounderlist","MRKshowprofile","click")},this)},markerTemplateDef:['<div class="db-mrk-main db-mrk-gpanelg">','<tpl for=".">','<div class="db-mrk-mpanel">','<div class="db-mrk-detailblock">','<div class="db-mrk-name">{goalname}</div>','<div class="db-mrk-desc">{[ fm.ellipsis(values.goaldesc,100) ]}</div>',"</div>","</div>","</tpl>","</div>",]}});Ext.namespace("Logabout.Demo");Logabout.Demo.ADTestWindow=Ext.extend(Ext.Window,{lbContainerW:null,lbContainerH:null,lbParentOwner:null,lbArPossies:[{lat:-34.403291,lng:19.287765,zoom:15,wtype:9},{lat:-34.408361,lng:19.289117,zoom:15,wtype:9},{lat:-34.412044,lng:19.279547,zoom:15,wtype:9},{lat:-34.412044,lng:22.279547,zoom:12,wtype:9}],lbArPossiesInside:[{lat:-34.410309,lng:19.285169,zoom:15,wtype:9},{lat:-34.408397,lng:19.283066,zoom:15,wtype:9}],lbArPossiesNoBuf:[{lat:-34.405706,lng:19.278517,zoom:10,wtype:9},{lat:-34.408468,lng:19.294739,zoom:12,wtype:9}],lbUpdatePos:function(c,a){var b=null;if(c==1){b=this.lbArPossies[a]}else{if(c==2){b=this.lbArPossiesInside[a]}else{if(c==3){b=this.lbArPossiesNoBuf[a]}}}this.lbParentOwner.MarkerUpdatePosition(b.lat,b.lng,b.zoom);this.lbParentOwner.loadVicinityMarkers(b.lat,b.lng,b.wtype)},lbZoomLevel:15,lbUpdateZoom:function(b){var a=null;if(b=="in"){this.lbZoomLevel++}else{if(b=="out"){this.lbZoomLevel--}}this.lbParentOwner.MarkerUpdateZoom(this.lbZoomLevel)},lbCustomFunc:function(a){this.lbParentOwner.lbCustomFunc(a)},initComponent:function(){Ext.apply(this,{closeAction:"hide",width:this.lbContainerW,height:this.lbContainerH,modal:false,title:"logabout adtest",constrain:true,constrainHeader:true,autoScroll:true,layout:"anchor",items:[{xtype:"panel",width:this.lbContainerW,height:this.lbContainerH,x:0,y:0,anchor:"90% 20%",html:"what up dawg"},{xtype:"panel",x:0,y:50,anchor:"90%",height:40,layout:"hbox",align:"stretch",border:false,items:[{xtype:"button",flex:2,text:"outside 0",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(1,0)},scope:this},{xtype:"button",flex:2,text:"outside 1",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(1,1)},scope:this},{xtype:"button",flex:2,text:"outside 2",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(1,2)},scope:this},{xtype:"button",flex:3,text:"inside 0",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(2,0)},scope:this},{xtype:"button",flex:3,text:"inside 1",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(2,1)},scope:this}]},{xtype:"panel",x:0,y:50,anchor:"90%",height:40,layout:"hbox",align:"stretch",border:false,items:[{xtype:"button",flex:3,text:"no buf 1",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(3,0)},scope:this},{xtype:"button",flex:3,text:"no buf 2",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(3,1)},scope:this},{xtype:"button",flex:3,text:"no results 1",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdatePos(1,3)},scope:this}]},{xtype:"panel",x:0,y:90,anchor:"90%",height:40,layout:"hbox",align:"stretch",border:false,items:[{xtype:"button",flex:2,text:"zoom in",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdateZoom("in")},scope:this},{xtype:"button",flex:2,text:"zoom out",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbUpdateZoom("out")},scope:this}]},{xtype:"panel",x:0,y:140,anchor:"90%",height:40,layout:"hbox",align:"stretch",border:false,items:[{xtype:"button",flex:2,text:"custom 1",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:function(){this.lbCustomFunc("custom param")},scope:this}]}]});Logabout.Demo.ADTestWindow.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.ADTestWindow.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.ADTestMasterSlaveWindow=Ext.extend(Ext.Window,{lbContainerW:null,lbContainerH:null,lbParentOwner:null,lbshow:function(a,b){this.show();if(b){Ext.getCmp("adtest_log").lbStore.baseParams={task:"adtestcustom",adtestcustomsql:"WHERE swpid = "+a+" AND w.sysdelete = 0"};Ext.getCmp("adtest_log").lbLoadData(null,null,null,{params:{start:0,limit:7}});Ext.getCmp("adtest_master").lbLoadData(null,null,null,{params:{adtestcustomsql:"WHERE swpid = "+b+" AND w.sysdelete = 0",start:0,limit:7}});Ext.getCmp("adtest_children").lbLoadData(null,null,null,{params:{adtestcustomsql:"WHERE mswpid = "+b+" AND w.sysdelete = 0",start:0,limit:7}});var c=this.lbmapmgr.getMapCenterInCustomLatLng();var d=this.lbmapmgr.getMapSpanInCustomLatLng();Ext.getCmp("adtest_unclaimed").lbStore.baseParams={task:"adtestcustom",adtestcustomsql:"WHERE w.sysdelete = 0 AND ((w.loguserid = 1 AND NOT EXISTS(SELECT * FROM `sg_waypoints` w2 WHERE w2.mswpid = w.swpid AND w2.mtype = 1)) OR (w.loguserid <> 1 AND w.mswpid IS null))",lat:Number(c.lat),lng:Number(c.lng),spanlat:Number(d.lat),spanlng:Number(d.lng)};Ext.getCmp("adtest_unclaimed").lbLoadData(null,null,null,{params:{start:0,limit:7}})}},getLatLngBox:function(e,f,g){var b=g/111.32;var a=g/Math.abs(111.32*Math.cos((Math.PI/180)*e));var i=e+b/2;var h=e-b/2;var d=f+a/2;var c=f-a/2;return[i,h,d,c]},initComponent:function(){Ext.apply(this,this.lbstandardconfig);Ext.apply(this,{closeAction:"hide",width:this.lbContainerW,height:this.lbContainerH,modal:false,title:"logabout adtest master slave",constrain:true,constrainHeader:true,autoScroll:true,layout:"anchor",items:[new Logabout.Demo.MemoryPanel.ADTestMasterSlave({id:"adtest_log",height:40,anchor:"95%",border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"adtestcustom"},lbusepager:true,lbpagesize:7}),new Logabout.Demo.MemoryPanel.ADTestMasterSlave({id:"adtest_master",height:40,anchor:"95%",border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"adtestcustom"},lbusepager:true,lbpagesize:7}),new Logabout.Demo.MemoryPanel.ADTestMasterSlave({id:"adtest_children",height:100,anchor:"95%",border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"adtestcustom"},lbusepager:true,lbpagesize:7}),new Logabout.Demo.MemoryPanel.ADTestMasterSlave({id:"adtest_unclaimed",height:100,anchor:"95%",border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"adtestcustom"},lbusepager:true,lbpagesize:7})]});Logabout.Demo.ADTestMasterSlaveWindow.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.ADTestMasterSlaveWindow.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.ADTestGoalAdmin=Ext.extend(Ext.Window,{lbContainerW:null,lbContainerH:null,lbParentOwner:null,lbTargWpt:null,lbshow:function(a){this.show();this.orefMempGoals.lbLoadData(null,null,null,{params:{start:0,limit:7}});if(a){this.lbTargWpt=a;this.orefTargAdd.body.update("swpid: "+a.swpid+" sfield1: "+a.sfield1);this.orefTargAddBut.setDisabled(false)}},lbAjax:function(c,d,b,a){Ext.Ajax.request({url:c,params:d,success:function(e,f){var g=Ext.util.JSON.decode(e.responseText);if(g.error){Ext.Msg.show({title:"Error",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}else{if(b){b.createDelegate(a)()}else{this.orefMempGoals.lbStore.reload()}}},failure:function(e,f){Ext.Msg.show({title:"Error",msg:"Transport Error",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})},scope:this})},lbUpdateEBoxes:function(a,b){this.orefGoalName.setValue(a);this.orefGoalDesc.setValue(b)},initComponent:function(){Ext.apply(this,this.lbstandardconfig);Ext.apply(this,{closeAction:"hide",width:this.lbContainerW,height:this.lbContainerH,modal:false,title:"logabout adtest goal admin",constrain:true,constrainHeader:true,autoScroll:true,layout:"absolute",items:[{xtype:"tabpanel",ref:"orefTab",activeTab:0,deferredRender:false,x:5,y:5,width:650,height:280,items:[{layout:"absolute",ref:"/orefTabGoal",title:"goal",items:[new Logabout.Demo.MemoryPanel.GadminGoals({ref:"//orefMempGoals",x:0,y:0,width:630,height:185,border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{table:"sg_goal",format:"json"},lbusepager:true,lbpagesize:7}),{xtype:"panel",layout:"hbox",align:"middle",pack:"center",x:0,y:190,width:630,height:30,items:[{xtype:"textfield",flex:6,ref:"///orefGoalName",emptyText:"goal name",height:20,selectOnFocus:true},{xtype:"textfield",flex:6,ref:"///orefGoalDesc",emptyText:"goal desc",height:20,selectOnFocus:true}]},{xtype:"panel",layout:"hbox",align:"middle",pack:"center",x:0,y:220,width:630,height:30,items:[new Ext.Button({text:"insert",height:20,flex:3,handler:function(){if(Ext.isEmpty(this.orefGoalName.getValue())){return false}this.lbAjax("crud/create",{table:"sg_goal",format:"json",fields:Ext.encode([{goalname:this.orefGoalName.getValue()}])})},scope:this}),new Ext.Button({text:"update",height:20,flex:3,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;if(Ext.isEmpty(this.orefGoalName.getValue())&&Ext.isEmpty(this.orefGoalDesc.getValue())){return false}var b={goalid:a};if(!Ext.isEmpty(this.orefGoalName.getValue())){b.goalname=this.orefGoalName.getValue()}if(!Ext.isEmpty(this.orefGoalDesc.getValue())){b.goaldesc=this.orefGoalDesc.getValue()}this.lbAjax("crud/update",{table:"sg_goal",format:"json",fields:Ext.encode([b])})}},scope:this}),new Ext.Button({text:"delete selected",height:20,flex:7,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;this.lbAjax("crud/delete",{table:"sg_goal",format:"json",fields:Ext.encode([{goalid:a}])})}},scope:this}),new Ext.Button({text:"show selected",height:20,flex:7,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;var b=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalname;this.orefMempGoalItems.lbLoadData(null,null,null,{params:{start:0,limit:7,goalid:a}});this.orefTab.setActiveTab(1);this.orefTabGoalItems.setTitle("goalitems: "+b)}},scope:this})]}]},{layout:"absolute",ref:"/orefTabGoalItems",title:"goalitems",items:[new Logabout.Demo.MemoryPanel.GadminGoalItems({ref:"//orefMempGoalItems",x:0,y:0,width:630,height:185,border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{table:"sg_goalitem",format:"json"},lbusepager:true,lbpagesize:7}),{xtype:"panel",layout:"hbox",align:"middle",pack:"center",x:0,y:190,width:630,height:30,items:[new Ext.Button({text:"delete selected",height:20,flex:7,handler:function(){if(this.orefMempGoalItems.lbDataView.getSelectionCount()>0){var a=this.orefMempGoalItems.lbDataView.getSelectedRecords()[0].data.goalitmid;this.lbAjax("crud/delete",{table:"sg_goalitem",format:"json",fields:Ext.encode([{goalitmid:a}])},function(){this.orefMempGoalItems.lbStore.reload()},this)}},scope:this}),new Ext.Button({text:"make goal picture and pos",height:20,flex:7,handler:function(){if(this.orefMempGoalItems.lbDataView.getSelectionCount()>0){var a=this.orefMempGoalItems.lbDataView.getSelectedRecords()[0].data;this.lbAjax("crud/update",{table:"sg_goal",format:"json",fields:Ext.encode([{goalid:a.goalid,sfield8:a.sfield8,ifield10:a.ifield10,lat:a.lat,lng:a.lng,alt:a.alt,gmapzoom:a.gmapzoom}])},function(){this.orefMempGoals.lbStore.reload()},this)}},scope:this})]}]}]},{xtype:"panel",x:5,y:295,width:650,height:50,items:[{html:"yebo gogo",ref:"/orefTargAdd"},{xtype:"panel",layout:"hbox",align:"middle",pack:"center",items:[new Ext.Button({text:"add to selected goal",ref:"//orefTargAddBut",disabled:true,height:20,flex:7,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0&&this.lbTargWpt){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;this.lbAjax("crud/create",{table:"sg_goalitem",format:"json",fields:Ext.encode([{goalid:a,goalswpid:this.lbTargWpt.swpid,sfield1:this.lbTargWpt.sfield1,goaldesc:this.lbTargWpt.goaldesc,sfield8:this.lbTargWpt.sfield8,ifield10:this.lbTargWpt.ifield10}])},function(){this.lbTargWpt=null;this.orefTargAdd.body.update("added");this.orefTargAddBut.setDisabled(true)},this)}},scope:this}),new Ext.Button({text:"update goal count",ref:"//orefTestBut1",disabled:false,height:20,flex:7,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;this.lbAjax("crud/updategoalcount",{format:"json",goalid:a})}},scope:this}),new Ext.Button({text:"test process selected",ref:"//orefTestBut2",disabled:false,height:20,flex:7,handler:function(){if(this.orefMempGoals.lbDataView.getSelectionCount()>0){var a=this.orefMempGoals.lbDataView.getSelectedRecords()[0].data.goalid;this.lbAjax("crud/updategoaluser",{format:"json",goalid:a,loguserid:this.lbluid})}},scope:this})]}]}]});Logabout.Demo.ADTestGoalAdmin.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.ADTestGoalAdmin.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.NameMapSearchNewPanel=Ext.extend(Ext.Panel,{lbMenuHandler:function(a){switch(a){case"newWiz":Logabout.Bridgeport.newWizWaypoint(true);Logabout.Bridgeport.trackEvent("namemapsearch","newWizWpt","click");break}},setAutoSearchOnOff:function(a){if(a){this.searchManager.enableAutoSearch();if(!this.gmMoveH){this.gmMoveH=GEvent.addListener(this.lbmapmgr.map,"moveend",(function(){console.log("namemapsearchnewpanel: setAutoSearchOnOff: MAP moveend fired");var b=this.lbmapmgr.map.getBounds();this.searchManager.bufferAddSearchArea({sw:{lat:b.getSouthWest().lat(),lng:b.getSouthWest().lng()},ne:{lat:b.getNorthEast().lat(),lng:b.getNorthEast().lng()},center:{lat:b.getCenter().lat(),lng:b.getCenter().lng()},zoom:this.lbmapmgr.map.getZoom(),source:"userdrag",loguserid:49,wtypelist:this.searchFilterWtypeList})}).createDelegate(this))}}else{this.searchManager.disableAutoSearch();GEvent.removeListener(this.gmMoveH);this.gmMoveH=null}},geoCodeThisHandler:function(){Logabout.Bridgeport.trackEvent("namemapsearch","geocode",Ext.getCmp("geocodesearchstring").getValue());this.geoCodeThis.geocode(Ext.getCmp("geocodesearchstring").getValue())},resultsCloseHandler:function(){this.getLayout().setActiveItem(0);this.searchManager.clearAllSearchStuff();Ext.getCmp("searchresultsmap").lbClearSearch()},searchHereHandler:function(){if(this.lbmapmgr.map){var a=this.lbmapmgr.map.getBounds();this.searchManager.forceSearch({sw:{lat:a.getSouthWest().lat(),lng:a.getSouthWest().lng()},ne:{lat:a.getNorthEast().lat(),lng:a.getNorthEast().lng()},center:{lat:a.getCenter().lat(),lng:a.getCenter().lng()},zoom:this.lbmapmgr.map.getZoom(),source:"userdrag",loguserid:49,wtypelist:this.searchFilterWtypeList})}Logabout.Bridgeport.trackEvent("namemapsearch","searchHere","click")},searchMoreHandler:function(){if(this.lbmapmgr.map){var a=this.lbmapmgr.map.getBounds();this.searchManager.manualSearchRepeat({sw:{lat:a.getSouthWest().lat(),lng:a.getSouthWest().lng()},ne:{lat:a.getNorthEast().lat(),lng:a.getNorthEast().lng()},center:{lat:a.getCenter().lat(),lng:a.getCenter().lng()},zoom:this.lbmapmgr.map.getZoom(),source:"userdrag",loguserid:49,wtypelist:this.searchFilterWtypeList},0.3)}Logabout.Bridgeport.trackEvent("namemapsearch","searchHereMore","click")},nextSearch:function(){this.searchManager.searchNow()},searchFilterWtypeList:[],searchFilterCheck:function(b){if(b>0){var d=null;for(var c=0,a=this.searchFilterWtypeList.length;c<a;c++){if(this.searchFilterWtypeList[c]==b){d=c;break}}if(d!==null){return true}else{return false}}else{if(this.searchFilterWtypeList.length>0){return false}else{return true}}},searchFilterSetUi:function(){if(Ext.getCmp("searchfilter-checks")){Ext.getCmp("searchfilter-checks").menu.items.each(function(c){c.setChecked(false,true)})}if(this.searchFilterWtypeList.length==0){if(Ext.getCmp("searchfilter-clear")){Ext.getCmp("searchfilter-clear").setDisabled(true)}}else{for(var b=0,a=this.searchFilterWtypeList.length;b<a;b++){if(Ext.getCmp("searchfilter-"+this.searchFilterWtypeList[b])){Ext.getCmp("searchfilter-"+this.searchFilterWtypeList[b]).setChecked(true,true)}}if(Ext.getCmp("searchfilter-clear")){Ext.getCmp("searchfilter-clear").setDisabled(false)}}},searchFilterWtypeListMod:function(b,d){if(!b){this.searchFilterWtypeList.length=0}else{var e=null;for(var c=0,a=this.searchFilterWtypeList.length;c<a;c++){if(this.searchFilterWtypeList[c]==b){e=c;break}}if(e!==null){this.searchFilterWtypeList.splice(e,1)}else{if(!d){this.searchFilterWtypeList.push(b)}}}this.searchFilterSetUi()},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.geoCodeThis=new Logabout.Demo.GeoCodeThis({lbmapmgr:this.lbmapmgr,lbtplFunctions:this.lbtplFunctions,lburl:this.lburl,lbtimeout:this.lbtimeout.geocodethis});this.geoCodeThis.on("geocoderstatus",function(g,f){var h=Ext.getCmp("geocodesearchstring");h.setValue(f.status);switch(f.status){case"searching":h.setValue("searching..");break;case"found":h.setValue(f.address);break;case"notfound":h.setValue("location not found. please try again.");h.selectText();break}},this);this.geoCodeThis.on("geocoderesults",function(g,f){var h=Ext.getCmp("geocodesearchstring");h.setValue(f.status);switch(f.status){case"found":h.setValue("");Ext.getCmp("searchresultsgeocode").lbUpdateColzoomlevel({centerlat:f.positionobject.celat,centerlng:f.positionobject.celng,zfactor:0.8,doNotUseFactor:true,sortDir:"ASC",sortFunc:function(j,i){if(j.diffdist<i.diffdist){return -1}if(j.diffdist>i.diffdist){return 1}return 0}});this.lbmapmgr.setActiveCol("searchresultsgeocode");this.getLayout().setActiveItem(1);Ext.getCmp("searchresultsgeocode").lbSetResultValue(f.positionobject.searchAddress);Ext.getCmp("searchresultsgeocode").lbLoadData({totalrows:f.totalrows,results:f.results});break;case"notfound":h.setValue("");this.getLayout().setActiveItem(1);Ext.getCmp("searchresultsgeocode").lbSetResultValue(f.positionobject.searchAddress);Ext.getCmp("searchresultsgeocode").lbLoadData({totalrows:0,results:[]});break}},this);this.searchManager=new Logabout.SearchManager({saMinSecs:3,lbluid:this.lbluid,lburl:this.lburl,lbmapmgr:this.lbmapmgr,lbtplFunctions:this.markerTemplateFuncs});this.searchManager.on("searchstatus",function(f,j,g,i){var h=Ext.getCmp("sa-cb");switch(j.status){case"limited":break;case"busy":h.setIconClass("db-icon-loading");h.setText("searching...");Ext.QuickTips.tips({target:h.getEl().child("button"),text:"searching... please wait."});Ext.getCmp("searchresultsmap").lbSetSearchResult(null,null,true);break;case"incomplete":h.setIconClass("db-icon-magnify");h.setText("search the map");this.getLayout().setActiveItem(2);Ext.getCmp("searchresultsmap").lbLoadData({totalrows:i.totalrows,results:i.results},(j.qcount==1?false:true));Ext.getCmp("searchresultsmap").lbSetSearchResult(j.rcount,false,false);break;case"complete":h.setIconClass("db-icon-magnify");h.setText("search the map");Ext.QuickTips.tips({target:h.getEl().child("button"),text:"search is complete. move or zoom the map to start a new search."});this.getLayout().setActiveItem(2);Ext.getCmp("searchresultsmap").lbLoadData({totalrows:i.totalrows,results:i.results},(j.qcount==1?false:true));Ext.getCmp("searchresultsmap").lbSetSearchResult(j.rcount,true,false);break;case"off":break;case"waiting":break;case"cleared":h.setIconClass("db-icon-magnify");h.setText("search the map");break;case"suspendactive":break;case"resumeactive":break}},this);var d=3;var a=this.lbHeight/3-d;var e=0;var c=e+a+d;var b=c+a+d;Ext.apply(this,{layout:"card",width:this.lbWidth,height:this.lbHeight,activeItem:0,border:false,items:[{layout:"absolute",width:this.lbWidth,height:this.lbHeight,border:false,items:[{layout:"absolute",width:this.lbWidth,height:a,x:0,y:e,border:false,cls:"db-custpanel-color",items:[{border:false,x:3,y:0,html:'<div class="fdemo-where">Want to log something? Start by searching near a city or state.</div>'},{id:"geocodesearchstring",xtype:"trigger",x:5,y:30,width:this.lbWidth-50,emptyText:"example: houston, tx",onTriggerClick:this.geoCodeThisHandler.createDelegate(this),selectOnFocus:true,triggerClass:"x-form-search-trigger",listeners:{render:function(f){f.getEl().addKeyMap({key:Ext.EventObject.ENTER,fn:this.geoCodeThisHandler,scope:this})},scope:this}}]},{layout:"absolute",width:this.lbWidth,height:a,x:0,y:c,border:false,cls:"db-custpanel-color",items:[{border:false,x:3,y:0,html:'<div class="fdemo-where">Or search the current map display.</div>'},{xtype:"button",id:"sa-cb",height:30,width:this.lbWidth-50,x:5,y:30,text:"search the map",tooltip:"click to search current map view",iconCls:"db-icon-magnify",iconAlign:"left",cls:"db-button",handler:this.searchHereHandler,scope:this}]},{layout:"absolute",width:this.lbWidth,height:a,x:0,y:b,border:false,cls:"db-custpanel-color",items:[{border:false,x:3,y:0,html:'<div class="fdemo-where">Still no luck... help us out by adding a new place.</div>'},{xtype:"button",height:30,width:this.lbWidth-50,x:5,y:30,text:"Add new place",tooltip:"click to add a new place using the wizard",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["newWiz"])}]}]},new Logabout.Demo.MemoryPanel.SearchResultsGeoCode({id:"searchresultsgeocode",width:this.lbWidth,height:this.lbHeight,lbstandardconfig:this.lbstandardconfig,lbtplFunctions:this.lbtplFunctions,border:false,listeners:{clickedclose:function(f){this.resultsCloseHandler()},scope:this}}),new Logabout.Demo.MemoryPanel.SearchResultsMap({id:"searchresultsmap",width:this.lbWidth,height:this.lbHeight,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbtplFunctions:this.lbtplFunctions,border:false,listeners:{clickedclose:function(f){this.resultsCloseHandler()},scope:this}})]});Logabout.Demo.NameMapSearchNewPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.NameMapSearchNewPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.IntroPanel=Ext.extend(Ext.Panel,{lbMenuHandler:function(a){switch(a){case"newWiz":Logabout.Bridgeport.newWizWaypoint(true);Logabout.Bridgeport.trackEvent("intropanel","newWiz","click");break;case"showRank":Logabout.Bridgeport.setMenu("card-people");Logabout.Bridgeport.trackEvent("intropanel","showPeople","click");break;case"showList":this.orefIntroplaces.lbSetOneLineCount();this.lbSwitchLeftCard(0);Logabout.Bridgeport.trackEvent("intropanel","showWptlist","click");break;case"showSearch":Logabout.Bridgeport.setMenu("card-news");Logabout.Bridgeport.trackEvent("intropanel","showSearch","click");break;case"showHelp":Logabout.Bridgeport.showHelp();Logabout.Bridgeport.trackEvent("intropanel","showHelp","click");break;case"showLogin":Logabout.Bridgeport.trackEvent("intropanel","login","click");window.location.pathname="user/login";break}},lbSwitchLeftCard:function(a){this.orefLeftCard.getLayout().setActiveItem(a)},lbLoad:function(){this.orefIntroplaces.lbStore.load({params:{browserts:new Date().format("U")}})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);var a=600;var b=this.lbWidth-a;Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,border:false,items:[{layout:"card",ref:"orefLeftCard",width:a,height:this.lbHeight,x:0,y:0,activeItem:0,border:false,items:[new Logabout.Demo.MemoryPanel.IntroPlaces({ref:"/orefIntroplaces",lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbtplFunctions:this.lbtplFunctions,border:false,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"getrecentwpt",extra:"introlist",wtypelist:Ext.encode([9,10]),start:0,limit:10,uid:this.lbluid},lbusepager:false,lbpagesize:7}),{layout:"absolute",width:a,height:this.lbHeight,border:false,cls:"db-custpanel-color",items:[{border:false,ref:"//orefResultOk",width:a-20,height:80,x:20,y:20,hidden:true,html:{tag:"div",cls:"intro-points-result-main",children:[{tag:"div",cls:"intro-points-result-topitm",children:[{tag:"span",html:"Congratulations. You just scored "},{tag:"span",cls:"intro-points-result-value",html:""},{tag:"span",html:" points."}]},{tag:"div",cls:"intro-points-result-itm",children:[{tag:"span",html:"See your ranking "},{tag:"span",cls:"db-dv-linkitem db-action-showrank",html:"here"},{tag:"span",html:" You can score even more points by "},{tag:"span",cls:"db-dv-linkitem db-action-createnew",html:"founding a new place."}]}]},listeners:{afterrender:function(c){c.body.child(".db-dv-linkitem.db-action-showrank").addClassOnOver("db-dv-linkover").on("click",function(e,d){Logabout.Bridgeport.showUserPanel(this.lbluid,this.lbuname,null,null,"alldates",null,null,null,true,"hist");Logabout.Bridgeport.trackEvent("intropanel","showUserPanel","click")},this);c.body.child(".db-dv-linkitem.db-action-createnew").addClassOnOver("db-dv-linkover").on("click",function(e,d){if(Ext.get(d.id)!=null){this.lbMenuHandler("newWiz")}},this)},scope:this}},{border:false,ref:"//orefResultNOTOk",width:a-20,height:80,x:20,y:20,hidden:false,html:{tag:"div",cls:"intro-points-result-main",children:[{tag:"div",cls:"intro-points-result-topitm",children:[{tag:"span",html:"So far you have not scored any points during this session. "}]},{tag:"div",cls:"intro-points-result-itm",children:[{tag:"span",html:"Log some places and score points to improve your ranking. You can "},{tag:"span",cls:"db-dv-linkitem db-action-showsearch",html:"search"},{tag:"span",html:" for places or "},{tag:"span",cls:"db-dv-linkitem db-action-createnew",html:"create your own."}]}]},listeners:{afterrender:function(c){c.body.child(".db-dv-linkitem.db-action-showsearch").addClassOnOver("db-dv-linkover").on("click",function(e,d){if(Ext.get(d.id)!=null){this.lbMenuHandler("showSearch")}},this);c.body.child(".db-dv-linkitem.db-action-createnew").addClassOnOver("db-dv-linkover").on("click",function(e,d){if(Ext.get(d.id)!=null){this.lbMenuHandler("newWiz")}},this)},scope:this}},{border:false,ref:"//orefResultGuestWarn",width:a-20,height:60,x:20,y:120,hidden:(this.lbisguestuser==true)?false:true,html:{tag:"div",cls:"intro-points-result-warn db-icon db-icon-error",children:[{tag:"span",html:"Welcome Guest user."},{tag:"span",html:" You have to "},{tag:"span",cls:"db-dv-linkitem db-action-login",html:"log in"},{tag:"span",html:" to save your log entries."},{tag:"span",cls:"db-dv-linkitem db-action-login",html:" Create"},{tag:"span",html:" a free account to own your points and to get ranked"}]},listeners:{afterrender:function(c){c.body.select(".db-dv-linkitem.db-action-login").addClassOnOver("db-dv-linkover").on("click",function(e,d){if(Ext.get(d.id)!=null){this.lbMenuHandler("showLogin")}},this)},scope:this}},{xtype:"button",height:30,width:150,x:20,y:180,text:"show the list again",tooltip:"show the list again",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["showList"])}]}]},{xtype:"panel",layout:"absolute",width:b-10,height:this.lbHeight,x:a+5,y:0,border:false,cls:"db-custpanel-color",items:[{xtype:"panel",border:false,height:45,width:b-50,x:10,y:7,html:{tag:"div",cls:"intro-points-main",children:[{tag:"div",cls:"intro-points-title",html:"points this session"},{tag:"div",cls:"intro-points-value",html:"0"}]}},{border:false,width:b-20,height:130,x:5,y:60,hidden:false,html:{tag:"div",cls:"intro-points-explain",children:[{tag:"div",cls:"intro-points-itmtop",children:[{tag:"span",html:"These places were founded by our users."}]},{tag:"div",cls:"intro-points-itm",children:[{tag:"span",html:"Have you been to any of them?"},{tag:"span",html:" You can get points (and a ranking) by logging your visit."}]}]}},{xtype:"button",height:30,width:b-50,x:15,y:190,text:"Search for More",tooltip:"click here to search for more",iconCls:"db-icon-help",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["showSearch"])}]}]});Logabout.Demo.IntroPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.IntroPanel.superclass.onRender.apply(this,arguments);this.lbsignalController.on({menuitemchange:function(b,a){if(a==this.lbCardHolder){if(!this.lbInitialized){this.lbLoad();this.lbInitialized=true}}},scope:this});this.lbsignalController.on("userstatsupdated",function(c,b,a){this.body.select(".intro-points-value",true).update(a.pntcnt.session);this.body.select(".intro-points-result-value",true).update(a.pntcnt.session);if(a.pntcnt.session>0){this.orefResultOk.show();this.orefResultNOTOk.hide()}else{this.orefResultOk.hide();this.orefResultNOTOk.show()}},this)}});Ext.namespace("Logabout.Demo");Logabout.Demo.GoalPanel=Ext.extend(Ext.Panel,{lbSetLastActiveChild:function(c){var b=5},lbResetGoalView:function(){this.getLayout().setActiveItem(1)},lbMenuHandler:function(a){switch(a){case"newWiz":Logabout.Bridgeport.newWizWaypoint(true);Logabout.Bridgeport.trackEvent("goalpanel","newWiz","click");break;case"showRank":Logabout.Bridgeport.setMenu("card-people");Logabout.Bridgeport.trackEvent("goalpanel","showPeople","click");break;case"showList":this.orefIntroplaces.lbSetOneLineCount();this.lbSwitchLeftCard(1);Logabout.Bridgeport.trackEvent("goalpanel","showWptlist","click");break;case"showSearch":Logabout.Bridgeport.setMenu("card-news");Logabout.Bridgeport.trackEvent("goalpanel","showSearch","click");break;case"showHelp":Logabout.Bridgeport.showHelp();Logabout.Bridgeport.trackEvent("goalpanel","showHelp","click");break;case"showLogin":Logabout.Bridgeport.trackEvent("goalpanel","login","click");window.location.pathname="user/login";break;case"showGoalUsers":this.showGoalUsers(this.scorebarState.goalid);break;case"showMyGoalItems":Logabout.Bridgeport.trackEvent("goalpanel","showmygoalitems","click");this.showGoalUserItems(this.scorebarState.goalid,this.lbluid,this.lbuname);break;case"showGoals":this.showGoals();break}},lbSwitchLeftCard:function(a){this.orefLeftCard.getLayout().setActiveItem(a)},lbLoad:function(a){this.getLayout().setActiveItem(1);this.orefLeftCard.getLayout().setActiveItem(0);if(!this.lbInitialized){this.orefMempGoals.lbStore.load({params:{browserts:new Date().format("U")},callback:function(c,b,d){if(a!=null){if(a.goalid!=null&&a.userid==null){this.showGoalUsers(a.goalid)}else{if(a.userid!=null){this.showGoalUserItems(a.goalid,a.userid,a.username)}}}},scope:this});this.lbInitialized=true}else{if(a!=null){if(a.goalid!=null&&a.userid==null){this.showGoalUsers(a.goalid)}else{if(a.userid!=null){this.showGoalUserItems(a.goalid,a.userid,a.username)}}}}},scorebarTplDef:['<div class="goal-scorebar-main">','<div class="goal-scorebar-crumbs">','<tpl if="this.showCrumbLevel(1,values)">','<div class="goal-sb-crumbs-itm db-action-goals">',"Goals","</div>","</tpl>",'<tpl if="this.showCrumbLevel(2,values)">','<span class="goal-sb-crumbs-itm2">>></span>','<div class="goal-sb-crumbs-itm db-action-goalname">',"{goalname}",'<span class="db-dv-linkdata">{goalid}</span>',"</div>","</tpl>",'<tpl if="this.showCrumbLevel(3,values)">','<span class="goal-sb-crumbs-itm2">>></span>','<div class="goal-sb-crumbs-itm db-action-username">',"{goalusername}",'<span class="db-dv-linkdata">{goalid}_{goaluserid}_{goalusername}</span>',"</div>","</tpl>","</div>",'<tpl if="this.showPoints(values)">','<div class="lb-round-border-5 goal-scorebar-pointgrats">','<tpl if="!this.showCongrats(values)">','<div class="goal-scorebar-points">',"<span>{usertotal} out of {goaltotal}</span>","</div>","</tpl>",'<tpl if="this.showCongrats(values)">','<div class="goal-scorebar-congrats">',"<span >goal complete ({usertotal}/{goaltotal})</span>","</div>","</tpl>","</div>","</tpl>",'<div class="goal-clear"></div>',"</div>"],scorebarTplFuncs:{showCrumbLevel:function(b,a){if(b==1){return true}else{if(b==2&&a.goalid!=null){return true}else{if(b==3&&a.goalid!=null&&a.goaluserid!=null){return true}else{return false}}}},showPoints:function(a){if(a.goalid!=null&&a.goaluserid!=null){return true}else{return false}},showCongrats:function(a){if(a.goalid!=null&&a.goaluserid!=null&&a.usertotal==a.goaltotal){return true}else{return false}}},scorebarState:{goalid:null,goalname:null,goaldesc:null,goaluserid:null,goalusername:null,usertotal:null,goaltotal:null},scorebarTplUpdate:function(){this.orefGoalScoreBar.body.update(this.scorebarTpl.apply(this.scorebarState));this.orefGoalScoreBar.body.select(".goal-sb-crumbs-itm").addClassOnOver("db-dv-linkover");if(this.scorebarState.goalid!=null){this.orefButMyProgress.setDisabled(false);this.orefButAllUsers.setDisabled(false);this.orefGoalDesc.show();this.orefGoalDesc.body.child(".goal-desc-itmtop").update(this.scorebarState.goaldesc)}else{this.orefButMyProgress.setDisabled(true);this.orefButAllUsers.setDisabled(true);this.orefGoalDesc.show();this.orefGoalDesc.body.child(".goal-desc-itmtop").update("Choose a goal on the left, then click the places you have been to")}},showGoals:function(){this.scorebarState.goalid=null;this.scorebarState.goaluserid=null;this.scorebarState.goalusername=null;this.scorebarState.usertotal=null;this.scorebarState.goalname=null;this.scorebarState.goaldesc=null;this.scorebarState.goaltotal=null;this.scorebarTplUpdate();this.getLayout().setActiveItem(1);this.orefLeftCard.getLayout().setActiveItem(0);if(!this.lbisguestuser){this.lbAjax("crud/updategoaluser",{format:"json",loguserid:this.lbluid},function(){this.orefMempGoals.lbStore.reload()},this)}},showGoalUsers:function(a){var b=this.orefMempGoals.lbDataView.getStore().getById(a);this.scorebarState.goalid=a;this.scorebarState.goaluserid=null;this.scorebarState.goalusername=null;this.scorebarState.usertotal=null;this.scorebarState.goalname=b.data.goalname;this.scorebarState.goaldesc=b.data.goaldesc;this.scorebarState.goaltotal=b.data.itemcount;this.getLayout().setActiveItem(1);this.orefLeftCard.getLayout().setActiveItem(2);this.orefGoalUsers.lbStore.load({params:{browserts:new Date().format("U"),goalid:a,loguserid:this.lbluid}});this.scorebarTplUpdate()},showGoalUserItems:function(b,d,a){var c=this.orefMempGoals.lbDataView.getStore().getById(b);this.scorebarState.goalid=b;this.scorebarState.goaluserid=d;this.scorebarState.goalusername=a;this.scorebarState.usertotal=null;this.scorebarState.goalname=c.data.goalname;this.scorebarState.goaldesc=c.data.goaldesc;this.scorebarState.goaltotal=c.data.itemcount;this.getLayout().setActiveItem(1);this.orefLeftCard.getLayout().setActiveItem(1);this.orefGoalItems.lbStore.load({params:{browserts:new Date().format("U"),goalid:b,loguserid:d}});this.scorebarTplUpdate()},lbGoalUpdate:function(b,a){this.scorebarState.usertotal=b;this.scorebarState.goaltotal=a;this.scorebarTplUpdate()},lbCurrentGoalCompleted:false,lbGoalItemUpdate:function(b,d,c,a){if(a){this.lbCurrentGoalCompleted=d==c}else{if(this.lbCurrentGoalCompleted&&d!=c){Logabout.Bridgeport.updateUserStats(this,"gupdate",{goccnt:-1,goccntchg:-1,gocbonus:-Logabout.Defs.StatsBonus.gocbonus,pntcnt:-Logabout.Defs.StatsBonus.gocbonus,pntcntchg:-Logabout.Defs.StatsBonus.gocbonus});if(!this.lbisguestuser){this.lbAjax("crud/updategoaluser",{format:"json",goalid:b,loguserid:this.lbluid})}}if(!this.lbCurrentGoalCompleted&&d==c){Logabout.Bridgeport.updateUserStats(this,"gupdate",{goccnt:1,goccntchg:1,gocbonus:Logabout.Defs.StatsBonus.gocbonus,pntcnt:Logabout.Defs.StatsBonus.gocbonus,pntcntchg:Logabout.Defs.StatsBonus.gocbonus});if(!this.lbisguestuser){this.lbAjax("crud/updategoaluser",{format:"json",goalid:b,loguserid:this.lbluid})}}this.lbCurrentGoalCompleted=d==c}this.scorebarState.usertotal=d;this.scorebarTplUpdate()},lbAjax:function(c,d,b,a){Ext.Ajax.request({url:c,params:d,success:function(e,f){var g=Ext.util.JSON.decode(e.responseText);if(g.error){Ext.Msg.show({title:"Error",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}else{if(b){b.createDelegate(a)()}}},failure:function(e,f){Ext.Msg.show({title:"Error",msg:"Transport Error",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})},scope:this})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.scorebarTpl=new Ext.XTemplate(this.scorebarTplDef.join(""),this.scorebarTplFuncs);this.scorebarTpl.compile();var a=600;var b=this.lbWidth-a;var c=30;Ext.apply(this,{layout:"card",activeItem:1,width:this.lbWidth,height:this.lbHeight,border:false,deferredRender:false,items:[{xtype:"panel",layout:"absolute",width:this.lbWidth,height:this.lbHeight,border:false,items:[{border:false,ref:"/orefGoalListBar",width:190-3,height:this.lbHeight-6,x:this.lbWidth-190+5,y:3,hidden:false,cls:"db-custpanel-color",html:{tag:"div",cls:"goal-intro-main",children:[{tag:"div",cls:"lb-round-border-10 goal-intro-msg",children:[{tag:"span",cls:"goal-intro-new",html:" "},{tag:"span",html:"New on Logabout. Work on a goal and compare your progress with the competition. Get started by choosing a goal on the left."}]},{tag:"div",cls:"lb-round-border-10 goal-intro-stats",children:[{tag:"span",cls:"goal-intro-h",html:"currently there are"},{tag:"span",cls:"goal-intro-count",html:"x"},{tag:"span",cls:"goal-intro-h2",html:"users"},{tag:"span",cls:"goal-intro-h",html:"working on"},{tag:"span",cls:"goal-intro-total",html:"y"},{tag:"span",cls:"goal-intro-h2",html:"goals"}]}]}}]},{xtype:"panel",layout:"absolute",border:false,items:[{border:false,ref:"/orefGoalScoreBar",width:this.lbWidth,height:c,x:0,y:0,hidden:false,cls:"db-custpanel-color",html:{tag:"div",cls:"goal-scorebar-container",html:""},listeners:{afterrender:function(d){d.body.on("click",function(f,e){this.lbMenuHandler("showGoals")},this,{delegate:".db-action-goals"});d.body.on("click",function(g,f){var e=Ext.get(f.id).child(".db-dv-linkdata",true).firstChild.nodeValue;this.showGoalUsers(e)},this,{delegate:".db-action-goalname"});d.body.on("click",function(g,f){var e=Ext.get(f.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");this.showGoalUserItems(e[0],e[1],e[2])},this,{delegate:".db-action-username"})},scope:this}},{layout:"card",ref:"/orefLeftCard",width:a,height:this.lbHeight-c,x:0,y:c,activeItem:1,border:false,deferredRender:false,items:[new Logabout.Demo.MemoryPanel.GpanelGoals({ref:"//orefMempGoals",x:0,y:0,width:a,height:this.lbHeight-40,border:false,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbidprop:"goalid",lbbaseparams:{table:"sg_goal",format:"json",loguserid:this.lbluid},lbusepager:false,lbpagesize:7}),new Logabout.Demo.MemoryPanel.GpanelGoalItems({ref:"//orefGoalItems",x:0,y:0,width:a,height:this.lbHeight-40,border:false,lbshowtitlebar:false,lbParentOwner:this,lbidprop:"swpid",lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{table:"sg_gpanelgoalitem",format:"json"},lbusepager:false,lbpagesize:7}),new Logabout.Demo.MemoryPanel.GpanelGoalUsers({ref:"//orefGoalUsers",x:0,y:0,width:a,height:this.lbHeight-40,border:false,lbshowtitlebar:false,lbParentOwner:this,lbidprop:"goaluserid",lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{table:"sg_gpanelgoaluser",format:"json"},lbusepager:false,lbpagesize:7})]},{xtype:"panel",width:b,height:this.lbHeight-c,x:a,y:c,border:false,cls:"db-custpanel-color",items:[{xtype:"panel",layout:"absolute",width:b-10,height:this.lbHeight-c,x:a+5,y:c,border:false,items:[{xtype:"panel",ref:"///orefGoalDesc",border:false,width:b-20,height:this.lbHeight-c-70,x:5,y:5,hidden:false,html:{tag:"div",cls:"goal-desc-main lb-round-border-5",children:[{tag:"div",cls:"goal-desc-itmtop",children:[{tag:"span",html:"goal desc goes here"}]}]}},{xtype:"button",height:30,width:(b-20)/2,x:5,y:this.lbHeight-c-70,text:"All Goals",tooltip:"click here to show all goals",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["showGoals"])},{xtype:"button",ref:"///orefButAllUsers",height:30,width:(b-20)/2,x:10+(b-20)/2,y:this.lbHeight-c-70,text:"All Users",tooltip:"click here to show all users for the selected goal",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["showGoalUsers"])},{xtype:"button",ref:"///orefButMyProgress",height:30,width:b-15,x:5,y:this.lbHeight-c-35,text:"Show My progress",tooltip:"click here to see your progress on the selected goal",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["showMyGoalItems"])}]}]}]}]});Logabout.Demo.GoalPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.GoalPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.QuickUserPanel=Ext.extend(Ext.Panel,{lbSetLastActiveChild:function(c){var b=5},lbMenuHandler:function(a){switch(a){case"newWiz":Logabout.Bridgeport.newWizWaypoint(true);Logabout.Bridgeport.trackEvent("quickuserpanel","newWiz","click");break;case"showPeople":Logabout.Bridgeport.setMenu("card-people");Logabout.Bridgeport.trackEvent("quickuserpanel","showPeople","click");break;case"showSearch":Logabout.Bridgeport.setMenu("card-search");Logabout.Bridgeport.trackEvent("quickuserpanel","showSearch","click");break;case"showHelp":Logabout.Bridgeport.showHelp();Logabout.Bridgeport.trackEvent("quickuserpanel","showHelp","click");break;case"showLogin":Logabout.Bridgeport.trackEvent("quickuserpanel","showLogin","click");window.location.pathname="user/login";break;case"showGoals":Logabout.Bridgeport.trackEvent("quickuserpanel","showGoals","click");Logabout.Bridgeport.showGoal();break;case"showProfile":Logabout.Bridgeport.trackEvent("quickuserpanel","showProfile","click");Logabout.Bridgeport.showProfile(this.quickUserData.userid,this.quickUserData.username);break;case"showUserEmailEdit":Logabout.Bridgeport.trackEvent("quickuserpanel","showUserEmailEdit","click");Logabout.Bridgeport.showQuickSignIn("emailedit");break;case"showCloseBonus":Logabout.Bridgeport.trackEvent("quickuserpanel","showCloseBonus","click");this.quickUserData.acknowledgebonus=0;this.orefCard1.body.child(".quserp-sec-switch").replaceClass("quserp-show-bonus","quserp-show-recent");break;case"showUserStats":Logabout.Bridgeport.trackEvent("quickuserpanel","showUserStats","click");Logabout.Bridgeport.showUserPanel(this.lbluid,this.lbuname,null,null,null,null,null,null,true,"hist");break;case"showUserLogs":Logabout.Bridgeport.trackEvent("quickuserpanel","showUserLogs","click");Logabout.Bridgeport.showUserPanel(this.lbluid,this.lbuname,null,null,null,null,null,null,true,"waypoints");break;case"showUserAccount":Logabout.Bridgeport.trackEvent("quickuserpanel","showUserAccount","click");Logabout.Bridgeport.showQuickSignIn("account");break}},lbLoad:function(){if(!this.lbInitialized){this.getLayout().setActiveItem(0);this.card1TplUpdate(true);this.lbInitialized=true}},card1TplDef:['<div class="quserp-main">','<div class="X-quserp-main-inner X-lb-round-border-10">','<tpl for=".">','<div class="quserp-sec-name">','<div class="quserp-itm-left">',"<div>",'<span class="db-icon db-icon-userblue querp-username">{username}</span>',"</div>","</div>",'<div class="quserp-itm-right">','<span class="db-dv-linkitem db-action-account">',"my account","</span>","<span> | </span>",'<span class="db-dv-linkitem db-action-account">',"sign-out","</span>","</div>",'<div class="quserp-clear"></div>',"</div>",'<div class="quserp-sec-stats lb-round-border-5">','<div class="quserp-itm-left tt-help-icon">',"<span>your stats</span>",'<div class="tt-trigger tt-hide">','<div class="tt-main">','<div class="tt-help-title"><div class="db-icon db-icon-help">help</div></div>','<div class="db-icon db-icon-userblue">rank: this is your ranking on logabout</div>','<div class="db-icon db-icon-founded">places: how many places you have founded</div>','<div class="db-icon db-icon-goal">goals: how many goals you have completed</div>','<div class="">click on details to see how points are calculated</div>',"</div>","</div>","</div>",'<div class="quserp-itm-right db-icon db-icon-go">','<span class="db-dv-linkitem db-action-morestats">',"details","</span>","</div>",'<div class="quserp-clear"></div>','<div class="quserp-statlist">','<div class="quserp-stat-itm db-icon db-icon-userblue">',"<span>rank:</span>","<span>{pntrank}</span>","</div>",'<div class="quserp-stat-itm db-icon db-icon-founded">',"<span>places:</span>","<span>{fdrcnt}</span>","</div>",'<div class="quserp-stat-itm db-icon db-icon-goal">',"<span>goals:</span>","<span>{goccnt}</span>","</div>","</div>","</div>",'<div class="quserp-sec-switch {[ this.getSwitchClass(values) ]}">','<div class="quserp-sec-bonus lb-round-border-5">','<div class="quserp-itm-left">',"improve your rank","</div>",'<div class="quserp-itm-right x-tool x-tool-close db-action-closebonus">',"</div>",'<div class="quserp-clear"></div>','<div class="quserp-bonuslist">','<tpl if="emailbonus == 0">','<div class="quserp-child-bonuswrap">','<div class="db-icon db-icon-unchecked db-dv-linkitem db-action-addemail">',"add your email address for bonus points","</div>","</div>","</tpl>",'<tpl if="emailbonus &gt; 0">','<div class="quserp-child-bonuswrap">','<div class="db-icon db-icon-checked">',"email on file: + {emailbonus} points","</div>","</div>","</tpl>",'<tpl if="profilebonus == 0">','<div class="quserp-child-bonuswrap">','<div class="db-icon db-icon-unchecked db-dv-linkitem db-action-addprofile">',"add a profile picture for bonus points","</div>","</div>","</tpl>",'<tpl if="profilebonus &gt; 0">','<div class="quserp-child-bonuswrap">','<div class="db-icon db-icon-checked">',"profile picture: + {profilebonus} points","</div>","</div>","</tpl>","</div>","</div>",'<div class="quserp-sec-recent lb-round-border-5">','<div class="quserp-itm-left">',"your recently activity","</div>",'<div class="quserp-itm-right db-icon db-icon-go">','<span class="db-dv-linkitem db-action-morerecent">',"more","</span>","</div>",'<div class="quserp-clear"></div>','<div class="quserp-recentlist">','<tpl if="this.recentCount() == 0">','<div class="quserp-child-emptywrap">',"you have not logged anything yet","</div>","</tpl>",'<tpl if="this.recentCount() != 0">','<tpl for="recentlogs">','<div id="{[ this.getMyId() ]}_{swpid}" class="quserp-child-wrap">','<div class="db-icon {[ this.getItemClass(values) ]}">','<span class="db-dv-linkitem db-li-placename">',"{[fm.ellipsis(values.sfield1,85)]}",'<div class="tt-trigger tt-hide">','<div class="tt-main">','<div class="tt-uname db-icon db-icon-redflag">{sfield1}</div>','<div class="db-icon db-icon-go">','<span class="tt-linkitem tt-zoomwaypoint">view place<span class="tt-linkdata">{swpid}</span></span>',"</div>","</div>","</div>","</span>","</div>","</div>","</tpl>","</tpl>","</div>","</div>","</div>","</tpl>","</div>","</div>"],quickUserData:{userid:null,username:null,pntrank:null,wptcnt:null,fdrcnt:null,goccnt:null,gocbonus:null,emailbonus:null,profilebonus:null,recentlogs:[]},card1TplUpdate:function(a){if(a){this.quickUserData.userid=Logabout.Bridgeport.usercomboresults.results.profile[0].userid;this.quickUserData.username=Logabout.Bridgeport.usercomboresults.results.profile[0].username;this.quickUserData.pntrank=Logabout.Bridgeport.usercomboresults.results.hist[0].pntrank;this.quickUserData.wptcnt=Logabout.Bridgeport.usercomboresults.results.hist[0].wptcnt;this.quickUserData.fdrcnt=Logabout.Bridgeport.usercomboresults.results.hist[0].fdrcnt;this.quickUserData.goccnt=parseInt(Logabout.Bridgeport.usercomboresults.results.hist[0].goccnt);this.quickUserData.gocbonus=parseInt(Logabout.Bridgeport.usercomboresults.results.hist[0].gocbonus);this.quickUserData.emailbonus=parseInt(Logabout.Bridgeport.usercomboresults.results.hist[0].emailbonus);this.quickUserData.profilebonus=parseInt(Logabout.Bridgeport.usercomboresults.results.hist[0].profilebonus);this.quickUserData.acknowledgebonus=0;this.quickUserData.recentlogs=Logabout.Bridgeport.usercomboresults.results.recentlogs.slice(0,3);if(this.quickUserData.emailbonus==0||this.quickUserData.profilebonus==0){this.quickUserData.acknowledgebonus=1}}this.orefCard1.body.update(this.card1Tpl.apply(this.quickUserData));this.orefCard1.body.select(".db-dv-linkitem").addClassOnOver("db-dv-linkover");this.orefCard1.body.select(".x-tool-close").addClassOnOver("x-tool-close-over")},lbAjax:function(c,d,b,a){Ext.Ajax.request({url:c,params:d,success:function(e,f){var g=Ext.util.JSON.decode(e.responseText);if(g.error){Ext.Msg.show({title:"Error",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}else{if(b){b.createDelegate(a)()}}},failure:function(e,f){Ext.Msg.show({title:"Error",msg:"Transport Error",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})},scope:this})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.card1Tpl=new Ext.XTemplate(this.card1TplDef.join(""),{getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(f){return"dbi-wpt-"+f.wtype},customDate:this.lbtplFunctions.customDate,getSwitchClass:function(f){if(f.acknowledgebonus){return"quserp-show-bonus"}else{return"quserp-show-recent"}},recentCount:(function(){return this.quickUserData.recentlogs.length}).createDelegate(this)});this.card1Tpl.compile();var d=this.lbWidth-9;var b=this.lbHeight-8;var c=5;var a=8;var e=4;Ext.apply(this,{layout:"card",activeItem:1,width:this.lbWidth,height:this.lbHeight,border:false,deferredRender:false,items:[{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",layout:"absolute",width:d,height:b,x:c,y:a,border:false,cls:"quserp-main-inner lb-round-border-10",items:[{border:false,ref:"//orefCard1",width:d-e*2,height:b-e*2-30,x:0,y:0,hidden:false,html:{tag:"div",html:"placeholder"},listeners:{afterrender:function(f){f.body.on("click",function(h,g){this.lbMenuHandler("showUserStats")},this,{delegate:".db-action-morestats"});f.body.on("click",function(h,g){this.lbMenuHandler("showUserAccount")},this,{delegate:".db-action-account"});f.body.on("click",function(h,g){this.lbMenuHandler("showUserLogs")},this,{delegate:".db-action-morerecent"});f.body.on("click",function(h,g){this.lbMenuHandler("showCloseBonus")},this,{delegate:".db-action-closebonus"});f.body.on("click",function(h,g){this.lbMenuHandler("showProfile")},this,{delegate:".db-action-addprofile"});f.body.on("click",function(h,g){this.lbMenuHandler("showUserEmailEdit")},this,{delegate:".db-action-addemail"})},scope:this}},{xtype:"button",x:20,y:b-e*2-30,width:90,height:30,text:"Add Place",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button-orange",handler:this.lbMenuHandler.createDelegate(this,["newWiz"])},{xtype:"button",x:20+90+10,y:b-e*2-30,width:125,height:30,text:"Complete a Goal",iconCls:"db-icon-goal",iconAlign:"left",cls:"db-button-orange",handler:this.lbMenuHandler.createDelegate(this,["showGoals"])},{xtype:"button",x:20+90+125+20,y:b-e*2-30,width:80,height:30,text:"Search",iconCls:"db-icon-magnify",iconAlign:"left",cls:"db-button-orange",handler:this.lbMenuHandler.createDelegate(this,["showSearch"])}]}]}]});Logabout.Demo.QuickUserPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.QuickUserPanel.superclass.onRender.apply(this,arguments);Logabout.Tips.tip({lbid:this.id+"_recenttips",target:this.body,delegate:".db-dv-linkitem.db-li-placename",lbShouldShow:this.lbParentOwner.lbShowChildTT,lbShouldScope:this.lbParentOwner,lbClicks:[{cls:".tt-zoomwaypoint",func:function(c,b){var a=Ext.get(b.id).child(".tt-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.zoomWptDetail(a,null,null,true);Logabout.Bridgeport.trackEvent("mostvizlist","zoomwptdetail","click")},scope:this}]});this.lbsignalController.on({userstatsupdated:function(c,b,a){Ext.apply(this.quickUserData,a);this.card1TplUpdate()},waypointsaved:function(a){this.quickUserData.recentlogs.unshift({swpid:a.newswpid,wtype:a.wtype,sfield1:a.sfield1,mswpid:a.mswpid,mtype:a.mtype});this.quickUserData.recentlogs=this.quickUserData.recentlogs.slice(0,3);this.card1TplUpdate()},scope:this})}});Ext.namespace("Logabout");Logabout.SearchManager=function(a){this.addEvents("searchstatus");this.lbluid=a.lbluid;this.lbdsess=a.lbdsess;this.lburl=a.lburl;this.lbmapmgr=a.lbmapmgr;this.lbtplFunctions=a.lbtplFunctions;this.searchAreas=[];this.targetAreas=[];this.savedAreas=[];this.persistedAreas=[{sw:{lat:45.182036837015886,lng:-123.24462890625},ne:{lat:49.296471602658094,lng:-117.22412109375},center:{lat:47.23925421983699,lng:-120.234375},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:40.56389453066509,lng:-124.29931640625},ne:{lat:45.01141864227728,lng:-118.27880859375001},center:{lat:42.78765658647118,lng:-121.2890625},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:42.512601715736665,lng:-117.74597167968751},ne:{lat:44.707706221835345,lng:-114.73571777343749},center:{lat:43.61015396878601,lng:-116.2408447265625},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:45.706179285330855,lng:-108.984375},ne:{lat:49.781264058178344,lng:-102.9638671875},center:{lat:47.7437216717546,lng:-105.97412109375},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:43.60823944964323,lng:-99.854736328125},ne:{lat:45.76369095661865,lng:-96.844482421875},center:{lat:44.68596520313094,lng:-98.349609375},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:32.95336814579932,lng:-102.37060546875},ne:{lat:42.52069952914966,lng:-90.32958984375},center:{lat:37.73703383747449,lng:-96.35009765624999},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:29.735762444449076,lng:-111.4892578125},ne:{lat:34.858890491257796,lng:-105.46875},center:{lat:32.29732646785344,lng:-108.47900390625},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:52.24461969494769,lng:-116.71875000000001},ne:{lat:54.06261195424756,lng:-113.70849609375},center:{lat:53.15361582459762,lng:-115.213623046875},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:50.092393210938795,lng:-113.785400390625},ne:{lat:51.998410382390325,lng:-110.775146484375},center:{lat:51.045401796664564,lng:-112.2802734375},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:48.167917284047974,lng:-111.170654296875},ne:{lat:49.169134431937806,lng:-109.66552734375},center:{lat:48.66852585799289,lng:-110.41809082031251},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:28.478348692223165,lng:-124.65087890624999},ne:{lat:38.56534784488546,lng:-112.60986328125},center:{lat:33.521848268554315,lng:-118.63037109375},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:38.479394673276445,lng:-112.8076171875},ne:{lat:43.068887774169625,lng:-106.787109375},center:{lat:40.774141223723035,lng:-109.79736328125},source:"userdrag",loguserid:49,wtypelist:[]},{sw:{lat:46.34692761055676,lng:-93.076171875},ne:{lat:50.3734961443035,lng:-87.0556640625},center:{lat:48.36021187743013,lng:-90.06591796874999},source:"userdrag",loguserid:49,wtypelist:[]}];this.gmPolyLines=[];this.maxCountSearchArea=a.maxCountSearchArea||10;this.autoTrim=a.autoTrim===false?false:true;this.autoSearch=a.autoSearch===false?false:true;this.saMinSecs=a.saMinSecs||5;this.savedAreaCursor=0;this.lastAddSearch=null;this.lastSearchRequest=null;this.searchRequestsEnabled=false;this.displayBoxes=false;this.suspendActiveSearch=false;this.ToggleSuspendActiveSearch=function(){var c=null;for(var b=this.targetAreas.length-1;b>=0;b--){if(this.targetAreas[b].status=="active"){c=this.targetAreas[b];break}}if(c){if(this.suspendActiveSearch){c.suspend=false;this.suspendActiveSearch=false;this.trimSearchRequest()}else{c.suspend=true;this.suspendActiveSearch=true}}this.fireEvent("searchstatus",this,{status:this.suspendActiveSearch?"suspendactive":"resumeactive"},"search suspend / resume");Logabout.Bridgeport.trackEvent("searchmanager","suspendactive","toggle")};this.enableAutoSearch=function(){this.searchRequestsEnabled=true;this.fireEvent("searchstatus",this,{status:"waiting"},"search waiting");Logabout.Bridgeport.trackEvent("searchmanager","autosearch","enable")};this.disableAutoSearch=function(){this.searchRequestsEnabled=false;this.clearAllSearchStuff();this.fireEvent("searchstatus",this,{status:"off"},"search off");Logabout.Bridgeport.trackEvent("searchmanager","autosearch","disable")};this.toggleBoxDisplay=function(){if(this.displayBoxes){for(var c=0,b=this.gmPolyLines.length;c<b;c++){this.lbmapmgr.map.removeOverlay(this.gmPolyLines[c])}this.gmPolyLines.length=0;this.displayBoxes=false}else{this.displayBoxes=true}};this.clearSearchAreas=function(){this.searchAreas.length=0};this.clearTargetAreas=function(){this.targetAreas.length=0};this.clearSavedAreas=function(){this.savedAreas.length=0};this.clearAllSearchStuff=function(){this.clearSearchAreas();this.clearTargetAreas();this.clearSavedAreas();if(this.lbmapmgr.mrkCols.searchman){this.lbmapmgr.removeCollection("searchman")}this.fireEvent("searchstatus",this,{status:"cleared"},"search cleared");Logabout.Bridgeport.trackEvent("searchmanager","clearresults","click")};this.saveSearchAreas=function(){for(var c=0,b=this.searchAreas.length;c<b;c++){this.savedAreas.push(this.searchAreas[c].sa)}};this.loadPersistedAreas=function(){for(var c=0,b=this.persistedAreas.length;c<b;c++){this.savedAreas.push(this.persistedAreas[c])}};this.printLog=function(){console.log("search areas: "+this.searchAreas.length);console.log(this.searchAreas);console.log("target areas: "+this.targetAreas.length);console.log(this.targetAreas);console.log("saved areas: "+this.savedAreas.length);console.log(this.savedAreas)};this.printPersist=function(){for(var c=0,b=this.savedAreas.length;c<b;c++){console.log(",{ sw: {lat:"+this.savedAreas[c].sw.lat+", lng: "+this.savedAreas[c].sw.lng+"}, ne: {lat: "+this.savedAreas[c].ne.lat+", lng: "+this.savedAreas[c].ne.lng+"}, center: {lat: "+this.savedAreas[c].center.lat+", lng: "+this.savedAreas[c].center.lng+'}, source: "userdrag", loguserid: 49, wtypelist: [] }')}};this.addFromSavedAreas=function(){if(this.savedAreaCursor>this.savedAreas.length-1){this.savedAreaCursor=0}var b=this.savedAreas[this.savedAreaCursor];if(b){this.addSearchArea({sw:{lat:b.sw.lat,lng:b.sw.lng},ne:{lat:b.ne.lat,lng:b.ne.lng},center:{lat:b.center.lat,lng:b.center.lng},zoom:b.zoom,source:"userdrag",loguserid:49,wtypelist:[]});this.savedAreaCursor++}};this.manualSearchRepeat=function(b){if(this.searchAreas.length>this.maxCountSearchArea){this.searchAreas.splice(0,this.searchAreas.length-this.maxCountSearchArea)}this.searchAreas.push({add:new Date().getTime(),sa:b});this.trimSearchAreas(true);this.gmShowAreas();this.searchNow()};this.bufferAddSearchArea=function(c,b){if(!b){b=2.5}this.lastAddSearch=new Date().getTime();this.forwardBufferAdd.defer(b*1000,this,[c,this.lastAddSearch]);this.postponeSearchRequest();if(this.searchRequestsEnabled){this.fireEvent("searchstatus",this,{status:"waiting"},"search waiting")}else{this.fireEvent("searchstatus",this,{status:"off"},"search off")}};this.forwardBufferAdd=function(c,b){if(this.lastAddSearch==b){this.addSearchArea(c)}};this.addSearchArea=function(b){if(this.searchAreas.length>this.maxCountSearchArea){this.searchAreas.splice(0,this.searchAreas.length-this.maxCountSearchArea)}this.searchAreas.push({add:new Date().getTime(),sa:b});if(this.searchRequestsEnabled){this.lastSearchRequest=new Date().getTime();this.trimSearchRequest.defer((this.saMinSecs+1)*1000,this,[this.lastSearchRequest])}this.gmShowAreas()};this.trimSearchRequest=function(b){if(!b||this.lastSearchRequest==b){this.trimSearchAreas();this.searchNow()}};this.forceSearch=function(b){if(this.searchAreas.length>this.maxCountSearchArea){this.searchAreas.splice(0,this.searchAreas.length-this.maxCountSearchArea)}this.searchAreas.push({add:new Date().getTime(),sa:b});this.trimSearchAreas(true);this.gmShowAreas();this.searchNow()};this.repeatActiveSearch=function(b){if(this.searchRequestsEnabled){if(this.lastSearchRequest==b){this.searchNow()}}};this.flagActiveAsFullSearch=function(){var c=null;for(var b=this.targetAreas.length-1;b>=0;b--){if(this.targetAreas[b].status=="active"){c=this.targetAreas[b];break}}c.fullsearch=true;if(c.querycount>=this.zoomLimitMatrix[c.sa.zoom]){this.searchNow()}Logabout.Bridgeport.trackEvent("searchmanager","removelimit","click")};this.postponeSearchRequest=function(){this.lastSearchRequest=new Date().getTime()};this.trimSearchAreas=function(e){var d=null;var c=null;if(this.searchAreas.length==0){return}d=this.searchAreas[this.searchAreas.length-1];c=this.matchFromTargetAreas(d.sa,e);if(c){c.status="active"}else{this.targetAreas.push({add:new Date().getTime(),key:d.add,status:"active",suspend:false,lastsearch:null,querystart:0,querylimit:20,resultcount:0,querycount:0,fullsearch:false,sa:d.sa,complete:false});c=this.targetAreas[this.targetAreas.length-1];for(var b=this.targetAreas.length-1;b>=0;b--){if(this.targetAreas[b].suspend){this.targetAreas[b].suspend=false}}this.suspendActiveSearch=false}for(var b=this.targetAreas.length-1;b>=0;b--){if(this.targetAreas[b].key!=c.key&&this.targetAreas[b].status=="active"){this.targetAreas[b].status="searched"}}};this.matchFromTargetAreas=function(j,k){var g=null;var d=0;for(var f=this.targetAreas.length-1;f>=0;f--){d=0;g=this.targetAreas[f].sa;var b=this._containvertexcount(g,j);var c=this._sizecomp(g,j,"lng");var l=this._sizecomp(g,j,"lat");var e=this._borderdiff(g,j,"lng");var h=this._borderdiff(g,j,"lat");if(c>0.5&&l>0.5){if(k){if(b>7&e<0.03&&h<0.03){return this.targetAreas[f]}}else{if(b>3){return this.targetAreas[f]}}}}return false};this._borderdiff=function(c,b,d){if(d=="lng"){return Number(Math.abs((c.ne.lng-b.ne.lng)/Math.abs(c.ne.lng-c.sw.lng))).toFixed(3)}else{return Number(Math.abs((c.ne.lat-b.ne.lat)/Math.abs(c.ne.lat-c.sw.lat))).toFixed(3)}};this._containvertexcount=function(d,f){var g=0;var c=this._getvertexes(d);for(var e=0,b=c.length;e<b;e++){if(this._contain(c[e],f)){g++}}return g};this._sizecomp=function(c,b,d){if(d=="lng"){var f=Math.abs(c.ne.lng-c.sw.lng);var e=Math.abs(b.ne.lng-b.sw.lng);return Number(f/e).toFixed(2)}else{var f=Math.abs(c.ne.lat-c.sw.lat);var e=Math.abs(b.ne.lat-b.sw.lat);return Number(f/e).toFixed(2)}};this._getvertexes=function(b){var d=Math.abs((b.center.lng-b.sw.lng)/2);var c=Math.abs((b.center.lat-b.sw.lat)/2);return[{lat:b.ne.lat-c,lng:b.sw.lng+d},{lat:b.ne.lat-c,lng:b.center.lng},{lat:b.ne.lat-c,lng:b.ne.lng-d},{lat:b.center.lat,lng:b.sw.lng+d},{lat:b.center.lat,lng:b.center.lng},{lat:b.center.lat,lng:b.ne.lng-d},{lat:b.sw.lat+c,lng:b.sw.lng+d},{lat:b.sw.lat+c,lng:b.center.lng},{lat:b.sw.lat+c,lng:b.ne.lng-d}]};this._contain=function(b,c){if((b.lat>c.sw.lat&&b.lat<c.ne.lat)&&(b.lng>c.sw.lng&&b.lng<c.ne.lng)){return true}else{return false}};this.searchNow=function(){if(this.busySearching){return}this.busySearching=true;var b=null;for(var c=this.targetAreas.length-1;c>=0;c--){if(this.targetAreas[c].status=="active"){b=this.targetAreas[c];break}}if(b){if(b.suspend){this.busySearching=false;this.fireEvent("searchstatus",this,{status:"suspendactive"},"search suspend / resume")}else{this.fireEvent("searchstatus",this,{status:"busy",qcount:b.querycount,limit:this.zoomLimitMatrix[b.sa.zoom],rcount:b.resultcount,zoom:b.sa.zoom},"busy searching");b.lastsearch=new Date().getTime();this.searchStore.load({params:{browserts:new Date().format("U"),swlat:b.sa.sw.lat,swlng:b.sa.sw.lng,nelat:b.sa.ne.lat,nelng:b.sa.ne.lng,celat:b.sa.center.lat,celng:b.sa.center.lng,wtypelist:Ext.util.JSON.encode(b.sa.wtypelist),start:b.querystart,limit:b.querylimit,sakey:b.key}})}}else{this.busySearching=false}};this.searchStore=new Ext.data.Store({url:this.lburl,baseParams:{task:"geosearch2",sesstoken:this.lbdsess,mtype:1},reader:new Ext.data.JsonReader({root:"results",id:"swpid",totalProperty:"totalrows"},Ext.data.Record.create(Logabout.Defs.FullRecDef.concat([{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:1},{name:"show_datalog",type:"int",defaultValue:0},{name:"show_editcontrols",type:"int",defaultValue:0}]))),sortInfo:{field:"utc",direction:"DESC"},listeners:{load:function(b,f,c){var e=null;for(var d=this.targetAreas.length-1;d>=0;d--){if(this.targetAreas[d].key==c.params.sakey){e=this.targetAreas[d];this.targetAreas[d].resultcount+=b.getCount();this.targetAreas[d].querystart=c.params.start+c.params.limit;this.targetAreas[d].querylimit=c.params.limit;if(b.getCount()<c.params.limit){this.targetAreas[d].complete=true}break}}if(!e){return}this.gmShowAreas();e.querycount++;this.busySearching=false;if(!e.complete){this.fireEvent("searchstatus",this,{status:"incomplete",qcount:e.querycount,limit:this.zoomLimitMatrix[e.sa.zoom],rcount:e.resultcount,zoom:e.sa.zoom},"z:"+e.sa.zoom+" l:"+this.zoomLimitMatrix[e.sa.zoom]+" q:"+e.querycount+" @ "+e.resultcount+" row(s)",b.reader.jsonData);if(e.fullsearch||e.querycount<this.zoomLimitMatrix[e.sa.zoom]){this.lastSearchRequest=new Date().getTime();this.repeatActiveSearch.defer((this.saMinSecs+1)*1000,this,[this.lastSearchRequest])}else{this.fireEvent("searchstatus",this,{status:"limited",qcount:e.querycount,limit:this.zoomLimitMatrix[e.sa.zoom],rcount:e.resultcount,zoom:e.sa.zoom},"z:"+e.sa.zoom+" l:"+this.zoomLimitMatrix[e.sa.zoom]+" q:"+e.querycount+" limited @ "+e.resultcount+" row(s)")}}else{this.fireEvent("searchstatus",this,{status:"complete",qcount:e.querycount,limit:this.zoomLimitMatrix[e.sa.zoom],rcount:e.resultcount,zoom:e.sa.zoom},"z:"+e.sa.zoom+" l:"+this.zoomLimitMatrix[e.sa.zoom]+" q:"+e.querycount+" complete @ "+e.resultcount+" row(s)",b.reader.jsonData)}},scope:this}});this.zoomLimitMatrix={0:3,1:3,2:3,3:3,4:3,5:3,6:4,7:4,8:6,9:8,10:10,11:30,12:100,13:100,14:100,15:100,16:100,17:100};this.gmShowAreas=function(){if(!this.displayBoxes){return}for(var f=0,c=this.gmPolyLines.length;f<c;f++){this.lbmapmgr.map.removeOverlay(this.gmPolyLines[f])}this.gmPolyLines.length=0;var g=null;var e=null;var j=null;for(var f=0,c=this.targetAreas.length;f<c;f++){g=[new GLatLng(this.targetAreas[f].sa.sw.lat,this.targetAreas[f].sa.sw.lng),new GLatLng(this.targetAreas[f].sa.ne.lat,this.targetAreas[f].sa.sw.lng),new GLatLng(this.targetAreas[f].sa.ne.lat,this.targetAreas[f].sa.ne.lng),new GLatLng(this.targetAreas[f].sa.sw.lat,this.targetAreas[f].sa.ne.lng),new GLatLng(this.targetAreas[f].sa.sw.lat,this.targetAreas[f].sa.sw.lng)];if(this.targetAreas[f].status=="active"){if(this.targetAreas[f].resultcount>0){e={color:"#FF0000",weight:8,opacity:0.5}}else{e={color:"#FF0000",weight:4,opacity:0.5}}}else{if(this.targetAreas[f].status=="searched"){if(this.targetAreas[f].resultcount>0){e={color:"#10E304",weight:8,opacity:0.5}}else{e={color:"#10E304",weight:4,opacity:0.5}}}}j=new GPolyline(g);j.setStrokeStyle(e);this.lbmapmgr.map.addOverlay(j);this.gmPolyLines.push(j)}var h=false;var b=true;for(var d=this.searchAreas.length-1;d>=0;d--){if(!h){g=[new GLatLng(this.searchAreas[d].sa.sw.lat,this.searchAreas[d].sa.sw.lng),new GLatLng(this.searchAreas[d].sa.ne.lat,this.searchAreas[d].sa.sw.lng),new GLatLng(this.searchAreas[d].sa.ne.lat,this.searchAreas[d].sa.ne.lng),new GLatLng(this.searchAreas[d].sa.sw.lat,this.searchAreas[d].sa.ne.lng),new GLatLng(this.searchAreas[d].sa.sw.lat,this.searchAreas[d].sa.sw.lng)];if(b){e={color:"#5446F9",weight:3,opacity:1}}else{e={color:"#2DC8F4",weight:1,opacity:1}}b=false;j=new GPolyline(g);j.setStrokeStyle(e);this.lbmapmgr.map.addOverlay(j);this.gmPolyLines.push(j)}}};Logabout.SearchManager.superclass.constructor.call(this)};Ext.extend(Logabout.SearchManager,Ext.util.Observable);Ext.namespace("Logabout");Logabout.QuickLogPanel=Ext.extend(Ext.Window,{lbWidth:null,lbHeight:null,lbSaveObj:null,lbMenuHandler:function(a,b){switch(a){case"showUserLogs":this.hide();Logabout.Bridgeport.trackEvent("quicklogpanel","showUserLogs","click");Logabout.Bridgeport.showUserPanel(this.lbuid,this.lbuname,null,null,null,null,null,null,true,"waypoints");break;case"showPlaceDetail":this.hide();Logabout.Bridgeport.trackEvent("quicklogpanel","zoomwptdetail","click");Logabout.Bridgeport.zoomWptDetail(b,null,null,true);break}},lbPlaceTplDef:['<div class="quicklog-main">','<tpl for=".">','<div class="quicklog-wrap">','<div class="quicklog-top">','<div class="quicklog-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}",'<tpl if="this.getDebugUser()">','<span> : </span><span class="db-mrk-linkitem db-action-addgoal">add goal</span>',"</tpl>","</div>",'<div class="quicklog-list">','<div class="quicklog-itm db-icon db-icon-founded">founded by ','<span class="db-mrk-linkitem db-action-showprofile">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="quicklog-itm db-icon {[ this.getItemIconClass(values) ]}">',"type {[ this.wpthash[values.wtype] ]}","</div>","</div>","</div>","</div>","</tpl>","</div>"],lbSuccessTplDef:['<div class="quicklog-success">','<tpl for=".">','<div class="quicklog-wrap">','<div class="quicklog-top">','<div class="quicklog-title">Thank You</div>','<div class="quicklog-line">You are logged in at</div>','<div class="quicklog-list">','<div class="quicklog-itm quicklog-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>",'<div class="quicklog-itm db-icon db-icon-clock">',"{[ this.customDate(values.logtime,Date.patterns.LbCombo)]}","</div>","</div>",'<div class="quicklog-line-points">You gained <b>+{points}</b> points!</div>','<div class="quicklog-line-goto">','<div class="db-action-viewlogs db-dv-linkitem db-icon db-icon-go">view your logs</div>','<div class="db-action-viewplace db-dv-linkitem db-icon db-icon-go">view place detail<span class="db-dv-linkdata">{swpid}</span></div>',"</div>","</div>","</div>","</tpl>","</div>"],lbtplFunctions:null,lbInitTemplate:function(){this.lbPlaceTpl=new Ext.XTemplate(this.lbPlaceTplDef.join(""),{customDate:this.lbtplFunctions.customDate,getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},wpthash:this.lbtplFunctions.wpthash,getDebugUser:this.lbtplFunctions.getDebugUser});this.lbPlaceTpl.compile();this.lbSuccessTpl=new Ext.XTemplate(this.lbSuccessTplDef.join(""),{customDate:this.lbtplFunctions.customDate,getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},wpthash:this.lbtplFunctions.wpthash});this.lbSuccessTpl.compile()},getCombinedDate:function(a,c,b){var d=c.split(":");return a.clearTime(true).add(Date.HOUR,Number(d[0])).add(Date.MINUTE,Number(d[1])).add(Date.SECOND,Number(b))},lbShow:function(b,a){if(!b&&a){this.lbStore.load({params:{swpid:a,browserts:new Date().format("U")},callback:function(d){var c=d[0].data;Ext.apply(this.lbSaveObj,{utc:new Date(),dsrc:2,swpid:0,wtype:c.wtype,sfield1:c.sfield1,logusername:c.logusername,mtype:0,mswpid:null,lat:c.lat,lng:c.lng,alt:c.alt,tsect:Logabout.Defs.defGrpTsect.toString(),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),tripname:"Default Trip",wpid:0,ifield12:true,gmapzoom:5});this.show();this.getLayout().setActiveItem(0);this.orefPlace.body.update(this.lbPlaceTpl.applyTemplate(this.lbSaveObj));this.orefCboDate.setValue(this.lbSaveObj.utc);this.orefCboTime.setValue(this.lbSaveObj.utc);this.orefPlace.body.select(".db-mrk-linkitem",true).addClassOnOver("db-mrk-linkover");this.orefPlace.body.on("click",function(f,e){Logabout.Bridgeport.showADTestGoal({swpid:c.mswpid,sfield1:c.sfield1,goaldesc:c.description,sfield8:c.sfield8,ifield10:c.ifield10})},this,{delegate:".db-action-addgoal"})},scope:this})}else{Ext.apply(this.lbSaveObj,{utc:new Date(),dsrc:2,swpid:0,wtype:b.wtype,sfield1:b.sfield1,logusername:b.logusername,mtype:0,mswpid:null,lat:b.lat,lng:b.lng,alt:b.alt,tsect:Logabout.Defs.defGrpTsect.toString(),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),tripname:"Default Trip",wpid:0,ifield12:true,gmapzoom:5});this.show();this.getLayout().setActiveItem(0);this.orefPlace.body.update(this.lbPlaceTpl.applyTemplate(this.lbSaveObj));this.orefCboDate.setValue(this.lbSaveObj.utc);this.orefCboTime.setValue(this.lbSaveObj.utc);this.orefPlace.body.select(".db-mrk-linkitem",true).addClassOnOver("db-mrk-linkover");this.orefPlace.body.on("click",function(d,c){Logabout.Bridgeport.showADTestGoal({swpid:b.mswpid,sfield1:b.sfield1,goaldesc:b.description,sfield8:b.sfield8,ifield10:b.ifield10})},this,{delegate:".db-action-addgoal"})}},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.lbInitTemplate();this.lbStore=new Ext.data.JsonStore({url:this.lburl,baseParams:{task:"zoomdata",sesstoken:this.lbdsess},root:"results",fields:Logabout.Defs.FullRecDef,remoteSort:false});this.lbSaveObj={};var a=30;Ext.apply(this,{width:this.lbWidth,height:this.lbHeight,layout:"card",activeItem:0,constrain:true,constrainHeader:true,modal:true,closeAction:"hide",title:"log in at",iconCls:"db-icon-greenflag",resizable:false,border:false,bodyBorder:true,plain:true,items:[{xtype:"panel",layout:"absolute",items:[{xtype:"panel",layout:"fit",ref:"//orefPlace",width:this.lbWidth-a,height:60,x:10,y:10,border:false},{xtype:"form",ref:"//orefLogForm",width:this.lbWidth-a,height:40,x:10,y:80,border:false,bodyStyle:"padding: 7px 3px;",bodyCssClass:"quicklog-body",items:[{xtype:"panel",layout:"column",border:false,bodyCssClass:"quicklog-body",items:[{layout:"form",columnWidth:0.5,labelWidth:30,border:false,bodyCssClass:"quicklog-body",items:[{xtype:"datefield",ref:"/////orefCboDate",fieldLabel:"Date",labelSeparator:":",name:"utc",allowBlank:false,width:115,format:"m/d/Y"}]},{layout:"form",columnWidth:0.5,labelWidth:30,border:false,bodyCssClass:"quicklog-body",items:[{xtype:"timefield",ref:"/////orefCboTime",fieldLabel:"Time",labelSeparator:":",name:"dttime",allowBlank:false,width:105,increment:30,format:"H:i"}]}]}]},{xtype:"panel",layout:"absolute",width:this.lbWidth-a,height:50,x:10,y:130,border:false,items:[{xtype:"button",height:30,width:350,x:0,y:0,text:"Log In",tooltip:"click to save log",iconCls:"db-icon-greenflag",iconAlign:"left",cls:"db-button",handler:function(){if(this.orefLogForm.getForm().isValid()){var b=this.orefCboDate.getValue();var c=this.orefCboTime.getValue();var d=new Date();this.lbSaveObj.logtime=this.getCombinedDate(b,c,d.getSeconds());this.lbSaveObj.utc=this.lbSaveObj.logtime.format("U").toString();this.updateWptData({swpid:this.lbSaveObj.swpid,wtype:this.lbSaveObj.wtype,fields:this.lbSaveObj})}},scope:this}]}]},{xtype:"panel",layout:"absolute",items:[{xtype:"panel",layout:"fit",ref:"//orefLogged",width:this.lbWidth,height:this.lbHeight,x:0,y:0,border:false,listeners:{afterrender:function(b){b.body.on("click",function(d,c){this.lbMenuHandler("showUserLogs")},this,{delegate:".db-action-viewlogs"});b.body.on("click",function(e,d){var c=Ext.get(d.id).child(".db-dv-linkdata",true).firstChild.nodeValue;this.lbMenuHandler("showPlaceDetail",c)},this,{delegate:".db-action-viewplace"})},scope:this}}]}]});Logabout.QuickLogPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.QuickLogPanel.superclass.onRender.apply(this,arguments)},updateWptData:function(a){(function(d,c){var b=arguments.callee;Ext.Ajax.request({url:this.lburl,method:"POST",params:{task:"userdataupdatebatch",updatedata:Ext.util.JSON.encode(d),uiforce:c,sesstoken:this.lbdsess,uid:this.lbuid},callback:function(f,h,e){if(h){var g=Ext.util.JSON.decode(e.responseText);if(g.success){this.getLayout().setActiveItem(1);this.orefLogged.body.update(this.lbSuccessTpl.applyTemplate({sfield1:this.lbSaveObj.sfield1,wtype:this.lbSaveObj.wtype,logtime:this.lbSaveObj.logtime,points:parseInt(g.points),swpid:parseInt(g.swpid)}));this.orefLogged.body.select(".db-dv-linkitem").addClassOnOver("db-dv-linkover");this.lbsignalController.fireEvent("waypointsaved",{eventSource:this,lbuid:this.lbuid,tsect:null,tripname:null,oldswpid:"new",newswpid:parseInt(g.swpid),wtype:this.lbSaveObj.wtype,sfield1:this.lbSaveObj.sfield1,mswpid:parseInt(g.mswpid),mtype:parseInt(g.mtype)});Logabout.Bridgeport.updateUserStats(this,"wupdate",{swpid:parseInt(g.swpid),mswpid:parseInt(g.mswpid),pntcnt:parseInt(g.points),pntcntchg:parseInt(g.pointchg),fdrcntchg:(parseInt(g.mtype)==1?1:0),wptcnt:1,wptcntchg:1})}else{if(g.requestforce){Ext.Msg.show({title:"Oops... an error occurred",msg:g.requestforce,buttons:Ext.Msg.OKCANCEL,icon:Ext.MessageBox.WARNING,fn:function(i){if(i=="ok"){b.defer(5,this,[d,1])}},scope:this})}else{Ext.Msg.show({title:"Oops... an error occurred",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}}}else{Ext.Msg.show({title:"Oops... an error occurred",msg:"please try again",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},scope:this})}).defer(5,this,[a,0])}});Ext.namespace("Logabout");Logabout.QuickSignInPanel=Ext.extend(Ext.Panel,{lbWidth:null,lbHeight:null,lbStartOnRegisterTab:null,lbGfcButInit:false,lbStartCardName:"login",lbIsQuickWindow:null,lbAjax:function(c,d,b,e,a){Ext.Ajax.request({url:c,params:d,success:function(f,g){var h=Ext.util.JSON.decode(f.responseText);if(h.error){if(e){e.createDelegate(a)(h)}else{Ext.Msg.show({title:"Error",msg:h.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}}else{if(b){b.createDelegate(a)(h)}}},failure:function(f,g){if(e){e.createDelegate(a)()}else{Ext.Msg.show({title:"Error",msg:"Transport Error",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},scope:this})},lbAjaxBusy:false,lbCheckBuffer:null,lbCheckLast:{checkval:null,checkresult:null},lbCheckUname:function(b,a){if(this.lbCheckLast.checkval==b){this.lbCheckBuffer=null;if(this.lbCheckLast.checkresult===true){return true}else{return"qsi-err-fail:username not available"}}else{if(this.lbAjaxBusy){this.lbCheckBuffer=b;return"qsi-err-checking:checking availability..."}else{(function(){var c=arguments.callee;this.lbAjax("user/xcheckuname",{format:"json",uname:b},function(e){this.lbAjaxBusy=false;if(this.lbCheckBuffer){if(this.lbCheckLast.checkval!=this.lbCheckBuffer){this.lbCheckLast={checkval:this.lbCheckBuffer,checkresult:null};c.defer(5,this,[this.lbCheckBuffer]);this.lbAjaxBusy=true;var d=a.el.parent(".x-form-item").child(".qsi-val-itm");d.addClass(["qsi-valshow","qsi-err-checking"]);d.removeClass(["qsi-err-warn","qsi-err-fail","qsi-err-ok"]);d.update("checking availability...")}this.lbCheckBuffer=null}else{this.lbCheckLast.checkresult=true;var d=a.el.parent(".x-form-item").child(".qsi-val-itm");d.addClass(["qsi-valshow","qsi-err-ok"]);d.removeClass(["qsi-err-warn","qsi-err-fail","qsi-err-checking"]);d.update("username is available")}},function(e){this.lbAjaxBusy=false;if(this.lbCheckBuffer){if(this.lbCheckLast.checkval!=this.lbCheckBuffer){this.lbCheckLast={checkval:this.lbCheckBuffer,checkresult:null};c.defer(5,this,[this.lbCheckBuffer]);this.lbAjaxBusy=true;var d=a.el.parent(".x-form-item").child(".qsi-val-itm");d.addClass(["qsi-valshow","qsi-err-checking"]);d.removeClass(["qsi-err-warn","qsi-err-fail","qsi-err-ok"]);d.update("checking availability...")}this.lbCheckBuffer=null}else{this.lbCheckLast.checkresult=false;var d=a.el.parent(".x-form-item").child(".qsi-val-itm");d.removeClass(["qsi-err-ok","qsi-err-checking"]);d.addClass(["qsi-valshow","qsi-err-fail"]);d.update("username not available")}},this);this.lbCheckLast={checkval:b,checkresult:null}}).defer(5,this);this.lbAjaxBusy=true;return"qsi-err-checking:checking availability..."}}},lbShowMsg:function(a,b){a.stopFx();a.update(b);a.slideIn("t").pause(5).ghost("t",{remove:false,useDisplay:true})},lbMask:null,lbShowMaskMsg:function(a){if(!this.lbMask){this.lbMask=new Ext.LoadMask(this.body,{msg:a})}this.lbMask.show()},lbTabNames:{account:{idx:0,title:"your account"},login:{idx:1,title:"login to your account"},register:{idx:2,title:"register a new account"},emailedit:{idx:3,title:"edit your email"},passwordedit:{idx:4,title:"edit your password"},passwordreset:{idx:5,title:"reset your password"},usernameedit:{idx:6,title:"edit your username"}},lbSwitchTab:function(a){Logabout.Tips.hide();this.getLayout().setActiveItem(this.lbTabNames[a].idx);if(this.lbParentOwner.lbSetTitle!=null){this.lbParentOwner.lbSetTitle(this.lbTabNames[a].title)}var b=this.getLayout().activeItem.findByType("form")[0];if(b){b.getForm().reset();b.getForm().clearInvalid()}if(a=="emailedit"){this.lbAjax("user/xusergetemail",{format:"json"},function(c){this.lbuseremail=c.results[0].email;if(Ext.isEmpty(this.lbuseremail)){this.lbParentOwner.lbSetTitle("add email address");this.orefEmailEditDesc.getEl().child(".qsi-login-desc").update("Add an email address below. Used for logabout communications. We do NOT spam.")}else{this.lbParentOwner.lbSetTitle("edit email address");this.orefEmailEditDesc.getEl().child(".qsi-login-desc").update("Your email address: <b>"+this.lbuseremail+"</b>. To change please enter a new address below.")}},function(c){this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"Error. Please try again.")},this);this.removeClass("qsi-register");this.removeClass("qsi-login")}else{if(a=="login"){this.addClass("qsi-login");this.removeClass("qsi-register");this.orefLoginUname.focus(false,true);this.gfcHandler(a)}else{if(a=="register"){this.addClass("qsi-register");this.removeClass("qsi-login");this.orefUname.focus(false,true)}else{if(a=="account"){this.removeClass("qsi-register");this.removeClass("qsi-login");this.gfcHandler(a)}else{this.removeClass("qsi-register");this.removeClass("qsi-login")}}}}},gfcHandler:function(a){if(a=="account"){if(this.lbgfcid!=null){if(Logabout.AuthControl.isReady()){this.orefGfcAccountDesc.body.child(".qsi-gfcaccount-desc").update("Your GFC username is <b>"+Logabout.AuthControl.getGfcData("gfcname")+"</b>");this.orefGfcSettings.setDisabled(false);this.orefGfcInvite.setDisabled(false);this.orefAccountSignout.setDisabled(false)}else{this.lbsignalController.on("authcontrolready",function(b){this.orefGfcAccountDesc.body.child(".qsi-gfcaccount-desc").update("Your GFC username is <b>"+Logabout.AuthControl.getGfcData("gfcname")+"</b>");this.orefGfcSettings.setDisabled(false);this.orefGfcInvite.setDisabled(false);this.orefAccountSignout.setDisabled(false)},this)}}}else{if(a=="login"){if(!this.lbGfcButInit){if(Logabout.AuthControl.isReady()){Logabout.AuthControl.renderGFCbutton(this.getId()+"-qsi-gfc-signin-id");this.lbGfcButInit=true}else{this.lbsignalController.on("authcontrolready",function(b){Logabout.AuthControl.renderGFCbutton(this.getId()+"-qsi-gfc-signin-id");this.lbGfcButInit=true},this)}}}}},loginHandler:function(){var a=this.orefLoginUname.getValue();var b=this.orefLoginPword.getValue();if(a.length>0&&b.length>0){this.lbShowMsg(this.orefLoginDesc.getEl().child(".qsi-login-msg"),"Signing In...");this.lbShowMaskMsg("Signing In... Please wait");this.lbAjax("user/xlogin",{format:"json",uname:a,pword:b},function(c){Logabout.Bridgeport.trackEvent("quicksignin","login","ok");window.location.pathname="/"},function(c){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","login","fail");this.lbShowMsg(this.orefLoginDesc.getEl().child(".qsi-login-msg"),c.error)},this)}else{this.lbShowMsg(this.orefLoginDesc.getEl().child(".qsi-login-msg"),"Please enter your credentials")}},formFieldInvalidH:function(c,d){var a=c.el.parent(".x-form-item").child(".qsi-val-itm");var b=d.split(":");a.removeClass("qsi-err-ok");a.addClass(["qsi-valshow",b[0]]);a.update(b[1])},formFieldValidH:function(c){var a=c.el.parent(".x-form-item").child(".qsi-val-itm");if(!Ext.isEmpty(c.getValue())){var b=c.lbOkText.split(":");a.addClass(["qsi-valshow",b[0]]);a.removeClass(["qsi-err-warn","qsi-err-fail"]);a.update(b[1])}else{a.removeClass(["qsi-valshow"]);a.update("")}},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.FormFieldTpl=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" class="qsi-label-element">{label}{labelSeparator}</label>','<div class="x-form-element qsi-form-element" id="x-form-el-{id}" style="{elementStyle}"></div>','<div class="qsi-val-itm" id="qsi-val-el-{id}">val text here</div>','<div class="{clearCls}"></div>',"</div>");var a=30;Ext.apply(this,{width:this.lbWidth,height:this.lbHeight,layout:"card",border:false,activeItem:this.lbTabNames[this.lbStartCardName].idx,items:[{xtype:"panel",layout:"absolute",items:[{xtype:"panel",ref:"/orefLogoutDesc",layout:"fit",width:this.lbWidth-a,height:30,x:10,y:10,border:false,bodyStyle:"font-size: 130%;",html:{tag:"div",cls:"qsi-main",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",html:"You are signed in as <b>"+this.lbuname+"</b>"}]}},{xtype:"button",width:(this.lbWidth-(3*a))/2,height:30,x:a,y:50,text:"Edit Email",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbSwitchTab.createDelegate(this,["emailedit"])},{xtype:"button",width:(this.lbWidth-(3*a))/2,height:30,x:(this.lbWidth-(3*a))/2+2*a,y:50,text:"Edit Password",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbSwitchTab.createDelegate(this,["passwordedit"]),hidden:this.lbgfcid!=null?true:false},{xtype:"button",width:(this.lbWidth-(3*a))/2,height:30,x:(this.lbWidth-(3*a))/2+2*a,y:50,text:"Edit Username",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbSwitchTab.createDelegate(this,["usernameedit"]),hidden:this.lbgfcid!=null?false:true},{xtype:"panel",layout:"absolute",width:this.lbWidth-a,height:70,x:a,y:90,border:false,hidden:this.lbgfcid!=null?false:true,items:[{xtype:"panel",ref:"//orefGfcAccountDesc",layout:"fit",width:this.lbWidth-a,height:20,x:0,y:0,border:false,bodyStyle:"font-size: 130%;",html:{tag:"div",cls:"qsi-account-main",children:[{tag:"div",cls:"qsi-gfcaccount-desc",html:""}]}},{xtype:"button",ref:"//orefGfcSettings",width:(this.lbWidth-3*a)/2,height:30,x:0,y:25,text:"GFC Settings",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",disabled:true,handler:function(){Logabout.AuthControl.callGFCaction("settings")},scope:this},{xtype:"button",ref:"//orefGfcInvite",width:(this.lbWidth-3*a)/2,height:30,x:((this.lbWidth-3*a)/2)+a,y:25,text:"GFC invite friends",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",disabled:true,handler:function(){Logabout.AuthControl.callGFCaction("invite")},scope:this}]},{xtype:"button",ref:"/orefAccountSignout",width:this.lbWidth-(2*a),height:30,x:a,y:170,text:"Sign Out",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",disabled:this.lbgfcid!=null?true:false,handler:function(){this.lbShowMsg(this.orefLogoutDesc.getEl().child(".qsi-login-msg"),"Signing out....");if(this.lbgfcid!=null){Logabout.AuthControl.callGFCaction("signout")}else{this.lbAjax("user/xlogout",{format:"json"},function(b){Logabout.Bridgeport.trackEvent("quicksignin","logout","ok");window.location.pathname="/"},function(b){Logabout.Bridgeport.trackEvent("quicksignin","logout","fail");this.lbShowMsg(this.orefLogoutDesc.getEl().child(".qsi-login-msg"),"Error signing out. Please try again.")},this)}},scope:this}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefLoginDesc",layout:"fit",width:this.lbWidth-a,height:30,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"Sign In to your account."}]}},{xtype:"form",width:180,height:55,x:10,y:40,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},labelWidth:60,defaults:{width:100,hideLabel:true},keys:{key:13,fn:this.loginHandler,scope:this},items:[{xtype:"textfield",ref:"//orefLoginUname",fieldLabel:"Username",msgTarget:"",maskRe:/[a-z0-9]/i},{xtype:"textfield",ref:"//orefLoginPword",fieldLabel:"Password",inputType:"password",msgTarget:"",maskRe:/[a-z0-9]/i}]},{xtype:"panel",ref:"/orefLoginRegisterLink",layout:"fit",width:160,height:30,x:210,y:40,border:false,html:{tag:"div",cls:"",children:[{tag:"div",cls:"",children:[{tag:"div",children:[{tag:"span",cls:"qsi-forgot-password db-icon db-icon-go db-dv-linkitem db-action-forgot",html:"Forgot your password?"}]}]}]},listeners:{afterrender:function(b){b.body.child(".db-dv-linkitem.db-action-forgot").addClassOnOver("db-dv-linkover").on("click",function(d,c){Logabout.Bridgeport.trackEvent("quicksignin","login","forgot");this.lbSwitchTab("passwordreset")},this)},scope:this}},{xtype:"button",width:160,height:30,x:210,y:60,text:"Sign In",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.loginHandler,scope:this},{xtype:"panel",ref:"/orefLoginRegisterLink",layout:"fit",width:this.lbWidth-a,height:110,x:10,y:96,border:false,html:{tag:"div",cls:"",children:[{tag:"div",cls:"qsi-signin-alt qsi-registerlink lb-round-border-5",children:[{tag:"div",cls:"qsi-register-opt1",children:[{tag:"span",cls:"",html:"Need an account? "},{tag:"span",cls:"db-icon db-icon-go db-dv-linkitem db-action-register",html:"Create one here"}]},{tag:"div",cls:"qsi-register-opt2",children:[{tag:"div",cls:"",html:"Do not want to register?"},{tag:"div",cls:"qsi-gfc-signin",children:[{tag:"div",id:this.getId()+"-qsi-gfc-signin-id",html:"Sign in with google"}]}]}]}]},listeners:{afterrender:function(b){if(!this.lbIsQuickWindow){this.lbSwitchTab.defer(2000,this,[this.lbStartCardName])}b.body.child(".db-dv-linkitem.db-action-register").addClassOnOver("db-dv-linkover").on("click",function(d,c){Logabout.Bridgeport.trackEvent("quicksignin","login","register");this.lbSwitchTab("register")},this)},show:function(b){},scope:this}}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefRegisterDesc",layout:"fit",width:this.lbWidth-a,height:30,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"Join now! Register a free account."}]}},{xtype:"form",ref:"/orefRegForm",width:this.lbWidth-a,height:90,x:10,y:40,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},defaults:{width:100,hideLabel:true},items:[{xtype:"textfield",ref:"//orefUname",fieldLabel:"Username",msgTarget:"",maskRe:/[a-z0-9]/i,validator:(function(c){var b=c.trim();if(b=="jim"){return"qsi-err-warn:TEST username not available"}else{if(b.length==0){return"qsi-err-fail:please enter a username"}else{if(b.length<3){return"qsi-err-fail:username is too short"}else{if(b.length>20){return"qsi-err-fail:username is too long"}else{return this.lbCheckUname(c,this.orefUname)}}}}}).createDelegate(this),lbOkText:"qsi-err-ok:username is available",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}},{xtype:"textfield",ref:"//orefPword",fieldLabel:"Password",inputType:"password",msgTarget:"",maskRe:/[a-z0-9]/i,validator:(function(c){var b=c.trim();if(b.length==0){return"qsi-err-fail:please enter a password"}else{if(b.length<5){return"qsi-err-fail:password is too short"}else{if(b.length>20){return"qsi-err-fail:password is too long"}else{return true}}}}).createDelegate(this),lbOkText:"qsi-err-ok:password is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}},{xtype:"textfield",ref:"//orefEmail",fieldLabel:"Email",vtype:"email",vtypeText:"qsi-err-fail:should look like an email",allowBlank:false,blankText:"qsi-err-fail:please enter email address",msgTarget:"",invalidClass:"",lbOkText:"qsi-err-ok:email is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}}]},{xtype:"button",width:this.lbWidth-a,height:30,x:10,y:130,text:"Register my account",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){var b=this.orefUname.getValue();var d=this.orefPword.getValue();var c=this.orefEmail.getValue();if(this.orefRegForm.getForm().isValid()){this.lbShowMsg(this.orefRegisterDesc.getEl().child(".qsi-login-msg"),"Creating account...");this.lbShowMaskMsg("Creating Account. Please wait");this.lbAjax("user/xregister",{format:"json",uname:b,pword:d,email:c},function(e){Logabout.Bridgeport.trackEvent("quicksignin","register","ok");window.location.pathname="/"},function(e){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","register","fail");this.lbShowMsg(this.orefRegisterDesc.getEl().child(".qsi-login-msg"),e.error)},this)}else{this.lbShowMsg(this.orefRegisterDesc.getEl().child(".qsi-login-msg"),"Please enter your details")}},scope:this},{xtype:"panel",layout:"fit",width:this.lbWidth-a,height:35,x:10,y:170,border:false,html:{tag:"div",cls:"qsi-signin-alt qsi-loginlink lb-round-border-5",children:[{tag:"span",cls:"",html:"Already have an account? "},{tag:"span",cls:"db-icon db-icon-go db-dv-linkitem db-action-signin",html:"Log In Here"}]},listeners:{afterrender:function(b){b.body.child(".db-dv-linkitem.db-action-signin").addClassOnOver("db-dv-linkover").on("click",function(d,c){this.lbSwitchTab("login")},this)},scope:this}}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefEmailEditDesc",layout:"fit",width:this.lbWidth-a,height:60,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main qsi-useredit",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"Edit your email. Enter the same address twice."}]}},{xtype:"form",ref:"/orefEmailEditForm",width:this.lbWidth-a,height:90,x:10,y:70,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},defaults:{width:100,hideLabel:true},items:[{xtype:"textfield",ref:"//orefUeEmail",fieldLabel:"New Email",vtype:"email",vtypeText:"qsi-err-fail:should look like an email",allowBlank:false,blankText:"qsi-err-fail:please enter email address",msgTarget:"",invalidClass:"",lbOkText:"qsi-err-ok:email is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}},{xtype:"textfield",ref:"//orefUe2Email",fieldLabel:"Re-enter",vtype:"email",vtypeText:"qsi-err-fail:should look like an email",allowBlank:false,blankText:"qsi-err-fail:please enter email address",msgTarget:"",invalidClass:"",lbOkText:"qsi-err-ok:email is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}}]},{xtype:"button",width:this.lbWidth-a,height:30,x:10,y:160,text:"Save Changes",tooltip:"click to save",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){var b=this.orefUeEmail.getValue();var d=this.orefUe2Email.getValue();var c=false;if(this.orefEmailEditForm.getForm().isValid()||c){if(b!=d){this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"The addresses do not match. Please re-enter.")}else{if(this.lbuseremail==b){this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"We already have that address for you. No update needed.")}else{this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"Saving...");this.lbShowMaskMsg("Saving... Please wait");this.lbAjax("user/xusereditemail",{format:"json",email:b},function(e){Logabout.Bridgeport.trackEvent("quicksignin","useredit","ok");this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"Email successfully updated.");if(Ext.isEmpty(this.lbuseremail)){Logabout.Bridgeport.updateUserStats(this,"emailupdate",{pntcnt:Logabout.Defs.StatsBonus.emailbonus,pntcntchg:Logabout.Defs.StatsBonus.emailbonus,emailbonus:Logabout.Defs.StatsBonus.emailbonus})}this.lbMask.hide();this.lbuseremail=b;this.lbParentOwner.lbSetTitle("edit email address");this.orefEmailEditDesc.getEl().child(".qsi-login-desc").update("Your email address: <b>"+this.lbuseremail+"</b>. To change please enter a new address below.")},function(e){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","useredit","fail");this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),e.error)},this)}}}else{this.lbShowMsg(this.orefEmailEditDesc.getEl().child(".qsi-login-msg"),"Please enter your email address twice")}},scope:this}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefPwdEditDesc",layout:"fit",width:this.lbWidth-a,height:60,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main qsi-useredit",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"Enter both your old and a new password"}]}},{xtype:"form",ref:"/orefPwdEditForm",width:this.lbWidth-a,height:90,x:10,y:70,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},defaults:{width:100,hideLabel:true},items:[{xtype:"textfield",ref:"//orefPePwordOld",fieldLabel:"Old Pwd",inputType:"password",msgTarget:"",maskRe:/[a-z0-9]/i,validator:(function(c){var b=c.trim();if(b.length==0){return"qsi-err-fail:please enter a password"}else{if(b.length<3){return"qsi-err-fail:password is too short"}else{if(b.length>20){return"qsi-err-fail:password is too long"}else{return true}}}}).createDelegate(this),lbOkText:"qsi-err-ok:password is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}},{xtype:"textfield",ref:"//orefPePwordNew",fieldLabel:"New Pwd",inputType:"password",msgTarget:"",maskRe:/[a-z0-9]/i,validator:(function(c){var b=c.trim();if(b.length==0){return"qsi-err-fail:please enter a password"}else{if(b.length<5){return"qsi-err-fail:password is too short"}else{if(b.length>20){return"qsi-err-fail:password is too long"}else{return true}}}}).createDelegate(this),lbOkText:"qsi-err-ok:password is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}}]},{xtype:"button",width:this.lbWidth-a,height:30,x:10,y:160,text:"Save Changes",tooltip:"click to save",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){var d=this.orefPePwordOld.getValue();var c=this.orefPePwordNew.getValue();var b=false;if(this.orefPwdEditForm.getForm().isValid()||b){if(d==c){this.lbShowMsg(this.orefPwdEditDesc.getEl().child(".qsi-login-msg"),"The passwords are the same. Please enter a new password")}else{this.lbShowMsg(this.orefPwdEditDesc.getEl().child(".qsi-login-msg"),"Saving...");this.lbShowMaskMsg("Saving... Please wait");this.lbAjax("user/xusereditpassword",{format:"json",pwordold:d,pwordnew:c},function(e){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","passwordedit","ok");this.lbShowMsg(this.orefPwdEditDesc.getEl().child(".qsi-login-msg"),"Password successfully updated.")},function(e){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","passwordedit","fail");this.lbShowMsg(this.orefPwdEditDesc.getEl().child(".qsi-login-msg"),e.error)},this)}}else{this.lbShowMsg(this.orefPwdEditDesc.getEl().child(".qsi-login-msg"),"Please enter your old and new password")}},scope:this}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefPwdResetDesc",layout:"fit",width:this.lbWidth-a,height:60,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main qsi-useredit",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"Enter your email address to receive a new password"}]}},{xtype:"form",ref:"/orefPwdResetForm",width:this.lbWidth-a,height:90,x:10,y:70,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},defaults:{width:100,hideLabel:true},items:[{xtype:"textfield",ref:"//orefPrEmail",fieldLabel:"Email",vtype:"email",vtypeText:"qsi-err-fail:should look like an email",allowBlank:false,blankText:"qsi-err-fail:please enter email address",msgTarget:"",invalidClass:"",lbOkText:"qsi-err-ok:email is ok",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}}]},{xtype:"button",width:150,height:30,x:10,y:160,text:"Reset Password",tooltip:"click to reset",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){var b=this.orefPrEmail.getValue();var c=false;if(this.orefPwdResetForm.getForm().isValid()||c){this.lbShowMsg(this.orefPwdResetDesc.getEl().child(".qsi-login-msg"),"Saving...");this.lbShowMaskMsg("Resetting... Please wait");this.lbAjax("user/xuserresetpassword",{format:"json",email:b},function(d){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","passwordreset","ok");this.lbShowMsg(this.orefPwdResetDesc.getEl().child(".qsi-login-msg"),"Password was reset. Check your email.")},function(d){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","passwordreset","fail");this.lbShowMsg(this.orefPwdResetDesc.getEl().child(".qsi-login-msg"),d.error)},this)}else{this.lbShowMsg(this.orefPwdResetDesc.getEl().child(".qsi-login-msg"),"Please enter your email address")}},scope:this},{xtype:"button",width:80,height:30,x:10+150+50,y:160,text:"Cancel",tooltip:"click to cancel",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.lbSwitchTab.createDelegate(this,["login"]),scope:this}]},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",ref:"/orefUsernameEditDesc",layout:"fit",width:this.lbWidth-a,height:60,x:10,y:5,border:false,html:{tag:"div",cls:"qsi-main qsi-useredit",children:[{tag:"div",cls:"qsi-login-msg",html:"Login Message"},{tag:"div",cls:"qsi-login-desc",html:"You are signed in as <b>"+this.lbuname+"</b>. Enter a new username to change."}]}},{xtype:"form",ref:"/orefUsernameEditForm",width:this.lbWidth-a,height:90,x:10,y:70,border:false,layoutConfig:{fieldTpl:this.FormFieldTpl},defaults:{width:100,hideLabel:true},items:[{xtype:"textfield",ref:"//orefUeUname",fieldLabel:"Username",msgTarget:"",maskRe:/[a-z0-9]/i,validator:(function(c){var b=c.trim();if(b=="jim"){return"qsi-err-warn:TEST username not available"}else{if(b.length==0){return"qsi-err-fail:please enter a username"}else{if(b.length<3){return"qsi-err-fail:username is too short"}else{if(b.length>20){return"qsi-err-fail:username is too long"}else{return this.lbCheckUname(c,this.orefUeUname)}}}}}).createDelegate(this),lbOkText:"qsi-err-ok:username is available",listeners:{invalid:this.formFieldInvalidH,valid:this.formFieldValidH,scope:this}}]},{xtype:"button",width:this.lbWidth-a,height:30,x:10,y:160,text:"Save Changes",tooltip:"click to save",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){var b=this.orefUeUname.getValue();var c=false;if(this.orefUsernameEditForm.getForm().isValid()||c){this.lbShowMsg(this.orefUsernameEditDesc.getEl().child(".qsi-login-msg"),"Saving...");this.lbShowMaskMsg("Saving... Please wait");this.lbAjax("user/xusereditusername",{format:"json",username:b},function(d){Logabout.Bridgeport.trackEvent("quicksignin","usernameedit","ok");this.lbShowMsg(this.orefUsernameEditDesc.getEl().child(".qsi-login-msg"),"Username successfully updated.");window.location.pathname="/"},function(d){this.lbMask.hide();Logabout.Bridgeport.trackEvent("quicksignin","usernameedit","fail");this.lbShowMsg(this.orefUsernameEditDesc.getEl().child(".qsi-login-msg"),d.error)},this)}else{this.lbShowMsg(this.orefUsernameEditDesc.getEl().child(".qsi-login-msg"),"Please enter a new username")}},scope:this}]},{xtype:"panel",layout:"absolute",items:[{xtype:"panel",layout:"fit",width:this.lbWidth-a,height:20,x:10,y:10,border:false,bodyStyle:"font-size: 130%;",html:{tag:"div",cls:"qsi-main",children:[{tag:"div",html:"You are not signed in to your logabout account."}]}},{xtype:"panel",layout:"absolute",width:this.lbWidth-a,height:30,x:10,y:40,border:false,items:[{xtype:"button",height:30,width:350,x:0,y:0,text:"Sign In",tooltip:"click to sign in",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){Logabout.Bridgeport.trackEvent("quicksignin","login","click");window.location.pathname="user/login"},scope:this}]},{xtype:"panel",layout:"absolute",width:this.lbWidth-a,height:30,x:10,y:80,border:false,items:[{xtype:"button",height:30,width:350,x:0,y:0,text:"Register for a free account",tooltip:"click to register a free account",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){Logabout.Bridgeport.trackEvent("quicksignin","register","click");window.location.pathname="user/register"},scope:this}]}]}]});Logabout.QuickSignInPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.QuickSignInPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout");Logabout.QuickSignInWindow=Ext.extend(Ext.Window,{lbWidth:null,lbHeight:null,lbshow:function(a){this.show();this.orefQSIP.lbSwitchTab(a)},lbSetTitle:function(a){this.setTitle(a)},initComponent:function(){Ext.apply(this,this.lbstandardconfig);var a=30;Ext.apply(this,{width:this.lbWidth,height:this.lbHeight,constrain:true,constrainHeader:true,modal:true,closeAction:"hide",title:"sign in window",iconCls:"db-icon-info",resizable:false,border:false,bodyBorder:true,plain:true,items:[new Logabout.QuickSignInPanel({ref:"orefQSIP",lbWidth:390,lbHeight:240,lbParentOwner:this,lbIsQuickWindow:true,lbstandardconfig:this.lbstandardconfig})]});Logabout.QuickSignInWindow.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.QuickSignInWindow.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout");Logabout.QuickDataPanel=Ext.extend(Ext.Window,{lbWidth:null,lbHeight:null,lbSaveObj:null,lbPlaceTplDef:['<div class="datalog-main">','<tpl for=".">','<div class="datalog-wrap">','<div class="datalog-top">','<div class="datalog-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>",'<div class="datalog-list">','<div class="datalog-itm db-icon db-icon-founded">founded by ','<span class="db-mrk-linkitem db-action-showprofile">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="datalog-itm db-icon {[ this.getItemIconClass(values) ]}">',"type {[ this.wpthash[values.wtype] ]}","</div>","</div>","</div>","</div>","</tpl>","</div>"],lbtpldefs:[{label:"place",tpldef:['<div class="datalog-main">','<tpl for=".">','<div class="datalog-wrap">','<div class="datalog-top">','<div class="datalog-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>",'<div class="datalog-list">','<div class="datalog-itm db-icon db-icon-founded">founded by ','<span class="db-mrk-linkitem db-action-showprofile">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="datalog-itm db-icon {[ this.getItemIconClass(values) ]}">',"type {[ this.wpthash[values.wtype] ]}","</div>","</div>","</div>","</div>","</tpl>","</div>"]},{label:"pic",tpldef:['<div class="bp-wpt-picplace">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<div class="bp-pitm-title">','<tpl if="placeswpid == null">','<div class="bp-wc-fleft bp-wc-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>","</tpl>",'<tpl if="placeswpid != null">','<div class="bp-wc-fleft bp-wc-placename db-icon {[ this.getItemIconClass(values) ]}">',"{placename}","</div>",'<div class="bp-wc-fright db-icon db-icon-go">','<div class="db-mrk-linkitem db-mrk-li-switch">place</div>',"</div>","</tpl>",'<div class="bp-wc-fclear"></div>',"</div>",'<div class="bp-wpt-combo-pic-container">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<tpl if="this.hasPhoto(values)">','<div class="bp-wpt-combo-picenlarge">','<div class="db-mrk-linkitem db-mrk-li-enlarge db-icon db-icon-zoomin">enlarge picture<div class="db-mrk-linkdata">{[ this.getPhotoSrc(values) ]}</div></div>',"</div>","</tpl>","</div>","</div>","</tpl>","</div>"]},{label:"log",tpldef:['<div class="bp-wpt-combo">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<tpl if="mtype == 1">','<div class="bp-litm db-icon db-icon-founded">',"this is the founding log entry","</div>","</tpl>",'<div class="bp-litm bp-wpt-combo-wayname">','<span class="bp-litm-lbl">log name: </span>{sfield1}',"</div>",'<tpl if="placeswpid == null">','<div class="bp-litm bp-wpt-combo-waytype">','<span class="bp-litm-lbl">log type: </span>{[ this.wpthash[values.wtype] ]}',"</div>","</tpl>",'<div class="bp-litm bp-wpt-combo-username">','<span class="bp-litm-lbl">log user: </span>','<span class="db-mrk-linkitem db-mrk-li-showdetails">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="bp-litm bp-wpt-combo-points">','<span class="bp-litm-lbl">log date: </span>{[ this.customDate(values.utc,Date.patterns.LbCombo)]}',"</div>",'<div class="bp-litm bp-wpt-combo-points">','<span class="bp-litm-lbl">log points: </span>{ifield13}',"</div>",'<tpl if="description != null">','<div class="bp-litm bp-wpt-combo-desc">','<span class="bp-litm-lbl">description: </span>{description}',"</div>","</tpl>","</div>","</div>","</tpl>","</div>"]},{label:"detail",tpldef:['<tpl for=".">','{[ this.getDetail(values,["sfield2","sfield3","sfield4","ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9"],"bp-wpt-combo-wrap","bp-litm") ]}',"</tpl>"]},{label:"position",tpldef:['<div class="bp-wpt-combo">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<div class="bp-litm bp-wpt-combo-lat">','<span class="bp-litm-lbl">lat: </span>{lat}',"</div>",'<div class="bp-litm bp-wpt-combo-lng">','<span class="bp-litm-lbl">lng: </span>{lng}',"</div>",'<div class="bp-litm bp-wpt-combo-acc">','<span class="bp-litm-lbl">accuracy: </span>{gmapzoom}',"</div>",'<tpl if="sfield5 != null">','<div class="bp-litm bp-wpt-combo-city">','<span class="bp-litm-lbl">city: </span>{sfield5}',"</div>","</tpl>",'<tpl if="sfield6 != null">','<div class="bp-litm bp-wpt-combo-state">','<span class="bp-litm-lbl">state: </span>{sfield6}',"</div>","</tpl>",'<tpl if="sfield7 != null">','<div class="bp-litm bp-wpt-combo-country">','<span class="bp-litm-lbl">country: </span>{sfield7}',"</div>","</tpl>","</div>","</div>","</tpl>","</div>"]}],lbtplFunctions:null,lbInitTemplate:function(){this.lbPlaceTpl=new Ext.XTemplate(this.lbtpldefs[0].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},wpthash:this.lbtplFunctions.wpthash});this.lbPlaceTpl.compile();this.lbDetailTpl=new Ext.XTemplate(this.lbtpldefs[3].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,getDetail:this.lbtplFunctions.getDetail});this.lbDetailTpl.compile()},lbShow:function(a){this.lbStore.load({params:{swpid:a,browserts:new Date().format("U")},callback:function(c){var d=this.lbStore.find("swpid",a);var b=c[d].data;Ext.apply(this.lbSaveObj,b);this.show();this.getLayout().setActiveItem(0);this.orefPlace.body.update(this.lbPlaceTpl.applyTemplate(this.lbSaveObj));this.orefDetail.body.update(this.lbDetailTpl.applyTemplate(this.lbSaveObj));this.linkHandler()},scope:this})},linkHandler:function(){this.orefLink.setValue("loading...");Ext.Ajax.request({url:this.lburl,params:{task:"getwptlink",sesstoken:this.lbdsess,swpid:this.lbSaveObj.swpid},callback:function(b,d,a){if(d){var c=Ext.util.JSON.decode(a.responseText);if(c.error){Ext.MessageBox.alert("Error",c.error)}else{this.orefLink.setValue("http://"+c.domain+"/wptv/?swpid="+c.scramswpid+"&lat="+this.lbSaveObj.lat+"&lng="+this.lbSaveObj.lng)}}else{Ext.MessageBox.alert("Unknown Error","An unknown error occured while attempting to delete data, please contact a system administrator.")}},scope:this})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.lbInitTemplate();this.lbStore=new Ext.data.JsonStore({url:this.lburl,baseParams:{task:"zoomdata",sesstoken:this.lbdsess},root:"results",fields:Logabout.Defs.FullRecDef,remoteSort:false});this.lbSaveObj={};var a=30;Ext.apply(this,{width:this.lbWidth,height:this.lbHeight,layout:"card",activeItem:0,constrain:true,constrainHeader:true,modal:true,closeAction:"hide",title:"log entry detail",iconCls:"db-icon-info",resizable:false,border:false,bodyBorder:true,plain:true,items:[{xtype:"panel",layout:"absolute",items:[{xtype:"panel",layout:"fit",ref:"//orefPlace",width:this.lbWidth-a,height:100,x:10,y:10,border:false,title:"place data",collapsible:true,collapsed:false},{xtype:"panel",layout:"fit",ref:"//orefDetail",width:this.lbWidth-a,height:100,x:10,y:120,border:false,title:"detail data",collapsible:true,collapsed:false,autoScroll:true},{xtype:"panel",layout:"absolute",width:this.lbWidth-a,height:150,x:10,y:240,border:false,title:"link data",collapsible:true,collapsed:false,items:[{xtype:"panel",width:this.lbWidth-a,height:70,x:0,y:0,border:false,html:'<div class="bp-wpt-combo-linktext"><div>use the link below to refer to this waypoint from other websites or in an email message.</div><div>Tip: click in the textbox to select the url. copy the text (ctl-c) and paste (ctl-v) in your document</div></div>'},{xtype:"textfield",width:this.lbWidth-a,height:40,x:0,y:80,text:"copy this link",ref:"///orefLink",border:false,selectOnFocus:true}]}]},{xtype:"panel",layout:"absolute",items:[{xtype:"panel",layout:"fit",ref:"//orefLogged",width:this.lbWidth,height:this.lbHeight,x:0,y:0,border:false}]}]});Logabout.QuickDataPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.QuickDataPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.PictureviewerWindow=Ext.extend(Ext.Window,{lbContainerW:null,lbContainerH:null,lbImgSrc:"dddd",lbshow:function(a){this.lbImgSrc=a;this.show(null,function(){Ext.DomHelper.overwrite(this.body,[{tag:"div",cls:"bp-picviewer-wrap",children:[{tag:"img",src:this.lbImgSrc}]}])},this);this.setPagePosition(200,200)},initComponent:function(){Ext.apply(this,{closeAction:"hide",width:this.lbContainerW,height:this.lbContainerH,modal:false,title:"Picture Viewer",constrain:true,constrainHeader:true,autoScroll:true,html:"loading picture window..."});Logabout.Demo.PictureviewerWindow.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.PictureviewerWindow.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.NewsComboPanel=Ext.extend(Ext.Panel,{border:false,lbInitialized:false,lbLastActiveChildObj:{objId:"groupednewspanel",itmId:null},lbSetLastActiveChild:function(a){this.lbLastActiveChildObj=a},lbScrollActiveChild:function(){if(typeof(Ext.getCmp(this.lbLastActiveChildObj.objId).lbScrollFocusItm)!="undefined"){Ext.getCmp(this.lbLastActiveChildObj.objId).lbScrollFocusItm(this.lbLastActiveChildObj)}},lbShowChildTT:function(a){if(this.lbCurrentConfig=="mapintro"){return false}else{if(this.lbCurrentConfig=="mapnointro"){return false}else{return true}}},lbMatchMapToCurrentConfig:function(){if(this.lbCurrentConfig=="mapnointro"){Logabout.Bridgeport.configHomePage(true)}else{if(this.lbCurrentConfig=="mapintro"){Logabout.Bridgeport.configHomePage(true)}else{if(this.lbCurrentConfig=="nomapintro"){Logabout.Bridgeport.configHomePage(false)}else{if(this.lbCurrentConfig=="nomapnointro"){Logabout.Bridgeport.configHomePage(false)}}}}},lbChangeConfig:function(a,b){if(this.lbCurrentConfig=="mapintro"&&b&&this.lbLastActiveChildObj.objId=="goalpanel"){this.lbCurrentConfig="nomapintro";this.orefIntro.getLayout().setActiveItem(1)}else{if(this.lbCurrentConfig=="mapintro"&&b){this.lbCurrentConfig="nomapintro"}else{if(this.lbCurrentConfig=="nomapintro"&&b&&this.lbLastActiveChildObj.objId=="groupednewspanel"){this.lbCurrentConfig="mapnointro"}else{if(this.lbCurrentConfig=="nomapintro"&&b&&this.lbLastActiveChildObj.objId==this.id+"_mostvizlist"){this.lbCurrentConfig="mapnointro"}else{if(this.lbCurrentConfig=="nomapintro"&&b&&this.lbLastActiveChildObj.objId==this.id+"_founderlist"){this.lbCurrentConfig="mapnointro"}else{if(this.lbCurrentConfig=="nomapintro"&&b&&this.lbLastActiveChildObj.objId==this.id+"_populargoals"){this.lbCurrentConfig="mapnointro"}else{if(this.lbCurrentConfig=="nomapintro"&&b&&this.lbLastActiveChildObj.objId=="goalpanel"){this.lbCurrentConfig="mapintro"}else{if(this.lbCurrentConfig=="nomapintro"&&b){this.lbCurrentConfig="mapintro"}else{if(this.lbCurrentConfig=="mapnointro"&&b){this.lbCurrentConfig="nomapintro"}else{if(this.lbCurrentConfig=="nomapnointro"&&b){this.lbCurrentConfig="mapnointro"}else{this.lbCurrentConfig=a}}}}}}}}}}if(this.lbCurrentConfig=="mapnointro"){Logabout.Bridgeport.configHomePage(true);this.orefIntro.hide();this.body.replaceClass("db-size-nomap","db-size-withmap")}else{if(this.lbCurrentConfig=="mapintro"){Logabout.Bridgeport.configHomePage(true);this.orefIntro.show();this.body.replaceClass("db-size-nomap","db-size-withmap")}else{if(this.lbCurrentConfig=="nomapintro"){Logabout.Bridgeport.configHomePage(false);this.orefIntro.show();this.body.replaceClass("db-size-withmap","db-size-nomap")}else{if(this.lbCurrentConfig=="nomapnointro"){Logabout.Bridgeport.configHomePage(false);this.orefIntro.hide();this.body.replaceClass("db-size-withmap","db-size-nomap")}}}}this.orefTabSetLeft.setSize(this.lbConfigO[this.lbCurrentConfig].tabs1.width,this.lbConfigO[this.lbCurrentConfig].tabs1.height);this.orefTabSetLeft.setPosition(this.lbConfigO[this.lbCurrentConfig].tabs1.x,this.lbConfigO[this.lbCurrentConfig].tabs1.y);this.orefTabSetRight.setSize(this.lbConfigO[this.lbCurrentConfig].tabs2.width,this.lbConfigO[this.lbCurrentConfig].tabs2.height);this.orefTabSetRight.setPosition(this.lbConfigO[this.lbCurrentConfig].tabs2.x,this.lbConfigO[this.lbCurrentConfig].tabs2.y);this.lbScrollActiveChild();this.fireEvent("dispconfigchange",this,this.lbCurrentConfig,((this.lbCurrentConfig=="mapnointro"||this.lbCurrentConfig=="mapintro")?true:false));Logabout.Tips.hide()},lbConfigO:{mapintro:{intro:{width:0,height:0,x:0,y:0},tabs1:{width:0,height:0,x:0,y:0},tabs2:{width:0,height:0,x:0,y:0}},mapnointro:{intro:{width:0,height:0,x:0,y:0},tabs1:{width:0,height:0,x:0,y:0},tabs2:{width:0,height:0,x:0,y:0}},nomapintro:{intro:{width:0,height:0,x:0,y:0},tabs1:{width:0,height:0,x:0,y:0},tabs2:{width:0,height:0,x:0,y:0}},nomapnointro:{intro:{width:0,height:0,x:0,y:0},tabs1:{width:0,height:0,x:0,y:0},tabs2:{width:0,height:0,x:0,y:0}}},lbInitConfigO:function(){var e=3;var g=3;var a=this.lbWidth-(e*2);var c=this.lbHeight-(g*2);var b=230;var f=c-b-g;var d=(a/2)-(e/2);Ext.apply(this.lbConfigO.mapintro.intro,{width:a,height:b,x:e,y:g});Ext.apply(this.lbConfigO.mapintro.tabs1,{width:d,height:f,x:e,y:b+(2*g)});Ext.apply(this.lbConfigO.mapintro.tabs2,{width:d,height:f,x:e+d+e,y:b+(2*g)});Ext.apply(this.lbConfigO.mapnointro.intro,{width:a,height:b,x:e,y:g});Ext.apply(this.lbConfigO.mapnointro.tabs1,{width:d,height:b,x:e,y:g});Ext.apply(this.lbConfigO.mapnointro.tabs2,{width:d,height:b,x:e+d+e,y:g});Ext.apply(this.lbConfigO.nomapintro.intro,{width:a,height:b,x:e,y:g});Ext.apply(this.lbConfigO.nomapintro.tabs1,{width:d,height:f,x:e,y:b+(2*g)});Ext.apply(this.lbConfigO.nomapintro.tabs2,{width:d,height:f,x:e+d+e,y:b+(2*g)});Ext.apply(this.lbConfigO.nomapnointro.intro,{width:a,height:b,x:e,y:g});Ext.apply(this.lbConfigO.nomapnointro.tabs1,{width:d,height:c,x:e,y:g});Ext.apply(this.lbConfigO.nomapnointro.tabs2,{width:d,height:c,x:e+d+e,y:g})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);Ext.apply(this,this.lbSize.nomap);this.lbInitConfigO();this.lbCurrentConfig="nomapintro";Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,cls:"db-custpanel-color",items:[{xtype:"panel",layout:"card",activeItem:1,ref:"orefIntro",width:this.lbConfigO[this.lbCurrentConfig].intro.width,height:this.lbConfigO[this.lbCurrentConfig].intro.height,x:this.lbConfigO[this.lbCurrentConfig].intro.x,y:this.lbConfigO[this.lbCurrentConfig].intro.y,border:false,items:[{xtype:"panel",html:"placeholder"},{xtype:"panel",layout:"absolute",border:false,items:[{xtype:"panel",width:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)-10,height:this.lbConfigO[this.lbCurrentConfig].intro.height,x:0,y:0,layout:"card",activeItem:(this.lbisguestuser?0:1),cls:"db-custpanel-color",border:false,items:[{xtype:"panel",border:false,cls:"db-custpanel-color",html:{tag:"div",cls:"newsc-intro-main",children:[{tag:"div",cls:"lb-round-border-10 newsc-intro-msg",children:[{tag:"span",cls:"newsc-intro-title",html:"Things you can do with logabout"},{tag:"ul",cls:"newsc-intro-lst",children:[{tag:"li",cls:"db-icon db-icon-go",html:"Find and check in at camp grounds, dump stations, wifi hotspots and more. Get points for every check in."},{tag:"li",cls:"db-icon db-icon-go",html:"Become a Founder by adding a new place and get bonus points!"},{tag:"li",cls:"db-icon db-icon-go",html:"Complete a goal and compare your stats with other users."}]}]}]}},new Logabout.Demo.QuickUserPanel({ref:"///orefQuickUserPanel",lbWidth:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)-10,lbHeight:this.lbConfigO[this.lbCurrentConfig].intro.height,x:0,y:0,border:false,cls:"db-custpanel-color",lbParentOwner:this,lbstandardconfig:this.lbstandardconfig})]},{xtype:"panel",width:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)-10,height:this.lbConfigO[this.lbCurrentConfig].intro.height,x:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)+5,y:0,layout:"card",activeItem:(this.lbisguestuser?1:0),cls:"db-custpanel-color",border:false,items:[{xtype:"panel",border:false,width:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)-10,height:this.lbConfigO[this.lbCurrentConfig].intro.height,x:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)+5,y:0,cls:"db-custpanel-color",html:{tag:"div",cls:"newsc-goal-main",children:[{tag:"div",cls:"newsc-goal-inner lb-round-border-10",children:[{tag:"div",cls:"newsc-goal-new"},{tag:"div",cls:"newsc-goal-title",html:"Complete a Goal"},{tag:"div",cls:"newsc-goal-pcont",children:[{tag:"div",cls:"newsc-goal-pic"}]},{tag:"div",cls:"newsc-goal-desc",html:"Simply check off places you visited and get bonus points when you complete a set."},{tag:"div",cls:"newsc-goal-clear"},{tag:"div",cls:"newsc-goal-go db-icon db-icon-go",children:[{tag:"div",cls:"db-dv-linkitem db-action-go",html:"get started... pick a goal"}]}]}]},listeners:{afterrender:function(a){a.body.child(".db-dv-linkitem.db-action-go").addClassOnOver("db-dv-linkover").on("click",function(c,b){Logabout.Bridgeport.showGoal()},this)},scope:this}},new Logabout.QuickSignInPanel({ref:"///orefQuickSignInPanel",lbWidth:(this.lbConfigO[this.lbCurrentConfig].intro.width/2)-10,lbHeight:this.lbConfigO[this.lbCurrentConfig].intro.height,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,cls:"qsi-hompage-container lb-round-border-10 qsi-login"})]}]}]},{xtype:"tabpanel",ref:"orefTabSetLeft",activeTab:0,width:this.lbConfigO[this.lbCurrentConfig].tabs1.width,height:this.lbConfigO[this.lbCurrentConfig].tabs1.height,x:this.lbConfigO[this.lbCurrentConfig].tabs1.x,y:this.lbConfigO[this.lbCurrentConfig].tabs1.y,border:false,plain:true,items:[new Logabout.Demo.MemoryPanel.MultiNews({id:"groupednewspanel",title:"recent activity",border:false,cls:"db-custpanel-color",lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbbaseparams:{task:"summarydata",sumtype:15,start:0,limit:50},lbusepager:false,lbpagesize:7})]},{xtype:"tabpanel",ref:"orefTabSetRight",activeTab:0,deferredRender:false,width:this.lbConfigO[this.lbCurrentConfig].tabs2.width,height:this.lbConfigO[this.lbCurrentConfig].tabs2.height,x:this.lbConfigO[this.lbCurrentConfig].tabs2.x,y:this.lbConfigO[this.lbCurrentConfig].tabs2.y,border:false,plain:true,items:[new Logabout.Demo.MemoryPanel.PopularGoals({id:this.id+"_populargoals",ref:"/orefPopularGoals",title:"popular goals",border:false,cls:"db-custpanel-color",lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:"crud/list",timeout:this.lbtimeout.waypointsforuserpanel},lbidprop:"goalid",lbbaseparams:{table:"sg_goal",format:"json",loguserid:this.lbluid},lbusepager:false,lbpagesize:7}),new Logabout.Demo.MemoryPanel.FounderList({id:this.id+"_founderlist",title:"top founders",border:false,cls:"db-custpanel-color",lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbbaseparams:{task:"summarydata",sumtype:11,start:0,limit:20},lbusepager:false,lbpagesize:7}),new Logabout.Demo.MemoryPanel.MostvizList({id:this.id+"_mostvizlist",title:"popular places",border:false,cls:"db-custpanel-color",lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbbaseparams:{task:"summarydata",sumtype:12,start:0,limit:20},lbusepager:false,lbpagesize:7})]}]});this.lbBaseStore=new Ext.data.JsonStore({url:this.lburl,baseParams:{task:"summarydata",sumtype:123,start:0,limit:100},root:"results",fields:[{name:"sumstatid"},{name:"sumstatdt"},{name:"sumstatutc",type:"date",dateFormat:"U"},{name:"sumstattype"},{name:"sumstatdesc"},{name:"sumstatorder"},{name:"sumstatentry"},{name:"ssIfield1"},{name:"ssIfield2"},{name:"ssIfield3"},{name:"ssSfield1"},{name:"ssSfield2"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"ppicPath"},{name:"ppicWidth"},{name:"ppicHeight"},{name:"utc",type:"date",dateFormat:"U"},{name:"swpid"},{name:"wtype",convert:function(a,b){if(b.sumstatentry=="goals"){return 5}else{return a}}},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"},{name:"wptcount",type:"int",convert:function(a,b){return b.ssIfield1}},{name:"restype",type:"string",convert:function(a,b){return b.sumstatentry}}],remoteSort:false,sortInfo:this.lbStoreSortInfo});this.childListsInitialized={founderlist:false,mostvizlist:false};this.childListsHandler=function(d){if(this.lbInitialized){var c=d.split("_")[1];if(this.childListsInitialized[c]==false){Ext.getCmp(d).lbStore.load({params:{browserts:new Date().format("U")}});this.childListsInitialized[c]=true}else{this.lbmapmgr.setActiveCol(d)}}else{var b=555}};this.lbsignalController.on({groupiteminserted:function(b,a){if(a==this.lbCardHolder){Ext.getCmp("groupednewspanel").lbStore.load({params:{browserts:new Date().format("U")}})}},menuitemchange:function(b,a){if(a==this.lbCardHolder){if(!this.lbInitialized){this.orefQuickUserPanel.lbLoad();this.orefPopularGoals.lbStore.load({params:{browserts:new Date().format("U")},callback:function(c,d,e){this.lbBaseStore.load({params:{browserts:new Date().format("U")},callback:function(k,m,h){if(h){if(k.length){var i=this.lbBaseStore.query("sumstattype",15);var n=Ext.pluck(i.getRange(),"data");var l=this.lbBaseStore.query("sumstattype",11);var g=Ext.pluck(l.getRange(),"data");var j=this.lbBaseStore.query("sumstattype",12);var f=Ext.pluck(j.getRange(),"data");Ext.getCmp("groupednewspanel").lbLoadData({totalrows:n.length,results:n});Ext.getCmp(this.id+"_founderlist").lbLoadData({totalrows:g.length,results:g});Ext.getCmp(this.id+"_mostvizlist").lbLoadData({totalrows:f.length,results:f})}}},scope:this})},scope:this});this.lbInitialized=true}}},mapinactiveten:function(){if(Logabout.Bridgeport.getActiveMenuTag()==this.lbCardHolder){this.toggleWelcomeSet()}},scope:this});this.on({activate:function(e,d,f){},render:function(){},show:function(){},scope:this});Logabout.Demo.NewsComboPanel.superclass.initComponent.apply(this,arguments)},lastWelcomeSet:null,toggleWelcomeSet:function(a,b){var d=["groupednewspanel",this.id+"_mostvizlist",this.id+"_founderlist"];if(!a){if(!this.lastWelcomeSet){this.lastWelcomeSet=d[0]}a=this.lastWelcomeSet}if(!b){b=1}var e=d.indexOf(a);var c=e+b;if(c<0){c=2}if(c==3){c=0}Ext.getCmp("card-news-sets").getLayout().setActiveItem(d[c]);this.childListsHandler(d[c]);this.lastWelcomeSet=d[c];Logabout.Bridgeport.trackEvent("newscombo","togglewelcomeset",d[c])},toggleIntroPanel:function(a){this.getLayout().setActiveItem((a==true)?0:1);if(a==true){Logabout.Bridgeport.setMenuTabName(this.lbCardHolder,"Welcome")}else{Logabout.Bridgeport.setMenuTabName(this.lbCardHolder,"News");Ext.getCmp("groupednewspanel").lbStore.load({params:{browserts:new Date().format("U")}})}},onRender:function(){Logabout.Demo.NewsComboPanel.superclass.onRender.apply(this,arguments);Logabout.Tips.tip({lbid:this.id+"_helphovers",target:this.body,delegate:".tt-help-icon",lbShouldShow:null,lbShouldScope:null,custCls:"tt-helpstyle",width:360,lbClicks:[]})}});Ext.namespace("Logabout.Demo");Logabout.Demo.GroupedNewsPanel=Ext.extend(Ext.Panel,{lburl:null,lbmapmgr:null,lbtpl:null,lbtpldef:['<div class="news-main">','<div class="news-datalist">','<tpl for=".">','<div class="news-group-wrap">','<div class="news-group-item">',"{groupdesc}","</div>",'<div class="news-childlist">','<tpl for="groupchildren">','<div id="{[ this.getMyId() ]}_{swpid}" class="news-child-wrap">','<div class="news-child-item news-ico {[ this.getItemClass(values) ]}">',"{logusername} {[this.getComboData(values)]}","</div>","</div>","</tpl>","</div>","</div>","</tpl>","</div>","</div>"],lbtplFunctions:null,lbBwrapCfg:{tag:"div",cls:"x-panel-bwrap",children:[{tag:"div",cls:"results-bwrap-header",children:[{tag:"div",cls:"news-maintitle",html:"news"},{tag:"div",cls:"news-maintitle-right db-scroll-nxt db-icon-nxt",html:""},{tag:"div",cls:"news-maintitle-right db-scroll-dots db-scroldots-1",html:""},{tag:"div",cls:"news-maintitle-right db-scroll-prv db-icon-prv",html:""},{tag:"div",cls:"news-clear"}]}]},lbloadcallback:function(a){this.body.select(".news-child-wrap",true).addClassOnOver("news-over").on("click",function(d,c){var b=d.getTarget(".news-child-wrap",10,true).id.split("_")[1];if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,b)}this.lbSelectNewsItem(b)},this)},lbClearSelections:function(){if(this.body){this.body.select(".news-child-wrap",true).removeClass("news-sel")}},lbSelectNewsItem:function(a){this.lbClearSelections();if(Ext.get(this.id+"_"+a)){Ext.get(this.id+"_"+a).addClass("news-sel")}},lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:function(a){if(a.wptcount>1){return"db-mrk-news-short"}else{return"db-mrk-news-long"}},customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){if(a.restype=="waypoints"){if(a.mtype==1){return"db-icon db-icon-founded"}else{return"dbi-wpt-"+a.wtype}}else{return"dbi-grp-"+a.restype}},getComboData:(function(a){if(a.restype=="waypoints"){if(a.mtype==1){return String.format(this.lbcombodata.wFounded[a.wtype],a.wptcount,(a.wptcount>1?"s":""))}else{return String.format(this.lbcombodata.wType[a.wtype],a.wptcount,(a.wptcount>1?"s":""))}}else{return String.format(this.lbcombodata.gToken[a.restype],a.wptcount,(a.wptcount>1?"s":""))}}).createDelegate(this)}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerNews.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerNews.markerTemplateDef},lbStoreSortInfo:{field:"utc",direction:"DESC"},lbcombodata:{gToken:{likethis:"really liked {0} waypoint{1}",beenhere:"have also been at {0} waypoint{1}",favorite:"added {0} favorite{1}"},wType:{7:"created {0} new trip{1}",8:"filled up {0} time{1} with fuel",9:"logged {0} camp spot{1}",10:"filled up {0} time{1} with water",11:"used {0} dump station{1}",12:"found {0} wifi hot spot{1}",13:"enjoyed {0} outdoor place{1}",14:"visited {0} point{1} of interest",15:"took {0} photo{1}",16:"stayed at {0} hotel{1}"},wFounded:{7:"created {0} new trip{1}",8:"founded {0} fuel stop{1}",9:"founded {0} camp spot{1}",10:"founded {0} water filling spot{1}",11:"founded {0} dump station{1}",12:"founded {0} wifi hot spot{1}",13:"founded {0} outdoor place{1}",14:"founded {0} point{1} of interest",15:"took {0} photo{1}",16:"founded {0} hotel{1}"}},initComponent:function(){this.addEvents("changeview");this.lbinitmarkercol();this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){if(a.restype=="waypoints"){if(a.mtype==1){return"db-icon db-icon-founded"}else{return"dbi-wpt-"+a.wtype}}else{return"dbi-grp-"+a.restype}},getComboData:(function(a){if(a.restype=="waypoints"){if(a.mtype==1){return String.format(this.lbcombodata.wFounded[a.wtype],a.wptcount,(a.wptcount>1?"s":""))}else{return String.format(this.lbcombodata.wType[a.wtype],a.wptcount,(a.wptcount>1?"s":""))}}else{return String.format(this.lbcombodata.gToken[a.restype],a.wptcount,(a.wptcount>1?"s":""))}}).createDelegate(this)});this.lbtpl.compile();this.tplSourceCreator=function(a){var b=new Array();Ext.each(a,function(e){var c=e.data.utc.format("Ymd");var d=-1;Ext.each(b,function(h,g){if(h.groupval==c){d=g;return false}});if(d==-1){d=b.push({mid:e.data.swpid,groupval:c,groupdesc:this.lbtplFunctions.customDate(e.data.utc,"logabout-feed"),groupchildren:new Array()})-1}var f=b[d].groupchildren.push({newstype:"initial"});Ext.apply(b[d].groupchildren[f-1],e.data)},this);return b};this.lbStore=new Ext.data.JsonStore({url:this.lburl,baseParams:this.lbbaseparams,root:"results",fields:[{name:"swpid",type:"string",convert:function(a,b){if(b.restype=="waypoints"){return b.swpid}else{return b.loguserid+"-"+b.restype+"-"+b.swpid}}},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"utc",type:"date",dateFormat:"U"},{name:"addutc",type:"date",convert:function(a,b){return new Date()}},{name:"wpid"},{name:"wtype"},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"},,{name:"sfield2"},{name:"sfield3"},{name:"sfield4"},{name:"sfield5"},{name:"sfield6"},{name:"sfield7"},{name:"ifield1"},{name:"ifield2"},{name:"ifield3"},{name:"ifield4"},{name:"ifield5"},{name:"ifield6"},{name:"ifield7"},{name:"ifield8"},{name:"ifield9"},{name:"ifield11"},{name:"ifield12"},{name:"ifield13"},{name:"ifield14"},{name:"daydiff"},{name:"wptcount"},{name:"restype"},{name:"origuserid",type:"string"},{name:"origusername",type:"string"},{name:"mtype"},{name:"mswpid"}],remoteSort:false,sortInfo:this.lbStoreSortInfo,listeners:{load:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(this.lbautoload){this.lbautoload=false}else{this.lbmapmgr.setActiveCol(this.id)}}this.body.update(this.lbtpl.applyTemplate(this.tplSourceCreator(b)));if(this.lbloadcallback){this.lbloadcallback(b)}},scope:this}});Ext.apply(this,{html:"",bwrapCfg:this.lbBwrapCfg});if(this.lbmapmgr){this.lbmapmgr.on({mapmgrcolchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbClearSelections()}},mapmgritmchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbClearSelections()}else{this.lbSelectNewsItem(a)}},mapmgrhidecol:function(b,a){if(this.id==a){this.lbClearSelections()}},scope:this})}Logabout.Demo.GroupedNewsPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){Logabout.Demo.GroupedNewsPanel.superclass.onRender.apply(this,arguments);this.bwrap.select(".db-icon-prv",true).addClassOnOver("db-scroll-hover");this.bwrap.select(".db-icon-nxt",true).addClassOnOver("db-scroll-hover");this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,-1)},this,{delegate:".db-icon-prv"});this.bwrap.on("click",function(b,a){this.lbParentOwner.toggleWelcomeSet(this.id,1)},this,{delegate:".db-icon-nxt"})}});Ext.namespace("Logabout.Demo");Logabout.Demo.RecentPhotoPanel=Ext.extend(Ext.Panel,{lburl:null,lbmapmgr:null,lbtpl:null,lbtpldef:['<div id="{[ this.getMyId() ]}_main" class="recentphoto-main">','<div class="recentphoto-maintitle">recent photos</div>','<div class="recentphoto-maintitle-right"><div class="recentphoto-changeview"></div></div>','<div class="recentphoto-clear"></div>','<div class="recentphoto-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_{swpid}" class="recentphoto-wrap">','<div class="recentphoto-data-section">','<div class="recentphoto-ico {[ this.getItemClass(values) ]}">','<div class="recentphoto-item-left">',': {[ this.customDate(values.utc,"logabout-vshort") ]}',"</div>",'<div class="recentphoto-clear"></div>',"</div>",'<div class="recentphoto-photo">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<div class="recentphoto-clear"></div>',"</div>","</div>","</tpl>","</div>","</div>"],lbtplFunctions:null,lbviewcallback:null,lbloadcallback:function(a){Ext.select(".recentphoto-maintitle-right .recentphoto-changeview",true).each(function(c,d,b){var e=new Ext.Button({applyTo:c.dom,text:"refresh",iconCls:"db-icon-refresh",iconAlign:"left",cls:"db-button",tooltip:"click to refresh",handler:function(){this.fireEvent("changeview",this,this.id);this.lbStore.load({params:{browserts:new Date().format("U")}});Logabout.Bridgeport.trackEvent("newsrecentphoto","refresh","click")},scope:this})},this)},lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={showSection:function(a){switch(a){case"uname":return true;break;case"date":return true;break;case"dist":return false;break}return false},getMarkerSize:function(){return"db-mrk-standardsize"},customDate:this.lbtplFunctions.customDate,getDetail:this.lbtplFunctions.getDetail,isOwner:function(){return false},isGuest:function(){return false},getPhotoSrc:function(b){if(!b.ifield10||!b.sfield8){return false}var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return a}}},lbmarkercolconfig:{markerType:"display-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,hideMarkerOnCreate:true,useTabMarker:true,infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef},lbStoreSortInfo:{field:"utc",direction:"DESC"},lbcombodata:{gToken:{likethis:"really liked",beenhere:"have also been at"},wType:{7:"started a new trip",8:"filled up with fuel",9:"logged a camp spot",10:"filled up with water",11:"used a dump station",12:"found a wifi hot spot",13:"enjoyed the great outdoors",14:"visited a point of interest",15:"took a photo",16:"stayed at a hotel"}},initComponent:function(){this.addEvents("changeview");this.lbinitmarkercol();this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{getItemPhotoDiv:this.lbtplFunctions.getItemPhotoDiv,customDate:this.lbtplFunctions.customDate,getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){if(a.restype=="waypoints"){return"dbi-wpt-"+a.wtype}else{return"dbi-grp-"+a.restype}},getItemText:function(a){if(a.restype=="waypoints"){return a.logusername+" "+this.getComboData("wType",a.wtype)}else{return a.logusername+" "+this.getComboData("gToken",a.restype)+" "+a.sfield1}},getComboData:(function(b,a){return this.lbcombodata[b][a]}).createDelegate(this)});this.lbtpl.compile();this.lbStore=new Ext.data.JsonStore({url:this.lburl,baseParams:this.lbbaseparams,root:"results",fields:[{name:"restype"},{name:"swpid"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"loguserid"},{name:"logusername"},{name:"utc",type:"date",dateFormat:"U"},{name:"addutc",type:"date",convert:function(a,b){return new Date()}},{name:"wpid"},{name:"wtype"},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"},{name:"diffdist",type:"float"},{name:"sfield2"},{name:"sfield3"},{name:"sfield4"},{name:"sfield5"},{name:"sfield6"},{name:"sfield7"},{name:"ifield1"},{name:"ifield2"},{name:"ifield3"},{name:"ifield4"},{name:"ifield5"},{name:"ifield6"},{name:"ifield7"},{name:"ifield8"},{name:"ifield9"},{name:"ifield11"},{name:"ifield12"},{name:"ifield13"},{name:"ifield14"}],remoteSort:false,sortInfo:this.lbStoreSortInfo,listeners:{load:function(a,b){if(b.length>0&&this.lbmapmgr){this.lbmapmgr.addCollection(this.id,"swpid",a.getRange(),this.lbmarkercolconfig);if(this.lbautoload){this.lbautoload=false}else{this.lbmapmgr.setActiveCol(this.id)}}if(this.lbloadcallback){this.lbloadcallback(b)}},scope:this}});this.lbDataView=new Ext.DataView({store:this.lbStore,tpl:this.lbtpl,listeners:{render:function(a){},selectionchange:function(c,b){if(b.length>0){var a=b[0].id;if(this.lbmapmgr){this.lbmapmgr.colItemSelected(this.id,a.split("_")[1])}if(this.lbviewcallback){this.lbviewcallback(c.getSelectedRecords())}}},scope:this},multiSelect:false,singleSelect:true,overClass:"recentphoto-over",selectedClass:"recentphoto-sel",itemSelector:"div.recentphoto-wrap",emptyText:"",loadingText:"loading.."});Ext.apply(this,{items:this.lbDataView});if(this.lbmapmgr){this.lbmapmgr.on({mapmgrcolchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbDataView.clearSelections()}},mapmgritmchanged:function(c,d,a,b,f,e){if(this.id!=d){this.lbDataView.clearSelections()}else{this.lbDataView.select(this.id+"_"+a,false,true)}},mapmgrhidecol:function(b,a){if(this.id==a){this.lbDataView.clearSelections()}},scope:this})}Logabout.Demo.RecentPhotoPanel.superclass.initComponent.apply(this,arguments)},lbLoadData:function(b,a){this.lbStore.loadData(b,a)},onRender:function(){Logabout.Demo.RecentPhotoPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.UserComboPanel=Ext.extend(Ext.Panel,{lbInitialized:false,lbserviceto:null,lbonmenuitem:null,lbtplFunctions:null,lbmapmgr:null,lbtpl:null,lbtpldef:['<div class="bp-combopanel">','<tpl for=".">','<div class="bp-combopanel-wrap">','<tpl for="profile">','<div class="bp-combopanel-top">','<div class="bp-combopanel-pic-container">',"{[ this.getImgSrc(values.picPath,values.picWidth,values.picHeight,values.username) ]}","</div>",'<div class="bp-combopanel-name">',"{username}","</div>",'<div class="db-icon db-icon-go">','<span class="db-dv-linkitem db-li-showprofile">show profile<span class="db-dv-linkdata">{userid}_{username}</span></span>',"</div>","</div>","</tpl>","</div>","</tpl>","</div>"],lbtplHist:null,lbtplHistdef:['<div class="hist-main">','<tpl for=".">','<div class="hist-wrap hist-show-boxes">','<tpl for="hist">','<div class="hist-boxes">','<div class="hist-box hist-box-long">','<div class="hist-box-top">',"<span>points</span>","</div>",'<div class="hist-box-main">','<div class="hist-box-value">',"<span>{pntcnt}</span>","</div>","</div>",'<div class="hist-box-bot">','{[ this.plusMinus(values,"pntcntchg") ]}',"</div>","</div>",'<div class="hist-box hist-box-long">','<div class="hist-box-top">',"<span>rank</span>","</div>",'<div class="hist-box-main">','<div class="hist-box-value">',"<span>{pntrank}</span>","</div>","</div>",'<div class="hist-box-bot">',"</div>","</div>",'<div class="hist-box hist-box-long">','<div class="hist-box-top">',"<span>places</span>","</div>",'<div class="hist-box-main">','<div class="hist-box-value">',"<span>{fdrcnt}</span>","</div>","</div>",'<div class="hist-box-bot">','{[ this.plusMinus(values,"fdrcntchg") ]}',"</div>","</div>",'<div class="hist-box hist-box-long">','<div class="hist-box-top">',"<span>goals</span>","</div>",'<div class="hist-box-main">','<div class="hist-box-value">',"<span>{goccnt}</span>","</div>","</div>",'<div class="hist-box-bot">','{[ this.plusMinus(values,"goccntchg") ]}',"</div>","</div>",'<div class="hist-clear"></div>','<div class="hist-showmore">','<div class="db-icon db-icon-go db-dv-linkitem db-li-showcalcsum">see how points are calculated</div>',"</div>","</div>",'<div class="hist-calcsum">','<div class="hist-float-right x-tool x-tool-close"></div>','<div class="hist-clear"></div>','<div class="hist-calcsum-wrap">','<div class="hist-calcsum-title">','<span class="hist-calcsum-itm-val1"></span>','<span class="hist-calcsum-itm-val2">count</span>','<span class="hist-calcsum-itm-val3">points</span>',"</div>",'<div class="hist-calcsum-itm">','<span class="hist-calcsum-itm-val1">logs</span>','<span class="hist-calcsum-itm-val2">{wptcnt}</span>','<span class="hist-calcsum-itm-val3">{[ values.pntcnt - (values.fdrcnt * 50) - values.gocbonus - values.emailbonus - values.profilebonus]}</span>',"</div>",'<div class="hist-calcsum-itm">','<span class="hist-calcsum-itm-val1">places</span>','<span class="hist-calcsum-itm-val2">{fdrcnt}</span>','<span class="hist-calcsum-itm-val3">{[ values.fdrcnt * 50 ]}</span>',"</div>",'<div class="hist-calcsum-itm">','<span class="hist-calcsum-itm-val1">goals</span>','<span class="hist-calcsum-itm-val2">{goccnt}</span>','<span class="hist-calcsum-itm-val3">{[ values.gocbonus ]}</span>',"</div>",'<div class="hist-calcsum-itm">','<span class="hist-calcsum-itm-val1">email bonus</span>','<span class="hist-calcsum-itm-val2">{[ values.emailbonus > 0 ? 1 : 0 ]}</span>','<span class="hist-calcsum-itm-val3">{emailbonus}</span>',"</div>",'<div class="hist-calcsum-itm">','<span class="hist-calcsum-itm-val1">profile bonus</span>','<span class="hist-calcsum-itm-val2">{[ values.profilebonus > 0 ? 1 : 0 ]}</span>','<span class="hist-calcsum-itm-val3">{profilebonus}</span>',"</div>",'<div class="hist-calcsum-title">','<span class="hist-calcsum-itm-val1">total</span>','<span class="hist-calcsum-itm-val2"></span>','<span class="hist-calcsum-itm-val3">{pntcnt}</span>',"</div>","</div>",'<div class="hist-updated">','<tpl if="jobdatets != 0">','<tpl if="this.isOwner()">',"<span>updated: just now</span>","</tpl>",'<tpl if="!this.isOwner()">',"<span>updated: {[ this.customDate(this.convertDate(values.jobdatets),Date.patterns.FullDateTime) ]}</span>","</tpl>","</tpl>",'<tpl if="jobdatets == 0">',"<span>stats not updated. check back soon.</span>","</tpl>","</div>","</div>","</tpl>","</div>","</tpl>","</div>"],initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{customDate:this.lbtplFunctions.customDate,showPrivateData:(function(){var c=Number(this.lbprofileData.profile[0].profilePrivacy);if(this.lbcurrentprofileid==this.lbuid){return true}if(c==1){return true}if(c==2){for(var d=0;d<this.lbprofileData.friends.length;d++){if(this.lbprofileData.friends[d].userid==this.lbuid){return true}}}return false}).createDelegate((this)),isOwner:(function(){return this.lbcurrentprofileid==this.lbuid?true:false}).createDelegate(this),ownerName:(function(){return this.lbuname}).createDelegate(this),getComboData:(function(d,c){return this.lbcombodata[d][c][1]}).createDelegate(this),getImgSrc:(function(g,c,f,e,d){return this.lbProfilePicImg(g,c,f,e,d)}).createDelegate(this),showFriendAdd:(function(){for(var c=0;c<this.lbprofileData.friendrequests.length;c++){if(this.lbprofileData.friendrequests[c].userid==this.lbuid){return 2}}for(var c=0;c<this.lbprofileData.friends.length;c++){if(this.lbprofileData.friends[c].userid==this.lbuid){return 3}}return 1}).createDelegate(this),hasRequests:(function(){if(this.lbprofileData.friendrequests.length>0){return true}else{return false}}).createDelegate(this)});this.lbtpl.compile();this.lbtplHist=new Ext.XTemplate(this.lbtplHistdef.join(""),{customDate:this.lbtplFunctions.customDate,convertDate:function(c){return Date.parseDate(c,"U")},isOwner:(function(){return this.lbisowner}).createDelegate(this),plusMinus:function(d,c){if(d[c]>0){return'<span class="hist-box-week-plus">week: +'+d[c]+"</span>"}else{if(d[c]<0){return'<span class="hist-box-week-minus">week: '+d[c]+"</span>"}else{return'<span class="hist-box-week">week: no change</span>'}}}});this.lbtplHist.compile();this.lbProfilePicImg=function(f,g,d,i,h){var j="profile-pic";var e=null;var c=null;if(!f){f="blankpicplaceholder.jpg";if(h=="friend"){j+=" friend-picsize"}else{if(h=="findfriend"){j+=" findfriend-picsize"}else{j+=" bp-combopanel-picsize"}}}else{if(h=="friend"){e=55;c=55}else{if(h=="findfriend"){e=100;c=100}else{e=110;c=110}}}return'<img class="'+j+'"'+(e!=null?" width="+e.toFixed(0)+" height="+c.toFixed(0)+" ":"")+' title="'+i+'" alt="'+i+' picture" src="'+Logabout.Defs.pPicFilePath+f+'"/>'};this.lbMenuHandler=function(d,c,e,f,g){switch(d){case"aT":Logabout.Bridgeport.trackEvent("usercombo","newTrip","click");Logabout.Bridgeport.newTrip();break;case"aW":Logabout.Bridgeport.trackEvent("usercombo","newWaypoint","click");Logabout.Bridgeport.newWaypoint(true);break;case"newWiz":Logabout.Bridgeport.trackEvent("usercombo","newWiz","click");Logabout.Bridgeport.newWizWaypoint(true);break;case"newWizDecide":if(this.lbguestmode){Logabout.Bridgeport.trackEvent("usercombo","newWiz","click");Logabout.Bridgeport.newWizWaypoint(true)}else{Logabout.Bridgeport.trackEvent("usercombo","newWaypoint","click");Logabout.Bridgeport.newWaypoint(true)}break}};this.sendDoWaypointSavedEvToUserWptPanel=function(c){Ext.getCmp(this.id+"_usertwpanel").do_waypointsaved(c)};this.sendDoWaypointCancelledEvToUserWptPanel=function(){Ext.getCmp(this.id+"_usertwpanel").do_waypointcancelled()};this.lbShowWizardEditPanel=function(){this.getLayout().setActiveItem(3);if(!this.EditWizPanel){this.EditWizPanel=new Logabout.Demo.UserEditPanel.Wizard(Ext.copyTo(Ext.apply({id:"editwizardpanelx",lbstandardconfig:this.lbstandardconfig},this.lbeditpanelconfig),this,"lbWidth,lbHeight,lbguestmode,lbuid,lbusername"));this.EditWizPanel.on({waypointsaved:function(c){this.lbUserComboDynamiCfg.lbvieweditmode="view";this.getLayout().setActiveItem(0);this.sendDoWaypointSavedEvToUserWptPanel(c);Logabout.Bridgeport.lbShowHelpTip("your new log point was saved",null,5);this.lbsignalController.fireEvent("waypointsaved",c)},waypointcancelled:function(){this.getLayout().setActiveItem(0);this.lbUserComboDynamiCfg.lbvieweditmode="view";this.sendDoWaypointCancelledEvToUserWptPanel();Logabout.Bridgeport.lbShowHelpTip("the log point was cancelled",null,3);this.lbsignalController.fireEvent("waypointcancelled",this)},changewaypointeditmode:function(c,d){if(d=="edit"){this.lbShowEditPanel()}},afterlayout:function(c,d){this.getLayout().setActiveItem(2)},scope:this});Ext.getCmp(this.id+"_wptcomboWIZeditcontainer").add(this.EditWizPanel);Ext.getCmp(this.id+"_wptcomboWIZeditcontainer").doLayout(false,true)}else{this.getLayout().setActiveItem(2)}if(this.lbUserEditDyanmiCfg.pSwpid){this.EditWizPanel.loadExistingRecord(this.lbUserEditDyanmiCfg.pSwpid)}else{if(this.lbUserEditDyanmiCfg.inCenter===true){this.EditWizPanel.loadNewRecord({totalrows:1,results:[{dsrc:"2",utc:new Date().format("U").toString(),tsect:(this.lbUserEditDyanmiCfg.tsect?this.lbUserEditDyanmiCfg.tsect:Logabout.Defs.defGrpTsect.toString()),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),lng:Number(this.lbmapmgr.getMapCenterInCustomLatLng().lng).toFixed(6),lat:Number(this.lbmapmgr.getMapCenterInCustomLatLng().lat).toFixed(6),tripname:(this.lbUserEditDyanmiCfg.tripname?this.lbUserEditDyanmiCfg.tripname:"Default Trip"),wpid:"0",wtype:"9",sfield1:"Camp #"+new Date().format("ymd-hi").toString(),ifield12:true}]})}else{if(this.lbUserEditDyanmiCfg.inCenter.lat&&this.lbUserEditDyanmiCfg.inCenter.lng){this.EditWizPanel.loadNewRecord({totalrows:1,results:[{dsrc:"2",utc:new Date().format("U").toString(),tsect:(this.lbUserEditDyanmiCfg.tsect?this.lbUserEditDyanmiCfg.tsect:Logabout.Defs.defGrpTsect.toString()),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),lng:Number(this.lbUserEditDyanmiCfg.inCenter.lng).toFixed(6),lat:Number(this.lbUserEditDyanmiCfg.inCenter.lng.lat).toFixed(6),tripname:(this.lbUserEditDyanmiCfg.tripname?this.lbUserEditDyanmiCfg.tripname:"Default Trip"),wpid:"0",wtype:"9",sfield1:"Camp #"+new Date().format("ymd-hi").toString(),ifield12:true}]})}else{this.EditWizPanel.loadNewRecord()}}}};this.lbShowEditPanel=function(){this.getLayout().setActiveItem(3);if(!this.EditPanel){this.EditPanel=new Logabout.Demo.UserEditPanel.Vicinity(Ext.copyTo(Ext.apply({id:"editpanelx",lbstandardconfig:this.lbstandardconfig},this.lbeditpanelconfig),this,"lbWidth,lbHeight,lbguestmode,lbuid,lbusername"));this.EditPanel.on({waypointsaved:function(c){this.lbUserComboDynamiCfg.lbvieweditmode="view";this.getLayout().setActiveItem(0);this.switchUserTab("waypoints");this.sendDoWaypointSavedEvToUserWptPanel(c);this.lbsignalController.fireEvent("waypointsaved",c)},quicklogupdatesaved:function(d,e,c){this.lbUserComboDynamiCfg.lbvieweditmode="view";this.getLayout().setActiveItem(0)},waypointcancelled:function(){this.getLayout().setActiveItem(0);this.lbUserComboDynamiCfg.lbvieweditmode="view";this.sendDoWaypointCancelledEvToUserWptPanel();Logabout.Bridgeport.lbShowHelpTip("new place add cancelled",null,3);this.lbsignalController.fireEvent("waypointcancelled",this)},changewaypointeditmode:function(c,d){if(d=="wizard"){this.lbShowWizardEditPanel()}},afterlayout:function(c,d){this.getLayout().setActiveItem(1)},scope:this});Ext.getCmp(this.id+"_wptcomboeditcontainer").add(this.EditPanel);Ext.getCmp(this.id+"_wptcomboeditcontainer").doLayout(false,true)}else{this.getLayout().setActiveItem(1)}if(this.lbUserEditDyanmiCfg.pSwpid){this.EditPanel.loadExistingRecord(this.lbUserEditDyanmiCfg.pSwpid)}else{if(this.lbUserEditDyanmiCfg.inCenter===true){this.EditPanel.loadNewRecord({totalrows:1,results:[{dsrc:"2",utc:new Date().format("U").toString(),tsect:(this.lbUserEditDyanmiCfg.tsect?this.lbUserEditDyanmiCfg.tsect:Logabout.Defs.defGrpTsect.toString()),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),lng:Number(this.lbmapmgr.getMapCenterInCustomLatLng().lng).toFixed(6),lat:Number(this.lbmapmgr.getMapCenterInCustomLatLng().lat).toFixed(6),tripname:(this.lbUserEditDyanmiCfg.tripname?this.lbUserEditDyanmiCfg.tripname:"Default Trip"),wpid:"0",wtype:"9",sfield1:"Camp #"+new Date().format("ymd-hi").toString(),ifield12:true}]})}else{if(this.lbUserEditDyanmiCfg.inCenter.lat&&this.lbUserEditDyanmiCfg.inCenter.lng){this.EditPanel.loadNewRecord({totalrows:1,results:[{dsrc:"2",utc:new Date().format("U").toString(),tsect:(this.lbUserEditDyanmiCfg.tsect?this.lbUserEditDyanmiCfg.tsect:Logabout.Defs.defGrpTsect.toString()),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),lng:Number(this.lbUserEditDyanmiCfg.inCenter.lng).toFixed(6),lat:Number(this.lbUserEditDyanmiCfg.inCenter.lng.lat).toFixed(6),tripname:(this.lbUserEditDyanmiCfg.tripname?this.lbUserEditDyanmiCfg.tripname:"Default Trip"),wpid:"0",wtype:"9",sfield1:"Camp #"+new Date().format("ymd-hi").toString(),ifield12:true}]})}else{this.EditPanel.loadNewRecord()}}}};this.lbUserListsInitialized={hist:false,waypoints:false,favorite:false,places:false};this.userListsHandler=function(e){if(this.lbInitialized){var d=e.split("_")[2];if(this.lbUserListsInitialized[d]==false||this.lbUserComboDynamiCfg.lbforcerefresh){this.lbUserComboDynamiCfg.lbforcerefresh=false;if(d=="waypoints"){Ext.getCmp(this.id+"_usertwpanel").lbLoadWith(this.lbUserWaypointPanelDynamiCfg);this.lbUserWaypointPanelDynamiCfg=null}else{if(d=="hist"){var g=5}else{Ext.getCmp(e).lbLoadData(null,null,null,{params:{start:0,limit:7}})}}this.lbUserListsInitialized[d]=true}else{if(d=="waypoints"){Ext.getCmp(this.id+"_usertwpanel").lbActivateCurentMarkerCol()}else{if(d=="hist"){var f=5}else{this.lbmapmgr.setActiveCol(e)}}}}else{var c=555}};this.setDynamicCfg=function(c){this.lbUserComboDynamiCfg=Ext.copyTo({},c,"lbvieweditmode,lbonmenuitem,lbforcerefresh");this.lbUserEditDyanmiCfg=Ext.apply({},c.lbeditobj);this.lbUserWaypointPanelDynamiCfg=Ext.copyTo({},c,"lbautoload,lbmode,lbtripname,lbtsect,lbinitloadcallback")};this.switchUserTab=function(c){Ext.getCmp(this.id+"_userp-tabpanel").setActiveTab(this.id+"_tab_"+c)};this.lbsignalc_menuitemchange_hdlr=function(d,c,e){if(c==this.lbserviceto){if(e){this.setDynamicCfg(e)}if(this.lbUserComboDynamiCfg.lbvieweditmode=="edit"){if(!this.lbInitialized){this.lbLoadBase(this.lbuid,function(){this.lbShowEditPanel()})}else{this.lbShowEditPanel()}}else{if(this.lbUserComboDynamiCfg.lbvieweditmode=="wizard"){if(!this.lbInitialized){this.lbLoadBase(this.lbuid,function(){this.lbShowWizardEditPanel()})}else{this.lbShowWizardEditPanel()}}else{this.getLayout().setActiveItem(0);if(!this.lbInitialized){this.lbLoadBase(this.lbuid,function(){if(Ext.getCmp(this.id+"_userp-tabpanel").getActiveTab().id==this.id+"_tab_"+this.lbUserComboDynamiCfg.lbonmenuitem.showtab){this.userListsHandler(this.id+"_"+this.lbUserComboDynamiCfg.lbonmenuitem.showtab)}else{this.switchUserTab(this.lbUserComboDynamiCfg.lbonmenuitem.showtab)}})}else{if(Ext.getCmp(this.id+"_userp-tabpanel").getActiveTab.id==this.id+"_tab_"+this.lbUserComboDynamiCfg.lbonmenuitem.showtab){this.userListsHandler(this.id+"_"+this.lbUserComboDynamiCfg.lbonmenuitem.showtab)}else{this.switchUserTab(this.lbUserComboDynamiCfg.lbonmenuitem.showtab)}}}}}};this.lbsignalc_groupitemdeleted_hdlr=function(e,d){if(!this.isVisible()){return}var c=Ext.getCmp(this.id+"_userp-tabpanel").getActiveTab().id;if(c==this.id+"_tab_"+d){Ext.getCmp(this.id+"_"+d).lbLoadData(null,null,null,{params:{start:0,limit:7}})}};this.lbsignalc_waypointdeleted_hdlr=function(c,d){Ext.getCmp(this.id+"_usertwpanel").do_waypointdeleted(c,d)};this.lbsignalController.on("menuitemchange",this.lbsignalc_menuitemchange_hdlr,this);this.lbsignalController.on("groupitemdeleted",this.lbsignalc_groupitemdeleted_hdlr,this);this.lbsignalController.on("waypointdeleted",this.lbsignalc_waypointdeleted_hdlr,this);this.lbsignalc_userstatsupdated_hdlr=function(d,e,c){if(this.lbInitialized){if(e==this.lbuid){this.lbUpdateHistoryCompetitorWithPoints(c)}}};this.lbsignalController.on("userstatsupdated",this.lbsignalc_userstatsupdated_hdlr,this);this.lbsignalc_userpicupdated_hdlr=function(c){if(this.lbInitialized&&parseInt(c.lbluid)==this.lbuid){this.lbUpdateProfilePic(c)}};this.lbsignalController.on("userpicupdated",this.lbsignalc_userpicupdated_hdlr,this);this.on({beforedestroy:function(c){this.lbsignalController.un("menuitemchange",this.lbsignalc_menuitemchange_hdlr,this);this.lbsignalController.un("groupitemdeleted",this.lbsignalc_groupitemdeleted_hdlr,this);this.lbsignalController.un("waypointdeleted",this.lbsignalc_waypointdeleted_hdlr,this);this.lbsignalController.un("userstatsupdated",this.lbsignalc_userstatsupdated_hdlr,this);this.lbsignalController.un("userpicupdated",this.lbsignalc_userpicupdated_hdlr,this)},scope:this});var b=150;var a=this.lbWidth-b;Ext.apply(this,{layout:"card",activeItem:3,width:this.lbWidth,height:this.lbHeight,border:false,items:[{layout:"absolute",width:this.lbWidth,height:this.lbHeight,x:0,y:0,border:false,items:[{xtype:"panel",id:this.id+"_userp-combopanel",ref:"/orefProfile",width:b,height:this.lbHeight-40,x:0,y:0,border:false,html:"loading...",listeners:{afterrender:function(c){c.body.on("click",function(f,e){var d=Ext.get(e.id).child(".db-dv-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(d[0],d[1]);Logabout.Bridgeport.trackEvent("usercombo","showprofile","click")},this,{delegate:".db-li-showprofile"})},scope:this}},{xtype:"button",ref:"/orefButAdd",height:30,width:b-50,x:10,y:this.lbHeight-40,text:"Add Place",tooltip:"Add or Log a place",iconCls:"icon-add",iconAlign:"left",cls:"db-button",disabled:!this.lbisowner,handler:this.lbMenuHandler.createDelegate(this,["newWizDecide"])},{xtype:"tabpanel",id:this.id+"_userp-tabpanel",width:a,height:this.lbHeight,x:b,y:0,border:false,activeTab:0,plain:true,deferredRender:false,cls:"bp-combopanel-usertab",items:[{title:"stats",id:this.id+"_tab_hist",listeners:{activate:this.userListsHandler.createDelegate(this,[this.id+"_hist"]),scope:this},layout:"absolute",items:[{xtype:"panel",ref:"///orefRank",border:false,height:200,width:300,x:0,y:0,html:{tag:"div",cls:"intro-points-main",children:[{tag:"div",cls:"intro-points-title",html:"points this session"},{tag:"div",cls:"intro-points-value",html:"0"}]},listeners:{afterrender:function(c){c.body.on("click",function(e,d){c.body.child(".hist-wrap").replaceClass("hist-show-boxes","hist-show-calcsum")},this,{delegate:".db-li-showcalcsum"});c.body.on("click",function(e,d){c.body.child(".hist-wrap").replaceClass("hist-show-calcsum","hist-show-boxes")},this,{delegate:".x-tool-close"})},scope:this}},new Logabout.Demo.MemoryPanel.UserCompetitors({ref:"///orefCompetitors",lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbuid:this.lbuid,border:false,height:200,width:a-300,x:300,y:0,lbusepager:false,lbpagesize:7})]},{title:"logs",id:this.id+"_tab_waypoints",listeners:{activate:this.userListsHandler.createDelegate(this,[this.id+"_waypoints"]),scope:this},layout:"absolute",items:[new Logabout.Demo.UserWaypointPanel(Ext.apply({width:811,height:230,x:0,y:0,id:this.id+"_usertwpanel",border:false},this.lbuserpanelconfig))]},{title:"favorites",id:this.id+"_tab_favorite",listeners:{activate:this.userListsHandler.createDelegate(this,[this.id+"_favorite"]),scope:this},items:[new Logabout.Demo.MemoryPanel.UserFavorite({id:this.id+"_favorite",width:a,height:this.lbHeight-28,border:false,lbshowtitlebar:false,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"userlistdata",uid:this.lbuid,usepager:true,grouptokenlist:Ext.util.JSON.encode(["favorite"]),browserts:new Date().format("U")},lbisowner:this.lbisowner,lbguestmode:this.lbguestmode,lbusepager:true,lbpagesize:7})]},{title:"places",id:this.id+"_tab_places",listeners:{activate:this.userListsHandler.createDelegate(this,[this.id+"_places"]),scope:this},items:[new Logabout.Demo.MemoryPanel.UserFounded({id:this.id+"_places",width:a,height:this.lbHeight-28,border:false,lbshowtitlebar:false,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"userfoundedwptlist",uid:this.lbuid,browserts:new Date().format("U")},lbusepager:true,lbpagesize:7})]}]}]},{layout:"absolute",id:this.id+"_wptcomboeditcontainer",width:this.lbWidth,height:this.lbHeight,border:false},{layout:"absolute",id:this.id+"_wptcomboWIZeditcontainer",width:this.lbWidth,height:this.lbHeight,border:false},{border:false,html:'<div class="db-loading-indicator db-loading-indicator-usercombo">loading</div>'}]});Logabout.Demo.UserComboPanel.superclass.initComponent.apply(this,arguments)},lbLoadBase:function(a,b){if(this.lbisowner){this.lbprofileData=Logabout.Bridgeport.usercomboresults.results;this.lbcurrentprofileid=a;this.lbApplyTemplates();this.lbInitialized=true;b.createDelegate(this)()}else{Ext.Ajax.request({url:this.lburl,params:{task:"userinitandcombodata",uid:a,sesstoken:this.lbdsess,sort:"utc",dir:"DESC",start:0,limit:50,wtype:9,tsect:"200805100101",browserts:new Date().format("U")},callback:function(d,f,c){this.setDisabled(false);if(f){var e=Ext.util.JSON.decode(c.responseText);if(e.error){Ext.MessageBox.alert("Error",e.error)}else{this.lbprofileData=e.results;this.lbcurrentprofileid=a;this.lbApplyTemplates();this.lbInitialized=true;b.createDelegate(this)()}}else{Ext.MessageBox.alert("Unknown Error","An unknown error occured while attempting to delete data, please contact a system administrator.")}},scope:this})}},lbUpdateProfilePic:function(a){this.lbprofileData.profile[0].picHeight=a.picHeight;this.lbprofileData.profile[0].picWidth=a.picWidth;this.lbprofileData.profile[0].picPath=a.picPath;this.lbApplyTemplates()},lbUpdateHistoryCompetitorWithPoints:function(a){Ext.apply(this.lbprofileData.hist[0],a);var b=null;Ext.each(this.lbprofileData.competitors,function(e,c,d){if(parseInt(e.loguserid)==this.lbuid){b=e}},this);if(b!=null){Ext.apply(b,a)}this.lbSortCompetitors()},lbSortCompetitors:function(){var b=null;var a=null;Ext.each(this.lbprofileData.competitors,function(e,c,d){if(parseInt(e.loguserid)==this.lbuid){b=e}if(a==null){a=e.pntrank}if(e.pntrank<a){a=e.pntrank}},this);this.lbprofileData.competitors.sort(function(d,c){if(parseInt(d.pntcnt)>parseInt(c.pntcnt)){return -1}else{if(parseInt(d.pntcnt)<parseInt(c.pntcnt)){return 1}else{return 0}}});Ext.each(this.lbprofileData.competitors,function(e,c,d){e.pntrank=a;a++},this);this.lbprofileData.hist[0].pntrank=b.pntrank;this.lbApplyTemplates()},lbApplyTemplates:function(){this.orefProfile.body.update(this.lbtpl.applyTemplate(this.lbprofileData));this.orefProfile.body.select(".db-dv-linkitem.db-li-showprofile").addClassOnOver("db-dv-linkover");if(this.lbprofileData.hist.length==0){this.orefRank.body.update("this user's stats have not updated. check back soon.")}else{this.orefRank.body.update(this.lbtplHist.applyTemplate(this.lbprofileData));this.orefRank.body.select(".x-tool-close").addClassOnOver("x-tool-close-over");this.orefRank.body.select(".db-li-showcalcsum").addClassOnOver("db-dv-linkover")}var a=null;Ext.each(this.lbprofileData.competitors,function(d,b,c){if(parseInt(d.loguserid)==this.lbuid){a=d;return false}},this);if(a!=null){this.orefCompetitors.lbSetOwnerVals({pnts:parseInt(a.pntcnt)});this.orefCompetitors.lbLoadData({totalrows:this.lbprofileData.competitors.length,results:this.lbprofileData.competitors},false,false)}},onRender:function(){Logabout.Demo.UserComboPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.UserWaypointPanel=Ext.extend(Ext.Panel,{lbInitialized:false,autoScroll:true,lbuid:null,lbusername:null,lbdsess:null,lbisowner:null,lbmode:null,lbguestmode:false,lbautoload:null,lbtsect:null,lbtripname:null,lbinitdate:null,lbdate:null,lbpagesize:10,lbmapmgr:null,lburl:null,lbtimeout:null,lbsignalController:null,lbinitloadcallback:null,lbonceloaded:false,lbtpl:null,lbtpldef:['<tpl if="this.getDebugUser()">','<div class="user-isdebug">',"</tpl>",'<tpl if="!this.getDebugUser()">','<div class="user-isnormal">',"</tpl>",'<div class="user-header">','<div class="user-header-text">{[ this.showHeader() ]}</div>',"</div>",'<div class="user-viewlist">','<tpl for=".">','<tpl if="!this.isTrip()">','<div id="user_{swpid}_{[this.getCompTemplateId()]}" class="user-waypoint user-wrap">','<div class="user-sct-top bp-user-ico {[ this.getItemIconClass(values) ]}">','<div class="user-sct-text">','<div class="user-name">{[ fm.ellipsis(values.sfield1,32) ]}</div>',"</div>",'<div class="user-sct-date">','<div class="user-date">{[ this.customDate(values.utc) ]}</div>',"</div>",'<div class="user-sct-bullets">','<tpl if="sfield8 != null">','<div class="user-bullet">','<img src="{[ this.getBulletPath() ]}camera_small.png"></img>',"</div>","</tpl>",'<tpl if="ifield12 &gt; 0">','<div class="user-bullet">','<img src="{[ this.getBulletPath() ]}bullet_feed.png"></img>',"</div>","</tpl>",'<tpl if="mtype == 1">','<div class="user-bullet">','<img src="{[ this.getBulletPath() ]}award_star_gold_1.png"></img>',"</div>","</tpl>",'<tpl if="this.getDebugUser()">','<div class="user-masterslave-test">',"<span>s {swpid}</span>","</div>",'<div class="user-masterslave-test">',"<span>t {mtype}</span>","</div>",'<div class="user-masterslave-test">',"<span>m {mswpid}</span>","</div>","</tpl>",'<tpl if="ifield13 &gt; 0">','<div class="user-points">',"<span>{ifield13}</span>","</div>","</tpl>",'<div class="user-clear"></div>',"</div>",'<tpl if="this.isOwner() && !this.isGuest()">','<div class="user-sct-more">','<div class="user-linkitem user-li-formore">options..<div class="user-linkdata">user_{swpid}_{[this.getCompTemplateId()]}</div></div>',"</div>",'<div class="user-clear"></div>',"</tpl>",'<div class="user-clear"></div>',"</div>",'<tpl if="this.isOwner() && !this.isGuest()">','<div class="user-sct-commands">','<div class="user-linkitem user-li-edit">edit<div class="user-linkdata">{swpid}</div></div>','<div class="user-linkitem user-li-delete">delete<div class="user-linkdata">{swpid}</div></div>','<tpl if="this.getDebugUser()">','<div class="user-linkitem user-li-show">show<div class="user-linkdata">{swpid}</div></div>',"</tpl>",'<tpl if="this.getDebugUser()">','<div class="user-linkitem user-li-debugshow">debug show<div class="user-linkdata">{swpid}_{mswpid}</div></div>',"</tpl>","</div>","</tpl>",'<div class="user-clear"></div>',"</div>","</tpl>",'<tpl if="this.isTrip()">','<div id="user_{swpid}_{[this.getCompTemplateId()]}" class="user-trip user-wrap">','<div class="user-sct-left bp-user-ico {[ this.getItemIconClass(values) ]}">','<div class="user-name">{[ fm.ellipsis(values.sfield1,35) ]}</div>','<div class="user-date">{wptcount} log(s)</div>','<div class="user-clear"></div>',"</div>",'<div class="user-sct-right">','<div class="user-linkitem user-li-fortrip">show trip<div class="user-linkdata">{tsect}_{sfield1}_{loguserid}</div></div>','<tpl if="this.isOwner() && !this.isGuest()">','<div class="user-linkitem user-li-formore">options..<div class="user-linkdata">user_{swpid}_{[this.getCompTemplateId()]}</div></div>',"</tpl>","</div>",'<div class="user-clear"></div>','<tpl if="this.isOwner() && !this.isGuest()">','<div class="user-sct-commands">','<div class="user-date">last on {[ this.customDate(values.maxutc,Date.patterns.LbLong) ]}</div>','<div class="user-linkitem user-li-edit">edit<div class="user-linkdata">{swpid}</div></div>','<div class="user-linkitem user-li-delete">delete<div class="user-linkdata">{swpid}</div></div>',"</div>","</tpl>",'<div class="user-clear"></div>',"</div>","</tpl>","</tpl>","</div>","</div>"],lbtplFunctions:null,setMode:function(b){Ext.apply(this,b);if(this.lbmode==null){this.lbmode="alldates"}var a={task:"waypointsforuserpanel",uid:this.lbuid,sesstoken:this.lbdsess,wtypelist:Ext.util.JSON.encode(this.lbfilterlist)};var c={start:0,limit:this.lbpagesize};switch(this.lbmode){case"ondate":a.userdatets=(this.lbdate/1000).toFixed(0);break;case"alldates":break;case"alltrips":a.wtype=7;break;case"fortrip":a.tsect=this.lbtsect;break}this.lbStore.baseParams=a;this.lbStore.load({params:c})},filterWtypeListMod:function(b,a){var c=new Array();if(b.itemId=="FilterClear"){this.FilterChecks.menu.items.each(function(d){d.setChecked(false,true)});this.FilterClear.setDisabled(true)}else{this.FilterChecks.menu.items.each(function(d){if(d.checked){c.push(Number(d.itemId.split("-")[1]))}})}if(c.length>0){this.FilterClear.setDisabled(false)}this.setMode({lbmode:this.lbmode,lbtsect:this.lbtsect,lbtripname:this.lbtripname,lbdate:this.lbdate,lbfilterlist:c});Logabout.Bridgeport.trackEvent("userwaypoint","filter","wtype: ")},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.lbtpl=new Ext.XTemplate(this.lbtpldef.join(""),{customDate:this.lbtplFunctions.customDate,getDebugUser:this.lbtplFunctions.getDebugUser,wpthash:this.lbtplFunctions.wpthash,getIconPath:this.lbtplFunctions.getIconPath,getBulletPath:this.lbtplFunctions.getBulletPath,getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},showHeader:(function(){var a="header";switch(this.lbmode){case"ondate":a="Logs on "+this.lbtplFunctions.customDate(new Date(this.lbdate),Date.patterns.LbShort);break;case"alldates":a="Recently Logged";break;case"alltrips":a="Trip List";break;case"fortrip":if(this.lbtripname){a=this.lbtripname}else{a="Recent Trip"}break}return a}).createDelegate(this),showLinks:(function(){var a="links";switch(this.lbmode){case"ondate":a='<div class="user-linkitem user-li-alldates">view all</div>';a+='<div class="user-linkitem user-li-alltrips">view trip list</div>';break;case"alldates":a='<div class="user-linkitem user-li-alltrips">view trip list</div>';break;case"alltrips":a='<div class="user-linkitem user-li-alldates">view recent logs</div>';break;case"fortrip":a='<div class="user-linkitem user-li-alltrips">view trip list</div>';break}a+='<div class="user-clear"></div>';return a}).createDelegate(this),isTrip:(function(){if(this.lbmode=="alltrips"){return true}else{return false}}).createDelegate(this),isOwner:(function(){return this.lbisowner}).createDelegate(this),isGuest:(function(){return this.lbguestmode}).createDelegate(this),showCompPart:(function(a){return this[a]}).createDelegate(this),getCompTemplateId:(function(){return this.id}).createDelegate(this)});this.lbtpl.compile();this.lbmarkercolconfigs={waypoint:{polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:true,panOnClick:false,colzoomlevel:99,useTabMarker:true,polyMasterShow:false,infoCallBackFunc:Logabout.Defs.TemplatesMarkerTabUserWay.infoCallBackFunc,markerTemplateDef:Logabout.Defs.TemplatesMarkerTabUserWay.markerTemplateDef,markerTemplateFunctions:{getMarkerSize:function(){return"db-mrk-standardsize"},customDate:this.lbtplFunctions.customDate,getDetail:this.lbtplFunctions.getDetail,isOwner:(function(){return this.lbisowner}).createDelegate(this),isGuest:(function(){return this.lbguestmode}).createDelegate(this),getPhotoSrc:function(b){if(!b.ifield10||!b.sfield8){return false}var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return a},getItemIconClass:function(a){return"dbi-wpt-"+a.wtype}}},trip:{polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showProfile(a[0],a[1]);Logabout.Bridgeport.trackEvent("userwaypoint","MRKtripshowprofile","click")},this);Ext.select(".db-mrk-linkitem.db-li-showtrip",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showUserPanel(a[0],a[1],a[2],null,"fortrip",false,a[3]);Logabout.Bridgeport.trackEvent("userwaypoint","MRKtripshowtrip","click")},this)},markerTemplateDef:['<tpl for=".">','<tpl if="description == null">','<div class="db-mrk-tripshort">',"</tpl>",'<tpl if="description != null">','<div class="db-mrk-triplong">',"</tpl>",'<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,35)]}</div>','<div class="db-mrk-detailblock">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showtrip">show trip<span class="db-mrk-linkdata">{loguserid}_{logusername}_{tsect}_{sfield1}</span></span>',"</div>",'<div class="db-mrk-itm db-icon db-icon-userblue">','{logusername} - <span class="db-mrk-linkitem db-li-showprofile">view profile<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="db-mrk-itm db-icon db-icon-clock">{[ this.customDate(values.utc,Date.patterns.LbLong)]}</div>','<tpl if="description != null">','<div class="db-mrk-desc">',"{[ fm.ellipsis(values.description,160) ]}","</div>","</tpl>","</div>","</div>","</tpl>"],markerTemplateFunctions:this.lbtplFunctions}};this.lbdataviewcallback=function(){this.lbDataView.getEl().select(".user-waypoint .user-li-edit",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.editWaypoint(a);Logabout.Bridgeport.trackEvent("userwaypoint","DVeditwpt","click")});this.lbDataView.getEl().select(".user-waypoint .user-li-delete",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteWaypoint(a);Logabout.Bridgeport.trackEvent("userwaypoint","DVdeletewpt","click")});this.lbDataView.getEl().select(".user-waypoint .user-li-show",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.zoomWptDetail(a,null,null,true);Logabout.Bridgeport.trackEvent("userwaypoint","DVzoomdetail","click")});this.lbDataView.getEl().select(".user-waypoint .user-li-debugshow",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.showADTestMasterSlaveDebug(a[0],a[1]);Logabout.Bridgeport.trackEvent("userwaypoint","DVdebugshow","click")});this.lbDataView.getEl().select(".user-waypoint .user-li-formore",true).addClassOnOver("user-linkover").on("click",function(d,c){this.lbDataView.getEl().select(".user-waypoint.user-wrap.expanded").each(function(e){e.shift({height:25})},this);var a=Ext.get(c.id).child(".user-linkdata",true).firstChild.nodeValue;var b=Ext.get(a);b.radioClass("expanded").shift({height:45})},this);this.lbDataView.getEl().select(".user-trip .user-li-fortrip",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue.split("_");this.setMode({lbmode:"fortrip",lbtsect:a[0],lbtripname:a[1],lbdate:null});Logabout.Bridgeport.trackEvent("userwaypoint","DVsetmode","fortrip")},this);this.lbDataView.getEl().select(".user-trip .user-li-edit",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.editTrip(a);Logabout.Bridgeport.trackEvent("userwaypoint","DVedittrip","click")});this.lbDataView.getEl().select(".user-trip .user-li-delete",true).addClassOnOver("user-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".user-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.deleteTrip(a);Logabout.Bridgeport.trackEvent("userwaypoint","DVdeletetrip","click")});this.lbDataView.getEl().select(".user-trip .user-li-formore",true).addClassOnOver("user-linkover").on("click",function(d,c){this.lbDataView.getEl().select(".user-trip.user-wrap.expanded").each(function(e){e.shift({height:28})},this);var a=Ext.get(c.id).child(".user-linkdata",true).firstChild.nodeValue;var b=Ext.get(a);b.radioClass("expanded").shift({height:53})},this)};this.lbStore=new Ext.data.JsonStore({proxy:new Ext.data.HttpProxy({url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel}),baseParams:{task:"waypointsforuserpanel",uid:this.lbuid,sesstoken:this.lbdsess},root:"results",totalProperty:"totalrows",fields:Logabout.Defs.FullRecDef.concat([{name:"wptcount",type:"int",convert:function(a,b){return b.wptcount}},{name:"maxutc",type:"date",convert:function(a,b){if(b.maxutc){return Date.parseDate(b.maxutc,"U")}else{return null}}},{name:"show_uname",type:"int",defaultValue:1},{name:"show_date",type:"int",defaultValue:1},{name:"show_dist",type:"int",defaultValue:0},{name:"show_detailfavorite",type:"int",defaultValue:1},{name:"show_quicklog",type:"int",defaultValue:0},{name:"show_datalog",type:"int",defaultValue:1},{name:"show_editcontrols",type:"int",defaultValue:1},{name:"me_isowner",type:"boolean",convert:(function(a){return this.lbisowner}).createDelegate(this)},{name:"me_isguest",type:"boolean",convert:(function(a){return this.lbguestmode}).createDelegate(this)}]),remoteSort:true,sortInfo:{field:"utc",direction:"DESC"},listeners:{beforeload:function(a,b){b.params.browserts=new Date().format("U")},loadexception:function(a,b){this.lbsignalController.logSignalErr(this.id,1);Ext.Msg.show({title:"Load Error for user "+this.lbusername,msg:"Please click OK to try again",buttons:Ext.Msg.OK,fn:function(c){if(c=="ok"){this.lbStore.reload()}},scope:this,icon:Ext.MessageBox.ERROR})},load:function(a,c,b){this.lbsignalController.logSignalClear(this.id);if(this.lbdataviewcallback){this.lbdataviewcallback()}switch(this.lbmode){case"ondate":this.lbSBTN.setIconClass("icon-up");this.lbSBTN.setText("Trips");break;case"alldates":this.lbSBTN.setIconClass("icon-up");this.lbSBTN.setText("Trips");break;case"alltrips":this.lbSBTN.setIconClass("icon-show");this.lbSBTN.setText("Recently");break;case"fortrip":this.lbSBTN.setIconClass("icon-up");this.lbSBTN.setText("Trips");break}if(c.length>0){this.lbmapmgr.refreshAdd(this.id+"_"+this.lbmode+"_"+this.lbtsect,"swpid",a.getRange(),(this.lbmode=="alltrips"?this.lbmarkercolconfigs.trip:this.lbmarkercolconfigs.waypoint));if(this.lbautoload){this.lbautoload=false}else{if(b.params.targetSwpid){this.lbDataView.select("user_"+b.params.targetSwpid+"_"+this.id,false,false);b.params.targetSwpid=null}else{this.lbmapmgr.colItemSelected(this.id+"_"+this.lbmode+"_"+this.lbtsect,c[0].data.swpid)}}if(this.lbinitloadcallback){this.lbinitloadcallback();this.lbinitloadcallback=null}this.lbonceloaded=true}},scope:this}});this.lbDataView=new Ext.DataView({width:500,height:230,x:0,y:0,store:this.lbStore,tpl:this.lbtpl,listeners:{render:function(a){},selectionchange:function(c,b){if(b.length>0){var a=b[0].id;this.lbmapmgr.colItemSelected(this.id+"_"+this.lbmode+"_"+this.lbtsect,a.split("_")[1])}},scope:this},multiSelect:false,singleSelect:true,overClass:"user-over",selectedClass:"user-sel",itemSelector:"div.user-wrap",emptyText:"no logs found",loadingText:"loading..."});this.lbMenuHandler=function(b,a,c,d,e){switch(b){case"vT":this.setMode({lbmode:"alltrips",lbtsect:null,lbtripname:null,lbdate:null});Logabout.Bridgeport.trackEvent("userwaypoint","setMode","alltrips");break;case"vR":this.setMode({lbmode:"alldates",lbtsect:null,lbtripname:null,lbdate:null});Logabout.Bridgeport.trackEvent("userwaypoint","setMode","alldates");break;case"vTR":if(this.lbmode=="alltrips"){this.setMode({lbmode:"alldates",lbtsect:null,lbtripname:null,lbdate:null});Logabout.Bridgeport.trackEvent("userwaypoint","setMode","alldates")}else{this.setMode({lbmode:"alltrips",lbtsect:null,lbtripname:null,lbdate:null});Logabout.Bridgeport.trackEvent("userwaypoint","setMode","alltrips")}break;case"vRefresh":this.lbStore.reload();Logabout.Bridgeport.trackEvent("userwaypoint","refresh","click");break;case"vP":Logabout.Bridgeport.showProfile(this.lbuid,this.lbusername);Logabout.Bridgeport.trackEvent("userwaypoint","showProfile","click");break;case"vGoal":Logabout.Bridgeport.showADTestGoal();break;case"vO":if(!this.tripOrganizer){this.tripOrganizer=new Logabout.TripOrganizer({url:this.lburl,lbmapmgr:this.lbmapmgr,lbluid:this.lbuid,lbsession:this.cfgdsess,lbtsect:Logabout.Defs.defGrpTsect,lbpagesize:15,lbisdebuguser:this.lbisdebuguser,width:650,height:450,listeners:{tripwaypointsrefreshed:function(f,g){this.do_waypointsrefreshed()},scope:this}})}else{this.tripOrganizer.loadWithTsect(Logabout.Defs.defGrpTsect)}this.tripOrganizer.show();Logabout.Bridgeport.trackEvent("userwaypoint","viewOrganizer","click");break;case"aT":Logabout.Bridgeport.newTrip();Logabout.Bridgeport.trackEvent("userwaypoint","newTrip","click");break;case"aW":Logabout.Bridgeport.newWaypoint(true,this.lbtsect,this.lbtripname);Logabout.Bridgeport.trackEvent("userwaypoint","newWaypoint","click");break}};this.lbLoadWith=function(a){Ext.apply(this,a);this.setMode({lbmode:this.lbmode,lbtsect:this.lbtsect,lbtripname:this.lbtripname,lbdate:this.lbdate})};this.lbActivateCurentMarkerCol=function(){this.lbmapmgr.setActiveCol(this.id+"_"+this.lbmode+"_"+this.lbtsect)};this.lbPTB=new Ext.PagingToolbar({afterPageText:"",beforePageText:"",pageSize:this.lbpagesize,store:this.lbStore,displayInfo:false,emptyMsg:"No items to display"});this.lbSBTN=new Ext.SplitButton({xtype:"splitbutton",height:30,width:100,x:5,y:17,text:"Show",tooltip:"click here to view a recent trip",iconCls:"icon-show",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["vTR"]),menu:new Ext.menu.Menu({items:[{text:"Trips",handler:this.lbMenuHandler.createDelegate(this,["vT"]),iconCls:"icon-trip"},{text:"Recent Logs",handler:this.lbMenuHandler.createDelegate(this,["vR"]),iconCls:"icon-waypoint"}]})});Ext.apply(this,{layout:"absolute",items:[{xtype:"panel",border:false,width:550,height:205,x:0,y:0,layout:"fit",items:this.lbDataView},{xtype:"panel",border:false,width:111,height:205,x:550,y:0,layout:"absolute",bbar:this.lbPTB,items:[this.lbSBTN,{xtype:"splitbutton",ref:"/orefButAdd",height:30,width:100,x:5,y:52,text:"Add",tooltip:"Add a log point. Click the arrow for more options.",iconCls:"icon-add",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["aW"]),menu:new Ext.menu.Menu({items:[{text:"Log",handler:this.lbMenuHandler.createDelegate(this,["aW"]),iconCls:"icon-waypoint"},{text:"Trip",handler:this.lbMenuHandler.createDelegate(this,["aT"]),iconCls:"icon-trip"},{text:"Organize",handler:this.lbMenuHandler.createDelegate(this,["vO"]),iconCls:"icon-organize"}]})},{xtype:"splitbutton",ref:"/orefButFilter",height:30,width:100,x:5,y:87,text:"Filter",tooltip:"Filter the results. Click the arrow for more options.",iconCls:"icon-filter",iconAlign:"left",cls:"db-button",menu:new Ext.menu.Menu({items:[{text:"Clear Filter",xtype:"button",itemId:"FilterClear",disabled:true,handler:this.filterWtypeListMod.createDelegate(this),iconCls:"icon-filter-clear"},{text:"Filter",itemId:"FilterChecks",iconCls:"icon-filter",menu:new Ext.menu.Menu({items:[new Ext.menu.CheckItem({checked:false,text:"fuel",itemId:"filter-8",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"camp ground",itemId:"filter-9",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"water",itemId:"filter-10",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"dump station",itemId:"filter-11",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"wifi",itemId:"filter-12",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"outdoor",itemId:"filter-13",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"POI",itemId:"filter-14",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"photo",itemId:"filter-15",checkHandler:this.filterWtypeListMod.createDelegate(this)}),new Ext.menu.CheckItem({checked:false,text:"hotel",itemId:"filter-16",checkHandler:this.filterWtypeListMod.createDelegate(this)})]})}]})},{xtype:"button",ref:"/orefButRefresh",height:30,width:100,x:5,y:122,text:"Refresh",tooltip:"Refresh the list",iconCls:"db-icon-refresh",iconAlign:"left",cls:"db-button",handler:this.lbMenuHandler.createDelegate(this,["vRefresh"])}]}],iconCls:(this.lbisowner?"icon-home":"icon-user"),closable:(this.lbisowner?false:true)});this.lbmapman_mapmgrcolchanged_hdlr=function(c,d,a,b,f,e){if(this.id+"_"+this.lbmode+"_"+this.lbtsect!=d){this.lbDataView.clearSelections()}};this.lbmapman_mapmgritmchanged_hdlr=function(c,d,a,b,f,e){if(this.id+"_"+this.lbmode+"_"+this.lbtsect!=d){this.lbDataView.clearSelections()}else{this.lbDataView.select("user_"+a+"_"+this.id,false,true)}};this.lbmapman_mapmgrhidecol_hdlr=function(b,a){if(this.id+"_"+this.lbmode+"_"+this.lbtsect==a){this.lbDataView.clearSelections()}};this.do_waypointcancelled=function(a){if(this.lbonceloaded){this.lbStore.reload()}else{this.setMode({lbmode:"alldates",lbtsect:null,lbtripname:null,lbdate:null})}};this.do_waypointsrefreshed=function(a){this.lbStore.reload()};this.do_waypointsaved=function(a){if(Number(a.lbuid)==this.lbuid){this.refreshRequested=true;if(a.eventSource.markerType=="trip-1"){this.setMode({lbmode:"alltrips",lbtsect:null,lbtripname:null,lbdate:null})}else{if(a.tsect==this.lbtsect){if(a.oldswpid=="new"){this.setMode({lbmode:"fortrip",lbtsect:a.tsect,lbtripname:a.tripname,lbdate:null})}else{var b=this.lbStore.lastOptions;b.params.targetSwpid=a.newswpid;this.lbStore.reload(b)}}else{this.setMode({lbmode:"alldates",lbtsect:null,lbtripname:null,lbdate:null})}}}};this.do_waypointdeleted=function(a,b){if(a==this.lbuid&&this.lbonceloaded){if(this.lbmapmgr.mrkCols[this.id+"_"+this.lbmode+"_"+this.lbtsect]){this.lbmapmgr.mrkCols[this.id+"_"+this.lbmode+"_"+this.lbtsect].lbRemoveOne(b.swpid)}this.lbStore.reload()}};this.lbmapmgr.on({mapmgrcolchanged:this.lbmapman_mapmgrcolchanged_hdlr,mapmgritmchanged:this.lbmapman_mapmgritmchanged_hdlr,mapmgrhidecol:this.lbmapman_mapmgrhidecol_hdlr,scope:this});this.on({beforedestroy:function(a){this.lbmapmgr.un("mapmgrcolchanged",this.lbmapman_mapmgrcolchanged_hdlr,this);this.lbmapmgr.un("mapmgritmchanged",this.lbmapman_mapmgritmchanged_hdlr,this);this.lbmapmgr.un("mapmgrhidecol",this.lbmapman_mapmgrhidecol_hdlr,this)},activate:function(e,d,f){this.lbmapmgr.setActiveCol(this.id+"_"+this.lbmode+"_"+this.lbtsect)},render:function(){this.lbPTB.findByType("numberfield")[0].hide();this.lbPTB.findByType("tbtext")[0].hide();this.lbPTB.findByType("tbseparator")[0].hide();this.lbPTB.findByType("tbseparator")[1].hide()},afterlayout:function(a,b){if(!this.FilterClear){this.FilterClear=this.orefButFilter.menu.getComponent("FilterClear")}if(!this.FilterChecks){this.FilterChecks=this.orefButFilter.menu.getComponent("FilterChecks")}if(this.lbisowner){this.orefButAdd.setDisabled(false)}else{this.orefButAdd.setDisabled(true)}},scope:this});Logabout.Demo.UserWaypointPanel.superclass.initComponent.apply(this,arguments)},lbLoadData:function(b,a){this.lbStore.loadData(b,a);this.lbStore.sort("utc","DESC")}});Ext.namespace("Logabout.Demo");Logabout.Demo.UserEditPanel=Ext.extend(Ext.Panel,{lburl:null,lbusername:null,lbuid:null,lbdsess:null,lbdetailwtype:null,lblogastriptext:"Log as activity on date:",lbmapmgr:null,lbtplFunctions:null,lbuserchangedname:false,lbguestmode:false,lbeditstatus:"new",lbnewmarker:true,lbContainerW:null,lbContainerH:null,lbWidth:null,lbHeight:null,lbReverseGeo:true,markerType:"waypoint-2",addToHistory:false,containerButtons:false,saveEventArgs:{eventSource:null,lbuid:null,tsect:null,tripname:null,oldswpid:null,newswpid:null,wtype:null,sfield1:null},lbInitialLatLng:{lat:null,lng:null},updateGeoCodeStatus:function(b,a){switch(b){case"SEARCH":this.orefGeoCodeTrig.setValue("searching...");break;case"OK":this.orefGeoCodeTrig.setValue("found: "+a);this.orefGeoCodeTrig.focus(true,true);break;case"NOTFOUND":this.orefGeoCodeTrig.setValue("not found.");this.orefGeoCodeTrig.focus(true,true);break;case"NOCODER":this.orefGeoCodeTrig.setValue("not available");break;default:break}},PosChangedFromInitial:function(){if(this.orefTposition&&this.lbInitialLatLng.lat!=null&&this.lbInitialLatLng.lng!=null){var a=this.orefTposition.find("name","lat")[0].getValue();var b=this.orefTposition.find("name","lng")[0].getValue();if(a!=this.lbInitialLatLng.lat||b!=this.lbInitialLatLng.lng){return true}else{return false}}else{return false}},MarkerUpdatePosition:function(c,b,a){if(this.lbnewmarker){this.lbnewmarker=false;this.lbInitialLatLng={lat:c,lng:b};this.updatePosition(c,b);if(this.editStore.getAt(0).data.swpid>0){this.updateAccuracy(a,true)}else{this.updateAccuracy(a,false)}}else{this.updatePosition(c,b);this.updateZoom(a);this.updateAccuracy(a,true)}},MarkerUpdateZoom:function(a){this.updateAccuracy(a,false)},updatePosition:function(b,a){if(this.orefTposition){this.orefTposition.find("name","lat")[0].setValue(b);this.orefTposition.find("name","lng")[0].setValue(a)}},updateZoom:function(a){if(this.orefTposition){this.orefTposition.find("name","gmapzoom")[0].setValue(a);this.calcPoints("gmapzoom",a)}},accuracyMap:{0:{txt:"Bad",warn:1,cls:"orange"},1:{txt:"Bad",warn:1,cls:"orange"},2:{txt:"Bad",warn:1,cls:"orange"},3:{txt:"Bad",warn:1,cls:"orange"},4:{txt:"Bad",warn:1,cls:"orange"},5:{txt:"Bad",warn:1,cls:"orange"},6:{txt:"Bad",warn:1,cls:"orange"},7:{txt:"Bad",warn:1,cls:"orange"},8:{txt:"Bad",warn:1,cls:"orange"},9:{txt:"Bad",warn:1,cls:"orange"},10:{txt:"Bad",warn:1,cls:"orange"},11:{txt:"Bad",warn:1,cls:"orange"},12:{txt:"Mediocre",warn:1,cls:"yellow"},13:{txt:"Mediocre",warn:1,cls:"yellow"},14:{txt:"Good",warn:0,cls:"green"},15:{txt:"Good",warn:0,cls:"green"},16:{txt:"Excellent",warn:0,cls:"green"},17:{txt:"Excellent",warn:0,cls:"green"},18:{txt:"Excellent",warn:0,cls:"green"},19:{txt:"Excellent",warn:0,cls:"green"},20:{txt:"Excellent",warn:0,cls:"green"},21:{txt:"Excellent",warn:0,cls:"green"}},calcMapAcc:function(a){return this.accuracyMap[a]},updateAccuracy:function(c,b){if(typeof this.orefAccuZoomTxt!="undefined"&&typeof this.orefAccuTxt!="undefined"){var a="";var d="";if(b){if(this.accuracyMap[c].warn==1){a='<div class="db-accu-disp db-icon-exclamation">Accuracy is '+this.accuracyMap[c].txt+" - please zoom in</div>"}else{a='<div class="db-accu-disp db-icon-tick">Accuracy is '+this.accuracyMap[c].txt+"</div>"}}else{if(this.accuracyMap[c].warn==1){a='<div class="db-accu-disp db-icon-exclamation">Accuracy is '+this.accuracyMap[c].txt+" - please zoom in</div>"}else{a='<div class="db-accu-disp db-icon-tick">Zoom is '+this.accuracyMap[c].txt+"</div>";d='<div class="db-accu-disp db-icon-exclamation">Accuarcy is NOT set - please adjust the position</div>'}}this.orefAccuZoomTxt.getEl().update(a);this.orefAccuTxt.getEl().update(d)}},updateCityStateCountry:function(c,a,b){if(!this.userChangedFields.sfield5){this.orefTposition.find("name","sfield5")[0].setValue(c)}if(!this.userChangedFields.sfield6){this.orefTposition.find("name","sfield6")[0].setValue(a)}if(!this.userChangedFields.sfield7){this.orefTposition.find("name","sfield7")[0].setValue(b)}},picasaUpdateHandler:function(b,a){var c=this.orefPhotoImgPanel.getEl().child("img");if(c){c.setStyle({display:"block",width:"108px",height:"144px"});c.set({src:a.thumbnail})}if(a.sfield1){this.orefTbasic.find("name","sfield1")[0].setValue(a.sfield1)}if(a.description){this.orefTbasic.find("name","description")[0].setValue(a.description)}if(a.alt){this.orefTposition.find("name","alt")[0].setValue(a.alt)}if(a.gmapzoom){this.orefTposition.find("name","gmapzoom")[0].setValue(a.gmapzoom);this.calcPoints("gmapzoom",a.gmapzoom)}if(a.utc){this.orefTbasic.find("name","utc")[0].setValue(a.utc);this.orefTbasic.find("name","dttime")[0].setValue(a.utc.format("H:i"));this.orefTbasic.find("title",this.lblogastriptext)[0].expand()}this.orefTphoto.find("name","ifield10")[0].setValue(a.ifield10);this.orefTphoto.find("name","sfield8")[0].setValue(a.sfield8);this.calcPoints("sfield8",a.sfield8);if(a.lat&&a.lng){this.fireEvent("waypointpositionUIchanged",this,{lat:a.lat,lng:a.lng})}},tryBlurFocus:function(){if(typeof this.orefSaveButton!=="undefined"){this.orefSaveButton.focus()}},fsValChangedHandler:function(b,c,a){this.calcPoints(b,c)},pointsTotal:0,pointsMatrix:{description:3,sfield1:"namepattern",sfield2:1,sfield3:1,sfield4:1,sfield8:10,ifield1:1,ifield2:1,ifield3:1,ifield4:1,ifield5:1,ifield6:1,ifield7:1,ifield8:1,ifield9:1,gmapzoom:"directvalue",mtype:"master"},pointsTally:{},pointsExpl:{totalpoints:0,pointdetails:[]},pointsExplTmpl:new Ext.XTemplate('<div class="points-view">','<tpl for="pointdetails">','<div class="points-detail-wrap">','<div class="points-detail-name">{ename}:</div>','<tpl if="basepts &gt; 0">','<div class="points-detail-value">+{basepts}</div>',"</tpl>",'<tpl if="bonuspts &gt; 0">','<div class="points-detail-bonus">+{bonuspts} bonus ({bonusmsg})</div>',"</tpl>",'<div class="points-clear"></div>',"</div>","</tpl>",'<div class="points-total">','<div class="points-total-name">Total Points:</div>','<div class="points-total-value">{totalpoints}</div>','<div class="points-clear"></div>',"</div>","</div>"),calcPoints:function(b,a,h){if(h){var g=this.editStore.getAt(0).data;for(var f in g){if(this.pointsMatrix[f]&&g[f]!==null&&g[f].length>0){if(this.pointsMatrix[f]=="directvalue"){this.pointsTally[f]=Number(g[f])}else{if(this.pointsMatrix[f]=="namepattern"){if(this.isPatternName(g[f])){this.pointsTally[f]=1}else{this.pointsTally[f]=3}}else{if(this.pointsMatrix[f]=="master"){if(g[f]==1){this.pointsTally[f]=50}}else{this.pointsTally[f]=this.pointsMatrix[f]}}}}}}if(b){if(this.pointsMatrix[b]){if(!a){this.pointsTally[b]=0}else{if(a.length==0){this.pointsTally[b]=0}else{if(this.pointsMatrix[b]=="directvalue"){this.pointsTally[b]=Number(a)}else{if(this.pointsMatrix[b]=="namepattern"){if(this.isPatternName(a)){this.pointsTally[b]=1}else{this.pointsTally[b]=3}}else{if(this.pointsMatrix[b]=="master"){if(a==1){this.pointsTally[b]=50}else{this.pointsTally[b]=0}}else{this.pointsTally[b]=this.pointsMatrix[b]}}}}}}}this.pointsExpl.pointdetails.length=0;var e=0;var d=0;for(var c in this.pointsTally){e+=this.pointsTally[c];switch(c){case"description":this.pointsExpl.pointdetails.push({sort:1,ename:"description",basepts:this.pointsTally[c],bonusmsg:"",bonuspts:0});break;case"sfield1":this.pointsExpl.pointdetails.push({sort:0,ename:"wpt name",basepts:1,bonusmsg:(this.pointsTally[c]==3?"changed":""),bonuspts:(this.pointsTally[c]==3?2:0)});break;case"sfield8":this.pointsExpl.pointdetails.push({sort:2,ename:"photo",basepts:this.pointsTally[c],bonusmsg:"",bonuspts:0});break;case"gmapzoom":this.pointsExpl.pointdetails.push({sort:3,ename:"accuracy",basepts:this.pointsTally[c],bonusmsg:"",bonuspts:0});break;case"mtype":this.pointsExpl.pointdetails.push({sort:5,ename:"place",basepts:0,bonusmsg:(this.pointsTally[c]==50?"qualify":"not qualify"),bonuspts:(this.pointsTally[c]==50?50:0)});break;default:d+=this.pointsTally[c];break}}if(d>0){this.pointsExpl.pointdetails.push({sort:4,ename:"detail fields",basepts:d,bonusmsg:"",bonuspts:0})}this.pointsExpl.pointdetails.sort(function(j,i){return j.sort-i.sort});this.pointsExpl.totalpoints=e;this.pointsExplTmpl.overwrite(this.orefTpoints.body,this.pointsExpl);this.pointsTotal=e;this.updatePointsDisplay()},updatePointsDisplay:function(){if(Ext.get("epoints")){Ext.get("epoints").child(".epoints-val").dom.firstChild.nodeValue=this.pointsTotal}if(this.pointsTotal==1){this.orefTpoints.setTitle("1 pt")}else{this.orefTpoints.setTitle(this.pointsTotal+" pts")}},prepareHide:function(){if(this.orefCboWtype){this.orefCboWtype.collapse()}if(this.orefCboDate){if(this.orefCboDate.menu){this.orefCboDate.menu.hide()}}if(this.orefCboTime){this.orefCboTime.collapse()}if(this.orefCboTrip){this.orefCboTrip.collapse()}var c=this.orefTdetail.findByType("combo");for(var b=0,a=c.length;b<a;b++){c[b].collapse()}},prepareShow:function(b){this.updatePointsDisplay();if(this.lbeditstatus=="new"||this.lbeditstatus=="edit"){if(!b){b=this.editStore.getAt(0)}this.userChangedFields={};this.pointsTally=new Object();this.orefTbasic.getForm().reset();this.orefTbasic.getForm().reset();this.orefTbasic.getForm().loadRecord(b);this.orefTbasic.find("name","sfield1")[0].focus(true,true);this.lbuserchangedname=false;if(b.data.sfield1==null){this.orefTbasic.find("name","sfield1")[0].setValue(this.getPatternName(b.data.wtype,b.data.utc))}this.changeDetailFieldSet(b.data.wtype);this.orefTposition.getForm().reset();this.orefTposition.getForm().loadRecord(b);this.orefTphoto.getForm().reset();this.orefTphoto.getForm().loadRecord(b);var a=this.orefPhotoImgPanel.getEl().child("img");if(a){if(b.data.sfield8){if(b.data.ifield10==1){a.setStyle({display:"block",width:"192px",height:"144px"})}else{if(b.data.ifield10==2){a.setStyle({display:"block",width:"108px",height:"144px"})}else{if(b.data.ifield10>2){a.setStyle({display:"none"})}}}if(Ext.util.Format.substr(b.data.sfield8,0,4)=="http"){a.set({src:b.data.sfield8})}else{a.set({src:Logabout.Defs.picComboPath+b.data.sfield8})}}else{a.setStyle({display:"none"});a.set({src:""})}}this.orefTabpanel.setActiveTab(0);if(this.lbeditstatus=="edit"){this.orefButChangeMode.setDisabled(true)}else{if(this.lbeditstatus=="new"){this.orefButChangeMode.setDisabled(false)}}this.lbeditstatus="loaded";this.calcPoints(null,null,true)}},saveWaypoint:function(){if(!this.orefTbasic.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTbasic.id)}else{if(!this.orefTdetail.getLayout().activeItem.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTdetail.id)}else{if(!this.orefTposition.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTposition.id)}else{if(!this.orefTphoto.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTphoto.id)}else{var b=this.editStore.getAt(0);var a=new Object();this.orefTbasic.getForm().updateRecord(b);this.orefTdetail.getLayout().activeItem.getForm().updateRecord(b);this.orefTposition.getForm().updateRecord(b);this.orefTphoto.getForm().updateRecord(b);Ext.apply(a,b.getChanges());Ext.apply(a,b.data);a.utc=this.getCombinedDate(b.data.utc,b.data.dttime,b.data.dtseconds).format("U").toString();a.ifield13=this.pointsTotal;a.mtype=b.data.mtype;a.mswpid=b.data.mswpid;var c=this.dsCboTsect.query("tsect",a.tsect);Ext.apply(this.saveEventArgs,{eventSource:this,lbuid:this.lbuid,tsect:a.tsect,tripname:(c!=null&&c.first()?c.first().data.sfield1:null),oldswpid:(a.swpid?a.swpid:"new"),wtype:a.wtype,sfield1:a.sfield1});if(this.lbdsess==0){Ext.Msg.show({title:"Save Changes?",msg:"You are not logged in. Would you like to save your changes as a guest user?",buttons:Ext.Msg.YESNOCANCEL,fn:function(d){if(d=="yes"){this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}},scope:this,icon:Ext.MessageBox.QUESTION})}else{this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}}}}}},createConfigObjects:function(){this.getPatternName=function(b,a){return Logabout.Defs.eWtype[b]+" #"+(a.format("ymd-Hi")).toString()};this.isPatternName=function(a){if(a.search(new RegExp("^(?:\\s*(?:Trip|Fuel|Camp|Water|Dump|Wifi|Outdoor|POI|Photo|Hotel)?.{0,4}\\d{4,}\\s*-\\s*\\d{2,}(?:\\w{0,3}|\\s*)|.{0,4})$",["i"]))>-1){return true}return false};this.getCombinedDate=function(a,c,b){var d=c.split(":");return a.clearTime(true).add(Date.HOUR,Number(d[0])).add(Date.MINUTE,Number(d[1])).add(Date.SECOND,Number(b))};this.dsCboTsect=new Ext.data.Store({url:this.lburl,reader:new Ext.data.JsonReader({root:"results",totalProperty:"totalrows",id:"swpid"},[{name:"date",mapping:"utc",type:"date",dateFormat:"U"},{name:"tsect",mapping:"tsect"},{name:"tsecttype",mapping:"tsecttype"},{name:"swpid",mapping:"swpid"},{name:"sfield1",mapping:"sfield1"},{name:"wpid",mapping:"wpid"},{name:"shorttripname",mapping:"sfield1",type:"string",convert:function(a){return Ext.util.Format.ellipsis(a,25)}}]),baseParams:{task:"gettsects",tsect:null,uid:this.lbuid,wtype:null}});this.detailFieldsAr=["ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9","sfield2","sfield3","sfield4"];this.wtypeToidx={8:2,9:0,10:7,11:1,12:8,13:4,14:6,15:5,16:3};this.clearDetailFields=function(){var a=this.editStore.getAt(0);for(var b=0;b<this.detailFieldsAr.length;b++){a.set(this.detailFieldsAr[b],null);this.calcPoints(this.detailFieldsAr[b],"")}};this.changeDetailFieldSet=function(c){var b=this.editStore.getAt(0);this.orefTdetail.getLayout().setActiveItem(this.wtypeToidx[Number(c)]);var a=this.orefTdetail.getLayout().activeItem;a.getForm().reset();a.getForm().loadRecord(b);if(this.lbeditstatus=="loaded"){if(this.isPatternName(this.orefSfield1.getValue())){var d=this.getCombinedDate(this.orefCboDate.getValue(),this.orefCboTime.getValue(),b.data.dtseconds);this.orefSfield1.setValue(this.getPatternName(c,d))}}this.lbdetailwtype=Number(c)};this.detailFSisDirty=function(){var b=this.editStore.getAt(0).data;var c=this.orefTdetail.getLayout().activeItem.getForm().getValues(false);for(var a=0;a<this.detailFieldsAr.length;a++){if(b[this.detailFieldsAr[a]]!==null&&b[this.detailFieldsAr[a]].length>0){return true}if(c[this.detailFieldsAr[a]]!=null){if(c[this.detailFieldsAr[a]].length>0){return true}}}return false};this.cboTypeBeforeSelect=function(a){if(this.lbdetailwtype==a.data.cbowtype){return true}var b=a.data.cbowtype;if(this.detailFSisDirty()){var c=Ext.MessageBox.show({title:"Confirm waypoint type change",msg:"The Waypoint Detail tab contains data specific to the "+Logabout.Defs.eWtype[this.lbdetailwtype]+" waypoint type. Click proceed to delete this data and convert to the "+Logabout.Defs.eWtype[b]+" waypoint type. Click cancel to keep the detail data.",fn:function(d){if(d=="cancel"){this.orefCboWtype.setValue(this.lbdetailwtype)}else{this.clearDetailFields();this.changeDetailFieldSet(b)}},scope:this,buttons:{ok:"proceed",cancel:"cancel"},closable:false,modal:true})}else{this.changeDetailFieldSet(b)}return true}},applyConfigItems:function(){Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,items:[{xtype:"panel",layout:"absolute",width:350,height:this.lbHeight,x:0,y:0,border:false,items:[{height:20,width:340,x:5,y:5,border:false,html:"goto (type a place name and hit enter)"},{xtype:"panel",height:30,width:340,x:5,y:35,cls:"wiz-section",border:false,items:[{xtype:"trigger",ref:"//orefGeoCodeTrig",selectOnFocus:true,allowBlank:true,emptyText:"<eg. Bishop, CA or 129 Elm St, Houston>",maxLength:100,width:320,hideLabel:true,listeners:{render:function(a){a.getEl().addKeyMap({key:Ext.EventObject.ENTER,fn:function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())},scope:this})},scope:this},onTriggerClick:(function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())}).createDelegate(this),triggerClass:"x-form-search-trigger"}]},{ref:"/orefAccuZoomTxt",height:20,width:320,x:5,y:70,border:false,html:"orefAccuZoomTxt"},{ref:"/orefAccuTxt",height:20,width:320,x:5,y:90,border:false,html:"orefAccuTxt"},{xtype:"button",ref:"/orefButChangeMode",height:30,y:this.lbHeight-35,width:180,x:5,text:"change to wizard mode",tooltip:"change to wizard mode",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:function(){this.fireEvent("changewaypointeditmode",this,"wizard")},scope:this},{xtype:"button",height:30,y:this.lbHeight-35,width:70,x:195,text:"Cancel",tooltip:"Cancel waypoint",iconCls:"db-icon-cancel",iconAlign:"left",cls:"db-button",handler:this.cancelWaypoint.createDelegate(this)},{xtype:"button",height:30,y:this.lbHeight-35,width:70,x:270,text:"Save",tooltip:"Save this waypoint",iconCls:"db-icon-save",iconAlign:"left",cls:"db-button",handler:this.saveWaypoint.createDelegate(this)}]},{xtype:"tabpanel",width:this.lbWidth-350,height:this.lbHeight,x:350,y:0,cls:"bp-combopanel-edittab",layoutOnTabChange:true,deferredRender:false,ref:"orefTabpanel",activeTab:0,plain:true,bodyBorder:false,border:false,bodyStyle:"padding: 2px 0px 0px 0px;",listeners:{beforetabchange:function(a,c,b){if(b){if(b.id==this.orefTbasic.id){if(!b.getForm().isValid()){return false}}}},scope:this},items:[{xtype:"form",ref:"/orefTbasic",title:"basic",autoHeight:true,labelWidth:80,items:[{xtype:"fieldset",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,style:"padding: 5px; margin-bottom: 3px;",items:[{xtype:"textfield",ref:"///orefSfield1",fieldLabel:"Name",listeners:{change:function(b,c,a){this.calcPoints(b.name,c);if(b.isValid()){this.lbuserchangedname=true}},scope:this},name:"sfield1",selectOnFocus:true,allowBlank:false,maxLength:100,width:308},{xtype:"textarea",listeners:{change:function(b,c,a){this.calcPoints(b.name,c)},scope:this},fieldLabel:"Description",name:"description",emptyText:"<enter a description here>",height:50,maxLength:160,width:308},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{xtype:"combo",ref:"////orefCboWtype",fieldLabel:"Type",name:"wtypename",hiddenName:"wtype",width:115,allowBlank:false,forceSelection:true,value:9,listWidth:150,emptyText:"Select a type...",displayField:"cbowtypedesc",valueField:"cbowtype",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true,store:new Ext.data.SimpleStore({fields:["cbowtype","cbowtypedesc","typeorder","wimg"],data:Logabout.Defs.NoGoaleWtypes,sortInfo:{field:"typeorder",direction:"ASC"}}),tpl:new Ext.XTemplate('<tpl for=".">','<div class="x-combo-list-item">',"<div>",'<img class="gt-wtype-pic" src="'+Logabout.Defs.imagesDirPath+'mrk/{wimg}"></img>','<span class="gt-wtype-txt">{cbowtypedesc}</span>','<div class="gtclear"></div>',"</div>","</div>","</tpl>"),listeners:{beforeselect:function(c,a,b){this.cboTypeBeforeSelect(a)},scope:this}}]},{layout:"form",columnWidth:0.5,labelWidth:45,border:false,items:[{xtype:"combo",fieldLabel:"Trip",ref:"////orefCboTrip",width:115,name:"tsectfriendly",emptyText:"choose trip",hiddenName:"tsect",allowBlank:false,listWidth:220,pageSize:10,store:this.dsCboTsect,forceSelection:true,displayField:"shorttripname",valueField:"tsect",typeAhead:true,mode:"remote",triggerAction:"all",valueNotFoundText:"click to show name",listeners:{beforequery:function(a){if(this.dsCboTsect.getCount()==1){this.dsCboTsect.reload()}},scope:this},lazyRender:true}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{xtype:"datefield",ref:"/////orefCboDate",fieldLabel:"Date",labelSeparator:":",name:"utc",allowBlank:true,width:115,format:"m/d/Y"}]},{layout:"form",labelWidth:45,border:false,columnWidth:0.5,items:[{xtype:"timefield",ref:"/////orefCboTime",fieldLabel:"Time",labelSeparator:":",name:"dttime",width:115,increment:30,format:"H:i"}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",border:false,columnWidth:0.7,items:[{xtype:"checkbox",name:"ifield12",inputValue:"1",boxLabel:"Show in Gadget",hideLabel:true,width:180,disabled:false}]}]}]}]},{xtype:"panel",ref:"/orefTdetail",title:"detail",border:false,layout:"card",activeItem:0,defaults:{border:false,height:200,autoWidth:true,autoScroll:true},items:[{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfscamp",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsdump",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsfuel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfshotel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsoutdoor",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsphoto",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfspoi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswater",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswifi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]}]},{xtype:"form",ref:"/orefTposition",title:"position",border:false,height:this.lbHeight,autoScroll:true,items:[{xtype:"fieldset",title:"Position Information",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,labelSeparator:":",defaults:{width:150},items:[{xtype:"numberfield",fieldLabel:"Lat",name:"lat",listeners:{change:function(b,c,a){if(b.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:c,lng:null})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-90,maxValue:90,allowBlank:false},{xtype:"numberfield",fieldLabel:"Lng",name:"lng",listeners:{change:function(b,c,a){if(b.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:null,lng:c})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-180,maxValue:180,allowBlank:false},{xtype:"numberfield",fieldLabel:"Alt",name:"alt",allowNegative:true,decimalPrecision:1,minValue:-1000,maxValue:55000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Zoom",name:"gmapzoom",disabled:true,allowBlank:true},{xtype:"textfield",fieldLabel:"City",name:"sfield5",listeners:{change:function(b,c,a){if(Ext.isEmpty(c)){this.userChangedFields[b.name]=false}else{this.userChangedFields[b.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"State/Prov",name:"sfield6",listeners:{change:function(b,c,a){if(Ext.isEmpty(c)){this.userChangedFields[b.name]=false}else{this.userChangedFields[b.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"Country",name:"sfield7",listeners:{change:function(b,c,a){if(Ext.isEmpty(c)){this.userChangedFields[b.name]=false}else{this.userChangedFields[b.name]=true}},scope:this},allowBlank:true}]}]},{xtype:"form",ref:"/orefTphoto",title:"photo",autoHeight:true,layoutConfig:{labelWidth:100,labelSeparator:":"},items:[{xtype:"fieldset",title:"",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,items:[{ref:"///orefPhotoImgPanel",border:false,html:'<div><img src=""></img>'}]},{xtype:"fieldset",title:"",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,items:[{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,labelWidth:1,border:false,items:[{xtype:"button",text:"Link with Picasa",handler:function(){if(!this.photoLinkerPicasa){this.photoLinkerPicasa=new Logabout.PhotoLinker.Picasa();this.photoLinkerPicasa.on("picasawaypointupdate",this.picasaUpdateHandler,this)}this.photoLinkerPicasa.show()},scope:this}]},{layout:"form",labelWidth:1,border:false,columnWidth:0.5,items:[{xtype:"button",text:"Clear Photo",handler:function(){this.orefTphoto.find("name","ifield10")[0].setValue(null);this.orefTphoto.find("name","sfield8")[0].setValue("");this.calcPoints("sfield8","");var a=this.orefPhotoImgPanel.getEl().child("img");if(a){a.set({src:""});a.setStyle({display:"none"})}},scope:this}]}]}]},{xtype:"fieldset",title:"",style:"display: none",autoHeight:true,autoWidth:true,collapsible:true,collapsed:false,defaults:{labelWidth:30,width:100},items:[{xtype:"numberfield",fieldLabel:"photo type",name:"ifield10"},{xtype:"textfield",fieldLabel:"photo path",name:"sfield8"}]}]},{xtype:"panel",ref:"/orefTpoints",title:"points",autoHeight:true,html:"dada",listeners:{activate:function(a){this.tryBlurFocus()},scope:this}}]}]})},executeCustom:function(){this.on({render:function(){if(this.footer){var a=Ext.DomHelper.insertFirst(this.footer.child(".x-panel-btns"),[{tag:"img",src:"fourfourty/sgicons/done.gif",style:"float:left;padding-top:4px"},{tag:"div",cls:"waccuracy-cont",html:'<span class="waccuracy-lbl">accu:</span><span class="waccuracy-val">0</span>'}],true)}},scope:this})},createMarkerConfig:function(){this.customMarkerConfig={polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,markerType:this.markerType,addToHistory:this.addToHistory,reverseGeo:this.lbReverseGeo,wptEditPanel:this,markerTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">Drag this marker to adjust the position of your waypoint.</div>'],altTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">This is a vicinity waypoint.</div>'],markerTemplateFunctions:this.lbtplFunctions}},focusMapMrk:function(){this.lbmapmgr.setActiveCol(this.id+"_mrkcol")},showBusy:function(a){if(!this.footer){return}if(a){this.footer.child("img").set({src:"fourfourty/sgicons/loading.gif"})}else{this.footer.child("img").set({src:"fourfourty/sgicons/done.gif"})}},updateWptData:function(a){this.lbeditstatus="saving";this.showBusy(true);(function(d,c){var b=arguments.callee;Ext.Ajax.request({url:this.lburl,method:"POST",params:{task:"userdataupdatebatch",updatedata:Ext.util.JSON.encode(d),uiforce:c,sesstoken:this.lbdsess,uid:this.lbuid},callback:function(f,h,e){this.showBusy(false);if(h){var g=Ext.util.JSON.decode(e.responseText);if(g.success){this.lbeditstatus="saved";Ext.apply(this.saveEventArgs,{newswpid:g.swpid,mswpid:parseInt(g.mswpid),mtype:parseInt(g.mtype)});this.fireEvent("waypointsaved",this.saveEventArgs);Logabout.Bridgeport.updateUserStats(this,"wupdate",{swpid:parseInt(g.swpid),mswpid:parseInt(g.mswpid),pntcnt:parseInt(g.points),pntcntchg:parseInt(g.pointchg),fdrcnt:parseInt(g.fdrchg),fdrcntchg:parseInt(g.fdrchg),wptcnt:g.newrec==true?1:0,wptcntchg:g.newrec==true?1:0})}else{if(g.requestforce){Ext.Msg.show({title:"Oops... an error occurred",msg:g.requestforce,buttons:Ext.Msg.OKCANCEL,icon:Ext.MessageBox.WARNING,fn:function(i){if(i=="ok"){b.defer(5,this,[d,1])}},scope:this})}else{Ext.Msg.show({title:"Oops... an error occurred",msg:g.error,buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}}}else{Ext.Msg.show({title:"Oops... an error occurred",msg:"please try again",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR})}},scope:this})}).defer(5,this,[a,0])},cancelWaypoint:function(){this.lbeditstatus="cancelled";this.fireEvent("waypointcancelled")},createEditStore:function(){this.editStore=new Ext.data.Store({url:this.lburl,baseParams:{task:"editdata",uid:this.lbuid,sesstoken:this.lbdsess},reader:new Ext.data.JsonReader({root:"results",id:"swpid",totalProperty:"totalrows"},Ext.data.Record.create(Logabout.Defs.FullRecDef)),sortInfo:{field:"utc",direction:"DESC"},listeners:{loadexception:function(){Ext.MessageBox.alert("Connection Error","Oops, a connection error occurred. Please try again.")},load:function(a,c,b){if(this.dsCboTsect){if(c[0].data.tripname){this.dsCboTsect.loadData({totalrows:1,results:[{date:new Date().format("U").toString(),tsect:c[0].data.tsect,tsecttype:Ext.util.Format.substr(c[0].data.tripname,8,2),sfield1:c[0].data.tripname}]})}}switch(this.lbeditstatus){case"trynew":this.lbeditstatus="new";break;case"tryedit":this.lbeditstatus="edit";break;default:break}this.lbnewmarker=true;this.lbmapmgr.addCollection(this.id+"_mrkcol","swpid",c,this.customMarkerConfig);this.lbmapmgr.setActiveCol(this.id+"_mrkcol");this.prepareShow()},scope:this}})},loadNewRecord:function(a){this.lbeditstatus="trynew";if(a){this.editStore.loadData(a)}else{this.editStore.loadData({totalrows:1,results:[{dsrc:"2",utc:new Date().format("U").toString(),tsect:Logabout.Defs.defGrpTsect.toString(),tsecttype:Ext.util.Format.substr(Logabout.Defs.defGrpTsect,8,2),lng:"-121.377",lat:"37.1822",wpid:"0",wtype:"11",sfield1:"my new wpt",ifield11:true}]})}},loadExistingRecord:function(a){this.lbeditstatus="tryedit";this.editStore.load({params:{swpid:a}})},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.createMarkerConfig();this.createEditStore();this.createConfigObjects();Ext.apply(this,{border:false,frame:false});if(this.containerButtons){Ext.apply(this,{buttons:[{text:"Cancel",handler:this.cancelWaypoint,scope:this},{text:"Save",ref:"//orefSaveButton",handler:this.saveWaypoint,scope:this}]})}this.applyConfigItems();this.executeCustom();Logabout.Demo.UserEditPanel.superclass.initComponent.apply(this,arguments)}});Ext.reg("lbusereditpanel",Logabout.Demo.UserEditPanel);Ext.namespace("Logabout.Demo");Logabout.Demo.UserEditPanel.Vicinity=Ext.extend(Logabout.Demo.UserEditPanel,{lbReverseGeo:true,markerType:"drageditvicinity",addToHistory:false,containerButtons:false,lbVicinityModeShowNearby:true,iLog:function(b){var a=false;if(a){console.log(b)}},updateAccuracy:function(e,a){var c=this.editStore.getAt(0).data;var b=this.orefTposition.find("name","lat")[0].getValue();var d=this.orefTposition.find("name","lng")[0].getValue();if(c.lat==b&&c.lng==d&&c.swpid>0){this.iLog("usereditpanel: upadateaccuracy: edit rec with same position");if(this.accuracyMap[c.gmapzoom].warn==1){this.vicinityDetails.reqaccuracy=0}else{this.vicinityDetails.reqaccuracy=1}this.vicinityDetails.accuval=this.accuracyMap[c.gmapzoom].txt}else{this.iLog("usereditpanel: upadateaccuracy: new rec or edit rec with diff position");if(this.accuracyMap[e].warn==1){this.vicinityDetails.reqaccuracy=0}else{if(a){this.vicinityDetails.reqaccuracy=1}else{this.vicinityDetails.reqaccuracy=2}}this.vicinityDetails.accuval=this.accuracyMap[e].txt}this.applyVicDetTpl("updateAccuracy")},prepareHide:function(){if(this.orefCboWtype){this.orefCboWtype.collapse()}if(this.orefCboDate){if(this.orefCboDate.menu){this.orefCboDate.menu.hide()}}if(this.orefCboTime){this.orefCboTime.collapse()}if(this.orefCboTrip){this.orefCboTrip.collapse()}var c=this.orefTdetail.findByType("combo");for(var b=0,a=c.length;b<a;b++){c[b].collapse()}},prepareShow:function(b){this.updatePointsDisplay();if(this.lbeditstatus=="new"||this.lbeditstatus=="edit"){if(!b){b=this.editStore.getAt(0)}if(this.orefGeoCodeTrig){this.orefGeoCodeTrig.setValue(null)}this.userChangedFields={};this.pointsTally=new Object();this.orefTbasic.getForm().reset();this.orefTbasic.getForm().reset();this.orefTbasic.getForm().loadRecord(b);this.orefTbasic.find("name","sfield1")[0].focus(true,true);this.lbuserchangedname=false;if(b.data.sfield1==null){this.orefTbasic.find("name","sfield1")[0].setValue(this.getPatternName(b.data.wtype,b.data.utc))}this.changeDetailFieldSet(b.data.wtype);this.orefTposition.getForm().reset();this.orefTposition.getForm().loadRecord(b);this.orefTphoto.getForm().reset();this.orefTphoto.getForm().loadRecord(b);var a=this.orefPhotoImgPanel.getEl().child("img");if(a){if(b.data.sfield8){if(b.data.ifield10==1){a.setStyle({display:"block",width:"192px",height:"144px"})}else{if(b.data.ifield10==2){a.setStyle({display:"block",width:"108px",height:"144px"})}else{if(b.data.ifield10>2){a.setStyle({display:"none"})}}}if(Ext.util.Format.substr(b.data.sfield8,0,4)=="http"){a.set({src:b.data.sfield8})}else{a.set({src:Logabout.Defs.picComboPath+b.data.sfield8})}}else{a.setStyle({display:"none"});a.set({src:""})}}this.orefTabpanel.setActiveTab(0);this.lbeditstatus="loaded";this.calcPoints(null,null,true);this.vicinityDetails.sfield1=b.data.sfield1;this.vicinityDetails.wtype=b.data.wtype;this.vicinityDetails.swpid=b.data.swpid;this.vicinityDetails.mtype=b.data.mtype;if(parseInt(this.vicinityDetails.mtype)==1){this.vicinityDetails.reqaccuracy=1;this.vicinityDetails.reqname=1;this.vicinityDetails.reqbuffer=1;this.vicinityDetails.reqall=1;this.vicinityDetails.insidemaster=0}else{this.vicinityDetails.reqall=0;this.vicinityDetails.insidemaster=0}this.applyVicDetTpl("prepareShow")}},saveWaypoint:function(){if(this.vicinityDetails.logAtSwpid!=null&&!this.vicinityDetails.swpid>0){Logabout.Bridgeport.showQuickLog(null,this.vicinityDetails.logAtSwpid);return true}if(!this.orefTbasic.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTbasic.id)}else{if(!this.orefTdetail.getLayout().activeItem.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTdetail.id)}else{if(!this.orefTposition.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTposition.id)}else{if(!this.orefTphoto.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTphoto.id)}else{var b=this.editStore.getAt(0);var a=new Object();this.orefTbasic.getForm().updateRecord(b);this.orefTdetail.getLayout().activeItem.getForm().updateRecord(b);this.orefTposition.getForm().updateRecord(b);this.orefTphoto.getForm().updateRecord(b);Ext.apply(a,b.getChanges());Ext.apply(a,b.data);a.utc=this.getCombinedDate(b.data.utc,b.data.dttime,b.data.dtseconds).format("U").toString();a.ifield13=this.pointsTotal;a.mtype=b.data.mtype;a.mswpid=b.data.mswpid;var c=this.dsCboTsect.query("tsect",a.tsect);Ext.apply(this.saveEventArgs,{eventSource:this,lbuid:this.lbuid,tsect:a.tsect,tripname:(c!=null&&c.first()?c.first().data.sfield1:null),oldswpid:(a.swpid?a.swpid:"new"),wtype:a.wtype,sfield1:a.sfield1});if(this.lbdsess==0){Ext.Msg.show({title:"Save Changes?",msg:"You are not logged in. Would you like to save your changes as a guest user?",buttons:Ext.Msg.YESNOCANCEL,fn:function(d){if(d=="yes"){this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}},scope:this,icon:Ext.MessageBox.QUESTION})}else{this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}}}}}},createConfigObjects:function(){this.getPatternName=function(b,a){return Logabout.Defs.eWtype[b]+" #"+(a.format("ymd-Hi")).toString()};this.isPatternName=function(a){if(a.search(new RegExp("^(?:\\s*(?:Trip|Fuel|Camp|Water|Dump|Wifi|Outdoor|POI|Photo|Hotel)?.{0,4}\\d{4,}\\s*-\\s*\\d{2,}(?:\\w{0,3}|\\s*)|.{0,4})$",["i"]))>-1){return true}return false};this.getCombinedDate=function(a,c,b){var d=c.split(":");return a.clearTime(true).add(Date.HOUR,Number(d[0])).add(Date.MINUTE,Number(d[1])).add(Date.SECOND,Number(b))};this.dsCboTsect=new Ext.data.Store({url:this.lburl,reader:new Ext.data.JsonReader({root:"results",totalProperty:"totalrows",id:"swpid"},[{name:"date",mapping:"utc",type:"date",dateFormat:"U"},{name:"tsect",mapping:"tsect"},{name:"tsecttype",mapping:"tsecttype"},{name:"swpid",mapping:"swpid"},{name:"sfield1",mapping:"sfield1"},{name:"wpid",mapping:"wpid"},{name:"shorttripname",mapping:"sfield1",type:"string",convert:function(a){return Ext.util.Format.ellipsis(a,25)}}]),baseParams:{task:"gettsects",tsect:null,uid:this.lbuid,wtype:null}});this.detailFieldsAr=["ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9","sfield2","sfield3","sfield4"];this.wtypeToidx={8:2,9:0,10:7,11:1,12:8,13:4,14:6,15:5,16:3};this.clearDetailFields=function(){var a=this.editStore.getAt(0);for(var b=0;b<this.detailFieldsAr.length;b++){a.set(this.detailFieldsAr[b],null);this.calcPoints(this.detailFieldsAr[b],"")}};this.changeDetailFieldSet=function(c){var b=this.editStore.getAt(0);this.orefTdetail.getLayout().setActiveItem(this.wtypeToidx[Number(c)]);var a=this.orefTdetail.getLayout().activeItem;a.getForm().reset();a.getForm().loadRecord(b);if(this.lbeditstatus=="loaded"){if(this.isPatternName(this.orefSfield1.getValue())){var d=this.getCombinedDate(this.orefCboDate.getValue(),this.orefCboTime.getValue(),b.data.dtseconds);this.orefSfield1.setValue(this.getPatternName(c,d));this.vicinityDetails.sfield1=this.getPatternName(c,d)}}this.vicinityDetails.wtype=c;this.applyVicDetTpl("changeDetailFieldSet");this.lbdetailwtype=Number(c)};this.detailFSisDirty=function(){var b=this.editStore.getAt(0).data;var c=this.orefTdetail.getLayout().activeItem.getForm().getValues(false);for(var a=0;a<this.detailFieldsAr.length;a++){if(b[this.detailFieldsAr[a]]!==null&&b[this.detailFieldsAr[a]].length>0){return true}if(c[this.detailFieldsAr[a]]!=null){if(c[this.detailFieldsAr[a]].length>0){return true}}}return false};this.cboTypeBeforeSelect=function(a){if(this.lbdetailwtype==a.data.cbowtype){return true}var b=a.data.cbowtype;this.fireEvent("waypointwtypeupdate",this,b);if(this.detailFSisDirty()){var c=Ext.MessageBox.show({title:"Confirm waypoint type change",msg:"The Waypoint Detail tab contains data specific to the "+Logabout.Defs.eWtype[this.lbdetailwtype]+" waypoint type. Click proceed to delete this data and convert to the "+Logabout.Defs.eWtype[b]+" waypoint type. Click cancel to keep the detail data.",fn:function(d){if(d=="cancel"){this.orefCboWtype.setValue(this.lbdetailwtype)}else{this.clearDetailFields();this.changeDetailFieldSet(b)}},scope:this,buttons:{ok:"proceed",cancel:"cancel"},closable:false,modal:true})}else{this.changeDetailFieldSet(b)}return true};this.loadVicinityMarkers=function(d,b,e,c,a){Ext.getCmp(this.id+"_vicinity").lbLoadData(null,false,true,{params:{celat:d,celng:b,wtype:e,spanlat:c,spanlng:a}})};this.resultsCloseHandler=function(){this.switchVicinityMode(false)};this.switchVicinityMode=function(a){this.lbVicinityModeShowNearby=a;if(this.lbVicinityModeShowNearby){this.orefPositionCard.getLayout().setActiveItem(1)}else{this.orefPositionCard.getLayout().setActiveItem(0)}};this.moveMarkerToCenter=function(){this.fireEvent("waypointpositionUIchanged",this,{lat:null,lng:null,tocenter:true})};this.panMapToMarker=function(){this.fireEvent("waypointpanto",this)};this.checkNameQualify=function(a){if(this.isPatternName(a)){this.vicinityDetails.reqname=0}else{this.vicinityDetails.reqname=1}this.applyVicDetTpl("checkNameQualify")};this.lbCurrWptTpl=new Ext.XTemplate('<tpl if="swpid == 0">','<div class="uedit-curr-sec uedit-new">',"</tpl>",'<tpl if="swpid != 0">','<div class="uedit-curr-sec uedit-edit">',"</tpl>",'<div class="uedit-curr-left">','<tpl if="reqall == 1">','<div class="uedit-curr-status db-icon db-icon-founded">','<tpl if="swpid == 0">',"Add Place:","</tpl>",'<tpl if="swpid != 0">',"Edit Place:","</tpl>","</div>","</tpl>",'<tpl if="reqall != 1">','<tpl if="insidemaster == 1">','<div class="uedit-curr-status db-icon db-icon-greenflag">','<tpl if="swpid == 0">',"Log visit at:","</tpl>",'<tpl if="swpid != 0">',"Log visit at:","</tpl>","</div>","</tpl>",'<tpl if="insidemaster != 1">','<div class="uedit-curr-status db-icon db-icon-redflag">','<tpl if="swpid == 0">',"Add Log:","</tpl>",'<tpl if="swpid != 0">',"Edit Log:","</tpl>","</div>","</tpl>","</tpl>",'<div class="uedit-name uedit-ico {[ this.getItemClass(values) ]} uedit-action-panto db-mrk-linkitem">',"{[ fm.ellipsis(values.sfield1,30) ]}","</div>","</div>",'<div class="uedit-clear"></div>',"</div>",{getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getBulletPath:this.lbtplFunctions.getBulletPath});this.lbCurrWptTpl.compile();this.vicinityDetails={reqaccuracy:0,accuval:null,reqbuffer:0,reqname:0,reqall:0,cntvicinity:0,insidemaster:0,foundingloose:0,sfield1:null,wtype:null,swpid:0,mtype:null};this.vicDetTpl=new Ext.XTemplate('<div class="uedit-vicinity-main">','<div class="uedit-vicinity-top">','<tpl if="insidemaster == 0">','<tpl if="reqall == 1">','<div class="uedit-vicdetwrap uedit-master">',"</tpl>",'<tpl if="reqall != 1">','<div class="uedit-vicdetwrap">',"</tpl>",'<tpl if="reqall == 1">','<div class="uedit-qualifyas-place">','<div class="db-icon db-icon-founded">',"<div>","qualify as a place","</div>","</div>","</div>","</tpl>",'<tpl if="reqall != 1">','<div class="uedit-qualifyas-log">',"<div>","please fix the following:","</div>","</div>","</tpl>",'<div class="uedit-qualifylist">','<tpl if="reqaccuracy == 0">','<div class="db-icon db-icon-exclamation">',"Accuracy is {accuval} - please zoom in","</div>","</tpl>",'<tpl if="reqaccuracy == 1">','<div class="db-icon db-icon-tick">',"Accuracy is {accuval}","</div>","</tpl>",'<tpl if="reqaccuracy == 2">','<div class="db-icon db-icon-exclamation">',"Accuarcy is NOT set - please adjust the position","</div>","</tpl>",'<tpl if="reqbuffer == 0">','<div class="db-icon db-icon-exclamation">',"buffer distance too small","</div>","</tpl>",'<tpl if="reqbuffer == 1">','<div class="db-icon db-icon-tick">',"buffer distance ok","</div>","</tpl>",'<tpl if="reqname == 0">','<div class="db-icon db-icon-exclamation">',"name is default","</div>","</tpl>",'<tpl if="reqname == 1">','<div class="db-icon db-icon-tick">',"name is changed","</div>","</tpl>","</div>","</div>",'<tpl if="foundingloose == 1">','<div class="db-icon db-icon-error">',"Founding Log Entry changed. Click cancel to keep founding rights.","</div>","</tpl>","</tpl>",'<tpl if="insidemaster == 1">','<div class="uedit-vicdetwrap">','<div class="uedit-qualifyas-visit">','<div class="db-icon db-icon-greenflag">',"<div>","Logging in at:","</div>","</div>","</div>",'<div class="uedit-visitlist">','<div class="db-icon {[ this.getItemClass(values) ]}">','<div class="uedit-logatname">',"{[fm.ellipsis(values.sfield1,85)]}","</div>","</div>",'<tpl if="foundingloose == 1">','<div class="uedit-foundingloose">','<div class="db-icon db-icon-error">',"Place position was changed. You could loose your place points.","</div>","</div>","</tpl>","</div>","</div>","</tpl>","</div>",'<div class="uedit-vicinity-bot">','<tpl if="cntvicinity &gt; 0">','<div class="uedit-vicinity-showlink">','<div class="db-icon db-icon-go">','<span class="db-dv-linkitem db-li-showvicinity">show {cntvicinity} nearby places</span>',"</div>","</div>",'<div class="uedit-clear"></div>',"</tpl>","</div>","</div>",{getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype},getBulletPath:this.lbtplFunctions.getBulletPath});this.vicDetTpl.compile();this.applyVicDetTpl=function(a){if(this.vicinityDetails.insidemaster==1){this.switchVicinityMode(false)}if(this.vicinityDetails.reqaccuracy==1&&this.vicinityDetails.reqbuffer==1&&this.vicinityDetails.reqname==1){this.vicinityDetails.reqall=1}else{this.vicinityDetails.reqall=0}this.orefVicinityDetails.body.update(this.vicDetTpl.applyTemplate(this.vicinityDetails));if(this.orefVicinityDetails.body.child(".db-li-showvicinity")){this.orefVicinityDetails.body.child(".db-li-showvicinity").addClassOnOver("db-dv-linkover").on("click",function(){this.switchVicinityMode(true)},this)}this.orefCurrentMark.body.update(this.lbCurrWptTpl.applyTemplate(this.vicinityDetails));this.orefCurrentMark.body.child(".uedit-action-panto").addClassOnOver("db-mrk-linkover").on("click",function(){this.panMapToMarker()},this);if(this.vicinityDetails.swpid>0){if(this.vicinityDetails.mtype==1){this.orefButSave.setText("Save Place");this.orefButSave.setIconClass("db-icon-save");if(this.vicinityDetails.foundingloose==1){this.orefButSave.setDisabled(true)}else{this.orefButSave.setDisabled(false)}this.calcPoints("mtype",1)}else{this.orefButSave.setText("Save Log");this.orefButSave.setIconClass("db-icon-save");this.orefButSave.setDisabled(false);this.calcPoints("mtype",0)}}else{if(this.vicinityDetails.insidemaster==1){this.orefButSave.setText("Log In");this.orefButSave.setIconClass("db-icon-greenflag");this.orefButSave.setDisabled(false)}else{this.orefButSave.setText("Add Place");this.orefButSave.setIconClass("db-icon-founded");if(this.vicinityDetails.reqall==1){this.calcPoints("mtype",1);this.orefButSave.setDisabled(false)}else{this.calcPoints("mtype",0);this.orefButSave.setDisabled(true)}}}};this.getLatLngBox=function(e,f,g){var b=g/111.32;var a=g/Math.abs(111.32*Math.cos((Math.PI/180)*e));var i=e+b/2;var h=e-b/2;var d=f+a/2;var c=f-a/2;return[i,h,d,c]};this.vicinityLoadHandler=function(h,k,j,l){var g=parseFloat(l.params.celat);var i=parseFloat(l.params.celng);var b=l.params.wtype;var e=this.editStore.getAt(0).data;var f=null;var d=null;Ext.each(j,function(p,n,s){var r=parseFloat(p.data.lat);var o=parseFloat(p.data.lng);var m=this.getLatLngBox(r,o,Logabout.Defs.masterMinDist);if(g>=m[1]&&g<=m[0]&&i>=m[3]&&i<=m[2]&&b==p.data.wtype){f=p.data}var q=this.getLatLngBox(r,o,Logabout.Defs.masterMinDist*2);if(g>=q[1]&&g<=q[0]&&i>=q[3]&&i<=q[2]&&b==p.data.wtype){d=p.data.swpid}},this);if(d){if(d==e.swpid){this.vicinityDetails.reqbuffer=1}else{this.vicinityDetails.reqbuffer=0}}else{this.vicinityDetails.reqbuffer=1}this.vicinityDetails.cntvicinity=j.length;if(f==null){this.iLog("uedit: retItm == null");if(e.swpid>0){this.iLog("uedit: retItm == null: edit mode");this.orefSfield1.setValue(e.sfield1);this.vicinityDetails.sfield1=e.sfield1}else{if(this.vicinityDetails.insidemaster==1){this.iLog("uedit: retItm == null: add mode / prev insidemaster");var c=this.getCombinedDate(this.orefCboDate.getValue(),this.orefCboTime.getValue(),e.dtseconds);var a=this.getPatternName(this.orefCboWtype.getValue(),c);this.orefSfield1.setValue(this.getPatternName(this.orefCboWtype.getValue(),c));this.vicinityDetails.sfield1=this.getPatternName(this.orefCboWtype.getValue(),c)}}this.vicinityDetails.foundingloose=0;this.vicinityDetails.insidemaster=0;this.vicinityDetails.logAtSwpid=null}else{this.iLog("uedit: retItm != null");if(e.mtype==1){this.iLog("uedit: retItm != null: mtype==1");if(f.swpid!=e.swpid&&f.wtype==e.wtype){this.iLog("uedit: retItm != null: mtype==1: diff master of same type");this.vicinityDetails.insidemaster=1;this.vicinityDetails.foundingloose=1}else{this.iLog("uedit: retItm != null: mtype==1: same master or diff master/diff type");this.vicinityDetails.insidemaster=0;this.vicinityDetails.foundingloose=0}this.vicinityDetails.logAtSwpid=null}else{this.iLog("uedit: retItm != null: mtype!=1");this.vicinityDetails.insidemaster=1;this.vicinityDetails.sfield1=f.sfield1;this.vicinityDetails.wtype=f.wtype;this.orefSfield1.setValue(f.sfield1);if(this.orefCboWtype){this.orefCboWtype.setValue(f.wtype)}this.vicinityDetails.logAtSwpid=f.swpid}}this.checkNameQualify(this.orefSfield1.getValue())}},applyConfigItems:function(){var d=350-6;var f=13;var c=this.lbWidth-350;var a=25;var b=34;var e=this.lbHeight-a-b;Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,items:[{xtype:"panel",layout:"absolute",width:d,height:this.lbHeight,x:0,y:0,border:false,items:[{xtype:"panel",layout:"absolute",width:d,height:this.lbHeight-b,x:0,y:0,border:false,items:[{ref:"//orefCurrentMark",height:a,width:d,x:0,y:0,border:false,html:""},{xtype:"panel",ref:"//orefPositionCard",height:e,width:d,x:0,y:a,border:false,layout:"card",activeItem:0,deferredRender:false,cls:"uedit-panelpad-position",autoScroll:false,items:[{xtype:"panel",layout:"absolute",height:e,width:d,x:0,y:0,border:false,items:[{xtype:"panel",layout:"absolute",height:23,width:d-f,x:0,y:0,cls:"uedit-panelpad",border:false,items:[{xtype:"trigger",height:23,width:d-f-40-20,x:0,y:0,ref:"/////orefGeoCodeTrig",selectOnFocus:true,allowBlank:true,emptyText:"move to: <eg. Bishop, CA>",maxLength:100,hideLabel:true,listeners:{afterrender:function(g){g.getEl().addKeyMap({key:Ext.EventObject.ENTER,fn:function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())},scope:this})},scope:this},onTriggerClick:(function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())}).createDelegate(this),triggerClass:"x-form-search-trigger"},{height:23,width:20,x:d-f-40,y:0,border:false,html:'<div class="bc-action-grp"><div class="bc-action-movecenter db-icon-map db-icon"></div></div>',listeners:{afterrender:function(g){g.body.child(".bc-action-movecenter").addClassOnOver("db-mrk-linkover").on("click",function(){this.moveMarkerToCenter()},this)},scope:this}}]},{xtype:"panel",ref:"////orefVicinityDetails",layout:"absolute",height:e-23,width:d-f,x:0,y:23,cls:"uedit-panelpad",border:false}]},{xtype:"panel",layout:"fit",width:d-f,height:e,autoScroll:false,border:false,items:[new Logabout.Demo.MemoryPanel.UserEditVicinity({id:this.id+"_vicinity",lbParentOwner:this,border:false,lbshowtitlebar:true,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"getvicinity",sesstoken:this.lbdsess},lbshowwithar:this.id+"_mrkcol",lbusepager:false,listeners:{lbstoreload:this.vicinityLoadHandler,scope:this}})]}]}]},{xtype:"panel",border:false,layout:"absolute",height:b,y:this.lbHeight-b,width:d,x:0,items:[{xtype:"button",ref:"/orefButCancel",height:30,y:2,width:70,x:2,text:"Cancel",tooltip:"Cancel",iconCls:"db-icon-cancel",iconAlign:"left",cls:"db-button",handler:this.cancelWaypoint.createDelegate(this)},{xtype:"button",ref:"//orefButSave",height:30,y:2,width:100,x:d-105,text:"Save",tooltip:"Save",iconCls:"db-icon-save",iconAlign:"left",cls:"db-button",handler:this.saveWaypoint.createDelegate(this)}]}]},{xtype:"tabpanel",width:this.lbWidth-350,height:this.lbHeight,x:350,y:0,cls:"bp-combopanel-edittab",layoutOnTabChange:true,deferredRender:false,ref:"orefTabpanel",activeTab:0,plain:true,bodyBorder:false,border:false,bodyStyle:"padding: 2px 0px 0px 0px;",listeners:{beforetabchange:function(g,i,h){if(h){if(h.id==this.orefTbasic.id){if(!h.getForm().isValid()){return false}}}},scope:this},items:[{xtype:"form",ref:"/orefTbasic",title:"basic",autoHeight:true,labelWidth:80,items:[{xtype:"fieldset",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,style:"padding: 5px; margin-bottom: 3px;",items:[{xtype:"textfield",ref:"///orefSfield1",fieldLabel:"Name",listeners:{change:function(h,i,g){this.calcPoints(h.name,i);this.vicinityDetails.sfield1=i;this.checkNameQualify(i);if(h.isValid()){this.lbuserchangedname=true}},scope:this},name:"sfield1",selectOnFocus:true,allowBlank:false,maxLength:100,width:308},{xtype:"textarea",listeners:{change:function(h,i,g){this.calcPoints(h.name,i)},scope:this},fieldLabel:"Description",name:"description",emptyText:"<enter a description here>",height:50,maxLength:160,width:308},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{xtype:"combo",ref:"/////orefCboWtype",fieldLabel:"Type",name:"wtypename",hiddenName:"wtype",width:115,allowBlank:false,forceSelection:true,value:9,listWidth:150,emptyText:"Select a type...",displayField:"cbowtypedesc",valueField:"cbowtype",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true,store:new Ext.data.SimpleStore({fields:["cbowtype","cbowtypedesc","typeorder","wimg"],data:Logabout.Defs.NoGoaleWtypes,sortInfo:{field:"typeorder",direction:"ASC"}}),tpl:new Ext.XTemplate('<tpl for=".">','<div class="x-combo-list-item">',"<div>",'<img class="gt-wtype-pic" src="'+Logabout.Defs.imagesDirPath+'mrk/{wimg}"></img>','<span class="gt-wtype-txt">{cbowtypedesc}</span>','<div class="gtclear"></div>',"</div>","</div>","</tpl>"),listeners:{beforeselect:function(i,g,h){this.cboTypeBeforeSelect(g)},scope:this}}]},{layout:"form",columnWidth:0.5,labelWidth:45,border:false,items:[{xtype:"combo",fieldLabel:"Trip",ref:"////orefCboTrip",width:115,name:"tsectfriendly",emptyText:"choose trip",hiddenName:"tsect",allowBlank:false,listWidth:220,pageSize:10,store:this.dsCboTsect,forceSelection:true,displayField:"shorttripname",valueField:"tsect",typeAhead:true,mode:"remote",triggerAction:"all",valueNotFoundText:"click to show name",listeners:{beforequery:function(g){if(this.dsCboTsect.getCount()==1){this.dsCboTsect.reload()}},scope:this},lazyRender:true}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{xtype:"datefield",ref:"/////orefCboDate",fieldLabel:"Date",labelSeparator:":",name:"utc",allowBlank:true,width:115,format:"m/d/Y"}]},{layout:"form",labelWidth:45,border:false,columnWidth:0.5,items:[{xtype:"timefield",ref:"/////orefCboTime",fieldLabel:"Time",labelSeparator:":",name:"dttime",width:115,increment:30,format:"H:i"}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",border:false,columnWidth:0.7,items:[{xtype:"checkbox",name:"ifield12",inputValue:"1",boxLabel:"Show in Gadget",hideLabel:true,width:180,disabled:false}]}]}]}]},{xtype:"panel",ref:"/orefTdetail",title:"detail",border:false,layout:"card",activeItem:0,defaults:{border:false,height:200,autoWidth:true,autoScroll:true},items:[{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfscamp",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsdump",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsfuel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfshotel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsoutdoor",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsphoto",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfspoi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswater",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswifi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]}]},{xtype:"form",ref:"/orefTposition",title:"position",border:false,height:this.lbHeight,autoScroll:true,items:[{xtype:"fieldset",title:"Position Information",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,labelSeparator:":",defaults:{width:150},items:[{xtype:"numberfield",fieldLabel:"Lat",name:"lat",listeners:{change:function(h,i,g){if(h.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:i,lng:null})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-90,maxValue:90,allowBlank:false},{xtype:"numberfield",fieldLabel:"Lng",name:"lng",listeners:{change:function(h,i,g){if(h.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:null,lng:i})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-180,maxValue:180,allowBlank:false},{xtype:"numberfield",fieldLabel:"Alt",name:"alt",allowNegative:true,decimalPrecision:1,minValue:-1000,maxValue:55000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Zoom",name:"gmapzoom",disabled:true,allowBlank:true},{xtype:"textfield",fieldLabel:"City",name:"sfield5",listeners:{change:function(h,i,g){if(Ext.isEmpty(i)){this.userChangedFields[h.name]=false}else{this.userChangedFields[h.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"State/Prov",name:"sfield6",listeners:{change:function(h,i,g){if(Ext.isEmpty(i)){this.userChangedFields[h.name]=false}else{this.userChangedFields[h.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"Country",name:"sfield7",listeners:{change:function(h,i,g){if(Ext.isEmpty(i)){this.userChangedFields[h.name]=false}else{this.userChangedFields[h.name]=true}},scope:this},allowBlank:true}]}]},{xtype:"form",ref:"/orefTphoto",title:"photo",autoHeight:true,layoutConfig:{labelWidth:100,labelSeparator:":"},items:[{xtype:"fieldset",title:"",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,items:[{ref:"///orefPhotoImgPanel",border:false,html:'<div><img src=""></img>'}]},{xtype:"fieldset",title:"",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,items:[{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,labelWidth:1,border:false,items:[{xtype:"button",text:"Link with Picasa",handler:function(){if(!this.photoLinkerPicasa){this.photoLinkerPicasa=new Logabout.PhotoLinker.Picasa();this.photoLinkerPicasa.on("picasawaypointupdate",this.picasaUpdateHandler,this)}this.photoLinkerPicasa.show()},scope:this}]},{layout:"form",labelWidth:1,border:false,columnWidth:0.5,items:[{xtype:"button",text:"Clear Photo",handler:function(){this.orefTphoto.find("name","ifield10")[0].setValue(null);this.orefTphoto.find("name","sfield8")[0].setValue("");this.calcPoints("sfield8","");var g=this.orefPhotoImgPanel.getEl().child("img");if(g){g.set({src:""});g.setStyle({display:"none"})}},scope:this}]}]}]},{xtype:"fieldset",title:"",style:"display: none",autoHeight:true,autoWidth:true,collapsible:true,collapsed:false,defaults:{labelWidth:30,width:100},items:[{xtype:"numberfield",fieldLabel:"photo type",name:"ifield10"},{xtype:"textfield",fieldLabel:"photo path",name:"sfield8"}]}]},{xtype:"panel",ref:"/orefTpoints",title:"points",autoHeight:true,html:"dada",listeners:{activate:function(g){this.tryBlurFocus()},scope:this}}]}]})},executeCustom:function(){this.on({render:function(){if(this.footer){var a=Ext.DomHelper.insertFirst(this.footer.child(".x-panel-btns"),[{tag:"img",src:"fourfourty/sgicons/done.gif",style:"float:left;padding-top:4px"},{tag:"div",cls:"waccuracy-cont",html:'<span class="waccuracy-lbl">accu:</span><span class="waccuracy-val">0</span>'}],true)}},scope:this});this.lbsignalController.on("userstatsupdated",function(a){this.fireEvent("quicklogupdatesaved",a)},this);this.moveMarkerReqHandler=function(e,a,c,b,d){this.fireEvent("waypointToVicinityPosition",this,{lat:parseFloat(c),lng:parseFloat(b),wtype:d})};if(Logabout.Defs.ADtest){if(!this.ADTestWindow){this.ADTestWindow=new Logabout.Demo.ADTestWindow({id:"adtestwindow",renderTo:Ext.getBody(),lbContainerW:700,lbContainerH:240,lbParentOwner:this,pageX:100,pageY:350})}this.ADTestWindow.show()}},createMarkerConfig:function(){this.customMarkerConfig={polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,markerType:this.markerType,reverseGeo:this.lbReverseGeo,wptEditPanel:this,showWith:[this.id+"_vicinity"],polyMasterShow:true,polyMasterStyles:{stroke:{color:"#D67959",weight:2,opacity:1},fill:{color:"#D6A190",weight:2,opacity:0.2}},polyMasterDefaultKmRadius:0.2,markerTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">Drag this marker to adjust the position of your waypoint.</div>'],altTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">This is a vicinity waypoint.</div>'],markerTemplateFunctions:this.lbtplFunctions}}});Ext.namespace("Logabout.Demo");Logabout.Demo.UserEditPanel.Trip=Ext.extend(Logabout.Demo.UserEditPanel,{lbtitle:"Trip",markerType:"trip-1",addToHistory:false,containerButtons:true,prepareHide:function(){if(Ext.getCmp("cbowtype")){Ext.getCmp("cbowtype").collapse()}},prepareShow:function(a){if(this.lbeditstatus=="new"||this.lbeditstatus=="edit"){if(!a){a=this.editStore.getAt(0)}Ext.getCmp("ttTripInfo").getForm().loadRecord(a);Ext.getCmp("tripTab").setActiveTab("ttTripInfo");this.lbeditstatus="loaded"}},saveWaypoint:function(){if(!Ext.getCmp("ttTripInfo").getForm().isValid()){Ext.getCmp("tripTab").setActiveTab("ttTripInfo")}else{var b=this.editStore.getAt(0);var a=new Object();Ext.getCmp("tripTab").items.each(function(c){if(c.isXType("form")){c.getForm().updateRecord(b)}else{if(c.findByType("form")[0]){c.findByType("form")[0].getForm().updateRecord(b)}}Ext.apply(a,b.getChanges())});Ext.apply(a,b.data);a.utc=b.data.utc.format("U").toString();Ext.apply(this.saveEventArgs,{eventSource:this,lbuid:this.lbuid,tsect:a.tsect,tripname:a.sfield1,oldswpid:null,wtype:null,sfield1:null});if(this.lbdsess==0){Ext.Msg.show({title:"Save Changes?",msg:"You are not logged in. Would you like to save your changes as a guest user?",buttons:Ext.Msg.YESNOCANCEL,fn:function(c){if(c=="yes"){this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}},scope:this,icon:Ext.MessageBox.QUESTION})}else{this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}}},createConfigObjects:function(){return},applyConfigItems:function(){Ext.apply(this,{width:this.lbEditW,height:this.lbEditH,layout:"fit",items:[{xtype:"tabpanel",layoutOnTabChange:true,deferredRender:false,id:"tripTab",activeTab:0,plain:true,bodyBorder:false,border:false,bodyStyle:"padding: 2px 0px 0px 0px;",listeners:{beforetabchange:function(a,c,b){if(b){if(b.id=="wTbasic"){if(!b.getForm().isValid()){return false}}}},scope:this},items:[{xtype:"form",id:"ttTripInfo",title:"Trip Info",autoHeight:true,labelWidth:50,items:[{xtype:"fieldset",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,style:"padding: 5px; margin-bottom: 3px;",items:[{xtype:"textfield",id:"ttTripInfo-sfield1",fieldLabel:"Name",listeners:{change:function(b,c,a){if(b.isValid()){this.lbuserchangedname=true}},scope:this},name:"sfield1",selectOnFocus:true,allowBlank:false,maxLength:100,width:215},{xtype:"textarea",fieldLabel:"description",name:"description",hideLabel:true,emptyText:"<enter a description here>",height:50,maxLength:500,width:270}]}]}]}]})},executeCustom:function(){this.on({render:function(){var a=Ext.DomHelper.insertFirst(this.footer.child(".x-panel-btns"),[{tag:"img",src:"fourfourty/sgicons/done.gif",style:"float:left;padding-top:4px"}],true)},scope:this})}});Ext.namespace("Logabout.Demo");Logabout.Demo.UserEditPanel.Wizard=Ext.extend(Logabout.Demo.UserEditPanel,{lbReverseGeo:true,markerType:"drageditvicinity",addToHistory:false,containerButtons:false,lbVicinityModeShowNearby:true,lbVicinityHaveNearbyRecs:false,lbVicinityInsideMaster:false,positionAccuOk:false,updateAccuracy:function(c,b){if(typeof this.orefAccuZoomTxt!="undefined"&&typeof this.orefAccuTxt!="undefined"&&typeof this.orefAccuZoomSlider!="undefined"){var a="";var d="";this.positionAccuOk=false;if(b){if(this.accuracyMap[c].warn==1){a='<div class="db-accu-disp db-icon-exclamation">Accuracy is '+this.accuracyMap[c].txt+" - please zoom in</div>"}else{a='<div class="db-accu-disp db-icon-tick">Accuracy is '+this.accuracyMap[c].txt+"</div>";this.positionAccuOk=true}}else{if(this.accuracyMap[c].warn==1){a='<div class="db-accu-disp db-icon-exclamation">Accuracy is '+this.accuracyMap[c].txt+" - please zoom in</div>"}else{a='<div class="db-accu-disp db-icon-tick">Zoom is '+this.accuracyMap[c].txt+"</div>";d='<div class="db-accu-disp db-icon-exclamation">Accuarcy is NOT set - please adjust the position</div>'}}this.orefAccuZoomTxt.getEl().update(a);this.orefAccuTxt.getEl().update(d);this.orefAccuZoomSlider.setValue(c);this.checkPositionTabValid()}},prepareHide:function(){if(this.orefCboWtype){this.orefCboWtype.collapse()}if(this.orefCboDate){if(this.orefCboDate.menu){this.orefCboDate.menu.hide()}}if(this.orefCboTime){this.orefCboTime.collapse()}if(this.orefCboTrip){this.orefCboTrip.collapse()}var c=this.orefTdetail.findByType("combo");for(var b=0,a=c.length;b<a;b++){c[b].collapse()}},prepareShow:function(a){this.updatePointsDisplay();if(this.lbeditstatus=="new"||this.lbeditstatus=="edit"){if(this.orefGeoCodeTrig){this.orefGeoCodeTrig.setValue(null)}if(!a){a=this.editStore.getAt(0)}this.userChangedFields={};this.pointsTally=new Object();this.orefTbasic.getForm().reset();this.orefTbasic.getForm().loadRecord(a);this.orefTbasic.find("name","sfield1")[0].focus(true,true);this.lbuserchangedname=false;if(a.data.sfield1==null){this.orefTbasic.find("name","sfield1")[0].setValue(this.getPatternName(a.data.wtype,a.data.utc))}this.changeDetailFieldSet(a.data.wtype);this.orefTbasicOther.getForm().reset();this.orefTbasicOther.getForm().loadRecord(a);this.orefTposition.getForm().reset();this.orefTposition.getForm().loadRecord(a);this.orefTabpanel.setActiveTab(0);this.lbeditstatus="loaded";this.calcPoints(null,null,true);this.switchPositionCard(0)}},saveWaypoint:function(){if(!this.orefTbasic.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTbasic.id)}else{if(!this.orefTdetail.getLayout().activeItem.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTdetail.id)}else{if(!this.orefTposition.getForm().isValid()){this.orefTabpanel.setActiveTab(this.orefTposition.id)}else{var b=this.editStore.getAt(0);var a=new Object();this.orefTbasic.getForm().updateRecord(b);this.orefTbasicOther.getForm().updateRecord(b);this.orefTdetail.getLayout().activeItem.getForm().updateRecord(b);this.orefTposition.getForm().updateRecord(b);Ext.apply(a,b.getChanges());Ext.apply(a,b.data);a.utc=this.getCombinedDate(b.data.utc,b.data.dttime,b.data.dtseconds).format("U").toString();a.ifield13=this.pointsTotal;var c=this.dsCboTsect.query("tsect",a.tsect);Ext.apply(this.saveEventArgs,{eventSource:this,lbuid:this.lbuid,tsect:a.tsect,tripname:(c!=null&&c.first()?c.first().data.sfield1:null),oldswpid:(a.swpid?a.swpid:"new"),wtype:a.wtype,sfield1:a.sfield1});if(this.lbdsess==0){Ext.Msg.show({title:"Save Changes?",msg:"You are not logged in. Would you like to save your changes as a guest user?",buttons:Ext.Msg.YESNOCANCEL,fn:function(d){if(d=="yes"){this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}},scope:this,icon:Ext.MessageBox.QUESTION})}else{this.updateWptData({swpid:b.data.swpid,wtype:b.data.wtype,fields:a})}}}}},createConfigObjects:function(){this.getPatternName=function(b,a){return Logabout.Defs.eWtype[b]+" #"+(a.format("ymd-Hi")).toString()};this.isPatternName=function(a){if(a.search(new RegExp("^(?:\\s*(?:Trip|Fuel|Camp|Water|Dump|Wifi|Outdoor|POI|Photo|Hotel)?.{0,4}\\d{4,}\\s*-\\s*\\d{2,}(?:\\w{0,3}|\\s*)|.{0,4})$",["i"]))>-1){return true}return false};this.getCombinedDate=function(a,c,b){var d=c.split(":");return a.clearTime(true).add(Date.HOUR,Number(d[0])).add(Date.MINUTE,Number(d[1])).add(Date.SECOND,Number(b))};this.dsCboTsect=new Ext.data.Store({url:this.lburl,reader:new Ext.data.JsonReader({root:"results",totalProperty:"totalrows",id:"swpid"},[{name:"date",mapping:"utc",type:"date",dateFormat:"U"},{name:"tsect",mapping:"tsect"},{name:"tsecttype",mapping:"tsecttype"},{name:"swpid",mapping:"swpid"},{name:"sfield1",mapping:"sfield1"},{name:"wpid",mapping:"wpid"},{name:"shorttripname",mapping:"sfield1",type:"string",convert:function(a){return Ext.util.Format.ellipsis(a,25)}}]),baseParams:{task:"gettsects",tsect:null,uid:this.lbuid,wtype:null}});this.detailFieldsAr=["ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9","sfield2","sfield3","sfield4"];this.wtypeToidx={8:2,9:0,10:7,11:1,12:8,13:4,14:6,15:5,16:3};this.clearDetailFields=function(){var a=this.editStore.getAt(0);for(var b=0;b<this.detailFieldsAr.length;b++){a.set(this.detailFieldsAr[b],null);this.calcPoints(this.detailFieldsAr[b],"")}};this.changeDetailFieldSet=function(c){var b=this.editStore.getAt(0);this.orefTdetail.getLayout().setActiveItem(this.wtypeToidx[Number(c)]);var a=this.orefTdetail.getLayout().activeItem;a.getForm().reset();a.getForm().loadRecord(b);if(this.lbeditstatus=="loaded"){if(this.isPatternName(this.orefSfield1.getValue())){var d=this.getCombinedDate(this.orefCboDate.getValue(),this.orefCboTime.getValue(),b.data.dtseconds);this.orefSfield1.setValue(this.getPatternName(c,d))}}this.lbdetailwtype=Number(c)};this.detailFSisDirty=function(){var b=this.editStore.getAt(0).data;var c=this.orefTdetail.getLayout().activeItem.getForm().getValues(false);for(var a=0;a<this.detailFieldsAr.length;a++){if(b[this.detailFieldsAr[a]]!==null&&b[this.detailFieldsAr[a]].length>0){return true}if(c[this.detailFieldsAr[a]]!=null){if(c[this.detailFieldsAr[a]].length>0){return true}}}return false};this.cboTypeBeforeSelect=function(a){if(this.lbdetailwtype==a.data.cbowtype){return true}var b=a.data.cbowtype;this.fireEvent("waypointwtypeupdate",this,b);if(this.detailFSisDirty()){var c=Ext.MessageBox.show({title:"Confirm waypoint type change",msg:"The Waypoint Detail tab contains data specific to the "+Logabout.Defs.eWtype[this.lbdetailwtype]+" waypoint type. Click proceed to delete this data and convert to the "+Logabout.Defs.eWtype[b]+" waypoint type. Click cancel to keep the detail data.",fn:function(d){if(d=="cancel"){this.orefCboWtype.setValue(this.lbdetailwtype)}else{this.clearDetailFields();this.changeDetailFieldSet(b)}},scope:this,buttons:{ok:"proceed",cancel:"cancel"},closable:false,modal:true})}else{this.changeDetailFieldSet(b)}return true};this.lbCustomFunc=function(b){var c=this.orefPositionCard.getLayout().activeItem.id;var a=this.orefPositionCard.getLayout().activeItem.ownerCt.items.indexOfKey(c);a++;if(a>3){a=0}this.orefPositionCard.getLayout().setActiveItem(a)};this.switchPositionCard=function(c){var b=this.orefPositionCard.getLayout().activeItem.id;var a=this.orefPositionCard.getLayout().activeItem.ownerCt.items.indexOfKey(b);if(c==0){this.lbVicinityModeShowNearby=true;this.positionAccuOk=false;this.checkPositionTabValid()}else{if(a==1&&c==2){this.lbVicinityModeShowNearby=true}else{if(a==2&&c==1){this.lbVicinityModeShowNearby=false}}}this.orefPositionCard.getLayout().setActiveItem(c)};this.loadVicinityMarkers=function(d,b,e,c,a){Ext.getCmp(this.id+"_vicinity").lbLoadData(null,false,true,{params:{celat:d,celng:b,wtype:e,spanlat:c,spanlng:a}})};this.resultsCloseHandler=function(){this.switchPositionCard(1)};this.checkPositionTabValid=function(){if(this.lbVicinityInsideMaster){this.orefPostabButNext.setDisabled(false);return true}else{if(this.positionAccuOk==true&&this.PosChangedFromInitial()==true){this.orefPostabButNext.setDisabled(false);return true}else{this.orefPostabButNext.setDisabled(true);return false}}};this.nextWizTab=function(){var b=this.orefTabpanel.getActiveTab().id;var a=this.orefTabpanel.getActiveTab().ownerCt.items.indexOfKey(b);a++;if(a<3){this.orefTabpanel.activate(a)}};this.lbLinkedMastertpl=new Ext.XTemplate('<div class="results-regulartitle wiz-bkg">',"existing place: your log will be positioned at:","</div>",'<div class="results-datalist">','<tpl for=".">','<div id="{[ this.getMyId() ]}_master_{swpid}" class="results-wrap">','<div class="results-data-section">','<div class="results-ico {[ this.getItemClass(values) ]}">','<div class="results-item-left">',"{[fm.ellipsis(values.sfield1,85)]}","</div>",'<div class="results-clear"></div>',"</div>","</div>","</div>","</tpl>","</div>",'<div class="results-regulartitle">',"want to log it somewhere else? change the position by dragging the red marker or type a new place name in the search box above.","</div>",{getMyId:(function(){return this.id}).createDelegate(this),getItemClass:function(a){return"dbi-wpt-"+a.wtype}});this.lbLinkedMastertpl.compile()},applyConfigItems:function(){var b=350-6;var e=13;var a=this.lbWidth-350;var d=this.lbHeight-6;var c=d-35;Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,items:[{xtype:"panel",layout:"card",width:b,height:d,x:3,y:3,bodyStyle:"background-color: #EBFFD9;",ref:"orefCardWiz",activeItem:0,border:false,defaults:{bodyStyle:"background-color: #EBFFD9;",border:false},items:[{xtype:"panel",layout:"absolute",height:d,y:0,width:b,x:0,defaults:{bodyStyle:"background-color: #EBFFD9;",border:false},items:[{html:"<div>Welcome to the new log wizard.</div><div>First: Set the position of your log. Start by typing a city or state name in the search box, or just drag the red map marker to a spot on the map.</div>"},{xtype:"button",height:30,y:c,width:70,x:2,disabled:false,text:"Cancel",tooltip:"Cancel waypoint",iconCls:"db-icon-cancel",iconAlign:"left",cls:"db-button",handler:this.cancelWaypoint.createDelegate(this)},{xtype:"button",height:30,y:c,width:100,x:b-105,ref:"//orefPostabButNext",disabled:true,text:"go to step 2",tooltip:"click for next step",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.nextWizTab.createDelegate(this)}]},{xtype:"panel",layout:"absolute",height:d,y:0,width:b,x:0,defaults:{bodyStyle:"background-color: #EBFFD9;",border:false},items:[{html:"<div>Next: Change the name, add a description and choose the type of log.</div>"},{xtype:"button",height:30,y:c,width:70,x:2,disabled:false,text:"Cancel",tooltip:"Cancel waypoint",iconCls:"db-icon-cancel",iconAlign:"left",cls:"db-button",handler:this.cancelWaypoint.createDelegate(this)},{xtype:"button",height:30,y:c,width:100,x:b-105,text:"go to step 3",tooltip:"click for next step",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.nextWizTab.createDelegate(this)}]},{xtype:"panel",layout:"absolute",height:d,y:0,width:b,x:0,defaults:{bodyStyle:"background-color: #EBFFD9;",border:false},items:[{html:"<div>Optionally add log details then click save to complete the wizard.</div>"},{xtype:"button",height:30,y:c,width:70,x:2,disabled:false,text:"Cancel",tooltip:"Cancel waypoint",iconCls:"db-icon-cancel",iconAlign:"left",cls:"db-button",handler:this.cancelWaypoint.createDelegate(this)},{xtype:"button",height:30,y:c,width:100,x:b-105,ref:"//orefButSave",text:"Save",tooltip:"click to save",iconCls:"db-icon-go",iconAlign:"left",cls:"db-button",handler:this.saveWaypoint.createDelegate(this)}]},{html:"<div>Next: Change the name, add a description and choose the type of waypoint that you would like to create.</div>"},{html:"<div>Optionally add details about the waypoint then click save to complete the wizard.</div>"},{html:"Very Important! Accurately set the position of your waypoint. To start you can type a city and state in the search box or just drag the red map marker to the desired location."},{html:"Your waypoint is ready to be saved."}]},{xtype:"tabpanel",width:a,height:this.lbHeight,x:350,y:0,cls:"bp-combopanel-edittab",layoutOnTabChange:true,deferredRender:false,ref:"orefTabpanel",activeTab:0,plain:true,bodyBorder:false,border:false,bodyStyle:"padding: 2px 0px 0px 0px;",listeners:{beforetabchange:function(f,h,g){if(g){if(g.id==this.orefTbasic.id){if(!g.getForm().isValid()){return false}}else{if(g.id==this.orefPositionCard.id){if(!this.checkPositionTabValid()){return false}}}}},tabchange:function(g,f){if(typeof this.orefCardWiz!="undefined"){switch(g.items.indexOf(f)){case 0:this.orefCardWiz.getLayout().setActiveItem(0);break;case 1:this.orefCardWiz.getLayout().setActiveItem(1);break;case 2:this.orefCardWiz.getLayout().setActiveItem(2);break;case 3:this.orefCardWiz.getLayout().setActiveItem(3);break}}if(f.id==this.orefTdetail.id){this.orefButSave.setDisabled(false)}else{this.orefButSave.setDisabled(true)}},afterlayout:function(f){f.hideTabStripItem(3);f.hideTabStripItem(4);f.hideTabStripItem(5)},scope:this},items:[{xtype:"panel",ref:"/orefPositionCard",title:"step 1: position",height:this.lbHeight-55-35-6,width:a,border:false,layout:"card",activeItem:0,deferredRender:false,cls:"db-panelwrap",autoScroll:false,items:[{xtype:"panel",border:false,layout:"absolute",items:[{height:20,width:a-e,x:0,y:0,border:false,html:"type a city or state name"},{xtype:"panel",height:30,width:a-e,x:0,y:22,border:false,items:[{xtype:"trigger",ref:"////orefGeoCodeTrig",selectOnFocus:true,allowBlank:true,emptyText:"<eg. Bishop, CA or 129 Elm St, Houston>",maxLength:100,width:b-e,hideLabel:true,listeners:{afterrender:function(f){f.getEl().addKeyMap({key:Ext.EventObject.ENTER,fn:function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())},scope:this})},scope:this},onTriggerClick:(function(){this.fireEvent("waypointgeocoderequest",this,this.orefGeoCodeTrig.getValue())}).createDelegate(this),triggerClass:"x-form-search-trigger"}]},{height:20,width:a-e,x:0,y:65,border:false,html:"OR drag the red map marker to a new spot"}]},{xtype:"panel",border:false,layout:"absolute",items:[{height:20,width:a-e,x:0,y:0,border:false,html:'<div class="bc-action-text wiz-bkg">new place: drag the red marker to position the new place</div>'},{xtype:"panel",layout:"absolute",border:false,y:25,height:120,x:0,width:a-e,items:[{xtype:"panel",y:5,height:20,x:5,width:a-e-48,border:false,cls:"bc-slider",html:"<div></div>"},{xtype:"slider",ref:"////orefAccuZoomSlider",y:25,height:20,x:5,width:a-e-48,increment:1,minValue:0,maxValue:24,animate:false,listeners:{change:function(g,f){this.fireEvent("waypointzoomrequest",this,null,f)},scope:this}},{ref:"////orefAccuZoomTxt",y:50,height:20,x:5,width:a-e-48,border:false,html:"zoom text"},{ref:"////orefAccuTxt",y:75,height:40,x:5,width:a-e-48,border:false,html:"accu text"}]},{ref:"///orefWizNewActions",height:40,width:a-e,x:0,y:150,border:false,html:'<div class="bc-action-grp"><div class="bc-action-startover db-mrk-linkitem db-icon-go db-icon">reset position</div><div class="bc-action-shownearby db-mrk-linkitem db-icon-go db-icon">show 5 nearby places</div></div>',listeners:{afterrender:function(f){f.body.child(".bc-action-startover").addClassOnOver("db-mrk-linkover").on("click",function(){this.switchPositionCard(0)},this);f.body.child(".bc-action-shownearby").addClassOnOver("db-mrk-linkover").on("click",function(){this.switchPositionCard(2)},this)},scope:this}}]},{xtype:"panel",layout:"absolute",border:false,items:[new Logabout.Demo.MemoryPanel.UserEditVicinityWiz({id:this.id+"_vicinity",lbParentOwner:this,height:140,y:0,width:a-e,x:0,border:false,lbshowtitlebar:false,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"getvicinity",sesstoken:this.lbdsess},lbshowwithar:this.id+"_mrkcol",lbusepager:false}),{height:20,width:a-e,x:0,y:150,border:false,html:'<div class="bc-action-grp"><div class="bc-action-add db-mrk-linkitem db-icon-add db-icon">add a new place</div></div>',listeners:{afterrender:function(f){f.body.child(".bc-action-add").addClassOnOver("db-mrk-linkover").on("click",function(){this.switchPositionCard(1)},this)},scope:this}}]},{xtype:"panel",border:false,layout:"absolute",items:[{ref:"///orefMasterLinkedName",height:50,width:a-e,x:0,y:0,border:false,html:"linked to"},{height:20,width:a-e,x:0,y:150,border:false,html:'<div class="bc-action-grp"><div class="bc-action-startover db-mrk-linkitem db-icon-go db-icon">reset position</div></div>',listeners:{afterrender:function(f){f.body.child(".bc-action-startover").addClassOnOver("db-mrk-linkover").on("click",function(){this.switchPositionCard(0)},this)},scope:this}}]}]},{xtype:"form",ref:"/orefTbasic",title:"step 2: name and type",autoHeight:true,labelWidth:80,items:[{xtype:"fieldset",title:"Basic Information",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,style:"padding: 5px; margin-bottom: 3px;",items:[{xtype:"textfield",ref:"///orefSfield1",fieldLabel:"Name",listeners:{change:function(g,h,f){this.calcPoints(g.name,h);if(g.isValid()){this.lbuserchangedname=true}},scope:this},name:"sfield1",selectOnFocus:true,allowBlank:false,maxLength:100,width:308},{xtype:"textarea",listeners:{change:function(g,h,f){this.calcPoints(g.name,h)},scope:this},fieldLabel:"Description",name:"description",emptyText:"<enter a description here>",height:50,maxLength:160,width:308},{xtype:"combo",ref:"///orefCboWtype",fieldLabel:"Type",name:"wtypename",hiddenName:"wtype",width:115,allowBlank:false,forceSelection:true,value:9,listWidth:150,emptyText:"Select a type...",displayField:"cbowtypedesc",valueField:"cbowtype",typeAhead:true,mode:"local",triggerAction:"all",lazyRender:true,store:new Ext.data.SimpleStore({fields:["cbowtype","cbowtypedesc","typeorder","wimg"],data:Logabout.Defs.NoGoaleWtypes,sortInfo:{field:"typeorder",direction:"ASC"}}),tpl:new Ext.XTemplate('<tpl for=".">','<div class="x-combo-list-item">',"<div>",'<img class="gt-wtype-pic" src="'+Logabout.Defs.imagesDirPath+'mrk/{wimg}"></img>','<span class="gt-wtype-txt">{cbowtypedesc}</span>','<div class="gtclear"></div>',"</div>","</div>","</tpl>"),listeners:{beforeselect:function(h,f,g){this.cboTypeBeforeSelect(f)},scope:this}}]}]},{xtype:"panel",ref:"/orefTdetail",title:"step 3: detail",border:false,layout:"card",activeItem:0,defaults:{border:false,height:200,autoWidth:true,autoScroll:true},items:[{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfscamp",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsdump",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsfuel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfshotel",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsoutdoor",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfsphoto",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfspoi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswater",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]},{xtype:"form",defaults:{autoHeight:true},items:[{xtype:"lbfswifi",listeners:{lbvalchanged:this.fsValChangedHandler,scope:this}}]}]},{xtype:"form",ref:"/orefTposition",title:"position",border:false,hidden:true,height:this.lbHeight,autoScroll:true,items:[{xtype:"fieldset",title:"Position Information",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,labelWidth:80,labelSeparator:":",defaults:{width:150},items:[{xtype:"numberfield",fieldLabel:"Lat",name:"lat",listeners:{change:function(g,h,f){if(g.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:h,lng:null})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-90,maxValue:90,allowBlank:false},{xtype:"numberfield",fieldLabel:"Lng",name:"lng",listeners:{change:function(g,h,f){if(g.isValid()){this.fireEvent("waypointpositionUIchanged",this,{lat:null,lng:h})}},scope:this},allowNegative:true,decimalPrecision:6,minValue:-180,maxValue:180,allowBlank:false},{xtype:"numberfield",fieldLabel:"Alt",name:"alt",allowNegative:true,decimalPrecision:1,minValue:-1000,maxValue:55000,allowBlank:true},{xtype:"numberfield",fieldLabel:"Zoom",name:"gmapzoom",disabled:true,allowBlank:true},{xtype:"textfield",fieldLabel:"City",name:"sfield5",listeners:{change:function(g,h,f){if(Ext.isEmpty(h)){this.userChangedFields[g.name]=false}else{this.userChangedFields[g.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"State/Prov",name:"sfield6",listeners:{change:function(g,h,f){if(Ext.isEmpty(h)){this.userChangedFields[g.name]=false}else{this.userChangedFields[g.name]=true}},scope:this},allowBlank:true},{xtype:"textfield",fieldLabel:"Country",name:"sfield7",listeners:{change:function(g,h,f){if(Ext.isEmpty(h)){this.userChangedFields[g.name]=false}else{this.userChangedFields[g.name]=true}},scope:this},allowBlank:true}]}]},{xtype:"panel",ref:"/orefTpoints",title:"points",autoHeight:true,html:"dada",listeners:{activate:function(f){this.tryBlurFocus()},scope:this}},{xtype:"form",ref:"/orefTbasicOther",title:"basic",autoHeight:true,labelWidth:80,items:[{xtype:"fieldset",autoHeight:true,autoWidth:true,collapsible:false,collapsed:false,style:"padding: 5px; margin-bottom: 3px;",items:[{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{html:"yebo placeholder for type cbo"}]},{layout:"form",columnWidth:0.5,labelWidth:45,border:false,items:[{xtype:"combo",fieldLabel:"Trip",ref:"////orefCboTrip",width:115,name:"tsectfriendly",emptyText:"choose trip",hiddenName:"tsect",allowBlank:false,listWidth:220,pageSize:10,store:this.dsCboTsect,forceSelection:true,displayField:"shorttripname",valueField:"tsect",typeAhead:true,mode:"remote",triggerAction:"all",valueNotFoundText:"click to show name",listeners:{beforequery:function(f){if(this.dsCboTsect.getCount()==1){this.dsCboTsect.reload()}},scope:this},lazyRender:true}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",columnWidth:0.5,border:false,items:[{xtype:"datefield",ref:"/////orefCboDate",fieldLabel:"Date",labelSeparator:":",name:"utc",allowBlank:true,width:115,format:"m/d/Y"}]},{layout:"form",labelWidth:45,border:false,columnWidth:0.5,items:[{xtype:"timefield",ref:"/////orefCboTime",fieldLabel:"Time",labelSeparator:":",name:"dttime",width:115,increment:30,format:"H:i"}]}]},{xtype:"panel",layout:"column",autoWidth:true,border:false,items:[{layout:"form",border:false,columnWidth:0.7,items:[{xtype:"checkbox",name:"ifield12",inputValue:"1",boxLabel:"Show in Gadget",hideLabel:true,width:180,disabled:false}]}]}]}]}]}]})},executeCustom:function(){this.on({render:function(){if(this.footer){var a=Ext.DomHelper.insertFirst(this.footer.child(".x-panel-btns"),[{tag:"img",src:"fourfourty/sgicons/done.gif",style:"float:left;padding-top:4px"},{tag:"div",cls:"waccuracy-cont",html:'<span class="waccuracy-lbl">accu:</span><span class="waccuracy-val">0</span>'}],true)}},scope:this});this.getLatLngBox=function(e,f,g){var b=g/111.32;var a=g/Math.abs(111.32*Math.cos((Math.PI/180)*e));var i=e+b/2;var h=e-b/2;var d=f+a/2;var c=f-a/2;return[i,h,d,c]};Ext.getCmp(this.id+"_vicinity").on({lbstoreload:function(g,j,i,k){if(!this.PosChangedFromInitial()){return}var f=parseFloat(k.params.celat);var h=parseFloat(k.params.celng);var b=k.params.wtype;var e=null;var a=true;this.lbVicinityHaveNearbyRecs=false;Ext.each(i,function(o,m,r){this.lbVicinityHaveNearbyRecs=true;var q=parseFloat(o.data.lat);var n=parseFloat(o.data.lng);var l=this.getLatLngBox(q,n,Logabout.Defs.masterMinDist);if(f>=l[1]&&f<=l[0]&&h>=l[3]&&h<=l[2]&&b==o.data.wtype){e=o.data}var p=this.getLatLngBox(q,n,Logabout.Defs.masterMinDist*2);if(f>=p[1]&&f<=p[0]&&h>=p[3]&&h<=p[2]&&b==o.data.wtype){a=false}},this);if(e==null){this.lbVicinityInsideMaster=false}else{this.lbVicinityInsideMaster=true}if(i.length>0&&e==null){if(this.lbVicinityModeShowNearby){this.switchPositionCard(2)}else{this.switchPositionCard(1)}this.orefWizNewActions.body.child(".bc-action-shownearby").show();this.orefWizNewActions.body.child(".bc-action-shownearby").update("show "+i.length+" nearby places");var d=this.editStore.getAt(0);var c=this.getCombinedDate(this.orefCboDate.getValue(),this.orefCboTime.getValue(),d.data.dtseconds);this.orefSfield1.setValue(this.getPatternName(this.orefCboWtype.getValue(),c))}else{if(e==null){this.orefWizNewActions.body.child(".bc-action-shownearby").hide();this.switchPositionCard(1)}else{this.switchPositionCard(3);this.orefMasterLinkedName.body.update(this.lbLinkedMastertpl.applyTemplate(e));this.orefSfield1.setValue(e.sfield1);if(this.orefCboWtype){this.orefCboWtype.setValue(e.wtype)}}}this.checkPositionTabValid()},scope:this});this.moveMarkerReqHandler=function(e,a,c,b,d){this.fireEvent("waypointToVicinityPosition",this,{lat:parseFloat(c),lng:parseFloat(b),wtype:d})};if(Logabout.Defs.ADtest){if(!this.ADTestWindow){this.ADTestWindow=new Logabout.Demo.ADTestWindow({id:"adtestwindow",renderTo:Ext.getBody(),lbContainerW:700,lbContainerH:240,lbParentOwner:this,pageX:100,pageY:350})}this.ADTestWindow.show()}},createMarkerConfig:function(){this.customMarkerConfig={polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:99,markerType:this.markerType,reverseGeo:this.lbReverseGeo,wptEditPanel:this,showWith:[this.id+"_vicinity"],polyMasterShow:true,polyMasterStyles:{stroke:{color:"#D67959",weight:2,opacity:1},fill:{color:"#D6A190",weight:2,opacity:0.2}},polyMasterDefaultKmRadius:0.2,markerTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">Drag this marker to adjust the position of your place log.</div>'],altTemplateDef:['<div id="wptpanelmarker" style="width:'+this.lbContainerW+"px; height:"+this.lbContainerH+'px;">This is a vicinity waypoint.</div>'],markerTemplateFunctions:this.lbtplFunctions}},focusMapMrk:function(){this.lbmapmgr.setActiveCol(this.id+"_mrkcol")},showBusy:function(a){if(!this.footer){return}if(a){this.footer.child("img").set({src:"fourfourty/sgicons/loading.gif"})}else{this.footer.child("img").set({src:"fourfourty/sgicons/done.gif"})}},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.createEditStore();this.createConfigObjects();Ext.apply(this,{border:false,frame:false});if(this.containerButtons){Ext.apply(this,{buttons:[{text:"Cancel",handler:this.cancelWaypoint,scope:this},{text:"Save",ref:"//orefSaveButton",handler:this.saveWaypoint,scope:this}]})}this.applyConfigItems();this.executeCustom();Logabout.Demo.UserEditPanel.Wizard.superclass.initComponent.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.WaypointComboPanel=Ext.extend(Ext.Panel,{searchRadius:100,lbInitialized:false,lbBusyLoading:false,lbNearbyInitialized:false,lbLinkInitialized:false,lbmapmgr:null,lbtplFunctions:null,lbviewcallback:null,lbresultval:null,lbUpdateColzoomlevel:function(a){this.lbmarkercolconfig.colzoomlevel=a},lbinitmarkercol:function(){this.lbmarkercolconfig.markerTemplateFunctions={getMarkerSize:this.lbtplFunctions.getMarkerSize,customDate:this.lbtplFunctions.customDate,getAddress:this.lbtplFunctions.getAddress,getDetail:this.lbtplFunctions.getDetail}},lbmarkercolconfig:{markerType:"waypointcombo-1",polyLineStyleCfg:{color:"#FF0550",width:2},polyLineShow:false,panOnClick:false,colzoomlevel:{hardzoom:15},useTabMarker:false,hideMarkerOnCreate:false,markstaticimage:{normal:"sf_new.png",highlight:"sf_new.png"},infoCallBackFunc:function(){Ext.select(".db-mrk-linkitem.db-li-showdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(b,a){Logabout.Bridgeport.zoomWptDetailFocusBasic();Logabout.Bridgeport.trackEvent("waypoint","MRKshowdetails","click")},this)},markerTemplateDef:['<tpl for=".">','<div class="db-mrk-mpanel db-mrk-tab1 db-mrk-waypointzoom">','<div class="db-mrk-name">{[fm.ellipsis(values.sfield1,23)]}</div>','<div class="db-mrk-detailblock">','<div class="db-icon db-icon-magnify">','<span class="db-mrk-linkitem db-li-showdetails">view details<span class="db-mrk-linkdata">{sfield1}</span></span>',"</div>","</div>","</div>","</tpl>"]},lbStoreSortInfo:{field:"diffdist",direction:"ASC"},initComponent:function(){Ext.apply(this,this.lbstandardconfig);this.lbinitmarkercol();this.lbtpldefs=[{label:"place",tpldef:['<div class="bp-wpt-picplace">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<div class="bp-pitm-title">','<div class="bp-wc-fleft bp-wc-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>",'<div class="bp-wc-fclear"></div>',"</div>",'<div class="bp-pitm-list">','<div class="bp-pitm bp-wpt-combo-username db-icon db-icon-founded">founded by ','<span class="db-mrk-linkitem db-action-showprofile">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="bp-pitm bp-wpt-combo-points db-icon db-icon-clock">',"on {[ this.customDate(values.utc,Date.patterns.LbCombo)]}","</div>",'<div class="bp-pitm bp-wpt-combo-waytype db-icon {[ this.getItemIconClass(values) ]}">',"type {[ this.wpthash[values.wtype] ]}","</div>","</div>",'<div class="bp-pitm-cmd">','<div class="bp-pitm db-icon db-icon-star">','<div class="db-mrk-linkitem db-action-addfav">add favorite</div>',"</div>",'<div class="bp-pitm db-icon db-icon-map">','<div class="db-mrk-linkitem db-action-showonmap">center map</div>',"</div>",'<tpl if="this.hasPhoto(values)">','<div class="bp-pitm db-icon db-icon-picture">','<div class="db-mrk-linkitem db-li-switch">show picture</div>',"</div>","</tpl>",'<div class="bp-pitm">','<div class="db-action-quicklogbut"></div>',"</div>","</div>","</div>","</div>","</tpl>","</div>"]},{label:"pic",tpldef:['<div class="bp-wpt-picplace">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<div class="bp-pitm-title">','<tpl if="!this.isRegularLog(values)">','<div class="bp-wc-fleft bp-wc-placename db-icon {[ this.getItemIconClass(values) ]}">',"{sfield1}","</div>","</tpl>",'<tpl if="!this.isRegularLog(values)">','<div class="bp-wc-fleft bp-wc-placename db-icon {[ this.getItemIconClass(values) ]}">',"{placename}","</div>","</tpl>",'<div class="bp-wc-fclear"></div>',"</div>",'<div class="bp-wpt-combo-pic-container">',"{[ this.getItemPhotoDiv(values) ]}","</div>",'<tpl if="this.hasPhoto(values)">','<div class="bp-wc-fleft bp-wpt-combo-picenlarge">','<div class="db-mrk-linkitem db-li-enlarge db-icon db-icon-zoomin">enlarge picture<div class="db-mrk-linkdata">{[ this.getPhotoSrc(values) ]}</div></div>',"</div>",'<tpl if="!this.isRegularLog(values)">','<div class="bp-wc-fright db-icon db-icon-picture">','<div class="db-mrk-linkitem db-li-switch">hide picture</div>',"</div>","</tpl>",'<div class="bp-wc-fclear"></div>',"</tpl>","</div>","</div>","</tpl>","</div>"]},{label:"log",tpldef:['<div class="bp-wpt-combo">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<tpl if="mtype == 1">','<div class="bp-litm db-icon db-icon-founded">',"this is the founding log entry","</div>","</tpl>",'<div class="bp-litm bp-wpt-combo-wayname">','<span class="bp-litm-lbl">log name: </span>{sfield1}',"</div>",'<tpl if="this.isRegularLog(values)">','<div class="bp-litm bp-wpt-combo-waytype">','<span class="bp-litm-lbl">log type: </span>{[ this.wpthash[values.wtype] ]}',"</div>","</tpl>",'<div class="bp-litm bp-wpt-combo-username">','<span class="bp-litm-lbl">log user: </span>','<span class="db-mrk-linkitem db-li-showdetails">{logusername}','<span class="db-mrk-linkdata">{loguserid}_{logusername}</span></span>',"</div>",'<div class="bp-litm bp-wpt-combo-points">','<span class="bp-litm-lbl">log date: </span>{[ this.customDate(values.utc,Date.patterns.LbCombo)]}',"</div>",'<div class="bp-litm bp-wpt-combo-points">','<span class="bp-litm-lbl">log points: </span>{ifield13}',"</div>",'<tpl if="description != null">','<div class="bp-litm bp-wpt-combo-desc">','<span class="bp-litm-lbl">description: </span>{description}',"</div>","</tpl>","</div>","</div>","</tpl>","</div>"]},{label:"detail",tpldef:['<tpl for=".">','{[ this.getDetail(values,["sfield2","sfield3","sfield4","ifield1","ifield2","ifield3","ifield4","ifield5","ifield6","ifield7","ifield8","ifield9"],"bp-wpt-combo-wrap","bp-litm") ]}',"</tpl>"]},{label:"position",tpldef:['<div class="bp-wpt-combo">','<tpl for=".">','<div class="bp-wpt-combo-wrap">','<div class="bp-wpt-combo-top">','<div class="bp-litm bp-wpt-combo-lat">','<span class="bp-litm-lbl">lat: </span>{lat}',"</div>",'<div class="bp-litm bp-wpt-combo-lng">','<span class="bp-litm-lbl">lng: </span>{lng}',"</div>",'<div class="bp-litm bp-wpt-combo-acc">','<span class="bp-litm-lbl">accuracy: </span>{gmapzoom}',"</div>",'<tpl if="sfield5 != null">','<div class="bp-litm bp-wpt-combo-city">','<span class="bp-litm-lbl">city: </span>{sfield5}',"</div>","</tpl>",'<tpl if="sfield6 != null">','<div class="bp-litm bp-wpt-combo-state">','<span class="bp-litm-lbl">state: </span>{sfield6}',"</div>","</tpl>",'<tpl if="sfield7 != null">','<div class="bp-litm bp-wpt-combo-country">','<span class="bp-litm-lbl">country: </span>{sfield7}',"</div>","</tpl>","</div>","</div>","</tpl>","</div>"]}];this.lbtpl_place=new Ext.XTemplate(this.lbtpldefs[0].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,isOwner:(function(){return this.lbCurrentSwpid==this.lbluid?true:false}).createDelegate(this),getComboData:(function(b,a){return this.lbcombodata[b][a][1]}).createDelegate(this),wpthash:this.lbtplFunctions.wpthash,getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},isRegularLog:function(a){return(a.mtype==1?false:true)},hasPhoto:function(a){if(!a.ifield10||!a.sfield8){return false}return true}});this.lbtpl_place.compile();this.lbtpl_combopanel=new Ext.XTemplate(this.lbtpldefs[1].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,hasPhoto:function(a){if(!a.ifield10||!a.sfield8){return false}return true},getPhotoSrc:function(b){if(!b.ifield10||!b.sfield8){return false}var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return a},getItemPhotoDiv:(function(b){if(!b.ifield10||!b.sfield8){return'<div class="intro-landscape"><img src="'+Logabout.Defs.blankWaypointImage+'"></img></div>'}var c=(b.ifield10==0?"pd-landscape":(b.ifield10==1?"pd-landscape":(b.ifield10==2?"pd-portrait":"pd-hide")));var a=(Ext.util.Format.substr(b.sfield8,0,4)=="http"?b.sfield8:(Logabout.Defs.picComboPath+b.sfield8));return'<div class="'+c+'"><img src="'+a+'"></img></div>'}).createDelegate((this)),showPrivateData:(function(){var a=Number(this.lbWaypointData.profile[0].profilePrivacy);if(this.lbCurrentSwpid==this.lbluid){return true}if(a==1){return true}if(a==2){for(var b=0;b<this.lbWaypointData.friends.length;b++){if(this.lbWaypointData.friends[b].userid==this.lbluid){return true}}}return false}).createDelegate((this)),isOwner:(function(){return this.lbCurrentSwpid==this.lbluid?true:false}).createDelegate(this),ownerName:(function(){return this.lbuname}).createDelegate(this),getComboData:(function(b,a){return this.lbcombodata[b][a][1]}).createDelegate(this),getImgSrc:(function(e,a,d,c,b){return this.lbProfilePicImg(e,a,d,c,b)}).createDelegate(this),getItemIconClass:function(a){return"dbi-wpt-"+a.wtype},isRegularLog:function(a){return(a.mtype==1?false:true)}});this.lbtpl_combopanel.compile();this.lbtpl_basics=new Ext.XTemplate(this.lbtpldefs[2].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,wpthash:this.lbtplFunctions.wpthash});this.lbtpl_basics.compile();this.lbtpl_detail=new Ext.XTemplate(this.lbtpldefs[3].tpldef.join(""),{customDate:this.lbtplFunctions.customDate,getDetail:this.lbtplFunctions.getDetail});this.lbtpl_detail.compile();this.lbtpl_position=new Ext.XTemplate(this.lbtpldefs[4].tpldef.join(""),{customDate:this.lbtplFunctions.customDate});this.lbtpl_position.compile();this.templateCallBackF=function(){Ext.getCmp(this.id+"_wayp-place").body.select(".db-action-showprofile",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.trackEvent("waypoint","DVshowprofile","click");Logabout.Bridgeport.showProfile(a[0],a[1])},this);Ext.getCmp(this.id+"_wayp-place").body.select(".db-li-switch",true).addClassOnOver("db-mrk-linkover").on("click",function(b,a){Ext.getCmp(this.id+"_wayp-placepic").getLayout().setActiveItem(1)},this);Ext.getCmp(this.id+"_wayp-place").body.select(".db-action-addfav",true).addClassOnOver("db-mrk-linkover").on("click",function(b,a){Logabout.Bridgeport.insertGroupItem(this.lbBaseWaypoint.memobj.swpid,"favorite");Logabout.Bridgeport.trackEvent("waypoint","addfavorite","wpt: "+this.lbBaseWaypoint.memobj.swpid)},this);Ext.getCmp(this.id+"_wayp-place").body.select(".db-action-showonmap",true).addClassOnOver("db-mrk-linkover").on("click",function(b,a){this.lbFocusBasicTabAndMarker();Logabout.Bridgeport.trackEvent("waypoint","showonmap","wpt: "+this.lbBaseWaypoint.memobj.swpid)},this);Ext.getCmp(this.id+"_wayp-place").body.select(".db-action-quicklogbut",true).each(function(b,c,a){var d=new Ext.Button({applyTo:b.dom,height:30,width:150,text:"Log this Place",iconCls:"db-icon-add",iconAlign:"left",cls:"db-button",tooltip:"click this button to log this place",handler:function(){Logabout.Bridgeport.showQuickLog(this.lbBaseWaypoint.memobj)},scope:this})},this);Ext.getCmp(this.id+"_wayp-pic").body.select(".db-li-enlarge",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue;Logabout.Bridgeport.trackEvent("waypoint","DVpicturewindow","click");Logabout.Bridgeport.showPictureWindow(a)},this);Ext.getCmp(this.id+"_wayp-pic").body.select(".db-li-switch",true).addClassOnOver("db-mrk-linkover").on("click",function(b,a){Ext.getCmp(this.id+"_wayp-placepic").getLayout().setActiveItem(0)},this);Ext.getCmp(this.id+"_tab_basics").body.select(".db-li-showdetails",true).addClassOnOver("db-mrk-linkover").on("click",function(c,b){var a=Ext.get(b.id).child(".db-mrk-linkdata",true).firstChild.nodeValue.split("_");Logabout.Bridgeport.trackEvent("waypoint","DVshowprofile","click");Logabout.Bridgeport.showProfile(a[0],a[1])},this)};this.lbStore=new Ext.data.JsonStore({url:this.lburl,baseParams:{task:"zoomdata",sesstoken:this.lbdsess},root:"results",fields:[{name:"mswpid"},{name:"mtype"},{name:"restype"},{name:"swpid"},{name:"lat"},{name:"lng"},{name:"alt"},{name:"gmapzoom"},{name:"loguserid"},{name:"logusername"},{name:"utc",type:"date",dateFormat:"U"},{name:"addutc",type:"date",convert:function(a,b){return new Date()}},{name:"wpid"},{name:"wtype"},{name:"tsect"},{name:"sfield1"},{name:"description"},{name:"sfield8"},{name:"ifield10"},{name:"diffdist",type:"float"},{name:"sfield2"},{name:"sfield3"},{name:"sfield4"},{name:"sfield5"},{name:"sfield6"},{name:"sfield7"},{name:"ifield1"},{name:"ifield2"},{name:"ifield3"},{name:"ifield4"},{name:"ifield5"},{name:"ifield6"},{name:"ifield7"},{name:"ifield8"},{name:"ifield9"},{name:"ifield11"},{name:"ifield12"},{name:"ifield13"},{name:"ifield14"}],remoteSort:false,sortInfo:this.lbStoreSortInfo});this.nearbyHandler=function(a){if(!this.lbNearbyInitialized){this.tellMeSearch(false,a);this.lbNearbyInitialized=true}else{this.lbmapmgr.setActiveCol(a)}};this.linkHandler=function(){if(!this.lbLinkInitialized){Ext.getCmp(this.id+"_urllink").setValue("loading...");Ext.Ajax.request({url:this.lburl,params:{task:"getwptlink",sesstoken:this.lbdsess,swpid:this.lbBaseWaypoint.memobj.swpid},callback:function(b,d,a){if(d){var c=Ext.util.JSON.decode(a.responseText);if(c.error){Ext.MessageBox.alert("Error",c.error)}else{Ext.getCmp(this.id+"_urllink").setValue("http://"+c.domain+"/wptv/?swpid="+c.scramswpid+"&lat="+this.lbBaseWaypoint.memobj.lat+"&lng="+this.lbBaseWaypoint.memobj.lng)}}else{Ext.MessageBox.alert("Unknown Error","An unknown error occured while attempting to delete data, please contact a system administrator.")}},scope:this});this.lbLinkInitialized=true}};Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,border:false,items:[{layout:"card",id:this.id+"_wayp-placepic",width:250,height:this.lbHeight,x:0,y:0,border:false,activeItem:0,items:[{xtype:"panel",id:this.id+"_wayp-place",border:false,html:"place"},{xtype:"panel",id:this.id+"_wayp-pic",border:false,html:"pic"}]},{xtype:"tabpanel",id:this.id+"_wayp-tabpanel",deferredRender:false,width:this.lbWidth-250,height:this.lbHeight,x:250,y:0,border:false,activeTab:0,plain:true,cls:"bp-combopanel-usertab",items:[{title:"logs",id:this.id+"_tab_basics",width:this.lbWidth-250,height:this.lbHeight,layout:"absolute",items:[new Logabout.Demo.MemoryPanel.WaypointComboPlaceLogs({id:this.id+"_tab_basics_logs",width:this.lbWidth-250,height:this.lbHeight,x:0,y:0,border:false,lbdistance:this.searchRadius,lbshowtitlebar:false,lbParentOwner:this,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"zoomdata"},lbusepager:false,lbpagesize:7,lbstoreparentloadhandler:(function(a,c){if(c.length>0&&this.lbmapmgr){var b=a.find("mtype","1");if(b!=-1){Logabout.Bridgeport.setMenuTabName(this.lbCardHolder,"Place");Ext.getCmp(this.id+"_tab_basics").setTitle("Logs");Ext.getCmp(this.id+"_wayp-place").body.update(this.lbtpl_place.applyTemplate(c[b].data));Ext.getCmp(this.id+"_wayp-placepic").getLayout().setActiveItem(0);Ext.getCmp(this.id+"_wayp-pic").body.update(this.lbtpl_combopanel.applyTemplate(c[b].data));this.lbBaseWaypoint.memobj=c[b].data}else{Logabout.Bridgeport.setMenuTabName(this.lbCardHolder,"Log");Ext.getCmp(this.id+"_tab_basics").setTitle("Log");Ext.getCmp(this.id+"_wayp-placepic").getLayout().setActiveItem(1);Ext.getCmp(this.id+"_wayp-pic").body.update(this.lbtpl_combopanel.applyTemplate(c[0].data));this.lbBaseWaypoint.memobj=c[0].data}this.lbNewBaseWaypoint=false;this.lbNearbyInitialized=false;this.lbLinkInitialized=false;Ext.getCmp(this.id+"_nearwpt").lbLoadData({totalrows:0,results:[]});this.templateCallBackF();Ext.getCmp(this.id+"_wayp-tabpanel").setActiveTab(0)}this.lbBusyLoading=false}).createDelegate(this)})]},{title:"nearby places",id:this.id+"_tab_nearwaypoint",listeners:{activate:this.nearbyHandler.createDelegate(this,[this.id+"_nearwpt"]),scope:this},items:[new Logabout.Demo.MemoryPanel.NearbyWaypoints({id:this.id+"_nearwpt",lbshowtitlebar:false,lbmapmgr:this.lbmapmgr,lbtplFunctions:this.lbtplFunctions,border:false,lbdistance:this.searchRadius})]}]}]});this.lbsignalController.on({menuitemchange:function(b,a){if(a==this.lbCardHolder){if(this.lbBaseWaypoint.mode=="view"&&(!this.lbInitialized||this.lbNewBaseWaypoint)){this.lbLoadBaseWaypoint();this.lbInitialized=true}else{this.lbFocusBasicTabAndMarker()}}},menuitemrefreshed:function(b,a){if(a==this.lbCardHolder){if(this.lbBaseWaypoint.mode=="view"&&(!this.lbInitialized||this.lbNewBaseWaypoint)){this.lbLoadBaseWaypoint();this.lbInitialized=true}else{this.lbFocusBasicTabAndMarker()}}},waypointsaved:function(a){if(this.lbBaseWaypoint.memobj&&a.mswpid==this.lbBaseWaypoint.memobj.mswpid){Ext.getCmp(this.id+"_tab_basics_logs").lbStore.reload()}},scope:this});this.on({activate:function(e,d,f){},render:function(){},scope:this});Logabout.Demo.WaypointComboPanel.superclass.initComponent.apply(this,arguments)},lbFocusBasicTabAndMarker:function(){if(this.lbBaseWaypoint.mode=="view"){Ext.getCmp(this.id+"_wayp-tabpanel").setActiveTab(0);this.lbmapmgr.setActiveCol(this.id+"_tab_basics_logs")}else{if(this.lbBaseWaypoint.mode=="new"||this.lbBaseWaypoint.mode=="edit"){this.EditPanel.focusMapMrk()}}},lbSetBaseWaypoint:function(a){this.lbBaseWaypoint=a;this.lbNewBaseWaypoint=true},lbLoadBaseWaypoint:function(){if(this.lbBusyLoading){return}this.lbBusyLoading=true;Ext.getCmp(this.id+"_tab_basics_logs").lbStore.load({params:{swpid:this.lbBaseWaypoint.swpid,browserts:new Date().format("U")}})},arRemoveUsingAr_Loguserid:function(g,a){var f=new Array();var h=false;for(var d=0,c=g.length;d<c;d++){h=false;for(var e=0,b=a.length;e<b;e++){if(g[d].loguserid==a[e].loguserid){h=true}}if(!h){f.push(g[d])}}return f},tellMeSearch:function(f,g){var c={celat:this.lbBaseWaypoint.memobj.lat,celng:this.lbBaseWaypoint.memobj.lng,dotelltypelist:["otherlog","closeplace","closeuser"],mswpid:(this.lbBaseWaypoint.memobj.mswpid!=null?this.lbBaseWaypoint.memobj.mswpid:0),loguserid:this.lbBaseWaypoint.memobj.loguserid,swpid:this.lbBaseWaypoint.memobj.swpid,wtypelist:[8,9,10,11,12,13,14,16],querystart:0,querylimit:50};var b=8;c.celat=Number(c.celat,6);c.celng=Number(c.celng,6);var d=this.searchRadius/(69.1*Math.cos(c.celat/57.3))+c.celng;var e=69.1*(d-c.celng)*Math.cos(c.celat/57.3);var a=d-c.celng;c.swlat=c.celat-a;c.swlng=c.celng-a;c.nelat=c.celat+a;c.nelng=c.celng+a;(function(){var h=arguments.callee;Ext.Ajax.request({url:this.lburl,timeout:this.lbtimeout.geocodethis,params:{task:"dotell",browserts:new Date().format("U"),swlat:c.swlat,swlng:c.swlng,nelat:c.nelat,nelng:c.nelng,celat:c.celat,celng:c.celng,mswpid:c.mswpid,wtypelist:Ext.util.JSON.encode(c.wtypelist),dotelltypelist:Ext.util.JSON.encode(c.dotelltypelist),start:c.querystart,limit:c.querylimit},reader:new Ext.data.JsonReader({root:"results",id:"swpid",totalProperty:"totalrows"},Ext.data.Record.create(Logabout.Defs.FullRecDef)),success:function(l,m){var o=Ext.util.JSON.decode(l.responseText);var k=new Array();for(var n=0,j=o.closeplace.length;n<j;n++){if(o.closeplace[n].swpid!=c.swpid&&k.length<b){k.push(o.closeplace[n])}}Ext.getCmp(this.id+"_nearwpt").lbLoadData({totalrows:k.length,results:k},false,(g==this.id+"_nearwpt"?false:true));Ext.getCmp(this.id+"_nearwpt").lbUpdateColzoomlevel({centerlat:c.celat,centerlng:c.celng,zfactor:0.8,doNotUseFactor:true,sortDir:"ASC",sortFunc:function(p,i){if(p.diffdist<i.diffdist){return -1}if(p.diffdist>i.diffdist){return 1}return 0}})},failure:function(i,j){Ext.Msg.show({title:"Search Error",msg:"Please click OK to try again",buttons:Ext.Msg.OK,fn:function(k){if(k=="ok"){h.defer(5,this)}},scope:this,icon:Ext.MessageBox.ERROR})},scope:this})}).defer(5,this)},onRender:function(){Logabout.Demo.WaypointComboPanel.superclass.onRender.apply(this,arguments)}});Ext.namespace("Logabout.Demo");Logabout.Demo.PeopleComboPanel=Ext.extend(Ext.Panel,{lbInitialized:false,lbmapmgr:null,lbtplFunctions:null,initComponent:function(){Ext.apply(this,this.lbstandardconfig);Ext.apply(this,{layout:"absolute",width:this.lbWidth,height:this.lbHeight,x:0,y:0,border:false,items:[{xtype:"tabpanel",id:"peoplep-tabpanel",width:this.lbWidth,height:this.lbHeight,x:0,y:0,border:false,activeTab:0,plain:true,cls:"bp-combopanel-usertab",items:[new Logabout.Demo.MemoryPanel.PeopleLeaderBoard({id:this.id+"_leaderboardp",title:"leader board",width:this.lbWidth,height:this.lbHeight,border:false,lbshowtitlebar:false,lbstandardconfig:this.lbstandardconfig,lbconnection:{url:this.lburl,timeout:this.lbtimeout.waypointsforuserpanel},lbbaseparams:{task:"gethistuser",start:0,limit:12},lbusepager:false,lbpagesize:7})]}]});this.lbsignalController.on({menuitemchange:function(b,a){if(a==this.lbCardHolder){if(!this.lbInitialized){Ext