var ServiceProxy={_doAjax:function(f,e,c,g,b,d,a){if(!b)b={};if(!a)a=this._defaultErrorHandler;$.ajax({type:"GET",url:f+g,data:b,contentType:c,dataType:e,success:d,error:a,cache:false,dataFilter:function(a,c){var b=jQuery.parseJSON(a),d=$().jquery.split(".");if(d[1]>=5&&c=="json"){if(b.hasOwnProperty("d"))a=a.slice(5,a.length-1);return a}else return b.hasOwnProperty("d")?b.d:b}})},_defaultErrorHandler:function(a){alert("error = "+a.statusText)}};ProductServiceProxy=function(a){this._baseURL=a};ProductServiceProxy.prototype={GetSelectorProducts:function(d,a,b){var c={SelectorId:d};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","GetSelectorProductsInfo",c,a,b)},GetProduct:function(e,a,b,c){var d={ProductId:e,getPrinting:a};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","GetProductInfo",d,b,c)},GetProductHeroes:function(e,d,a,b){var c={SelectorId:e,ProductId:d};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","GetProductHeroesInfo",c,a,b)},SetProductPlus:function(d,e,a,b){var c={ProductId:d,VariationId:e};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","SetProductPlus",c,a,b)},RemoveProductPlus:function(a,b){ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","RemoveProductPlus","",a,b)},AddToBasket:function(h,i,a,g,d,c,b,e){var f={ProductId:h,VariationId:i,HeroProductId:a,PrintingName:g,PrintingNumber:d,BadgeId:c};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","AddToBasket",f,b,e)},SearchProducts:function(d,a,b){var c={searchText:d};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","ProductSearch",c,a,b)}};CustomerServiceProxy=function(a){this._baseURL=a};CustomerServiceProxy.prototype={AddCustomerToMailList:function(b,a,c){var d={Email:b};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","addCustomerToMailList",d,a,c)}};GeneralServiceProxy=function(a){this._baseURL=a};GeneralServiceProxy.prototype={GetLeafContent:function(b,e,a,c){var d={BranchId:b,Leaf:e};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","GetLeafContent",d,a,c)}};BasketServiceProxy=function(a){this._baseURL=a};BasketServiceProxy.prototype={InsertPrintingItem:function(b,d,i,h,a,c,e,f){var g={BasketItemId:b,PrintTypeID:d,Quantity:i,printDescription:h,priceWholeSale:a,priceRetail:c};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","InsertPrintingItem",g,e,f)},RemovePrintingItem:function(a,b,c,d){var e={BasketItemId:a,PrintTypeID:b};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","RemovePrintingItem",e,c,d)},UpdatePrintingItem:function(a,b,c,d,e){var f={BasketItemId:a,PrintTypeID:b,PrintDescription:c};ServiceProxy._doAjax(this._baseURL,"html","application/html; charset=utf-8","UpdatePrintingItem",f,d,e)},RemovePrintingItemsByType:function(a,b,c){var d={PrintTypeID:a};ServiceProxy._doAjax(this._baseURL,"json","application/json; charset=utf-8","RemovePrintingItemsByType",d,b,c)}};
