// Begin Cart Effects var cart_turned_on = false; function effects_start() { update_cart_onopen(); // Run Ajax // If IE 6, and hide all drop down menus on-open (they showed over the top of the modal), re-show them on close if(isRunningIE6OrBelow) { $$('select').each(function(el) { el.style.display = "none"; }); } // set the background to be able to show if($('modal_window_background')) { $('modal_window_background').show({ queue: 'front' }); // and fade in the background new Effect.Opacity('modal_window_background', { from: 0, to: 0.7, duration: 0.5, queue: 'end' }); // check if IE or not... if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ // fade in the main box new Effect.Opacity('modal_window_box', { from: 0, to: 1.1, duration: 0.6, queue: 'end' }); } else { // fade in the main box ( but in 0 time so its not there on start and has to fade in before the slide in next) new Effect.Opacity('modal_window_box', { from: 0, to: 1.1, duration: 0, queue: 'end' }); } // slide in box new Effect.SlideDown('modal_window_box'); cart_turned_on = true; Effect.ScrollTo('modal_window_background'); } } function effects_end() { // removing the modal window Effect.Queues.get('modal_window_background').interval = 200; // slide up the main box new Effect.SlideUp('modal_window_box', { queue: 'front' }); Effect.Fade('modal_window_box'); // finaly hide the window Effect.Fade('modal_window_background'); cart_turned_on = false; setTimeout(function() { // If IE 6, re-open the closed select if(isRunningIE6OrBelow) { $$('select').each(function(el) { el.style.display = "inline"; }); } }, 600); } function update_cart_onopen(){ var session_id = '45412276'; var url = 'includes/cart/update_cart_onopen.inc.php' + '?session_id=' + session_id new Ajax.Request(url, { method:'get', onLoading: function(){ $('cart_update_box').innerHTML = 'Loading '; }, onSuccess: function(transport){ setTimeout(function() { var response = transport.responseText || " No response text found, please try again "; $('cart_update_box').innerHTML = response; // Update Cart Summary refresh_cart_content(); }, 100); }, onFailure: function(){ setTimeout(function() { $('cart_update_box').innerHTML = '

Sorry, but there was a problem with this request, please try again

'; }, 100); } }); } // this function watches for the user to press the ESC key function keyPressHandler(e) { var kC = (window.event) ? // MSIE or Firefox? event.keyCode : e.keyCode; var Esc = (window.event) ? 27 : e.DOM_VK_ESCAPE // MSIE : Firefox if(kC==Esc) { if(cart_turned_on == true) { // if the modal cart is open currently, then close it on click of ESC effects_end(); } if(lightboxImageGalOn == true) { // if the modal image window is open currently, then close it on click of ESC closeLightboxImageGal(); } } } // Add to wish list var itemId; function add_to_wish_list(itemId) { var url = 'includes/shop/wish_lists/add_to_wish_list.inc.php?itemId=' + itemId; new Ajax.Request(url, { method:'get', onLoading: function(){ if($('wish_update_box')) { $('wish_update_box').innerHTML = 'Loading... '; } }, onSuccess: function(transport){ var response = transport.responseText || " No response text found, please try again "; if($('wish_update_box')) { $('wish_update_box').innerHTML = response; } new Effect.Highlight('wish_update_box'); }, onFailure: function(){ if($('wish_update_box')) { $('wish_update_box').innerHTML = '

Sorry, but there was a problem with adding this item to your wish list, please try again

'; } } }); } // Add to compare list var itemId; function add_to_compare_list(itemId) { var url = 'includes/shop/compare/add_to_compare.inc.php?itemId=' + itemId; new Ajax.Request(url, { method:'get', onLoading: function(){ $('compare_update_box').innerHTML = 'Loading... '; }, onSuccess: function(transport){ var response = transport.responseText || " No response text found, please try again "; $('compare_update_box').innerHTML = response; new Effect.Highlight('compare_update_box'); }, onFailure: function(){ $('compare_update_box').innerHTML = '

Sorry, but there was a problem with adding this item to your compare list, please try again

'; } }); } // loop a bundle of products by there ids into the cart var bundle; var bundle_array = new Array(); function loop_bundle_array_cart(bundle) { bundle_array = bundle.split(","); for(var i=0; i