$(function() {
    	
    $(".product-selector").tabs();
    
	// setup zoom options - will re-use in .file-thumb click handler below
	var zoomOptions = {
		zoomWidth: 516,
		zoomHeight:500,
		showEffect:'show',
		hideEffect:'fadeout',
		fadeoutSpeed: 'slow',
		yOffset :-30,
		xOffset :61,
		title :false
	};
	
	// zoom the default image
	$("#zoomer").jqzoom(zoomOptions);

	// tricky dicky bind click event to thumbnails, id has been set to the src of the scaled large image, href set to the full size
	$(".file-thumb").each(function(){
		$(this).bind("click", function(){
			$(".file-thumb").each(function(){$(this).removeClass('current')});
			$(this).addClass('current');
			$(".imgLarge").attr('src',$(this).attr('id'));
			$("#zoomer").attr('href',$(this).attr('href'));
			$("#zoomer").jqzoom(zoomOptions);
			return false;
		});
	});

});


function enable_purchase()
{
    $('#quantity, #add_to_cart').removeAttr('disabled');
    $('#QtyAddBlock').show();
}

function disable_purchase()
{
    $('#quantity, #add_to_cart').removeAttr('disabled');
    $('#QtyAddBlock').hide();
}
