$.tabs = function(selector, start) {
	$(selector).each(function(i, element) {
		$($(element).attr('tab')).css('display', 'none');
		
		$(element).click(function() {
			$(selector).each(function(i, element) {
				$(element).removeClass('selected');
				
				$($(element).attr('rel')).css('display', 'none');
			});
			
			$(this).addClass('selected');
			
			$($(this).attr('rel')).css('display', 'block');
		});
	});
	
	if (!start) {
		start = $(selector + ':first').attr('rel');
	}

	$(selector + '[rel=\'' + start + '\']').trigger('click');
};


$(document).ready(function () {
	

	
	
	
$('#add_to_cart').removeAttr('onclick');
$('#add_to_cart').click(function () {
$.ajax({
type: 'post',
url: 'index.php?route=module/cart/minicart',
dataType: 'html',
data: $('#product :input'),
success: function (html) {
$('#cart_in_header').html(html);
},

complete: function () {
var image = $('#image').offset();
var cart  = $('#cart_in_header').offset();
$('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');
params = {
top : -100 + 'px',
left : 600 + 'px',
opacity : 0.0,
width : $('#cart_in_header').width(),
heigth : $('#cart_in_header').height()
};
$('#temp').animate(params, 'slow', false, function () {
$('#temp').remove();
});
}
});
});
});

