var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); function add_product_to_cart( p_id, p_instructions, p_options ) { hide_how_to(); show_processing_message( neucart_adding_product ); var before_click_text = change_atc_text( p_id ); // the original text. $.post( "handlers/item_handler.php", { action : "add_product", id : p_id, options : p_options, spec_inst : p_instructions }, function( data ) { // the function echos "false" string or json to replace the the cart if ( data == "false" ) { hide_processing_message(); restore_atc_text( p_id, before_click_text ); return; } var result = null; try { result = JSON.parse( data ); } catch ( err ) { alert( neucart_client_error ); hide_processing_message(); restore_atc_text( p_id, before_click_text ); return; } // see if we shouldd add or not. var newItem = result.type == 'add'; // hide the processing label $( "#cart_processing" ).hide(); if ( newItem ) { // show the entire cart $( "#entire_cart_wrapper" ).replaceWith( result.cart ); // fade in the item that was just added. $( ".just_added" ).fadeIn( 500, function() { // nothing here. } ); var ciw = "#cart_item_wrapper"; $( ciw ).scrollTop( $( ciw ).prop( "scrollHeight" ) ); } else { // show the cart header row again. $( "#cart_header_table" ).show(); // the result has the guid of the prod quantity that I need to replace, and the new quantity text. $( "#prod_q_" + result.id ).text( result.prod_q ); $( "#cart_item_row_" + result.id ).addClass( 'qty_changed' ); // and update the subtotals. $( "#updateable_cart_items" ).text( result.cart_q ); $( "#updateable_cart_value" ).text( result.cart_v ); if ( $( ".qty_changed" ).length > 0 ) { // $( ".qty_changed" )[ 0 ].scrollIntoView(); $( "#cart_items_table .qty_changed" ).removeClass( 'qty_changed', 800 ); } } // if there are custom cart fields, update those. update_custom_totals( $( "#updateable_cart_items" ).text(), $( "#updateable_cart_value" ).text() ); restore_atc_text( p_id, null ); } ) .error( function() { alert( neucart_server_error ); hide_processing_message(); restore_atc_text( p_id, before_click_text ); }); } function show_processing_message( msg ) { var cp = $( "#cart_processing" ); $( cp ).html( msg ); $( cp ).show(); $( "#cart_header_table" ).hide(); } function hide_how_to() { $( "#cart_item_wrapper #how_to" ).remove(); } function hide_processing_message() { $( "#cart_header_table" ).show(); $( "#cart_processing" ).hide(); } function change_atc_text( p_id ) { var id_key = '#atc_link_' + p_id; if ( $( id_key ).length == 0 ) return; var atc_link_now = $( id_key ).text(); $( id_key ).text( neucart_adding_product ); return atc_link_now; } function restore_atc_text( p_id, text ) { var id_key = '#atc_link_' + p_id; if ( $( id_key ).length == 0 ) return; $( id_key ).fadeTo( 500, 0, function() { var restore_text = text == null ? neucart_click_to_add_another : text; $( id_key ).text( restore_text ); $( id_key ).fadeTo( 500, 1 ); } ); } function empty_cart(){ if ( !confirm( neucart_empty_cart_confirm ) ) return; show_processing_message( neucart_emptying_cart ); $.post( "handlers/item_handler.php", { action : "empty_cart" }, function( data ) { if ( data == "false" ) { hide_processing_message(); return; } // show the cart and hide the processing message. $( "#entire_cart_wrapper" ).replaceWith( data ); $( "#cart_processing" ).hide(); // if there are custom cart fields, update those. update_custom_totals( 0, neucart_currency_symbol + "0.00" ); } ) .error( function() { alert( neucart_server_error ); hide_processing_message(); }); } var current_cart_item_wrapper = ''; function show_edit_quantity_dialog( item_key ) { current_cart_item_wrapper = $( "#cart_item_wrapper" ).html(); $.post( "handlers/item_handler.php", { action : "get_quantity_dialog", product : item_key }, function( data ) { if ( data == "false" ) return; $( "#cart_item_wrapper" ).html( data ); } ) .error( function() { alert( neucart_server_error ); }); } /* quantity editor, quantity change */ function qe_q_change( diff ) { var q = $( ".quantity_editor #editor #qbox" ).val(); if ( !is_number( q ) ) q = 0; q = parseInt( q ) + parseInt( diff ); q = q < 0 ? 0 : q; $( ".quantity_editor #editor #qbox" ).val( q ); } function qe_submit( item_key ) { var q = $( ".quantity_editor #editor #qbox" ).val(); if ( !is_number( q ) ) { alert( neucart_invalid_quantity ); return; } if ( q == 0 && !confirm( neucart_zero_means_remove ) ) return; qe_ajax_send_qty( item_key, q ); } function qe_remove( item_key ) { if ( !confirm( neucart_remove_prompt ) ) return; qe_ajax_send_qty( item_key, 0 ); } function qe_ajax_send_qty( item_key, q ) { $.post( "handlers/item_handler.php", { action : "set_quantity", product : item_key, qty : q }, function( data ) { if ( data == "false" ) return; $( "#entire_cart_wrapper" ).html( data ); if ( $( ".qty_changed" ).length > 0 ) { //$( ".qty_changed" )[ 0 ].scrollIntoView(); $( "#cart_items_table .qty_changed" ).removeClass( 'qty_changed', 800 ); } // if there are custom cart fields, update those. update_custom_totals( $( "#updateable_cart_items" ).text(), $( "#updateable_cart_value" ).text() ); } ) .error( function() { alert( neucart_server_error ); }); } function qe_cancel() { $( "#cart_item_wrapper" ).html( current_cart_item_wrapper ); current_cart_item_wrapper = ''; } function details_clicked( guid ) { var show_hide_id = "#show_hide_" + guid; var cell_details_id = "#cell_details_" + guid; if ( $( cell_details_id ).is( ":visible" ) ) { // hide it. $( cell_details_id ).hide(); $( show_hide_id ).html( neucart_show_details ); } else { // show it. $( cell_details_id ).show(); $( show_hide_id ).html( neucart_hide_details ); } } // used on the product detail page. this will get the text in // the special instructions box. function get_prod_detail_special_instructions() { if ( $( '#descbox' ).length > 0 ) return $( '#descbox' ).val(); return ''; } // used on the product detail page. this gets all the options out // of the options table. function get_prod_detail_options() { var toReturn = new Object(); // product option is the name of the class; this construction // returns all the select boxes that use this class. var o_list = $( '.product_option' ); for ( var i = 0; i < o_list.length; i++ ) { var optionid = o_list[ i ].name; optionid = optionid.replace( "option_", "" ); var value = o_list[ i ].value; toReturn[ optionid ] = value; } return toReturn; } function toggle_mobile_cart_display() { // current content area var cca = $( "#productdetail" ); var cart= $( "#shoppingcart" ); if ( cart.is( ":visible" ) ) { cca.removeClass( "popup_bg_opacity" ); cart.removeClass( "popup_cart_show" ); } else { // show the cart, hide the background. cca.addClass( "popup_bg_opacity" ); cart.addClass( "popup_cart_show" ); } } } /* FILE ARCHIVED ON 10:17:14 Oct 24, 2016 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 00:55:47 Nov 23, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 0.514 exclusion.robots: 0.018 exclusion.robots.policy: 0.007 esindex: 0.009 cdx.remote: 4.627 LoadShardBlock: 70.419 (3) PetaboxLoader3.datanode: 105.484 (5) load_resource: 193.011 (2) PetaboxLoader3.resolve: 104.191 */