jQuery.noConflict();


function initLightbox() {
    var el = jQuery('.main-image img');
    if (el.length) {
	el.click(function() {
	    jQuery('.more-views ul li a').first().click();
	});
    }
	jQuery('a[rel=image_group]').fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'titlePosition'	:	'outside',
		'titleFormat'	:	function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
}

function openOptionBox(obj) {
	var el = jQuery(obj);
	if (el.length) {
		var el2 = el.parent().find('.innerContent');
		if (el2.length) {
			el2.removeClass('hidden');
		}
	}
}

function initProductOptionSlider() {
	var el = jQuery('.product-view .float-box div h3');
	if (el.length) {
		el.click().toggle(function() {
			jQuery(this).parent().find('.innerContent').animate({
				height: 'hide',
				opacity: 'hide'
			},'slow');
		}, function() {
			jQuery(this).parent().find('.innerContent').animate({
				height: 'show',
				opacity: 'show'
			},'slow');
		});
	}
}

jQuery(document).ready(function() {
    initLightbox();
	
	initProductOptionSlider();
	
	jQuery('.product-view .float-box div h3').click();
    
});
