
Type.registerNamespace('Monster.Client.Behavior.CartRedux');Monster.Client.Behavior.CartRedux.TotalDisplayAdapter=function(element){Monster.Client.Behavior.CartRedux.TotalDisplayAdapter.initializeBase(this,[element]);this.createProperty('_totalPrice');this.createProperty('lblSubTotal');this.createProperty('lblTotal');this.createProperty('lblAppliedTaxes');this.createProperty('discountControl');}
Monster.Client.Behavior.CartRedux.TotalDisplayAdapter.prototype={initialize:function(){Monster.Client.Behavior.CartRedux.TotalDisplayAdapter.callBaseMethod(this,'initialize');this.registerDataProperty('PriceData');this.registerDataProperty('DiscountData');},dispose:function(){Monster.Client.Behavior.CartRedux.TotalDisplayAdapter.callBaseMethod(this,'dispose');},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){case'PriceData':var data=this._dataStore.get_property('PriceData');if(this._totalPrice>0&&data.totalPrice==0){var currentUrl=window.location;window.location=currentUrl;return;}
this._totalPrice=data.totalPrice;this.lblTotal.innerHTML=data.totalPriceString;if(this.lblSubTotal){this.lblSubTotal.innerHTML=data.grandSubTotal;}
if(this.lblAppliedTaxes){var builder=new Sys.StringBuilder();var taxes=data.taxes;for(var tax in taxes){builder.append('<div class=\'tax-line\'>');builder.append('<div class=\'vat-title\'>');builder.append(taxes[tax].Name);builder.append('&nbsp;');builder.append('</div>');builder.append('<div class=\'vat-price\'>');builder.append(taxes[tax].Amount);builder.append('</div>');builder.append('<div class=\'clearing-div\' /></div>');}
this.lblAppliedTaxes.innerHTML=builder.toString();}
break;case'DiscountData':if(this.discountControl){var data=this._dataStore.get_property('DiscountData');Sys.UI.DomElement.setVisible(this.discountControl,data.hasDiscount);this.discountControl.innerHTML=data.discountInfo;}
break;}}}
Monster.Client.Behavior.CartRedux.TotalDisplayAdapter.registerClass('Monster.Client.Behavior.CartRedux.TotalDisplayAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;
