function addCartOrWishlist(i,d,a,b,j,e,c,h,g,f){$.ajax({type:"POST",url:"webservices/ShopServices.asmx/AddToCartOrWishlist",data:"{ShopID: '"+i+"', UserID: '"+d+"', ProductID: '"+a+"', AnonymousID: '"+b+"', IfCart: '"+j+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(k){if(k.d){location.href="storeproduct?shopid="+i+"&passedid="+a}else{if(j==false){location.href="storewishlist?shopid="+i}else{if($("#divCartSmall")){$('#divCartSmall').parent().parent().css('display', 'block');getShoppingCartSmall(i,d,b,e,c,h,g,f)}}}}})}function getShoppingCartSmall(e,d,b,c,f,h,g,a){$("#divCartSmall").html("");$.ajax({type:"POST",url:"webservices/ShopServices.asmx/GetShoppingCart",data:"{ShopID: '"+e+"', UserID: '"+d+"', AnonymousID: '"+b+"', sortColumn: 'CreatedDate', sortOrder: 'DESC'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(m){var t=m.d.Rows;var p=m.d.Total;if(p<1){$("#divCartSmall").parent().parent().css("display","none")}var o=0;for(var n=0;n<t.length;n++){var l=t[n].CartItemID;var q=t[n].ProductID;var s=t[n].ProductName;var k=t[n].SelectedArributes;var j=t[n].TotalCost;var r=t[n].Quatity;o+=parseFloat(j)*parseInt(r);$('<a href="storeproduct?shopid='+e+"&passedid="+q+'" title="'+s+'">'+s+"</a><br />"+c+": "+r+"<br />"+f+": "+formatCurrency(j)+'<br /><a href="javascript:void(0);" title="'+h+'" onclick="return deleteCartItemSmall(\''+e+"', '"+d+"', '"+b+"', '"+c+"', '"+f+"', '"+h+"', '"+g+"', '"+a+"', '"+l+'\', true);"><img src="images/delete.gif" alt="'+h+'" /></a>'+(k==""?"":'<span>&nbsp;</span><a href="storeproduct?shopid='+e+"&cartitemid="+l+'" title="'+g+'"><img src="images/edit.gif" alt="'+g+'" /></a>')+"<br /><br />").appendTo("#divCartSmall");if(n==t.length-1){$('<span>&#8594; </span><a href="storeshoppingcart?shopid='+e+'">'+formatCurrency(o)+"</a><br />").appendTo("#divCartSmall")}}}})}function deleteCartItemSmall(i,c,a,d,b,f,g,h,e,j){if(confirm(h)){$.ajax({type:"POST",url:"webservices/ShopServices.asmx/DeleteCartOrWishlist",data:"{ShopID: '"+i+"', UserID: '"+c+"', AnonymousID: '"+a+"', ItemID: '"+e+"', IfCart: '"+j+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(k){if(k.d){getShoppingCartSmall(i,c,a,d,b,f,g,h)}}})}}function editCartItem(a,b){location.href="storeproduct?shopid="+a+"&cartitemid="+b};
