function MapToolbar(){var a=this;a.rightEdge=null;a.leftEdge=null;a.out=false;a.SelectedCategories=null;a.edgeOffset=2;a.singleSelectMode=true;a.selectedClass="active";a.unselectedClass="";a.toggleInProgress=false}MapToolbar.prototype.Dispose=function(){};MapToolbar.prototype.LoadIcons=function(){var d=document.getElementById("CategoryOptionList"),a=d.getElementsByTagName("a"),b=a.length-1,c="url('{0}')";for(x=0;x<b;x++)a[x].style.backgroundImage=mapCommon.Format(c,mapIcons.GetCategoryIconByIndex(x));a[b].style.backgroundImage=mapCommon.Format(c,mapIcons.GetSelectAllIcon())};MapToolbar.prototype.ToggleToolbarSlide=function(a){if(this.out)this.doSlideIn(a);else this.doSlideOut(a)};MapToolbar.prototype.doSlideOut=function(e){var a=this;obj=document.getElementById(e);if(obj!=null){var d=document.getElementById(mapSettings.ControlHostName);a.rightEdge=d.offsetWidth-a.edgeOffset;a.leftEdge=a.rightEdge-mapSettings.Data.ToolbarExpandedWidth;obj.style.left=a.leftEdge+mapSettings.MapUnit;obj.style.width=mapSettings.Data.ToolbarExpandedWidth+mapSettings.MapUnit;obj.style.visibility="visible";a.out=true;var b=document.getElementById("MapToolbarHeading");if(b!=null)b.innerText=mapSettings.Data.ToolbarExpandedText;var c=document.getElementById("MapToolbarExpander");if(c!=null)c.className="collapse"}};MapToolbar.prototype.doSlideIn=function(e){var a=this;obj=document.getElementById(e);if(obj!=null){var d=document.getElementById(mapSettings.ControlHostName);a.rightEdge=d.offsetWidth-a.edgeOffset;a.leftEdge=a.rightEdge-mapSettings.Data.ToolbarCollapsedWidth;obj.style.left=a.leftEdge+mapSettings.MapUnit;obj.style.width=mapSettings.Data.ToolbarCollapsedWidth+mapSettings.MapUnit;obj.style.visibility="visible";a.out=false;var b=document.getElementById("MapToolbarHeading");if(b!=null)b.innerText=mapSettings.Data.ToolbarCollapsedText;var c=document.getElementById("MapToolbarExpander");if(c!=null)c.className="expand"}};MapToolbar.prototype.SetFullSelection=function(c){var a=new StringList,b="0";if(c==true)b="1";a.SetList(mapSettings.CategoryList.Count(),b);this.SelectedCategories=a;return a};MapToolbar.prototype.ShowAllCategories=function(){this.SetAllCategories(this.selectedClass,true,true)};MapToolbar.prototype.SetAllCategories=function(c,e,g){var a=mapSettings.CategoryList.Count();if(a>0){if(e==true)this.SetFullSelection(true);var f=document.getElementById("CategoryOptionList"),b=f.getElementsByTagName("a");if(b.length>=a)b[a].className=c;var d=b.length;for(x=0;x<d;x++)if(x!=a)b[x].className=c;if(g==true)mapEvents.GetPinData()}};MapToolbar.prototype.EvaluateSelectAll=function(){var e=document.getElementById("CategoryOptionList"),a=e.getElementsByTagName("a"),b=mapSettings.CategoryList.Count(),f=this.selectedClass,c=0,d=a.length;for(x=0;x<d;x++)if(x!=b)if(a[x].className==f)c+=1;if(a.length>=b)if(c==mapSettings.CategoryList.Count())a[b].className=this.selectedClass;else a[b].className=""};MapToolbar.prototype.ToggleCategoryLink=function(k){var a=this,c=false,b=true;if(a.toggleInProgress==b)return c;a.toggleInProgress=b;var e=c,g=document.getElementById(k);if(a.SelectedCategories==null){a.SetFullSelection(b);e=b}var h=g.innerText.replace("&amp;","&"),f=mapSettings.CategoryList.IndexOf(h);if(f>=0){var j="0",i=a.unselectedClass,d=c;e=b;if(g.className==a.unselectedClass){j="1";i="active";d=b}if(a.singleSelectMode==b){if(a.SelectedCategories.IndexOf("0")<0)d=b;a.SelectSingleItem(f,d)}else{g.className=i;a.SelectedCategories.Set(f,j)}a.EvaluateSelectAll();a.toggleInProgress=c;if(d==b)mapTracking.TrackShowCategory(h)}else e=c;a.toggleInProgress=c;return e};MapToolbar.prototype.ToggleCategoryFilter=function(a){if(this.ToggleCategoryLink(a)==true)if(this.toggleInProgress==false)mapEvents.GetPinData()};MapToolbar.prototype.SelectSingleItem=function(g,i){var a=this,j=document.getElementById("CategoryOptionList"),b=j.getElementsByTagName("a"),h=b.length,e=a.selectedClass,f="1",c=a.unselectedClass,d="0";if(i==false){e=a.selectedClass;c=a.selectedClass;f="1";d="1"}for(x=0;x<h;x++)if(x==g){b[x].className=e;a.SelectedCategories.Set(x,f)}else{b[x].className=c;a.SelectedCategories.Set(x,d)}};