// JavaScript Document
jQuery(document).ready(function($) {
	$("a.flag").click(function(){
		return false;
	});
	$("a.mini_form:not(a.submit)").fancybox({
		'overlayShow'	: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titleShow' : false
	});
	$('.fancybox').fancybox();
	$('.tab_show').click(function(){
		$('.tab_show').removeClass('active');
		$(this).addClass('active');
		var to_show = $(this).attr('href');
		$('.tabs:visible').fadeOut(500, function(){
			$(to_show).fadeIn(500);
		});
	});
	
	$('.compareLink').click(function () {
		var val = $(this).parent().find('.compare_list').val();
		if (val) {
			location = $(this).attr('href') + $(this).attr('rel') + '-' + val + '/';
		}
		return false;
	});
	
	$('div.angle img').hover(function () {
		var $big = $(this).parents('div.prod_img:first').find('div.prod_main_img img');
		var orig = $big.attr('rel');
		if (!orig) {
			orig = $big.attr('src')
			$big.attr('rel', orig);
		}
		$big.attr('src', $(this).attr('src').replace('s_', 'm_'));
	}, function () {
		var $big = $(this).parents('div.prod_img:first').find('div.prod_main_img img');
		$big.attr('src', $big.attr('rel'));
	});
	
	$('.fancy').fancybox();
	
	$('.add2cart').click(function () {
		purchaseItem($(this).attr('rel'));
		// return false;
	});
	
	$('.item_plus').click(function () {
		purchasePlus($(this).attr('rel'));
		return false;
	});
	
	$('.item_minus').click(function () {
		purchaseMinus($(this).attr('rel'));
		return false;
	});
	
	$('.remove_item').click(function () {
		purchaseDel($(this).attr('rel'));
		return false;
	});
})

jQuery(document).ready(function() {
    jQuery('.mycarousel').jcarousel();
});
