
jQuery(document).ready(function() {
	/* Fix for IE */
    	if (jQuery.browser.msie && jQuery.browser.version >= 9) {
		 jQuery.support.noCloneEvent = true;
		}
	/* End fix for IE */
	  
	/* Load scripts */
		if(jQuery('.lightbox').length) {
				jQuery(".lightbox").fancybox({
						'opacity'		: true,
						'overlayShow'	: true,
						'transitionIn'	: 'elastic',
						'transitionOut'	: 'elastic'
					});
			}
		
		if (jQuery('#carousel-2').length) {
				jQuery("#carousel-2").jCarouselLite({
					btnNext: ".next",
					btnPrev: ".prev",
					visible: 4
				});
			}
		
		if (jQuery('ul#myRoundabout').length) {
				jQuery('ul#myRoundabout').roundabout({
						btnNext: '#next',
         				btnPrev: '#previous'
					});
			}
			
			
		
	/* End load scripts*/
	
	/* Sidebar tabs */
	
	/**/
	
	var tabsContent = jQuery('.tab_container .block');
	var i = 1;
	var y = 1;
	tabsContent.each (function(){
			jQuery(this).attr('id', 'tab'+i).addClass('tab_content');
			var tabsTitle = jQuery(this).find('div.block-title strong');
			
			jQuery(tabsTitle).appendTo('ul.tabs');
			i++;
		})
	var tabsTitle = jQuery('ul.tabs strong');
	tabsTitle.each(function(){
			jQuery(this).wrap('<li><a href="#tab'+y+'"></a></li>')
			y++;
		})
	/**/
	
	//When page loads...
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab
	jQuery(".tab_content:first").show(); //Show first tab content

	//On Click Event
	jQuery("ul.tabs li").click(function() {

		jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content

		var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	/* End sidebar tabs */
	
	/* Product view tabs */
	
	//When page loads...
	jQuery(".tab_content-2").hide(); //Hide all content
	jQuery("ul.tabs-2 li:first").addClass("active").show(); //Activate first tab
	jQuery(".tab_content-2:first").show(); //Show first tab content

	//On Click Event
	jQuery("ul.tabs-2 li").click(function() {

		jQuery("ul.tabs-2 li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content-2").hide(); //Hide all tab content

		var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	/* End product view tabs */
	
	/* Hover */
	jQuery('.top-cart').hover(function(){
			jQuery(this).find('.block-title a').addClass('active');
			jQuery('#topCartContent').stop().fadeTo(500, 1).addClass('active');
		}, function(){
				jQuery(this).find('.block-title a').removeClass('active');
				jQuery('#topCartContent').fadeTo(400, 0).removeClass('active');
			})
	/* Hover */
	

	/*  */
	jQuery('.cart .totals table td:first-child').addClass('totals-title')
	jQuery ('.block-height').equalHeightColumns();
	/*  */
});

