/* 
 *Updated for mic
 */
 $(document).ready(function(){
});
//update shiiping method on cart page 17-11-2014
 function cartShipmethod(cartid,productid,method)
 {    
                        if(method=='72')
                        {
                           //$("#taxiTip_"+dealid).show(); 
                           $(".taxiDeliveryBlk_"+productid).show(); 
                        }
                        else
                        {
                             $(".taxiDeliveryBlk_"+productid).hide();   
                        }
                        var name   = 'shippingMethod_'+productid;
                        var reserr = name;
                        reserr     = reserr.replace("_", "_val_");
                               
                        if($('input[name='+name+']:radio:checked').length>0) {                           
                           
                            $("#div_err_formCheckoutShippingMethod_"+reserr).addClass('hide');
                            $("#hid_err_formCheckoutShippingMethod_"+reserr).val(0);
                        }
    $('.shipMethod_'+productid).val(method);
    //$('.shipMethod_'+productid).selectpicker('render');
    var currentPage = $("#currentPage").val();
    if(cartid >0 && productid >0) {
        $.ajax({
            type: "POST",
            url: GLOBAL_BASE_PATH+"/cart/ajaxSaveShipMethod/",
            data: {cartId:cartid,productId:productid,methodId:method,currentPage:currentPage},			
            success: function(data)
            { 
                    var x = jQuery.parseJSON(data);
                    $('.cart-total').html(x.html);
                    if(currentPage == 'checkout')
                    {
                            //$('#order_summary').html(x.html);
                            $("#order_summary .totSummary").html(x.summary); 
                            if($('#shipping_AmountDiv').length) {
                                $('#shipping_AmountDiv').html(x.htmlShipp);
                            }
                    }
                    
            }
        });
    }
 }