function Sidebar(B,A,C,E,D){this.locator=B;this.columnIds=A;this.maxEntriesCol=C;this.metro=E;this.lng=D;this.currentPage=1;this.menu_bar_fl=new YAHOO.widget.MenuBar("menu_bar_fl");this.menu_bar_pn=new YAHOO.widget.MenuBar("menu_bar_pn");this.menu_bar_fl.render();this.menu_bar_pn.render();this.menu_bar_fl.show();this.menu_bar_pn.show()}Sidebar.prototype.fillColumn=SidebarFillColumn;Sidebar.prototype.fillPage=SidebarFillPage;Sidebar.prototype.goToPage=SidebarGoToPage;Sidebar.prototype.firstPage=SidebarFirstPage;Sidebar.prototype.lastPage=SidebarLastPage;Sidebar.prototype.nextPage=SidebarNextPage;Sidebar.prototype.previousPage=SidebarPreviousPage;Sidebar.prototype.refreshNavigationBar=refreshNavigationBar;function SidebarFillColumn(B,A){var D="";var C=A;while(C<this.locator.business.length&&C-A+1<=this.maxEntriesCol){if(this.metro){D+='<a class="result" onclick="'+this.locator.name+".business["+C+'].showWithMetro(metro_stations);return false;" href="#" onmouseover="return true;">'+this.locator.business[C].name+"</a><br/>"}else{D+='<a class="result" onclick="'+this.locator.name+".business["+C+'].goTo();return false;" href="#" onmouseover="return true;">'+this.locator.business[C].name+"</a><br/>"}C++}document.getElementById(this.columnIds[B]).innerHTML=D;return C-1}function SidebarFillPage(B){var A=B-1;for(var C=0;C<this.columnIds.length;C++){A=this.fillColumn(C,A+1)}}function SidebarGoToPage(B){var A=Math.ceil(this.locator.business.length/(this.maxEntriesCol*this.columnIds.length));this.currentPage=B;this.fillPage((B-1)*this.maxEntriesCol*this.columnIds.length);this.refreshNavigationBar()}function refreshNavigationBar(){var D=Math.ceil(this.locator.business.length/(this.maxEntriesCol*this.columnIds.length));var F="Page";if(this.lng=="fr"){F+=" "}F+=": "+this.currentPage+"/"+D;document.getElementById("page_num").innerHTML=F;var E=this.menu_bar_pn.getItem(0);var B=this.menu_bar_pn.getItem(1);var A=this.menu_bar_fl.getItem(0);var C=this.menu_bar_fl.getItem(1);if(D==1){E.cfg.setProperty("disabled",true);B.cfg.setProperty("disabled",true);A.cfg.setProperty("disabled",true);C.cfg.setProperty("disabled",true)}else{if(this.currentPage==1){E.cfg.setProperty("disabled",true);B.cfg.setProperty("disabled",false);A.cfg.setProperty("disabled",true);C.cfg.setProperty("disabled",false)}else{if(this.currentPage==D){E.cfg.setProperty("disabled",false);B.cfg.setProperty("disabled",true);A.cfg.setProperty("disabled",false);C.cfg.setProperty("disabled",true)}else{E.cfg.setProperty("disabled",false);B.cfg.setProperty("disabled",false);A.cfg.setProperty("disabled",false);C.cfg.setProperty("disabled",false)}}}}function SidebarFirstPage(){this.goToPage(1)}function SidebarLastPage(){var A=Math.ceil(this.locator.business.length/(this.maxEntriesCol*this.columnIds.length));this.goToPage(A)}function SidebarNextPage(){var A=Math.ceil(this.locator.business.length/(this.maxEntriesCol*this.columnIds.length));if(this.currentPage==A){return }this.goToPage(this.currentPage+1)}function SidebarPreviousPage(){if(this.currentPage==1){return }this.goToPage(this.currentPage-1)}