
//Back to top slider

jQuery(document).ready(function() {
   
    jQuery('a[href=#totop]').click(function(){
        jQuery('html, body').animate({scrollTop:0}, 600);
        return false;
    });

// FancyBox jQuery
		
			 jQuery("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true }); 

// Slider Homepage

/*
	jQuery("#slider").easySlider({
		auto: true,
		continuous: true,
		numeric: true
	});
*/
});


jQuery(document).ready(function() {
    
   if (window.location.pathname.indexOf('checkout/cart') != '-1'){
       jQuery('#shopping-cart-table td[class=last] span[class=cart-price]').each(function(){
           if (jQuery(this).children('span[class=price]').length > 1){
               jQuery(this).children('span[class=price]:not(:first)').remove();
           }
       });
   } 
   
   jQuery('input[type=text].grouped-qty').focusout(function(){
       // refresh total price
       var totalPrice=0;
       var iterator=0;
       jQuery('input[type=text].grouped-qty').each(function(){
           if (jQuery(this).val() > 0){
                // get price of row
                totalPrice = totalPrice + parseFloat((parseInt(jQuery(this).val()) * jQuery('.grouped-price:eq(' + iterator + ')').val()));
                
           }
          
           iterator++;
       });
       
       totalPrice = totalPrice.toFixed(2).toString();
       totalPrice = totalPrice.replace('.', ',')
       
       jQuery('#total-grouped-price').text(totalPrice);
       
   });

});
