$(function() { if ($('#lnk_order_info').length > 0) { $('#lnk_order_info').fancybox({ 'titleShow': false, 'showCloseButton': true, 'autoDimensions': true, 'titlePosition': 'inside', 'transitionIn': 'fade', 'transitionOut': 'fade', 'overlayShow': true, 'centerOnScroll': true, 'hideOnOverlayClick': true, 'hideOnContentClick': false, 'scrolling': 'no', 'modal': false, onStart: function() { var num_order = $('#lnk_order_info #num_order').html(); $('#order_info_dialog #num_order').html(num_order); } }); } if ($('#order_info_dialog #cancel_button').length > 0) { $('#order_info_dialog #cancel_button').click(function() { $.fancybox.close(); }); } if ($('#order_info_dialog #clear_shoppingcart').length > 0) { $('#order_info_dialog #clear_shoppingcart').click(clearShoppingCart); } if ($('#lnk_login').length > 0) { $('#lnk_login').fancybox({ 'titleShow': false, 'showCloseButton': true, 'autoDimensions': true, 'titlePosition': 'inside', 'transitionIn': 'fade', 'transitionOut': 'fade', 'overlayShow': true, 'centerOnScroll': true, 'hideOnOverlayClick': true, 'hideOnContentClick': false, 'scrolling': 'no', 'modal': false, onComplete: function() { $('#login_dialog #login_email').focus(); } }); } init_login_form('popup_login'); }); function clearShoppingCart() { var ret = false; if (!confirm('Are you sure to clear the shoppingcart ?')) { return ret; } $.ajax({ url: 'http://ebent.medanreview.com/medanreview/sys/invoice.php' , type: 'post' , async: false , dataType: 'json' , data: { 'json_param' : $('#order_info_dialog #clear_shoppingcart_param').serializeJSON() } , beforeSend: function(jqXHR, settings) { $('#order_info_dialog *').attr('disabled', true); } , success: function(data) { if (!data) { $('#order_info_dialog .title').html('Error.'); $('#order_info_dialog .message').html('Error to process your request.'); } else { ret = data.success; if (ret) { // Update Informasi Item di Top Banner if ($('#order_info_panel #num_order').length) $('#order_info_panel #num_order').html(0); location.replace("