jQuery.noConflict();

var options = {
    zoomWidth: 300,
    zoomHeight: 300,
    xOffset: 10,
    yOffset: 0,
    position: "right",
    title: false //and MORE OPTIONS
};

function swapImages(el) {
    var el = jQuery(el),
        sibling = jQuery(el).siblings(),
        currentImage = jQuery('#product_image_wrap .product-image'),
        siblingHtml = el.siblings().html();

    jQuery('#product_image_wrap').html(siblingHtml);
    jQuery('#product_image_wrap > .product-image:first-child').each(function() {
        if (jQuery(this).hasClass('.nozoom')) {
            if (jQuery('.is-zoomable').length) {
                jQuery('.is-zoomable').remove();
            }
        } else {
            jQuery(this).jqzoom(options);
            if (!jQuery('.is-zoomable').length) {
                jQuery(this).parents('#product_image_wrap').after('<div class="is-zoomable"><span>Zoom</span></div>');
            }
        }
    });
}

jQuery(document).ready(function(){
    
	jQuery('#product_image_wrap > .product-image:first-child').each(function() {
        if (jQuery(this).hasClass('.nozoom')) {
            if (jQuery('.is-zoomable').length) {
                jQuery('.is-zoomable').remove();
            }
        } else {
            jQuery(this).jqzoom(options);
            if (!jQuery('.is-zoomable').length) {
                jQuery(this).parents('#product_image_wrap').after('<div class="is-zoomable"><span>Zoom</span></div>');
            }
        }
    });
    
});
