Ext.namespace("Ext.BvD.Horizon");Ext.BvD.Horizon.SelectionModel=Ext.extend(Ext.grid.CheckboxSelectionModel,{initEvents:function(){Ext.BvD.Horizon.SelectionModel.superclass.initEvents.call(this);this.on("beforeload",this.onBeforeLoad,this);this.on("load",this.onLoad,this);this.on("beforerowselect",this.onBeforeRowSelect,this);this.on("selectionchange",this.onSelectionChange,this)},renderer:function(b,c,a){return'<div class="x-grid3-row-checker" style="margin-top:5px;">&#160;</div>'},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true)}}}},onBeforeRowSelect:function(d,c,a,b){return a},onSelectionChange:function(b){var g=g_eBook.Locations[$("_selLocation").value],a=0,f=false;if(g!=null){for(var e=0;e<b.getSelections().length;e++){var d=b.getSelections()[e].get("Prices");for(var c=0;c<d.length;c++){if(d[c].Currency.Code!=g.Currency.Code){continue}a+=parseFloat(d[c].Amount);f=true}}}if($("_selLocation").value==""){$("_tdChapterPrice").hide();$("_tdPrice").show();$("_divOrderChapter").hide();$("_divOrderBook").hide()}else{if(f){$("_tdPrice").hide();$("_tdChapterPrice").show();$("_tdChapterPrice").update(g.Currency.Code+(a));$("_divOrderBook").hide();$("_divOrderChapter").show()}else{$("_tdChapterPrice").hide();$("_tdPrice").show();$("_divOrderChapter").hide();if(g!=null){$("_divOrderBook").show()}}}}});
