jQuery(document).ready(function() {
	jQuery('.price-fit .products .price').textfill({ maxFontPixels: 36, innerTag: 'span' });
	
	var priceTimeout = '';
	jQuery('.price-no-fit .products .price').hover(function(){
		var boxWidth = jQuery(this).width();
		var amount = jQuery(this).find('.amount:visible');											   
		var amountWidth = amount.width();
		if(amountWidth > boxWidth){
			var distance = amountWidth-boxWidth+3;
			priceTimeout = setInterval(function(){
							amount.animate({'margin-left':'-'+distance+'px'},1000,"swing",function(){
								setTimeout(function(){
									amount.css({'margin-left':'3px'});
								},500);
							});
						},2000);
		}
	},function(){
		clearInterval(priceTimeout);
		var amount = jQuery(this).find('.amount:visible');	
		amount.animate({'margin-left':'3px'});
	});
	jQuery('.single-product .product .onsale-wrap').click(function(e){
		jQuery(this).siblings('.images').find('a.zoom').trigger('click.fb');
	
	});
});
